Kernel: Stack pointer is validated when updated

This allows us not to fail stack pointer when in syscall since
interrupts use their own stack
This commit is contained in:
Bananymous
2023-04-21 10:40:24 +03:00
parent b1c7af38d0
commit 9c506ef85b
9 changed files with 37 additions and 23 deletions

View File

@@ -10,9 +10,9 @@ namespace Kernel
{
template<typename T1 = void*, typename T2 = void*, typename T3 = void*>
inline int syscall(int syscall, T1 arg1 = nullptr, T2 arg2 = nullptr, T3 arg3 = nullptr)
inline long syscall(int syscall, T1 arg1 = nullptr, T2 arg2 = nullptr, T3 arg3 = nullptr)
{
int ret;
long ret;
asm volatile("int $0x80" : "=a"(ret) : "a"(syscall), "b"((uintptr_t)arg1), "c"((uintptr_t)arg2), "d"((uintptr_t)arg3) : "memory");
return ret;
}