Skip to content

Add support for C macro for_each_online_cpu #727

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

Open
Richardhongyu opened this issue Mar 26, 2022 · 1 comment
Open

Add support for C macro for_each_online_cpu #727

Richardhongyu opened this issue Mar 26, 2022 · 1 comment
Labels
• lib Related to the `rust/` library.

Comments

@Richardhongyu
Copy link

Currently, rust-for-linux does not have support for the for_each_online_cpu C macro. It is necessary for some drivers which need to know about the online cpus during the working phase.

It's hard to implement a function that has the same ability as this macro. Because this macro wraps some statements inside rather than acts as a part of some statements. I ask for advice in the Zulip. Wedson suggests we should implement an iterator that returns all the cpu indices.

I give a try to implement an iterator for for_each_online_cpu. It works fine in my local test. I want to ask for some advice and see whether it can be merged.

@Richardhongyu
Copy link
Author

The corresponding implementation is in #728. There are still other for_each_* macros that I don't implement for now. But the basic idea is similar. I want to ask if this PR is appropriate before getting all the code done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• lib Related to the `rust/` library.
Development

No branches or pull requests

2 participants