diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-04-21 23:09:26 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-04-21 23:09:26 +0800 |
| commit | 74e1c9ad2bcf52918b3d266222185813455b64c0 (patch) | |
| tree | a014cfd7894eb4ac1dd95a2ce426ec88ea5b9375 /na/include | |
| parent | 2270bd9ea4a0c93688223db9e42ec531321cabbf (diff) | |
| download | lume-74e1c9ad2bcf52918b3d266222185813455b64c0.tar.gz lume-74e1c9ad2bcf52918b3d266222185813455b64c0.tar.xz | |
feat: add global compile-time configuration header for LumeOS
Diffstat (limited to 'na/include')
| -rw-r--r-- | na/include/lume/config.h | 34 |
1 files changed, 34 insertions, 0 deletions
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 <arch/config.h>. + * + * 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 <lume/types.h> + +/* 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 |
