Files
LithosAnanke/kernel/include/starkernel/cmdline.h
T
Claude 3bd81097e1 chore(license): an SPDX header on every source file that had none (LicenseRef-Starship-1.0) [skip ci]
The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).

253 files now begin
    SPDX-License-Identifier: LicenseRef-Starship-1.0
    Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.

Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).

Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
2026-11-10 04:12:49 +00:00

43 lines
1.4 KiB
C

/* SPDX-License-Identifier: LicenseRef-Starship-1.0
* Copyright (c) 2023-2026 Robert A. James
*/
/*
* cmdline.h — kernel command-line parser API
*
* Pure C99 / freestanding — no UEFI types, no libc.
* The UEFI loader converts LoadOptions (UCS-2) to ASCII before calling
* cmdline_parse_ascii(); the parser itself never sees CHAR16.
*/
#ifndef STARKERNEL_CMDLINE_H
#define STARKERNEL_CMDLINE_H
#include "kernel_args.h"
/*
* cmdline_parse_ascii — parse a NUL-terminated ASCII cmdline into *args.
*
* Fills all default values first; unknown flags are silently ignored so
* future kernels can add flags without breaking old boot entries.
* Safe to call with NULL or empty cmdline (returns all defaults).
*
* Recognised flags:
* --doe set run_doe = 1
* --log-level=<level> debug / info / warn / error
* --stack=<N>[KMG] stack_size in bytes
* --heap=<N>[KMG] heap_size in bytes
* system=v3 | system=v4 which system runs, where both are built in
* ("--system=" too)
*/
void cmdline_parse_ascii(const char *cmdline, KernelArgs *args);
/*
* cmdline_parse_size — parse a size token with optional K/M/G suffix.
*
* Examples: "2M" -> 2*1024*1024, "4G" -> 4*1024^3, "65536" -> 65536.
* Returns 0 on parse error (empty string, non-digit start, etc.).
*/
uint64_t cmdline_parse_size(const char *s);
#endif /* STARKERNEL_CMDLINE_H */