casaroli opened a new pull request, #21532:
URL: https://github.com/apache/nuttx/pull/21532

   ## Summary
   
   With `CONFIG_BOARDCTL_POWEROFF`, `qemu-intel64` does not link: `boardctl()` 
calls `board_power_off()`, and the board does not have it.
   
   ```
   boards/boardctl.c:425:(.text.boardctl+0x41): undefined reference to 
`board_power_off'
   ```
   
   x86_64 already has `up_systempoweroff()` 
(`arch/x86_64/src/intel64/intel64_systempoweroff.c`, built with 
`CONFIG_BOARDCTL_POWEROFF`). It enters the ACPI sleep state S5, and QEMU stops. 
This PR adds `qemu_power.c` with `board_power_off()`, which calls it, as 
`qemu-armv8a` does. The Makefile and the `CMakeLists.txt` build the file with 
`CONFIG_BOARDCTL_POWEROFF`.
   
   ## Impact
   
   Only `qemu-intel64` with `CONFIG_BOARDCTL_POWEROFF`, which did not link 
before. No defconfig of the board sets this option, so no CI build changes. No 
flat-build API change. No Documentation change: the board page does not 
describe power-off.
   
   ## Testing
   
   Make builds with `BOARDCTL_POWEROFF` on, then QEMU (TCG, `-machine 
pc,hpet=on -no-reboot`) boots to NSH, a script types `poweroff`, and checks 
that QEMU ends by itself.
   
   | Config | master 43f7f34b995 | this branch |
   |---|---|---|
   | `qemu-intel64:nsh` (flat) | link fails: `undefined reference to 
board_power_off` | builds; QEMU ends at once after `poweroff`, rc 0 |
   | `qemu-intel64:knsh_romfs` (kernel) | link fails: `undefined reference to 
board_power_off` | builds; QEMU ends at once after `poweroff`, rc 0 |
   
   For TCG, the runs also set `ARCH_INTEL64_HPET_ALARM` and `INTEL64_HPET` 
instead of the TSC deadline timer, and turn off `ARCH_INTEL64_HAVE_PCID`. 
Compiler: x86_64-elf GCC 16.2. Not run: KVM. Not built: CMake. The CMake build 
of `qemu-intel64:nsh` on macOS fails on master and on this branch in 
`intel64_saveusercontext.S`, before it reaches the board files (host compiler 
and x86_64-elf GCC); CI builds x86_64 with make only. The `CMakeLists.txt` 
change is the same as the Makefile change. This board has no protected build. A 
test in apps does not fit: the test is that QEMU stops.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to