launch.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
  7. * Copyright (C) 2000 by Colin Ngam
  8. */
  9. #ifndef _ASM_SN_LAUNCH_H
  10. #define _ASM_SN_LAUNCH_H
  11. #include <asm/sn/types.h>
  12. #include <asm/sn/addrs.h>
  13. /*
  14. * The launch data structure resides at a fixed place in each node's memory
  15. * and is used to communicate between the master processor and the slave
  16. * processors.
  17. *
  18. * The master stores launch parameters in the launch structure
  19. * corresponding to a target processor that is in a slave loop, then sends
  20. * an interrupt to the slave processor. The slave calls the desired
  21. * function, then returns to the slave loop. The master may poll or wait
  22. * for the slaves to finish.
  23. *
  24. * There is an array of launch structures, one per CPU on the node. One
  25. * interrupt level is used per local CPU.
  26. */
  27. #define LAUNCH_MAGIC 0xaddbead2addbead3
  28. #ifdef CONFIG_SGI_IP27
  29. #define LAUNCH_SIZEOF 0x100
  30. #define LAUNCH_PADSZ 0xa0
  31. #endif
  32. #define LAUNCH_OFF_MAGIC 0x00 /* Struct offsets for assembly */
  33. #define LAUNCH_OFF_BUSY 0x08
  34. #define LAUNCH_OFF_CALL 0x10
  35. #define LAUNCH_OFF_CALLC 0x18
  36. #define LAUNCH_OFF_CALLPARM 0x20
  37. #define LAUNCH_OFF_STACK 0x28
  38. #define LAUNCH_OFF_GP 0x30
  39. #define LAUNCH_OFF_BEVUTLB 0x38
  40. #define LAUNCH_OFF_BEVNORMAL 0x40
  41. #define LAUNCH_OFF_BEVECC 0x48
  42. #define LAUNCH_STATE_DONE 0 /* Return value of LAUNCH_POLL */
  43. #define LAUNCH_STATE_SENT 1
  44. #define LAUNCH_STATE_RECD 2
  45. /*
  46. * The launch routine is called only if the complement address is correct.
  47. *
  48. * Before control is transferred to a routine, the complement address
  49. * is zeroed (invalidated) to prevent an accidental call from a spurious
  50. * interrupt.
  51. *
  52. * The slave_launch routine turns on the BUSY flag, and the slave loop
  53. * clears the BUSY flag after control is returned to it.
  54. */
  55. #ifndef __ASSEMBLY__
  56. typedef int launch_state_t;
  57. typedef void (*launch_proc_t)(u64 call_parm);
  58. typedef struct launch_s {
  59. volatile u64 magic; /* Magic number */
  60. volatile u64 busy; /* Slave currently active */
  61. volatile launch_proc_t call_addr; /* Func. for slave to call */
  62. volatile u64 call_addr_c; /* 1's complement of call_addr*/
  63. volatile u64 call_parm; /* Single parm passed to call*/
  64. volatile void *stack_addr; /* Stack pointer for slave function */
  65. volatile void *gp_addr; /* Global pointer for slave func. */
  66. volatile char *bevutlb;/* Address of bev utlb ex handler */
  67. volatile char *bevnormal;/*Address of bev normal ex handler */
  68. volatile char *bevecc;/* Address of bev cache err handler */
  69. volatile char pad[160]; /* Pad to LAUNCH_SIZEOF */
  70. } launch_t;
  71. /*
  72. * PROM entry points for launch routines are determined by IPxxprom/start.s
  73. */
  74. #define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \
  75. launch_proc_t call_addr, \
  76. u64 call_parm, \
  77. void *stack_addr, \
  78. void *gp_addr)) \
  79. IP27PROM_LAUNCHSLAVE)
  80. #define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \
  81. IP27PROM_WAITSLAVE)
  82. #define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \
  83. IP27PROM_POLLSLAVE)
  84. #define LAUNCH_LOOP (*(void (*)(void)) \
  85. IP27PROM_SLAVELOOP)
  86. #define LAUNCH_FLASH (*(void (*)(void)) \
  87. IP27PROM_FLASHLEDS)
  88. #endif /* !__ASSEMBLY__ */
  89. #endif /* _ASM_SN_LAUNCH_H */