Files
LithosAnanke/v4/include/v4/rom_errors.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

47 lines
2.5 KiB
C

/* SPDX-License-Identifier: LicenseRef-Starship-1.0
* Copyright (c) 2023-2026 Robert A. James
*/
/* rom_errors.h -- the ROM's error codes and what they mean.
*
* The ROM (capsules/v4/rom) stops at (ROM-FAILED) with one of these codes in
* (FAILED); the loader, which owns the console, prints its words
* (v4/system/boot.c). This is the one list: the map's constants ERR-* the
* ROM is assembled with (v4/tools/mkmap.c, through v4/tests/host_map.h's
* ROM_ERR_*) and the boot's messages are both made from it. The codes run
* 1, 2, 3 ... in order; a new one goes at the end.
*
* X(NAME, CODE, WORDS)
*/
#ifndef V4_ROM_ERRORS_H
#define V4_ROM_ERRORS_H
#define V4_ROM_ERRORS(X) \
X(TOO_LONG, 1, "name too long") /* a token longer than 63 characters */ \
X(COMMENT, 2, "comment not closed") /* a ( with no ) before the end of its blob */ \
X(BAD_NAME, 3, "cannot be used as a name") /* an opcode, a reserved word, a label, a number or &... */ \
X(DEFINED, 4, "already defined") \
X(NAMES, 5, "too many names") /* the symbol table is full */ \
X(FIT, 6, "does not fit: memory is full, or a branch cannot reach") \
X(OPCODE, 7, "not an opcode the packer takes there") \
X(IN_MACRO, 8, "not allowed in a macro") \
X(MACRO, 9, "macro without endmacro, or endmacro without macro") \
X(LABEL_DUP, 10, "label already defined in this word") \
X(LABELS, 11, "too many labels in one word") \
X(FOR, 12, "FOR nested too deep, NEXT or UNEXT without FOR, or FOR without NEXT") \
X(UNEXT, 13, "FOR ... UNEXT must fit one instruction word and hold no literal") \
X(TARGET, 14, "not something to branch to") \
X(UNDEFINED, 15, "never defined") \
X(BIG, 16, "number does not fit a cell") \
X(AMP, 17, "& needs a word that is already defined") \
X(FETCH_P, 18, "write the number, not @p") \
X(MISSING, 19, "a name, a target, a value or a string is missing") \
X(DEEP, 20, "macros nested too deep") \
X(REFS, 21, "too many unresolved branches") \
X(VALUE, 22, "not a value") \
X(NO_START, 23, "the source ended with no start") \
X(START, 24, "start of something not a word") \
X(RANGE, 25, "address out of range") /* store outside RAM */ \
X(AFTER, 26, "text after start")
#endif