Skip to content

Improve RV64/GNU port robustness, portability, and CSR handling#496

Open
akifejaz wants to merge 2 commits intoeclipse-threadx:devfrom
akifejaz:rv64-gnu-port
Open

Improve RV64/GNU port robustness, portability, and CSR handling#496
akifejaz wants to merge 2 commits intoeclipse-threadx:devfrom
akifejaz:rv64-gnu-port

Conversation

@akifejaz
Copy link

@akifejaz akifejaz commented Jan 13, 2026

improve port robustness, portability, and CSR handling

  • 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

@akifejaz akifejaz changed the base branch from master to dev January 13, 2026 08:22
@akifejaz
Copy link
Author

started writing the readme risc-v64/gnu/readme_threadx.txt for rv64/gnu, please feel free to comment what to add/remove.

- 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 <akif.ejaz@10xengineers.ai>
Signed-off-by: Akif Ejaz <akif.ejaz@10xengineers.ai>
@akifejaz
Copy link
Author

Hi @billlamiework, as per your suggestions here #490 (comment), I've updated the RV64/GNU port, It should include following changes. Please review the changes when you get time.

  • 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

Once we have risc-v64/gnu port fixed/formatted correctly, I'll do the same for risc-v32/gnu.
cc: @fdesbiens

@billlamiework
Copy link

Definitely looking good... my only comments are:

  1. It's good(better) to us inline assembly or compiler intrinsics for TX_DISABLE/TX_RESTORE macros in tx_port.h for single core ports.
  2. The assembly code seems to be using "/*" comments and "//" comments for comments on the right of assembly instructions. It would be good to use "//" if possible. Also, it would be good if all these started in the same column.
    Otherwise, looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants