Fully support userland interrupt handler. Use fixed common abort handler.

This commit is contained in:
TXuian
2024-04-28 14:44:49 +08:00
parent a7cbb0d041
commit a24d73f710
25 changed files with 260 additions and 154 deletions
@@ -89,7 +89,7 @@ int main()
mmap(ARM_PERIPHERAL_VIRT_BASE, ARM_PERIPHERAL_BASE, 0x2000, true);
printf("%s: Sending soft interrupt\n", prog_name);
gic_send_sgi(SW_INTERRUPT_3, 0, kGicSgiFilter_OnlyThisCPU);
gic_send_sgi(SW_INTERRUPT_3, 0xF, kGicSgiFilter_UseTargetList);
printf("%s: Soft interrupt send done\n", prog_name);
exit();
}
@@ -53,9 +53,9 @@ int exit()
return syscall(SYSCALL_EXIT, 0, 0, 0, 0);
}
int yield()
int yield(task_yield_reason reason)
{
return syscall(SYSCALL_YIELD, 0, 0, 0, 0);
return syscall(SYSCALL_YIELD, (uintptr_t)reason, 0, 0, 0);
}
int kill(int pid)
@@ -44,6 +44,12 @@ typedef enum {
SYS_STATE_SHOW_CPU_INFO,
} sys_state_option;
typedef enum {
SYS_TASK_YIELD_NO_REASON = 0x0,
SYS_TASK_YIELD_FOREVER = 0x1,
SYS_TASK_YIELD_BLOCK_IPC = 0x2,
} task_yield_reason;
typedef union {
struct {
uintptr_t memblock_start;
@@ -58,7 +64,7 @@ typedef int (*ipc_write_fn)(struct Session* session, int fd, char* src, int offs
int spawn(struct Session* session, int fd, ipc_read_fn ipc_read, ipc_fsize_fn ipc_fsize, char* name, char** argv);
int exit();
int yield();
int yield(task_yield_reason reason);
int kill(int pid);
int register_server(char* name);
int session(char* path, int capacity, struct Session* user_session);