mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 05:55:16 -04:00
Refactor 32-bit register definitions
This commit is contained in:
parent
c0f99fcd1c
commit
a6c7a2c57e
26 changed files with 126 additions and 98 deletions
22
exosphere/bpmpfw/src/utils.h
Normal file
22
exosphere/bpmpfw/src/utils.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef EXOSPHERE_BPMPFW_UTILS_H
|
||||
#define EXOSPHERE_BPMPFW_UTILS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define BIT(n) (1u << (n))
|
||||
#define BITL(n) (1ull << (n))
|
||||
#define MASK(n) (BIT(n) - 1)
|
||||
#define MASKL(n) (BITL(n) - 1)
|
||||
#define MASK2(a,b) (MASK(a) & ~MASK(b))
|
||||
#define MASK2L(a,b) (MASKL(a) & ~MASKL(b))
|
||||
|
||||
#define MAKE_REG32(a) (*(volatile uint32_t *)(a))
|
||||
|
||||
#define ALIGN(m) __attribute__((aligned(m)))
|
||||
#define PACKED __attribute__((packed))
|
||||
|
||||
#define ALINLINE __attribute__((always_inline))
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue