Merge pull request #545 from gsomlo/gls-fix-mmptr

csr: fix simple accessor alignment
This commit is contained in:
enjoy-digital 2020-05-29 18:32:30 +02:00 committed by GitHub
commit 5dd5f97b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -37,12 +37,12 @@
/* CSR subregisters (a.k.a. "simple CSRs") are embedded inside native CPU-word
* aligned locations: */
#if CONFIG_CSR_DATA_WIDTH == 32
#define MMPTR(a) (*((volatile unsigned int *)(a)))
#elif CONFIG_CSR_DATA_WIDTH == 8
#define MMPTR(a) (*((volatile unsigned char *)(a)))
#if CONFIG_CSR_ALIGNMENT == 32
#define MMPTR(a) (*((volatile uint32_t *)(a)))
#elif CONFIG_CSR_ALIGNMENT == 64
#define MMPTR(a) (*((volatile uint64_t *)(a)))
#else
#error Unsupported CSR data width
#error Unsupported CSR alignment
#endif
static inline void csr_write_simple(unsigned long v, unsigned long a)