Fix the Windows and CI builds

This commit is contained in:
Baptiste MOINE committed 2026-11-05 23:57:10 +01:00
1 parent e2feebf9f7
commit ee96a1b8ca
4 files changed
+37 -16

No files matched your search

+2 -2
View File
@@ -204,7 +204,7 @@ real consoles. Details in [DESIGN.md](DESIGN.md#ccplex-cpu0).
way a bootloader would hand over to it:
```bash
linux/build.sh # linux/boot.bin (devkitARM + devkitA64)
linux/build.sh # linux/boot.bin (arm-none-eabi + aarch64 gcc)
linux/mkdtb.sh tegra210-odin.dtb odin-emu.dtb # console on UART-B, one CPU
linux/run.sh Image odin-emu.dtb boot.log 120
```
@@ -228,7 +228,7 @@ initialisation.
## Tests
```bash
make test # CCPLEX, kernel CPU, SE, USB + display regression payloads (arm-none-eabi-gcc, devkitA64, python3)
make test # CCPLEX, kernel CPU, SE, USB + display regression payloads (arm-none-eabi-gcc, aarch64 gcc, python3)
tests/hwtest/build.sh build-hwtest # build hwtest-rcm (+ gcc-aarch64-linux-gnu)
tests/hwtest/run.sh ./rcm_emu build-hwtest/hwtest-rcm/build/hwtest.bin
```
+11 -8
View File
@@ -6,7 +6,6 @@
#include <cstdint>
#include <cstring>
#include <deque>
#include <mutex>
#include <vector>
#include <string>
@@ -260,20 +259,24 @@ struct EmuState {
// Framebuffer snapshots asked for by the input script (SNAP), written by
// the display thread from the next frame it shows. CPU thread produces,
// display thread consumes.
std::mutex snap_mtx;
// display thread consumes. A spin lock, not std::mutex: the Windows
// build's MinGW uses the win32 thread model, which has none.
std::atomic<bool> snap_busy{false};
std::vector<std::string> snap_paths;
void snap_request(const std::string &path) {
std::lock_guard<std::mutex> lk(snap_mtx);
while (snap_busy.exchange(true, std::memory_order_acquire)) {}
snap_paths.push_back(path);
snap_busy.store(false, std::memory_order_release);
}
bool snap_take(std::string *path) {
std::lock_guard<std::mutex> lk(snap_mtx);
if (snap_paths.empty())
return false;
while (snap_busy.exchange(true, std::memory_order_acquire)) {}
bool got = !snap_paths.empty();
if (got) {
*path = snap_paths.front();
snap_paths.erase(snap_paths.begin());
return true;
}
snap_busy.store(false, std::memory_order_release);
return got;
}
// last_rot mirrors the rotation last applied by sdl_display_update.
// Read from the SDL event handler to invert the display→window transform.
+12 -3
View File
@@ -1,9 +1,18 @@
#!/bin/sh
# Builds linux/boot.bin: shim.S (devkitA64) embedded in the BPMP payload.
# Builds linux/boot.bin: shim.S (an AArch64 assembler) embedded in the BPMP payload.
set -e
D=$(dirname "$0")
A64=${A64:-/opt/devkitpro/devkitA64/bin/aarch64-none-elf-}
ARM=${ARM:-/opt/devkitpro/devkitARM/bin/arm-none-eabi-}
# devkitPro when it is installed, else the distribution's cross compilers
# (gcc-aarch64-linux-gnu, gcc-arm-none-eabi), as on CI.
DKP=${DEVKITPRO:-/opt/devkitpro}
if [ -z "$A64" ]; then
A64=aarch64-linux-gnu-
if [ -x "$DKP/devkitA64/bin/aarch64-none-elf-gcc" ]; then A64=$DKP/devkitA64/bin/aarch64-none-elf-; fi
fi
if [ -z "$ARM" ]; then
ARM=arm-none-eabi-
if [ -x "$DKP/devkitARM/bin/arm-none-eabi-gcc" ]; then ARM=$DKP/devkitARM/bin/arm-none-eabi-; fi
fi
${A64}gcc -c -o "$D/shim.o" "$D/shim.S"
${A64}ld -Ttext=0xA0000000 -o "$D/shim.elf" "$D/shim.o"
${A64}objcopy -O binary "$D/shim.elf" "$D/shim.bin"
+12 -3
View File
@@ -1,10 +1,19 @@
#!/bin/sh
# Builds tests/kernelcpu/payload.bin: cpu0.S with devkitA64's assembler,
# Builds tests/kernelcpu/payload.bin: cpu0.S with an AArch64 assembler,
# embedded as a word array into the BPMP payload built with arm-none-eabi.
set -e
D=$(dirname "$0")
A64=${A64:-/opt/devkitpro/devkitA64/bin/aarch64-none-elf-}
ARM=${ARM:-/opt/devkitpro/devkitARM/bin/arm-none-eabi-}
# devkitPro when it is installed, else the distribution's cross compilers
# (gcc-aarch64-linux-gnu, gcc-arm-none-eabi), as on CI.
DKP=${DEVKITPRO:-/opt/devkitpro}
if [ -z "$A64" ]; then
A64=aarch64-linux-gnu-
if [ -x "$DKP/devkitA64/bin/aarch64-none-elf-gcc" ]; then A64=$DKP/devkitA64/bin/aarch64-none-elf-; fi
fi
if [ -z "$ARM" ]; then
ARM=arm-none-eabi-
if [ -x "$DKP/devkitARM/bin/arm-none-eabi-gcc" ]; then ARM=$DKP/devkitARM/bin/arm-none-eabi-; fi
fi
${A64}gcc -c -o "$D/cpu0.o" "$D/cpu0.S"
${A64}ld -Ttext=0xA0000000 -o "$D/cpu0.elf" "$D/cpu0.o"
${A64}objcopy -O binary "$D/cpu0.elf" "$D/cpu0.bin"