From 380f6486fcc78d786c611ff0fa22f813a5dd99b0 Mon Sep 17 00:00:00 2001 From: kajoljain379 Date: Tue, 19 Mar 2019 14:11:32 +0530 Subject: [PATCH] arch-power: Add helper functions in radixwalk * Added function to generate Mask with given bit set. * Added a function to generate Mask with a sequence of clear bits. Change-Id: I7cf0b0915ffd327a98537a89f7b3f60314ea6098 Signed-off-by: kajoljain379 --- src/arch/power/radixwalk.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/arch/power/radixwalk.cc b/src/arch/power/radixwalk.cc index 295f4a955..efa3422e4 100644 --- a/src/arch/power/radixwalk.cc +++ b/src/arch/power/radixwalk.cc @@ -46,6 +46,8 @@ #define extract(x, shift, mask) ((x >> shift) & mask) #define align(x, bits) (x << bits) +#define setBitMask(shift) ( (uint64_t)1 << shift) +#define unsetMask(start ,end)(~((setBitMask(start))-1) | ((setBitMask(end))-1)) #define getRTS(x) ((extract(x, RTS1_SHIFT, RTS1_MASK) << RTS2_BITS) | \ (extract(x, RTS2_SHIFT, RTS2_MASK))) -- 2.30.2