1 module tango.sys.darwin.consts.sysctl;
2 enum SysCtl{
3 CTL_MAXNAME = 12 , /* largest number of components supported */
4     /+
5      + Each subsystem defined by sysctl defines a list of variables
6      + for that subsystem. Each name is either a node with further
7      + levels defined below it, or it is a leaf of some particular
8      + type given below. Each sysctl level defines a set of name/type
9      + pairs to be used by sysctl(1) in manipulating the subsystem.
10      +
11      + When declaring new sysctl names, please use the 0x00800000
12      + flag in the type to indicate that all necessary locking will
13      + be handled within the sysctl. Any sysctl defined without
14      + 0x00800000 is considered legacy and will be protected by
15      + both the kernel funnel and the sysctl memlock. This is not
16      + optimal, so it is best to handle locking yourself.
17      +/
18 CTLTYPE = 0xf , /* Mask for the type */
19 CTLTYPE_NODE = 1 , /* name is a node */
20 CTLTYPE_INT = 2 , /* name describes an integer */
21 CTLTYPE_STRING = 3, /* name describes a string */
22 CTLTYPE_QUAD = 4 , /* name describes a 64-bit number */
23 CTLTYPE_OPAQUE = 5, /* name describes a structure */
24 CTLTYPE_STRUCT = 5, /* name describes a structure */
25 CTLFLAG_RD = 0x80000000 , /* Allow reads of variable */
26 CTLFLAG_WR = 0x40000000 , /* Allow writes to the variable */
27 CTLFLAG_RW = (0x80000000|0x40000000) ,
28 CTLFLAG_NOLOCK = 0x20000000 , /* XXX Don't Lock */
29 CTLFLAG_ANYBODY = 0x10000000, /* All users can set this var */
30 CTLFLAG_SECURE = 0x08000000 , /* Permit set only if securelevel<=0 */
31 CTLFLAG_MASKED = 0x04000000 , /* deprecated variable, do not display */
32 CTLFLAG_NOAUTO = 0x02000000 , /* do not auto-register */
33 CTLFLAG_KERN = 0x01000000 , /* valid inside the kernel */
34 CTLFLAG_LOCKED = 0x00800000 , /* node will handle locking itself (highly encouraged) */
35     /*
36      * USE THIS instead of a hardwired number from the categories below
37      * to get dynamically assigned sysctl entries using the linker-set
38      * technology. This is the way nearly all new sysctl variables should
39      * be implemented.
40      *
41      * e.g. SYSCTL_INT(_parent, OID_AUTO, name, CTLFLAG_RW, &variable, 0, "");
42      *
43      * Note that linker set technology will automatically register all nodes
44      * declared like this on kernel initialization, UNLESS they are defined
45      * in I/O-Kit. In this case, you have to call sysctl_register_oid()
46      * manually - just like in a KEXT.
47      */
48 OID_AUTO = (-1) ,
49 OID_AUTO_START = 100, /* conventional */
50     /*
51      * Top-level identifiers
52      */
53 CTL_UNSPEC = 0 , /* unused */
54 CTL_KERN = 1 , /* "high kernel": proc, limits */
55 CTL_VM = 2 , /* virtual memory */
56 CTL_VFS = 3 , /* file system, mount type is next */
57 CTL_NET = 4 , /* network, see socket.h */
58 CTL_DEBUG = 5 , /* debugging parameters */
59 CTL_HW = 6 , /* generic cpu/io */
60 CTL_MACHDEP = 7, /* machine dependent */
61 CTL_USER = 8 , /* user-level */
62 CTL_MAXID = 9 , /* number of valid top-level ids */
63     /*
64      * CTL_KERN identifiers
65      */
66 KERN_OSTYPE = 1 , /* string: system version */
67 KERN_OSRELEASE = 2 , /* string: system release */
68 KERN_OSREV = 3 , /* int: system revision */
69 KERN_VERSION = 4 , /* string: compile time info */
70 KERN_MAXVNODES = 5 , /* int: max vnodes */
71 KERN_MAXPROC = 6 , /* int: max processes */
72 KERN_MAXFILES = 7 , /* int: max open files */
73 KERN_ARGMAX = 8 , /* int: max arguments to exec */
74 KERN_SECURELVL = 9 , /* int: system security level */
75 KERN_HOSTNAME = 10 , /* string: hostname */
76 KERN_HOSTID = 11 , /* int: host identifier */
77 KERN_CLOCKRATE = 12 , /* struct: struct clockrate */
78 KERN_VNODE = 13 , /* struct: vnode structures */
79 KERN_PROC = 14 , /* struct: process entries */
80 KERN_FILE = 15 , /* struct: file entries */
81 KERN_PROF = 16 , /* node: kernel profiling info */
82 KERN_POSIX1 = 17 , /* int: POSIX.1 version */
83 KERN_NGROUPS = 18 , /* int: # of supplemental group ids */
84 KERN_JOB_CONTROL = 19 , /* int: is job control available */
85 KERN_SAVED_IDS = 20 , /* int: saved set-user/group-ID */
86 KERN_BOOTTIME = 21 , /* struct: time kernel was booted */
87 KERN_NISDOMAINNAME = 22 , /* string: YP domain name */
88 KERN_DOMAINNAME = 22 ,
89 KERN_MAXPARTITIONS = 23 , /* int: number of partitions/disk */
90 KERN_KDEBUG = 24 , /* int: kernel trace points */
91 KERN_UPDATEINTERVAL = 25 , /* int: update process sleep time */
92 KERN_OSRELDATE = 26 , /* int: OS release date */
93 KERN_NTP_PLL = 27 , /* node: NTP PLL control */
94 KERN_BOOTFILE = 28 , /* string: name of booted kernel */
95 KERN_MAXFILESPERPROC = 29 , /* int: max open files per proc */
96 KERN_MAXPROCPERUID = 30 , /* int: max processes per uid */
97 KERN_DUMPDEV = 31 , /* dev_t: device to dump on */
98 KERN_IPC = 32 , /* node: anything related to IPC */
99 KERN_DUMMY = 33 , /* unused */
100 KERN_PS_STRINGS = 34 , /* int: address of PS_STRINGS */
101 KERN_USRSTACK32 = 35 , /* int: address of USRSTACK */
102 KERN_LOGSIGEXIT = 36 , /* int: do we log sigexit procs? */
103 KERN_SYMFILE = 37 , /* string: kernel symbol filename */
104 KERN_PROCARGS = 38 , /* was KERN_PCSAMPLES... now deprecated */
105 KERN_NETBOOT = 40 , /* int: are we netbooted? 1=yes,0=no */
106 KERN_PANICINFO = 41 , /* node: panic UI information */
107 KERN_SYSV = 42 , /* node: System V IPC information */
108 KERN_AFFINITY = 43 , /* xxx */
109 KERN_TRANSLATE = 44 , /* xxx */
110 KERN_CLASSIC = 44 , /* XXX backwards compat */
111 KERN_EXEC = 45 , /* xxx */
112 KERN_CLASSICHANDLER = 45 , /* XXX backwards compatibility */
113 KERN_AIOMAX = 46 , /* int: max aio requests */
114 KERN_AIOPROCMAX = 47 , /* int: max aio requests per process */
115 KERN_AIOTHREADS = 48 , /* int: max aio worker threads */
116 KERN_COREFILE = 50 , /* string: corefile format string */
117 KERN_COREDUMP = 51 , /* int: whether to coredump at all */
118 KERN_SUGID_COREDUMP = 52 , /* int: whether to dump SUGID cores */
119 KERN_PROCDELAYTERM = 53 , /* int: set/reset current proc for delayed termination during shutdown */
120 KERN_SHREG_PRIVATIZABLE = 54, /* int: can shared regions be privatized ? */
121 KERN_PROC_LOW_PRI_IO = 55 , /* int: set/reset current proc for low priority I/O */
122 KERN_LOW_PRI_WINDOW = 56 , /* int: set/reset throttle window - milliseconds */
123 KERN_LOW_PRI_DELAY = 57 , /* int: set/reset throttle delay - milliseconds */
124 KERN_POSIX = 58 , /* node: posix tunables */
125 KERN_USRSTACK64 = 59 , /* LP64 user stack query */
126 KERN_NX_PROTECTION = 60 , /* int: whether no-execute protection is enabled */
127 KERN_TFP = 61 , /* Task for pid settings */
128 KERN_PROCNAME = 62 , /* setup process program  name(2*MAXCOMLEN) */
129 KERN_THALTSTACK = 63 , /* for compat with older x86 and does nothing */
130 KERN_SPECULATIVE_READS = 64 , /* int: whether speculative reads are disabled */
131 KERN_OSVERSION = 65 , /* for build number i.e. 9A127 */
132 KERN_SAFEBOOT = 66 , /* are we booted safe? */
133 KERN_LCTX = 67 , /* node: login context */
134 KERN_RAGEVNODE = 68 ,
135 KERN_TTY = 69 , /* node: tty settings */
136 KERN_CHECKOPENEVT = 70 , /* spi: check the VOPENEVT flag on vnodes at open time */
137 KERN_MAXID = 71 , /* number of valid kern ids */
138     /*                                                  ,
139      * Don't add any more sysctls like this.  Instead, use the SYSCTL_*() macros
140      * and OID_AUTO. This will have the added benefit of not having to recompile
141      * sysctl(8) to pick up your changes.
142      */
143     /* KERN_RAGEVNODE types */
144 KERN_RAGE_PROC = 1 ,
145 KERN_RAGE_THREAD = 2 ,
146 KERN_UNRAGE_PROC = 3 ,
147 KERN_UNRAGE_THREAD = 4 ,
148     /* KERN_OPENEVT types */
149 KERN_OPENEVT_PROC = 1 ,
150 KERN_UNOPENEVT_PROC = 2 ,
151     /* KERN_TFP types */
152 KERN_TFP_POLICY = 1 ,
153     /* KERN_TFP_POLICY values . All policies allow task port for self */
154 KERN_TFP_POLICY_DENY = 0, /* Deny Mode: None allowed except privileged */
155 KERN_TFP_POLICY_DEFAULT = 2, /* Default  Mode: related ones allowed and upcall authentication */
156     /* KERN_KDEBUG types */
157 KERN_KDEFLAGS = 1 ,
158 KERN_KDDFLAGS = 2 ,
159 KERN_KDENABLE = 3 ,
160 KERN_KDSETBUF = 4 ,
161 KERN_KDGETBUF = 5 ,
162 KERN_KDSETUP = 6 ,
163 KERN_KDREMOVE = 7 ,
164 KERN_KDSETREG = 8 ,
165 KERN_KDGETREG = 9 ,
166 KERN_KDREADTR = 10 ,
167 KERN_KDPIDTR = 11 ,
168 KERN_KDTHRMAP = 12 ,
169 KERN_KDPIDEX = 14 ,
170 KERN_KDSETRTCDEC = 15 ,
171 KERN_KDGETENTROPY = 16 ,
172     /* KERN_PANICINFO types */
173 KERN_PANICINFO_MAXSIZE = 1 , /* quad: panic UI image size limit */
174 KERN_PANICINFO_IMAGE = 2 , /* panic UI in 8-bit kraw format */
175     /* 
176      * KERN_PROC subtypes
177      */
178 KERN_PROC_ALL = 0 , /* everything */
179 KERN_PROC_PID = 1 , /* by process id */
180 KERN_PROC_PGRP = 2 , /* by process group id */
181 KERN_PROC_SESSION = 3 , /* by session of pid */
182 KERN_PROC_TTY = 4 , /* by controlling tty */
183 KERN_PROC_UID = 5 , /* by effective uid */
184 KERN_PROC_RUID = 6 , /* by real uid */
185 KERN_PROC_LCID = 7 , /* by login context id */
186     /*
187      * KERN_LCTX subtypes
188      */
189 KERN_LCTX_ALL = 0 , /* everything */
190 KERN_LCTX_LCID = 1 , /* by login context id */
191     /*
192      * KERN_IPC identifiers
193      */
194 KIPC_MAXSOCKBUF = 1 , /* int: max size of a socket buffer */
195 KIPC_SOCKBUF_WASTE = 2 , /* int: wastage factor in sockbuf */
196 KIPC_SOMAXCONN = 3 , /* int: max length of connection q */
197 KIPC_MAX_LINKHDR = 4 , /* int: max length of link header */
198 KIPC_MAX_PROTOHDR = 5 , /* int: max length of network header */
199 KIPC_MAX_HDR = 6 , /* int: max total length of headers */
200 KIPC_MAX_DATALEN = 7 , /* int: max length of data? */
201 KIPC_MBSTAT = 8 , /* struct: mbuf usage statistics */
202 KIPC_NMBCLUSTERS = 9 , /* int: maximum mbuf clusters */
203 KIPC_SOQLIMITCOMPAT = 10 , /* int: socket queue limit */
204     /*
205      * CTL_VM identifiers
206      */
207 VM_METER = 1 , /* struct vmmeter */
208 VM_LOADAVG = 2 , /* struct loadavg */
209     /*
210      * Note: "3" was skipped sometime ago and should probably remain unused
211      * to avoid any new entry from being accepted by older kernels...
212      */
213 VM_MACHFACTOR = 4 , /* struct loadavg with mach factor*/
214 VM_SWAPUSAGE = 5 , /* total swap usage */
215 VM_MAXID = 6 , /* number of valid vm ids */
216     /*
217      * CTL_HW identifiers
218      */
219 HW_MACHINE = 1 , /* string: machine class */
220 HW_MODEL = 2 , /* string: specific machine model */
221 HW_NCPU = 3 , /* int: number of cpus */
222 HW_BYTEORDER = 4 , /* int: machine byte order */
223 HW_PHYSMEM = 5 , /* int: total memory */
224 HW_USERMEM = 6 , /* int: non-kernel memory */
225 HW_PAGESIZE = 7 , /* int: software page size */
226 HW_DISKNAMES = 8 , /* strings: disk drive names */
227 HW_DISKSTATS = 9 , /* struct: diskstats[] */
228 HW_EPOCH = 10 , /* int: 0 for Legacy, else NewWorld */
229 HW_FLOATINGPT = 11 , /* int: has HW floating point? */
230 HW_MACHINE_ARCH = 12 , /* string: machine architecture */
231 HW_VECTORUNIT = 13 , /* int: has HW vector unit? */
232 HW_BUS_FREQ = 14 , /* int: Bus Frequency */
233 HW_CPU_FREQ = 15 , /* int: CPU Frequency */
234 HW_CACHELINE = 16 , /* int: Cache Line Size in Bytes */
235 HW_L1ICACHESIZE = 17 , /* int: L1 I Cache Size in Bytes */
236 HW_L1DCACHESIZE = 18 , /* int: L1 D Cache Size in Bytes */
237 HW_L2SETTINGS = 19 , /* int: L2 Cache Settings */
238 HW_L2CACHESIZE = 20 , /* int: L2 Cache Size in Bytes */
239 HW_L3SETTINGS = 21 , /* int: L3 Cache Settings */
240 HW_L3CACHESIZE = 22 , /* int: L3 Cache Size in Bytes */
241 HW_TB_FREQ = 23 , /* int: Bus Frequency */
242 HW_MEMSIZE = 24 , /* uint64_t: physical ram size */
243 HW_AVAILCPU = 25 , /* int: number of available CPUs */
244 HW_MAXID = 26 , /* number of valid hw ids */
245     /*
246      * XXX This information should be moved to the man page.
247      *
248      * These are the support HW selectors for sysctlbyname.  Parameters that are byte counts or frequencies are 64 bit numbers.
249      * All other parameters are 32 bit numbers.
250      *
251      *   hw.memsize                - The number of bytes of physical memory in the system.
252      *
253      *   hw.ncpu                   - The maximum number of processors that could be available this boot.
254      *                               Use this value for sizing of static per processor arrays; i.e. processor load statistics.
255      *
256      *   hw.activecpu              - The number of processors currently available for executing threads.
257      *                               Use this number to determine the number threads to create in SMP aware applications.
258      *                               This number can change when power management modes are changed.
259      *
260      *   hw.physicalcpu            - The number of physical processors available in the current power management mode.
261      *   hw.physicalcpu_max        - The maximum number of physical processors that could be available this boot
262      *
263      *   hw.logicalcpu             - The number of logical processors available in the current power management mode.
264      *   hw.logicalcpu_max         - The maximum number of logical processors that could be available this boot
265      *
266      *   hw.tbfrequency            - This gives the time base frequency used by the OS and is the basis of all timing services.
267      *                               In general is is better to use mach's or higher level timing services, but this value
268      *                               is needed to convert the PPC Time Base registers to real time.
269      *
270      *   hw.cpufrequency           - These values provide the current, min and max cpu frequency.  The min and max are for
271      *   hw.cpufrequency_max       - all power management modes.  The current frequency is the max frequency in the current mode.
272      *   hw.cpufrequency_min       - All frequencies are in Hz.
273      *
274      *   hw.busfrequency           - These values provide the current, min and max bus frequency.  The min and max are for
275      *   hw.busfrequency_max       - all power management modes.  The current frequency is the max frequency in the current mode.
276      *   hw.busfrequency_min       - All frequencies are in Hz.
277      *
278      *   hw.cputype                - These values provide the mach-o cpu type and subtype.  A complete list is in <mach/machine.h>
279      *   hw.cpusubtype             - These values should be used to determine what processor family the running cpu is from so that
280      *                               the best binary can be chosen, or the best dynamic code generated.  They should not be used
281      *                               to determine if a given processor feature is available.
282      *   hw.cputhreadtype          - This value will be present if the processor supports threads.  Like hw.cpusubtype this selector
283      *                               should not be used to infer features, and only used to name the processors thread architecture.
284      *                               The values are defined in <mach/machine.h>
285      *
286      *   hw.byteorder              - Gives the byte order of the processor.  4321 for big endian, 1234 for little.
287      *
288      *   hw.pagesize               - Gives the size in bytes of the pages used by the processor and VM system.
289      *
290      *   hw.cachelinesize          - Gives the size in bytes of the processor's cache lines.
291      *                               This value should be use to control the strides of loops that use cache control instructions
292      *                               like dcbz, dcbt or dcbst.
293      *
294      *   hw.l1dcachesize           - These values provide the size in bytes of the L1, L2 and L3 caches.  If a cache is not present
295      *   hw.l1icachesize           - then the selector will return and error.
296      *   hw.l2cachesize            -
297      *   hw.l3cachesize            -
298      *
299      *   hw.packages               - Gives the number of processor packages.
300      *
301      * These are the selectors for optional processor features for specific processors.  Selectors that return errors are not support 
302      * on the system.  Supported features will return 1 if they are recommended or 0 if they are supported but are not expected to help .
303      * performance.  Future versions of these selectors may return larger values as necessary so it is best to test for non zero.
304      *
305      * For PowerPC:
306      *
307      *   hw.optional.floatingpoint - Floating Point Instructions
308      *   hw.optional.altivec       - AltiVec Instructions
309      *   hw.optional.graphicsops   - Graphics Operations
310      *   hw.optional.64bitops      - 64-bit Instructions
311      *   hw.optional.fsqrt         - HW Floating Point Square Root Instruction
312      *   hw.optional.stfiwx        - Store Floating Point as Integer Word Indexed Instructions
313      *   hw.optional.dcba          - Data Cache Block Allocate Instruction
314      *   hw.optional.datastreams   - Data Streams Instructions
315      *   hw.optional.dcbtstreams   - Data Cache Block Touch Steams Instruction Form
316      *
317      * For x86 Architecture:
318      * 
319      *   hw.optional.floatingpoint     - Floating Point Instructions
320      *   hw.optional.mmx               - Original MMX vector instructions
321      *   hw.optional.sse               - Streaming SIMD Extensions
322      *   hw.optional.sse2              - Streaming SIMD Extensions 2
323      *   hw.optional.sse3              - Streaming SIMD Extensions 3
324      *   hw.optional.supplementalsse3  - Supplemental Streaming SIMD Extensions 3
325      *   hw.optional.x86_64            - 64-bit support
326      */
327     /*
328      * CTL_USER definitions
329      */
330 USER_CS_PATH = 1 , /* string: _CS_PATH */
331 USER_BC_BASE_MAX = 2 , /* int: BC_BASE_MAX */
332 USER_BC_DIM_MAX = 3 , /* int: BC_DIM_MAX */
333 USER_BC_SCALE_MAX = 4 , /* int: BC_SCALE_MAX */
334 USER_BC_STRING_MAX = 5 , /* int: BC_STRING_MAX */
335 USER_COLL_WEIGHTS_MAX = 6 , /* int: COLL_WEIGHTS_MAX */
336 USER_EXPR_NEST_MAX = 7 , /* int: EXPR_NEST_MAX */
337 USER_LINE_MAX = 8 , /* int: LINE_MAX */
338 USER_RE_DUP_MAX = 9 , /* int: RE_DUP_MAX */
339 USER_POSIX2_VERSION = 10 , /* int: POSIX2_VERSION */
340 USER_POSIX2_C_BIND = 11 , /* int: POSIX2_C_BIND */
341 USER_POSIX2_C_DEV = 12 , /* int: POSIX2_C_DEV */
342 USER_POSIX2_CHAR_TERM = 13 , /* int: POSIX2_CHAR_TERM */
343 USER_POSIX2_FORT_DEV = 14 , /* int: POSIX2_FORT_DEV */
344 USER_POSIX2_FORT_RUN = 15 , /* int: POSIX2_FORT_RUN */
345 USER_POSIX2_LOCALEDEF = 16 , /* int: POSIX2_LOCALEDEF */
346 USER_POSIX2_SW_DEV = 17 , /* int: POSIX2_SW_DEV */
347 USER_POSIX2_UPE = 18 , /* int: POSIX2_UPE */
348 USER_STREAM_MAX = 19 , /* int: POSIX2_STREAM_MAX */
349 USER_TZNAME_MAX = 20 , /* int: POSIX2_TZNAME_MAX */
350 USER_MAXID = 21 , /* number of valid user ids */
351     /*
352      * CTL_DEBUG definitions
353      *
354      * Second level identifier specifies which debug variable.
355      * Third level identifier specifies which stucture component.
356      */
357 CTL_DEBUG_NAME = 0 , /* string: variable name */
358 CTL_DEBUG_VALUE = 1 , /* int: variable value */
359 CTL_DEBUG_MAXID = 20 ,
360 }
361 enum {KERN_USRSTACK=35}