#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/kconfig.h>
#include <sys/kassert.h>
#include <sys/kmem.h>
#include <sys/mp.h>
#include <sys/thread.h>
#include <machine/amd64.h>
#include <machine/amd64op.h>
#include <machine/trap.h>
#include <machine/pmap.h>
Go to the source code of this file.
|
void | ThreadKThreadEntry (TrapFrame *tf) |
|
void | switchstack (uint64_t *oldrsp, uint64_t rsp) |
|
void | Thread_InitArch (Thread *thr) |
|
void | Thread_SetupKThread (Thread *thr, void(*f)(), uintptr_t arg1, uintptr_t arg2, uintptr_t arg3) |
|
static void | ThreadEnterUserLevelCB (uintptr_t arg1, uintptr_t arg2, uintptr_t arg3) |
|
void | Thread_SetupUThread (Thread *thr, uintptr_t rip, uintptr_t arg) |
|
void | Thread_SwitchArch (Thread *oldthr, Thread *newthr) |
|
◆ switchstack()
◆ Thread_InitArch()
void Thread_InitArch |
( |
Thread * |
thr | ) |
|
◆ Thread_SetupKThread()
Definition at line 26 of file thread.c.
28{
29
33
34 tf = (
TrapFrame *)(stacktop -
sizeof(*tf));
37
38 memset(tf, 0,
sizeof(*tf));
39 memset(sf, 0,
sizeof(*sf));
40
41
42
45
55}
void ThreadKThreadEntry(TrapFrame *tf)
void * memset(void *dst, int c, size_t len)
◆ Thread_SetupUThread()
Definition at line 75 of file thread.c.
76{
79}
void Thread_SetupKThread(Thread *thr, void(*f)(), uintptr_t arg1, uintptr_t arg2, uintptr_t arg3)
static void ThreadEnterUserLevelCB(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3)
◆ Thread_SwitchArch()
Definition at line 84 of file thread.c.
85{
86
87
88
89
91 {
93 }
94
96 {
98 }
99
101
102
104
105
107}
void switchstack(uint64_t *oldrsp, uint64_t rsp)
TaskStateSegment64 TSS[MAX_CPUS]
static INLINE void fxrstor(struct XSAVEArea *xsa)
static INLINE void clts()
static INLINE void fxsave(struct XSAVEArea *xsa)
◆ ThreadEnterUserLevelCB()
Definition at line 58 of file thread.c.
59{
61
62 memset(&tf, 0,
sizeof(tf));
70
72}
#define MEM_USERSPACE_STKLEN
void Trap_Pop(TrapFrame *tf)
◆ ThreadKThreadEntry()
Definition at line 314 of file thread.c.
315{
317
319
321}
Thread * curProc[MAX_CPUS]
void Spinlock_Unlock(Spinlock *lock) __UNLOCK_EX(*lock)
◆ TSS