aboutsummaryrefslogtreecommitdiff
path: root/gdb/ocd.h
diff options
context:
space:
mode:
authorGeoffrey Noer <noer@cygnus>1997-08-07 06:31:46 +0000
committerGeoffrey Noer <noer@cygnus>1997-08-07 06:31:46 +0000
commit35ce4f08131b8de3b177971297076a3a2609bab5 (patch)
treea10f4618cae75287820133933a6e8486da1df4af /gdb/ocd.h
parent3d18ed7d46260a9b4e7cf4b4d2b0546427a75d10 (diff)
downloadgdb-35ce4f08131b8de3b177971297076a3a2609bab5.zip
gdb-35ce4f08131b8de3b177971297076a3a2609bab5.tar.gz
gdb-35ce4f08131b8de3b177971297076a3a2609bab5.tar.bz2
Wed Aug 6 16:15:31 1997 Geoffrey Noer <noer@cygnus.com>
* Makefile.in: add DLLTOOL = @DLLTOOL@, pass on DLLTOOL to sub makes, change clean rule to also remove *.a to remove libwigglers.a, in dependencies: add ppc-bdm.o ocd.o ser-ocd.o and remove remote-wiggler.o * configure.in: add DLLTOOL support * configure: regenerate * wigglers.def: new file for imports for wigglers.dll * ser-ocd.c: new file which is layer between ocd.c and either the wigglers.dll or the target box, only stub so far * config/powerpc/ppc-eabi.mt: add ppc-bdm.o to TDEPFILES * config/powerpc/ppc-sim.mt: add ppc-bdm.o to TDEPFILES * config/i386/cygwin32.mh: add ocd.o ser-ocd.o libwigglers.a to XDEPFILES, add rules to build libwigglers.a checking in changes of Stu Grossman <grossman@cygnus.com>: * remote-wiggler.c: delete * ocd.c: new, was remote-wiggler.c always include sys/types.h, include ocd.h, move WIGGLER commands and many wiggler prototypes to ocd.h, make wiggler_desc static, stop making local wiggler functions static, define write_mem_command for wiggler_write_bytes (wiggler_start_remote): stop hardcoding the target type, instead set and use a target_type variable. (wiggler_open): add new target_type and ops args (wiggler_wait): now no longer takes pid and target_status as args, stop trying to set target_status struct, remove BGND insn checks (read_bdm_registers): renamed to wiggler_read_bdm_registers (wiggler_read_bdm_registers): numregs arg changed to reglen arg, remove pktlen check, set reglen instead of numregs (dump_all_bdm_regs): delete (wiggler_fetch_registers): delete (wiggler_prepare_to_store): now just an empty function (wiggler_store_registers): delete (wiggler_read_bdm_register): new (wiggler_write_bdm_registers): new (wiggler_write_bdm_register): new (wiggler_write_bytes): use write_mem_command variable instead of WIGGLER_WRITE_MEM (get_packet): renamed to wiggler_get_packet, change refs throughout (put_packet): renamed to wiggler_put_packet, change refs throughout (wiggler_get_packet): add break to default case of switch, change length of WIGGLER_GET_VERSION len to 10 from 4 to match specs (wiggler_mourn): unpush_target with current_ops, not &wiggler_ops (flash_xfer_memory): delete (noop_store_registers): new placeholder replacement for target_store_registers() which prevents generic_load from trying to set up the PC. (bdm_update_flash_command): add store_registers_tmp variable, make handling of wiggler_ops more generic -- define wiggler_ops in a target-specific file instead (such as ppc-bdm.c in the case of the ppc), use current_target to deal with registers again making this file less target-specific. (bdm_read_register_command): new (_initialize_remote_wiggler): stop doing add_target (&wiggler_ops), comment out add_cmd ("read-register", ...) * ocd.h: new, contains common wiggler prototypes, command definitions * ppc-bdm.c: file for ppc-specific OCD code, including target_ops structure for ppc bdm (bdm_ppc_open): new (bdm_ppc_wait): new (bdm_ppc_fetch_registers): new (bdm_ppc_store_registers_: new (_initialize_bdm_ppc): new * config/powerpc/tm-ppc-eabi.h: add necessary CPU32 BDM defines
Diffstat (limited to 'gdb/ocd.h')
-rw-r--r--gdb/ocd.h132
1 files changed, 132 insertions, 0 deletions
diff --git a/gdb/ocd.h b/gdb/ocd.h
new file mode 100644
index 0000000..a8e0494
--- /dev/null
+++ b/gdb/ocd.h
@@ -0,0 +1,132 @@
+/* Definitions for the Macraigor Systems BDM Wiggler
+ Copyright 1996, 1997 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef WIGGLER_H
+#define WIGGLER_H
+
+/* Wiggler serial protocol definitions */
+
+#define DLE 020 /* Quote char */
+#define SYN 026 /* Start of packet */
+#define RAW_SYN ((026 << 8) | 026) /* get_quoted_char found a naked SYN */
+
+/* Status flags */
+
+#define WIGGLER_FLAG_RESET 0x01 /* Target is being reset */
+#define WIGGLER_FLAG_STOPPED 0x02 /* Target is halted */
+#define WIGGLER_FLAG_BDM 0x04 /* Target is in BDM */
+#define WIGGLER_FLAG_PWF 0x08 /* Power failed */
+#define WIGGLER_FLAG_CABLE_DISC 0x10 /* BDM cable disconnected */
+
+/* Commands */
+
+#define WIGGLER_AYT 0x0 /* Are you there? */
+#define WIGGLER_GET_VERSION 0x1 /* Get Version */
+#define WIGGLER_SET_BAUD_RATE 0x2 /* Set Baud Rate */
+#define WIGGLER_INIT 0x10 /* Initialize Wiggler */
+#define WIGGLER_SET_SPEED 0x11 /* Set Speed */
+#define WIGGLER_GET_STATUS_MASK 0x12 /* Get Status Mask */
+#define WIGGLER_GET_CTRS 0x13 /* Get Error Counters */
+#define WIGGLER_SET_FUNC_CODE 0x14 /* Set Function Code */
+#define WIGGLER_SET_CTL_FLAGS 0x15 /* Set Control Flags */
+#define WIGGLER_SET_BUF_ADDR 0x16 /* Set Register Buffer Address */
+#define WIGGLER_RUN 0x20 /* Run Target from PC */
+#define WIGGLER_RUN_ADDR 0x21 /* Run Target from Specified Address */
+#define WIGGLER_STOP 0x22 /* Stop Target */
+#define WIGGLER_RESET_RUN 0x23 /* Reset Target and Run */
+#define WIGGLER_RESET 0x24 /* Reset Target and Halt */
+#define WIGGLER_STEP 0x25 /* Single step */
+#define WIGGLER_READ_REGS 0x30 /* Read Registers */
+#define WIGGLER_WRITE_REGS 0x31 /* Write Registers */
+#define WIGGLER_READ_MEM 0x32 /* Read Memory */
+#define WIGGLER_WRITE_MEM 0x33 /* Write Memory */
+#define WIGGLER_FILL_MEM 0x34 /* Fill Memory */
+#define WIGGLER_MOVE_MEM 0x35 /* Move Memory */
+
+#define WIGGLER_READ_INT_MEM 0x80 /* Read Internal Memory */
+#define WIGGLER_WRITE_INT_MEM 0x81 /* Write Internal Memory */
+#define WIGGLER_JUMP 0x82 /* Jump to Subroutine */
+
+#define WIGGLER_ERASE_FLASH 0x90 /* Erase flash memory */
+#define WIGGLER_PROGRAM_FLASH 0x91 /* Write flash memory */
+#define WIGGLER_EXIT_MON 0x93 /* Exit the flash programming monitor */
+#define WIGGLER_ENTER_MON 0x94 /* Enter the flash programming monitor */
+
+#define WIGGLER_SET_STATUS 0x0a /* Set status */
+#define WIGGLER_FLAG_STOP 0x0 /* Stop the target, enter BDM */
+#define WIGGLER_FLAG_START 0x01 /* Start the target at PC */
+#define WIGGLER_FLAG_RETURN_STATUS 0x04 /* Return async status */
+
+/* Target type (for WIGGLER_INIT command) */
+
+enum wiggler_target_type {
+ WIGGLER_TARGET_CPU32=0x0, /* Moto cpu32 family */
+ WIGGLER_TARGET_CPU16=0x1,
+ WIGGLER_TARGET_MOTO_PPC=0x2, /* Motorola PPC 5xx/8xx */
+ WIGGLER_TARGET_IBM_PPC=0x3}; /* IBM PPC 4xx */
+
+void wiggler_open PARAMS ((char *name, int from_tty, enum wiggler_target_type,
+ struct target_ops *ops));
+
+void wiggler_close PARAMS ((int quitting));
+
+void wiggler_detach PARAMS ((char *args, int from_tty));
+
+void wiggler_resume PARAMS ((int pid, int step, enum target_signal siggnal));
+
+void wiggler_prepare_to_store PARAMS ((void));
+
+void wiggler_stop PARAMS ((void));
+
+void wiggler_files_info PARAMS ((struct target_ops *ignore));
+
+
+int wiggler_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr,
+ int len, int should_write,
+ struct target_ops *target));
+
+void wiggler_mourn PARAMS ((void));
+
+void wiggler_create_inferior PARAMS ((char *exec_file,
+ char *args,
+ char **env));
+
+int wiggler_thread_alive PARAMS ((int th));
+
+void wiggler_error PARAMS ((char *s, int error_code));
+
+void wiggler_kill PARAMS ((void));
+
+void wiggler_load PARAMS((char *args, int from_tty));
+
+unsigned char * wiggler_read_bdm_registers PARAMS ((int first_bdm_regno,
+ int last_bdm_regno,
+ int *reglen));
+
+CORE_ADDR wiggler_read_bdm_register PARAMS ((int bdm_regno));
+
+void wiggler_write_bdm_registers PARAMS ((int first_bdm_regno,
+ unsigned char *regptr,
+ int reglen));
+
+void wiggler_write_bdm_register PARAMS ((int bdm_regno, CORE_ADDR reg));
+
+int wiggler_wait PARAMS ((void));
+
+#endif /* WIGGLER_H */