From: Alexandre Oliva <aoliva@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: AM33/2.0 support for mn10300-elf
Date: Sat, 26 Jun 2004 22:00:00 -0000 [thread overview]
Message-ID: <orn02qq94o.fsf@livre.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: <3F2BC9F5.5040100@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
On Aug 2, 2003, Andrew Cagney <ac131313@redhat.com> wrote:
> The code needs to use strict ISO C. It might be easier to just
> convert everything.
This patch completes the conversion of the current code in sim/mn10300
to ISO C. I'm checking it in as obvious.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mn10300-sim-isoc.patch --]
[-- Type: text/x-patch, Size: 7520 bytes --]
Index: sim/mn10300/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* interp.c, mn10300_sim.h, op_utils.c: Convert function prototypes
and definitions to ISO C.
Index: sim/mn10300/interp.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/interp.c,v
retrieving revision 1.3
diff -u -p -r1.3 interp.c
--- sim/mn10300/interp.c 26 Jun 2004 18:45:53 -0000 1.3
+++ sim/mn10300/interp.c 26 Jun 2004 21:50:02 -0000
@@ -47,12 +47,11 @@ enum {
};
static SIM_RC
-mn10300_option_handler (sd, cpu, opt, arg, is_command)
- SIM_DESC sd;
- sim_cpu *cpu;
- int opt;
- char *arg;
- int is_command;
+mn10300_option_handler (SIM_DESC sd,
+ sim_cpu *cpu,
+ int opt,
+ char *arg,
+ int is_command)
{
int cpu_nr;
switch (opt)
@@ -88,11 +87,10 @@ SIM_DESC simulator;
/* These default values correspond to expected usage for the chip. */
SIM_DESC
-sim_open (kind, cb, abfd, argv)
- SIM_OPEN_KIND kind;
- host_callback *cb;
- struct bfd *abfd;
- char **argv;
+sim_open (SIM_OPEN_KIND kind,
+ host_callback *cb,
+ struct bfd *abfd,
+ char **argv)
{
SIM_DESC sd = sim_state_alloc (kind, cb);
mn10300_callback = cb;
@@ -304,20 +302,17 @@ sim_open (kind, cb, abfd, argv)
void
-sim_close (sd, quitting)
- SIM_DESC sd;
- int quitting;
+sim_close (SIM_DESC sd, int quitting)
{
sim_module_uninstall (sd);
}
SIM_RC
-sim_create_inferior (sd, prog_bfd, argv, env)
- SIM_DESC sd;
- struct bfd *prog_bfd;
- char **argv;
- char **env;
+sim_create_inferior (SIM_DESC sd,
+ struct bfd *prog_bfd,
+ char **argv,
+ char **env)
{
memset (&State, 0, sizeof (State));
if (prog_bfd != NULL) {
@@ -331,9 +326,7 @@ sim_create_inferior (sd, prog_bfd, argv,
}
void
-sim_do_command (sd, cmd)
- SIM_DESC sd;
- char *cmd;
+sim_do_command (SIM_DESC sd, char *cmd)
{
char *mm_cmd = "memory-map";
char *int_cmd = "interrupt";
@@ -353,41 +346,34 @@ sim_do_command (sd, cmd)
but need to be changed to use the memory map. */
uint8
-get_byte (x)
- uint8 *x;
+get_byte (uint8 *x)
{
return *x;
}
uint16
-get_half (x)
- uint8 *x;
+get_half (uint8 *x)
{
uint8 *a = x;
return (a[1] << 8) + (a[0]);
}
uint32
-get_word (x)
- uint8 *x;
+get_word (uint8 *x)
{
uint8 *a = x;
return (a[3]<<24) + (a[2]<<16) + (a[1]<<8) + (a[0]);
}
void
-put_byte (addr, data)
- uint8 *addr;
- uint8 data;
+put_byte (uint8 *addr, uint8 data)
{
uint8 *a = addr;
a[0] = data;
}
void
-put_half (addr, data)
- uint8 *addr;
- uint16 data;
+put_half (uint8 *addr, uint16 data)
{
uint8 *a = addr;
a[0] = data & 0xff;
@@ -395,9 +381,7 @@ put_half (addr, data)
}
void
-put_word (addr, data)
- uint8 *addr;
- uint32 data;
+put_word (uint8 *addr, uint32 data)
{
uint8 *a = addr;
a[0] = data & 0xff;
@@ -407,22 +391,20 @@ put_word (addr, data)
}
int
-sim_fetch_register (sd, rn, memory, length)
- SIM_DESC sd;
- int rn;
- unsigned char *memory;
- int length;
+sim_fetch_register (SIM_DESC sd,
+ int rn,
+ unsigned char *memory,
+ int length)
{
put_word (memory, State.regs[rn]);
return -1;
}
int
-sim_store_register (sd, rn, memory, length)
- SIM_DESC sd;
- int rn;
- unsigned char *memory;
- int length;
+sim_store_register (SIM_DESC sd,
+ int rn,
+ unsigned char *memory,
+ int length)
{
State.regs[rn] = get_word (memory);
return -1;
@@ -431,13 +413,13 @@ sim_store_register (sd, rn, memory, leng
void
mn10300_core_signal (SIM_DESC sd,
- sim_cpu *cpu,
- sim_cia cia,
- unsigned map,
- int nr_bytes,
- address_word addr,
- transfer_type transfer,
- sim_core_signals sig)
+ sim_cpu *cpu,
+ sim_cia cia,
+ unsigned map,
+ int nr_bytes,
+ address_word addr,
+ transfer_type transfer,
+ sim_core_signals sig)
{
const char *copy = (transfer == read_transfer ? "read" : "write");
address_word ip = CIA_ADDR (cia);
Index: sim/mn10300/mn10300_sim.h
===================================================================
RCS file: /cvs/src/src/sim/mn10300/mn10300_sim.h,v
retrieving revision 1.4
diff -u -p -r1.4 mn10300_sim.h
--- sim/mn10300/mn10300_sim.h 26 Jun 2004 18:45:53 -0000 1.4
+++ sim/mn10300/mn10300_sim.h 26 Jun 2004 21:50:02 -0000
@@ -161,32 +161,32 @@ sim_core_write_unaligned_4 (STATE_CPU (s
/* Function declarations. */
-uint32 get_word PARAMS ((uint8 *));
-uint16 get_half PARAMS ((uint8 *));
-uint8 get_byte PARAMS ((uint8 *));
-void put_word PARAMS ((uint8 *, uint32));
-void put_half PARAMS ((uint8 *, uint16));
-void put_byte PARAMS ((uint8 *, uint8));
+uint32 get_word (uint8 *);
+uint16 get_half (uint8 *);
+uint8 get_byte (uint8 *);
+void put_word (uint8 *, uint32);
+void put_half (uint8 *, uint16);
+void put_byte (uint8 *, uint8);
-extern uint8 *map PARAMS ((SIM_ADDR addr));
+extern uint8 *map (SIM_ADDR addr);
-INLINE_SIM_MAIN (void) genericAdd PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericSub PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericCmp PARAMS ((unsigned32 leftOpnd, unsigned32 rightOpnd));
-INLINE_SIM_MAIN (void) genericOr PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericXor PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericBtst PARAMS ((unsigned32 leftOpnd, unsigned32 rightOpnd));
-INLINE_SIM_MAIN (int) syscall_read_mem PARAMS ((host_callback *cb,
- struct cb_syscall *sc,
- unsigned long taddr,
- char *buf,
- int bytes));
-INLINE_SIM_MAIN (int) syscall_write_mem PARAMS ((host_callback *cb,
- struct cb_syscall *sc,
- unsigned long taddr,
- const char *buf,
- int bytes));
-INLINE_SIM_MAIN (void) do_syscall PARAMS ((void));
+INLINE_SIM_MAIN (void) genericAdd (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericSub (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericCmp (unsigned32 leftOpnd, unsigned32 rightOpnd);
+INLINE_SIM_MAIN (void) genericOr (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericXor (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericBtst (unsigned32 leftOpnd, unsigned32 rightOpnd);
+INLINE_SIM_MAIN (int) syscall_read_mem (host_callback *cb,
+ struct cb_syscall *sc,
+ unsigned long taddr,
+ char *buf,
+ int bytes);
+INLINE_SIM_MAIN (int) syscall_write_mem (host_callback *cb,
+ struct cb_syscall *sc,
+ unsigned long taddr,
+ const char *buf,
+ int bytes);
+INLINE_SIM_MAIN (void) do_syscall (void);
void program_interrupt (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, SIM_SIGNAL sig);
void mn10300_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc);
Index: sim/mn10300/op_utils.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/op_utils.c,v
retrieving revision 1.2
diff -u -p -r1.2 op_utils.c
--- sim/mn10300/op_utils.c 18 May 2000 22:56:28 -0000 1.2
+++ sim/mn10300/op_utils.c 26 Jun 2004 21:50:02 -0000
@@ -164,7 +164,7 @@ syscall_write_mem (host_callback *cb, st
/* syscall */
INLINE_SIM_MAIN (void)
-do_syscall ()
+do_syscall (void)
{
/* We use this for simulated system calls; we may need to change
[-- Attachment #3: Type: text/plain, Size: 188 bytes --]
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
next prev parent reply other threads:[~2004-06-26 22:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-10 3:10 Alexandre Oliva
2003-07-10 3:31 ` Alexandre Oliva
2003-07-10 4:59 ` Alexandre Oliva
2003-07-16 16:05 ` [Bug-dejagnu] " Rob Savoye
2003-07-22 20:02 ` Alexandre Oliva
2003-07-10 4:57 ` Alexandre Oliva
2003-08-02 14:26 ` Andrew Cagney
2004-06-21 13:59 ` Alexandre Oliva
2004-06-25 21:41 ` Andrew Cagney
2004-06-26 22:00 ` Alexandre Oliva
2004-06-26 22:00 ` Alexandre Oliva [this message]
2004-06-26 22:18 ` Alexandre Oliva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=orn02qq94o.fsf@livre.redhat.lsd.ic.unicamp.br \
--to=aoliva@redhat.com \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox