From 1e78526274b0fc0f2e25463ec91fa1ccf22bc8aa Mon Sep 17 00:00:00 2001 From: Andrew Gallatin Date: Mon, 16 Oct 2000 20:15:43 +0000 Subject: [PATCH] Fix problems booting large kernels on alphas. The symptom is that the kernel loads, prints the copyright, and either hangs or locks solid. The PC tends to be in the data segment and the RA is in XentMM Doug really came up with the fix, I'm just the monkey typing. Doug says: The alpha can only support 64k of globals with $gp pointing at base+32k so that the code can use 16bit signed offsets from $gp to access it. .... it is possible to have multiple .got subsections and the linker handles this with the relocations for 'ldgp' pseudo instructions. [Without this patch] the code in exception.s has been linked to use a different gp from locore.s (where pal_kgp is set). Reviewed by: dfr --- sys/alpha/alpha/exception.s | 4 ++++ sys/alpha/include/asm.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/alpha/alpha/exception.s b/sys/alpha/alpha/exception.s index 417c5ddd921..ad9d8a9f30a 100644 --- a/sys/alpha/alpha/exception.s +++ b/sys/alpha/alpha/exception.s @@ -124,6 +124,8 @@ /* syscall number, passed in v0, is first arg, frame pointer second */ mov v0,a0 mov sp,a1 ; .loc 1 __LINE__ + br pv,XentSys1 +XentSys1: LDGP(pv) CALL(syscall) jmp zero, exception_return @@ -147,6 +149,8 @@ LEAF(XentUna, 3) /* XXX should be NESTED */ /* a0, a1, & a2 already set up */ ldiq a3, ALPHA_KENTRY_UNA mov sp, a4 ; .loc 1 __LINE__ + br pv, XentUna1 +XentUna1: LDGP(pv) CALL(trap) jmp zero, exception_return diff --git a/sys/alpha/include/asm.h b/sys/alpha/include/asm.h index d46eb972868..2b4efe0b00e 100644 --- a/sys/alpha/include/asm.h +++ b/sys/alpha/include/asm.h @@ -250,7 +250,10 @@ #define PALVECT(_name_) \ ESETUP(_name_); \ - ERSAVE() + ERSAVE(); \ + br pv, _name_##lgp; \ +_name_##lgp:; \ + LDGP(pv) #define ESETUP(_name_) \ .loc 1 __LINE__; \