xref: /illumos-gate/usr/src/uts/i86pc/sys/sbd_ioctl.h (revision 9c2acf00e275b6b2125a306f33cdddcc58393220)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * Copyright (c) 2010, Intel Corporation.
27  * All rights reserved.
28  */
29 /*
30  * Copyright 2019 Peter Tribble.
31  */
32 
33 #ifndef	_SBD_IOCTL_H
34 #define	_SBD_IOCTL_H
35 
36 #ifndef	_ASM
37 #include <sys/types.h>
38 #include <sys/obpdefs.h>
39 #include <sys/processor.h>
40 #include <sys/param.h>
41 #endif
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 #ifndef	_ASM
48 typedef enum {
49 	SBD_COMP_NONE,
50 	SBD_COMP_CPU,
51 	SBD_COMP_MEM,
52 	SBD_COMP_IO,
53 	SBD_COMP_CMP,
54 	SBD_COMP_UNKNOWN
55 } sbd_comp_type_t;
56 
57 typedef enum {
58 	SBD_STAT_NONE = 0,
59 	SBD_STAT_EMPTY,
60 	SBD_STAT_DISCONNECTED,
61 	SBD_STAT_CONNECTED,
62 	SBD_STAT_UNCONFIGURED,
63 	SBD_STAT_CONFIGURED
64 } sbd_state_t;
65 
66 typedef enum {
67 	SBD_COND_UNKNOWN = 0,
68 	SBD_COND_OK,
69 	SBD_COND_FAILING,
70 	SBD_COND_FAILED,
71 	SBD_COND_UNUSABLE
72 } sbd_cond_t;
73 
74 typedef	int	sbd_busy_t;
75 
76 #define	SBD_MAX_UNSAFE		16
77 #define	SBD_TYPE_LEN		12
78 #define	SBD_NULL_UNIT		-1
79 
80 typedef struct {
81 	sbd_comp_type_t	c_type;
82 	int		c_unit;
83 	char		c_name[OBP_MAXPROPNAME];
84 } sbd_comp_id_t;
85 
86 typedef struct {
87 	sbd_comp_id_t	c_id;
88 	sbd_state_t	c_ostate;
89 	sbd_cond_t	c_cond;
90 	sbd_busy_t	c_busy;
91 	uint_t		c_sflags;
92 	time_t		c_time;
93 } sbd_cm_stat_t;
94 
95 #define	ci_type		c_id.c_type
96 #define	ci_unit		c_id.c_unit
97 #define	ci_name		c_id.c_name
98 
99 typedef struct {
100 	sbd_cm_stat_t	cs_cm;
101 	int		cs_isbootproc;
102 	processorid_t	cs_cpuid;
103 	int		cs_speed;
104 	int		cs_ecache;
105 } sbd_cpu_stat_t;
106 
107 #define	cs_type		cs_cm.ci_type
108 #define	cs_unit		cs_cm.ci_unit
109 #define	cs_name		cs_cm.ci_name
110 #define	cs_ostate	cs_cm.c_ostate
111 #define	cs_cond		cs_cm.c_cond
112 #define	cs_busy		cs_cm.c_busy
113 #define	cs_suspend	cs_cm.c_sflags
114 #define	cs_time		cs_cm.c_time
115 
116 typedef struct {
117 	sbd_cm_stat_t	ms_cm;
118 	int		ms_interleave;
119 	pfn_t		ms_basepfn;
120 	pgcnt_t		ms_totpages;
121 	pgcnt_t		ms_detpages;
122 	pgcnt_t		ms_pageslost;
123 	pgcnt_t		ms_managed_pages;
124 	pgcnt_t		ms_noreloc_pages;
125 	pgcnt_t		ms_noreloc_first;
126 	pgcnt_t		ms_noreloc_last;
127 	int		ms_cage_enabled;
128 	int		ms_peer_is_target;	/* else peer is source */
129 	char		ms_peer_ap_id[MAXPATHLEN];	/* board's AP name */
130 } sbd_mem_stat_t;
131 
132 #define	ms_type		ms_cm.ci_type
133 #define	ms_unit		ms_cm.ci_unit
134 #define	ms_name		ms_cm.ci_name
135 #define	ms_ostate	ms_cm.c_ostate
136 #define	ms_cond		ms_cm.c_cond
137 #define	ms_busy		ms_cm.c_busy
138 #define	ms_suspend	ms_cm.c_sflags
139 #define	ms_time		ms_cm.c_time
140 
141 typedef struct {
142 	sbd_cm_stat_t	is_cm;
143 	int		is_referenced;
144 	int		is_unsafe_count;
145 	int		is_unsafe_list[SBD_MAX_UNSAFE];
146 	char		is_pathname[MAXPATHLEN];
147 } sbd_io_stat_t;
148 
149 #define	is_type		is_cm.ci_type
150 #define	is_unit		is_cm.ci_unit
151 #define	is_name		is_cm.ci_name
152 #define	is_ostate	is_cm.c_ostate
153 #define	is_cond		is_cm.c_cond
154 #define	is_busy		is_cm.c_busy
155 #define	is_suspend	is_cm.c_sflags
156 #define	is_time		is_cm.c_time
157 
158 /* This constant must be the max of the max cores on all platforms */
159 #define	SBD_MAX_CORES_PER_CMP	64
160 
161 typedef struct {
162 	sbd_cm_stat_t	ps_cm;
163 	processorid_t	ps_cpuid[SBD_MAX_CORES_PER_CMP];
164 	int		ps_ncores;
165 	int		ps_speed;
166 	int		ps_ecache;
167 } sbd_cmp_stat_t;
168 
169 #define	ps_type		ps_cm.ci_type
170 #define	ps_unit		ps_cm.ci_unit
171 #define	ps_name		ps_cm.ci_name
172 #define	ps_ostate	ps_cm.c_ostate
173 #define	ps_cond		ps_cm.c_cond
174 #define	ps_busy		ps_cm.c_busy
175 #define	ps_suspend	ps_cm.c_sflags
176 #define	ps_time		ps_cm.c_time
177 
178 typedef union {
179 	sbd_cm_stat_t	d_cm;
180 	sbd_cpu_stat_t	d_cpu;
181 	sbd_mem_stat_t	d_mem;
182 	sbd_io_stat_t	d_io;
183 	sbd_cmp_stat_t	d_cmp;
184 } sbd_dev_stat_t;
185 
186 #define	ds_type		d_cm.ci_type
187 #define	ds_unit		d_cm.ci_unit
188 #define	ds_name		d_cm.ci_name
189 #define	ds_ostate	d_cm.c_ostate
190 #define	ds_cond		d_cm.c_cond
191 #define	ds_busy		d_cm.c_busy
192 #define	ds_suspend	d_cm.c_sflags
193 #define	ds_time		d_cm.c_time
194 
195 #define	SBD_MAX_INFO	256
196 
197 typedef struct {
198 	int		s_board;
199 	char		s_type[SBD_TYPE_LEN];
200 	char		s_info[SBD_MAX_INFO];
201 	sbd_state_t	s_rstate;
202 	sbd_state_t	s_ostate;
203 	sbd_cond_t	s_cond;
204 	sbd_busy_t	s_busy;
205 	time_t		s_time;
206 	uint_t		s_power:1;
207 	uint_t		s_assigned:1;
208 	uint_t		s_platopts;
209 	int		s_nstat;
210 	sbd_dev_stat_t	s_stat[1];
211 } sbd_stat_t;
212 
213 typedef struct {
214 	sbd_comp_id_t	c_id;
215 	uint_t		c_flags;
216 	int		c_len;
217 	caddr_t		c_opts;
218 } sbd_cm_cmd_t;
219 
220 typedef struct {
221 	sbd_cm_cmd_t	g_cm;
222 	int		g_ncm;
223 } sbd_getncm_cmd_t;
224 
225 typedef struct {
226 	sbd_cm_cmd_t	s_cm;
227 	int		s_nbytes;
228 	caddr_t		s_statp;
229 } sbd_stat_cmd_t;
230 
231 typedef union {
232 	sbd_cm_cmd_t		cmd_cm;
233 	sbd_getncm_cmd_t	cmd_getncm;
234 	sbd_stat_cmd_t		cmd_stat;
235 } sbd_cmd_t;
236 
237 typedef struct {
238 	int		e_code;
239 	char		e_rsc[MAXPATHLEN];
240 } sbd_error_t;
241 
242 typedef struct {
243 	sbd_cmd_t	i_cmd;
244 	sbd_error_t	i_err;
245 } sbd_ioctl_arg_t;
246 
247 typedef struct {
248 	int		t_base;
249 	int		t_bnd;
250 	char		**t_text;
251 } sbd_etab_t;
252 
253 #define	i_flags		i_cmd.cmd_cm.c_flags
254 #define	i_len		i_cmd.cmd_cm.c_len
255 #define	i_opts		i_cmd.cmd_cm.c_opts
256 #define	ic_type		i_cmd.cmd_cm.ci_type
257 #define	ic_name		i_cmd.cmd_cm.ci_name
258 #define	ic_unit		i_cmd.cmd_cm.ci_unit
259 #define	ie_code		i_err.e_code
260 #define	ie_rsc		i_err.e_rsc
261 
262 #define	_SBD_IOC		(('D' << 16) | ('R' << 8))
263 
264 #define	SBD_CMD_ASSIGN		(_SBD_IOC | 0x01)
265 #define	SBD_CMD_UNASSIGN	(_SBD_IOC | 0x02)
266 #define	SBD_CMD_POWERON		(_SBD_IOC | 0x03)
267 #define	SBD_CMD_POWEROFF	(_SBD_IOC | 0x04)
268 #define	SBD_CMD_TEST		(_SBD_IOC | 0x05)
269 #define	SBD_CMD_CONNECT		(_SBD_IOC | 0x06)
270 #define	SBD_CMD_CONFIGURE	(_SBD_IOC | 0x07)
271 #define	SBD_CMD_UNCONFIGURE	(_SBD_IOC | 0x08)
272 #define	SBD_CMD_DISCONNECT	(_SBD_IOC | 0x09)
273 #define	SBD_CMD_STATUS		(_SBD_IOC | 0x0a)
274 #define	SBD_CMD_GETNCM		(_SBD_IOC | 0x0b)
275 #define	SBD_CMD_PASSTHRU	(_SBD_IOC | 0x0c)
276 
277 #define	SBD_CHECK_SUSPEND(cmd, c_sflags) \
278 		(((c_sflags) >> (((cmd) & 0xf) - 1)) & 0x01)
279 
280 #define	SBD_SET_SUSPEND(cmd, c_sflags) \
281 		((c_sflags) |= (0x01 << (((cmd) & 0xf) - 1)))
282 
283 #define	SBD_CHECK_PLATOPTS(cmd, c_platopts) \
284 		(((c_platopts) >> (((cmd) & 0xf) - 1)) & 0x01)
285 
286 #define	SBD_SET_PLATOPTS(cmd, c_platopts) \
287 		((c_platopts) &= ~(0x01 << (((cmd) & 0xf) - 1)))
288 
289 #define	SBD_FLAG_FORCE		0x1
290 #define	SBD_FLAG_ALLCMP		0x2
291 #define	SBD_FLAG_QUIESCE_OKAY	0x4
292 
293 #if defined(_SYSCALL32)
294 
295 typedef struct {
296 	int32_t		c_type;
297 	int32_t		c_unit;
298 	char		c_name[OBP_MAXPROPNAME];
299 } sbd_comp_id32_t;
300 
301 typedef struct {
302 	sbd_comp_id32_t	c_id;
303 	int32_t		c_ostate;
304 	int32_t		c_cond;
305 	int32_t		c_busy;
306 	uint32_t	c_sflags;
307 	time32_t	c_time;
308 } sbd_cm_stat32_t;
309 
310 typedef struct {
311 	sbd_cm_stat32_t	cs_cm;
312 	int32_t		cs_isbootproc;
313 	int32_t		cs_cpuid;
314 	int32_t		cs_speed;
315 	int32_t		cs_ecache;
316 } sbd_cpu_stat32_t;
317 
318 typedef struct {
319 	sbd_cm_stat32_t	ms_cm;
320 	int32_t		ms_interleave;
321 	uint32_t	ms_basepfn;
322 	uint32_t	ms_totpages;
323 	uint32_t	ms_detpages;
324 	int32_t		ms_pageslost;
325 	uint32_t	ms_managed_pages;
326 	uint32_t	ms_noreloc_pages;
327 	uint32_t	ms_noreloc_first;
328 	uint32_t	ms_noreloc_last;
329 	int32_t		ms_cage_enabled;
330 	int32_t		ms_peer_is_target;
331 	char		ms_peer_ap_id[MAXPATHLEN];
332 } sbd_mem_stat32_t;
333 
334 typedef struct {
335 	sbd_cm_stat32_t	is_cm;
336 	int32_t		is_referenced;
337 	int32_t		is_unsafe_count;
338 	int32_t		is_unsafe_list[SBD_MAX_UNSAFE];
339 	char		is_pathname[MAXPATHLEN];
340 } sbd_io_stat32_t;
341 
342 typedef struct {
343 	sbd_cm_stat32_t	ps_cm;
344 	int32_t		ps_cpuid[SBD_MAX_CORES_PER_CMP];
345 	int32_t		ps_ncores;
346 	int32_t		ps_speed;
347 	int32_t		ps_ecache;
348 } sbd_cmp_stat32_t;
349 
350 typedef union {
351 	sbd_cm_stat32_t		d_cm;
352 	sbd_cpu_stat32_t	d_cpu;
353 	sbd_mem_stat32_t	d_mem;
354 	sbd_io_stat32_t		d_io;
355 	sbd_cmp_stat32_t	d_cmp;
356 } sbd_dev_stat32_t;
357 
358 typedef struct {
359 	int32_t			s_board;
360 	char			s_type[SBD_TYPE_LEN];
361 	char			s_info[SBD_MAX_INFO];
362 	int32_t			s_rstate;
363 	int32_t			s_ostate;
364 	int32_t			s_cond;
365 	int32_t			s_busy;
366 	time32_t		s_time;
367 	uint32_t		s_power:1;
368 	uint32_t		s_assigned:1;
369 	uint32_t		s_platopts;
370 	int32_t			s_nstat;
371 	sbd_dev_stat32_t	s_stat[1];
372 } sbd_stat32_t;
373 
374 typedef struct {
375 	int32_t			e_code;
376 	char			e_rsc[MAXPATHLEN];
377 } sbd_error32_t;
378 
379 typedef struct {
380 	sbd_comp_id32_t		c_id;
381 	uint32_t		c_flags;
382 	int32_t			c_len;
383 	caddr32_t		c_opts;
384 } sbd_cm_cmd32_t;
385 
386 typedef struct {
387 	sbd_cm_cmd32_t	g_cm;
388 	int32_t		g_ncm;
389 } sbd_getncm_cmd32_t;
390 
391 typedef struct {
392 	sbd_cm_cmd32_t	s_cm;
393 	int32_t		s_nbytes;
394 	caddr32_t	s_statp;
395 } sbd_stat_cmd32_t;
396 
397 typedef union {
398 	sbd_cm_cmd32_t		cmd_cm;
399 	sbd_getncm_cmd32_t	cmd_getncm;
400 	sbd_stat_cmd32_t	cmd_stat;
401 } sbd_cmd32_t;
402 
403 typedef struct {
404 	sbd_cmd32_t		i_cmd;
405 	sbd_error32_t		i_err;
406 } sbd_ioctl_arg32_t;
407 
408 typedef struct {
409 	int32_t			t_base;
410 	int32_t			t_bnd;
411 	char			**t_text;
412 } sbd_etab32_t;
413 
414 #endif	/* _SYSCALL32 */
415 #endif	/* _ASM */
416 
417 /* Common error codes */
418 
419 #define	ESBD_NOERROR		0	/* no error */
420 #define	ESBD_INTERNAL		1	/* Internal error */
421 #define	ESBD_NOMEM		2	/* Insufficient memory */
422 #define	ESBD_PROTO		3	/* Protocol error */
423 #define	ESBD_BUSY		4	/* Device busy */
424 #define	ESBD_NODEV		5	/* No such device */
425 #define	ESBD_ALREADY		6	/* Operation already in progress */
426 #define	ESBD_IO			7	/* I/O error */
427 #define	ESBD_FAULT		8	/* Bad address */
428 #define	ESBD_EMPTY_BD		9	/* No device(s) on board */
429 #define	ESBD_INVAL		10	/* Invalid argument */
430 #define	ESBD_STATE		11	/* Invalid state transition */
431 #define	ESBD_FATAL_STATE	12	/* Device in fatal state */
432 #define	ESBD_OUTSTANDING	13	/* Outstanding error */
433 #define	ESBD_SUSPEND		14	/* Device failed to suspend */
434 #define	ESBD_RESUME		15	/* Device failed to resume */
435 #define	ESBD_UTHREAD		16	/* Cannot stop user thread */
436 #define	ESBD_RTTHREAD		17	/* Cannot quiesce realtime thread */
437 #define	ESBD_KTHREAD		18	/* Cannot stop kernel thread  */
438 #define	ESBD_OFFLINE		19	/* Failed to off-line */
439 #define	ESBD_ONLINE		20	/* Failed to on-line */
440 #define	ESBD_CPUSTART		21	/* Failed to start CPU */
441 #define	ESBD_CPUSTOP		22	/* Failed to stop CPU */
442 #define	ESBD_INVAL_COMP		23	/* Invalid component type */
443 #define	ESBD_KCAGE_OFF		24	/* Kernel cage is disabled */
444 #define	ESBD_NO_TARGET		25	/* No available memory target */
445 #define	ESBD_HW_PROGRAM		26	/* Hardware programming error */
446 #define	ESBD_MEM_NOTVIABLE	27	/* VM viability test failed */
447 #define	ESBD_MEM_REFUSED	28	/* Memory operation refused */
448 #define	ESBD_MEM_NONRELOC	29	/* Non-relocatable pages in span */
449 #define	ESBD_MEM_CANCELLED	30	/* Memory operation cancelled */
450 #define	ESBD_MEMFAIL		31	/* Memory operation failed */
451 #define	ESBD_MEMONLINE		32	/* Can't unconfig cpu if mem online */
452 #define	ESBD_QUIESCE_REQD	33
453 	/* Operator confirmation for quiesce is required */
454 #define	ESBD_MEMINTLV		34
455 	/* Memory is interleaved across boards */
456 #define	ESBD_CPUONLINE		35
457 	/* Can't config memory if not all cpus are online */
458 #define	ESBD_UNSAFE		36	/* Unsafe driver present */
459 #define	ESBD_INVAL_OPT		37	/* option invalid */
460 
461 /* Starcat error codes */
462 
463 #define	ESTC_NONE		1000	/* No error */
464 #define	ESTC_GETPROP		1001	/* Cannot read property value */
465 #define	ESTC_BNUM		1002	/* Invalid board number */
466 #define	ESTC_CONFIGBUSY		1003
467 	/* Cannot proceed; Board is configured or busy */
468 #define	ESTC_PROBE		1004	/* Solaris failed to probe */
469 #define	ESTC_DEPROBE		1005	/* Solaris failed to deprobe */
470 #define	ESTC_MOVESIGB		1006	/* Firmware move-cpu0 failed */
471 #define	ESTC_SUPPORT		1007	/* Operation not supported */
472 #define	ESTC_DRVFAIL		1008	/* Device driver failure */
473 #define	ESTC_UNKPTCMD		1012	/* Unrecognized platform command */
474 #define	ESTC_NOTID		1013
475 	/* drmach parameter is not a valid ID */
476 #define	ESTC_INAPPROP		1014
477 	/* drmach parameter is inappropriate for operation */
478 #define	ESTC_INTERNAL		1015	/* Unexpected internal condition */
479 #define	ESTC_MBXRQST		1016
480 	/* Mailbox framework failure: outgoing */
481 #define	ESTC_MBXRPLY		1017
482 	/* Mailbox framework failure: incoming */
483 #define	ESTC_NOACL		1018	/* Board is not in domain ACL */
484 #define	ESTC_NOT_ASSIGNED	1019	/* Board is not assigned to domain */
485 #define	ESTC_NOT_ACTIVE		1020	/* Board is not active */
486 #define	ESTC_EMPTY_SLOT		1021	/* Slot is empty */
487 #define	ESTC_POWER_OFF		1022	/* Board is powered off */
488 #define	ESTC_TEST_IN_PROGRESS	1023	/* Board is already being tested */
489 #define	ESTC_TESTING_BUSY	1024
490 	/* Wait: All SC test resources are in use */
491 #define	ESTC_TEST_REQUIRED	1025	/* Board requires test prior to use */
492 #define	ESTC_TEST_ABORTED	1026	/* Board test has been aborted */
493 #define	ESTC_MBOX_UNKNOWN	1027
494 	/* Unknown error type received from SC */
495 #define	ESTC_TEST_STATUS_UNKNOWN	1028
496 	/* Test completed with unknown status */
497 #define	ESTC_TEST_RESULT_UNKNOWN	1029
498 	/* Unknown test result returned by SC */
499 #define	ESTC_TEST_FAILED	1030
500 	/* SMS hpost reported error, see POST log for details */
501 #define	ESTC_UNAVAILABLE	1031	/* Slot is unavailable to the domain */
502 #define	ESTC_NZ_LPA		1032	/* Nonzero LPA not yet supported */
503 #define	ESTC_IOSWITCH		1033
504 	/* Cannot unconfigure I/O board: tunnel switch failed */
505 #define	ESTC_IOCAGE_NO_CPU_AVAIL	1034
506 	/* No CPU available for I/O cage test. */
507 #define	ESTC_SMS_ERR_RECOVERABLE	1035
508 	/* SMS reported recoverable error: check SMS status and Retry */
509 #define	ESTC_SMS_ERR_UNRECOVERABLE	1036
510 	/* SMS reported unrecoverable error: Board is Unusable */
511 #define	ESTC_NWSWITCH		1037
512 	/* Cannot unconfigure I/O board: network switch failed */
513 
514 /* Daktari error codes */
515 
516 #define	EDAK_NONE		3000	/* no error */
517 #define	EDAK_INTERNAL		3001	/* Internal error */
518 #define	EDAK_NOFRUINFO		3002	/* Didn't receive fru info */
519 #define	EDAK_NONDR_BOARD	3003
520 	/* DR is not supported on this board type */
521 #define	EDAK_POWERON		3004	/* Power on request failed */
522 #define	EDAK_POWEROK		3005	/* Failed to power on */
523 #define	EDAK_INTERRUPTED	3006	/* Operation interrupted */
524 #define	EDAK_BOARDINIT		3007	/* Board initialization failed */
525 #define	EDAK_CPUINIT		3008	/* CPU intialization failed */
526 #define	EDAK_MEMFAIL		3009	/* Memory operation failed */
527 
528 /* Serengeti error codes */
529 
530 #define	ESGT_NONE		4000	/* no error */
531 #define	ESGT_INTERNAL		4001	/* Internal error */
532 #define	ESGT_INVAL		4002	/* Invalid argument */
533 #define	ESGT_MEMFAIL		4003	/* Memory operation failed */
534 #define	ESGT_PROBE		4004	/* Board probe failed */
535 #define	ESGT_DEPROBE		4005	/* Board deprobe failed */
536 #define	ESGT_JUGGLE_BOOTPROC	4006	/* Failed to juggle bootproc */
537 #define	ESGT_NOT_CPUTYPE	4007	/* Not a cpu device */
538 #define	ESGT_NO_DEV_TYPE	4008	/* Cannot find device type */
539 #define	ESGT_BAD_PORTID		4009	/* Bad port id */
540 #define	ESGT_RESUME		4010	/* Failed to resume device */
541 #define	ESGT_SUSPEND		4011	/* Failed to suspend device */
542 #define	ESGT_KTHREAD		4012	/* failed to stop kernel thd */
543 #define	ESGT_UNSAFE		4013	/* unsafe */
544 #define	ESGT_RTTHREAD		4014	/* real time threads */
545 #define	ESGT_UTHREAD		4015	/* failed to stop user thd */
546 #define	ESGT_PROM_ATTACH	4016	/* prom failed attach board */
547 #define	ESGT_PROM_DETACH	4017	/* prom failed detach board */
548 #define	ESGT_SC_ERR		4018	/* sc return a failure */
549 #define	ESGT_GET_BOARD_STAT	4019	/* Failed to obtain board information */
550 #define	ESGT_WAKEUPCPU		4020	/* Failed to wake up cpu */
551 #define	ESGT_STOPCPU		4021	/* Failed to stop cpu */
552 /* Serengeti SC return codes */
553 #define	ESGT_HW_FAIL		4022	/* Hardware Failure */
554 #define	ESGT_BD_ACCESS		4023	/* Board access denied */
555 #define	ESGT_STALE_CMP		4024	/* Stale components */
556 #define	ESGT_STALE_OBJ		4025	/* Stale objects */
557 #define	ESGT_NO_SEPROM_SPACE	4026	/* No SEPROM space */
558 #define	ESGT_NOT_SUPP		4027	/* Operation not supported */
559 #define	ESGT_NO_MEM		4028	/* No Memory */
560 
561 /* OPL error codes */
562 
563 #define	EOPL_GETPROP		5001	/* Cannot read property value */
564 #define	EOPL_BNUM		5002	/* Invalid board number */
565 #define	EOPL_CONFIGBUSY		5003
566 	/* Cannot proceed; Board is configured or busy */
567 #define	EOPL_PROBE		5004	/* Firmware probe failed */
568 #define	EOPL_DEPROBE		5005	/* Firmware deprobe failed */
569 #define	EOPL_SUPPORT		5006	/* Operation not supported */
570 #define	EOPL_DRVFAIL		5007	/* Device driver failure */
571 #define	EOPL_UNKPTCMD		5008	/* Unrecognized platform command */
572 #define	EOPL_NOTID		5009	/* drmach parameter is not a valid ID */
573 #define	EOPL_INAPPROP		5010
574 	/* drmach parameter is inappropriate for operation */
575 #define	EOPL_INTERNAL		5011	/* Unexpected internal condition */
576 #define	EOPL_FINDDEVICE		5012	/* Firmware cannot find node. */
577 #define	EOPL_MC_SETUP		5013	/* Cannot setup memory node */
578 #define	EOPL_CPU_STATE		5014	/* Invalid CPU/core state */
579 #define	EOPL_MC_OPL		5015	/* Cannot find mc-opl interface */
580 #define	EOPL_SCF_FMEM		5016	/* Cannot find scf_fmem interface */
581 #define	EOPL_FMEM_SETUP		5017	/* Error setting up FMEM buffer */
582 #define	EOPL_SCF_FMEM_START	5018	/* scf_fmem_start error */
583 #define	EOPL_FMEM_ERROR		5019	/* FMEM error */
584 #define	EOPL_SCF_FMEM_CANCEL	5020	/* scf_fmem_cancel error */
585 #define	EOPL_FMEM_XC_TIMEOUT	5021	/* xcall timeout */
586 #define	EOPL_FMEM_COPY_TIMEOUT	5022	/* DR parellel copy timeout */
587 #define	EOPL_FMEM_SCF_BUSY	5023	/* SCF busy */
588 #define	EOPL_FMEM_RETRY_OUT	5024	/* SCF IO Retry Error */
589 #define	EOPL_FMEM_TIMEOUT	5025	/* FMEM command timeout */
590 #define	EOPL_FMEM_HW_ERROR	5026	/* Hardware error */
591 #define	EOPL_FMEM_TERMINATE	5027	/* FMEM operation Terminated */
592 #define	EOPL_FMEM_COPY_ERROR	5028	/* Memory copy error */
593 #define	EOPL_FMEM_SCF_ERR	5029	/* SCF error */
594 #define	EOPL_MIXED_CPU		5030
595 	/* Cannot add SPARC64-VI to domain booted with all SPARC64-VII CPUs */
596 #define	EOPL_FMEM_SCF_OFFLINE	5031	/* SCF OFFLINE */
597 
598 /* X86 error codes */
599 
600 #define	EX86_GETPROP		10001	/* Cannot read property value */
601 #define	EX86_BNUM		10002	/* Invalid board number */
602 #define	EX86_NOTID		10003	/* drmach parameter is not a valid ID */
603 #define	EX86_INAPPROP		10004
604 	/* drmach parameter is inappropriate for operation */
605 #define	EX86_PROBE		10005	/* Firmware probe failed */
606 #define	EX86_DEPROBE		10006	/* Firmware deprobe failed */
607 #define	EX86_SUPPORT		10007	/* Operation not supported */
608 #define	EX86_INTERNAL		10008	/* Unexpected internal condition */
609 #define	EX86_CONFIGBUSY		10009
610 	/* Cannot proceed, board is configured or busy */
611 #define	EX86_POWERBUSY		10010	/* Cannot proceed, board is powered */
612 #define	EX86_CONNECTBUSY	10011	/* Cannot proceed, board is connected */
613 #define	EX86_INVALID_ARG	10012	/* Invalid argument */
614 #define	EX86_DRVFAIL		10013	/* Device driver failure */
615 #define	EX86_UNKPTCMD		10014	/* Unrecognized platform command */
616 #define	EX86_ALLOC_CPUID	10015	/* Failed to allocate processor id */
617 #define	EX86_FREE_CPUID		10016	/* Failed to release processor id */
618 #define	EX86_POWERON		10017	/* Failed to power on board */
619 #define	EX86_POWEROFF		10018	/* Failed to power off board */
620 #define	EX86_MC_SETUP		10019	/* Cannot setup memory node */
621 #define	EX86_ACPIWALK		10020	/* Cannot walk ACPI namespace */
622 #define	EX86_WALK_DEPENDENCY	10021
623 	/* Failed to check dependency for board */
624 #define	EX86_IN_FAILURE		10022	/* Board is in failure state */
625 
626 #ifdef	__cplusplus
627 }
628 #endif
629 
630 #endif	/* _SBD_IOCTL_H */
631