summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authordzwdz2023-02-23 18:36:11 +0100
committerdzwdz2023-02-23 18:36:11 +0100
commit7f4cdc65a390c5bacab00cc38100d66637394476 (patch)
tree3d280dbd1cf67a0f7a3c73e319d7ba4d20f4b198 /src/kernel
parent55224307bf9b3e4231daca9ad4c4e3b6d734869b (diff)
fix: misc warnings
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/arch/amd64/driver/rtl8139.c1
-rw-r--r--src/kernel/execbuf.c32
2 files changed, 18 insertions, 15 deletions
diff --git a/src/kernel/arch/amd64/driver/rtl8139.c b/src/kernel/arch/amd64/driver/rtl8139.c
index 8a40f28..09b0ca5 100644
--- a/src/kernel/arch/amd64/driver/rtl8139.c
+++ b/src/kernel/arch/amd64/driver/rtl8139.c
@@ -118,6 +118,7 @@ static int try_rx(Proc *proc, void __user *dest, size_t dlen) {
* 0 - Receive OK
* 14 - Physical Address Matched */
flags = *(uint16_t*)(rxbuf + rxpos);
+ (void)flags; // TODO check rtl8139 rx flags
rxpos += 2;
/* doesn't include the header, includes a 4 byte crc */
size = *(uint16_t*)(rxbuf + rxpos);
diff --git a/src/kernel/execbuf.c b/src/kernel/execbuf.c
index 33bb94a..fe9e159 100644
--- a/src/kernel/execbuf.c
+++ b/src/kernel/execbuf.c
@@ -22,23 +22,25 @@ static void try_fetch(Proc *proc, uint64_t *buf, size_t amt) {
_Noreturn void execbuf_run(Proc *proc) {
uint64_t buf[6];
- assert(proc == proc_cur); // idiotic, but needed because of _syscall.
- assert(proc->state == PS_RUNNING);
- assert(proc->execbuf.buf);
+ for (;;) {
+ assert(proc == proc_cur); /* idiotic, but needed because of _syscall. */
+ assert(proc->state == PS_RUNNING);
+ assert(proc->execbuf.buf);
- try_fetch(proc, buf, 1);
- switch (buf[0]) {
- case EXECBUF_SYSCALL:
- try_fetch(proc, buf, 6);
- _syscall(buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
- proc_switch_any();
+ try_fetch(proc, buf, 1);
+ switch (buf[0]) {
+ case EXECBUF_SYSCALL:
+ try_fetch(proc, buf, 6);
+ _syscall(buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
+ proc_switch_any();
- case EXECBUF_JMP:
- try_fetch(proc, buf, 1);
- proc->regs.rcx = buf[0];
- execbuf_run(proc);
+ case EXECBUF_JMP:
+ try_fetch(proc, buf, 1);
+ proc->regs.rcx = buf[0];
+ break;
- default:
- halt(proc);
+ default:
+ halt(proc);
+ }
}
}