1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

Kernel+LibSystem: Add a 4th syscall argument

Let's allow passing 4 function arguments to a syscall. The 4th argument
goes into ESI or RSI.
This commit is contained in:
Andreas Kling 2021-07-24 02:15:07 +02:00
parent 9b78ae5149
commit deff554096
5 changed files with 33 additions and 8 deletions

View file

@ -531,6 +531,17 @@ inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3)
: "memory");
return result;
}
template<typename T1, typename T2, typename T3, typename T4>
inline uintptr_t invoke(Function function, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
{
uintptr_t result;
asm volatile("int $0x82"
: "=a"(result)
: "a"(function), "d"((uintptr_t)arg1), "c"((uintptr_t)arg2), "b"((uintptr_t)arg3), "S"((uintptr_t)arg4)
: "memory");
return result;
}
#endif
}