X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8ad349bb6ed4a0be06e34c92be0d98b92e078db4..4452a7af2eac33dbad800bcc91f2399d62c18f53:/bsd/sys/sysctl.h diff --git a/bsd/sys/sysctl.h b/bsd/sys/sysctl.h index f91d55f74..32d9a4fe8 100644 --- a/bsd/sys/sysctl.h +++ b/bsd/sys/sysctl.h @@ -1,31 +1,29 @@ /* - * Copyright (c) 2006 Apple Computer, Inc. All Rights Reserved. + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * - * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the - * License may not be used to create, or enable the creation or - * redistribution of, unlawful or unlicensed copies of an Apple operating - * system, or to circumvent, violate, or enable the circumvention or - * violation of, any terms of an Apple operating system software license - * agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and * limitations under the License. - * - * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ /* @@ -358,8 +356,10 @@ SYSCTL_DECL(_user); #define KERN_PANICINFO 41 /* node: panic UI information */ #define KERN_SYSV 42 /* node: System V IPC information */ #define KERN_AFFINITY 43 /* xxx */ -#define KERN_CLASSIC 44 /* xxx */ -#define KERN_CLASSICHANDLER 45 /* xxx */ +#define KERN_TRANSLATE 44 /* xxx */ +#define KERN_CLASSIC KERN_TRANSLATE /* XXX backwards compat */ +#define KERN_EXEC 45 /* xxx */ +#define KERN_CLASSICHANDLER KERN_EXEC /* XXX backwards compatibility */ #define KERN_AIOMAX 46 /* int: max aio requests */ #define KERN_AIOPROCMAX 47 /* int: max aio requests per process */ #define KERN_AIOTHREADS 48 /* int: max aio worker threads */ @@ -375,8 +375,12 @@ SYSCTL_DECL(_user); #define KERN_LOW_PRI_WINDOW 56 /* int: set/reset throttle window - milliseconds */ #define KERN_LOW_PRI_DELAY 57 /* int: set/reset throttle delay - milliseconds */ #define KERN_POSIX 58 /* node: posix tunables */ -#define KERN_USRSTACK64 59 /* LP64 user stack query */ -#define KERN_MAXID 60 /* number of valid kern ids */ +#define KERN_USRSTACK64 59 /* LP64 user stack query */ +#define KERN_NX_PROTECTION 60 /* int: whether no-execute protection is enabled */ +#define KERN_TFP 61 /* Task for pid settings */ +#define KERN_PROCNAME 62 /* setup process program name(2*MAXCOMLEN) */ +#define KERN_THALTSTACK 63 /* setup process to have per thread sigaltstack */ +#define KERN_MAXID 64 /* number of valid kern ids */ #if defined(__LP64__) #define KERN_USRSTACK KERN_USRSTACK64 @@ -384,6 +388,16 @@ SYSCTL_DECL(_user); #define KERN_USRSTACK KERN_USRSTACK32 #endif +/* KERN_TFP types */ +#define KERN_TFP_POLICY 1 +#define KERN_TFP_READ_GROUP 2 +#define KERN_TFP_RW_GROUP 3 + +/* KERN_TFP_POLICY values . All policies allow task port for self */ +#define KERN_TFP_POLICY_DENY 0 /* Deny Mode: None allowed except privileged */ +#define KERN_TFP_POLICY_PERMISSIVE 1 /* Permissive Mode: related ones allowed or privileged */ +#define KERN_TFP_POLICY_RESTRICTED 2 /* Restricted Mode: privileged or setgid and realted */ + /* KERN_KDEBUG types */ #define KERN_KDEFLAGS 1 #define KERN_KDDFLAGS 2 @@ -477,7 +491,7 @@ SYSCTL_DECL(_user); { "sysv", CTLTYPE_NODE }, \ { "dummy", CTLTYPE_INT }, \ { "dummy", CTLTYPE_INT }, \ - { "dummy", CTLTYPE_INT }, \ + { "exec", CTLTYPE_NODE }, \ { "aiomax", CTLTYPE_INT }, \ { "aioprocmax", CTLTYPE_INT }, \ { "aiothreads", CTLTYPE_INT }, \ @@ -490,7 +504,12 @@ SYSCTL_DECL(_user); { "proc_low_pri_io", CTLTYPE_INT }, \ { "low_pri_window", CTLTYPE_INT }, \ { "low_pri_delay", CTLTYPE_INT }, \ - { "posix", CTLTYPE_NODE } \ + { "posix", CTLTYPE_NODE }, \ + { "usrstack64", CTLTYPE_QUAD }, \ + { "nx", CTLTYPE_INT }, \ + { "tfp", CTLTYPE_NODE }, \ + { "procname", CTLTYPE_STRING }, \ + { "threadsigaltstack", CTLTYPE_INT } \ } /* @@ -572,10 +591,6 @@ struct kinfo_proc { * WARNING - keep in sync with _pcred */ -#if __DARWIN_ALIGN_NATURAL -#pragma options align=natural -#endif - struct user_pcred { char pc_lock[72]; /* opaque content */ user_addr_t pc_ucred; /* Current credentials. */ @@ -583,7 +598,7 @@ struct user_pcred { uid_t p_svuid; /* Saved effective user id. */ gid_t p_rgid; /* Real group id. */ gid_t p_svgid; /* Saved effective group id. */ - int p_refcnt; /* Number of references. */ + int p_refcnt __attribute((aligned(8))); /* Number of references. */ }; /* LP64 version of kinfo_proc. all pointers @@ -603,7 +618,7 @@ struct user_kinfo_proc { short e_jobc; /* job control counter */ dev_t e_tdev; /* controlling tty dev */ pid_t e_tpgid; /* tty process group id */ - user_addr_t e_tsess; /* tty session pointer */ + user_addr_t e_tsess __attribute((aligned(8))); /* tty session pointer */ char e_wmesg[WMESGLEN+1]; /* wchan message */ segsz_t e_xsize; /* text size */ short e_xrssize; /* text rss */ @@ -615,10 +630,6 @@ struct user_kinfo_proc { } kp_eproc; }; -#if __DARWIN_ALIGN_NATURAL -#pragma options align=reset -#endif - #endif /* BSD_KERNEL_PRIVATE */ #endif /* __APPLE_API_UNSTABLE */ @@ -679,18 +690,11 @@ extern struct loadavg averunnable; // LP64todo - should this move? #ifdef BSD_KERNEL_PRIVATE -#if __DARWIN_ALIGN_NATURAL -#pragma options align=natural -#endif struct user_loadavg { fixpt_t ldavg[3]; - user_long_t fscale; + user_long_t fscale __attribute((aligned(8))); }; -#if __DARWIN_ALIGN_NATURAL -#pragma options align=reset -#endif - #endif /* BSD_KERNEL_PRIVATE */ #endif /* __APPLE_API_PRIVATE */ @@ -807,9 +811,11 @@ struct user_loadavg { * hw.l3cachesize - * * - * These are the selectors for optional processor features. Selectors that return errors are not support on the system. - * Supported features will return 1 if they are recommended or 0 if they are supported but are not expected to help performance. - * Future versions of these selectors may return larger values as necessary so it is best to test for non zero. + * These are the selectors for optional processor features for specific processors. Selectors that return errors are not support + * on the system. Supported features will return 1 if they are recommended or 0 if they are supported but are not expected to help . + * performance. Future versions of these selectors may return larger values as necessary so it is best to test for non zero. + * + * For PowerPC: * * hw.optional.floatingpoint - Floating Point Instructions * hw.optional.altivec - AltiVec Instructions @@ -821,6 +827,14 @@ struct user_loadavg { * hw.optional.datastreams - Data Streams Instructions * hw.optional.dcbtstreams - Data Cache Block Touch Steams Instruction Form * + * For x86 Architecture: + * + * hw.optional.floatingpoint - Floating Point Instructions + * hw.optional.mmx - Original MMX vector instructions + * hw.optional.sse - Streaming SIMD Extensions + * hw.optional.sse2 - Streaming SIMD Extensions 2 + * hw.optional.sse3 - Streaming SIMD Extensions 3 + * hw.optional.x86_64 - 64-bit support */