From: kajoljain379 Date: Tue, 19 Mar 2019 08:41:32 +0000 (+0530) Subject: arch-power: Add helper functions in radixwalk X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=380f6486fcc78d786c611ff0fa22f813a5dd99b0;p=gem5.git 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 --- 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)))