4
1
mirror of https://github.com/DragonOS-Community/DragonOS.git synced 2025-07-11 02:53:25 +00:00

支持syscall快速系统调用指令 (#417)

* 支持syscall快速系统调用指令

---------

Co-authored-by: LoGin <longjin@DragonOS.org>
This commit is contained in:
GnoCiYeH
2023-11-04 21:39:44 +08:00
committed by GitHub
parent 2f6f547ae0
commit 1603395155
14 changed files with 317 additions and 48 deletions
.gitignore
kernel/src
arch
driver
interrupt
apic
exception
head.S
process
smp
syscall
tools

@ -10,8 +10,15 @@
#include <process/preempt.h>
#include <sched/sched.h>
#include <driver/acpi/acpi.h>
#include "exception/trap.h"
#include "ipi.h"
/* x86-64 specific MSRs */
#define MSR_EFER 0xc0000080 /* extended feature register */
#define MSR_STAR 0xc0000081 /* legacy mode SYSCALL target */
#define MSR_LSTAR 0xc0000082 /* long mode SYSCALL target */
#define MSR_SYSCALL_MASK 0xc0000084 /* EFLAGS mask for syscall */
static void __smp_kick_cpu_handler(uint64_t irq_num, uint64_t param, struct pt_regs *regs);
static void __smp__flush_tlb_ipi_handler(uint64_t irq_num, uint64_t param, struct pt_regs *regs);
@ -25,6 +32,7 @@ int num_cpu_started = 1;
extern void smp_ap_start();
extern uint64_t rs_get_idle_stack_top(uint32_t cpu_id);
extern void rs_init_syscall_64();
// 在head.S中定义的APU启动时要加载的页表
// 由于内存管理模块初始化的时候重置了页表因此我们要把当前的页表传给APU
@ -146,8 +154,11 @@ void smp_ap_start_stage2()
io_mfence();
spin_unlock_no_preempt(&multi_core_starting_lock);
rs_init_syscall_64();
apic_timer_ap_core_init();
sti();
sched();