diff options
| author | Miguel <m.i@gmx.at> | 2018-08-19 19:39:47 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-19 19:39:47 +0200 |
| commit | 5055dc85c8a74fcd2ec24fbc51eba2a2da68debe (patch) | |
| tree | 6b9589c5c89c8bc5c90771ff9d630c15e670f024 /kernel/ringbuffer.c | |
| parent | 575c725f998b166f1d286a2664aa3d6061d337fe (diff) | |
cleaning up asm stuff and improving docs
Diffstat (limited to 'kernel/ringbuffer.c')
| -rw-r--r-- | kernel/ringbuffer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/ringbuffer.c b/kernel/ringbuffer.c index 31185dc..099e96a 100644 --- a/kernel/ringbuffer.c +++ b/kernel/ringbuffer.c @@ -20,11 +20,11 @@ ringbuffer ringbuffer_init(uint32_t size) bool ringbuffer_put(ringbuffer* f,uint8_t c) { - x86_int_disable(); + x86_cli(); if((f->back-1+f->size)%f->size==f->front) { - x86_int_enable(); + x86_sti(); return false; } @@ -33,30 +33,30 @@ bool ringbuffer_put(ringbuffer* f,uint8_t c) f->back+=f->size; f->back%=f->size; - x86_int_enable(); + x86_sti(); return true; } bool ringbuffer_has(ringbuffer* f) { - x86_int_disable(); + x86_cli(); bool res=true; if(f->front==f->back) res=false; - x86_int_enable(); + x86_sti(); return res; } uint8_t ringbuffer_get(ringbuffer* f) // non blocking . please check first { - x86_int_disable(); + x86_cli(); char c; if(f->front==f->back) { - x86_int_enable(); + x86_sti(); return ' '; } @@ -66,6 +66,6 @@ uint8_t ringbuffer_get(ringbuffer* f) // non blocking . please check first f->front+=f->size; f->front%=f->size; - x86_int_enable(); + x86_sti(); return c; } |
