OpenOCD
|
Go to the source code of this file.
Macros | |
#define | BIT(nr) (1UL << (nr)) |
#define | BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) |
#define | BIT_ULL(nr) (1ULL << (nr)) |
#define | BIT_WORD(nr) ((nr) / BITS_PER_LONG) |
#define | BITS_PER_BYTE 8 |
#define | BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) |
#define | BITS_PER_LONG_LONG (BITS_PER_BYTE * sizeof(long long)) |
#define | BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
#define | DECLARE_BITMAP(name, bits) unsigned long name[BITS_TO_LONGS(bits)] |
#define | GENMASK(h, l) (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) |
#define | GENMASK_ULL(h, l) (((~0ULL) - (1ULL << (l)) + 1) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) |
Functions | |
static void | bitmap_zero (unsigned long *dst, unsigned int nbits) |
bitmap_zero - Clears all the bits in memory More... | |
static void | clear_bit (unsigned int nr, volatile unsigned long *addr) |
clear_bit - Clear a bit in memory More... | |
static void | set_bit (unsigned int nr, volatile unsigned long *addr) |
set_bit - Set a bit in memory More... | |
static int | test_bit (unsigned int nr, const volatile unsigned long *addr) |
test_bit - Determine whether a bit is set More... | |
#define BIT_MASK | ( | nr | ) | (1UL << ((nr) % BITS_PER_LONG)) |
#define BIT_WORD | ( | nr | ) | ((nr) / BITS_PER_LONG) |
#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) |
#define BITS_PER_LONG_LONG (BITS_PER_BYTE * sizeof(long long)) |
#define BITS_TO_LONGS | ( | nr | ) | DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
#define DECLARE_BITMAP | ( | name, | |
bits | |||
) | unsigned long name[BITS_TO_LONGS(bits)] |
#define GENMASK | ( | h, | |
l | |||
) | (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) |
#define GENMASK_ULL | ( | h, | |
l | |||
) | (((~0ULL) - (1ULL << (l)) + 1) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) |
|
inlinestatic |
bitmap_zero - Clears all the bits in memory
dst | the address of the bitmap |
nbits | the number of bits to clear |
Definition at line 36 of file bits.h.
References BITS_TO_LONGS.
Referenced by COMMAND_HANDLER(), and stm32l4_protect_same_bank().
|
inlinestatic |
clear_bit - Clear a bit in memory
nr | the bit to set |
addr | the address to start counting from |
Definition at line 47 of file bits.h.
References addr, BIT_MASK, BIT_WORD, and mask.
Referenced by stlink_dap_closeall_ap(), stlink_dap_reinit_interface(), and stm32l4_protect_same_bank().
|
inlinestatic |
set_bit - Set a bit in memory
nr | the bit to set |
addr | the address to start counting from |
Definition at line 60 of file bits.h.
References addr, BIT_MASK, BIT_WORD, and mask.
Referenced by COMMAND_HANDLER(), stlink_usb_open_ap(), and stm32l4_protect_same_bank().
|
inlinestatic |
test_bit - Determine whether a bit is set
nr | bit number to test |
addr | Address to start counting from |
Definition at line 73 of file bits.h.
References addr, BIT_WORD, and BITS_PER_LONG.
Referenced by bitmap_to_ranges(), rsl10_protect_check(), stlink_dap_closeall_ap(), stlink_dap_reinit_interface(), and stlink_usb_open_ap().