# HG changeset patch # User Paul Boddie # Date 1539776281 -7200 # Node ID 9b95ca04597e16199ae0a8759f7c5c25647b8a5c # Parent e8f35b8da65d21d17a81b54fe7e9c1980cd8ad9e Added address translation macros. diff -r e8f35b8da65d -r 9b95ca04597e pic32_c.h --- a/pic32_c.h Wed Oct 17 13:37:41 2018 +0200 +++ b/pic32_c.h Wed Oct 17 13:38:01 2018 +0200 @@ -4,6 +4,7 @@ #define __PIC32_C_H__ #include +#include "mips.h" #include "pic32.h" /* Access. */ @@ -16,6 +17,11 @@ #define SET_REG(mem, val) (REG(mem + SET) = val) #define INV_REG(mem, val) (REG(mem + INV) = val) +/* Address translation. */ + +#define PHYSICAL(addr) (((uint32_t) addr) - KSEG0_BASE) +#define HW_PHYSICAL(addr) (((uint32_t) addr) - KSEG1_BASE) + #endif /* __PIC32_C_H__ */ #endif /* __ASSEMBLER__ */