Fix some printf stuff
This commit is contained in:
parent
0066af13e8
commit
b337e5193b
1 changed files with 2 additions and 11 deletions
|
|
@ -51,7 +51,7 @@ atomic_flag printf_lock = ATOMIC_FLAG_INIT;
|
|||
|
||||
int kprintf(const char *format_string, ...){
|
||||
extern struct flanterm_context *ft_ctx;
|
||||
acquire_spinlock(&printf_lock);
|
||||
//acquire_spinlock(&printf_lock);
|
||||
int state = NORMAL;
|
||||
va_list a_list;
|
||||
va_start(a_list, format_string);
|
||||
|
|
@ -114,7 +114,7 @@ int kprintf(const char *format_string, ...){
|
|||
}
|
||||
|
||||
va_end(a_list);
|
||||
free_spinlock(&printf_lock);
|
||||
//free_spinlock(&printf_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -418,27 +418,18 @@ char toupper(char c){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
atomic_flag fb_spinlock = ATOMIC_FLAG_INIT;
|
||||
|
||||
/* Eventually fix printf so that these print_* functions dont
|
||||
write to the framebuffer but instead return to printf */
|
||||
|
||||
/* Prints a char array to the framebuffer, thread safe*/
|
||||
void kernel_framebuffer_print(char *buffer, size_t n){
|
||||
extern struct flanterm_context *ft_ctx;
|
||||
//acquire_lock(&fb_spinlock);
|
||||
flanterm_write(ft_ctx, buffer, n);
|
||||
//free_lock(&fb_spinlock);
|
||||
}
|
||||
|
||||
atomic_flag serial_spinlock = ATOMIC_FLAG_INIT;
|
||||
|
||||
/* Prints a char array to serial, thread safe*/
|
||||
void kernel_serial_print(char *buffer, size_t n){
|
||||
//acquire_lock(&serial_spinlock);
|
||||
for(size_t i = 0; i < n; i++){
|
||||
serial_print_char(buffer[i]);
|
||||
}
|
||||
//free_lock(&serial_spinlock);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue