Feat: POSIX signal

This commit is contained in:
2025-05-04 20:38:25 +08:00
parent 8d1045f20d
commit d31f5e02fe
9 changed files with 171 additions and 33 deletions

View File

@@ -1,6 +1,8 @@
#pragma once
#include <stddef.h>
#include <vector.h>
#include <signal.h>
typedef struct {
uint64_t x0, x1;
@@ -38,6 +40,13 @@ typedef struct process {
void *mem;
size_t mem_size;
void *sigstack;
size_t sigstack_size;
bool sigstate[SIGNAL_NUM];
int32_t current_signal;
signal_handler_t sighandlers[SIGNAL_NUM];
trapframe_t *regs;
} process_t;
@@ -51,3 +60,4 @@ int32_t run_process(uint64_t process);
process_t *fork_process(const process_t *from);
extern int32_t global_pid_counter;
extern vector_t *global_processes;