]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/table.h
xnu-124.13.tar.gz
[apple/xnu.git] / bsd / sys / table.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
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 */
28/*
29 * HISTORY
30 * 27-Apr-97 A.Ramesh
31 * added limited set to MacOSX
32 *
33 * 05-Sep-91 Doug Mitchell at NeXT
34 * Made entire contents PRIVATE.
35 *
36 *
37 */
38
39#ifdef KERNEL_PRIVATE
40
41#ifndef _SYS_TABLE_
42#define _SYS_TABLE_
43
44#include <sys/dkstat.h>
45#include <machine/table.h>
46
47#define TBL_LOADAVG 3 /* (no index) */
48#define TBL_ARGUMENTS 6 /* index by process ID */
49#define TBL_PROCINFO 10 /* index by proc table slot */
50#define TBL_MACHFACTOR 11 /* index by cpu number */
51#define TBL_CPUINFO 12 /* (no index), generic CPU info */
52
53/*
54 * Machine specific table id base
55 */
56#define TBL_MACHDEP_BASE 0x4000 /* Machine dependent codes start here */
57
58/*
59 * Return codes from machine dependent calls
60 */
61#define TBL_MACHDEP_NONE 0 /* Not handled by machdep code */
62#define TBL_MACHDEP_OKAY 1 /* Handled by machdep code */
63#define TBL_MACHDEP_BAD -1 /* Bad status from machdep code */
64
65
66
67/*
68 * TBL_LOADAVG data layout
69 * (used by TBL_MACHFACTOR too)
70 */
71struct tbl_loadavg
72{
73 long tl_avenrun[3];
74 int tl_lscale; /* 0 scale when floating point */
75};
76
77/*
78 * TBL_PROCINFO data layout
79 */
80#define PI_COMLEN 19 /* length of command string */
81struct tbl_procinfo
82{
83 int pi_uid; /* user ID */
84 int pi_pid; /* proc ID */
85 int pi_ppid; /* parent proc ID */
86 int pi_pgrp; /* proc group ID */
87 int pi_ttyd; /* controlling terminal number */
88 int pi_status; /* process status: */
89#define PI_EMPTY 0 /* no process */
90#define PI_ACTIVE 1 /* active process */
91#define PI_EXITING 2 /* exiting */
92#define PI_ZOMBIE 3 /* zombie */
93 int pi_flag; /* other random flags */
94 char pi_comm[PI_COMLEN+1];
95 /* short command name */
96};
97
98/*
99 * TBL_CPUINFO data layout
100 */
101struct tbl_cpuinfo
102{
103 int ci_swtch; /* # context switches */
104 int ci_intr; /* # interrupts */
105 int ci_syscall; /* # system calls */
106 int ci_traps; /* # system traps */
107 int ci_hz; /* # ticks per second */
108 int ci_phz; /* profiling hz */
109 int ci_cptime[CPUSTATES]; /* cpu state times */
110};
111
112
113
114#ifdef KERNEL
115/*
116 * Machine specific procedure prototypes.
117 */
118int machine_table(int id, int index, caddr_t addr, int nel, u_int lel, int set);
119int machine_table_setokay(int id);
120#endif /* KERNEL */
121
122#endif /* _SYS_TABLE_ */
123
124#endif /* KERNEL_PRIVATE */