debugcc: add convenient macro GENMASK to calculate mask from bits

Add convenient macro GENMASK to calculate masks from bits similar to how
it's implemented in kernel linux tools.

This is useful to better describe some specific define instead of using
comments and raw HEX values.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi
2023-11-08 12:26:27 +01:00
parent 93f5ccd037
commit 776a4f281e

View File

@@ -32,6 +32,7 @@
#define __DEBUGCC_H__
#define BIT(x) (1 << (x))
#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))
#define CORE_CC_BLOCK "core"