/* Write value to pma{i}cfg entry which are packed into CSRs pmacfg{j}  */
static void write_pmacfg_entry(const uint32_t entry_index, uint8_t entry_value)
/* Write value to pma{i}cfg entry which are packed into CSRs pmacfg{j}  */
static void write_pmacfg_entry(const uint32_t entry_index, uint8_t entry_value)
{
	uint32_t index = PMACFG_NUM(entry_index);
	uint8_t shift = PMACFG_SHIFT(entry_index);
	unsigned long pmacfg = 0;
	#define SWITCH_CASE_PMACFG_READ(x)		\
		case (x):				\
		pmacfg = csr_read(NDS_PMACFG##x); break;
	switch (index) {
	FOR_EACH(SWITCH_CASE_PMACFG_READ, (;), 0, 1, 2, 3);
	}
	pmacfg &= ~(0xFF << shift);
	pmacfg |= entry_value << shift;
	#define SWITCH_CASE_PMACFG_WRITE(x)		\
		case (x):				\
		csr_write(NDS_PMACFG##x, pmacfg); break;
	switch (index) {
	FOR_EACH(SWITCH_CASE_PMACFG_WRITE, (;), 0, 1, 2, 3);
	}
}