Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V Semihosting 2 of 3: Refactor magic sequence detection #1199

Conversation

JanMatCodasip
Copy link
Collaborator

Refactor (clean up) the code in riscv_semihosting.c by moving
the magic sequence detection to its own function.

@JanMatCodasip JanMatCodasip changed the title Semihosting 2 of 3: Refactor magic sequence detection RISC-V Semihosting 2 of 3: Refactor magic sequence detection Jan 7, 2025
@JanMatCodasip
Copy link
Collaborator Author

JanMatCodasip commented Jan 7, 2025

Note: This MR is built on top of #1198.

@JanMatCodasip JanMatCodasip force-pushed the jm-codasip/semihosting-2-refactor-magic-seq-detection branch 2 times, most recently from eeedccd to d0165b4 Compare January 14, 2025 16:10
@JanMatCodasip JanMatCodasip force-pushed the jm-codasip/semihosting-2-refactor-magic-seq-detection branch from d0165b4 to df49067 Compare January 20, 2025 06:32
Refactor (clean up) the code in riscv_semihosting.c by moving
the magic sequence detection to its own function.

Cleanup the debug prints denoting the semihosting outcome
so that they are easier to understand when reading the OpenOCD's
verbose (debug) log.

Use le_to_h_u32() to convert memory buffer to instruction code
because RISC-V instructions are always little endian.
(target_buffer_get_u32() was incorrect for that reason.)

Change-Id: I3a3ce991336ceeeff023d459d0e28558059554e0
Signed-off-by: Jan Matyas <[email protected]>
@JanMatCodasip JanMatCodasip force-pushed the jm-codasip/semihosting-2-refactor-magic-seq-detection branch from df49067 to 8c0a1cd Compare January 20, 2025 07:30
@en-sc en-sc requested a review from aap-sc January 20, 2025 11:09
@en-sc en-sc merged commit 88fe568 into riscv-collab:riscv Jan 22, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants