root/include/asm-sparc/head.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef __SPARC_HEAD_H
   2 #define __SPARC_HEAD_H
   3 
   4 #define KERNBASE        0xf0000000  /* First address the kernel will eventually be */
   5 #define LOAD_ADDR       0x4000      /* prom jumps to us here unless this is elf /boot */
   6 #define C_STACK         96
   7 #define SUN4C_SEGSZ     (1 << 18)
   8 #define SRMMU_L1_KBASE_OFFSET ((KERNBASE>>24)<<2)  /* Used in boot remapping. */
   9 #define INTS_ENAB   0x01            /* entry.S uses this. */
  10 
  11 #define NCPUS           4            /* Architectual limit of sun4m. */
  12 
  13 #define  SUN4_PROM_VECTOR   0xFFE81000    /* To safely die on a SUN4 */
  14 #define  SUN4_PRINTF   0x84               /* Offset into SUN4_PROM_VECTOR */
  15 
  16 #define WRITE_PAUSE     nop; nop; nop;
  17 
  18 #define NOP_INSN        0x01000000        /* Used to patch sparc_save_state */
  19 
  20 /* Here are some trap goodies */
  21 
  22 /* Generic trap entry. */
  23 #define TRAP_ENTRY(type, label) \
  24         mov (type), %l3; b label; rd %psr, %l0; nop;
  25 
  26 /* Notice that for the system calls we pull a trick.  We load up a
  27  * different pointer to the system call vector table in %l7, but call
  28  * the same generic system call low-level entry point.  The trap table
  29  * entry sequences are also HyperSparc pipeline friendly ;-)
  30  */
  31 
  32 /* Software trap for Linux system calls. */
  33 #define LINUX_SYSCALL_TRAP \
  34         sethi %hi(C_LABEL(sys_call_table)), %l7; or %l7, %lo(C_LABEL(sys_call_table)), %l7; b linux_sparc_syscall; mov %psr, %l0;
  35 
  36 /* Software trap for SunOS4.1.x system calls. */
  37 #define SUNOS_SYSCALL_TRAP \
  38         sethi %hi(C_LABEL(sys_call_table)), %l7; or %l7, %lo(C_LABEL(sys_call_table)), %l7; b linux_sparc_syscall; mov %psr, %l0;
  39 
  40 /* Software trap for Slowaris system calls. */
  41 #define SOLARIS_SYSCALL_TRAP \
  42         sethi %hi(C_LABEL(sys_call_table)), %l7; or %l7, %lo(C_LABEL(sys_call_table)), %l7; b linux_sparc_syscall; mov %psr, %l0;
  43 
  44 /* Software trap for Sparc-netbsd system calls. */
  45 #define NETBSD_SYSCALL_TRAP \
  46         sethi %hi(C_LABEL(sys_call_table)), %l7; or %l7, %lo(C_LABEL(sys_call_table)), %l7; b linux_sparc_syscall; mov %psr, %l0;
  47 
  48 /* The Get Condition Codes software trap for userland. */
  49 #define GETCC_TRAP \
  50         b getcc_trap_handler; mov %psr, %l0; nop; nop
  51 
  52 /* The Set Condition Codes software trap for userland. */
  53 #define SETCC_TRAP \
  54         b setcc_trap_handler; mov %psr, %l0; nop; nop
  55 
  56 /* This is for hard interrupts from level 1-14, 15 is non-maskable (nmi) and
  57  * gets handled with another macro.
  58  */
  59 #define TRAP_ENTRY_INTERRUPT(int_level) \
  60         mov int_level, %l3; b real_irq_entry; rd %psr, %l0; nop;
  61 
  62 /* NMI's (Non Maskable Interrupts) are special, you can't keep them
  63  * from coming in, and basically if you get one, the shows over. ;(
  64  */
  65 #define NMI_TRAP \
  66         b linux_trap_nmi; mov %psr, %l0; nop; nop
  67 
  68 /* The above two macros are for generic traps. The following is made
  69  * especially for timer interrupts at IRQ level 14.
  70  */
  71 #define TRAP_ENTRY_TIMER \
  72         rd %psr, %l0; b sparc_timer; nop; nop;
  73 
  74 /* Trap entry code in entry.S needs the offsets into task_struct
  75  * to get at the thread_struct goodies during window craziness.
  76  *
  77  * NOTE: We need to keep these values under 0x3ff in order to do
  78  *       efficient load/stores in the window fill/spill handlers.
  79  *       See TRAP_WIN_CLEAN in entry.S for details.
  80  */
  81 
  82 /* First generic task_struct offsets */
  83 #define TASK_STATE        0x000
  84 #define TASK_PRI          0x008
  85 #define TASK_KSTACK_PG    0x250
  86 
  87 #define THREAD_UWINDOWS   0x3b8
  88 #define THREAD_WIM        0x3bc
  89 #define THREAD_W_SAVED    0x3c0
  90 #define THREAD_KSP        0x3c4
  91 #define THREAD_USP        0x3c8
  92 #define THREAD_PSR        0x3cc
  93 #define THREAD_PC         0x3d0
  94 #define THREAD_NPC        0x3d4
  95 #define THREAD_Y          0x3d8
  96 #define THREAD_REG_WINDOW 0x3e0
  97 
  98 /* More fun offset macros. These are for pt_regs. */
  99 
 100 #define PT_PSR    0x0
 101 #define PT_PC     0x4
 102 #define PT_NPC    0x8
 103 #define PT_Y      0xc
 104 #define PT_G0     0x10
 105 #define PT_G1     0x14
 106 #define PT_G2     0x18
 107 #define PT_G3     0x1c
 108 #define PT_G4     0x20
 109 #define PT_G5     0x24
 110 #define PT_G6     0x28
 111 #define PT_G7     0x2c
 112 #define PT_I0     0x30
 113 #define PT_I1     0x34
 114 #define PT_I2     0x38
 115 #define PT_I3     0x3c
 116 #define PT_I4     0x40
 117 #define PT_I5     0x44
 118 #define PT_I6     0x48
 119 #define PT_I7     0x4c
 120 
 121 #endif __SPARC_HEAD_H

/* [previous][next][first][last][top][bottom][index][help] */