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