diff --git a/Platform/RISC-V/PlatformPkg/Include/RiscVBitOp.h b/Platform/RISC-V/PlatformPkg/Include/RiscVBitOp.h new file mode 100644 index 00000000000..c33414f6d6c --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Include/RiscVBitOp.h @@ -0,0 +1,15 @@ +/** @file + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + * Copyright (c) 2024, Bosc. All rights reserved.
+ * + */ + +#ifndef RISCV_BIT_OP_H +#define RISCV_BIT_OP_H + +#define BIT(nr) (1UL << (nr)) +#define GENMASK(h, l) \ + (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) + +#endif