Skip to content
Snippets Groups Projects
Verified Commit 9e2cbcc4 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

redox-exec: Add aarch64 stubs

parent 13e58007
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,24 @@ pub unsafe fn pte_clone_impl(stack: *mut usize) -> Result<usize> {
Ok(0)
}
//TODO
//TODO: aarch64
#[cfg(target_arch = "aarch64")]
core::arch::global_asm!("
.globl __relibc_internal_pte_clone_ret
.type __relibc_internal_pte_clone_ret, @function
.p2align 6
__relibc_internal_pte_clone_ret:
b __relibc_internal_pte_clone_ret
.size __relibc_internal_pte_clone_ret, . - __relibc_internal_pte_clone_ret
");
#[cfg(target_arch = "aarch64")]
extern "C" {
fn __relibc_internal_pte_clone_ret();
}
//TODO: x86
#[cfg(target_arch = "x86")]
core::arch::global_asm!("
.globl __relibc_internal_pte_clone_ret
......
use syscall::error::*;
use crate::{FdGuard, fork_inner};
// Setup a stack starting from the very end of the address space, and then growing downwards.
pub(crate) const STACK_TOP: usize = 1 << 47;
pub(crate) const STACK_SIZE: usize = 1024 * 1024;
/// Deactive TLS, used before exec() on Redox to not trick target executable into thinking TLS
/// is already initialized as if it was a thread.
pub unsafe fn deactivate_tcb(open_via_dup: usize) -> Result<()> {
//TODO: aarch64
Err(Error::new(ENOSYS))
}
pub fn copy_env_regs(cur_pid_fd: usize, new_pid_fd: usize) -> Result<()> {
//TODO: aarch64
Err(Error::new(ENOSYS))
}
#[no_mangle]
unsafe extern "C" fn __relibc_internal_fork_impl(initial_rsp: *mut usize) -> usize {
Error::mux(fork_inner(initial_rsp))
}
#[no_mangle]
unsafe extern "C" fn __relibc_internal_fork_hook(cur_filetable_fd: usize, new_pid_fd: usize) {
let _ = syscall::close(cur_filetable_fd);
let _ = syscall::close(new_pid_fd);
}
//TODO: aarch64
core::arch::global_asm!("
.p2align 6
.globl __relibc_internal_fork_wrapper
.type __relibc_internal_fork_wrapper, @function
__relibc_internal_fork_wrapper:
b __relibc_internal_fork_wrapper
.size __relibc_internal_fork_wrapper, . - __relibc_internal_fork_wrapper
.p2align 6
.globl __relibc_internal_fork_ret
.type __relibc_internal_fork_ret, @function
__relibc_internal_fork_ret:
b __relibc_internal_fork_ret
.size __relibc_internal_fork_ret, . - __relibc_internal_fork_ret"
);
extern "C" {
pub(crate) fn __relibc_internal_fork_wrapper() -> usize;
pub(crate) fn __relibc_internal_fork_ret();
}
#[cfg(target_arch = "aarch64")]
pub use self::aarch64::*;
#[cfg(target_arch = "aarch64")]
pub mod aarch64;
#[cfg(target_arch = "x86")]
pub use self::x86::*;
#[cfg(target_arch = "x86")]
......
......@@ -45,7 +45,7 @@ unsafe extern "cdecl" fn __relibc_internal_fork_hook(cur_filetable_fd: usize, ne
let _ = syscall::close(new_pid_fd);
}
//TODO
//TODO: x86
core::arch::global_asm!("
.p2align 6
.globl __relibc_internal_fork_wrapper
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment