1 #ifndef __ASSEMBLER__ 2 3 #ifndef __PIC32_C_H__ 4 #define __PIC32_C_H__ 5 6 #include <stdint.h> 7 #include "mips.h" 8 #include "pic32.h" 9 10 /* Access. */ 11 12 #define REG(mem) *((volatile uint32_t *) (mem)) 13 14 /* Bit clearing, setting and inverting. */ 15 16 #define CLR_REG(mem, val) (REG(mem + CLR) = val) 17 #define SET_REG(mem, val) (REG(mem + SET) = val) 18 #define INV_REG(mem, val) (REG(mem + INV) = val) 19 20 /* Address translation. */ 21 22 #define PHYSICAL(addr) (((uint32_t) addr) - KSEG0_BASE) 23 #define HW_PHYSICAL(addr) (((uint32_t) addr) - KSEG1_BASE) 24 25 #endif /* __PIC32_C_H__ */ 26 27 #endif /* __ASSEMBLER__ */