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