diff --git a/src/pal/pal_freebsd.h b/src/pal/pal_freebsd.h index 66ef925..916fc70 100644 --- a/src/pal/pal_freebsd.h +++ b/src/pal/pal_freebsd.h @@ -3,11 +3,14 @@ #if defined(__FreeBSD__) && !defined(_KERNEL) # include "pal_bsd_aligned.h" -// On CHERI platforms, we need to know the value of CHERI_PERM_CHERIABI_VMMAP. +// On CHERI platforms, we need to know the value of CHERI_PERM_SW_VMEM. // This pollutes the global namespace a little, sadly, but I think only with // symbols that begin with CHERI_, which is as close to namespaces as C offers. # if defined(__CHERI_PURE_CAPABILITY__) # include +# if !defined(CHERI_PERM_SW_VMEM) +# define CHERI_PERM_SW_VMEM CHERI_PERM_CHERIABI_VMMAP +# endif # endif namespace snmalloc @@ -108,7 +111,7 @@ namespace snmalloc /** * On CheriBSD, exporting a pointer means stripping it of the authority to - * manage the address space it references by clearing the CHERIABI_VMMAP + * manage the address space it references by clearing the SW_VMEM * permission bit. */ template @@ -124,8 +127,7 @@ namespace snmalloc } return CapPtr>( __builtin_cheri_perms_and( - p.unsafe_ptr(), - ~static_cast(CHERI_PERM_CHERIABI_VMMAP))); + p.unsafe_ptr(), ~static_cast(CHERI_PERM_SW_VMEM))); } # endif };