-
Notifications
You must be signed in to change notification settings - Fork 113
Misc cleanup: pub(crate) mock fields, log_println allow, current_processor_number, stdin guard #755
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,11 +23,13 @@ pub use page_mgmt::PageManagementProvider; | |
| #[macro_export] | ||
| macro_rules! log_println { | ||
| ($platform:expr, $s:expr) => {{ | ||
| #[allow(unused_imports)] | ||
| use $crate::platform::DebugLogProvider as _; | ||
| $platform.debug_log_print($s); | ||
| }}; | ||
| ($platform:expr, $($tt:tt)*) => {{ | ||
| use core::fmt::Write as _; | ||
| #[allow(unused_imports)] | ||
|
Comment on lines
+26
to
+32
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand why these This part of the change is fine to keep btw, no issue specifically due to the exact scenario it is in (i.e., a macro in a logging utility), but more broadly, introducing |
||
| use $crate::platform::DebugLogProvider as _; | ||
| let mut t: arrayvec::ArrayString<8192> = arrayvec::ArrayString::new(); | ||
| writeln!(t, $($tt)*).unwrap(); | ||
|
|
@@ -666,6 +668,16 @@ pub trait SystemInfoProvider { | |
| /// Return `Some(address)` if the VDSO is available on the platform, or `None` | ||
| /// if the platform does not support or provide a VDSO. | ||
| fn get_vdso_address(&self) -> Option<usize>; | ||
|
|
||
| /// Returns the current processor number, used to emulate `getcpu`-family | ||
| /// syscalls and related VDSO interfaces. | ||
| /// | ||
| /// Platforms that do not expose a stable processor identifier, or that | ||
| /// virtualize CPU topology, may return `0`. Callers arrive in subsequent | ||
| /// stacked PRs. | ||
| fn current_processor_number(&self) -> u32 { | ||
| 0 | ||
| } | ||
|
Comment on lines
+671
to
+680
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are allowing platforms to just give 0, are there scenarios where it matters that we are accurate? Why can't the shim just assume 0 always? Otherwise, this will lead to making the interface wider unnecessarily. Also, same comment as in other PRs, doc strings should not mention "subsequent stacked PRs" and such. |
||
| } | ||
|
|
||
| /// A provider for thread-local storage. | ||
|
|
||
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.
This is actually making them from private into crate-public, which contradicts the claim in the PR description. I don't understand why this change is done/needed.