mpmbox.h 2.0 KB

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