mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
kernel: ldt support
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <kernel/jobctl.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <logging.h>
|
||||
|
||||
syscallret_t syscall_fork(context_t *ctx) {
|
||||
syscallret_t ret = {
|
||||
@@ -37,6 +38,14 @@ syscallret_t syscall_fork(context_t *ctx) {
|
||||
if (ret.errno)
|
||||
goto cleanup;
|
||||
|
||||
#ifdef __x86_64__
|
||||
if (proc->ldt) {
|
||||
ret.errno = arch_ldt_fork(&nproc->ldt, proc->ldt);
|
||||
if (ret.errno)
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
MUTEX_ACQUIRE(&proc->mutex);
|
||||
|
||||
nproc->parent = proc;
|
||||
@@ -80,5 +89,6 @@ syscallret_t syscall_fork(context_t *ctx) {
|
||||
PROC_RELEASE(nproc);
|
||||
|
||||
cleanup:
|
||||
// XXX no cleanup, TODO
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user