<feed xmlns='http://www.w3.org/2005/Atom'>
<title>threadx.git/ports/risc-v64/gnu/src/tx_thread_schedule.S, branch v6.5.2.202603_rel</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/threadx.git/atom/ports/risc-v64/gnu/src/tx_thread_schedule.S?h=v6.5.2.202603_rel</id>
<link rel='self' href='http://cgit.235523.xyz/threadx.git/atom/ports/risc-v64/gnu/src/tx_thread_schedule.S?h=v6.5.2.202603_rel'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/'/>
<updated>2026-09-09T20:25:28Z</updated>
<entry>
<title>Added lazy FPU stacking and QEMU functional tests for RV64 GNU port (#549)</title>
<updated>2026-09-09T20:25:28Z</updated>
<author>
<name>Wei-Chen Lai</name>
<email>douhualu6@gmail.com</email>
</author>
<published>2026-09-09T20:25:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=850a172bac0d26bedf8d92768e880d1613527f84'/>
<id>urn:sha1:850a172bac0d26bedf8d92768e880d1613527f84</id>
<content type='text'>
* add lazy FPU stacking to context save/restore

Save mstatus/sstatus to stack slot 29 and skip floating-point register
save/restore when FS is Off (bits 14:13). This avoids unnecessary FP
context work for threads that do not use the FPU.

- context_save: check FS in nested and first-level interrupt paths
- context_restore: gate FP restore on nested, no-preempt, and preempt paths
- use sstatus when TX_RISCV_SMODE is defined, otherwise mstatus

* add QEMU virt CMake build and automated test runner
Wire the QEMU virt demo into the CMake build system and add a
Python/GDB functional test runner, mirroring the risc-v32/gnu port.
- Add qemu_virt/CMakeLists.txt to build kernel.elf and register the
  check-functional-riscv64 target (requires Python3; skipped if absent)
- Link kernel.elf with --whole-archive so all ThreadX symbols resolve
- Pin _start at 0x80000000 via .text.boot in entry.s and
  KEEP(*(.text.boot)) in link.lds
- Extend demo_threadx.c with fpu_test_val and shorten thread_0 sleep
  for GDB-driven FPU, timer, and preemption checks
- Add test/azrtos_test_tx_gnu_riscv64_qemu.py; verified passing on
  QEMU virt (FPU, timer interrupt, preemption)

* Clean up RV64 PR scope and remove QEMU test integration leftovers

Revert accidental RV64 qemu_virt test/CMake integration changes and keep this branch
focused on lazy FPU context handling only. Also remove unintended TX_RISCV_SMODE-based
mstatus/sstatus save path and align comments/logic to mstatus-only behavior.

* Initialize mstatus.FS in RV64 stack build so new threads start with clean FP state

Slot 29 was left uninitialized while context restore reads it as an FP-live
hint; garbage FS bits could make a new thread inherit the previous thread's
floating-point registers.

* Add RV64 regression test for the FP state of a newly created thread

The test dirties every floating point register, then creates a thread and
checks that the stack builder wrote the mstatus slot and that the new
thread starts with all floating point registers zeroed. It is registered
for RV64 only, since the RV32 stack builder still leaves the slot unwritten.

* Completed the RISC-V64 lazy FPU so the restore side matches the save side

The lazy FPU save in this branch skips the floating-point stores when
mstatus.FS is Off, and records the mstatus it judged that on in frame slot
29. Merged onto current dev, only the save side had that treatment: both
restore paths and the scheduler's interrupt-frame path still reloaded the
FP registers unconditionally, from slots the save had deliberately left
alone. A thread that never touched the FP unit would have had whatever the
frame happened to contain loaded into its registers, and FS driven to
Dirty on the way out.

The guard is added at the three places that consume an interrupt frame:
both paths in _tx_thread_context_restore, and _tx_thread_schedule_loop.
Each reads slot 29 and skips the FP block when FS was Off, which is the
same shape the risc-v32 port already uses.

The solicited path is deliberately left alone. _tx_thread_system_return
saves the callee-saved FP registers unconditionally, so restoring them
unconditionally is consistent; making that pair lazy as well is a separate
change, and risc-v32 is the model for it.

Verified with QEMU on all five configurations:

  risc-v64   96 of 96 passing, five configurations, nothing unlinkable
  risc-v32   95 of 95 passing, five configurations, unchanged
  functional check-functional-riscv64 passes every check

The ninety-sixth test is the one this branch adds. It is load bearing:
seeding stack build with FS = Off instead of Initial makes it fail, and
restoring the seed makes it pass, so it guards the behaviour the rest of
this branch is about rather than passing regardless.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;

---------

Co-authored-by: r &lt;r@r&gt;
Co-authored-by: Frédéric Desbiens &lt;frederic.desbiens@eclipse-foundation.org&gt;</content>
</entry>
<entry>
<title>riscv64: spec compliance and regression test fix (#698)</title>
<updated>2026-09-09T13:26:11Z</updated>
<author>
<name>Akif Ejaz</name>
<email>akifejaz40@gmail.com</email>
</author>
<published>2026-09-09T13:26:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=164f211a01f6bc756c6620ec8ca55f4ccf9f6041'/>
<id>urn:sha1:164f211a01f6bc756c6620ec8ca55f4ccf9f6041</id>
<content type='text'>
* spec compliance

Signed-off-by: Akif Ejaz &lt;akifejaz40@gmail.com&gt;

* revert the demo changes

Signed-off-by: Akif Ejaz &lt;akifejaz40@gmail.com&gt;

* Restored the FPU demo hook so the RISC-V64 functional test can pass

The new check-functional-riscv64 target verifies FPU context switching by
watching fpu_test_val advance by 1.1f on each pass through
thread_6_and_7_entry. The GDB script deliberately treats a missing symbol
as a failure rather than silently skipping the check, but the demo no
longer defined it, so the target failed on every run:

    FPU_VERIFIED_FAIL_NO_SYMBOL

The definition and the increment are restored, matching what the risc-v32
demo already carries. The functional target now passes end to end.

Three small corrections are folded in:

- tx_port.h carried a comment stating that the ISA string must include
  Zicsr, but nothing enforced it, so an rv64imac build failed with a wall
  of assembler "unrecognized opcode" errors. It now stops at one clear
  diagnostic.
- Removed TX_RISCV_TRAP_CALL_FRAME_SIZE, which nothing referenced.
- The example .gitignore listed qemu-riscv32.log, but the runner writes
  qemu-riscv64.log, so the generated log showed up as an untracked file.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;

---------

Signed-off-by: Akif Ejaz &lt;akifejaz40@gmail.com&gt;
Co-authored-by: Frédéric Desbiens &lt;frederic.desbiens@eclipse-foundation.org&gt;</content>
</entry>
<entry>
<title>Reverted ULONG to be 4 bytes long, fixing missaligment issue in the current port (#534)</title>
<updated>2026-05-25T20:12:33Z</updated>
<author>
<name>Christos Papadopoulos</name>
<email>papadopoulos.chris@icloud.com</email>
</author>
<published>2026-05-25T20:12:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=5b1b740a6610ae3434da9fc2cd55f390f7619429'/>
<id>urn:sha1:5b1b740a6610ae3434da9fc2cd55f390f7619429</id>
<content type='text'>
* Reverted RISCV-64 port

* Fixed wrong load/store instructions used</content>
</entry>
<entry>
<title>Added RISC-V board Bananapi BPI-F3 (SpacemiT K1 SoC) BSP Support  (#531)</title>
<updated>2026-05-25T19:59:17Z</updated>
<author>
<name>Akif Ejaz</name>
<email>akifejaz40@gmail.com</email>
</author>
<published>2026-05-25T19:59:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=c7d4b2f22869f1f06a99599d4ccfe201b0496f82'/>
<id>urn:sha1:c7d4b2f22869f1f06a99599d4ccfe201b0496f82</id>
<content type='text'>
* Add BananaPi BPI-F3 BSP support

Add RISC-V supervisor support to the rv64/gnu port and
provide a complete board support package for the BananaPi BPI-F3
(SpacemiT K1 SoC, X60 cores).

Port changes (risc-v64/gnu):
- Guard all CSR accesses with TX_RISCV_SMODE to select S-mode registers
  (sstatus/sepc/sie/sret) vs M-mode (mstatus/mepc/mie/mret) in
  context_save, context_restore, schedule, system_return,
  interrupt_control, and stack_build.
- Add S-mode TX_INT_ENABLE/TX_DISABLE and inline TX_RESTORE macros
  to tx_port.h.
- Add TX_RISCV_SMODE CMake option to CMakeLists.txt.

BananaPi BPI-F3 BSP (example_build/bananapi-f3):
- Boot flow: FSBL → OpenSBI (M-mode) → U-Boot (S-mode) → ThreadX
- S-mode trap handler with context save/restore integration
- SBI legacy ecall timer at 10 Hz (24 MHz timebase)
- PLIC driver with S-mode context, stale-IRQ drain, and callbacks
- PXA-compatible UART0 console (115200 8N1)
- Linker script at 0x200000 load address

Tested on risc-v board, BananaPi BPI-F3 hardware.

Signed-off-by: Akif Ejaz &lt;akif.ejaz@10xengineers.ai&gt;

* Fixed S-mode context restore and PLIC spurious IRQ handling

- tx_thread_context_restore.S (non-nested path): set SPIE(0x20) alongside
  SPP(0x100) so sret re-enables interrupts in the restored thread.
- tx_thread_context_restore.S (both S-mode paths): use FS=Dirty (0x6000)
  instead of FS=Initial (0x2000) to match tx_thread_schedule.S and prevent
  FP register corruption across context switches.
- plic.c (plic_irq_intr): return early when plic_claim() yields 0 (no
  pending interrupt) to avoid completing a spurious IRQ ID 0, which is
  undefined behavior per the PLIC spec.

Co-authored-by: Copilot &lt;223556219+Copilot@users.noreply.github.com&gt;

---------

Signed-off-by: Akif Ejaz &lt;akif.ejaz@10xengineers.ai&gt;
Co-authored-by: Frédéric Desbiens &lt;frederic.desbiens@eclipse-foundation.org&gt;
Co-authored-by: Copilot &lt;223556219+Copilot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Merge pull request #508 from goodnorning/feature/rv64_rvv_support</title>
<updated>2026-04-14T13:26:33Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-04-14T13:26:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=a0dc185f669afaf633d363996df21ed354dbcfb1'/>
<id>urn:sha1:a0dc185f669afaf633d363996df21ed354dbcfb1</id>
<content type='text'>
Added rv64 rvv support</content>
</entry>
<entry>
<title>RISC-V64 arch. port support RVV Extension;</title>
<updated>2026-04-07T03:41:33Z</updated>
<author>
<name>shuta.lst</name>
<email>shuta.lst@alibaba-inc.com</email>
</author>
<published>2026-03-04T02:51:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=2f1fc5291827ee1b4279237646a2bc808a299896'/>
<id>urn:sha1:2f1fc5291827ee1b4279237646a2bc808a299896</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Updated copyright headers and version number constants (#509)</title>
<updated>2026-03-05T09:46:30Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-03-05T09:46:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=c3259a216026372e3833dd8996a68f77e8595fbd'/>
<id>urn:sha1:c3259a216026372e3833dd8996a68f77e8595fbd</id>
<content type='text'>
* Updated version number constants

* Removed revision history from all files

* Added Eclipse ThreadX contributors' copyright header </content>
</entry>
<entry>
<title>Cleanup the macros in tx_port.h &amp; comments in inc/*.S</title>
<updated>2026-02-05T11:16:59Z</updated>
<author>
<name>Akif Ejaz</name>
<email>akifejaz40@gmail.com</email>
</author>
<published>2026-02-05T11:16:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=21256bed516345f0918f49b314758c60b5691562'/>
<id>urn:sha1:21256bed516345f0918f49b314758c60b5691562</id>
<content type='text'>
- removed the trailing whitespaces

Signed-off-by: Akif Ejaz &lt;akif.ejaz@10xengineers.ai&gt;
</content>
</entry>
<entry>
<title>few cleanups</title>
<updated>2026-01-26T11:08:51Z</updated>
<author>
<name>Akif Ejaz</name>
<email>akifejaz40@gmail.com</email>
</author>
<published>2026-01-26T11:08:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=99ed67df5afeeac52827c2681438a4627c4198d7'/>
<id>urn:sha1:99ed67df5afeeac52827c2681438a4627c4198d7</id>
<content type='text'>
Signed-off-by: Akif Ejaz &lt;akif.ejaz@10xengineers.ai&gt;
</content>
</entry>
<entry>
<title>improve port robustness, portability, and CSR handling</title>
<updated>2026-01-26T10:48:46Z</updated>
<author>
<name>Akif Ejaz</name>
<email>akifejaz40@gmail.com</email>
</author>
<published>2026-01-26T10:48:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=6c25effb405cc694578dec664a798fc8af3107e1'/>
<id>urn:sha1:6c25effb405cc694578dec664a798fc8af3107e1</id>
<content type='text'>
- removed tx_port.h dependency from .S files
- replaced tx_timer_interrupt.c with tx_timer_interrupt.S
-  made some cleanups, formatting to better readability
- removed macros (LOAD/STORE/REGBYTES)
  changed register nomenclature to use RISC-V ABI
  names (ra, sp, t0, etc.)
- added readme_threadx.txt

Signed-off-by: Akif Ejaz &lt;akif.ejaz@10xengineers.ai&gt;
</content>
</entry>
</feed>
