Index: sys/arm64/linux/linux_locore.s =================================================================== --- /dev/null +++ sys/arm64/linux/linux_locore.s @@ -0,0 +1,32 @@ +/* $FreeBSD$ */ + +#include + + .data + + .globl linux_platform +linux_platform: + .asciz "arm64" + + + .text + +// LINUXTODO: implement __kernel_rt_sigreturn +ENTRY(__kernel_rt_sigreturn) + brk #0 + ret + +// LINUXTODO: implement __kernel_gettimeofday +ENTRY(__kernel_gettimeofday) + brk #0 + ret + +// LINUXTODO: implement __kernel_clock_gettime +ENTRY(__kernel_clock_gettime) + brk #0 + ret + +// LINUXTODO: implement __kernel_clock_getres +ENTRY(__kernel_clock_getres) + brk #0 + ret Index: sys/arm64/linux/linux_machdep.c =================================================================== --- /dev/null +++ sys/arm64/linux/linux_machdep.c @@ -0,0 +1,104 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* DTrace probes */ +LIN_SDT_PROBE_DEFINE0(machdep, linux_set_upcall_kse, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_mprotect, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_set_cloned_tls, todo); + +// LINUXTODO: deduplicate? +int +linux_execve(struct thread *td, struct linux_execve_args *args) +{ + struct image_args eargs; + char *path; + int error; + + LCONVPATHEXIST(td, args->path, &path); + + LINUX_CTR(execve); + + error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, + args->envp); + free(path, M_TEMP); + if (error == 0) + error = linux_common_execve(td, &eargs); + return (error); +} + +// LINUXTODO: implement/deduplicate arm64 linux_set_upcall_kse +int +linux_set_upcall_kse(struct thread *td, register_t stack) +{ + + LIN_SDT_PROBE0(machdep, linux_set_upcall_kse, todo); + return (EDOOFUS); +} + +/* LINUXTODO deduplicate arm64 linux_mmap2?*/ +int +linux_mmap2(struct thread *td, struct linux_mmap2_args *args) +{ + + LIN_SDT_PROBE0(machdep, linux_mmap2, todo); + return (linux_mmap_common(td, PTROUT(args->addr), args->len, args->prot, + args->flags, args->fd, args->pgoff)); +} + +// XXX why uap vs args? +// LINUXTODO: implement/deduplicate arm64 linux_mprotect +int +linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_mprotect, todo); + return (EDOOFUS); +} + +// LINUXTODO: implement arm64 linux_rt_sigsuspend +int +linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_rt_sigsuspend, todo); + return (EDOOFUS); +} + +// LINUXTODO: implement arm64 linux_sigaltstack +int +linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_sigaltstack, todo); + return (EDOOFUS); +} + +// LINUXTODO: implement arm64 linux_set_cloned_tls +int +linux_set_cloned_tls(struct thread *td, void *desc) +{ + + LIN_SDT_PROBE0(machdep, linux_set_cloned_tls, todo); + return (EDOOFUS); +} Index: sys/arm64/linux/linux_ptrace.c =================================================================== --- /dev/null +++ sys/arm64/linux/linux_ptrace.c @@ -0,0 +1,27 @@ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* DTrace probes */ +LIN_SDT_PROBE_DEFINE0(ptrace, linux_ptrace, todo); + +// LINUXTODO: implement arm64 linux_ptrace +int +linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) +{ + + LIN_SDT_PROBE0(ptrace, linux_ptrace, todo); + return (EDOOFUS); +} Index: sys/arm64/linux/linux_support.s =================================================================== --- /dev/null +++ sys/arm64/linux/linux_support.s @@ -0,0 +1,31 @@ +#include "linux_assym.h" +//#include +#include + +#include "assym.inc" + +// LINUXTODO: implement futex_* + +futex_fault: + brk #0 + ret + +ENTRY(futex_xchgl) + brk #0 + ret + +ENTRY(futex_addl) + brk #0 + ret + +ENTRY(futex_orl) + brk #0 + ret + +ENTRY(futex_andl) + brk #0 + ret + +ENTRY(futex_xorl) + brk #0 + ret