mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 05:38:21 +00:00
initial signal implementation
This commit is contained in:
@@ -267,8 +267,12 @@ static void pfisr(isr_t *self, context_t *ctx) {
|
||||
if (ctx->error & ERROR_FETCH)
|
||||
vmmerror |= VMM_ACTION_EXEC;
|
||||
|
||||
if (vmm_pagefault((void *)ctx->cr2, ctx->cs != 8, vmmerror) == false)
|
||||
_panic("Page fault", ctx);
|
||||
if (vmm_pagefault((void *)ctx->cr2, ctx->cs != 8, vmmerror) == false) {
|
||||
if (ARCH_CONTEXT_ISUSER(ctx))
|
||||
signal_signalthread(_cpu()->thread, SIGSEGV, true);
|
||||
else
|
||||
_panic("Page fault", ctx);
|
||||
}
|
||||
}
|
||||
|
||||
void arch_mmu_init() {
|
||||
|
||||
@@ -57,6 +57,11 @@ extern syscall_getpgid
|
||||
extern syscall_getsid
|
||||
extern syscall_setsid
|
||||
extern syscall_setpgid
|
||||
extern syscall_sigaction
|
||||
extern syscall_sigaltstack
|
||||
extern syscall_sigprocmask
|
||||
extern syscall_kill
|
||||
extern syscall_sigreturn
|
||||
syscalltab:
|
||||
dq syscall_print
|
||||
dq syscall_mmap
|
||||
@@ -116,7 +121,12 @@ dq syscall_getpgid
|
||||
dq syscall_getsid
|
||||
dq syscall_setsid
|
||||
dq syscall_setpgid
|
||||
syscallcount equ 58
|
||||
dq syscall_sigaction
|
||||
dq syscall_sigaltstack
|
||||
dq syscall_sigprocmask
|
||||
dq syscall_kill
|
||||
dq syscall_sigreturn
|
||||
syscallcount equ 63
|
||||
section .text
|
||||
global arch_syscall_entry
|
||||
; on entry:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#ifdef SYSCALL_LOGGING
|
||||
|
||||
#define SYSCALL_COUNT 58
|
||||
#define SYSCALL_COUNT 63
|
||||
#define LOGSTR(x) arch_e9_puts(x)
|
||||
|
||||
static char *name[] = {
|
||||
@@ -65,7 +65,12 @@ static char *name[] = {
|
||||
"getpgid",
|
||||
"getsid",
|
||||
"setsid",
|
||||
"setpgid"
|
||||
"setpgid",
|
||||
"sigaction",
|
||||
"sigaltstack",
|
||||
"sigprocmask",
|
||||
"kill",
|
||||
"sigreturn"
|
||||
};
|
||||
|
||||
static char *args[] = {
|
||||
@@ -127,6 +132,11 @@ static char *args[] = {
|
||||
"pid %d", // getsid
|
||||
"N/A", // setsid
|
||||
"pid %d pgid %d", // setpgid
|
||||
"signal %d new %p old %p", // sigaction
|
||||
"new %p old %p", // sigaltstack
|
||||
"how %d set %p oldset %p", // sigprocmask
|
||||
"pid %d signal %d", // kill
|
||||
"N/A" // sigreturn
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user