mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-06 06:53:39 +00:00
Cleanup syscall numbers
This commit is contained in:
parent
61fe0e8647
commit
9d6e6790e1
19 changed files with 32 additions and 32 deletions
|
|
@ -1,10 +1,11 @@
|
|||
// Definitions needed by both host and target
|
||||
|
||||
// CSRs for exposed host functions
|
||||
#define UVM32_SYSCALL_PRINT 0x13A
|
||||
#define UVM32_SYSCALL_PRINTLN 0x13B
|
||||
#define UVM32_SYSCALL_PRINTD 0x13C
|
||||
#define UVM32_SYSCALL_PRINTX 0x13D
|
||||
#define UVM32_SYSCALL_MILLIS 0x13F
|
||||
#define UVM32_SYSCALL_PRINTC 0x140
|
||||
// syscalls for exposed host functions, start at 0
|
||||
#define UVM32_SYSCALL_PRINTC 0x00000000
|
||||
#define UVM32_SYSCALL_GETC 0x00000001
|
||||
#define UVM32_SYSCALL_PRINT 0x00000002
|
||||
#define UVM32_SYSCALL_PRINTLN 0x00000003
|
||||
#define UVM32_SYSCALL_PRINTD 0x00000004
|
||||
#define UVM32_SYSCALL_PRINTX 0x00000005
|
||||
#define UVM32_SYSCALL_MILLIS 0x00000006
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// System provided UVM32_SYSCALLs
|
||||
#define UVM32_SYSCALL_HALT 0x138
|
||||
#define UVM32_SYSCALL_YIELD 0x139
|
||||
// System provided UVM32_SYSCALLs, start at 0x10000000
|
||||
#define UVM32_SYSCALL_HALT 0x1000000
|
||||
#define UVM32_SYSCALL_YIELD 0x1000001
|
||||
|
||||
#include "uvm32_common_custom.h"
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter)
|
|||
get_safeptr_terminated(vmst, value, 0x00, &vmst->ioevt.data.syscall.val.buf);
|
||||
break;
|
||||
case UVM32_SYSCALL_TYP_U32_RD:
|
||||
// pass link to r1 for user function to update
|
||||
vmst->ioevt.data.syscall.val.u32p = &vmst->core->regs[11];
|
||||
break;
|
||||
}
|
||||
|
|
@ -167,6 +168,7 @@ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter)
|
|||
}
|
||||
// no mapping found
|
||||
if (!syscall_valid) {
|
||||
printf("BADSYS %08x halt=%08x YIELD=%08x\n", syscall, UVM32_SYSCALL_HALT, UVM32_SYSCALL_YIELD);
|
||||
setStatusErr(vmst, UVM32_ERR_BAD_SYSCALL);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// "well-known" system UVM32_SYSCALL functions
|
||||
#define UVM32_SYSCALL_HALT 0x138
|
||||
#define UVM32_SYSCALL_YIELD 0x139
|
||||
#include "common/uvm32_sys.h"
|
||||
|
||||
#define LIST_OF_UVM32_ERRS \
|
||||
X(UVM32_ERR_NONE) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue