/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define enaLkDeb 0x00000001 /* Request debug in default attribute */
#define enaLkStat 0x00000002 /* Request statistic in default attribute */
+#define disLkRWPrio 0x00000004 /* Disable RW lock priority promotion */
#endif /* MACH_KERNEL_PRIVATE */
};
uint32_t lck_mtxd_state;
};
-#if defined(__x86_64__)
/* Pad field used as a canary, initialized to ~0 */
uint32_t lck_mtxd_pad32;
-#endif
} lck_mtxd;
struct {
struct _lck_mtx_ext_ *lck_mtxi_ptr;
uint32_t lck_mtxi_tag;
-#if defined(__x86_64__)
uint32_t lck_mtxi_pad32;
-#endif
} lck_mtxi;
} lck_mtx_sw;
} lck_mtx_t;
extern void lck_mtx_lock_mark_destroyed(lck_mtx_t *mutex);
extern int lck_mtx_lock_grab_mutex(lck_mtx_t *mutex);
-extern void hw_lock_byte_init(uint8_t *lock_byte);
-extern void hw_lock_byte_lock(uint8_t *lock_byte);
-extern void hw_lock_byte_unlock(uint8_t *lock_byte);
+extern void hw_lock_byte_init(volatile uint8_t *lock_byte);
+extern void hw_lock_byte_lock(volatile uint8_t *lock_byte);
+extern void hw_lock_byte_unlock(volatile uint8_t *lock_byte);
typedef struct {
unsigned int type;
-#ifdef __x86_64__
unsigned int pad4;
-#endif
vm_offset_t pc;
vm_offset_t thread;
} lck_mtx_deb_t;
lck_mtx_t lck_mtx;
struct _lck_grp_ *lck_mtx_grp;
unsigned int lck_mtx_attr;
-#ifdef __x86_64__
unsigned int lck_mtx_pad1;
-#endif
lck_mtx_deb_t lck_mtx_deb;
uint64_t lck_mtx_stat;
-#ifdef __x86_64__
unsigned int lck_mtx_pad2[2];
-#endif
} lck_mtx_ext_t;
#define LCK_MTX_ATTR_DEBUG 0x1
#define LCK_MTX_ATTR_STAT 0x2
#define LCK_MTX_ATTR_STATb 1
+#define LCK_MTX_EVENT(lck) ((event_t)(((unsigned int*)lck)+(sizeof(lck_mtx_t)-1)/sizeof(unsigned int)))
+
#else /* MACH_KERNEL_PRIVATE */
#ifdef XNU_KERNEL_PRIVATE
typedef struct {
#pragma pack(1) /* Make sure the structure stays as we defined it */
typedef struct _lck_rw_t_internal_ {
volatile uint16_t lck_rw_shared_count; /* No. of accepted readers */
- uint8_t lck_rw_interlock; /* Interlock byte */
+ volatile uint8_t lck_rw_interlock; /* Interlock byte */
volatile uint8_t
lck_rw_priv_excl:1, /* Writers prioritized if set */
lck_rw_want_upgrade:1, /* Read-to-write upgrade waiting */
* are in
*/
uint32_t lck_rw_pad8;
-#ifdef __x86_64__
uint32_t lck_rw_pad12;
-#endif
} lck_rw_t;
#pragma pack()
#pragma pack(1)
typedef struct {
uint32_t opaque[3];
-#ifdef __x86_64__
uint32_t opaque4;
-#endif
} lck_rw_t;
#pragma pack()
#else
#endif
#endif
+#ifdef MACH_KERNEL_PRIVATE
+
+extern void kernel_preempt_check (void);
+
+#endif /* MACH_KERNEL_PRIVATE */
+
#endif /* _I386_LOCKS_H_ */