Skip to content
New issue

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

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

Already on GitHub? # to your account

Consolidate public header by integrating src/state.h #301

Closed
ChinYikMing opened this issue Dec 21, 2023 · 1 comment · Fixed by #305
Closed

Consolidate public header by integrating src/state.h #301

ChinYikMing opened this issue Dec 21, 2023 · 1 comment · Fixed by #305

Comments

@ChinYikMing
Copy link
Collaborator

ChinYikMing commented Dec 21, 2023

To fully(as much as possible) leverage rv32emu's core, I've attempted to export the state_new function from "state.h" for usage in WebAssembly, but it doesn't appear to be functioning. It works after splitting to "state.[ch]". I think the reason is that state_new is not found in any translation units since they have been inlined by the compiler.

May I know any concerns with this change? I might send a PR for this modification if it doesn't.

Refer to #75

@jserv
Copy link
Contributor

jserv commented Dec 22, 2023

The src/state.h header originally served as a testament to my efforts in refining the APIs for the RISC-V instruction set simulator in the src/riscv.h header. It would be more efficient to merge src/state.h into src/riscv.[ch], aligning it with the improved and consistent public functions. For reference, you can review the riscv.h file in SEMU.

@jserv jserv changed the title Separate "state.h" to "state.[ch]" to support Emscripten exporting Consolidate public header by integrating src/state.h Dec 22, 2023
ChinYikMing added a commit to ChinYikMing/rv32emu that referenced this issue Dec 22, 2023
- Merge "src/state.h" into "riscv.[ch]" to consolidate public header.
- Handle malloc failed in the "state_new" and "memory_new" functions.

Close sysprog21#301
ChinYikMing added a commit to ChinYikMing/rv32emu that referenced this issue Dec 22, 2023
- Merge "src/state.h" into "riscv.[ch]" to consolidate public header.
- Handle malloc failed in the "state_new" and "memory_new" functions.

Close sysprog21#301
vestata pushed a commit to vestata/rv32emu that referenced this issue Jan 24, 2025
- Merge "src/state.h" into "riscv.[ch]" to consolidate public header.
- Handle malloc failed in the "state_new" and "memory_new" functions.

Close sysprog21#301
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants