mips32, add realloc code
[fw/openocd] / src / target / mips32_pracc.h
index 112110fcc1ea4803247c91899d01df37374a7260..525d6e618ec5646770e392cf8c7bfc306b04ad78 100644 (file)
@@ -21,8 +21,8 @@
  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
-#ifndef MIPS32_PRACC_H
-#define MIPS32_PRACC_H
+#ifndef OPENOCD_TARGET_MIPS32_PRACC_H
+#define OPENOCD_TARGET_MIPS32_PRACC_H
 
 #include <target/mips32.h>
 #include <target/mips_ejtag.h>
 #define NEG16(v)                                               (((~(v)) + 1) & 0xFFFF)
 /*#define NEG18(v) (((~(v)) + 1) & 0x3FFFF)*/
 
+#define PRACC_BLOCK    128     /* 1 Kbyte */
+
+typedef struct {
+       uint32_t instr;
+       uint32_t addr;
+} pa_list;
+
 struct pracc_queue_info {
        int retval;
-       const int max_code;
        int code_count;
        int store_count;
-       uint32_t *pracc_list;   /* Code and store addresses */
+       int max_code;           /* max intstructions with currently allocated memory */
+       pa_list *pracc_list;    /* Code and store addresses at dmseg */
 };
 void pracc_queue_init(struct pracc_queue_info *ctx);
 void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr);
+void pracc_add_li32(struct pracc_queue_info *ctx, uint32_t reg_num, uint32_t data, bool optimize);
 void pracc_queue_free(struct pracc_queue_info *ctx);
 int mips32_pracc_queue_exec(struct mips_ejtag *ejtag_info,
                            struct pracc_queue_info *ctx, uint32_t *buf);
@@ -99,4 +107,4 @@ int mips32_cp0_read(struct mips_ejtag *ejtag_info,
 int mips32_cp0_write(struct mips_ejtag *ejtag_info,
                uint32_t val, uint32_t cp0_reg, uint32_t cp0_sel);
 
-#endif
+#endif /* OPENOCD_TARGET_MIPS32_PRACC_H */