sk_v4_run's three stops -- "not started", "did not let go of POST's
blocks", "stopped on a fault" -- ended in for (;;) { }: a core spinning at
100%, the thing #151 removed from the prompt. Each now calls sk_v4_stop()
(kernel/src/v4/sk_v4_stop.c): interrupts off, then arch_halt() for ever. Each
still says why first. sk_v4_stop.c added to the loader's and the kernel's v4
sources.
kernel/tests/test_sk_v4_stop.c, with arch_halt and arch_disable_interrupts
faked (the halt jumps back out after three calls; an alarm fails a spin):
against the stop as it was -- "spun for 2 s without halting"; now -- 2
checks, 0 failures: halts in a loop, interrupts off before the first halt.
Built for amd64, aarch64 and riscv64. #177's "seen on the three
architectures": no boot reaches these stops, so it is shown on the host only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
15 lines
480 B
C
15 lines
480 B
C
/* SPDX-License-Identifier: LicenseRef-Starship-1.0
|
|
* Copyright (c) 2023-2026 Robert A. James
|
|
*/
|
|
/* sk_v4_stop.c -- see sk_v4_stop.h. */
|
|
#include "starkernel/v4/sk_v4_stop.h"
|
|
#include "starkernel/arch.h"
|
|
|
|
/* Interrupts off, then halt for ever: the core sleeps instead of spinning at 100% (#177), and no
|
|
* timer or device wakes it to do anything. sk_v4_run's three stops each said why first. */
|
|
void sk_v4_stop(void)
|
|
{
|
|
arch_disable_interrupts();
|
|
for (;;) arch_halt();
|
|
}
|