Fix overly long event name

This commit is contained in:
Toby Jaffey 2025-12-08 13:04:05 +00:00
parent 86f93be100
commit c691c3ebdf
9 changed files with 10 additions and 10 deletions

View file

@ -80,7 +80,7 @@ If the bytecode attempts to execute more instructions than the the passed value
* `UVM32_EVT_END` the program has ended * `UVM32_EVT_END` the program has ended
* `UVM32_EVT_ERR` the program has encountered an error * `UVM32_EVT_ERR` the program has encountered an error
* `UVM32_EVT_YIELD` the program has called `yield()` signifying that it requires more instructions to be executed, but has not crashed/hung * `UVM32_EVT_YIELD` the program has called `yield()` signifying that it requires more instructions to be executed, but has not crashed/hung
* `UVM32_EVT_UVM32_SYSCALL` the program requests some IO via the host * `UVM32_EVT_SYSCALL` the program requests some IO via the host
## Internals ## Internals
@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
case UVM32_EVT_END: case UVM32_EVT_END:
isrunning = false; isrunning = false;
break; break;
case UVM32_EVT_UVM32_SYSCALL: // vm has paused to handle UVM32_SYSCALL case UVM32_EVT_SYSCALL: // vm has paused to handle UVM32_SYSCALL
switch((f_code_t)evt.data.syscall.code) { switch((f_code_t)evt.data.syscall.code) {
case F_PRINTD: case F_PRINTD:
// Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32 // Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32

View file

@ -68,7 +68,7 @@ void loop(void) {
case UVM32_EVT_END: case UVM32_EVT_END:
isrunning = false; isrunning = false;
break; break;
case UVM32_EVT_UVM32_SYSCALL: // vm has paused to handle UVM32_SYSCALL case UVM32_EVT_SYSCALL: // vm has paused to handle UVM32_SYSCALL
switch((f_code_t)evt.data.syscall.code) { switch((f_code_t)evt.data.syscall.code) {
case F_PRINTD: case F_PRINTD:
Serial.println(evt.data.syscall.val.u32); Serial.println(evt.data.syscall.val.u32);

View file

@ -158,7 +158,7 @@ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter)
vmst->ioevt.data.syscall.val.u32p = &vmst->core->regs[11]; vmst->ioevt.data.syscall.val.u32p = &vmst->core->regs[11];
break; break;
} }
vmst->ioevt.typ = UVM32_EVT_UVM32_SYSCALL; vmst->ioevt.typ = UVM32_EVT_SYSCALL;
vmst->ioevt.data.syscall.code = vmst->mappings[i].code; vmst->ioevt.data.syscall.code = vmst->mappings[i].code;
vmst->ioevt.data.syscall.typ = vmst->mappings[i].typ; vmst->ioevt.data.syscall.typ = vmst->mappings[i].typ;
setStatus(vmst, UVM32_STATUS_PAUSED); setStatus(vmst, UVM32_STATUS_PAUSED);

View file

@ -23,7 +23,7 @@ typedef enum {
typedef enum { typedef enum {
UVM32_EVT_ERR, UVM32_EVT_ERR,
UVM32_EVT_UVM32_SYSCALL, UVM32_EVT_SYSCALL,
UVM32_EVT_YIELD, UVM32_EVT_YIELD,
UVM32_EVT_END, UVM32_EVT_END,
} uvm32_evt_typ_t; } uvm32_evt_typ_t;

View file

@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
case UVM32_EVT_END: case UVM32_EVT_END:
isrunning = false; isrunning = false;
break; break;
case UVM32_EVT_UVM32_SYSCALL: // vm has paused to handle UVM32_SYSCALL case UVM32_EVT_SYSCALL: // vm has paused to handle UVM32_SYSCALL
switch((f_code_t)evt.data.syscall.code) { switch((f_code_t)evt.data.syscall.code) {
case F_PRINTD: case F_PRINTD:
// Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32 // Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32

View file

@ -55,7 +55,7 @@ int main(int argc, char *argv[]) {
printf("[VM %d ended]\n", scheduler_index); printf("[VM %d ended]\n", scheduler_index);
numVmRunning--; numVmRunning--;
break; break;
case UVM32_EVT_UVM32_SYSCALL: // vm has paused to handle UVM32_SYSCALL case UVM32_EVT_SYSCALL: // vm has paused to handle UVM32_SYSCALL
switch((f_code_t)evt.data.syscall.code) { switch((f_code_t)evt.data.syscall.code) {
case F_PRINTD: case F_PRINTD:
// Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32 // Type of F_PRINTD is UVM32_SYSCALL_TYP_U32_WR, so expect value in evt.data.syscall.val.u32

View file

@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
printf("UVM32_EVT_ERR '%s' (%d)\n", evt.data.err.errstr, (int)evt.data.err.errcode); printf("UVM32_EVT_ERR '%s' (%d)\n", evt.data.err.errstr, (int)evt.data.err.errcode);
isrunning = false; isrunning = false;
break; break;
case UVM32_EVT_UVM32_SYSCALL: case UVM32_EVT_SYSCALL:
switch((f_code_t)evt.data.syscall.code) { switch((f_code_t)evt.data.syscall.code) {
case F_PRINT: case F_PRINT:
printf("%.*s", evt.data.syscall.val.buf.len, evt.data.syscall.val.buf.ptr); printf("%.*s", evt.data.syscall.val.buf.len, evt.data.syscall.val.buf.ptr);

View file

@ -157,7 +157,7 @@ uint32_t uvm32_run(uvm32_state_t *vmst, uvm32_evt_t *evt, uint32_t instr_meter)
vmst->ioevt.data.syscall.val.u32p = &vmst->core->regs[11]; vmst->ioevt.data.syscall.val.u32p = &vmst->core->regs[11];
break; break;
} }
vmst->ioevt.typ = UVM32_EVT_UVM32_SYSCALL; vmst->ioevt.typ = UVM32_EVT_SYSCALL;
vmst->ioevt.data.syscall.code = vmst->mappings[i].code; vmst->ioevt.data.syscall.code = vmst->mappings[i].code;
vmst->ioevt.data.syscall.typ = vmst->mappings[i].typ; vmst->ioevt.data.syscall.typ = vmst->mappings[i].typ;
setStatus(vmst, UVM32_STATUS_PAUSED); setStatus(vmst, UVM32_STATUS_PAUSED);

View file

@ -23,7 +23,7 @@ typedef enum {
typedef enum { typedef enum {
UVM32_EVT_ERR, UVM32_EVT_ERR,
UVM32_EVT_UVM32_SYSCALL, UVM32_EVT_SYSCALL,
UVM32_EVT_YIELD, UVM32_EVT_YIELD,
UVM32_EVT_END, UVM32_EVT_END,
} uvm32_evt_typ_t; } uvm32_evt_typ_t;