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
This commit is contained in:
parent
25dc44b348
commit
149b0297a4
1 changed files with 1119 additions and 378 deletions
40
libstd_real/libc/src/start.rs
Normal file
40
libstd_real/libc/src/start.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
use super::exit;
|
||||
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
#[cfg(target_arch = "x86")]
|
||||
pub unsafe fn _start() {
|
||||
asm!("push esp
|
||||
call _start_stack
|
||||
pop esp"
|
||||
:
|
||||
:
|
||||
: "memory"
|
||||
: "intel", "volatile");
|
||||
let _ = exit(0);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub unsafe fn _start() {
|
||||
asm!("mov rdi, rsp
|
||||
and rsp, 0xFFFFFFFFFFFFFFF0
|
||||
call _start_stack"
|
||||
:
|
||||
:
|
||||
: "memory"
|
||||
: "intel", "volatile");
|
||||
let _ = exit(0);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn _start_stack(stack: *const usize){
|
||||
extern "C" {
|
||||
fn main(argc: usize, argv: *const *const u8) -> usize;
|
||||
}
|
||||
|
||||
let argc = *stack as usize;
|
||||
let argv = stack.offset(1) as *const *const u8;
|
||||
let _ = exit(main(argc, argv));
|
||||
}
|
||||
Loading…
Reference in a new issue