]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
arm64/mm: Introduce NUM_ASIDS
authorJulien Grall <julien.grall@arm.com>
Wed, 18 Jul 2018 16:43:16 +0000 (17:43 +0100)
committerJulien Grall <julien.grall@arm.com>
Thu, 20 Jun 2019 12:45:07 +0000 (13:45 +0100)
At the moment ASID_FIRST_VERSION is used to know the number of ASIDs
supported. As we are going to move the ASID allocator in a separate, it
would be better to use a different name for external users.

This patch adds NUM_ASIDS and implements ASID_FIRST_VERSION using it.

Signed-off-by: Julien Grall <julien.grall@arm.com>
arch/arm64/mm/context.c

index d128f02644b09a9e306d00767e63086846586075..beba8e5b4100e669ad628bae7ab01f01cdb57d8e 100644 (file)
@@ -48,7 +48,9 @@ static DEFINE_PER_CPU(atomic64_t, active_asids);
 static DEFINE_PER_CPU(u64, reserved_asids);
 
 #define ASID_MASK(info)                        (~GENMASK((info)->bits - 1, 0))
-#define ASID_FIRST_VERSION(info)       (1UL << ((info)->bits))
+#define NUM_ASIDS(info)                        (1UL << ((info)->bits))
+
+#define ASID_FIRST_VERSION(info)       NUM_ASIDS(info)
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
 #define ASID_PER_CONTEXT               2
@@ -56,7 +58,7 @@ static DEFINE_PER_CPU(u64, reserved_asids);
 #define ASID_PER_CONTEXT               1
 #endif
 
-#define NUM_CTXT_ASIDS(info)           (ASID_FIRST_VERSION(info) >> (info)->ctxt_shift)
+#define NUM_CTXT_ASIDS(info)           (NUM_ASIDS(info) >> (info)->ctxt_shift)
 #define asid2idx(info, asid)           (((asid) & ~ASID_MASK(info)) >> (info)->ctxt_shift)
 #define idx2asid(info, idx)            (((idx) << (info)->ctxt_shift) & ~ASID_MASK(info))