51 lines
840 B
C
51 lines
840 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef _ARCH_PROC_H_
|
|
#define _ARCH_PROC_H_
|
|
|
|
#include <descriptor.h>
|
|
#include <kernel/common.h>
|
|
#include <kernel/types.h>
|
|
|
|
#define IPI_KILL 0x30
|
|
#define IPI_TLB_FLUSH 0x31
|
|
|
|
struct thread;
|
|
struct cpu_local {
|
|
struct thread *cur_thread;
|
|
vaddr_t kernel_rsp;
|
|
vaddr_t user_rsp;
|
|
u32 cpu_id;
|
|
vaddr_t irq_rsp;
|
|
struct tss tss;
|
|
u32 apic_id;
|
|
struct thread *idle_thread;
|
|
} PACKED;
|
|
|
|
struct pt_regs {
|
|
u64 rax;
|
|
u64 rbx;
|
|
u64 rcx;
|
|
u64 rdx;
|
|
u64 rdi;
|
|
u64 rsi;
|
|
u64 rbp;
|
|
u64 r8;
|
|
u64 r9;
|
|
u64 r10;
|
|
u64 r11;
|
|
u64 r12;
|
|
u64 r13;
|
|
u64 r14;
|
|
u64 r15;
|
|
u64 rsp;
|
|
} PACKED;
|
|
|
|
struct cpu_local *tls_get();
|
|
struct thread *get_cur_thread();
|
|
void enter_userspace_init(struct thread *thread, uaddr_t entry);
|
|
struct pt_regs *current_pt_regs();
|
|
u32 cpu_id();
|
|
|
|
void reschedule(u64 state);
|
|
|
|
#endif /* _ARCH_PROC_H_ */
|