-/*
- * The general lock structure. Provides for multiple readers,
- * upgrading from read to write, and sleeping until the lock
- * can be gained.
- *
- * On some architectures, assembly language code in the 'inline'
- * program fiddles the lock structures. It must be changed in
- * concert with the structure layout.
- *
- * Only the "interlock" field is used for hardware exclusion;
- * other fields are modified with normal instructions after
- * acquiring the interlock bit.
- */
-#ifdef MACH_KERNEL_PRIVATE
-typedef struct {
- decl_simple_lock_data(,interlock) /* "hardware" interlock field */
- volatile unsigned int
- read_count:16, /* No. of accepted readers */
- want_upgrade:1, /* Read-to-write upgrade waiting */
- want_write:1, /* Writer is waiting, or
- locked for write */
- waiting:1, /* Someone is sleeping on lock */
- can_sleep:1; /* Can attempts to lock go to sleep? */
-#if ETAP_LOCK_TRACE
- union { /* Must be overlaid on the event_tablep */
- struct event_table_chain event_table_chain;
- struct {
- event_table_t event_tablep; /* ptr to event table entry */
- start_data_node_t start_list; /* linked list of start times
- and pcs */
- } s;
- } u;
-#endif /* ETAP_LOCK_TRACE */
-#if ETAP_LOCK_ACCUMULATE
- cbuff_entry_t cbuff_write; /* write cumulative buffer entry */
- cbuff_entry_t cbuff_read; /* read cumulative buffer entry */
-#endif /* ETAP_LOCK_ACCUMULATE */
-} lock_t;