mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 15:25:07 +00:00
UserspaceEmulator: Implement virt$pipe()
This commit is contained in:
parent
633301323b
commit
e12b591509
2 changed files with 13 additions and 0 deletions
|
@ -221,6 +221,8 @@ u32 Emulator::virt_syscall(u32 function, u32 arg1, u32 arg2, u32 arg3)
|
||||||
return virt$madvise(arg1, arg2, arg3);
|
return virt$madvise(arg1, arg2, arg3);
|
||||||
case SC_open:
|
case SC_open:
|
||||||
return virt$open(arg1);
|
return virt$open(arg1);
|
||||||
|
case SC_pipe:
|
||||||
|
return virt$pipe(arg1, arg2);
|
||||||
case SC_fcntl:
|
case SC_fcntl:
|
||||||
return virt$fcntl(arg1, arg2, arg3);
|
return virt$fcntl(arg1, arg2, arg3);
|
||||||
case SC_getgroups:
|
case SC_getgroups:
|
||||||
|
@ -334,6 +336,16 @@ u32 Emulator::virt$open(u32 params_addr)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Emulator::virt$pipe(FlatPtr vm_pipefd, int flags)
|
||||||
|
{
|
||||||
|
int pipefd[2];
|
||||||
|
int rc = syscall(SC_pipe, pipefd, flags);
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
|
mmu().copy_to_vm(vm_pipefd, pipefd, sizeof(pipefd));
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
u32 Emulator::virt$munmap(FlatPtr address, u32 size)
|
u32 Emulator::virt$munmap(FlatPtr address, u32 size)
|
||||||
{
|
{
|
||||||
auto* region = mmu().find_region({ 0x20, address });
|
auto* region = mmu().find_region({ 0x20, address });
|
||||||
|
|
|
@ -70,6 +70,7 @@ private:
|
||||||
u32 virt$mprotect(FlatPtr, size_t, int);
|
u32 virt$mprotect(FlatPtr, size_t, int);
|
||||||
u32 virt$madvise(FlatPtr, size_t, int);
|
u32 virt$madvise(FlatPtr, size_t, int);
|
||||||
u32 virt$open(u32);
|
u32 virt$open(u32);
|
||||||
|
int virt$pipe(FlatPtr pipefd, int flags);
|
||||||
int virt$close(int);
|
int virt$close(int);
|
||||||
int virt$get_process_name(FlatPtr buffer, int size);
|
int virt$get_process_name(FlatPtr buffer, int size);
|
||||||
int virt$dbgputstr(FlatPtr characters, int length);
|
int virt$dbgputstr(FlatPtr characters, int length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue