Conversation
Remove the previous magic values, and add bit macros with explicit names. This makes reading the code easier, and is more is sync with what's done for device registers.
We do not check whether the running CPU supports the CPUID instruction, but this should not be the case unless we are running on ancient hardware.
This structure contains information about the system's CPU. It is intended to be used to fetch the CPU's capabilities instead of using and parsing the CPUID instruction each time. We will surely be adding more fields in the future (e.g. processor model).
Split the mmu_init() function into distinct parts using sub-functions to make it more readable. This will also help when having to initialize the PAT table in the next commits.
Reference: Intel SDM 2023 volume 3 chapter 12 (Memory cache control)
The caching policy used for a vm_segment is now explicitely configured inside the segment's flag. The chosen policy is forwarded to the MMU API when mapping an address inside the segment. This commit also adds the vm_set_policy() function that can be called to dynamically re-configure these policies for an already existing segment. When no policies are specified the API defaults back to using write-back caching (regular caching).
Accesses to memory-mapped I/O often have side-effects and should not be combined or delayed. Add a new VM_IOMEM flag that should be used with memory-mapped registers.
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.
Resolves #59