]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/table.h
xnu-344.49.tar.gz
[apple/xnu.git] / bsd / sys / table.h
1 /*
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Mach Operating System
27 * Copyright (c) 1986 Carnegie-Mellon University
28 * All rights reserved. The CMU software License Agreement specifies
29 * the terms and conditions for use and redistribution.
30 */
31
32 #ifndef _SYS_TABLE_
33 #define _SYS_TABLE_
34
35 #include <sys/appleapiopts.h>
36
37 #warning obsolete header! Please delete the include from your sources.
38
39 #ifdef KERNEL_PRIVATE
40
41 #ifdef __APPLE_API_OBSOLETE
42 #include <sys/dkstat.h>
43 #include <machine/table.h>
44
45 #define TBL_LOADAVG 3 /* (no index) */
46 #define TBL_ARGUMENTS 6 /* index by process ID */
47 #define TBL_PROCINFO 10 /* index by proc table slot */
48 #define TBL_MACHFACTOR 11 /* index by cpu number */
49 #define TBL_CPUINFO 12 /* (no index), generic CPU info */
50
51 /*
52 * Machine specific table id base
53 */
54 #define TBL_MACHDEP_BASE 0x4000 /* Machine dependent codes start here */
55
56 /*
57 * Return codes from machine dependent calls
58 */
59 #define TBL_MACHDEP_NONE 0 /* Not handled by machdep code */
60 #define TBL_MACHDEP_OKAY 1 /* Handled by machdep code */
61 #define TBL_MACHDEP_BAD -1 /* Bad status from machdep code */
62
63
64
65 /*
66 * TBL_LOADAVG data layout
67 * (used by TBL_MACHFACTOR too)
68 */
69 struct tbl_loadavg
70 {
71 long tl_avenrun[3];
72 int tl_lscale; /* 0 scale when floating point */
73 };
74
75 /*
76 * TBL_PROCINFO data layout
77 */
78 #define PI_COMLEN 19 /* length of command string */
79 struct tbl_procinfo
80 {
81 int pi_uid; /* user ID */
82 int pi_pid; /* proc ID */
83 int pi_ppid; /* parent proc ID */
84 int pi_pgrp; /* proc group ID */
85 int pi_ttyd; /* controlling terminal number */
86 int pi_status; /* process status: */
87 #define PI_EMPTY 0 /* no process */
88 #define PI_ACTIVE 1 /* active process */
89 #define PI_EXITING 2 /* exiting */
90 #define PI_ZOMBIE 3 /* zombie */
91 int pi_flag; /* other random flags */
92 char pi_comm[PI_COMLEN+1];
93 /* short command name */
94 };
95
96 /*
97 * TBL_CPUINFO data layout
98 */
99 struct tbl_cpuinfo
100 {
101 int ci_swtch; /* # context switches */
102 int ci_intr; /* # interrupts */
103 int ci_syscall; /* # system calls */
104 int ci_traps; /* # system traps */
105 int ci_hz; /* # ticks per second */
106 int ci_phz; /* profiling hz */
107 int ci_cptime[CPUSTATES]; /* cpu state times */
108 };
109
110
111
112 #ifdef KERNEL
113 /*
114 * Machine specific procedure prototypes.
115 */
116 int machine_table(int id, int index, caddr_t addr, int nel, u_int lel, int set);
117 int machine_table_setokay(int id);
118 #endif /* KERNEL */
119
120 #endif /* __APPLE_API_OBSOLETE */
121
122 #endif /* KERNEL_PRIVATE */
123 #endif /* _SYS_TABLE_ */
124