Rewrite ps2kbproc, rbuf (kernel ring buffer) and pipe read/write, Change to -O0 in kernel code
This commit is contained in:
@ -9,14 +9,13 @@
|
||||
Proc *PS2KBPROC = NULL;
|
||||
Ps2KbFastBuf PS2KB_BUF;
|
||||
|
||||
|
||||
void ps2kbproc_init(Proc *proc) {
|
||||
PS2KBPROC = proc;
|
||||
|
||||
PS2KBPROC->bcast_pipes.list = NULL;
|
||||
|
||||
PS2KB_BUF.rbuf.buffer = dlmalloc(IPC_PIPE_MAX);
|
||||
PS2KB_BUF.rbuf.cap = IPC_PIPE_MAX;
|
||||
uint8_t *buf = dlmalloc(IPC_PIPE_MAX);
|
||||
rbuf_init(&PS2KB_BUF.rbuf, buf, IPC_PIPE_MAX);
|
||||
spinlock_init(&PS2KB_BUF.spinlock);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef PROC_PS2KB_PS2KBPROC_H_
|
||||
#define PROC_PS2KB_PS2KBPROC_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "proc/proc.h"
|
||||
#include "rbuf/rbuf.h"
|
||||
#include "spinlock/spinlock.h"
|
||||
|
@ -18,7 +18,7 @@ void termproc_fn(void) {
|
||||
for (;;) {
|
||||
char c = 0;
|
||||
int32_t read = ipc_piperead(TERMPROC->pipes[1], (uint8_t *)&c, 1);
|
||||
if (read > 0 && c != 0) {
|
||||
if (read > 0) {
|
||||
kprintf("%c", c);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user