diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-01-25 19:00:37 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-01-25 19:00:37 -0800 |
commit | e0e1662fc1a89c2189217e43a9364e63110c685a (patch) | |
tree | a350a54a0aaf0289e66e7b41ce595f4dea990e3e /pk/pk.S | |
parent | 8c4a41f9835d56437c44631d97ef592e948385d9 (diff) | |
download | pk-e0e1662fc1a89c2189217e43a9364e63110c685a.zip pk-e0e1662fc1a89c2189217e43a9364e63110c685a.tar.gz pk-e0e1662fc1a89c2189217e43a9364e63110c685a.tar.bz2 |
rename binary to pk; change argv handling
the new fesvr approach makes argv[0] = pk, rather than user program's name
Diffstat (limited to 'pk/pk.S')
-rw-r--r-- | pk/pk.S | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +#include "pcr.h" +#include "pk.h" + +.section .text,"ax",@progbits +.globl _start +.ent _start +_start: + + lui sp, %hi(stack_top) + add sp, sp, %lo(stack_top) + + lui t0, %hi(trap_entry) + add t0, t0, %lo(trap_entry) + mtpcr t0, ASM_CR(PCR_EVEC) + +#ifdef __riscv64 + li t0, SR_S | SR_PS | SR_ET | SR_EC | SR_S64 +#else + li t0, SR_S | SR_PS | SR_ET | SR_EC +#endif + or t1, t0, SR_EF | SR_EV + mtpcr t1, ASM_CR(PCR_SR) + mfpcr t1, ASM_CR(PCR_SR) + mtpcr t0, ASM_CR(PCR_SR) + + and t2, t1, SR_EF + lui t0, %hi(have_fp) + sw t2, %lo(have_fp)(t0) + + and t2, t1, SR_EV + lui t0, %hi(have_vector) + sw t2, %lo(have_vector)(t0) + + lui t0, %hi(boot) + jalr.j t0, %lo(boot) + #j boot + +.end _start |