* d10v-dis.c: Fix formatting.
[deliverable/binutils-gdb.git] / gdb / dve3900-rom.c
index 60a177dbed1963482571862014814d7bf94469a8..feb8e12001a9c72c37113985075260b045b2b731 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote debugging interface for Densan DVE-R3900 ROM monitor for
    GDB, the GNU debugger.
-   Copyright 1997 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "command.h"
 #include "gdb_string.h"
 #include <time.h>
+#include "regcache.h"
 
 /* Type of function passed to bfd_map_over_sections.  */
 
-typedef void (*section_map_func) PARAMS ((bfd * abfd, asection * sect, PTR obj));
+typedef void (*section_map_func) (bfd * abfd, asection * sect, PTR obj);
 
 /* Packet escape character used by Densan monitor.  */
 
@@ -44,8 +45,7 @@ typedef void (*section_map_func) PARAMS ((bfd * abfd, asection * sect, PTR obj))
 
 /* External functions.  */
 
-extern void report_transfer_performance PARAMS ((unsigned long,
-                                                time_t, time_t));
+extern void report_transfer_performance (unsigned long, time_t, time_t);
 
 /* Certain registers are "bitmapped", in that the monitor can only display
    them or let the user modify them as a series of named bitfields.
@@ -62,36 +62,32 @@ struct bit_field
 
 /* Local functions for register manipulation.  */
 
-static void r3900_supply_register PARAMS ((char *regname, int regnamelen,
-                                          char *val, int vallen));
-static void fetch_bad_vaddr PARAMS ((void));
-static unsigned long fetch_fields PARAMS ((struct bit_field * bf));
-static void fetch_bitmapped_register PARAMS ((int regno,
-                                             struct bit_field * bf));
-static void r3900_fetch_registers PARAMS ((int regno));
-static void store_bitmapped_register PARAMS ((int regno,
-                                             struct bit_field * bf));
-static void r3900_store_registers PARAMS ((int regno));
+static void r3900_supply_register (char *regname, int regnamelen,
+                                  char *val, int vallen);
+static void fetch_bad_vaddr (void);
+static unsigned long fetch_fields (struct bit_field *bf);
+static void fetch_bitmapped_register (int regno, struct bit_field *bf);
+static void r3900_fetch_registers (int regno);
+static void store_bitmapped_register (int regno, struct bit_field *bf);
+static void r3900_store_registers (int regno);
 
 /* Local functions for fast binary loading.  */
 
-static void write_long PARAMS ((char *buf, long n));
-static void write_long_le PARAMS ((char *buf, long n));
-static int debug_readchar PARAMS ((int hex));
-static void debug_write PARAMS ((unsigned char *buf, int buflen));
-static void ignore_packet PARAMS ((void));
-static void send_packet PARAMS ((char type, unsigned char *buf, int buflen,
-                                int seq));
-static void process_read_request PARAMS ((unsigned char *buf, int buflen));
-static void count_section PARAMS ((bfd * abfd, asection * s,
-                                  unsigned int *section_count));
-static void load_section PARAMS ((bfd * abfd, asection * s,
-                                 unsigned int *data_count));
-static void r3900_load PARAMS ((char *filename, int from_tty));
+static void write_long (char *buf, long n);
+static void write_long_le (char *buf, long n);
+static int debug_readchar (int hex);
+static void debug_write (unsigned char *buf, int buflen);
+static void ignore_packet (void);
+static void send_packet (char type, unsigned char *buf, int buflen, int seq);
+static void process_read_request (unsigned char *buf, int buflen);
+static void count_section (bfd * abfd, asection * s,
+                          unsigned int *section_count);
+static void load_section (bfd * abfd, asection * s, unsigned int *data_count);
+static void r3900_load (char *filename, int from_tty);
 
 /* Miscellaneous local functions.  */
 
-static void r3900_open PARAMS ((char *args, int from_tty));
+static void r3900_open (char *args, int from_tty);
 
 
 /* Pointers to static functions in monitor.c for fetching and storing
@@ -100,13 +96,13 @@ static void r3900_open PARAMS ((char *args, int from_tty));
    format, and those that can't be modified at all.  In those cases
    we have to use our own functions to fetch and store their values.  */
 
-static void (*orig_monitor_fetch_registers) PARAMS ((int regno));
-static void (*orig_monitor_store_registers) PARAMS ((int regno));
+static void (*orig_monitor_fetch_registers) (int regno);
+static void (*orig_monitor_store_registers) (int regno);
 
 /* Pointer to static function in monitor. for loading programs.
    We use this function for loading S-records via the serial link.  */
 
-static void (*orig_monitor_load) PARAMS ((char *file, int from_tty));
+static void (*orig_monitor_load) (char *file, int from_tty);
 
 /* This flag is set if a fast ethernet download should be used.  */
 
@@ -378,11 +374,7 @@ static struct bit_field cause_fields[] =
    the hex value before passing it to monitor_supply_register.  */
 
 static void
-r3900_supply_register (regname, regnamelen, val, vallen)
-     char *regname;
-     int regnamelen;
-     char *val;
-     int vallen;
+r3900_supply_register (char *regname, int regnamelen, char *val, int vallen)
 {
   int regno = -1;
   int i;
@@ -421,7 +413,7 @@ r3900_supply_register (regname, regnamelen, val, vallen)
    you modify it.  */
 
 static void
-fetch_bad_vaddr ()
+fetch_bad_vaddr (void)
 {
   char buf[20];
 
@@ -436,8 +428,7 @@ fetch_bad_vaddr ()
    combined binary value.  */
 
 static unsigned long
-fetch_fields (bf)
-     struct bit_field *bf;
+fetch_fields (struct bit_field *bf)
 {
   char buf[20];
   unsigned long val = 0;
@@ -461,9 +452,7 @@ fetch_fields (bf)
 
 
 static void
-fetch_bitmapped_register (regno, bf)
-     int regno;
-     struct bit_field *bf;
+fetch_bitmapped_register (int regno, struct bit_field *bf)
 {
   unsigned long val;
   unsigned char regbuf[MAX_REGISTER_RAW_SIZE];
@@ -487,8 +476,7 @@ fetch_bitmapped_register (regno, bf)
    a very unusual fashion by the monitor, and must be handled specially.  */
 
 static void
-r3900_fetch_registers (regno)
-     int regno;
+r3900_fetch_registers (int regno)
 {
   switch (regno)
     {
@@ -510,9 +498,7 @@ r3900_fetch_registers (regno)
 /* Write the new value of the bitmapped register to the monitor.  */
 
 static void
-store_bitmapped_register (regno, bf)
-     int regno;
-     struct bit_field *bf;
+store_bitmapped_register (int regno, struct bit_field *bf)
 {
   unsigned long oldval, newval;
 
@@ -542,8 +528,7 @@ store_bitmapped_register (regno, bf)
 
 
 static void
-r3900_store_registers (regno)
-     int regno;
+r3900_store_registers (int regno)
 {
   switch (regno)
     {
@@ -562,9 +547,7 @@ r3900_store_registers (regno)
 /* Write a 4-byte integer to the buffer in big-endian order.  */
 
 static void
-write_long (buf, n)
-     char *buf;
-     long n;
+write_long (char *buf, long n)
 {
   buf[0] = (n >> 24) & 0xff;
   buf[1] = (n >> 16) & 0xff;
@@ -576,9 +559,7 @@ write_long (buf, n)
 /* Write a 4-byte integer to the buffer in little-endian order.  */
 
 static void
-write_long_le (buf, n)
-     char *buf;
-     long n;
+write_long_le (char *buf, long n)
 {
   buf[0] = n & 0xff;
   buf[1] = (n >> 8) & 0xff;
@@ -592,8 +573,7 @@ write_long_le (buf, n)
    character in hexadecimal; otherwise, print it in ASCII.  */
 
 static int
-debug_readchar (hex)
-     int hex;
+debug_readchar (int hex)
 {
   char buf[10];
   int c = monitor_readchar ();
@@ -619,9 +599,7 @@ debug_readchar (hex)
    print the sent buffer in hex.  */
 
 static void
-debug_write (buf, buflen)
-     unsigned char *buf;
-     int buflen;
+debug_write (unsigned char *buf, int buflen)
 {
   char s[10];
 
@@ -654,7 +632,7 @@ debug_write (buf, buflen)
  */
 
 static void
-ignore_packet ()
+ignore_packet (void)
 {
   int c;
   int len;
@@ -693,10 +671,7 @@ ignore_packet ()
  */
 
 static void
-send_packet (type, buf, buflen, seq)
-     char type;
-     unsigned char *buf;
-     int buflen, seq;
+send_packet (char type, unsigned char *buf, int buflen, int seq)
 {
   unsigned char hdr[4];
   int len = buflen;
@@ -769,9 +744,7 @@ send_packet (type, buf, buflen, seq)
  */
 
 static void
-process_read_request (buf, buflen)
-     unsigned char *buf;
-     int buflen;
+process_read_request (unsigned char *buf, int buflen)
 {
   unsigned char len[4];
   int i, chunk;
@@ -807,10 +780,7 @@ process_read_request (buf, buflen)
 /* Count loadable sections (helper function for r3900_load).  */
 
 static void
-count_section (abfd, s, section_count)
-     bfd *abfd;
-     asection *s;
-     unsigned int *section_count;
+count_section (bfd *abfd, asection *s, unsigned int *section_count)
 {
   if (s->flags & SEC_LOAD && bfd_section_size (abfd, s) != 0)
     (*section_count)++;
@@ -832,10 +802,7 @@ count_section (abfd, s, section_count)
  */
 
 static void
-load_section (abfd, s, data_count)
-     bfd *abfd;
-     asection *s;
-     unsigned int *data_count;
+load_section (bfd *abfd, asection *s, unsigned int *data_count)
 {
   if (s->flags & SEC_LOAD)
     {
@@ -867,7 +834,7 @@ load_section (abfd, s, data_count)
       buffer = (unsigned char *) xmalloc (section_size);
       bfd_get_section_contents (abfd, s, buffer, 0, section_size);
       process_read_request (buffer, section_size);
-      free (buffer);
+      xfree (buffer);
     }
 }
 
@@ -891,9 +858,7 @@ load_section (abfd, s, data_count)
  */
 
 static void
-r3900_load (filename, from_tty)
-     char *filename;
-     int from_tty;
+r3900_load (char *filename, int from_tty)
 {
   bfd *abfd;
   unsigned int data_count = 0;
@@ -962,7 +927,7 @@ r3900_load (filename, from_tty)
   if (exec_bfd)
     write_pc (bfd_get_start_address (exec_bfd));
 
-  inferior_pid = 0;            /* No process now */
+  inferior_ptid = null_ptid;           /* No process now */
 
   /* This is necessary because many things were based on the PC at the
      time that we attached to the monitor, which is no longer valid
@@ -995,9 +960,7 @@ static struct target_ops r3900_ops;
 static struct monitor_ops r3900_cmds;
 
 static void
-r3900_open (args, from_tty)
-     char *args;
-     int from_tty;
+r3900_open (char *args, int from_tty)
 {
   char buf[64];
   int i;
@@ -1028,7 +991,7 @@ r3900_open (args, from_tty)
 }
 
 void
-_initialize_r3900_rom ()
+_initialize_r3900_rom (void)
 {
   r3900_cmds.flags = MO_NO_ECHO_ON_OPEN |
     MO_ADDR_BITS_REMOVE |
This page took 0.028356 seconds and 4 git commands to generate.