1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright (c) 2000 by Sun Microsystems, Inc. 24*7c478bd9Sstevel@tonic-gate * All rights reserved. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _CPU_SGN_H 28*7c478bd9Sstevel@tonic-gate #define _CPU_SGN_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate #ifndef _ASM 37*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 38*7c478bd9Sstevel@tonic-gate #include <sys/cpuvar.h> 39*7c478bd9Sstevel@tonic-gate #endif /* _ASM */ 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate /* 42*7c478bd9Sstevel@tonic-gate * BBSRAM virtual address - 64 bits max. 43*7c478bd9Sstevel@tonic-gate */ 44*7c478bd9Sstevel@tonic-gate typedef uint64_t vaddr_t; 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate /* 47*7c478bd9Sstevel@tonic-gate * Special type for BBSRAM offsets (rather than pointers). 48*7c478bd9Sstevel@tonic-gate * This must be a 32 bit value 49*7c478bd9Sstevel@tonic-gate */ 50*7c478bd9Sstevel@tonic-gate typedef uint32_t bboff_t; 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate /* 53*7c478bd9Sstevel@tonic-gate * As long as each component of the revision is less than 54*7c478bd9Sstevel@tonic-gate * 256, this trick will work. So we check for that and generate a 55*7c478bd9Sstevel@tonic-gate * syntax error if the SID is out of range. 56*7c478bd9Sstevel@tonic-gate */ 57*7c478bd9Sstevel@tonic-gate #define SIGB_MBOX_SIZE 64 58*7c478bd9Sstevel@tonic-gate /* reserved space - rounds size of sigblock_t to 512 */ 59*7c478bd9Sstevel@tonic-gate #define SIGB_RESV 16 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate #define BASE_ADDR_T_OFFSET 0xFE0 /* BBSRAM base_addr_t offset */ 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gate #define CVC_OUT_SIZ 1024 /* cvc output buffer size */ 64*7c478bd9Sstevel@tonic-gate #define CVC_IN_SIZ 256 /* cvc input buffer size */ 65*7c478bd9Sstevel@tonic-gate 66*7c478bd9Sstevel@tonic-gate /* make sure the assembler doesn't see the C code */ 67*7c478bd9Sstevel@tonic-gate #ifndef _ASM 68*7c478bd9Sstevel@tonic-gate 69*7c478bd9Sstevel@tonic-gate /* 70*7c478bd9Sstevel@tonic-gate * The reserved hardware interrupt 7F is used as a pointer structure 71*7c478bd9Sstevel@tonic-gate * to the two processors' signature blocks in bbsram. Each trap entry 72*7c478bd9Sstevel@tonic-gate * is 32 bytes, so this structure is always present at bbsram offset 73*7c478bd9Sstevel@tonic-gate * 0xFE0. 74*7c478bd9Sstevel@tonic-gate * Over time, we may discover other items that need pointers, that don't 75*7c478bd9Sstevel@tonic-gate * logically fit in the sigblocks themselves. This structure declares 76*7c478bd9Sstevel@tonic-gate * the global use of these 8 words. 77*7c478bd9Sstevel@tonic-gate * The spare_x words are reserved in case a design change calls for 78*7c478bd9Sstevel@tonic-gate * using 64-bit virtual addresses instead of offsets. This is 79*7c478bd9Sstevel@tonic-gate * considered unlikely. 80*7c478bd9Sstevel@tonic-gate * 81*7c478bd9Sstevel@tonic-gate * The offsets and this structure are normally created by POST when it 82*7c478bd9Sstevel@tonic-gate * initially creates the sigblocks. Subsequent programs may move the 83*7c478bd9Sstevel@tonic-gate * sigblocks in bbsram as they see fit, as long as this structure is changed 84*7c478bd9Sstevel@tonic-gate * to reflect the new location. 85*7c478bd9Sstevel@tonic-gate */ 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate typedef struct { 88*7c478bd9Sstevel@tonic-gate bboff_t sigblk_offset_0; /* BBSRAM sig block 0 offset */ 89*7c478bd9Sstevel@tonic-gate uint32_t spare_0; /* spare word just in case */ 90*7c478bd9Sstevel@tonic-gate bboff_t sigblk_offset_1; /* BBSRAM sig block 1 offset */ 91*7c478bd9Sstevel@tonic-gate uint32_t spare_1; /* another just in case */ 92*7c478bd9Sstevel@tonic-gate uint32_t pad[4]; /* trap is 8 32-bit words long */ 93*7c478bd9Sstevel@tonic-gate } base_addr_t; 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate 96*7c478bd9Sstevel@tonic-gate /* 97*7c478bd9Sstevel@tonic-gate * The following are used in the flag field of the mailbox structure. 98*7c478bd9Sstevel@tonic-gate * They are used to synchronize access with the mailbox between the 99*7c478bd9Sstevel@tonic-gate * SSP and Host, and indicate direction of the given message. 100*7c478bd9Sstevel@tonic-gate */ 101*7c478bd9Sstevel@tonic-gate #define SIGB_MBOX_EMPTY 0 102*7c478bd9Sstevel@tonic-gate #define SIGB_MBOX_BUSY 1 103*7c478bd9Sstevel@tonic-gate #define HOST_TO_CBS 2 104*7c478bd9Sstevel@tonic-gate #define CBS_TO_HOST 3 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate /* for sigblk polling */ 107*7c478bd9Sstevel@tonic-gate #define SIGB_INTR_OFF 0x00 108*7c478bd9Sstevel@tonic-gate #define SIGB_INTR_SEND 0xFF 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate typedef short mboxflag_t; 111*7c478bd9Sstevel@tonic-gate 112*7c478bd9Sstevel@tonic-gate /* 113*7c478bd9Sstevel@tonic-gate * BE CAREFUL with modifications. To optimize transfers on the 114*7c478bd9Sstevel@tonic-gate * bootbus between the kernel and mailbox, try to make sure the data 115*7c478bd9Sstevel@tonic-gate * field falls on a 16 byte boundary. 116*7c478bd9Sstevel@tonic-gate */ 117*7c478bd9Sstevel@tonic-gate typedef struct { 118*7c478bd9Sstevel@tonic-gate /* 0 */ short intr; 119*7c478bd9Sstevel@tonic-gate /* 2 */ mboxflag_t flag; 120*7c478bd9Sstevel@tonic-gate /* 4 */ int32_t len; 121*7c478bd9Sstevel@tonic-gate /* 8 */ uint32_t cmd; 122*7c478bd9Sstevel@tonic-gate /* c */ char data[SIGB_MBOX_SIZE]; 123*7c478bd9Sstevel@tonic-gate } sigbmbox_t; /* sizeof = 76 (0x4c) = 19X */ 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gate typedef struct { 126*7c478bd9Sstevel@tonic-gate uchar_t cvc_output_buf[CVC_OUT_SIZ]; 127*7c478bd9Sstevel@tonic-gate uchar_t cvc_input_buf[CVC_IN_SIZ]; 128*7c478bd9Sstevel@tonic-gate uchar_t cvc_obp_input_flag; /* !=0 -> OBP wants CVC input */ 129*7c478bd9Sstevel@tonic-gate } sigb_cvc_t; 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gate /* 132*7c478bd9Sstevel@tonic-gate * Every CPU signature, state, or substate transition is captured 133*7c478bd9Sstevel@tonic-gate * in the ring buffer. OS or OBP will be the writer of the ring buffer 134*7c478bd9Sstevel@tonic-gate * and control board executive (via JTAG) will be the sole reader. Because of 135*7c478bd9Sstevel@tonic-gate * space limitation in the BBSRAM, the ring buffer can only be 64 entries big. 136*7c478bd9Sstevel@tonic-gate * A ring buffer is necessary because of the speed difference between the 137*7c478bd9Sstevel@tonic-gate * reader and writer, and to prevent race condition. 138*7c478bd9Sstevel@tonic-gate * 139*7c478bd9Sstevel@tonic-gate * The ring buffer structure contains two pointers, one for reading and 140*7c478bd9Sstevel@tonic-gate * one for writing, and the buffer itself. The last 6 bits in each of the 141*7c478bd9Sstevel@tonic-gate * pointer identify an entry in the buffer. The read pointer represents 142*7c478bd9Sstevel@tonic-gate * the next entry the reader should read. The write pointer represents the 143*7c478bd9Sstevel@tonic-gate * next entry the writer is going to write. For the reader, the ring buffer 144*7c478bd9Sstevel@tonic-gate * contains un-read entries if the read and write pointers are different. 145*7c478bd9Sstevel@tonic-gate * 146*7c478bd9Sstevel@tonic-gate * In most situations, the reader should be able to keep up with the 147*7c478bd9Sstevel@tonic-gate * writer. However, in the case where the writer is transitioning 148*7c478bd9Sstevel@tonic-gate * rapidly, the reader may not be able to keep up and causes an overflow. 149*7c478bd9Sstevel@tonic-gate * When an overflow happens, instead of suspending the writer, the 150*7c478bd9Sstevel@tonic-gate * writer continues to write. 151*7c478bd9Sstevel@tonic-gate * 152*7c478bd9Sstevel@tonic-gate * The first transition that causes an overflow has 2 consequences 153*7c478bd9Sstevel@tonic-gate * because of this continuous write action: 154*7c478bd9Sstevel@tonic-gate * 1. The ring buffer is flushed, all previous transitions history are lost. 155*7c478bd9Sstevel@tonic-gate * 156*7c478bd9Sstevel@tonic-gate * Flushing the ring buffer is acceptable since the reader is not 157*7c478bd9Sstevel@tonic-gate * able to keep up with rapid transitions, it is better off to start 158*7c478bd9Sstevel@tonic-gate * from the current transition than trying to catch up. 159*7c478bd9Sstevel@tonic-gate * 160*7c478bd9Sstevel@tonic-gate * 2. The new transition is recorded in the ring buffer. However, bcecause of 161*7c478bd9Sstevel@tonic-gate * the way the write pointer is updated, both the read and write pointers 162*7c478bd9Sstevel@tonic-gate * will be identical which makes the reader thinks there is no transition to 163*7c478bd9Sstevel@tonic-gate * read. 164*7c478bd9Sstevel@tonic-gate * 165*7c478bd9Sstevel@tonic-gate * Even though the reader does not see the most current signature/state in the 166*7c478bd9Sstevel@tonic-gate * ring buffer, it can be found in the signature block data structure. 167*7c478bd9Sstevel@tonic-gate * The reader can do a read in the signature block to obtain the current 168*7c478bd9Sstevel@tonic-gate * signature/block if the read/write pointers indicate the buffer is empty. 169*7c478bd9Sstevel@tonic-gate * The problem will go away once the writer starts writing again. 170*7c478bd9Sstevel@tonic-gate * 171*7c478bd9Sstevel@tonic-gate * Initial condition: 172*7c478bd9Sstevel@tonic-gate * rd_ptr = 0 173*7c478bd9Sstevel@tonic-gate * wr_ptr = 0 174*7c478bd9Sstevel@tonic-gate * 175*7c478bd9Sstevel@tonic-gate * To write a signature into the ring buffer, the steps are: 176*7c478bd9Sstevel@tonic-gate * 1. write signature into ringbuf[wr_ptr] 177*7c478bd9Sstevel@tonic-gate * 2. increment wr_ptr by 1 modulo SIGB_RB_SIZ using RB_IDX_MASK 178*7c478bd9Sstevel@tonic-gate * 179*7c478bd9Sstevel@tonic-gate * Note: the writer always writes to the ring buffer and the signature 180*7c478bd9Sstevel@tonic-gate * field in the signature block data structure. 181*7c478bd9Sstevel@tonic-gate * 182*7c478bd9Sstevel@tonic-gate * To read a signature from the ring buffer, the steps are: 183*7c478bd9Sstevel@tonic-gate * 1. compare rd_ptr and wr_ptr 184*7c478bd9Sstevel@tonic-gate * 2. if they are not equal then 185*7c478bd9Sstevel@tonic-gate * read signature ringbuf[rd_ptr] 186*7c478bd9Sstevel@tonic-gate * increment rd_ptr by 1 modulo SIGB_RB_SIZ using RB_IDX_MASK 187*7c478bd9Sstevel@tonic-gate * save a copy of the signature locally 188*7c478bd9Sstevel@tonic-gate * return the signature 189*7c478bd9Sstevel@tonic-gate * 3. else 190*7c478bd9Sstevel@tonic-gate * read signature from the signature block data structure 191*7c478bd9Sstevel@tonic-gate * if signature is not the same as the last signature then 192*7c478bd9Sstevel@tonic-gate * return the signature 193*7c478bd9Sstevel@tonic-gate * 194*7c478bd9Sstevel@tonic-gate */ 195*7c478bd9Sstevel@tonic-gate 196*7c478bd9Sstevel@tonic-gate #define SIGB_RB_SIZ 64 /* ring buffer size */ 197*7c478bd9Sstevel@tonic-gate #define RB_IDX_MASK 0x3f /* mask to determine read/write index */ 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate typedef struct { 200*7c478bd9Sstevel@tonic-gate /* 0 */ uchar_t rd_ptr; /* entry to read */ 201*7c478bd9Sstevel@tonic-gate /* 1 */ uchar_t wr_ptr; /* next entry to write */ 202*7c478bd9Sstevel@tonic-gate /* 4 */ sig_state_t ringbuf[SIGB_RB_SIZ]; 203*7c478bd9Sstevel@tonic-gate } sigb_ringbuf_t; /* sizeof = 260 (0x104) = 65X */ 204*7c478bd9Sstevel@tonic-gate 205*7c478bd9Sstevel@tonic-gate typedef struct cpu_sgnblk { 206*7c478bd9Sstevel@tonic-gate /* 0 */ uint32_t sigb_magic; /* SIGBLOCK_MAGIC */ 207*7c478bd9Sstevel@tonic-gate /* 4 */ uint32_t sigb_version; /* changes with each SID */ 208*7c478bd9Sstevel@tonic-gate /* 8 */ uint32_t sigb_flags; /* struct sigblock status */ 209*7c478bd9Sstevel@tonic-gate /* c */ uint32_t sigb_heartbeat; /* prog's heartbeat */ 210*7c478bd9Sstevel@tonic-gate 211*7c478bd9Sstevel@tonic-gate /* 10 */ uint32_t sigb_leds; /* Software LED */ 212*7c478bd9Sstevel@tonic-gate /* 14 */ sig_state_t sigb_signature; /* Current signature & state */ 213*7c478bd9Sstevel@tonic-gate 214*7c478bd9Sstevel@tonic-gate /* 215*7c478bd9Sstevel@tonic-gate * sigb_ringbuf captures the last SIGB_RB_SIZ signature/state 216*7c478bd9Sstevel@tonic-gate * transitions. 217*7c478bd9Sstevel@tonic-gate */ 218*7c478bd9Sstevel@tonic-gate /* 18 */ sigb_ringbuf_t sigb_ringbuf; 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate /* 221*7c478bd9Sstevel@tonic-gate * sigb_host_mbox is intended for msgs targeted for the Host and 222*7c478bd9Sstevel@tonic-gate * follows the protocol: 223*7c478bd9Sstevel@tonic-gate * SSP -> [cmd] -> Host -> [resp] -> SSP. 224*7c478bd9Sstevel@tonic-gate */ 225*7c478bd9Sstevel@tonic-gate /* 11c */ sigbmbox_t sigb_host_mbox; 226*7c478bd9Sstevel@tonic-gate 227*7c478bd9Sstevel@tonic-gate /* 168 */ char sigb_idn[sizeof (sigbmbox_t)]; 228*7c478bd9Sstevel@tonic-gate 229*7c478bd9Sstevel@tonic-gate /* 1b4 */ bboff_t sigb_obp_mbox; /* OBP/DHLP mailbox. */ 230*7c478bd9Sstevel@tonic-gate 231*7c478bd9Sstevel@tonic-gate /* 1b8 */ bboff_t sigb_postconfig; /* config info from POST */ 232*7c478bd9Sstevel@tonic-gate 233*7c478bd9Sstevel@tonic-gate /* 1bc */ uint32_t sigb_post; /* POST opaque */ 234*7c478bd9Sstevel@tonic-gate 235*7c478bd9Sstevel@tonic-gate /* 1c0 */ bboff_t sigb_slavep; /* Slave startup block offset */ 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate /* 1c4 */ bboff_t sigb_resetinfo_off; /* Resetinfo offset */ 238*7c478bd9Sstevel@tonic-gate 239*7c478bd9Sstevel@tonic-gate /* 1c8 */ bboff_t sigb_cvc_off; /* CVC offset */ 240*7c478bd9Sstevel@tonic-gate 241*7c478bd9Sstevel@tonic-gate /* 1cc */ bboff_t sigb_eeprom_off; /* EEPROM offset */ 242*7c478bd9Sstevel@tonic-gate 243*7c478bd9Sstevel@tonic-gate /* 1d0 */ vaddr_t sigb_wdog_reset_vec; /* Watchdog Reset Vector */ 244*7c478bd9Sstevel@tonic-gate 245*7c478bd9Sstevel@tonic-gate /* 1d8 */ vaddr_t sigb_xir_reset_vec; /* XIR Reset vector */ 246*7c478bd9Sstevel@tonic-gate 247*7c478bd9Sstevel@tonic-gate /* 1e0 */ vaddr_t sigb_sir_reset_vec; /* SIR Reset Vector */ 248*7c478bd9Sstevel@tonic-gate 249*7c478bd9Sstevel@tonic-gate /* 1e8 */ vaddr_t sigb_red_state_reset_vec; /* RED State Reset Vector */ 250*7c478bd9Sstevel@tonic-gate 251*7c478bd9Sstevel@tonic-gate /* 1f0 */ uchar_t sigb_resv_array[SIGB_RESV]; /* reserved space */ 252*7c478bd9Sstevel@tonic-gate } cpu_sgnblk_t; /* sizeof = 512 (0x200) = 128X */ 253*7c478bd9Sstevel@tonic-gate 254*7c478bd9Sstevel@tonic-gate #endif /* _ASM */ 255*7c478bd9Sstevel@tonic-gate 256*7c478bd9Sstevel@tonic-gate /* 257*7c478bd9Sstevel@tonic-gate * Mailbox commands. 258*7c478bd9Sstevel@tonic-gate * 259*7c478bd9Sstevel@tonic-gate * The commands are listed here so that they are in a central place 260*7c478bd9Sstevel@tonic-gate * for all users of the signature block mailbox. Want to be careful 261*7c478bd9Sstevel@tonic-gate * that some subsystems don't accidently use the same value for a 262*7c478bd9Sstevel@tonic-gate * command. For this reason we introduce a cookie for each subsystem. 263*7c478bd9Sstevel@tonic-gate */ 264*7c478bd9Sstevel@tonic-gate 265*7c478bd9Sstevel@tonic-gate #define SIGB_HANDLER_BUSY (-2) 266*7c478bd9Sstevel@tonic-gate #define SIGB_BAD_MBOX_CMD (-1) 267*7c478bd9Sstevel@tonic-gate #define SSP_CMD ('S' << 8) /* generic SSP */ 268*7c478bd9Sstevel@tonic-gate #define SSP_CMD_SUCCESS (SSP_CMD | 0x1) 269*7c478bd9Sstevel@tonic-gate #define SSP_GOTO_OBP (SSP_CMD | 0x2) 270*7c478bd9Sstevel@tonic-gate #define SSP_GOTO_PANIC (SSP_CMD | 0x3) 271*7c478bd9Sstevel@tonic-gate #define SSP_ENVIRON (SSP_CMD | 0x4) /* environmental intr */ 272*7c478bd9Sstevel@tonic-gate 273*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL 274*7c478bd9Sstevel@tonic-gate 275*7c478bd9Sstevel@tonic-gate #ifdef _STARFIRE 276*7c478bd9Sstevel@tonic-gate 277*7c478bd9Sstevel@tonic-gate extern void juggle_sgnblk_poll(struct cpu *); 278*7c478bd9Sstevel@tonic-gate extern int sgnblk_poll_register(void (*)(processorid_t, cpu_sgnblk_t *)); 279*7c478bd9Sstevel@tonic-gate extern int sgnblk_poll_unregister(void (*)(processorid_t, cpu_sgnblk_t *)); 280*7c478bd9Sstevel@tonic-gate extern int sgnblk_poll_reference(void (*)(cpu_sgnblk_t *, void *), void *); 281*7c478bd9Sstevel@tonic-gate extern void sgnblk_poll_unreference(void (*)(cpu_sgnblk_t *, void *)); 282*7c478bd9Sstevel@tonic-gate 283*7c478bd9Sstevel@tonic-gate extern cpu_sgnblk_t *cpu_sgnblkp[NCPU]; 284*7c478bd9Sstevel@tonic-gate 285*7c478bd9Sstevel@tonic-gate /* 286*7c478bd9Sstevel@tonic-gate * Starfire specific signatures 287*7c478bd9Sstevel@tonic-gate */ 288*7c478bd9Sstevel@tonic-gate #define POST_SIG SIG_BLD('P', 'O') 289*7c478bd9Sstevel@tonic-gate #define DHLP_SIG SIG_BLD('D', 'H') 290*7c478bd9Sstevel@tonic-gate 291*7c478bd9Sstevel@tonic-gate /* 292*7c478bd9Sstevel@tonic-gate * Starfire specific Sigblock states. 293*7c478bd9Sstevel@tonic-gate */ 294*7c478bd9Sstevel@tonic-gate #define SIGBST_NONE 0 /* no state */ 295*7c478bd9Sstevel@tonic-gate #define SIGBST_RUN 1 /* running */ 296*7c478bd9Sstevel@tonic-gate #define SIGBST_EXIT 2 /* finished */ 297*7c478bd9Sstevel@tonic-gate #define SIGBST_PRERUN 3 /* pre-exec */ 298*7c478bd9Sstevel@tonic-gate #define SIGBST_ARBSTOP 4 /* transient arbstop state */ 299*7c478bd9Sstevel@tonic-gate #define SIGBST_RESET 5 /* reset */ 300*7c478bd9Sstevel@tonic-gate #define SIGBST_POWEROFF 6 /* no power */ 301*7c478bd9Sstevel@tonic-gate #define SIGBST_DETACHED 7 /* spinning in OBP after DR DETACH */ 302*7c478bd9Sstevel@tonic-gate #define SIGBST_CALLBACK 8 /* kernel calling back into OBP */ 303*7c478bd9Sstevel@tonic-gate #define SIGBST_WATCHDOG 9 /* OBP running after watchdog */ 304*7c478bd9Sstevel@tonic-gate #define SIGBST_WATCHDOG_SYNC 10 /* OBP "sync" after watchdog reset */ 305*7c478bd9Sstevel@tonic-gate #define SIGBST_OFFLINE 11 /* cpu offline */ 306*7c478bd9Sstevel@tonic-gate #define SIGBST_BOOTING 12 /* booting */ 307*7c478bd9Sstevel@tonic-gate #define SIGBST_UNKNOWN 13 /* unknown */ 308*7c478bd9Sstevel@tonic-gate #define SIGBST_XIR 14 /* OBP running after XIR */ 309*7c478bd9Sstevel@tonic-gate #define SIGBST_XIR_SYNC 15 /* OBP trying "sync" in XIR */ 310*7c478bd9Sstevel@tonic-gate #define SIGBST_SIR 16 /* OBP running after SIR */ 311*7c478bd9Sstevel@tonic-gate #define SIGBST_SIR_SYNC 17 /* OBP trying "sync" in SIR */ 312*7c478bd9Sstevel@tonic-gate #define SIGBST_REDMODE 18 /* OBP running after REDMODE */ 313*7c478bd9Sstevel@tonic-gate #define SIGBST_REDMODE_SYNC 19 /* OBP trying "sync" in REDMODE */ 314*7c478bd9Sstevel@tonic-gate #define SIGBST_QUIESCED 20 /* system quiesced */ 315*7c478bd9Sstevel@tonic-gate #define SIGBST_QUIESCE_INPROGRESS 21 /* system quiesce in-progress */ 316*7c478bd9Sstevel@tonic-gate #define SIGBST_RESUME_INPROGRESS 22 /* system resume in-progress */ 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate /* 319*7c478bd9Sstevel@tonic-gate * Starfire specific Sigblock sub-states 320*7c478bd9Sstevel@tonic-gate */ 321*7c478bd9Sstevel@tonic-gate #define EXIT_NULL 0 322*7c478bd9Sstevel@tonic-gate #define EXIT_HALT 1 323*7c478bd9Sstevel@tonic-gate #define EXIT_ENVIRON 2 324*7c478bd9Sstevel@tonic-gate #define EXIT_REBOOT 3 325*7c478bd9Sstevel@tonic-gate #define EXIT_PANIC1 4 326*7c478bd9Sstevel@tonic-gate #define EXIT_PANIC2 5 327*7c478bd9Sstevel@tonic-gate #define EXIT_HUNG 6 328*7c478bd9Sstevel@tonic-gate #define EXIT_WATCH 7 329*7c478bd9Sstevel@tonic-gate #define EXIT_PANIC_REBOOT 8 330*7c478bd9Sstevel@tonic-gate #define EXIT_WATCHDOG_REBOOT 9 331*7c478bd9Sstevel@tonic-gate #define EXIT_SOFT_INIT_RESET 10 /* SIR */ 332*7c478bd9Sstevel@tonic-gate #define EXIT_EXTERN_INIT_RESET 11 /* XIR */ 333*7c478bd9Sstevel@tonic-gate #define EXIT_REDMODE_REBOOT 12 /* REDMODE */ 334*7c478bd9Sstevel@tonic-gate #define EXIT_OBP_RESET 13 /* OBP RESET */ 335*7c478bd9Sstevel@tonic-gate 336*7c478bd9Sstevel@tonic-gate #else 337*7c478bd9Sstevel@tonic-gate 338*7c478bd9Sstevel@tonic-gate #define REGISTER_BBUS_INTR() 339*7c478bd9Sstevel@tonic-gate #define CPU_SGN_MAPIN(cpuid) 340*7c478bd9Sstevel@tonic-gate #define CPU_SGN_MAPOUT(cpuid) 341*7c478bd9Sstevel@tonic-gate #define CPU_SGN_EXISTS(cpuid) (0) 342*7c478bd9Sstevel@tonic-gate #define SGN_CPU_IS_OS(cpuid) (0) 343*7c478bd9Sstevel@tonic-gate #define SGN_CPU_IS_OBP(cpuid) (0) 344*7c478bd9Sstevel@tonic-gate #define SGN_CPU_STATE_IS_DETACHED(cpuid) (0) 345*7c478bd9Sstevel@tonic-gate 346*7c478bd9Sstevel@tonic-gate #endif /* _STARFIRE */ 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 349*7c478bd9Sstevel@tonic-gate 350*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 351*7c478bd9Sstevel@tonic-gate } 352*7c478bd9Sstevel@tonic-gate #endif 353*7c478bd9Sstevel@tonic-gate 354*7c478bd9Sstevel@tonic-gate #endif /* _CPU_SGN_H */ 355