-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Kernel: Add and use TypedMapping<T*[]*> #25411
base: master
Are you sure you want to change the base?
Conversation
f62f25c
to
a92e393
Compare
[]
>
ahh oops an unrelated change sneaked in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using TypedMapping
s for this seems nice. I guess it shifts their purpose beyond just MMIO mappings, but that seems ok.
Just some commit message typos:
"Remove Unused" -> "Remove unused"
"Add support for Arrays" -> "Add support for arrays"
"TypedMapping<T volatie[]>" -> "TypedMapping<T volatile[]>"
This is quite useful, as it is a common pattern that a Kernel allocated DMA buffer is just a simple array of some type.
a92e393
to
116fbc5
Compare
Huh I had changed that locally, just forgot to push.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing I missed during my first review
(Also, CI is failing due to my MM PR replacing Region::Cacheable
with MemoryType
)
} | ||
|
||
template<typename T> | ||
static ErrorOr<TypedMapping<T[]>> map_typed_array(PhysicalAddress paddr, size_t items) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this overload be unnecessary? The access
parameter of the other map_typed_array
implementation has a default value
This mainly adds users of this in the Network code, as those were the easiest to find
Other places in the kernel may profit off of this in the future, like the ring buffers across other drivers