Replace BAR flags with unified layout parameter#41
Closed
otischung wants to merge 2 commits intosysprog21:masterfrom
Closed
Replace BAR flags with unified layout parameter#41otischung wants to merge 2 commits intosysprog21:masterfrom
layout parameter#41otischung wants to merge 2 commits intosysprog21:masterfrom
Conversation
This change updates pci_set_bar() to accept a single `layout` bitmask instead of separate boolean flags, simplifying BAR configuration. The new `layout` argument encodes I/O vs. memory space, 32-/64-bit decoding, and prefetchable settings via standard PCI_BASE_ADDRESS_* macros. Existing callers can now pass any combination of: - PCI_BASE_ADDRESS_SPACE_IO or PCI_BASE_ADDRESS_SPACE_MEMORY - PCI_BASE_ADDRESS_MEM_TYPE_32 or PCI_BASE_ADDRESS_MEM_TYPE_64 - PCI_BASE_ADDRESS_MEM_PREFETCH The function writes the full layout to the BAR, derives `bar_is_io_space` from bit[0], and initializes the region with the provided callback. Docstrings updated with Doxygen examples illustrating MMIO and port I/O. BREAKING CHANGE: pci_set_bar() signature changed; call sites must be updated to pass the new `layout` parameter rather than separate flags.
jserv
reviewed
Jul 4, 2025
jserv
reviewed
Jul 4, 2025
- Remove verbose Doxygen-style documentation for pci_set_bar() to match the existing concise comment style used throughout the codebase - Update PCI_BASE_ADDRESS_MEM_PREFETCH comment to clarify it's an optional flag that users can uncomment if prefetchable memory is needed, rather than implying it's technically not supported The original verbose comment was inconsistent with the project's comment style, which favors brief, direct explanations. The prefetch flag comment now better explains that it's a user choice rather than a limitation.
Contributor
Author
|
I've completed the requested changes to simplify the PCI-related comments and make them more consistent with the existing codebase style. Please review and approve when ready. |
Contributor
|
Close in favor of #48 |
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 change updates pci_set_bar() to accept a single
layoutbitmask instead of separate boolean flags, simplifying BAR configuration. The newlayoutargument encodes I/O vs. memory space, 32-/64-bit decoding, and prefetchable settings via standard PCI_BASE_ADDRESS_* macros. Existing callers can now pass any combination of:bar_is_io_spacefrom bit[0], and initializes the region with the provided callback. Docstrings updated with Doxygen examples illustrating MMIO and port I/O.BREAKING CHANGE: pci_set_bar() signature changed; call sites must be updated to pass the new
layoutparameter rather than separate flags.