File: os.h

package info (click to toggle)
open-vm-tools 1%3A8.4.2-261024-1
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze
  • size: 20,368 kB
  • ctags: 30,043
  • sloc: ansic: 164,785; sh: 10,713; cpp: 6,525; makefile: 3,386
file content (77 lines) | stat: -rw-r--r-- 2,441 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*********************************************************
 * Copyright (C) 2000 VMware, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation version 2 and no later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 *
 *********************************************************/

/* 
 * os.h --
 *
 * 	Definitions for OS-specific wrapper functions required
 *	by "vmmemctl".  This allows customers to build their own
 *	vmmemctl driver for custom versioned kernels without the
 *	need for source code. 
 */

#ifndef	OS_H
#define	OS_H

/*
 * Needs fixing for 64bit OSes
 */
#ifndef __x86_64__
#define CDECL __attribute__((cdecl, regparm(0)))
#else
#define CDECL
#endif

/*
 * Types
 */

typedef void CDECL (*os_timer_handler)(void *);
typedef int  CDECL (*os_status_handler)(char *);

/*
 * Operations
 */

extern void CDECL *os_kmalloc_nosleep(unsigned int size);
extern void CDECL os_kfree(void *obj, unsigned int size);
extern void CDECL os_yield(void);
extern void CDECL os_bzero(void *s, unsigned int n);
extern void CDECL os_memcpy(void *dest, const void *src, unsigned int size);
extern int  CDECL os_sprintf(char *str, const char *format, ...);

extern unsigned long CDECL os_addr_to_ppn(unsigned long addr);
extern unsigned long CDECL os_alloc_reserved_page(int can_sleep);
extern void          CDECL os_free_reserved_page(unsigned long page);

extern void CDECL os_timer_init(os_timer_handler handler, void *data, int period);
extern void CDECL os_timer_start(void);
extern void CDECL os_timer_stop(void);

extern void CDECL os_init(const char *name,
                          const char *name_verbose,
                          os_status_handler handler);
extern void CDECL os_cleanup(void);

extern char CDECL *os_identity(void);

extern unsigned int CDECL os_predict_max_balloon_pages(void);

extern unsigned int CDECL os_timer_hz(void);

#endif  /* OS_H */