From 3d23187acffac817df7f9f15af9cbe69078e5ab7 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Wed, 28 Jan 2026 23:52:48 +0100 Subject: [PATCH] Implement userspace TLS, remove RW Locks --- amd64/link.ld | 31 +++++++++--------- init/init.c | 22 ++++++------- kernel/amd64/apic.c | 14 ++++---- kernel/amd64/proc.c | 38 ++++++++++++++++++--- kernel/amd64/proc.h | 1 + kernel/amd64/procgroup.h | 13 ++++++++ kernel/irq/irq.c | 12 +++---- kernel/proc/proc.c | 42 ++++++++++++++++-------- kernel/proc/proc.h | 1 - kernel/proc/procgroup.c | 15 ++++----- kernel/proc/procgroup.h | 2 ++ kernel/sync/rw_spin_lock.c | 67 -------------------------------------- kernel/sync/rw_spin_lock.h | 17 ---------- kernel/sync/src.mk | 6 ++-- kernel/sys/proc.h | 1 + kernel/sys/procgroup.h | 8 +++++ kernel/syscall/syscall.c | 2 -- 17 files changed, 135 insertions(+), 157 deletions(-) create mode 100644 kernel/amd64/procgroup.h delete mode 100644 kernel/sync/rw_spin_lock.c delete mode 100644 kernel/sync/rw_spin_lock.h create mode 100644 kernel/sys/procgroup.h diff --git a/amd64/link.ld b/amd64/link.ld index 99d4e82..395d413 100644 --- a/amd64/link.ld +++ b/amd64/link.ld @@ -6,8 +6,8 @@ PHDRS { text PT_LOAD; rodata PT_LOAD; data PT_LOAD; - tls PT_TLS; bss PT_LOAD; + tls PT_TLS; } SECTIONS { @@ -15,6 +15,7 @@ SECTIONS { .text : { *(.text .text.*) + *(.ltext .ltext.*) } :text . = ALIGN(CONSTANT(MAXPAGESIZE)); @@ -27,7 +28,19 @@ SECTIONS { .data : { *(.data .data.*) + *(.ldata .ldata.*) } :data + + . = ALIGN(CONSTANT(MAXPAGESIZE)); + + __bss_start = .; + + .bss : { + *(.bss .bss.*) + *(.lbss .lbss.*) + } :bss + + __bss_end = .; . = ALIGN(CONSTANT(MAXPAGESIZE)); @@ -35,32 +48,20 @@ SECTIONS { .tdata : { *(.tdata .tdata.*) - } :data :tls + } :tls __tdata_end = .; - . = ALIGN(CONSTANT(MAXPAGESIZE)); - __tbss_start = .; .tbss : { *(.tbss .tbss.*) - } :bss :tls + } :tls __tbss_end = .; - . = ALIGN(CONSTANT(MAXPAGESIZE)); - __tls_size = __tbss_end - __tdata_start; - __bss_start = .; - - .bss : { - *(.bss .bss.*) - } :data - - __bss_end = .; - /DISCARD/ : { *(.eh_frame*) *(.note .note.*) diff --git a/init/init.c b/init/init.c index 8e19b10..83c4f04 100644 --- a/init/init.c +++ b/init/init.c @@ -8,7 +8,7 @@ #define MUTEX 2000 -/* __thread char letter; */ +__thread char letter = 'c'; void app_thread1 (void); @@ -25,30 +25,30 @@ int spawn (void (*fn) (void)) { void app_main (void) { mutex_create (MUTEX); - /* letter = 'd'; */ + letter = 'a'; spawn (&app_thread1); for (;;) { - /* mutex_lock (MUTEX); */ + mutex_lock (MUTEX); - /* for (int i = 0; i < 3; i++) */ - /* test (letter); */ + for (int i = 0; i < 3; i++) + test (letter); - /* mutex_unlock (MUTEX); */ + mutex_unlock (MUTEX); } } void app_thread1 (void) { - /* letter = 'c'; */ + letter = 'b'; for (;;) { - /* mutex_lock (MUTEX); */ + mutex_lock (MUTEX); - /* for (int i = 0; i < 3; i++) */ - /* test (letter); */ + for (int i = 0; i < 3; i++) + test (letter); - /* mutex_unlock (MUTEX); */ + mutex_unlock (MUTEX); } quit (); diff --git a/kernel/amd64/apic.c b/kernel/amd64/apic.c index 5055ecf..ab1c4ed 100644 --- a/kernel/amd64/apic.c +++ b/kernel/amd64/apic.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -38,7 +38,7 @@ struct ioapic { struct acpi_madt_ioapic table_data; - rw_spin_lock_t lock; + spin_lock_t lock; uintptr_t mmio_base; }; @@ -59,10 +59,10 @@ static spin_lock_t lapic_calibration_lock = SPIN_LOCK_INIT; static uint32_t amd64_ioapic_read (struct ioapic* ioapic, uint32_t reg) { spin_lock_ctx_t ctxioar; - rw_spin_read_lock (&ioapic->lock, &ctxioar); + spin_lock (&ioapic->lock, &ctxioar); *(volatile uint32_t*)ioapic->mmio_base = reg; uint32_t ret = *(volatile uint32_t*)(ioapic->mmio_base + 0x10); - rw_spin_read_unlock (&ioapic->lock, &ctxioar); + spin_unlock (&ioapic->lock, &ctxioar); return ret; } @@ -70,10 +70,10 @@ static uint32_t amd64_ioapic_read (struct ioapic* ioapic, uint32_t reg) { static void amd64_ioapic_write (struct ioapic* ioapic, uint32_t reg, uint32_t value) { spin_lock_ctx_t ctxioaw; - rw_spin_write_lock (&ioapic->lock, &ctxioaw); + spin_lock (&ioapic->lock, &ctxioaw); *(volatile uint32_t*)ioapic->mmio_base = reg; *(volatile uint32_t*)(ioapic->mmio_base + 0x10) = value; - rw_spin_write_unlock (&ioapic->lock, &ctxioaw); + spin_unlock (&ioapic->lock, &ctxioaw); } /* Find an IOAPIC corresposting to provided IRQ */ @@ -162,7 +162,7 @@ void amd64_ioapic_init (void) { (uintptr_t)hhdm->offset + (uintptr_t)ioapic_table_data->address, MM_PG_PRESENT | MM_PG_RW); ioapics[ioapic_entries++] = (struct ioapic){ - .lock = RW_SPIN_LOCK_INIT, + .lock = SPIN_LOCK_INIT, .table_data = *ioapic_table_data, .mmio_base = ((uintptr_t)hhdm->offset + (uintptr_t)ioapic_table_data->address), }; diff --git a/kernel/amd64/proc.c b/kernel/amd64/proc.c index 3f14cfc..d94e924 100644 --- a/kernel/amd64/proc.c +++ b/kernel/amd64/proc.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -11,12 +12,11 @@ #include #include #include -#include #include #include +#include -/* 0 is kpproc */ -static atomic_int pids = 1; +static atomic_int pids = 0; struct proc* proc_from_elf (uint8_t* elf_contents) { struct limine_hhdm_response* hhdm = limine_hhdm_request.response; @@ -87,6 +87,8 @@ struct proc* proc_clone (struct proc* proto, uintptr_t vstack_top, uintptr_t ent proc->pdata.regs.cs = GDT_UCODE | 0x03; proc->pdata.regs.rip = (uint64_t)entry; + proc_init_tls (proc); + return proc; } @@ -116,10 +118,36 @@ void proc_cleanup (struct proc* proc) { spin_unlock (&proc->lock, &ctxpr); - procgroup_detach (proc->procgroup, proc); - pmm_free (proc->pdata.kernel_stack, KSTACK_SIZE / PAGE_SIZE); + procgroup_unmap (proc->procgroup, proc->pdata.tls_vaddr, proc->procgroup->tls.tls_tmpl_pages); + + procgroup_detach (proc->procgroup, proc); /* clean the process */ free (proc); } + +void proc_init_tls (struct proc* proc) { + struct limine_hhdm_response* hhdm = limine_hhdm_request.response; + + size_t tls_size = proc->procgroup->tls.tls_tmpl_size; + + uintptr_t tls_paddr; + uint32_t flags = MM_PG_USER | MM_PG_PRESENT | MM_PG_RW; + + uintptr_t tls_vaddr = + procgroup_map (proc->procgroup, 0, proc->procgroup->tls.tls_tmpl_pages, flags, &tls_paddr); + + uintptr_t k_tls_addr = (uintptr_t)hhdm->offset + tls_paddr; + + uintptr_t ktcb = k_tls_addr + tls_size; + uintptr_t utcb = tls_vaddr + tls_size; + + memset ((void*)k_tls_addr, 0, tls_size); + memcpy ((void*)k_tls_addr, (void*)proc->procgroup->tls.tls_tmpl, tls_size); + + *(uintptr_t*)ktcb = utcb; + + proc->pdata.fs_base = utcb; + proc->pdata.tls_vaddr = tls_vaddr; +} diff --git a/kernel/amd64/proc.h b/kernel/amd64/proc.h index 8f4073f..623f6fa 100644 --- a/kernel/amd64/proc.h +++ b/kernel/amd64/proc.h @@ -16,6 +16,7 @@ struct proc_platformdata { struct saved_regs regs; uintptr_t kernel_stack; uint64_t fs_base; + uintptr_t tls_vaddr; }; #endif // _KERNEL_AMD64_PROC_H diff --git a/kernel/amd64/procgroup.h b/kernel/amd64/procgroup.h new file mode 100644 index 0000000..610f1d3 --- /dev/null +++ b/kernel/amd64/procgroup.h @@ -0,0 +1,13 @@ +#ifndef _KERNEL_AMD64_PROCGRPUP_H +#define _KERNEL_AMD64_PROCGRPUP_H + +#include + +struct procgroup_tls { + uint8_t* tls_tmpl; + size_t tls_tmpl_size; + size_t tls_tmpl_total_size; + size_t tls_tmpl_pages; +}; + +#endif // _KERNEL_AMD64_PROCGRPUP_H diff --git a/kernel/irq/irq.c b/kernel/irq/irq.c index 5f86c55..b145e39 100644 --- a/kernel/irq/irq.c +++ b/kernel/irq/irq.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #if defined(__x86_64__) @@ -12,7 +12,7 @@ struct irq* irq_table[0x100]; -static rw_spin_lock_t irqs_lock; +static spin_lock_t irqs_lock = SPIN_LOCK_INIT; bool irq_attach (void (*func) (void*, void*), void* arg, uint32_t irq_num) { spin_lock_ctx_t ctxiqa; @@ -26,9 +26,9 @@ bool irq_attach (void (*func) (void*, void*), void* arg, uint32_t irq_num) { irq->arg = arg; irq->irq_num = irq_num; - rw_spin_write_lock (&irqs_lock, &ctxiqa); + spin_lock (&irqs_lock, &ctxiqa); irq_table[irq_num] = irq; - rw_spin_write_unlock (&irqs_lock, &ctxiqa); + spin_unlock (&irqs_lock, &ctxiqa); return true; } @@ -36,11 +36,11 @@ bool irq_attach (void (*func) (void*, void*), void* arg, uint32_t irq_num) { struct irq* irq_find (uint32_t irq_num) { spin_lock_ctx_t ctxiqa; - rw_spin_read_lock (&irqs_lock, &ctxiqa); + spin_lock (&irqs_lock, &ctxiqa); struct irq* irq = irq_table[irq_num]; - rw_spin_read_unlock (&irqs_lock, &ctxiqa); + spin_unlock (&irqs_lock, &ctxiqa); return irq; } diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index 5f61e3d..f314207 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -29,7 +28,7 @@ #define SCHED_REAP_FREQ 10 static struct rb_node_link* proc_tree = NULL; -static rw_spin_lock_t proc_tree_lock = RW_SPIN_LOCK_INIT; +static spin_lock_t proc_tree_lock = SPIN_LOCK_INIT; static atomic_int sched_cycles = 0; @@ -75,6 +74,23 @@ struct elf_aux proc_load_segments (struct proc* proc, uint8_t* elf) { (void*)((uintptr_t)elf + phdr->p_offset), phdr->p_filesz); } break; case PT_TLS: { +#if defined(__x86_64__) + size_t tls_align = phdr->p_align ? phdr->p_align : sizeof (uintptr_t); + size_t tls_size = phdr->p_memsz; + size_t tls_total_needed = tls_size + sizeof (uintptr_t); + size_t blks = div_align_up (tls_total_needed, PAGE_SIZE); + proc->procgroup->tls.tls_tmpl_pages = blks; + proc->procgroup->tls.tls_tmpl_size = tls_size; + proc->procgroup->tls.tls_tmpl_total_size = tls_total_needed; + + proc->procgroup->tls.tls_tmpl = malloc (blks * PAGE_SIZE); + memset (proc->procgroup->tls.tls_tmpl, 0, blks * PAGE_SIZE); + + memcpy (proc->procgroup->tls.tls_tmpl, (void*)((uintptr_t)elf + phdr->p_offset), + phdr->p_filesz); + + proc_init_tls (proc); +#endif } break; } } @@ -86,7 +102,6 @@ struct proc* proc_spawn_rd (char* name) { struct rd_file* rd_file = rd_get_file (name); bool ok = proc_check_elf (rd_file->content); - DEBUG ("ELF magic %s\n", (ok ? "OK" : "BAD")); if (!ok) return NULL; @@ -98,9 +113,9 @@ struct proc* proc_find_pid (int pid) { spin_lock_ctx_t ctxprtr; struct proc* proc = NULL; - rw_spin_read_lock (&proc_tree_lock, &ctxprtr); + spin_lock (&proc_tree_lock, &ctxprtr); rbtree_find (struct proc, &proc_tree, pid, proc, proc_tree_link, pid); - rw_spin_read_unlock (&proc_tree_lock, &ctxprtr); + spin_unlock (&proc_tree_lock, &ctxprtr); return proc; } @@ -109,21 +124,20 @@ void proc_register (struct proc* proc, struct cpu* cpu1) { spin_lock_ctx_t ctxcpu, ctxprtr; proc->cpu = cpu1 != NULL ? cpu1 : cpu_find_lightest (); - DEBUG ("Assigning CPU %d to PID %d\n", proc->cpu->id, proc->pid); struct cpu* cpu = proc->cpu; - rw_spin_write_lock (&proc_tree_lock, &ctxprtr); - rbtree_insert (struct proc, &proc_tree, &proc->proc_tree_link, proc_tree_link, pid); - rw_spin_write_unlock (&proc_tree_lock, &ctxprtr); - + spin_lock (&proc_tree_lock, &ctxprtr); spin_lock (&cpu->lock, &ctxcpu); - list_append (cpu->proc_run_q, &proc->cpu_run_q_link); - atomic_fetch_add (&cpu->proc_run_q_count, 1); + rbtree_insert (struct proc, &proc_tree, &proc->proc_tree_link, proc_tree_link, pid); + + atomic_fetch_add (&cpu->proc_run_q_count, 1); + list_append (cpu->proc_run_q, &proc->cpu_run_q_link); if (cpu->proc_current == NULL) cpu->proc_current = proc; + spin_unlock (&proc_tree_lock, &ctxprtr); spin_unlock (&cpu->lock, &ctxcpu); } @@ -162,7 +176,7 @@ static void proc_reap (void) { spin_lock_ctx_t ctxprtr; spin_lock_ctx_t ctxpr; - rw_spin_write_lock (&proc_tree_lock, &ctxprtr); + spin_lock (&proc_tree_lock, &ctxprtr); struct rb_node_link* node; rbtree_first (&proc_tree, node); @@ -182,7 +196,7 @@ static void proc_reap (void) { node = next; } - rw_spin_write_unlock (&proc_tree_lock, &ctxprtr); + spin_unlock (&proc_tree_lock, &ctxprtr); struct list_node_link *reap_link, *reap_link_tmp; list_foreach (reap_list, reap_link, reap_link_tmp) { diff --git a/kernel/proc/proc.h b/kernel/proc/proc.h index 5750f0a..029f31a 100644 --- a/kernel/proc/proc.h +++ b/kernel/proc/proc.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include diff --git a/kernel/proc/procgroup.c b/kernel/proc/procgroup.c index ae1e7a0..903ee4c 100644 --- a/kernel/proc/procgroup.c +++ b/kernel/proc/procgroup.c @@ -4,13 +4,12 @@ #include #include #include -#include #include #include #include static struct rb_node_link* procgroup_tree = NULL; -static rw_spin_lock_t procgroup_tree_lock = RW_SPIN_LOCK_INIT; +static spin_lock_t procgroup_tree_lock = SPIN_LOCK_INIT; static atomic_int pgids = 0; uintptr_t procgroup_map (struct procgroup* procgroup, uintptr_t vaddr, size_t pages, uint32_t flags, @@ -143,10 +142,10 @@ struct procgroup* procgroup_create (void) { procgroup->pd.cr3_paddr = mm_alloc_user_pd_phys (); procgroup->map_base = PROC_MAP_BASE; - rw_spin_write_lock (&procgroup_tree_lock, &ctxpgtr); + spin_lock (&procgroup_tree_lock, &ctxpgtr); rbtree_insert (struct procgroup, &procgroup_tree, &procgroup->procgroup_tree_link, procgroup_tree_link, pgid); - rw_spin_write_unlock (&procgroup_tree_lock, &ctxpgtr); + spin_unlock (&procgroup_tree_lock, &ctxpgtr); return procgroup; } @@ -160,7 +159,6 @@ void procgroup_attach (struct procgroup* procgroup, struct proc* proc) { rbtree_insert (struct proc, &procgroup->memb_proc_tree, &proc->procgroup_memb_tree_link, procgroup_memb_tree_link, pid); atomic_fetch_add (&procgroup->refs, 1); - DEBUG ("procgrpup attach PID %d to PGID %d\n", proc->pid, procgroup->pgid); spin_unlock (&proc->lock, &ctxpr); spin_unlock (&procgroup->lock, &ctxpg); @@ -174,19 +172,18 @@ void procgroup_detach (struct procgroup* procgroup, struct proc* proc) { rbtree_delete (&procgroup->memb_proc_tree, &proc->procgroup_memb_tree_link); int refs = atomic_fetch_sub (&procgroup->refs, 1); - DEBUG ("procgrpup detach PID %d to PGID %d\n", proc->pid, procgroup->pgid); spin_unlock (&proc->lock, &ctxpr); spin_unlock (&procgroup->lock, &ctxpg); if (refs == 1) { - rw_spin_write_lock (&procgroup_tree_lock, &ctxpgtr); + spin_lock (&procgroup_tree_lock, &ctxpgtr); spin_lock (&procgroup->lock, &ctxpg); rbtree_delete (&procgroup_tree, &procgroup->procgroup_tree_link); spin_unlock (&procgroup->lock, &ctxpg); - rw_spin_write_unlock (&procgroup_tree_lock, &ctxpgtr); + spin_unlock (&procgroup_tree_lock, &ctxpgtr); /* delete resources */ struct rb_node_link* rnode; @@ -214,6 +211,8 @@ void procgroup_detach (struct procgroup* procgroup, struct proc* proc) { pmm_free (procgroup->pd.cr3_paddr, 1); + free (procgroup->tls.tls_tmpl); + free (procgroup); } } diff --git a/kernel/proc/procgroup.h b/kernel/proc/procgroup.h index 6cec44b..5cfbe64 100644 --- a/kernel/proc/procgroup.h +++ b/kernel/proc/procgroup.h @@ -7,6 +7,7 @@ #include #include #include +#include struct proc; @@ -29,6 +30,7 @@ struct procgroup { struct pd pd; struct list_node_link* mappings; uintptr_t map_base; + struct procgroup_tls tls; }; struct procgroup* procgroup_create (void); diff --git a/kernel/sync/rw_spin_lock.c b/kernel/sync/rw_spin_lock.c deleted file mode 100644 index 01d4a89..0000000 --- a/kernel/sync/rw_spin_lock.c +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define WRITER_WAIT (1U << 31) -#define READER_MASK (~WRITER_WAIT) - -void rw_spin_read_lock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx) { - uint32_t value; - - irq_save (ctx); - - for (;;) { - value = atomic_load_explicit (rw, memory_order_relaxed); - - if ((value & WRITER_WAIT) == 0) { - if (atomic_compare_exchange_weak_explicit (rw, &value, value + 1, memory_order_acquire, - memory_order_relaxed)) { - return; - } - } - - spin_lock_relax (); - } -} - -void rw_spin_read_unlock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx) { - uint32_t old = atomic_fetch_sub_explicit (rw, 1, memory_order_release); - assert ((old & READER_MASK) > 0); - irq_restore (ctx); -} - -void rw_spin_write_lock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx) { - uint32_t value; - - irq_save (ctx); - - /* announce writer */ - for (;;) { - value = atomic_load_explicit (rw, memory_order_relaxed); - - if ((value & WRITER_WAIT) == 0) { - if (atomic_compare_exchange_weak_explicit (rw, &value, (value | WRITER_WAIT), - memory_order_acquire, memory_order_relaxed)) - break; - } else { - spin_lock_relax (); - } - } - - /* wait for readers */ - for (;;) { - value = atomic_load_explicit (rw, memory_order_acquire); - if ((value & READER_MASK) == 0) - return; - - spin_lock_relax (); - } -} - -void rw_spin_write_unlock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx) { - atomic_store_explicit (rw, 0, memory_order_release); - irq_restore (ctx); -} diff --git a/kernel/sync/rw_spin_lock.h b/kernel/sync/rw_spin_lock.h deleted file mode 100644 index 515ba8e..0000000 --- a/kernel/sync/rw_spin_lock.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _KERNEL_SYNC_RW_SPIN_LOCK_H -#define _KERNEL_SYNC_RW_SPIN_LOCK_H - -#include -#include -#include - -#define RW_SPIN_LOCK_INIT 0 - -typedef _Atomic (uint32_t) rw_spin_lock_t; - -void rw_spin_read_lock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx); -void rw_spin_read_unlock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx); -void rw_spin_write_lock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx); -void rw_spin_write_unlock (rw_spin_lock_t* rw, spin_lock_ctx_t* ctx); - -#endif // _KERNEL_SYNC_RW_SPIN_LOCK_H diff --git a/kernel/sync/src.mk b/kernel/sync/src.mk index 748287a..17eabd6 100644 --- a/kernel/sync/src.mk +++ b/kernel/sync/src.mk @@ -1,5 +1,3 @@ -c += sync/spin_lock.c \ - sync/rw_spin_lock.c +c += sync/spin_lock.c -o += sync/spin_lock.o \ - sync/rw_spin_lock.o +o += sync/spin_lock.o diff --git a/kernel/sys/proc.h b/kernel/sys/proc.h index 30f20dc..3ba4588 100644 --- a/kernel/sys/proc.h +++ b/kernel/sys/proc.h @@ -8,5 +8,6 @@ struct proc; struct proc* proc_from_elf (uint8_t* elf_contents); struct proc* proc_clone (struct proc* proto, uintptr_t vstack_top, uintptr_t entry); void proc_cleanup (struct proc* proc); +void proc_init_tls (struct proc* proc); #endif // _KERNEL_SYS_PROC_H diff --git a/kernel/sys/procgroup.h b/kernel/sys/procgroup.h new file mode 100644 index 0000000..f0ff225 --- /dev/null +++ b/kernel/sys/procgroup.h @@ -0,0 +1,8 @@ +#ifndef _KERNEL_SYS_PROCGROUP_H +#define _KERNEL_SYS_PROCGROUP_H + +#if defined(__x86_64__) +#include +#endif + +#endif // _KERNEL_SYS_PROCGROUP_H diff --git a/kernel/syscall/syscall.c b/kernel/syscall/syscall.c index 7fa04ba..78121f1 100644 --- a/kernel/syscall/syscall.c +++ b/kernel/syscall/syscall.c @@ -85,8 +85,6 @@ DEFINE_SYSCALL (sys_clone) { struct proc* new = proc_clone (proc, vstack_top, entry); - DEBUG ("new=%p\n", new); - if (new == NULL) { return SYSRESULT (-ST_OOM_ERROR); }