SMP and timer interrupts
This commit is contained in:
@@ -3,11 +3,14 @@
|
||||
#include <libk/printf.h>
|
||||
#include <libk/std.h>
|
||||
#include <libk/string.h>
|
||||
#include <sync/spin_lock.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
#define PORT_COM1 0x03F8
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
spin_lock_t serial_lock = SPIN_LOCK_INIT;
|
||||
|
||||
static bool amd64_debug_serial_tx_empty (void) {
|
||||
return (bool)(amd64_io_inb (PORT_COM1 + 5) & 0x20);
|
||||
}
|
||||
@@ -30,10 +33,15 @@ void debugprintf (const char* fmt, ...) {
|
||||
buffer[sizeof (buffer) - 1] = '\0';
|
||||
|
||||
const char* p = buffer;
|
||||
|
||||
spin_lock (&serial_lock);
|
||||
|
||||
while (*p) {
|
||||
amd64_debug_serial_write (*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
spin_unlock (&serial_lock);
|
||||
}
|
||||
|
||||
void amd64_debug_init (void) {
|
||||
|
||||
Reference in New Issue
Block a user