Rewrite init app in C, introduce MSL (MOP3 System Library)
All checks were successful
Build documentation / build-and-deploy (push) Successful in 35s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 35s
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
BasedOnStyle: LLVM
|
||||
Language: C
|
||||
|
||||
# Indentation
|
||||
IndentWidth: 2
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
|
||||
# Braces and blocks
|
||||
BreakBeforeBraces: Attach
|
||||
BraceWrapping:
|
||||
AfterFunction: false
|
||||
AfterControlStatement: false
|
||||
AfterStruct: false
|
||||
AfterEnum: false
|
||||
AfterUnion: false
|
||||
BeforeElse: false
|
||||
|
||||
# Control statements
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
|
||||
# Line breaking
|
||||
ColumnLimit: 100
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakStringLiterals: false
|
||||
|
||||
# Spacing
|
||||
SpaceBeforeParens: Always
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Left
|
||||
DerivePointerAlignment: false
|
||||
|
||||
# Alignment
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: true
|
||||
AlignOperands: false
|
||||
|
||||
# Includes
|
||||
SortIncludes: true
|
||||
|
||||
# Comments
|
||||
ReflowComments: false
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
|
||||
# Misc
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
@@ -235,7 +235,7 @@ void amd64_lapic_tick (uint32_t tick) { amd64_lapic_write (LAPIC_TIMICT, tick);
|
||||
* @return amount of ticsk in a given period
|
||||
*/
|
||||
static uint32_t amd64_lapic_calibrate (uint32_t us) {
|
||||
amd64_lapic_write (LAPIC_DCR, 0x03);
|
||||
amd64_lapic_write (LAPIC_DCR, 0x0B);
|
||||
|
||||
amd64_lapic_write (LAPIC_LVTTR, SCHED_PREEMPT_TIMER | (1 << 16));
|
||||
|
||||
@@ -256,7 +256,7 @@ static uint32_t amd64_lapic_calibrate (uint32_t us) {
|
||||
* Initial tick count
|
||||
*/
|
||||
static void amd64_lapic_start (uint32_t ticks) {
|
||||
amd64_lapic_write (LAPIC_DCR, 0x03);
|
||||
amd64_lapic_write (LAPIC_DCR, 0x0B);
|
||||
|
||||
amd64_lapic_write (LAPIC_LVTTR, SCHED_PREEMPT_TIMER | (1 << 17));
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ ALIGNED (16) static uint8_t uacpi_memory_buffer[UACPI_MEMORY_BUFFER_MAX];
|
||||
*/
|
||||
void bootmain (void) {
|
||||
struct cpu* bsp_cpu = cpu_make ();
|
||||
amd64_thiscpu_set_init ();
|
||||
|
||||
amd64_init (bsp_cpu, false);
|
||||
syscall_init ();
|
||||
@@ -52,10 +51,6 @@ void bootmain (void) {
|
||||
|
||||
smp_init ();
|
||||
|
||||
/* busy wait for cpus to come online */
|
||||
for (volatile int i = 0; i < INT_MAX; i++)
|
||||
;
|
||||
|
||||
mm_init2 ();
|
||||
|
||||
proc_init ();
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
static bool hpet_32bits = 1;
|
||||
/// Physical address for HPET MMIO
|
||||
static uintptr_t hpet_paddr;
|
||||
/// HPET nanoseconds for conversion
|
||||
static uint64_t hpet_clock_nano;
|
||||
/// HPET period in femtoseconds
|
||||
static uint64_t hpet_period_fs;
|
||||
/// Lock, which protects concurrent access. See \ref amd64/smp.c
|
||||
static spin_lock_t hpet_lock = SPIN_LOCK_INIT;
|
||||
|
||||
@@ -54,32 +54,22 @@ static void amd64_hpet_write (uint32_t reg, uint64_t value) {
|
||||
/// Read current value of \ref HPET_MCVR register.
|
||||
static uint64_t amd64_hpet_timestamp (void) { return amd64_hpet_read (HPET_MCVR); }
|
||||
|
||||
/**
|
||||
* @brief Get current HPET timestamp in nanoseconds
|
||||
*
|
||||
* @param lock
|
||||
* if true, hold \ref hpet_lock
|
||||
*/
|
||||
uint64_t amd64_hpet_current_nano (bool lock) {
|
||||
if (lock)
|
||||
spin_lock (&hpet_lock);
|
||||
|
||||
uint64_t t = amd64_hpet_timestamp () * hpet_clock_nano;
|
||||
|
||||
if (lock)
|
||||
spin_unlock (&hpet_lock);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/// Sleep for a given amount of microseconds. This time can last longer due to \ref hpet_lock being held.
|
||||
void amd64_hpet_sleep_micro (uint64_t us) {
|
||||
spin_lock (&hpet_lock);
|
||||
|
||||
uint64_t start = amd64_hpet_timestamp ();
|
||||
uint64_t conv = us * 1000;
|
||||
while (((amd64_hpet_timestamp () - start) * hpet_clock_nano) < conv)
|
||||
uint64_t target_fs = us * 1000000000ULL;
|
||||
|
||||
for (;;) {
|
||||
uint64_t current = amd64_hpet_timestamp ();
|
||||
uint64_t dt = current - start;
|
||||
|
||||
if ((dt * hpet_period_fs) >= target_fs)
|
||||
break;
|
||||
|
||||
__asm__ volatile ("pause" ::: "memory");
|
||||
}
|
||||
|
||||
spin_unlock (&hpet_lock);
|
||||
}
|
||||
@@ -114,7 +104,5 @@ void amd64_hpet_init (void) {
|
||||
gcidr = (((uint64_t)high << 32) | low);
|
||||
}
|
||||
|
||||
uint64_t period_fs = (gcidr >> 32);
|
||||
|
||||
hpet_clock_nano = period_fs / 1000000;
|
||||
hpet_period_fs = (gcidr >> 32);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <libk/std.h>
|
||||
|
||||
uint64_t amd64_hpet_current_nano (bool lock);
|
||||
void amd64_hpet_sleep_micro (uint64_t us);
|
||||
void amd64_hpet_init (void);
|
||||
|
||||
|
||||
@@ -65,8 +65,6 @@ static void amd64_gdt_init (struct cpu* cpu) {
|
||||
"movw %%ax, %%ds\n"
|
||||
"movw %%ax, %%es\n"
|
||||
"movw %%ax, %%ss\n"
|
||||
"movw %%ax, %%fs\n"
|
||||
"movw %%ax, %%gs\n"
|
||||
:
|
||||
: [kcode] "i"(GDT_KCODE), [kdata] "i"(GDT_KDATA)
|
||||
: "rax", "memory");
|
||||
|
||||
@@ -175,8 +175,6 @@ static void amd64_intr_exception (struct saved_regs* regs) {
|
||||
void amd64_intr_handler (void* stack_ptr) {
|
||||
struct saved_regs* regs = stack_ptr;
|
||||
|
||||
amd64_load_kernel_cr3 ();
|
||||
|
||||
if (regs->trap <= 31) {
|
||||
amd64_intr_exception (regs);
|
||||
} else {
|
||||
@@ -219,10 +217,6 @@ static void amd64_irq_restore_flags (uint64_t rflags) {
|
||||
|
||||
/// Save current interrupt state
|
||||
void irq_save (void) {
|
||||
/* before smp init. */
|
||||
if (thiscpu == NULL)
|
||||
return;
|
||||
|
||||
int prev = atomic_fetch_add_explicit (&thiscpu->irq_ctx.nesting, 1, memory_order_acq_rel);
|
||||
if (prev == 0)
|
||||
thiscpu->irq_ctx.rflags = amd64_irq_save_flags ();
|
||||
@@ -230,10 +224,6 @@ void irq_save (void) {
|
||||
|
||||
/// Restore interrupt state
|
||||
void irq_restore (void) {
|
||||
/* before smp init. */
|
||||
if (thiscpu == NULL)
|
||||
return;
|
||||
|
||||
int prev = atomic_fetch_sub_explicit (&thiscpu->irq_ctx.nesting, 1, memory_order_acq_rel);
|
||||
if (prev == 1)
|
||||
amd64_irq_restore_flags (thiscpu->irq_ctx.rflags);
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
;\
|
||||
movq %rsp, %rdi; \
|
||||
;\
|
||||
movq %cr3, %rax; \
|
||||
pushq %rax; \
|
||||
;\
|
||||
movq %rsp, %rbp; \
|
||||
;\
|
||||
subq $8, %rsp; \
|
||||
@@ -34,9 +31,6 @@
|
||||
;\
|
||||
movq %rbp, %rsp; \
|
||||
;\
|
||||
popq %rax; \
|
||||
movq %rax, %cr3; \
|
||||
;\
|
||||
pop_regs; \
|
||||
addq $16, %rsp; \
|
||||
;\
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
void do_sched (struct proc* proc) {
|
||||
thiscpu->tss.rsp0 = proc->pdata.kernel_stack;
|
||||
thiscpu->syscall_kernel_stack = proc->pdata.kernel_stack;
|
||||
amd64_wrmsr (MSR_GS_BASE, (uint64_t)proc->pdata.gs_base);
|
||||
|
||||
amd64_do_sched ((void*)&proc->pdata.regs, (void*)proc->pd.cr3_paddr);
|
||||
}
|
||||
|
||||
@@ -13,38 +13,31 @@
|
||||
#include <sys/syscall.h>
|
||||
|
||||
/// Cpu ID counter
|
||||
static uint32_t cpu_counter = 0;
|
||||
/// Lock for \ref cpu_counter
|
||||
static spin_lock_t cpu_counter_lock = SPIN_LOCK_INIT;
|
||||
static atomic_uint cpu_counter = 0;
|
||||
/// The CPUs
|
||||
static struct cpu cpus[CPUS_MAX];
|
||||
|
||||
static bool thiscpu_init = false;
|
||||
|
||||
void amd64_thiscpu_set_init (void) { thiscpu_init = true; }
|
||||
static atomic_int cpu_init_count;
|
||||
|
||||
/// Allocate a CPU structure
|
||||
struct cpu* cpu_make (void) {
|
||||
spin_lock (&cpu_counter_lock);
|
||||
int id = cpu_counter++;
|
||||
spin_unlock (&cpu_counter_lock);
|
||||
int id = atomic_fetch_add (&cpu_counter, 1);
|
||||
|
||||
struct cpu* cpu = &cpus[id];
|
||||
|
||||
memset (cpu, 0, sizeof (*cpu));
|
||||
cpu->lock = SPIN_LOCK_INIT;
|
||||
cpu->id = id;
|
||||
cpu->self = cpu;
|
||||
|
||||
amd64_wrmsr (MSR_SHADOW_GS_BASE, (uint64_t)cpu);
|
||||
amd64_wrmsr (MSR_GS_BASE, (uint64_t)cpu);
|
||||
|
||||
return cpu;
|
||||
}
|
||||
|
||||
struct cpu* cpu_get (void) {
|
||||
if (!thiscpu_init)
|
||||
return NULL;
|
||||
|
||||
return (struct cpu*)amd64_rdmsr (MSR_SHADOW_GS_BASE);
|
||||
struct cpu* ptr = (struct cpu*)amd64_rdmsr (MSR_GS_BASE);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/// Bootstrap code for non-BSP CPUs
|
||||
@@ -56,27 +49,36 @@ static void amd64_smp_bootstrap (struct limine_mp_info* mp_info) {
|
||||
amd64_init (cpu, true); /* gdt + idt */
|
||||
syscall_init ();
|
||||
|
||||
thiscpu->lapic_ticks = amd64_lapic_init (2500);
|
||||
thiscpu->lapic_ticks = amd64_lapic_init (10000);
|
||||
amd64_lapic_tick (thiscpu->lapic_ticks);
|
||||
|
||||
DEBUG ("CPU %u is online!\n", thiscpu->id);
|
||||
|
||||
__asm__ volatile ("sti");
|
||||
|
||||
atomic_fetch_sub (&cpu_init_count, 1);
|
||||
|
||||
for (;;)
|
||||
;
|
||||
}
|
||||
|
||||
/// Initialize SMP subsystem for AMD64. Start AP CPUs
|
||||
void smp_init (void) {
|
||||
thiscpu->lapic_ticks = amd64_lapic_init (2500);
|
||||
thiscpu->lapic_ticks = amd64_lapic_init (10000);
|
||||
|
||||
struct limine_mp_response* mp = limine_mp_request.response;
|
||||
|
||||
cpu_init_count = mp->cpu_count - 1; /* Don't include BSP */
|
||||
|
||||
for (size_t i = 0; i < mp->cpu_count; i++) {
|
||||
if (mp->cpus[i]->lapic_id != thiscpu->id) {
|
||||
DEBUG ("Trying CPU %u\n", mp->cpus[i]->lapic_id);
|
||||
mp->cpus[i]->goto_address = &amd64_smp_bootstrap;
|
||||
}
|
||||
}
|
||||
|
||||
while (atomic_load (&cpu_init_count) > 0)
|
||||
;
|
||||
|
||||
DEBUG ("All CPUs are online\n");
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ struct cpu {
|
||||
/* for syscall instruction */
|
||||
uintptr_t syscall_user_stack;
|
||||
uintptr_t syscall_kernel_stack;
|
||||
struct cpu* self;
|
||||
volatile uint8_t kernel_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t except_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t irq_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <proc/proc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/smp.h>
|
||||
#include <syscall/defs.h>
|
||||
#include <m/syscall_defs.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
extern void amd64_syscall_entry (void);
|
||||
@@ -14,8 +14,6 @@ extern void amd64_syscall_entry (void);
|
||||
int amd64_syscall_dispatch (void* stack_ptr) {
|
||||
struct saved_regs* regs = stack_ptr;
|
||||
|
||||
amd64_load_kernel_cr3 ();
|
||||
|
||||
int syscall_num = regs->rax;
|
||||
syscall_handler_func_t func = syscall_find_handler (syscall_num);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
.global amd64_syscall_entry
|
||||
amd64_syscall_entry:
|
||||
cli
|
||||
swapgs
|
||||
|
||||
movq %rsp, %gs:0
|
||||
movq %gs:8, %rsp
|
||||
@@ -20,15 +19,10 @@ amd64_syscall_entry:
|
||||
|
||||
push_regs
|
||||
|
||||
swapgs
|
||||
|
||||
cld
|
||||
|
||||
movq %rsp, %rdi
|
||||
|
||||
movq %cr3, %rax
|
||||
pushq %rax
|
||||
|
||||
movq %rsp, %rbp
|
||||
|
||||
subq $8, %rsp
|
||||
@@ -38,20 +32,9 @@ amd64_syscall_entry:
|
||||
|
||||
movq %rbp, %rsp
|
||||
|
||||
popq %rax
|
||||
movq %rax, %cr3
|
||||
|
||||
pop_regs
|
||||
|
||||
swapgs
|
||||
|
||||
addq $16, %rsp
|
||||
popq %rcx
|
||||
addq $8, %rsp
|
||||
popq %r11
|
||||
addq $16, %rsp
|
||||
addq $56, %rsp
|
||||
movq %gs:0, %rsp
|
||||
|
||||
swapgs
|
||||
|
||||
sysretq
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -1 +0,0 @@
|
||||
This is a collection of 0BSD-licensed freestanding C headers, for use with GCC or Clang.
|
||||
@@ -1,124 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_FLOAT_H
|
||||
#define __FREESTND_C_HDRS_FLOAT_H 1
|
||||
|
||||
#undef FLT_ROUNDS
|
||||
#define FLT_ROUNDS 1
|
||||
|
||||
#undef FLT_RADIX
|
||||
#define FLT_RADIX __FLT_RADIX__
|
||||
|
||||
#undef FLT_MANT_DIG
|
||||
#define FLT_MANT_DIG __FLT_MANT_DIG__
|
||||
#undef DBL_MANT_DIG
|
||||
#define DBL_MANT_DIG __DBL_MANT_DIG__
|
||||
#undef LDBL_MANT_DIG
|
||||
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201103L) \
|
||||
|| (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
||||
|
||||
#undef DECIMAL_DIG
|
||||
#define DECIMAL_DIG __DECIMAL_DIG__
|
||||
|
||||
#undef FLT_EVAL_METHOD
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
|
||||
#endif
|
||||
|
||||
#undef FLT_DIG
|
||||
#define FLT_DIG __FLT_DIG__
|
||||
#undef DBL_DIG
|
||||
#define DBL_DIG __DBL_DIG__
|
||||
#undef LDBL_DIG
|
||||
#define LDBL_DIG __LDBL_DIG__
|
||||
|
||||
#undef FLT_MIN_EXP
|
||||
#define FLT_MIN_EXP __FLT_MIN_EXP__
|
||||
#undef DBL_MIN_EXP
|
||||
#define DBL_MIN_EXP __DBL_MIN_EXP__
|
||||
#undef LDBL_MIN_EXP
|
||||
#define LDBL_MIN_EXP __LDBL_MIN_EXP__
|
||||
|
||||
#undef FLT_MIN_10_EXP
|
||||
#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
|
||||
#undef DBL_MIN_10_EXP
|
||||
#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
|
||||
#undef LDBL_MIN_10_EXP
|
||||
#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
|
||||
|
||||
#undef FLT_MAX_EXP
|
||||
#define FLT_MAX_EXP __FLT_MAX_EXP__
|
||||
#undef DBL_MAX_EXP
|
||||
#define DBL_MAX_EXP __DBL_MAX_EXP__
|
||||
#undef LDBL_MAX_EXP
|
||||
#define LDBL_MAX_EXP __LDBL_MAX_EXP__
|
||||
|
||||
#undef FLT_MAX_10_EXP
|
||||
#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
|
||||
#undef DBL_MAX_10_EXP
|
||||
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
|
||||
|
||||
#undef FLT_MAX
|
||||
#define FLT_MAX __FLT_MAX__
|
||||
#undef DBL_MAX
|
||||
#define DBL_MAX __DBL_MAX__
|
||||
#undef LDBL_MAX
|
||||
#define LDBL_MAX __LDBL_MAX__
|
||||
|
||||
#undef FLT_EPSILON
|
||||
#define FLT_EPSILON __FLT_EPSILON__
|
||||
#undef DBL_EPSILON
|
||||
#define DBL_EPSILON __DBL_EPSILON__
|
||||
#undef LDBL_EPSILON
|
||||
#define LDBL_EPSILON __LDBL_EPSILON__
|
||||
|
||||
#undef FLT_MIN
|
||||
#define FLT_MIN __FLT_MIN__
|
||||
#undef DBL_MIN
|
||||
#define DBL_MIN __DBL_MIN__
|
||||
#undef LDBL_MIN
|
||||
#define LDBL_MIN __LDBL_MIN__
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) \
|
||||
|| (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
|
||||
|
||||
#undef FLT_DECIMAL_DIG
|
||||
#define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
|
||||
#undef DBL_DECIMAL_DIG
|
||||
#define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
|
||||
#undef LDBL_DECIMAL_DIG
|
||||
#define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
|
||||
|
||||
#undef FLT_TRUE_MIN
|
||||
#define FLT_TRUE_MIN __FLT_DENORM_MIN__
|
||||
#undef DBL_TRUE_MIN
|
||||
#define DBL_TRUE_MIN __DBL_DENORM_MIN__
|
||||
#undef LDBL_TRUE_MIN
|
||||
#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
|
||||
|
||||
#undef FLT_HAS_SUBNORM
|
||||
#define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
|
||||
#undef DBL_HAS_SUBNORM
|
||||
#define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
|
||||
#undef LDBL_HAS_SUBNORM
|
||||
#define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_ISO646_H
|
||||
#define __FREESTND_C_HDRS_ISO646_H 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#undef and
|
||||
#define and &&
|
||||
#undef and_eq
|
||||
#define and_eq &=
|
||||
#undef bitand
|
||||
#define bitand &
|
||||
#undef bitor
|
||||
#define bitor |
|
||||
#undef compl
|
||||
#define compl ~
|
||||
#undef not
|
||||
#define not !
|
||||
#undef not_eq
|
||||
#define not_eq !=
|
||||
#undef or
|
||||
#define or ||
|
||||
#undef or_eq
|
||||
#define or_eq |=
|
||||
#undef xor
|
||||
#define xor ^
|
||||
#undef xor_eq
|
||||
#define xor_eq ^=
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,147 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_LIMITS_H
|
||||
#define __FREESTND_C_HDRS_LIMITS_H 1
|
||||
|
||||
#undef CHAR_BIT
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
#ifndef MB_LEN_MAX
|
||||
# define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
#undef SCHAR_MAX
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
#undef SCHAR_MIN
|
||||
#define SCHAR_MIN (-SCHAR_MAX - 1)
|
||||
|
||||
#undef UCHAR_MAX
|
||||
#if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
|
||||
#else
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
# undef CHAR_MIN
|
||||
# if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define CHAR_MIN 0U
|
||||
# else
|
||||
# define CHAR_MIN 0
|
||||
# endif
|
||||
#else
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
#endif
|
||||
|
||||
#undef SHRT_MAX
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
#undef SHRT_MIN
|
||||
#define SHRT_MIN (-SHRT_MAX - 1)
|
||||
|
||||
#undef USHRT_MAX
|
||||
#if __SHRT_MAX__ == __INT_MAX__
|
||||
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
|
||||
#else
|
||||
# define USHRT_MAX (SHRT_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
#undef INT_MAX
|
||||
#define INT_MAX __INT_MAX__
|
||||
#undef INT_MIN
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
|
||||
#undef UINT_MAX
|
||||
#define UINT_MAX (INT_MAX * 2U + 1U)
|
||||
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
#undef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1L)
|
||||
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
|
||||
#undef LLONG_MAX
|
||||
#define LLONG_MAX __LONG_LONG_MAX__
|
||||
#undef LLONG_MIN
|
||||
#define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
|
||||
#undef ULLONG_MAX
|
||||
#define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
|
||||
#if defined(__clang__)
|
||||
# undef CHAR_WIDTH
|
||||
# define CHAR_WIDTH CHAR_BIT
|
||||
# undef SCHAR_WIDTH
|
||||
# define SCHAR_WIDTH CHAR_BIT
|
||||
# undef UCHAR_WIDTH
|
||||
# define UCHAR_WIDTH CHAR_BIT
|
||||
#else
|
||||
# undef CHAR_WIDTH
|
||||
# define CHAR_WIDTH __SCHAR_WIDTH__
|
||||
# undef SCHAR_WIDTH
|
||||
# define SCHAR_WIDTH __SCHAR_WIDTH__
|
||||
# undef UCHAR_WIDTH
|
||||
# define UCHAR_WIDTH __SCHAR_WIDTH__
|
||||
#endif
|
||||
# undef SHRT_WIDTH
|
||||
# define SHRT_WIDTH __SHRT_WIDTH__
|
||||
# undef USHRT_WIDTH
|
||||
# define USHRT_WIDTH __SHRT_WIDTH__
|
||||
# undef INT_WIDTH
|
||||
# define INT_WIDTH __INT_WIDTH__
|
||||
# undef UINT_WIDTH
|
||||
# define UINT_WIDTH __INT_WIDTH__
|
||||
# undef LONG_WIDTH
|
||||
# define LONG_WIDTH __LONG_WIDTH__
|
||||
# undef ULONG_WIDTH
|
||||
# define ULONG_WIDTH __LONG_WIDTH__
|
||||
#if defined(__clang__)
|
||||
# undef LLONG_WIDTH
|
||||
# define LLONG_WIDTH __LLONG_WIDTH__
|
||||
# undef ULLONG_WIDTH
|
||||
# define ULLONG_WIDTH __LLONG_WIDTH__
|
||||
#else
|
||||
# undef LLONG_WIDTH
|
||||
# define LLONG_WIDTH __LONG_LONG_WIDTH__
|
||||
# undef ULLONG_WIDTH
|
||||
# define ULLONG_WIDTH __LONG_LONG_WIDTH__
|
||||
#endif
|
||||
|
||||
#undef BOOL_MAX
|
||||
#define BOOL_MAX 1
|
||||
#undef BOOL_WIDTH
|
||||
#define BOOL_WIDTH 1
|
||||
|
||||
#ifdef __BITINT_MAXWIDTH__
|
||||
# undef BITINT_MAXWIDTH
|
||||
# define BITINT_MAXWIDTH __BITINT_MAXWIDTH__
|
||||
#endif
|
||||
|
||||
#define __STDC_VERSION_LIMITS_H__ 202311L
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,36 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDALIGN_H
|
||||
#define __FREESTND_C_HDRS_STDALIGN_H 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
/* These do not need to be defined for C23+ */
|
||||
#else
|
||||
# undef alignas
|
||||
# define alignas _Alignas
|
||||
# undef alignof
|
||||
# define alignof _Alignof
|
||||
|
||||
# undef __alignof_is_defined
|
||||
# define __alignof_is_defined 1
|
||||
# undef __alignas_is_defined
|
||||
# define __alignas_is_defined 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDARG_H
|
||||
#define __FREESTND_C_HDRS_STDARG_H 1
|
||||
|
||||
typedef __builtin_va_list va_list;
|
||||
|
||||
#undef va_start
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
# define va_start(v, ...) __builtin_va_start(v, 0)
|
||||
#else
|
||||
# define va_start(v, l) __builtin_va_start(v, l)
|
||||
#endif
|
||||
#undef va_end
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#undef va_arg
|
||||
#define va_arg(v, l) __builtin_va_arg(v, l)
|
||||
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
# undef va_copy
|
||||
# define va_copy(d, s) __builtin_va_copy(d, s)
|
||||
#endif
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
# define __STDC_VERSION_STDARG_H__ 202311L
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,95 +0,0 @@
|
||||
#ifndef _STD_ATOMIC_H
|
||||
#define _STD_ATOMIC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
// modified version of: https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/stdatomic.h
|
||||
|
||||
typedef enum memory_order {
|
||||
memory_order_relaxed = __ATOMIC_RELAXED,
|
||||
memory_order_consume = __ATOMIC_CONSUME,
|
||||
memory_order_acquire = __ATOMIC_ACQUIRE,
|
||||
memory_order_release = __ATOMIC_RELEASE,
|
||||
memory_order_acq_rel = __ATOMIC_ACQ_REL,
|
||||
memory_order_seq_cst = __ATOMIC_SEQ_CST
|
||||
} memory_order;
|
||||
|
||||
typedef _Atomic(_Bool) atomic_bool;
|
||||
typedef _Atomic(char) atomic_char;
|
||||
typedef _Atomic(signed char) atomic_schar;
|
||||
typedef _Atomic(unsigned char) atomic_uchar;
|
||||
typedef _Atomic(short) atomic_short;
|
||||
typedef _Atomic(unsigned short) atomic_ushort;
|
||||
typedef _Atomic(int) atomic_int;
|
||||
typedef _Atomic(unsigned int) atomic_uint;
|
||||
typedef _Atomic(long) atomic_long;
|
||||
typedef _Atomic(unsigned long) atomic_ulong;
|
||||
typedef _Atomic(long long) atomic_llong;
|
||||
typedef _Atomic(unsigned long long) atomic_ullong;
|
||||
typedef _Atomic(uint_least16_t) atomic_char16_t;
|
||||
typedef _Atomic(uint_least32_t) atomic_char32_t;
|
||||
typedef _Atomic(wchar_t) atomic_wchar_t;
|
||||
typedef _Atomic(int_least8_t) atomic_int_least8_t;
|
||||
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
|
||||
typedef _Atomic(int_least16_t) atomic_int_least16_t;
|
||||
typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
|
||||
typedef _Atomic(int_least32_t) atomic_int_least32_t;
|
||||
typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
|
||||
typedef _Atomic(int_least64_t) atomic_int_least64_t;
|
||||
typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
|
||||
typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
|
||||
typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
|
||||
typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
|
||||
typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
|
||||
typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
|
||||
typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
|
||||
typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
|
||||
typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
|
||||
typedef _Atomic(intptr_t) atomic_intptr_t;
|
||||
typedef _Atomic(uintptr_t) atomic_uintptr_t;
|
||||
typedef _Atomic(size_t) atomic_size_t;
|
||||
typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
|
||||
typedef _Atomic(intmax_t) atomic_intmax_t;
|
||||
typedef _Atomic(uintmax_t) atomic_uintmax_t;
|
||||
|
||||
typedef struct atomic_flag { atomic_bool _Value; } atomic_flag;
|
||||
#define ATOMIC_FLAG_INIT ((atomic_flag){ 0 })
|
||||
|
||||
#define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
|
||||
#define atomic_store_explicit __c11_atomic_store
|
||||
|
||||
#define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
|
||||
#define atomic_load_explicit __c11_atomic_load
|
||||
|
||||
#define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST)
|
||||
#define atomic_exchange_explicit __c11_atomic_exchange
|
||||
|
||||
#define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
||||
#define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
|
||||
|
||||
#define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
||||
#define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak
|
||||
|
||||
#define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
|
||||
#define atomic_fetch_add_explicit __c11_atomic_fetch_add
|
||||
|
||||
#define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
|
||||
#define atomic_fetch_sub_explicit __c11_atomic_fetch_sub
|
||||
|
||||
#define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
|
||||
#define atomic_fetch_or_explicit __c11_atomic_fetch_or
|
||||
|
||||
#define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
|
||||
#define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
|
||||
|
||||
#define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
|
||||
#define atomic_fetch_and_explicit __c11_atomic_fetch_and
|
||||
|
||||
#define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST)
|
||||
#define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order)
|
||||
|
||||
#define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST)
|
||||
#define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order)
|
||||
|
||||
#endif // _STD_ATOMIC_H
|
||||
@@ -1,37 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDBOOL_H
|
||||
#define __FREESTND_C_HDRS_STDBOOL_H 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
/* These do not need to be defined for C23+ */
|
||||
#else
|
||||
# undef bool
|
||||
# define bool _Bool
|
||||
|
||||
# undef true
|
||||
# define true 1
|
||||
# undef false
|
||||
# define false 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#undef __bool_true_false_are_defined
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDDEF_H
|
||||
#define __FREESTND_C_HDRS_STDDEF_H 1
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
typedef typeof(nullptr) nullptr_t;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
#endif
|
||||
|
||||
#undef NULL
|
||||
#ifndef __cplusplus
|
||||
# define NULL ((void *)0)
|
||||
#else
|
||||
# define NULL __null
|
||||
#endif
|
||||
|
||||
#undef offsetof
|
||||
#define offsetof(s, m) __builtin_offsetof(s, m)
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
# undef unreachable
|
||||
# define unreachable() __builtin_unreachable()
|
||||
|
||||
# define __STDC_VERSION_STDDEF_H__ 202311L
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,375 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDINT_H
|
||||
#define __FREESTND_C_HDRS_STDINT_H 1
|
||||
|
||||
#ifdef __UINT8_TYPE__
|
||||
typedef __UINT8_TYPE__ uint8_t;
|
||||
#endif
|
||||
#ifdef __UINT16_TYPE__
|
||||
typedef __UINT16_TYPE__ uint16_t;
|
||||
#endif
|
||||
#ifdef __UINT32_TYPE__
|
||||
typedef __UINT32_TYPE__ uint32_t;
|
||||
#endif
|
||||
#ifdef __UINT64_TYPE__
|
||||
typedef __UINT64_TYPE__ uint64_t;
|
||||
#endif
|
||||
|
||||
typedef __UINT_LEAST8_TYPE__ uint_least8_t;
|
||||
typedef __UINT_LEAST16_TYPE__ uint_least16_t;
|
||||
typedef __UINT_LEAST32_TYPE__ uint_least32_t;
|
||||
typedef __UINT_LEAST64_TYPE__ uint_least64_t;
|
||||
|
||||
typedef __UINT_FAST8_TYPE__ uint_fast8_t;
|
||||
typedef __UINT_FAST16_TYPE__ uint_fast16_t;
|
||||
typedef __UINT_FAST32_TYPE__ uint_fast32_t;
|
||||
typedef __UINT_FAST64_TYPE__ uint_fast64_t;
|
||||
|
||||
#ifdef __INT8_TYPE__
|
||||
typedef __INT8_TYPE__ int8_t;
|
||||
#endif
|
||||
#ifdef __INT16_TYPE__
|
||||
typedef __INT16_TYPE__ int16_t;
|
||||
#endif
|
||||
#ifdef __INT32_TYPE__
|
||||
typedef __INT32_TYPE__ int32_t;
|
||||
#endif
|
||||
#ifdef __INT64_TYPE__
|
||||
typedef __INT64_TYPE__ int64_t;
|
||||
#endif
|
||||
|
||||
typedef __INT_LEAST8_TYPE__ int_least8_t;
|
||||
typedef __INT_LEAST16_TYPE__ int_least16_t;
|
||||
typedef __INT_LEAST32_TYPE__ int_least32_t;
|
||||
typedef __INT_LEAST64_TYPE__ int_least64_t;
|
||||
|
||||
typedef __INT_FAST8_TYPE__ int_fast8_t;
|
||||
typedef __INT_FAST16_TYPE__ int_fast16_t;
|
||||
typedef __INT_FAST32_TYPE__ int_fast32_t;
|
||||
typedef __INT_FAST64_TYPE__ int_fast64_t;
|
||||
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
#endif
|
||||
#ifdef __INTPTR_TYPE__
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
#endif
|
||||
|
||||
typedef __UINTMAX_TYPE__ uintmax_t;
|
||||
typedef __INTMAX_TYPE__ intmax_t;
|
||||
|
||||
/* Clang and GCC have different mechanisms for INT32_C and friends. */
|
||||
#ifdef __clang__
|
||||
# ifndef __FREESTND_C_HDRS_C_JOIN
|
||||
# define __FREESTND_C_HDRS_C_EXPAND_JOIN(x, suffix) x ## suffix
|
||||
# define __FREESTND_C_HDRS_C_JOIN(x, suffix) __FREESTND_C_HDRS_C_EXPAND_JOIN(x, suffix)
|
||||
# endif
|
||||
|
||||
# undef INT8_C
|
||||
# define INT8_C(x) __FREESTND_C_HDRS_C_JOIN(x, __INT8_C_SUFFIX__)
|
||||
# undef INT16_C
|
||||
# define INT16_C(x) __FREESTND_C_HDRS_C_JOIN(x, __INT16_C_SUFFIX__)
|
||||
# undef INT32_C
|
||||
# define INT32_C(x) __FREESTND_C_HDRS_C_JOIN(x, __INT32_C_SUFFIX__)
|
||||
# undef INT64_C
|
||||
# define INT64_C(x) __FREESTND_C_HDRS_C_JOIN(x, __INT64_C_SUFFIX__)
|
||||
|
||||
# undef UINT8_C
|
||||
# define UINT8_C(x) __FREESTND_C_HDRS_C_JOIN(x, __UINT8_C_SUFFIX__)
|
||||
# undef UINT16_C
|
||||
# define UINT16_C(x) __FREESTND_C_HDRS_C_JOIN(x, __UINT16_C_SUFFIX__)
|
||||
# undef UINT32_C
|
||||
# define UINT32_C(x) __FREESTND_C_HDRS_C_JOIN(x, __UINT32_C_SUFFIX__)
|
||||
# undef UINT64_C
|
||||
# define UINT64_C(x) __FREESTND_C_HDRS_C_JOIN(x, __UINT64_C_SUFFIX__)
|
||||
|
||||
# undef INTMAX_C
|
||||
# define INTMAX_C(x) __FREESTND_C_HDRS_C_JOIN(x, __INTMAX_C_SUFFIX__)
|
||||
# undef UINTMAX_C
|
||||
# define UINTMAX_C(x) __FREESTND_C_HDRS_C_JOIN(x, __UINTMAX_C_SUFFIX__)
|
||||
#else
|
||||
# undef INT8_C
|
||||
# define INT8_C(x) __INT8_C(x)
|
||||
# undef INT16_C
|
||||
# define INT16_C(x) __INT16_C(x)
|
||||
# undef INT32_C
|
||||
# define INT32_C(x) __INT32_C(x)
|
||||
# undef INT64_C
|
||||
# define INT64_C(x) __INT64_C(x)
|
||||
|
||||
# undef UINT8_C
|
||||
# define UINT8_C(x) __UINT8_C(x)
|
||||
# undef UINT16_C
|
||||
# define UINT16_C(x) __UINT16_C(x)
|
||||
# undef UINT32_C
|
||||
# define UINT32_C(x) __UINT32_C(x)
|
||||
# undef UINT64_C
|
||||
# define UINT64_C(x) __UINT64_C(x)
|
||||
|
||||
# undef INTMAX_C
|
||||
# define INTMAX_C(x) __INTMAX_C(x)
|
||||
# undef UINTMAX_C
|
||||
# define UINTMAX_C(x) __UINTMAX_C(x)
|
||||
#endif
|
||||
|
||||
#ifdef __UINT8_MAX__
|
||||
# undef UINT8_MAX
|
||||
# define UINT8_MAX __UINT8_MAX__
|
||||
#endif
|
||||
#ifdef __UINT16_MAX__
|
||||
# undef UINT16_MAX
|
||||
# define UINT16_MAX __UINT16_MAX__
|
||||
#endif
|
||||
#ifdef __UINT32_MAX__
|
||||
# undef UINT32_MAX
|
||||
# define UINT32_MAX __UINT32_MAX__
|
||||
#endif
|
||||
#ifdef __UINT64_MAX__
|
||||
# undef UINT64_MAX
|
||||
# define UINT64_MAX __UINT64_MAX__
|
||||
#endif
|
||||
|
||||
#ifdef __INT8_MAX__
|
||||
# undef INT8_MAX
|
||||
# define INT8_MAX __INT8_MAX__
|
||||
#endif
|
||||
#ifdef __INT16_MAX__
|
||||
# undef INT16_MAX
|
||||
# define INT16_MAX __INT16_MAX__
|
||||
#endif
|
||||
#ifdef __INT32_MAX__
|
||||
# undef INT32_MAX
|
||||
# define INT32_MAX __INT32_MAX__
|
||||
#endif
|
||||
#ifdef __INT64_MAX__
|
||||
# undef INT64_MAX
|
||||
# define INT64_MAX __INT64_MAX__
|
||||
#endif
|
||||
|
||||
#ifdef __INT8_MAX__
|
||||
# undef INT8_MIN
|
||||
# define INT8_MIN (-INT8_MAX - 1)
|
||||
#endif
|
||||
#ifdef __INT16_MAX__
|
||||
# undef INT16_MIN
|
||||
# define INT16_MIN (-INT16_MAX - 1)
|
||||
#endif
|
||||
#ifdef __INT32_MAX__
|
||||
# undef INT32_MIN
|
||||
# define INT32_MIN (-INT32_MAX - 1)
|
||||
#endif
|
||||
#ifdef __INT64_MAX__
|
||||
# undef INT64_MIN
|
||||
# define INT64_MIN (-INT64_MAX - 1)
|
||||
#endif
|
||||
|
||||
#undef UINT_LEAST8_MAX
|
||||
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
|
||||
#undef UINT_LEAST16_MAX
|
||||
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
|
||||
#undef UINT_LEAST32_MAX
|
||||
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
|
||||
#undef UINT_LEAST64_MAX
|
||||
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
|
||||
|
||||
#undef INT_LEAST8_MAX
|
||||
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
|
||||
#undef INT_LEAST16_MAX
|
||||
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
|
||||
#undef INT_LEAST32_MAX
|
||||
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
|
||||
#undef INT_LEAST64_MAX
|
||||
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
|
||||
|
||||
#undef INT_LEAST8_MIN
|
||||
#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
|
||||
#undef INT_LEAST16_MIN
|
||||
#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
|
||||
#undef INT_LEAST32_MIN
|
||||
#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
|
||||
#undef INT_LEAST64_MIN
|
||||
#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
|
||||
|
||||
#undef UINT_FAST8_MAX
|
||||
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
|
||||
#undef UINT_FAST16_MAX
|
||||
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
|
||||
#undef UINT_FAST32_MAX
|
||||
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
|
||||
#undef UINT_FAST64_MAX
|
||||
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
|
||||
|
||||
#undef INT_FAST8_MAX
|
||||
#define INT_FAST8_MAX __INT_FAST8_MAX__
|
||||
#undef INT_FAST16_MAX
|
||||
#define INT_FAST16_MAX __INT_FAST16_MAX__
|
||||
#undef INT_FAST32_MAX
|
||||
#define INT_FAST32_MAX __INT_FAST32_MAX__
|
||||
#undef INT_FAST64_MAX
|
||||
#define INT_FAST64_MAX __INT_FAST64_MAX__
|
||||
|
||||
#undef INT_FAST8_MIN
|
||||
#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
|
||||
#undef INT_FAST16_MIN
|
||||
#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
|
||||
#undef INT_FAST32_MIN
|
||||
#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
|
||||
#undef INT_FAST64_MIN
|
||||
#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
|
||||
|
||||
#ifdef __UINTPTR_MAX__
|
||||
# undef UINTPTR_MAX
|
||||
# define UINTPTR_MAX __UINTPTR_MAX__
|
||||
#endif
|
||||
#ifdef __INTPTR_MAX__
|
||||
# undef INTPTR_MAX
|
||||
# define INTPTR_MAX __INTPTR_MAX__
|
||||
# undef INTPTR_MIN
|
||||
# define INTPTR_MIN (-INTPTR_MAX - 1)
|
||||
#endif
|
||||
|
||||
#undef UINTMAX_MAX
|
||||
#define UINTMAX_MAX __UINTMAX_MAX__
|
||||
#undef INTMAX_MAX
|
||||
#define INTMAX_MAX __INTMAX_MAX__
|
||||
#undef INTMAX_MIN
|
||||
#define INTMAX_MIN (-INTMAX_MAX - 1)
|
||||
|
||||
#undef PTRDIFF_MAX
|
||||
#define PTRDIFF_MAX __PTRDIFF_MAX__
|
||||
#undef PTRDIFF_MIN
|
||||
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
|
||||
|
||||
#undef SIG_ATOMIC_MAX
|
||||
#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
|
||||
#undef SIG_ATOMIC_MIN
|
||||
#define SIG_ATOMIC_MIN (-SIG_ATOMIC_MAX - 1)
|
||||
|
||||
#undef SIZE_MAX
|
||||
#define SIZE_MAX __SIZE_MAX__
|
||||
|
||||
#undef WCHAR_MAX
|
||||
#define WCHAR_MAX __WCHAR_MAX__
|
||||
#undef WCHAR_MIN
|
||||
#define WCHAR_MIN (-WCHAR_MAX - 1)
|
||||
|
||||
#undef WINT_MAX
|
||||
#define WINT_MAX __WINT_MAX__
|
||||
#undef WINT_MIN
|
||||
#define WINT_MIN (-WINT_MAX - 1)
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
|
||||
|
||||
#ifdef __INT8_TYPE__
|
||||
# undef INT8_WIDTH
|
||||
# define INT8_WIDTH 8
|
||||
#endif
|
||||
#ifdef __UINT8_TYPE__
|
||||
# undef UINT8_WIDTH
|
||||
# define UINT8_WIDTH 8
|
||||
#endif
|
||||
#ifdef __INT16_TYPE__
|
||||
# undef INT16_WIDTH
|
||||
# define INT16_WIDTH 16
|
||||
#endif
|
||||
#ifdef __UINT16_TYPE__
|
||||
# undef UINT16_WIDTH
|
||||
# define UINT16_WIDTH 16
|
||||
#endif
|
||||
#ifdef __INT32_TYPE__
|
||||
# undef INT32_WIDTH
|
||||
# define INT32_WIDTH 32
|
||||
#endif
|
||||
#ifdef __UINT32_TYPE__
|
||||
# undef UINT32_WIDTH
|
||||
# define UINT32_WIDTH 32
|
||||
#endif
|
||||
#ifdef __INT64_TYPE__
|
||||
# undef INT64_WIDTH
|
||||
# define INT64_WIDTH 64
|
||||
#endif
|
||||
#ifdef __UINT64_TYPE__
|
||||
# undef UINT64_WIDTH
|
||||
# define UINT64_WIDTH 64
|
||||
#endif
|
||||
|
||||
#undef INT_LEAST8_WIDTH
|
||||
#define INT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
|
||||
#undef UINT_LEAST8_WIDTH
|
||||
#define UINT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
|
||||
#undef INT_LEAST16_WIDTH
|
||||
#define INT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
|
||||
#undef UINT_LEAST16_WIDTH
|
||||
#define UINT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
|
||||
#undef INT_LEAST32_WIDTH
|
||||
#define INT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
|
||||
#undef UINT_LEAST32_WIDTH
|
||||
#define UINT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
|
||||
#undef INT_LEAST64_WIDTH
|
||||
#define INT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
|
||||
#undef UINT_LEAST64_WIDTH
|
||||
#define UINT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
|
||||
|
||||
#undef INT_FAST8_WIDTH
|
||||
#define INT_FAST8_WIDTH __INT_FAST8_WIDTH__
|
||||
#undef UINT_FAST8_WIDTH
|
||||
#define UINT_FAST8_WIDTH __INT_FAST8_WIDTH__
|
||||
#undef INT_FAST16_WIDTH
|
||||
#define INT_FAST16_WIDTH __INT_FAST16_WIDTH__
|
||||
#undef UINT_FAST16_WIDTH
|
||||
#define UINT_FAST16_WIDTH __INT_FAST16_WIDTH__
|
||||
#undef INT_FAST32_WIDTH
|
||||
#define INT_FAST32_WIDTH __INT_FAST32_WIDTH__
|
||||
#undef UINT_FAST32_WIDTH
|
||||
#define UINT_FAST32_WIDTH __INT_FAST32_WIDTH__
|
||||
#undef INT_FAST64_WIDTH
|
||||
#define INT_FAST64_WIDTH __INT_FAST64_WIDTH__
|
||||
#undef UINT_FAST64_WIDTH
|
||||
#define UINT_FAST64_WIDTH __INT_FAST64_WIDTH__
|
||||
|
||||
#ifdef __INTPTR_TYPE__
|
||||
# undef INTPTR_WIDTH
|
||||
# define INTPTR_WIDTH __INTPTR_WIDTH__
|
||||
#endif
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
# undef UINTPTR_WIDTH
|
||||
# define UINTPTR_WIDTH __INTPTR_WIDTH__
|
||||
#endif
|
||||
|
||||
#undef INTMAX_WIDTH
|
||||
#define INTMAX_WIDTH __INTMAX_WIDTH__
|
||||
#undef UINTMAX_WIDTH
|
||||
#define UINTMAX_WIDTH __INTMAX_WIDTH__
|
||||
|
||||
#undef PTRDIFF_WIDTH
|
||||
#define PTRDIFF_WIDTH __PTRDIFF_WIDTH__
|
||||
|
||||
#undef SIG_ATOMIC_WIDTH
|
||||
#define SIG_ATOMIC_WIDTH __SIG_ATOMIC_WIDTH__
|
||||
|
||||
#undef SIZE_WIDTH
|
||||
#define SIZE_WIDTH __SIZE_WIDTH__
|
||||
|
||||
#undef WCHAR_WIDTH
|
||||
#define WCHAR_WIDTH __WCHAR_WIDTH__
|
||||
|
||||
#undef WINT_WIDTH
|
||||
#define WINT_WIDTH __WINT_WIDTH__
|
||||
|
||||
#define __STDC_VERSION_STDINT_H__ 202311L
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
/* Copyright (C) 2022-2025 Mintsuki and contributors.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __FREESTND_C_HDRS_STDNORETURN_H
|
||||
#define __FREESTND_C_HDRS_STDNORETURN_H 1
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define noreturn _Noreturn
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,7 @@ cflags += -nostdinc \
|
||||
-Wextra \
|
||||
-mcmodel=kernel
|
||||
|
||||
cflags += -isystem . -isystem c_headers/include
|
||||
cflags += -isystem . -isystem ../include
|
||||
|
||||
cflags += -DPRINTF_INCLUDE_CONFIG_H=1 \
|
||||
-D_ALLOC_SKIP_DEFINE
|
||||
|
||||
@@ -7,11 +7,7 @@ void debugprintf (const char* fmt, ...);
|
||||
|
||||
#define DEBUG(fmt, ...) \
|
||||
do { \
|
||||
if (thiscpu != NULL) { \
|
||||
debugprintf ("(CPU %u) %s:%d: " fmt, thiscpu->id, __func__, __LINE__, ##__VA_ARGS__); \
|
||||
} else { \
|
||||
debugprintf ("%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__); \
|
||||
} \
|
||||
debugprintf ("(CPU %u) %s:%d: " fmt, thiscpu->id, __func__, __LINE__, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif // _KERNEL_SYS_DEBUG_H
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef _KERNEL_SYSCALL_DEFS_H
|
||||
#define _KERNEL_SYSCALL_DEFS_H
|
||||
|
||||
#define SYS_PROC_QUIT 1
|
||||
#define SYS_PROC_TEST 2
|
||||
|
||||
#define SR_OK 0
|
||||
#define SR_SYSCALL_NOT_FOUND 1
|
||||
|
||||
#endif // _KERNEL_SYSCALL_DEFS_H
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <libk/std.h>
|
||||
#include <proc/proc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <syscall/defs.h>
|
||||
#include <m/syscall_defs.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
#define DEFINE_SYSCALL(name) \
|
||||
|
||||
Reference in New Issue
Block a user