Skip to content

Commit

Permalink
RISC-V/PlatformPkg:Added Bit operation header file
Browse files Browse the repository at this point in the history
Add bit operated macro,like BIT...

Reviewed-by: Sunil V L <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Daniel Schaefer <[email protected]>
Cc: Ray Ni <[email protected]>

Signed-off-by: Yang Wang <[email protected]>
  • Loading branch information
Yang Wang committed Sep 25, 2024
1 parent f709251 commit e57b17b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Platform/RISC-V/PlatformPkg/Include/RiscVBitOp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit e57b17b

Please sign in to comment.