diff --git a/src/platform/x86_64/ipc/signal.c b/src/platform/x86_64/ipc/signal.c new file mode 100644 index 0000000..283fa97 --- /dev/null +++ b/src/platform/x86_64/ipc/signal.c @@ -0,0 +1,30 @@ +/* + * lux - a lightweight unix-like operating system + * Omar Elghoul, 2024 + * + * Platform-Specific Code for x86_64 + */ + +#include +#include +#include +#include +#include +#include + +extern size_t sigstubSize; +extern uint8_t sigstub[]; + +/* platformSignalSetup(): sets up the signal trampoline code in a user process + * params: t - thread structure + * returns: zero on success + */ + +int platformSignalSetup(Thread *t) { + void *trampoline = uxmalloc(sigstubSize); + if(!trampoline) return -1; + + memcpy(trampoline, sigstub, sigstubSize); + t->signalTrampoline = (uintptr_t) trampoline; + return 0; +} \ No newline at end of file