Skip to content
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

chardev_map undocumented / doesn't support non page size size #47

Open
bennoleslie opened this issue Sep 26, 2020 · 0 comments
Open

chardev_map undocumented / doesn't support non page size size #47

bennoleslie opened this issue Sep 26, 2020 · 0 comments

Comments

@bennoleslie
Copy link

The chardev_map is used by many serial drivers in the platform code for mapping the serial registers into virtual memory.

Given the extensive use of the function it should really be documented.

It takes as a parameter a struct dev_defn, which has a size field.

It is somewhat implied (or at least it was to me from usage!) that size could be an arbitrary power-of-2 size.

However, that turns out to not be the case! It must be page-sized. Passing a non-page sized value results in a very difficult to debug error occurring (and when you are trying to map the UART registers you don't have any debug output!).

Could this function be please be documented to make it clear that only page-size sizes may be passed and/or could the chardev_map function perform that check early. That would make manually tracing the error much easier, rather than it failing about 12 functions deep otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant