1 /* mpmbox.h: Interface and defines for the OpenProm mailbox 2 * facilities for MP machines under Linux. 3 * 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5 */ 6 7 #ifndef _SPARC_MPMBOX_H 8 #define _SPARC_MPMBOX_H 9 10 /* The prom allocates, for each CPU on the machine an unsigned 11 * byte in physical ram. You probe the device tree prom nodes 12 * for these values. The purpose of this byte is to be able to 13 * pass messages from one cpu to another. 14 */ 15 16 /* These are the main message types we have to look for in our 17 * Cpu mailboxes, based upon these values we decide what course 18 * of action to take. 19 */ 20 21 /* The CPU is executing code in the kernel. */ 22 #define MAILBOX_ISRUNNING 0xf0 23 24 /* Another CPU called romvec->pv_exit(), you should call 25 * prom_stopcpu() when you see this in your mailbox. 26 */ 27 #define MAILBOX_EXIT 0xfb 28 29 /* Another CPU called romvec->pv_enter(), you should call 30 * prom_cpuidle() when this is seen. 31 */ 32 #define MAILBOX_GOSPIN 0xfc 33 34 /* Another CPU has hit a breakpoint either into kadb or the prom 35 * itself. Just like MAILBOX_GOSPIN, you should call prom_cpuidle() 36 * at this point. 37 */ 38 #define MAILBOX_BPT_SPIN 0xfd 39 40 /* Oh geese, some other nitwit got a damn watchdog reset. The partys 41 * over so go call prom_stopcpu(). 42 */ 43 #define MAILBOX_WDOG_STOP 0xfe 44 45 #ifndef __ASSEMBLY__ 46 47 /* Handy macro's to determine a cpu's state. */ 48 49 /* Is the cpu still in Power On Self Test? */ 50 #define MBOX_POST_P(letter) ((letter) >= 0x00 && (letter) <= 0x7f) 51 52 /* Is the cpu at the 'ok' prompt of the PROM? */ 53 #define MBOX_PROMPROMPT_P(letter) ((letter) >= 0x80 && (letter) <= 0x8f) 54 55 /* Is the cpu spinning in the PROM? */ 56 #define MBOX_PROMSPIN_P(letter) ((letter) >= 0x90 && (letter) <= 0xef) 57 58 /* Sanity check... This is junk mail, throw it out. */ 59 #define MBOX_BOGON_P(letter) ((letter) >= 0xf1 && (letter) <= 0xfa) 60 61 /* Is the cpu actively running an application/kernel-code? */ 62 #define MBOX_RUNNING_P(letter) ((letter) == MAILBOX_ISRUNNING) 63 64 #endif /* !(__ASSEMBLY__) */ 65 66 #endif /* !(_SPARC_MPMBOX_H) */