#define PADDR(a) (a) /* * Function: int readFromExtMem(int addr) * Description: loads value from external memory. * Input: addr - address of external memory, must be aligned at 4 * Output: int - loaded value */ int readFromExtMem(int addr) { int val = 0; addr = PADDR(addr); asm volatile("lsrl 2, %0, r6.l"::"r"(addr)); asm volatile("move r6.l, a5.l":::"a5.l"); asm volatile("move (a5.l), r6.l"); asm volatile("move r6.l, %0":"=r"(val)); return val; } /* * Function: void writeToExtMem(int addr, int value) * Description: loads value into external memory. * Input: addr - address of external memory, must be aligned at 4 * value - value to store */ void writeToExtMem(int addr, int value) { addr = PADDR(addr); asm volatile("lsrl 2, %0, r6.l"::"r"(addr)); asm volatile("move r6.l, a5.l":::"a5.l"); asm volatile("move %0, (a5.l)"::"r"(value)); } /* int readFromExtMem(int addr); void writeToExtMem(int address, int value); */ void mmemcpy(int* s, int* d, int size) { int i = 0; for(i=0;i