/*************************************************************************** * Copyright (c) 2026 Eclipse ThreadX contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * AI Disclosure: This file was largely AI-generated by Claude Code (Opus 5.5). * The AI-generated portions may be considered public domain (CC0-1.0) * and not subject to the project's licence. The human contributor has * reviewed and verified that the code is correct. * * SPDX-License-Identifier: MIT and CC0-1.0 **************************************************************************/ /* Reset entry for the Erbium example. Hart 0 sets up the global pointer, the system stack and .bss, then calls main(). Any other hart is parked. */ .section .text.entry, "ax", @progbits .align 2 .global _start .extern main .extern _sysstack_end .extern _bss_start .extern _bss_end _start: csrr t0, mhartid bnez t0, _park .option push .option norelax la gp, __global_pointer$ // norelax keeps this load absolute .option pop la sp, _sysstack_end la t0, _bss_start // .bss is 16-byte aligned in link.lds la t1, _bss_end _bss_clear: bgeu t0, t1, _bss_done sd zero, 0(t0) addi t0, t0, 8 j _bss_clear _bss_done: call main /* The example never executes WFI; a parked hart spins. */ _park: j _park