diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp index ae352641516..ad32ee150e8 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@ -81,14 +81,12 @@ #endif #define SPELL_REG_SP "sp" -#define SPELL_REG_FP "fp" #ifdef __APPLE__ // see darwin-xnu/osfmk/mach/arm/_structs.h // 10.5 UNIX03 member name prefixes #define DU3_PREFIX(s, m) __ ## s.__ ## m -#endif #define context_x uc_mcontext->DU3_PREFIX(ss,x) #define context_fp uc_mcontext->DU3_PREFIX(ss,fp) @@ -97,6 +95,31 @@ #define context_pc uc_mcontext->DU3_PREFIX(ss,pc) #define context_cpsr uc_mcontext->DU3_PREFIX(ss,cpsr) #define context_esr uc_mcontext->DU3_PREFIX(es,esr) +#endif + +#ifdef __FreeBSD__ +# define context_x uc_mcontext.mc_gpregs.gp_x +# define context_fp context_x[REG_FP] +# define context_lr uc_mcontext.mc_gpregs.gp_lr +# define context_sp uc_mcontext.mc_gpregs.gp_sp +# define context_pc uc_mcontext.mc_gpregs.gp_elr +#endif + +#ifdef __NetBSD__ +# define context_x uc_mcontext.__gregs +# define context_fp uc_mcontext.__gregs[_REG_FP] +# define context_lr uc_mcontext.__gregs[_REG_LR] +# define context_sp uc_mcontext.__gregs[_REG_SP] +# define context_pc uc_mcontext.__gregs[_REG_ELR] +#endif + +#ifdef __OpenBSD__ +# define context_x sc_x +# define context_fp sc_x[REG_FP] +# define context_lr sc_lr +# define context_sp sc_sp +# define context_pc sc_elr +#endif #define REG_BCP context_x[22] @@ -497,9 +520,11 @@ int os::extra_bang_size_in_bytes() { return 0; } +#ifdef __APPLE__ void os::current_thread_enable_wx(WXMode mode) { pthread_jit_write_protect_np(mode == WXExec); } +#endif static inline void atomic_copy64(const volatile void *src, volatile void *dst) { *(jlong *) dst = *(const jlong *) src;