diff options
author | jake <jake@FreeBSD.org> | 2002-02-23 03:38:18 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-02-23 03:38:18 +0000 |
commit | 9ee486a3f2ecdda839f097d63899d4fc57b5e767 (patch) | |
tree | 23f1fe7b2427ebff12733cbcaf5d004c4271c58d /sys/boot/sparc64 | |
parent | 3088b53a9a745aca8d9a6e06ac6c7e7f879bd62c (diff) | |
download | FreeBSD-src-9ee486a3f2ecdda839f097d63899d4fc57b5e767.zip FreeBSD-src-9ee486a3f2ecdda839f097d63899d4fc57b5e767.tar.gz |
Allocate a frame on our initial stack so that it doesn't run off into
random memory. Disable interrupts while loading the tlb.
Submitted by: tmm
Diffstat (limited to 'sys/boot/sparc64')
-rw-r--r-- | sys/boot/sparc64/loader/locore.S | 18 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/locore.s | 18 |
2 files changed, 24 insertions, 12 deletions
diff --git a/sys/boot/sparc64/loader/locore.S b/sys/boot/sparc64/loader/locore.S index 8f3c401..8d89c3d 100644 --- a/sys/boot/sparc64/loader/locore.S +++ b/sys/boot/sparc64/loader/locore.S @@ -11,7 +11,9 @@ #include <machine/asi.h> #include <machine/asm.h> #include <machine/pstate.h> -#include <machine/param.h> + +#define PAGE_SIZE 8192 +#define PAGE_SHIFT 13 #define SPOFF 2047 #define STACK_SIZE (2 * PAGE_SIZE) @@ -27,7 +29,7 @@ ENTRY(_start) wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate wr %g0, 0x4, %fprs - setx stack + STACK_SIZE - SPOFF, %l7, %l6 + setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6 mov %l6, %sp call main mov %o4, %o0 @@ -85,23 +87,27 @@ ENTRY(dtlb_va_to_pa) * %o3 = flags */ ENTRY(itlb_enter) + rdpr %pstate, %o4 + wrpr %o4, PSTATE_IE, %pstate sllx %o0, 3, %o0 or %o1, %o3, %o1 mov AA_IMMU_TAR, %o3 stxa %o2, [%o3] ASI_IMMU - membar #Sync stxa %o1, [%o0] ASI_ITLB_DATA_ACCESS_REG + membar #Sync retl - nop + wrpr %o4, 0, %pstate ENTRY(dtlb_enter) + rdpr %pstate, %o4 + wrpr %o4, PSTATE_IE, %pstate sllx %o0, 3, %o0 or %o1, %o3, %o1 mov AA_DMMU_TAR, %o3 stxa %o2, [%o3] ASI_DMMU - membar #Sync stxa %o1, [%o0] ASI_DTLB_DATA_ACCESS_REG + membar #Sync retl - nop + wrpr %o4, 0, %pstate .comm stack, STACK_SIZE, 32 diff --git a/sys/boot/sparc64/loader/locore.s b/sys/boot/sparc64/loader/locore.s index 8f3c401..8d89c3d 100644 --- a/sys/boot/sparc64/loader/locore.s +++ b/sys/boot/sparc64/loader/locore.s @@ -11,7 +11,9 @@ #include <machine/asi.h> #include <machine/asm.h> #include <machine/pstate.h> -#include <machine/param.h> + +#define PAGE_SIZE 8192 +#define PAGE_SHIFT 13 #define SPOFF 2047 #define STACK_SIZE (2 * PAGE_SIZE) @@ -27,7 +29,7 @@ ENTRY(_start) wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate wr %g0, 0x4, %fprs - setx stack + STACK_SIZE - SPOFF, %l7, %l6 + setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6 mov %l6, %sp call main mov %o4, %o0 @@ -85,23 +87,27 @@ ENTRY(dtlb_va_to_pa) * %o3 = flags */ ENTRY(itlb_enter) + rdpr %pstate, %o4 + wrpr %o4, PSTATE_IE, %pstate sllx %o0, 3, %o0 or %o1, %o3, %o1 mov AA_IMMU_TAR, %o3 stxa %o2, [%o3] ASI_IMMU - membar #Sync stxa %o1, [%o0] ASI_ITLB_DATA_ACCESS_REG + membar #Sync retl - nop + wrpr %o4, 0, %pstate ENTRY(dtlb_enter) + rdpr %pstate, %o4 + wrpr %o4, PSTATE_IE, %pstate sllx %o0, 3, %o0 or %o1, %o3, %o1 mov AA_DMMU_TAR, %o3 stxa %o2, [%o3] ASI_DMMU - membar #Sync stxa %o1, [%o0] ASI_DTLB_DATA_ACCESS_REG + membar #Sync retl - nop + wrpr %o4, 0, %pstate .comm stack, STACK_SIZE, 32 |