Build on i686, remove unnecessary #[no_mangle].
This commit is contained in:
@@ -44,13 +44,11 @@ pub fn copy_env_regs(cur_pid_fd: usize, new_pid_fd: usize) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "cdecl" fn __relibc_internal_fork_impl(initial_rsp: *mut usize) -> usize {
|
||||
unsafe extern "cdecl" fn fork_impl(initial_rsp: *mut usize) -> usize {
|
||||
Error::mux(fork_inner(initial_rsp))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "cdecl" fn __relibc_internal_fork_hook(cur_filetable_fd: usize, new_pid_fd: usize) {
|
||||
unsafe extern "cdecl" fn child_hook(cur_filetable_fd: usize, new_pid_fd: usize) {
|
||||
let _ = syscall::close(cur_filetable_fd);
|
||||
let _ = syscall::close(new_pid_fd);
|
||||
}
|
||||
@@ -71,14 +69,14 @@ asmfunction!(__relibc_internal_fork_wrapper -> usize: ["
|
||||
fnstcw [esp+24]
|
||||
|
||||
push esp
|
||||
call __relibc_internal_fork_impl
|
||||
call {fork_impl}
|
||||
pop esp
|
||||
jmp 2f
|
||||
"] <= []);
|
||||
"] <= [fork_impl = sym fork_impl]);
|
||||
|
||||
asmfunction!(__relibc_internal_fork_ret: ["
|
||||
// Arguments already on the stack
|
||||
call __relibc_internal_fork_hook
|
||||
call {child_hook}
|
||||
|
||||
//TODO ldmxcsr [esp+16]
|
||||
fldcw [esp+24]
|
||||
@@ -97,7 +95,7 @@ asmfunction!(__relibc_internal_fork_ret: ["
|
||||
|
||||
pop ebp
|
||||
ret
|
||||
"] <= []);
|
||||
"] <= [child_hook = sym child_hook]);
|
||||
asmfunction!(__relibc_internal_sigentry: ["
|
||||
sub esp, 512
|
||||
fxsave [esp]
|
||||
|
||||
@@ -49,13 +49,11 @@ pub fn copy_env_regs(cur_pid_fd: usize, new_pid_fd: usize) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "sysv64" fn __relibc_internal_fork_impl(initial_rsp: *mut usize) -> usize {
|
||||
unsafe extern "sysv64" fn fork_impl(initial_rsp: *mut usize) -> usize {
|
||||
Error::mux(fork_inner(initial_rsp))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "sysv64" fn __relibc_internal_fork_hook(cur_filetable_fd: usize, new_pid_fd: usize) {
|
||||
unsafe extern "sysv64" fn child_hook(cur_filetable_fd: usize, new_pid_fd: usize) {
|
||||
let _ = syscall::close(cur_filetable_fd);
|
||||
let _ = syscall::close(new_pid_fd);
|
||||
}
|
||||
@@ -77,18 +75,18 @@ asmfunction!(__relibc_internal_fork_wrapper -> usize: ["
|
||||
fnstcw [rsp+24]
|
||||
|
||||
mov rdi, rsp
|
||||
call __relibc_internal_fork_impl
|
||||
call {fork_impl}
|
||||
|
||||
add rsp, 80
|
||||
|
||||
pop rbp
|
||||
ret
|
||||
|
||||
"] <= []);
|
||||
"] <= [fork_impl = sym fork_impl]);
|
||||
asmfunction!(__relibc_internal_fork_ret: ["
|
||||
mov rdi, [rsp]
|
||||
mov rsi, [rsp + 8]
|
||||
call __relibc_internal_fork_hook
|
||||
call {child_hook}
|
||||
|
||||
ldmxcsr [rsp+16]
|
||||
fldcw [rsp+24]
|
||||
@@ -105,7 +103,7 @@ asmfunction!(__relibc_internal_fork_ret: ["
|
||||
|
||||
pop rbp
|
||||
ret
|
||||
"] <= []);
|
||||
"] <= [child_hook = sym child_hook]);
|
||||
asmfunction!(__relibc_internal_rlct_clone_ret: ["
|
||||
# Load registers
|
||||
pop rax
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use core::cell::{Cell, UnsafeCell};
|
||||
use core::ffi::c_int;
|
||||
use core::sync::atomic::{AtomicU64, Ordering};
|
||||
use core::sync::atomic::Ordering;
|
||||
|
||||
use syscall::{Error, IntRegisters, Result, SetSighandlerData, SigProcControl, Sigcontrol, SigcontrolFlags, EINVAL, SIGCHLD, SIGCONT, SIGKILL, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGW0_NOCLDSTOP_BIT, SIGW0_TSTP_IS_STOP_BIT, SIGW0_TTIN_IS_STOP_BIT, SIGW0_TTOU_IS_STOP_BIT, SIGWINCH};
|
||||
use syscall::{Error, IntRegisters, Result, SetSighandlerData, SigProcControl, Sigcontrol, SigcontrolFlags, EINVAL, SIGCHLD, SIGCONT, SIGKILL, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGW0_NOCLDSTOP_BIT, SIGW0_TSTP_IS_STOP_BIT, SIGW0_TTIN_IS_STOP_BIT, SIGW0_TTOU_IS_STOP_BIT, SIGWINCH, data::AtomicU64};
|
||||
|
||||
use crate::{arch::*, Tcb};
|
||||
use crate::sync::Mutex;
|
||||
|
||||
Reference in New Issue
Block a user