]>
git.cameronkatri.com Git - apple_cmds.git/blob - system_cmds/lskq.tproj/common.h
2 * Copyright (c) 2015 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #ifndef _LSKQ_COMMON_H_
25 #define _LSKQ_COMMON_H_
30 #if __has_attribute(enum_extensibility)
31 #define __enum_open __attribute__((__enum_extensibility__(open)))
32 #define __enum_closed __attribute__((__enum_extensibility__(closed)))
36 #endif // __has_attribute(enum_extensibility)
39 #ifndef __enum_options
40 #if __has_attribute(flag_enum)
41 #define __enum_options __attribute__((__flag_enum__))
43 #define __enum_options
48 #define __enum_decl(_name, _type, ...) \
49 typedef _type _name; enum __VA_ARGS__ __enum_open
50 #define __options_decl(_name, _type, ...) \
51 typedef _type _name; enum __VA_ARGS__ __enum_open __enum_options
55 * This file must be kept in sync with xnu headers
61 __options_decl(kn_status_t
, uint16_t /* 12 bits really */, {
62 KN_ACTIVE
= 0x001, /* event has been triggered */
63 KN_QUEUED
= 0x002, /* event is on queue */
64 KN_DISABLED
= 0x004, /* event is disabled */
65 KN_DROPPING
= 0x008, /* knote is being dropped */
66 KN_LOCKED
= 0x010, /* knote is locked (kq_knlocks) */
67 KN_POSTING
= 0x020, /* f_event() in flight */
68 KN_STAYACTIVE
= 0x040, /* force event to stay active */
69 KN_DEFERDELETE
= 0x080, /* defer delete until re-enabled */
70 KN_MERGE_QOS
= 0x100, /* f_event() / f_* ran concurrently and overrides must merge */
71 KN_REQVANISH
= 0x200, /* requested EV_VANISH */
72 KN_VANISHED
= 0x400, /* has vanished */
73 KN_SUPPRESSED
= 0x800, /* event is suppressed during delivery */
79 __options_decl(kq_state_t
, uint16_t, {
80 KQ_SEL
= 0x0001, /* select was recorded for kq */
81 KQ_SLEEP
= 0x0002, /* thread is waiting for events */
82 KQ_PROCWAIT
= 0x0004, /* thread waiting for processing */
83 KQ_KEV32
= 0x0008, /* kq is used with 32-bit events */
84 KQ_KEV64
= 0x0010, /* kq is used with 64-bit events */
85 KQ_KEV_QOS
= 0x0020, /* kq events carry QoS info */
86 KQ_WORKQ
= 0x0040, /* KQ is bound to process workq */
87 KQ_WORKLOOP
= 0x0080, /* KQ is part of a workloop */
88 KQ_PROCESSING
= 0x0100, /* KQ is being processed */
89 KQ_DRAIN
= 0x0200, /* kq is draining */
90 KQ_WAKEUP
= 0x0400, /* kq awakened while processing */
91 KQ_DYNAMIC
= 0x0800, /* kqueue is dynamically managed */
92 KQ_R2K_ARMED
= 0x1000, /* ast notification armed */
93 KQ_HAS_TURNSTILE
= 0x2000, /* this kqueue has a turnstile */
97 * bsd/pthread/workqueue_internal.h
99 __enum_decl(workq_tr_state_t
, uint8_t, {
100 WORKQ_TR_STATE_IDLE
= 0, /* request isn't in flight */
101 WORKQ_TR_STATE_NEW
= 1, /* request is being initiated */
102 WORKQ_TR_STATE_QUEUED
= 2, /* request is being queued */
103 WORKQ_TR_STATE_CANCELED
= 3, /* request is canceled */
104 WORKQ_TR_STATE_BINDING
= 4, /* request is preposted for bind */
105 WORKQ_TR_STATE_BOUND
= 5, /* request is bound to a thread */
149 * bsd/sys/event.h: EVFILT_*
174 * bsd/sys/proc_info.h: PROX_FDTYPE_*
192 #endif /* _LSKQ_COMMON_H_ */