mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-27 10:55:20 +00:00
asm: extract per-arch syscall impls into separate modules
The monolithic lib.rs had grown to 2600+ lines of `#[cfg(target_arch)]` blocks interleaved inside every `sys_*` function. Reading or modifying one arch's syscalls meant scrolling past thirteen others. Pull each arch's asm into `<arch>.rs`, re-exported via a single `#[cfg] #[path] mod arch;` so `lib.rs` only contains wrappers, structs, and module dispatch. Adding a new architecture now touches one new file plus one three-line mod decl.
This commit is contained in:
parent
136d5bcb58
commit
e77976b94b
6 changed files with 587 additions and 460 deletions
|
|
@ -401,7 +401,13 @@ fn print_system_info(fields: &Fields) -> Result<(), Error> {
|
|||
// Row format mirrors the default logo path exactly.
|
||||
let rows: [(&str, &str, &str, &str, &str); 11] = [
|
||||
("", "", user_info.as_str(), " ", " ~"),
|
||||
("\u{F313} ", "System", os_name.as_str(), " \u{E621} ", ""),
|
||||
(
|
||||
"\u{F313} ",
|
||||
"System",
|
||||
os_name.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{E712} ",
|
||||
"Kernel",
|
||||
|
|
@ -409,11 +415,41 @@ fn print_system_info(fields: &Fields) -> Result<(), Error> {
|
|||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
("\u{F2DB} ", "CPU", cpu_name.as_str(), " \u{E621} ", ""),
|
||||
("\u{F4BC} ", "Topology", cpu_cores.as_str(), " \u{E621} ", ""),
|
||||
("\u{E795} ", "Shell", shell.as_str(), " \u{E621} ", ""),
|
||||
("\u{F017} ", "Uptime", uptime.as_str(), " \u{E621} ", ""),
|
||||
("\u{F2D2} ", "Desktop", desktop.as_str(), " \u{E621} ", ""),
|
||||
(
|
||||
"\u{F2DB} ",
|
||||
"CPU",
|
||||
cpu_name.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{F4BC} ",
|
||||
"Topology",
|
||||
cpu_cores.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{E795} ",
|
||||
"Shell",
|
||||
shell.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{F017} ",
|
||||
"Uptime",
|
||||
uptime.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{F2D2} ",
|
||||
"Desktop",
|
||||
desktop.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{F035B} ",
|
||||
"Memory",
|
||||
|
|
@ -421,8 +457,20 @@ fn print_system_info(fields: &Fields) -> Result<(), Error> {
|
|||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
("\u{F194E} ", "Storage (/)", storage.as_str(), " \u{E621} ", ""),
|
||||
("\u{E22B} ", "Colors", colors.as_str(), " \u{E621} ", ""),
|
||||
(
|
||||
"\u{F194E} ",
|
||||
"Storage (/)",
|
||||
storage.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
(
|
||||
"\u{E22B} ",
|
||||
"Colors",
|
||||
colors.as_str(),
|
||||
" \u{E621} ",
|
||||
"",
|
||||
),
|
||||
];
|
||||
|
||||
core::fmt::write(&mut w, format_args!("\n")).ok();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue