syscall: add basic syscall entry
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
1b8fe6b24d
commit
c01b1d7eee
12 changed files with 154 additions and 15 deletions
|
|
@ -1,14 +1,20 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#include <drivers/acpi.h>
|
||||
#include <kernel/tty.h>
|
||||
#include <kernel/atomic.h>
|
||||
#include <arch/proc.h>
|
||||
#include <drivers/acpi.h>
|
||||
#include <drivers/serial.h>
|
||||
#include <lib/stdio.h>
|
||||
#include "arch/msr.h"
|
||||
#include "arch/reg.h"
|
||||
#include "descriptor.h"
|
||||
|
||||
static struct tty tty_early = {0};
|
||||
static struct tty_serial_ops tty_early_ops = {.serial_getchar = arch_serial_read, .serial_putchar = arch_serial_write};
|
||||
|
||||
static struct cpu_local cpu_local_arr[128];
|
||||
static u64 cpu_ticker = 0;
|
||||
|
||||
void yield()
|
||||
{
|
||||
for (;;) {
|
||||
|
|
@ -39,3 +45,13 @@ void arch_init()
|
|||
gdt_init();
|
||||
idt_init();
|
||||
}
|
||||
|
||||
void arch_ap_startup()
|
||||
{
|
||||
u64 id = atomic_xadd(&cpu_ticker, 1);
|
||||
|
||||
struct cpu_local *this_local = &cpu_local_arr[id];
|
||||
wrmsr(IA32_GS_BASE, (u64)this_local);
|
||||
|
||||
yield();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue