Terminal lock
This commit is contained in:
@ -7,7 +7,9 @@
|
||||
|
||||
#define kprintf(fmt, ...) \
|
||||
do { \
|
||||
spinlock_acquire(&TERM.spinlock); \
|
||||
printf_(fmt, ##__VA_ARGS__); \
|
||||
spinlock_release(&TERM.spinlock); \
|
||||
} while(0)
|
||||
|
||||
#define ksprintf sprintf_
|
||||
|
@ -32,6 +32,7 @@ void term_doinit(void *addr) {
|
||||
|
||||
void term_init(void *addr) {
|
||||
term_doinit(addr);
|
||||
spinlock_init(&TERM.spinlock);
|
||||
}
|
||||
|
||||
void term_write_unsafe(const char *s, size_t len) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
typedef struct {
|
||||
struct flanterm_context *ftctx;
|
||||
SpinLock spinlock;
|
||||
} Term;
|
||||
|
||||
extern Term TERM;
|
||||
|
Reference in New Issue
Block a user