summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-28 21:55:40 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-28 21:55:40 -0400
commitc0a391cb11fe1b14f6622bad5697a72de1781eb2 (patch)
tree9131f2275cfe407381bf9c12f0bcfac3faec1919 /kernel
parentchange struct gpu to gpu_dev (diff)
downloadcomus-c0a391cb11fe1b14f6622bad5697a72de1781eb2.tar.gz
comus-c0a391cb11fe1b14f6622bad5697a72de1781eb2.tar.bz2
comus-c0a391cb11fe1b14f6622bad5697a72de1781eb2.zip
fmt
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memory/paging.c20
-rw-r--r--kernel/procs.c2
-rw-r--r--kernel/syscall.c2
3 files changed, 9 insertions, 15 deletions
diff --git a/kernel/memory/paging.c b/kernel/memory/paging.c
index b089895..763bdce 100644
--- a/kernel/memory/paging.c
+++ b/kernel/memory/paging.c
@@ -508,10 +508,10 @@ volatile void *page_clone(volatile void *old_pADDR, bool cow)
volatile void *new_pADDR, *new_vADDR;
// TODO: cow
- (void) cow;
+ (void)cow;
// dont reallocate kernel memeory!!
- if ((volatile char *) old_pADDR <= kernel_end)
+ if ((volatile char *)old_pADDR <= kernel_end)
return old_pADDR;
new_pADDR = alloc_phys_page();
@@ -524,8 +524,7 @@ volatile void *page_clone(volatile void *old_pADDR, bool cow)
return new_pADDR;
}
-volatile struct pt *pt_clone(volatile const struct pt *old_pPT,
- bool cow)
+volatile struct pt *pt_clone(volatile const struct pt *old_pPT, bool cow)
{
volatile const struct pt *old_vPT;
volatile struct pt *new_pPT, *new_vPT;
@@ -557,9 +556,7 @@ volatile struct pt *pt_clone(volatile const struct pt *old_pPT,
new_vPTE->execute_disable = old_vPTE->execute_disable;
new_vPTE->flags = old_vPTE->flags;
- old_pADDR =
- (volatile void *)((uintptr_t)old_vPTE->address
- << 12);
+ old_pADDR = (volatile void *)((uintptr_t)old_vPTE->address << 12);
new_pADDR = page_clone(old_pADDR, cow);
if (new_pADDR == NULL)
goto fail;
@@ -574,8 +571,7 @@ fail:
return NULL;
}
-volatile struct pd *pd_clone(volatile const struct pd *old_pPD,
- bool cow)
+volatile struct pd *pd_clone(volatile const struct pd *old_pPD, bool cow)
{
volatile const struct pd *old_vPD;
volatile struct pd *new_pPD, *new_vPD;
@@ -605,8 +601,7 @@ volatile struct pd *pd_clone(volatile const struct pd *old_pPD,
continue;
old_pPT =
- (volatile const struct pt *)((uintptr_t)old_vPDE->address
- << 12);
+ (volatile const struct pt *)((uintptr_t)old_vPDE->address << 12);
new_pPT = pt_clone(old_pPT, cow);
if (new_pPT == NULL)
goto fail;
@@ -652,8 +647,7 @@ volatile struct pdpt *pdpt_clone(volatile const struct pdpt *old_pPDPT,
continue;
old_pPD =
- (volatile const struct pd *)((uintptr_t)old_vPDPTE->address
- << 12);
+ (volatile const struct pd *)((uintptr_t)old_vPDPTE->address << 12);
new_pPD = pd_clone(old_pPD, cow);
if (new_pPD == NULL)
goto fail;
diff --git a/kernel/procs.c b/kernel/procs.c
index e2455ea..5b03e73 100644
--- a/kernel/procs.c
+++ b/kernel/procs.c
@@ -474,7 +474,7 @@ __attribute__((noreturn)) void dispatch(void)
panic("dispatch queue remove failed, code %d", status);
// set the process up for success
- current_pcb->regs.cr3 = (uint64_t) mem_ctx_pgdir(current_pcb->memctx);
+ current_pcb->regs.cr3 = (uint64_t)mem_ctx_pgdir(current_pcb->memctx);
current_pcb->state = PROC_STATE_RUNNING;
current_pcb->ticks = 3; // ticks per process
diff --git a/kernel/syscall.c b/kernel/syscall.c
index 2dd6460..403b3bd 100644
--- a/kernel/syscall.c
+++ b/kernel/syscall.c
@@ -327,7 +327,7 @@ static int sys_ticks(void)
static int (*syscall_tbl[N_SYSCALLS])(void) = {
[SYS_exit] = sys_exit, [SYS_waitpid] = sys_waitpid,
- [SYS_fork] = sys_fork, [SYS_exec] = NULL,
+ [SYS_fork] = sys_fork, [SYS_exec] = NULL,
[SYS_open] = NULL, [SYS_close] = NULL,
[SYS_read] = NULL, [SYS_write] = sys_write,
[SYS_getpid] = sys_getpid, [SYS_getppid] = sys_getppid,