summaryrefslogtreecommitdiff
path: root/Platform/RISC-V/PlatformPkg/Include/RiscVBitOp.h
blob: c33414f6d6c59e9c3f260f1015b33d4efe3dff1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/** @file
 * SPDX-License-Identifier: BSD-2-Clause-Patent
 *
 * Copyright (c) 2024, Bosc. All rights reserved.<BR>
 *
 */

#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