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