Various changes and additions#2
Merged
Merged
Conversation
d53c148 to
e8f62b1
Compare
Contributor
Author
|
For the sake of smaller PRs: #3 is the next batch |
e8f62b1 to
fe56c15
Compare
Contributor
Author
|
Updated to use rust-embedded/riscv-rt#95 instead of hard-coding the QEMU device tree address. |
Contributor
Author
|
Friendly ping :) #3 is the next part of this |
Owner
lion328
reviewed
Jul 16, 2022
| /// The pointer must point to a valid fw_cfg device. | ||
| /// | ||
| /// Only one `FwCfg` value may exist at the same time for that pointer. | ||
| pub unsafe fn new_memory_mapped(base_ptr: *mut ()) -> Result<FwCfg, FwCfgError> { |
Owner
There was a problem hiding this comment.
Is this also works on x86/x86_64?
Contributor
Author
There was a problem hiding this comment.
qemu-system-i386 and qemu-system-x86_64 don’t expose a memory-mapped fw-cfg device, so there is no valid address that could be passed to this constructor. But if you somehow had an x86/x86_64 with such a device, this should work.
The I/O port mode is only available on x86 or x86-64: rename the constructor and add conditionally-compile it accordingly.
fe56c15 to
ceae702
Compare
Contributor
Author
|
Sorry I forgot about this! 😅 Again if you prefer single-purpose PRs, #4 is the next batch of commits from this one. |
Owner
|
Thanks. I will go ahead and merge this larger one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains various changes and additions. I would have preferred to find a meaningful split of them into multiple PRs that I could send independently, but I expect this would have caused merge conflicts so here is everything a single linear branch on top of #1. Please see individual commit messages.
At a high-level, I’m trying to use QEMU’s
ramfbdevice from RISC-V guest code, which for involves memory-mapped fw_cfg instead of port I/O, writing to a fw_cfg file instead of just reading, and DMA access (required for writing) instead of just the data register. RISC-V support is added to the test harness and CI in order to have coverage for the memory-mapped mode. Also as drive-by changes: supporting stable Rust, adding a file iterator.