Thread: Add init_regs_user()

This commit is contained in:
apio 2022-12-26 12:46:07 +01:00
parent 7efb79dd26
commit 2600acc96c
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -34,6 +34,14 @@ void Thread::init_regs_kernel()
regs.rflags = 1 << 9; // IF (Interrupt enable flag)
}
void Thread::init_regs_user()
{
memset(&regs, 0, sizeof(Registers));
regs.cs = 0x18 | 3;
regs.ss = 0x20 | 3;
regs.rflags = 1 << 9; // IF (Interrupt enable flag)
}
void Thread::set_arguments(u64 arg1, u64 arg2, u64 arg3, u64 arg4)
{
regs.rdi = arg1;