From 928f2662d1469e815a7e32e04d6c68bae4a61c14 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 12 Mar 2021 19:40:49 +0100 Subject: Added user stack pushing --- kernel/features/proc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'kernel/features') diff --git a/kernel/features/proc.c b/kernel/features/proc.c index 38d88f8..e4b5105 100644 --- a/kernel/features/proc.c +++ b/kernel/features/proc.c @@ -437,6 +437,18 @@ static u8 procfs_ready(const char *path, struct device *dev) return 1; } +static void proc_stack_push(struct proc *proc, u32 data) +{ + struct page_dir *prev; + memory_backup_dir(&prev); + memory_switch_dir(proc->page_dir); + + proc->regs.useresp -= sizeof(data); + *(u32 *)proc->regs.useresp = data; + + memory_switch_dir(prev); +} + extern void proc_jump_userspace(void); u32 _esp, _eip; -- cgit v1.2.3