1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 10:45:07 +00:00

More compat work.

Move syscall to int 0x82 since using int 0x80 was kinda prone to fork bombs
when building things on Linux. :^)
This commit is contained in:
Andreas Kling 2019-02-26 12:57:02 +01:00
parent f6b41d166d
commit cccc8d8aeb
17 changed files with 81 additions and 9 deletions

View file

@ -886,8 +886,8 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
*code_ptr++ = 0xb8; // mov eax, <dword>
*(dword*)code_ptr = Syscall::SC_sigreturn;
code_ptr += sizeof(dword);
*code_ptr++ = 0xcd; // int 0x80
*code_ptr++ = 0x80;
*code_ptr++ = 0xcd; // int 0x82
*code_ptr++ = 0x82;
*code_ptr++ = 0x0f; // ud2
*code_ptr++ = 0x0b;

View file

@ -40,8 +40,8 @@ namespace Syscall {
void initialize()
{
register_user_callable_interrupt_handler(0x80, syscall_trap_handler);
kprintf("Syscall: int 0x80 handler installed\n");
register_user_callable_interrupt_handler(0x82, syscall_trap_handler);
kprintf("Syscall: int 0x82 handler installed\n");
}
int sync()

View file

@ -131,7 +131,7 @@ int sync();
inline dword invoke(Function function)
{
dword result;
asm volatile("int $0x80":"=a"(result):"a"(function):"memory");
asm volatile("int $0x82":"=a"(result):"a"(function):"memory");
return result;
}
@ -139,7 +139,7 @@ template<typename T1>
inline dword invoke(Function function, T1 arg1)
{
dword result;
asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1):"memory");
asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1):"memory");
return result;
}
@ -147,7 +147,7 @@ template<typename T1, typename T2>
inline dword invoke(Function function, T1 arg1, T2 arg2)
{
dword result;
asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2):"memory");
asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2):"memory");
return result;
}
@ -155,7 +155,7 @@ template<typename T1, typename T2, typename T3>
inline dword invoke(Function function, T1 arg1, T2 arg2, T3 arg3)
{
dword result;
asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2),"b"((dword)arg3):"memory");
asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2),"b"((dword)arg3):"memory");
return result;
}
#endif