Merge pull request #545 from gsomlo/gls-fix-mmptr
csr: fix simple accessor alignment
This commit is contained in:
commit
5dd5f97b88
|
@ -37,12 +37,12 @@
|
||||||
|
|
||||||
/* CSR subregisters (a.k.a. "simple CSRs") are embedded inside native CPU-word
|
/* CSR subregisters (a.k.a. "simple CSRs") are embedded inside native CPU-word
|
||||||
* aligned locations: */
|
* aligned locations: */
|
||||||
#if CONFIG_CSR_DATA_WIDTH == 32
|
#if CONFIG_CSR_ALIGNMENT == 32
|
||||||
#define MMPTR(a) (*((volatile unsigned int *)(a)))
|
#define MMPTR(a) (*((volatile uint32_t *)(a)))
|
||||||
#elif CONFIG_CSR_DATA_WIDTH == 8
|
#elif CONFIG_CSR_ALIGNMENT == 64
|
||||||
#define MMPTR(a) (*((volatile unsigned char *)(a)))
|
#define MMPTR(a) (*((volatile uint64_t *)(a)))
|
||||||
#else
|
#else
|
||||||
#error Unsupported CSR data width
|
#error Unsupported CSR alignment
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void csr_write_simple(unsigned long v, unsigned long a)
|
static inline void csr_write_simple(unsigned long v, unsigned long a)
|
||||||
|
|
Loading…
Reference in New Issue