diff options
author | Andrew Waterman <waterman@ubuntu.(none)> | 2010-08-22 21:25:41 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@ubuntu.(none)> | 2010-08-22 21:25:41 -0700 |
commit | 79a84855df0e7cc1aeba886d8e1d21487af6a3c1 (patch) | |
tree | b44859bb1fd2110d18b96f940aa7d41ac4e00d9a /pk | |
parent | 29cc0dc9854c66f12bd65e12516f68ccd9a741da (diff) | |
download | pk-79a84855df0e7cc1aeba886d8e1d21487af6a3c1.zip pk-79a84855df0e7cc1aeba886d8e1d21487af6a3c1.tar.gz pk-79a84855df0e7cc1aeba886d8e1d21487af6a3c1.tar.bz2 |
[pk] Fixed broken PK build process (moved boot into a .c file)
Diffstat (limited to 'pk')
-rw-r--r-- | pk/boot.S | 23 | ||||
-rw-r--r-- | pk/entry.S | 4 | ||||
-rw-r--r-- | pk/pcr.h | 3 | ||||
-rw-r--r-- | pk/pk.ld | 2 | ||||
-rw-r--r-- | pk/pk.mk.in | 1 | ||||
-rw-r--r-- | pk/riscv-pk.c | 21 |
6 files changed, 24 insertions, 30 deletions
diff --git a/pk/boot.S b/pk/boot.S deleted file mode 100644 index 0619671..0000000 --- a/pk/boot.S +++ /dev/null @@ -1,23 +0,0 @@ -#include "pcr.h" - - .section boottext - .global __start - .ent __start -__start: - - # set up SR - li $t0, SR_S | SR_PS | SR_ET | SR_UX | SR_KX - mtpcr $t0, $0 - - # set up trap table - la $t0, trap_table - mtpcr $t0, $3 - - # set up stack - la $sp,stack_top-64 - - # call into kernel - la $t0, boot - jr $t0 - - .end __start @@ -90,8 +90,10 @@ pop_tf: # write the trap frame onto the stack #define TRAP_TABLE_ENTRY(x) \ .align 7; \ - move $k0,$ra; \ + .set at=$k0; \ la $k1,stack_top-320; \ + .set noat; \ + move $k0,$ra; \ jal save_tf; \ move $sp,$k1; \ move $a0,$k1; \ @@ -9,6 +9,9 @@ #define SR_KX 0x0000000000000040 #define SR_IM 0x000000000000FF00 +#define PCR_SR 0 +#define PCR_TBR 3 + #ifndef __ASSEMBLER__ #define mtpcr(val,reg) ({ long __tmp = (long)(val); \ @@ -16,7 +16,7 @@ SECTIONS . = 0x00000000; .boottext : { - *(.boottext) + riscv-pk.o(.boottext) } . = 0x70000000; diff --git a/pk/pk.mk.in b/pk/pk.mk.in index a89ee2b..a9957ed 100644 --- a/pk/pk.mk.in +++ b/pk/pk.mk.in @@ -12,7 +12,6 @@ pk_srcs = \ pk_asm_srcs = \ entry.S \ - boot.S \ pk_test_srcs = diff --git a/pk/riscv-pk.c b/pk/riscv-pk.c index b25b339..dfcc71d 100644 --- a/pk/riscv-pk.c +++ b/pk/riscv-pk.c @@ -1,6 +1,19 @@ -// force the linker to pull in our __start from boot.S. -void* dummy() +#include "pcr.h" + +void __attribute__((section(".boottext"))) __start() { - extern void __start(); - return &__start; + extern char stack_top; + asm("move $sp,%0" : : "r"(&stack_top-64)); + + register long sr0 = SR_S | SR_PS | SR_ET | SR_UX | SR_KX; + mtpcr(sr0,PCR_SR); + + extern char trap_table; + register void* tt = &trap_table; + mtpcr(tt,PCR_TBR); + + extern void boot(); + register void (*boot_p)() = &boot; + asm("" : "=r"(boot_p) : "0"(boot_p)); + boot_p(); } |