Compare commits
1 commit
c9ad69a32d
...
3e27882a75
Author | SHA1 | Date | |
---|---|---|---|
3e27882a75 |
3 changed files with 3 additions and 9 deletions
|
@ -2,7 +2,6 @@
|
|||
#include <am.h>
|
||||
#include <klib.h>
|
||||
#include <riscv/riscv.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static Context *(*user_handler)(Event, Context *) = NULL;
|
||||
|
||||
|
@ -38,10 +37,7 @@ bool cte_init(Context *(*handler)(Event, Context *)) {
|
|||
}
|
||||
|
||||
Context *kcontext(Area kstack, void (*entry)(void *), void *arg) {
|
||||
Context *c = kstack.end - sizeof(Context);
|
||||
c->mepc = (uintptr_t)entry;
|
||||
c->gpr[10] = (uintptr_t)arg;
|
||||
return c;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void yield() {
|
||||
|
|
|
@ -60,8 +60,6 @@ __am_asm_trap:
|
|||
mv a0, sp
|
||||
jal __am_irq_handle
|
||||
|
||||
mv sp, a0
|
||||
|
||||
LOAD t1, OFFSET_STATUS(sp)
|
||||
LOAD t2, OFFSET_EPC(sp)
|
||||
csrw mstatus, t1
|
||||
|
|
|
@ -158,6 +158,8 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
|
|||
static Decode s;
|
||||
nemu_state.state = NEMU_RUNNING;
|
||||
do {
|
||||
exec_once(&s, cpu.pc);
|
||||
g_nr_guest_inst++;
|
||||
for (int i = 0; i < len; i++) {
|
||||
size_t addr = bp[i].addr;
|
||||
bp_type_t bptype = bp[i].type;
|
||||
|
@ -174,8 +176,6 @@ breakpoint_t *cpu_exec_with_bp(uint64_t n, breakpoint_t *bp, size_t len) {
|
|||
return bp + i;
|
||||
}
|
||||
}
|
||||
exec_once(&s, cpu.pc);
|
||||
g_nr_guest_inst++;
|
||||
if (nemu_state.state != NEMU_RUNNING)
|
||||
return NULL;
|
||||
} while (--n);
|
||||
|
|
Loading…
Reference in a new issue