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