Fix remaining issues, move setjmp into relibc crate, move start logic into relibc
This commit is contained in:
+2
-2
@@ -13,7 +13,7 @@ pub unsafe extern "C" fn _start() {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
asm!("mov rdi, rsp
|
||||
and rsp, 0xFFFFFFFFFFFFFFF0
|
||||
call _start_rust"
|
||||
call relibc_start"
|
||||
:
|
||||
:
|
||||
:
|
||||
@@ -21,7 +21,7 @@ pub unsafe extern "C" fn _start() {
|
||||
);
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
asm!("mov x0, sp
|
||||
bl _start_rust"
|
||||
bl relibc_start"
|
||||
:
|
||||
:
|
||||
:
|
||||
|
||||
@@ -12,6 +12,7 @@ pub mod locale;
|
||||
pub mod netinet_in;
|
||||
pub mod pwd;
|
||||
pub mod semaphore;
|
||||
pub mod setjmp;
|
||||
pub mod sgtty;
|
||||
pub mod signal;
|
||||
pub mod stdio;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[package]
|
||||
name = "setjmp"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
@@ -34,6 +34,7 @@ extern crate spin;
|
||||
mod macros;
|
||||
pub mod header;
|
||||
pub mod platform;
|
||||
pub mod start;
|
||||
|
||||
use platform::{Allocator, Pal, Sys};
|
||||
|
||||
|
||||
+4
-1
@@ -1,6 +1,9 @@
|
||||
use alloc::Vec;
|
||||
use core::ptr;
|
||||
|
||||
use header::stdio;
|
||||
use platform;
|
||||
use platform::{Pal, Sys};
|
||||
use platform::types::*;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -25,7 +28,7 @@ impl Stack {
|
||||
|
||||
#[inline(never)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
|
||||
pub unsafe extern "C" fn relibc_start(sp: &'static Stack) -> ! {
|
||||
extern "C" {
|
||||
fn main(argc: isize, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user