~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to modules/freebsd/vmhgfs/os.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-07-30 12:56:49 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730125649-97sfj5li8axiseoo
Tags: 2009.07.22-179896-2
* Temporarily building without dumbnet, the recently uploaded
  new dumbnet upstream version broke down (Closes: #539006).
* Using more common name to store local debian additions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
/*
21
21
 * os.h --
22
22
 *
23
 
 *   Wrappers for OS specific functions that are different between OS X and FreeBsd.
24
 
 *   1. Implementation OS X / FreeBSD independent memory allocation and
 
23
 *   Wrappers for OS specific functions that are different between Mac OS and FreeBsd.
 
24
 *   1. Implementation Mac OS / FreeBSD independent memory allocation and
25
25
 *   thread synchronization routines.
26
26
 *   2. Interaction with memory manager/pager.
27
27
 */
29
29
#ifndef _OS_H_
30
30
#define _OS_H_
31
31
 
32
 
#if defined(__FreeBSD__)
 
32
#if defined __FreeBSD__
33
33
#  include <sys/param.h>          // for <everything>
34
34
#  include <sys/proc.h>
35
35
#  include <sys/condvar.h>
36
36
#  include <sys/lock.h>           // for struct mtx
37
37
#  include <sys/mutex.h>          // for struct mtx
38
38
#  include <sys/sx.h>
39
 
#elif defined(__APPLE__)
 
39
#elif defined __APPLE__
40
40
#  include <kern/thread.h>
41
41
#  include <kern/locks.h>
42
42
#endif
44
44
#include <sys/malloc.h>
45
45
#include "vm_basic_types.h"
46
46
 
47
 
#if defined(__FreeBSD__)
 
47
#if defined __FreeBSD__
48
48
   typedef struct proc *OS_THREAD_T;
49
49
   typedef struct mtx OS_MUTEX_T;
50
50
   typedef struct sx OS_RWLOCK_T;
51
51
   typedef struct cv OS_CV_T;
52
 
#elif defined(__APPLE__)
 
52
#elif defined __APPLE__
53
53
   typedef thread_t OS_THREAD_T;
54
54
   typedef lck_mtx_t OS_MUTEX_T;
55
55
   typedef lck_rw_t OS_RWLOCK_T;
56
56
   /*
57
 
    * In OS X, a kernel thread waits on a 32-bit integer. To avoid collision,
 
57
    * In Mac OS, a kernel thread waits on a 32-bit integer. To avoid collision,
58
58
    * Apple recommends that threads wait on the address of an object.
59
59
    */
60
60
   typedef void *OS_CV_T;
67
67
void os_cleanup(void);
68
68
 
69
69
/*
70
 
 * There does not seem to be a public zone allocator exposed in OS X. We create
 
70
 * There does not seem to be a public zone allocator exposed in Mac OS. We create
71
71
 * a zone wrapper around the FreeBSD zone allocator so that we can keep the
72
 
 * FreeBSD zone allocator and support OS X at the same time.
 
72
 * FreeBSD zone allocator and support Mac OS at the same time.
73
73
 */
74
74
 
75
75
struct os_zone_struct;
78
78
/*
79
79
 * Provide zone allocator function prototypes with the same signature as
80
80
 * the ones used in the FreeBSD kernel. This way they can be used both with
81
 
 * the FreeBSD uma allocator and the custom mac os allocation functions.
 
81
 * the FreeBSD uma allocator and the custom Mac OS allocation functions.
82
82
 */
83
83
typedef int (*os_zone_ctor)(void *mem, int size, void *arg, int flags);
84
84
typedef void (*os_zone_dtor)(void *mem, int size, void *arg);