]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/table.h
xnu-517.3.7.tar.gz
[apple/xnu.git] / bsd / sys / table.h
CommitLineData
1c79356b 1/*
9bccf70c 2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
43866e37 6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1c79356b 7 *
43866e37
A
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
1c79356b
A
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
43866e37
A
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.
1c79356b
A
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 */
1c79356b
A
31
32#ifndef _SYS_TABLE_
33#define _SYS_TABLE_
34
9bccf70c
A
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
1c79356b
A
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 */
69struct 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 */
79struct 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 */
99struct 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 */
116int machine_table(int id, int index, caddr_t addr, int nel, u_int lel, int set);
117int machine_table_setokay(int id);
118#endif /* KERNEL */
119
9bccf70c 120#endif /* __APPLE_API_OBSOLETE */
1c79356b
A
121
122#endif /* KERNEL_PRIVATE */
9bccf70c
A
123#endif /* _SYS_TABLE_ */
124