redox/libstd_real/libc/src/funcs.rs
Jeremy Soller 149b0297a4 Smp (#23)
* 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
2016-10-31 10:49:00 -06:00

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
}