summaryrefslogtreecommitdiff
path: root/sched/scheduler.h
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-30 20:46:36 +0100
committerAnton Kling <anton@kling.gg>2023-10-30 21:49:48 +0100
commitecf1e4c6c6efc3edeb006ff120ac60a191ddce50 (patch)
treedb5e312704d43ec8ff0a81bc87c9a1cdf6b01970 /sched/scheduler.h
parentc7a07bf214ef9b3fabc15c8e70f696ede9644c2c (diff)
Kernel/LibC: Add signals and support for custom signal handlers to processes.
Diffstat (limited to 'sched/scheduler.h')
-rw-r--r--sched/scheduler.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/sched/scheduler.h b/sched/scheduler.h
index 7df7c40..fc92ff3 100644
--- a/sched/scheduler.h
+++ b/sched/scheduler.h
@@ -4,6 +4,7 @@
#include <fs/vfs.h>
#include <halts.h>
#include <mmu.h>
+#include <signal.h>
#define MAX_PATH 256
#define KEYBOARD_HALT 0
@@ -19,6 +20,8 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd,
size_t offset);
int munmap(void *addr, size_t length);
int msync(void *addr, size_t length, int flags);
+int kill(pid_t pid, int sig);
+void set_signal_handler(int sig, void (*handler)(int));
typedef struct {
void *u_address;
@@ -34,25 +37,26 @@ struct Process {
char program_name[100];
char current_working_directory[MAX_PATH];
uint32_t eip, esp, ebp;
+ uint8_t incoming_signal;
+ uint32_t signal_handler_stack;
+ void *signal_handlers[20];
PageDirectory *cr3;
vfs_fd_t *file_descriptors[100];
vfs_inode_t *read_halt_inode[100];
vfs_inode_t *write_halt_inode[100];
vfs_inode_t *disconnect_halt_inode[100];
- // struct vfs_fd_t ** file_descriptors;
uint32_t halts[2];
struct Halt *halt_list;
void *data_segment_end;
- // uint32_t *halts;
process_t *next;
process_t *parent;
+ // TODO: Create a linkedlist of childs so that the parent process
+ // can do stuff such as reap zombies and get status.
process_t *child;
MemoryMap *maps[100];
uint32_t sleep_until;
int child_rc;
int dead;
- // FIXME: Create a linkedlisti of childs so that the parent process
- // can do stuff such as reap zombies and get status.
};
process_t *get_current_task(void);