Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Driver for the Conexant CX25821 PCIe bridge
0004  *
0005  *  Copyright (C) 2009 Conexant Systems Inc.
0006  *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
0007  */
0008 
0009 #ifndef _BITFUNCS_H
0010 #define _BITFUNCS_H
0011 
0012 #define SetBit(Bit)  (1 << Bit)
0013 
0014 static inline u8 getBit(u32 sample, u8 index)
0015 {
0016     return (u8) ((sample >> index) & 1);
0017 }
0018 
0019 static inline u32 clearBitAtPos(u32 value, u8 bit)
0020 {
0021     return value & ~(1 << bit);
0022 }
0023 
0024 static inline u32 setBitAtPos(u32 sample, u8 bit)
0025 {
0026     sample |= (1 << bit);
0027     return sample;
0028 
0029 }
0030 
0031 #endif