mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-28 07:44:18 +08:00
* Fire up multiple processors * Use IPIs to wake up secondary processors * Much better exception information * Modifications to show more information on fault * WIP: Use real libstd * Add TLS (not complete) * Add random function, export getpid, cleanup * Do not spin APs until new context * Update rust * Update rust * Use rd/wrfsbase * Implement TLS * Implement compiler builtins and update rust * Update rust * Back to Redox libstd * Update rust
20 lines
352 B
Rust
20 lines
352 B
Rust
use super::{c_char, size_t};
|
|
|
|
pub unsafe extern fn strlen(ptr: *const c_char) -> size_t {
|
|
let mut i: size_t = 0;
|
|
while *ptr.offset(i as isize) != 0 {
|
|
i += 1;
|
|
}
|
|
i
|
|
}
|
|
|
|
pub unsafe extern fn random() -> u64 {
|
|
let rand;
|
|
asm!("rdrand rax"
|
|
: "={rax}"(rand)
|
|
:
|
|
:
|
|
: "intel", "volatile");
|
|
rand
|
|
}
|