1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:37:47 +00:00

Kernel: Add ThreadRegisters::set_exec_state and use it in execve.cpp

Using this abstraction it is possible to compile this file for aarch64.
This commit is contained in:
Timon Kruiper 2023-01-25 17:11:48 +01:00 committed by Linus Groh
parent 171a8ca478
commit 1fbf562e7e
3 changed files with 19 additions and 4 deletions

View file

@ -79,6 +79,14 @@ struct ThreadRegisters {
set_ip(entry_ip);
rdi = entry_data; // entry function argument is expected to be in regs.rdi
}
void set_exec_state(FlatPtr entry_ip, FlatPtr userspace_sp, Memory::AddressSpace& space)
{
cs = GDT_SELECTOR_CODE3 | 3;
rip = entry_ip;
rsp = userspace_sp;
cr3 = space.page_directory().cr3();
}
};
}