From b2ee1902dcf76fa78216a266a2921b0ca5eaaf4f Mon Sep 17 00:00:00 2001 From: Nathaniel Filardo Date: Wed, 13 May 2020 13:58:12 +0000 Subject: [PATCH] AAL: add AalName and smallest_page_size --- src/aal/aal.h | 7 +++++++ src/aal/aal_arm.h | 4 ++++ src/aal/aal_x86.h | 4 ++++ src/aal/aal_x86_sgx.h | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/src/aal/aal.h b/src/aal/aal.h index b632fbd..bf22af8 100644 --- a/src/aal/aal.h +++ b/src/aal/aal.h @@ -44,6 +44,13 @@ namespace snmalloc StrictProvenance = (1 << 2), }; + enum AalName : int + { + ARM, + X86, + X86_SGX, + }; + /** * Architecture Abstraction Layer. Includes default implementations of some * functions using compiler builtins. Falls back to the definitions in the diff --git a/src/aal/aal_arm.h b/src/aal/aal_arm.h index baa690f..bd5f08b 100644 --- a/src/aal/aal_arm.h +++ b/src/aal/aal_arm.h @@ -27,6 +27,10 @@ namespace snmalloc static constexpr uint64_t aal_features = IntegerPointers | NoCpuCycleCounters; + static constexpr enum AalName aal_name = ARM; + + static constexpr size_t smallest_page_size = 0x1000; + /** * On pipelined processors, notify the core that we are in a spin loop and * that speculative execution past this point may not be a performance gain. diff --git a/src/aal/aal_x86.h b/src/aal/aal_x86.h index 2473b5f..cc20e77 100644 --- a/src/aal/aal_x86.h +++ b/src/aal/aal_x86.h @@ -60,6 +60,10 @@ namespace snmalloc */ static constexpr uint64_t aal_features = IntegerPointers; + static constexpr enum AalName aal_name = X86; + + static constexpr size_t smallest_page_size = 0x1000; + /** * On pipelined processors, notify the core that we are in a spin loop and * that speculative execution past this point may not be a performance gain. diff --git a/src/aal/aal_x86_sgx.h b/src/aal/aal_x86_sgx.h index 3d9a467..87808a4 100644 --- a/src/aal/aal_x86_sgx.h +++ b/src/aal/aal_x86_sgx.h @@ -26,6 +26,10 @@ namespace snmalloc */ static constexpr uint64_t aal_features = IntegerPointers; + static constexpr enum AalName aal_name = X86_SGX; + + static constexpr size_t smallest_page_size = 0x1000; + /** * On pipelined processors, notify the core that we are in a spin loop and * that speculative execution past this point may not be a performance gain.