mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
UserspaceEmulator: Emulate the sys$get_stack_bounds() syscall
This commit is contained in:
parent
04d9af79ac
commit
ae81ced21c
Notes:
sideshowbarker
2024-07-19 01:24:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ae81ced21c4
@ -252,6 +252,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
||||
return virt$chdir(arg1, arg2);
|
||||
case SC_dup2:
|
||||
return virt$dup2(arg1, arg2);
|
||||
case SC_get_stack_bounds:
|
||||
return virt$get_stack_bounds(arg1, arg2);
|
||||
case SC_access:
|
||||
return virt$access(arg1, arg2, arg3);
|
||||
case SC_waitid:
|
||||
@ -549,6 +551,16 @@ int Emulator::virt$setsockopt(FlatPtr params_addr)
|
||||
TODO();
|
||||
}
|
||||
|
||||
int Emulator::virt$get_stack_bounds(FlatPtr base, FlatPtr size)
|
||||
{
|
||||
auto* region = mmu().find_region({ m_cpu.ss(), m_cpu.esp().value() });
|
||||
FlatPtr b = region->base();
|
||||
size_t s = region->size();
|
||||
mmu().copy_to_vm(base, &b, sizeof(b));
|
||||
mmu().copy_to_vm(size, &s, sizeof(s));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Emulator::virt$accept(int sockfd, FlatPtr address, FlatPtr address_length)
|
||||
{
|
||||
socklen_t host_address_length = 0;
|
||||
|
@ -134,6 +134,7 @@ private:
|
||||
int virt$getsockopt(FlatPtr);
|
||||
int virt$setsockopt(FlatPtr);
|
||||
int virt$select(FlatPtr);
|
||||
int virt$get_stack_bounds(FlatPtr, FlatPtr);
|
||||
int virt$accept(int sockfd, FlatPtr address, FlatPtr address_length);
|
||||
int virt$bind(int sockfd, FlatPtr address, socklen_t address_length);
|
||||
int virt$recvmsg(int sockfd, FlatPtr msg_addr, int flags);
|
||||
|
Loading…
Reference in New Issue
Block a user