From 74e1c9ad2bcf52918b3d266222185813455b64c0 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Tue, 21 Apr 2026 23:09:26 +0800 Subject: feat: add global compile-time configuration header for LumeOS --- na/include/lume/config.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 na/include/lume/config.h (limited to 'na/include') diff --git a/na/include/lume/config.h b/na/include/lume/config.h new file mode 100644 index 0000000..acd76ef --- /dev/null +++ b/na/include/lume/config.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* Copyright (C) 2026 Richard Qin */ + +#pragma once + +/* + * LumeOS Global Compile-Time Configuration + * + * All kernel-wide tuning constants live here. + * Architecture-specific constants live in . + * + * This header is safe to include from both C++ and assembly files. + * Assembly-visible constants use #define; C++ code gets typed constexpr. + * + * Reference: docs/specs/00_conventions.md ยง1.3 + */ + +/* These macros are shared with assembly (entry.S) */ +#define LUME_MAX_CPUS 8 +#define LUME_PAGE_SIZE 4096 + +#ifndef __ASSEMBLER__ + +#include + +/* Maximum number of CPUs supported by the kernel. + * Compile-time limit for static arrays (boot stacks, per-cpu data). + * Actual CPU count is detected at runtime via FDT. */ +inline constexpr int kMaxCpus = LUME_MAX_CPUS; + +/* Virtual memory page size (4KB, matching SV39 base page). */ +inline constexpr uint64 kPageSize = LUME_PAGE_SIZE; + +#endif /* __ASSEMBLER__ */ \ No newline at end of file -- cgit v1.2.3