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