Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/processor.h
+++ new/usr/src/uts/common/sys/processor.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
23 23 * All Rights Reserved
24 24 *
25 25 */
26 26
27 27 /*
28 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
29 + *
28 30 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
29 31 * Use is subject to license terms.
30 32 */
31 33
32 34 #ifndef _SYS_PROCESSOR_H
33 35 #define _SYS_PROCESSOR_H
34 36
35 37 #include <sys/types.h>
36 38 #include <sys/procset.h>
37 39
38 40 #ifdef __cplusplus
39 41 extern "C" {
40 42 #endif
41 43
42 44 /*
43 45 * Definitions for p_online, processor_info & lgrp system calls.
44 46 */
45 47
46 48 /*
47 49 * Type for an lgrpid
48 50 */
49 51 typedef uint16_t lgrpid_t;
50 52
51 53 /*
52 54 * Type for processor name (CPU number).
53 55 */
54 56 typedef int processorid_t;
55 57 typedef int chipid_t;
56 58
57 59 /*
58 60 * Flags and return values for p_online(2), and pi_state for processor_info(2).
59 61 * These flags are *not* for in-kernel examination of CPU states.
60 62 * See <sys/cpuvar.h> for appropriate informational functions.
61 63 */
62 64 #define P_OFFLINE 0x0001 /* processor is offline, as quiet as possible */
63 65 #define P_ONLINE 0x0002 /* processor is online */
64 66 #define P_STATUS 0x0003 /* value passed to p_online to request status */
65 67 #define P_FAULTED 0x0004 /* processor is offline, in faulted state */
66 68 #define P_POWEROFF 0x0005 /* processor is powered off */
67 69 #define P_NOINTR 0x0006 /* processor is online, but no I/O interrupts */
68 70 #define P_SPARE 0x0007 /* processor is offline, can be reactivated */
69 71 #define P_BAD P_FAULTED /* unused but defined by USL */
70 72 #define P_FORCED 0x10000000 /* force processor offline */
71 73
72 74 /*
73 75 * String names for processor states defined above.
74 76 */
75 77 #define PS_OFFLINE "off-line"
76 78 #define PS_ONLINE "on-line"
77 79 #define PS_FAULTED "faulted"
78 80 #define PS_POWEROFF "powered-off"
79 81 #define PS_NOINTR "no-intr"
80 82 #define PS_SPARE "spare"
81 83
82 84 /*
83 85 * Structure filled in by processor_info(2). This structure
84 86 * SHOULD NOT BE MODIFIED. Changes to the structure would
85 87 * negate ABI compatibility.
86 88 *
87 89 * The string fields are guaranteed to contain a NULL.
88 90 *
89 91 * The pi_fputypes field contains a (possibly empty) comma-separated
90 92 * list of floating point identifier strings.
91 93 */
92 94 #define PI_TYPELEN 16 /* max size of CPU type string */
93 95 #define PI_FPUTYPE 32 /* max size of FPU types string */
94 96
95 97 typedef struct {
96 98 int pi_state; /* processor state, see above */
97 99 char pi_processor_type[PI_TYPELEN]; /* ASCII CPU type */
98 100 char pi_fputypes[PI_FPUTYPE]; /* ASCII FPU types */
99 101 int pi_clock; /* CPU clock freq in MHz */
100 102 } processor_info_t;
101 103
102 104 /*
103 105 * Binding values for processor_bind(2)
104 106 */
↓ open down ↓ |
67 lines elided |
↑ open up ↑ |
105 107 #define PBIND_NONE -1 /* LWP/thread is not bound */
106 108 #define PBIND_QUERY -2 /* don't set, just return the binding */
107 109 #define PBIND_HARD -3 /* prevents offlining CPU (default) */
108 110 #define PBIND_SOFT -4 /* allows offlining CPU */
109 111 #define PBIND_QUERY_TYPE -5 /* Return binding type */
110 112
111 113 /*
112 114 * User-level system call interface prototypes
113 115 */
114 116 #ifndef _KERNEL
115 -#ifdef __STDC__
116 117
117 118 extern int p_online(processorid_t processorid, int flag);
118 119 extern int processor_info(processorid_t processorid,
119 120 processor_info_t *infop);
120 121 extern int processor_bind(idtype_t idtype, id_t id,
121 122 processorid_t processorid, processorid_t *obind);
122 123 extern processorid_t getcpuid(void);
123 124 extern lgrpid_t gethomelgroup(void);
124 125
125 -#else
126 -
127 -extern int p_online();
128 -extern int processor_info();
129 -extern int processor_bind();
130 -extern processorid_t getcpuid();
131 -extern lgrpid_t gethomelgroup();
132 -
133 -#endif /* __STDC__ */
134 -
135 126 #else /* _KERNEL */
136 127
137 128 /*
138 129 * Internal interface prototypes
139 130 */
140 131 extern int p_online_internal(processorid_t, int, int *);
141 132 extern int p_online_internal_locked(processorid_t, int, int *);
142 133
143 134 #endif /* !_KERNEL */
144 135
145 136 #ifdef __cplusplus
146 137 }
147 138 #endif
148 139
149 140 #endif /* _SYS_PROCESSOR_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX