Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
0007  * Copyright (C) 2000 by Colin Ngam
0008  */
0009 #ifndef _ASM_SN_LAUNCH_H
0010 #define _ASM_SN_LAUNCH_H
0011 
0012 #include <asm/sn/types.h>
0013 #include <asm/sn/addrs.h>
0014 
0015 /*
0016  * The launch data structure resides at a fixed place in each node's memory
0017  * and is used to communicate between the master processor and the slave
0018  * processors.
0019  *
0020  * The master stores launch parameters in the launch structure
0021  * corresponding to a target processor that is in a slave loop, then sends
0022  * an interrupt to the slave processor.  The slave calls the desired
0023  * function, then returns to the slave loop.  The master may poll or wait
0024  * for the slaves to finish.
0025  *
0026  * There is an array of launch structures, one per CPU on the node.  One
0027  * interrupt level is used per local CPU.
0028  */
0029 
0030 #define LAUNCH_MAGIC        0xaddbead2addbead3
0031 #ifdef CONFIG_SGI_IP27
0032 #define LAUNCH_SIZEOF       0x100
0033 #define LAUNCH_PADSZ        0xa0
0034 #endif
0035 
0036 #define LAUNCH_OFF_MAGIC    0x00    /* Struct offsets for assembly      */
0037 #define LAUNCH_OFF_BUSY     0x08
0038 #define LAUNCH_OFF_CALL     0x10
0039 #define LAUNCH_OFF_CALLC    0x18
0040 #define LAUNCH_OFF_CALLPARM 0x20
0041 #define LAUNCH_OFF_STACK    0x28
0042 #define LAUNCH_OFF_GP       0x30
0043 #define LAUNCH_OFF_BEVUTLB  0x38
0044 #define LAUNCH_OFF_BEVNORMAL    0x40
0045 #define LAUNCH_OFF_BEVECC   0x48
0046 
0047 #define LAUNCH_STATE_DONE   0   /* Return value of LAUNCH_POLL      */
0048 #define LAUNCH_STATE_SENT   1
0049 #define LAUNCH_STATE_RECD   2
0050 
0051 /*
0052  * The launch routine is called only if the complement address is correct.
0053  *
0054  * Before control is transferred to a routine, the complement address
0055  * is zeroed (invalidated) to prevent an accidental call from a spurious
0056  * interrupt.
0057  *
0058  * The slave_launch routine turns on the BUSY flag, and the slave loop
0059  * clears the BUSY flag after control is returned to it.
0060  */
0061 
0062 #ifndef __ASSEMBLY__
0063 
0064 typedef int launch_state_t;
0065 typedef void (*launch_proc_t)(u64 call_parm);
0066 
0067 typedef struct launch_s {
0068     volatile u64        magic;  /* Magic number             */
0069     volatile u64        busy;   /* Slave currently active       */
0070     volatile launch_proc_t  call_addr;  /* Func. for slave to call  */
0071     volatile u64        call_addr_c;    /* 1's complement of call_addr*/
0072     volatile u64        call_parm;  /* Single parm passed to call*/
0073     volatile void *stack_addr;  /* Stack pointer for slave function */
0074     volatile void *gp_addr;     /* Global pointer for slave func.   */
0075     volatile char       *bevutlb;/* Address of bev utlb ex handler   */
0076     volatile char       *bevnormal;/*Address of bev normal ex handler */
0077     volatile char       *bevecc;/* Address of bev cache err handler */
0078     volatile char       pad[160];   /* Pad to LAUNCH_SIZEOF     */
0079 } launch_t;
0080 
0081 /*
0082  * PROM entry points for launch routines are determined by IPxxprom/start.s
0083  */
0084 
0085 #define LAUNCH_SLAVE    (*(void (*)(int nasid, int cpu, \
0086                     launch_proc_t call_addr, \
0087                     u64 call_parm, \
0088                     void *stack_addr, \
0089                     void *gp_addr)) \
0090              IP27PROM_LAUNCHSLAVE)
0091 
0092 #define LAUNCH_WAIT (*(void (*)(int nasid, int cpu, int timeout_msec)) \
0093              IP27PROM_WAITSLAVE)
0094 
0095 #define LAUNCH_POLL (*(launch_state_t (*)(int nasid, int cpu)) \
0096              IP27PROM_POLLSLAVE)
0097 
0098 #define LAUNCH_LOOP (*(void (*)(void)) \
0099              IP27PROM_SLAVELOOP)
0100 
0101 #define LAUNCH_FLASH    (*(void (*)(void)) \
0102              IP27PROM_FLASHLEDS)
0103 
0104 #endif /* !__ASSEMBLY__ */
0105 
0106 #endif /* _ASM_SN_LAUNCH_H */