diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-01-07 02:33:00 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-01-07 02:33:00 +0000 |
commit | beb116954b9b7f3bb56412b2494b562f02b864b1 (patch) | |
tree | 120e997879884e1b9d93b265221b939d2ef1ade1 /include/asm-sparc/head.h | |
parent | 908d4681a1dc3792ecafbe64265783a86c4cccb6 (diff) |
Import of Linux/MIPS 2.1.14
Diffstat (limited to 'include/asm-sparc/head.h')
-rw-r--r-- | include/asm-sparc/head.h | 143 |
1 files changed, 91 insertions, 52 deletions
diff --git a/include/asm-sparc/head.h b/include/asm-sparc/head.h index b26067623..f89e41fc8 100644 --- a/include/asm-sparc/head.h +++ b/include/asm-sparc/head.h @@ -1,75 +1,114 @@ +/* $Id: head.h,v 1.30 1996/07/29 21:00:28 miguel Exp $ */ #ifndef __SPARC_HEAD_H #define __SPARC_HEAD_H -#define KERNSIZE 134217728 /* this is how much of a mapping the prom promises */ -#define PAGESIZE 4096 /* luckily this is the same on sun4c's and sun4m's */ -#define PAGESHIFT 12 -#define PROM_BASE -1568768 /* casa 'de PROM */ -#define LOAD_ADDR 0x4000 /* prom jumps to us here */ -#define C_STACK 96 +#define KERNBASE 0xf0000000 /* First address the kernel will eventually be */ +#define LOAD_ADDR 0x4000 /* prom jumps to us here unless this is elf /boot */ #define SUN4C_SEGSZ (1 << 18) -#define USRSTACK 0x0 /* no joke, this is temporary, trust me */ -#define INT_ENABLE_REG_PHYSADR 0xf5000000 -#define INTS_ENAB 0x01 +#define SRMMU_L1_KBASE_OFFSET ((KERNBASE>>24)<<2) /* Used in boot remapping. */ +#define INTS_ENAB 0x01 /* entry.S uses this. */ -#define BOOT_MSG_LEN 61 -#define BOOT_MSG2_LEN 50 +#define NCPUS 4 /* Architectural limit of sun4m. */ +#define SUN4_PROM_VECTOR 0xFFE81000 /* To safely die on a SUN4 */ +#define SUN4_PRINTF 0x84 /* Offset into SUN4_PROM_VECTOR */ -#define WRITE_PAUSE nop; nop; nop; - -#define PAGE_SIZE 4096 +#define WRITE_PAUSE nop; nop; nop; /* Have to do this after %wim/%psr chg */ +#define NOP_INSN 0x01000000 /* Used to patch sparc_save_state */ /* Here are some trap goodies */ - /* Generic trap entry. */ - #define TRAP_ENTRY(type, label) \ - mov (type), %l3; b label; rd %psr, %l0; nop; + rd %psr, %l0; b label; rd %wim, %l3; nop; + +/* Data/text faults. Defaults to sun4c version at boot time. */ +#define SPARC_TFAULT rd %psr, %l0; rd %wim, %l3; b sun4c_fault; mov 1, %l7; +#define SPARC_DFAULT rd %psr, %l0; rd %wim, %l3; b sun4c_fault; mov 0, %l7; +#define SRMMU_TFAULT rd %psr, %l0; rd %wim, %l3; b C_LABEL(srmmu_fault); mov 1, %l7; +#define SRMMU_DFAULT rd %psr, %l0; rd %wim, %l3; b C_LABEL(srmmu_fault); mov 0, %l7; + +/* This is for traps we should NEVER get. */ +#define BAD_TRAP(num) \ + rd %psr, %l0; mov num, %l7; b bad_trap_handler; rd %wim, %l3; + +/* Notice that for the system calls we pull a trick. We load up a + * different pointer to the system call vector table in %l7, but call + * the same generic system call low-level entry point. The trap table + * entry sequences are also HyperSparc pipeline friendly ;-) + */ + +/* Software trap for Linux system calls. */ +#define LINUX_SYSCALL_TRAP \ + sethi %hi(C_LABEL(sys_call_table)), %l7; \ + or %l7, %lo(C_LABEL(sys_call_table)), %l7; \ + b linux_sparc_syscall; \ + rd %psr, %l0; + +/* Software trap for SunOS4.1.x system calls. */ +#define SUNOS_SYSCALL_TRAP \ + rd %psr, %l0; \ + sethi %hi(C_LABEL(sunos_sys_table)), %l7; \ + b linux_sparc_syscall; \ + or %l7, %lo(C_LABEL(sunos_sys_table)), %l7; + +/* Software trap for Slowaris system calls. */ +#define SOLARIS_SYSCALL_TRAP \ + sethi %hi(C_LABEL(sys_call_table)), %l7; \ + or %l7, %lo(C_LABEL(sys_call_table)), %l7; \ + b solaris_syscall; \ + rd %psr, %l0; + +#define INDIRECT_SOLARIS_SYSCALL(x) \ + sethi %hi(C_LABEL(sys_call_table)), %l7; \ + or %g0,%lo(x),%g1; \ + b solaris_indirect_syscall; \ + rd %psr, %l0; + +#define BREAKPOINT_TRAP \ + b breakpoint_trap; \ + rd %psr,%l0; \ + nop; \ + nop; + +/* Software trap for Sparc-netbsd system calls. */ +#define NETBSD_SYSCALL_TRAP \ + sethi %hi(C_LABEL(sys_call_table)), %l7; \ + or %l7, %lo(C_LABEL(sys_call_table)), %l7; \ + b bsd_syscall; \ + rd %psr, %l0; + +/* The Get Condition Codes software trap for userland. */ +#define GETCC_TRAP \ + b getcc_trap_handler; mov %psr, %l0; nop; nop; + +/* The Set Condition Codes software trap for userland. */ +#define SETCC_TRAP \ + b setcc_trap_handler; mov %psr, %l0; nop; nop; /* This is for hard interrupts from level 1-14, 15 is non-maskable (nmi) and * gets handled with another macro. */ - #define TRAP_ENTRY_INTERRUPT(int_level) \ - mov int_level, %l3; b stray_irq_entry; rd %psr, %l0; nop; - -/* Here is the macro for soft interrupts (ie. not as urgent as hard ones) - * which need to jump to a different handler. + mov int_level, %l7; rd %psr, %l0; b real_irq_entry; rd %wim, %l3; + +/* NMI's (Non Maskable Interrupts) are special, you can't keep them + * from coming in, and basically if you get one, the shows over. ;( + * On the sun4c they are usually asynchronous memory errors, on the + * the sun4m they could be either due to mem errors or a software + * initiated interrupt from the prom/kern on an SMP box saying "I + * command you to do CPU tricks, read your mailbox for more info." */ +#define NMI_TRAP \ + rd %wim, %l3; b linux_trap_nmi_sun4c; mov %psr, %l0; nop; -#define TRAP_ENTRY_INTERRUPT_SOFT(int_level, ident) \ - mov int_level, %l3; rd %psr, %l0; b stray_irq_entry; mov ident, %l4; - -/* The above two macros are for generic traps. The following is made - * especially for timer interrupts at IRQ level 14. - */ - -#define TRAP_ENTRY_TIMER \ - mov 10, %l3; rd %psr, %l0; b sparc_timer; nop; - -/* Non-maskable interrupt entry macro. You have to turn off all interrupts - * to not receive this. This is usually due to a asynchronous memory error. - * All we can really do is stop the show. :-( - */ - -#define TRAP_ENTRY_INTERRUPT_NMI(t_type, jmp_to) \ - mov t_type, %l3; b jmp_to; rd %psr, %l0; nop; - -/* Trap entry code in entry.S needs the offsets into task_struct - * to get at the thread_struct goodies during window craziness. - * - * NOTE: We need to keep these values under 0x3ff in order to do - * efficient load/stores in the window fill/spill handlers. - * See TRAP_WIN_CLEAN in entry.S for details. +/* Window overflows/underflows are special and we need to try to be as + * efficient as possible here.... */ +#define WINDOW_SPILL \ + rd %psr, %l0; rd %wim, %l3; b spill_window_entry; andcc %l0, PSR_PS, %g0; -#define THREAD_UWINDOWS 0x3bc -#define THREAD_WIM 0x3c0 -#define THREAD_W_SAVED 0x3c4 -#define THREAD_KSP 0x3c8 -#define THREAD_USP 0x3cc -#define THREAD_REG_WINDOW 0x3d4 +#define WINDOW_FILL \ + rd %psr, %l0; rd %wim, %l3; b fill_window_entry; andcc %l0, PSR_PS, %g0; #endif __SPARC_HEAD_H |