diff options
author | Salvador Arroyo <sarroyofdez@yahoo.es> | 2012-11-01 20:55:28 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2012-11-16 12:40:55 +0000 |
commit | 66440183377fb80569badadad689d673269fd5d5 (patch) | |
tree | f75202709353be441cc1c1913ec2b597bb09a4ca /src/target/mips32_pracc.h | |
parent | 9aad563d15da07fdd938014e65c1bbc38fcf3f6c (diff) |
mips: optimize CP0 read/write code
MIPS32_PRACC_BASE_ADDR is defined as 0xFF200000. Now is
possible to load the base address with a lui instruction and
only one pracc access.
Offsets to the pracc code addresses are defined to simplify the code
and probably make it a bit more readable or self-explained.
Change-Id: I853dd2d7fad52745931cc6e6be68c0ae156d897e
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/951
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
Diffstat (limited to 'src/target/mips32_pracc.h')
-rw-r--r-- | src/target/mips32_pracc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index c200e93d..8f208f5f 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -30,6 +30,7 @@ #include <target/mips_ejtag.h> #define MIPS32_PRACC_FASTDATA_AREA 0xFF200000 +#define MIPS32_PRACC_BASE_ADDR 0xFF200000 #define MIPS32_PRACC_FASTDATA_SIZE 16 #define MIPS32_PRACC_TEXT 0xFF200200 #define MIPS32_PRACC_STACK 0xFF204000 @@ -38,6 +39,12 @@ #define MIPS32_PRACC_PARAM_OUT (MIPS32_PRACC_PARAM_IN + MIPS32_PRACC_PARAM_IN_SIZE) #define MIPS32_PRACC_PARAM_OUT_SIZE 0x1000 +#define PRACC_UPPER_BASE_ADDR (MIPS32_PRACC_BASE_ADDR >> 16) +#define PRACC_TEXT_OFFSET (MIPS32_PRACC_TEXT - MIPS32_PRACC_BASE_ADDR) +#define PRACC_IN_OFFSET (MIPS32_PRACC_PARAM_IN - MIPS32_PRACC_BASE_ADDR) +#define PRACC_OUT_OFFSET (MIPS32_PRACC_PARAM_OUT - MIPS32_PRACC_BASE_ADDR) +#define PRACC_STACK_OFFSET (MIPS32_PRACC_STACK - MIPS32_PRACC_BASE_ADDR) + #define MIPS32_FASTDATA_HANDLER_SIZE 0x80 #define UPPER16(uint32_t) (uint32_t >> 16) #define LOWER16(uint32_t) (uint32_t & 0xFFFF) |