Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] sim/erc32/ max simulation time extended by using 64bit   ints
@ 2010-04-23 13:25 Tiemen Schut
  2010-04-23 20:28 ` Doug Evans
  0 siblings, 1 reply; 13+ messages in thread
From: Tiemen Schut @ 2010-04-23 13:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: joel.sherrill

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Hey all,

This patch solves the problem that the sparc instruction simulator (SIS) would hang after a few minutes of simulation time (time depending on speed of host pc), because of the use of 32 bit counters internally.

This patch doesn't change anything to simulator behaviour, except that it allows for longer simulation times.

There may be a problem with the use of 64 bit integers, but that was also there before this patch.

Thanks,

Tiemen Schut


[-- Attachment #2: sis-V3.diff --]
[-- Type: application/octet-stream, Size: 9232 bytes --]

Index: sim/erc32/ChangeLog
===================================================================
RCS file: /cvs/src/src/sim/erc32/ChangeLog,v
retrieving revision 1.31
diff -u -r1.31 ChangeLog
--- sim/erc32/ChangeLog	14 Apr 2010 07:38:04 -0000	1.31
+++ sim/erc32/ChangeLog	22 Apr 2010 13:45:22 -0000
@@ -1,3 +1,8 @@
+2010-04-20  Tiemen Schut    <T.Schut@sron.nl>
+
+	* sis.c, func.c, sis.h, interf.c: Increase max simulation time
+	by using uint64 for relevant counters.
+
 2010-04-14  Mike Frysinger  <vapier@gentoo.org>
 
 	* interp.c (sim_write): Add const to buf arg.
Index: sim/erc32/func.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/func.c,v
retrieving revision 1.4
diff -u -r1.4 func.c
--- sim/erc32/func.c	8 Jul 2005 08:04:54 -0000	1.4
+++ sim/erc32/func.c	22 Apr 2010 13:45:22 -0000
@@ -421,7 +421,7 @@
 	    }
 	} else if (strncmp(cmd1, "cont", clen) == 0) {
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 0);
 	    }
@@ -472,7 +472,7 @@
 	    if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) {
 		stat = run_sim(sregs, VAL(cmd2), 0);
 	    } else {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    }
 	    daddr = sregs->pc;
 	    sim_halt();
@@ -544,7 +544,7 @@
 	    reset_all();
 	    reset_stat(sregs);
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 0);
 	    }
@@ -560,7 +560,7 @@
 	    sim_halt();
 	} else if (strncmp(cmd1, "tcont", clen) == 0) {
 	    sregs->tlimit = limcalc(sregs->freq);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else if (strncmp(cmd1, "tgo", clen) == 0) {
@@ -573,7 +573,7 @@
 	    sregs->pc = len & ~3;
 	    sregs->npc = sregs->pc + 4;
 	    printf("resuming at 0x%08x\n",sregs->pc);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else if (strncmp(cmd1, "tlimit", clen) == 0) {
@@ -583,7 +583,7 @@
 		sregs->tlimit / sregs->freq / 1000);
 	} else if (strncmp(cmd1, "tra", clen) == 0) {
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 1);
+		stat = run_sim(sregs, UINT64_MAX, 1);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 1);
 	    }
@@ -595,7 +595,7 @@
 	    reset_all();
 	    reset_stat(sregs);
 	    sregs->tlimit = limcalc(sregs->freq);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else
@@ -833,7 +833,7 @@
 event(cfunc, arg, delta)
     void            (*cfunc) ();
     int32           arg;
-    uint32          delta;
+    uint64          delta;
 {
     struct evcell  *ev1, *evins;
 
@@ -900,7 +900,8 @@
 
     struct evcell  *evrem;
     void            (*cfunc) ();
-    uint32          arg, endtime;
+    uint32          arg;
+    uint64          endtime;
 
 #ifdef STAT
     sregs->fholdt += sregs->fhold;
@@ -938,7 +939,8 @@
 {
     struct evcell  *evrem;
     void            (*cfunc) ();
-    int32           arg, endtime;
+    int32           arg;
+    uint64          endtime;
 
     if (ebase.eq.nxt == NULL)
 	printf("Warning: event queue empty - power-down mode not entered\n");
Index: sim/erc32/interf.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/interf.c,v
retrieving revision 1.7
diff -u -r1.7 interf.c
--- sim/erc32/interf.c	14 Apr 2010 07:38:04 -0000	1.7
+++ sim/erc32/interf.c	22 Apr 2010 13:45:22 -0000
@@ -37,7 +37,7 @@
 
 #define PSR_CWP 0x7
 
-#define	VAL(x)	strtol(x,(char **)NULL,0)
+#define	VAL(x)	strtoull(x,(char **)NULL,0)
 
 extern struct disassemble_info dinfo;
 extern struct pstate sregs;
@@ -69,7 +69,7 @@
 int
 run_sim(sregs, icount, dis)
     struct pstate  *sregs;
-    unsigned int    icount;
+    uint64          icount;
     int             dis;
 {
     int             mexc, irq;
@@ -338,10 +338,10 @@
 
 int
 sim_fetch_register(sd, regno, buf, length)
-     SIM_DESC sd;
-    int             regno;
-    unsigned char  *buf;
-     int length;
+    SIM_DESC sd;
+    int regno;
+    unsigned char *buf;
+    int length;
 {
     get_regi(&sregs, regno, buf);
     return -1;
@@ -349,10 +349,10 @@
 
 int
 sim_write(sd, mem, buf, length)
-     SIM_DESC sd;
-    SIM_ADDR             mem;
+    SIM_DESC sd;
+    SIM_ADDR mem;
     const unsigned char  *buf;
-    int             length;
+    int length;
 {
     return (sis_memory_write(mem, buf, length));
 }
@@ -461,7 +461,7 @@
 void
 sim_resume(SIM_DESC sd, int step, int siggnal)
 {
-    simstat = run_sim(&sregs, -1, 0);
+    simstat = run_sim(&sregs, UINT64_MAX, 0);
 
     if (sis_gdb_break) flush_windows ();
 }
Index: sim/erc32/sis.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/sis.c,v
retrieving revision 1.3
diff -u -r1.3 sis.c
--- sim/erc32/sis.c	9 Jun 2008 22:55:27 -0000	1.3
+++ sim/erc32/sis.c	22 Apr 2010 13:45:22 -0000
@@ -82,7 +82,7 @@
 int
 run_sim(sregs, icount, dis)
     struct pstate  *sregs;
-    unsigned int    icount;
+    uint64          icount;
     int             dis;
 {
     int             irq, mexc, deb, asi;
Index: sim/erc32/sis.h
===================================================================
RCS file: /cvs/src/src/sim/erc32/sis.h,v
retrieving revision 1.2
diff -u -r1.2 sis.h
--- sim/erc32/sis.h	9 Jun 2002 15:45:46 -0000	1.2
+++ sim/erc32/sis.h	22 Apr 2010 13:45:22 -0000
@@ -23,6 +23,7 @@
 #include "ansidecl.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
+#include "stdint.h"
 
 #include "end.h"
 
@@ -52,8 +53,8 @@
 typedef double  float64;	/* 64-bit float */
 
 /* FIXME: what about host compilers that don't support 64-bit ints? */
-typedef unsigned long long uint64; /* 64-bit unsigned int */
-typedef long long int64;	/* 64-bit signed int */
+typedef uint64_t uint64; /* 64-bit unsigned int */
+typedef int64_t int64;	/* 64-bit signed int */
 
 struct pstate {
 
@@ -108,22 +109,22 @@
     float32         freq;	/* Simulated processor frequency */
 
 
-    uint32          tottime;
-    uint32          ninst;
-    uint32          fholdt;
-    uint32          holdt;
-    uint32          icntt;
-    uint32          finst;
-    uint32          simstart;
-    uint32          starttime;
-    uint32          tlimit;	/* Simulation time limit */
-    uint32          pwdtime;	/* Cycles in power-down mode */
-    uint32          nstore;	/* Number of load instructions */
-    uint32          nload;	/* Number of store instructions */
-    uint32          nannul;	/* Number of annuled instructions */
-    uint32          nbranch;	/* Number of branch instructions */
-    uint32          ildreg;	/* Destination of last load instruction */
-    uint32          ildtime;	/* Last time point for load dependency */
+    uint64          tottime;
+    uint64          ninst;
+    uint64          fholdt;
+    uint64          holdt;
+    uint64          icntt;
+    uint64          finst;
+    uint64          simstart;
+    uint64          starttime;
+    uint64          tlimit;	/* Simulation time limit */
+    uint64          pwdtime;	/* Cycles in power-down mode */
+    uint64          nstore;	/* Number of load instructions */
+    uint64          nload;	/* Number of store instructions */
+    uint64          nannul;	/* Number of annuled instructions */
+    uint64          nbranch;	/* Number of branch instructions */
+    uint64          ildreg;	/* Destination of last load instruction */
+    uint64          ildtime;	/* Last time point for load dependency */
 
     int             rett_err;	/* IU in jmpl/restore error state (Rev.0) */
     int             jmpltime;
@@ -132,14 +133,14 @@
 struct evcell {
     void            (*cfunc) ();
     int32           arg;
-    uint32          time;
+    uint64          time;
     struct evcell  *nxt;
 };
 
 struct estate {
     struct evcell   eq;
     struct evcell  *freeq;
-    uint32          simtime;
+    uint64          simtime;
 };
 
 struct irqcell {
@@ -186,7 +187,7 @@
 struct disassemble_info;
 extern void	dis_mem PARAMS ((uint32 addr, uint32 len,
 				 struct disassemble_info *info));
-extern void	event PARAMS ((void (*cfunc) (), int32 arg, uint32 delta));
+extern void	event PARAMS ((void (*cfunc) (), int32 arg, uint64 delta));
 extern void	set_int PARAMS ((int32 level, void (*callback) (), int32 arg));
 extern void	advance_time PARAMS ((struct pstate  *sregs));
 extern uint32	now PARAMS ((void));
@@ -205,7 +206,7 @@
 
 /* interf.c */
 extern int	run_sim PARAMS ((struct pstate *sregs,
-				 unsigned int icount, int dis));
+				 uint64 icount, int dis));
 
 /* float.c */
 extern int	get_accex PARAMS ((void));

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit   ints
  2010-04-23 13:25 [patch] sim/erc32/ max simulation time extended by using 64bit ints Tiemen Schut
@ 2010-04-23 20:28 ` Doug Evans
  2010-05-04 21:16   ` Joel Sherrill
  0 siblings, 1 reply; 13+ messages in thread
From: Doug Evans @ 2010-04-23 20:28 UTC (permalink / raw)
  To: Tiemen Schut; +Cc: gdb-patches, joel.sherrill

On Fri, Apr 23, 2010 at 6:25 AM, Tiemen Schut <T.Schut@sron.nl> wrote:
> Hey all,
>
> This patch solves the problem that the sparc instruction simulator (SIS) would hang after a few minutes of simulation time (time depending on speed of host pc), because of the use of 32 bit counters internally.
>
> This patch doesn't change anything to simulator behaviour, except that it allows for longer simulation times.
>
> There may be a problem with the use of 64 bit integers, but that was also there before this patch.
>
> Thanks,
>
> Tiemen Schut

Hi.

The patch is ok with me, with a few changes.
I'd leave it a week to see if anyone else has something to say.

1)

-#define	VAL(x)	strtol(x,(char **)NULL,0)
+#define	VAL(x)	strtoull(x,(char **)NULL,0)

I realize VAL is only used once in interf.c but it's also defined in
other files as well.
While one could consolidate them, having the macro at all is probably
less preferable to just calling strtoul{,l} directly.
I would just remove it from interf.c and call strtoull directly.

2)

@@ -338,10 +338,10 @@

 int
 sim_fetch_register(sd, regno, buf, length)
-     SIM_DESC sd;
-    int             regno;
-    unsigned char  *buf;
-     int length;
+    SIM_DESC sd;
+    int regno;
+    unsigned char *buf;
+    int length;
 {
     get_regi(&sregs, regno, buf);
     return -1;
@@ -349,10 +349,10 @@

 int
 sim_write(sd, mem, buf, length)
-     SIM_DESC sd;
-    SIM_ADDR             mem;
+    SIM_DESC sd;
+    SIM_ADDR mem;
     const unsigned char  *buf;
-    int             length;
+    int length;
 {
     return (sis_memory_write(mem, buf, length));
 }

Generally, formatting changes/fixes should be separate.  I noticed a
few, can you remove them?

3)

+#include "stdint.h"

That should be <stdint.h>

4)

-    uint32          ildreg;	/* Destination of last load instruction */
+    uint64          ildreg;	/* Destination of last load instruction */

No point in making this uint64, leave it as uint32.

5)

+	* sis.c, func.c, sis.h, interf.c: Increase max simulation time
+	by using uint64 for relevant counters.

I realize sim/erc32/ChangeLog doesn't always follow the GNU
conventions for ChangeLog entries - it's software obtained from
elsewhere.  It's ok with me to leave as is, but I defer to someone
else with an opinion.

6) I'm assuming this change has been well tested.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-04-23 20:28 ` Doug Evans
@ 2010-05-04 21:16   ` Joel Sherrill
  2010-05-07 17:48     ` Doug Evans
  2010-05-17  2:08     ` Joel Brobecker
  0 siblings, 2 replies; 13+ messages in thread
From: Joel Sherrill @ 2010-05-04 21:16 UTC (permalink / raw)
  To: Doug Evans; +Cc: Tiemen Schut, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 3691 bytes --]

Attached is V4.  Comments interspersed.

--joel

On 04/23/2010 03:28 PM, Doug Evans wrote:
> On Fri, Apr 23, 2010 at 6:25 AM, Tiemen Schut<T.Schut@sron.nl>  wrote:
>    
>> Hey all,
>>
>> This patch solves the problem that the sparc instruction simulator (SIS) would hang after a few minutes of simulation time (time depending on speed of host pc), because of the use of 32 bit counters internally.
>>
>> This patch doesn't change anything to simulator behaviour, except that it allows for longer simulation times.
>>
>> There may be a problem with the use of 64 bit integers, but that was also there before this patch.
>>
>> Thanks,
>>
>> Tiemen Schut
>>      
> Hi.
>
> The patch is ok with me, with a few changes.
> I'd leave it a week to see if anyone else has something to say.
>
>    
I am trying to help address these.
> 1)
>
> -#define	VAL(x)	strtol(x,(char **)NULL,0)
> +#define	VAL(x)	strtoull(x,(char **)NULL,0)
>
> I realize VAL is only used once in interf.c but it's also defined in
> other files as well.
> While one could consolidate them, having the macro at all is probably
> less preferable to just calling strtoul{,l} directly.
> I would just remove it from interf.c and call strtoull directly.
>    
I have fixed this in interf.c.  But didn't touch the other files.
Is this OK?

I can do a second patch after this is merged if you want VAL killed.
> 2)
>
> @@ -338,10 +338,10 @@
>
>   int
>   sim_fetch_register(sd, regno, buf, length)
> -     SIM_DESC sd;
> -    int             regno;
> -    unsigned char  *buf;
> -     int length;
> +    SIM_DESC sd;
> +    int regno;
> +    unsigned char *buf;
> +    int length;
>   {
>       get_regi(&sregs, regno, buf);
>       return -1;
> @@ -349,10 +349,10 @@
>
>   int
>   sim_write(sd, mem, buf, length)
> -     SIM_DESC sd;
> -    SIM_ADDR             mem;
> +    SIM_DESC sd;
> +    SIM_ADDR mem;
>       const unsigned char  *buf;
> -    int             length;
> +    int length;
>   {
>       return (sis_memory_write(mem, buf, length));
>   }
>
> Generally, formatting changes/fixes should be separate.  I noticed a
> few, can you remove them?
>    
The ones you are citing above are my fault.  I used a
very new version of gcc to compile this when checking
his patch and it complained.  I got near the code and
fixed it. Sorry.
> 3)
>
> +#include "stdint.h"
>
> That should be<stdint.h>
>    
Fixed.
> 4)
>
> -    uint32          ildreg;	/* Destination of last load instruction */
> +    uint64          ildreg;	/* Destination of last load instruction */
>
> No point in making this uint64, leave it as uint32.
>
>    
Fixed.
> 5)
>
> +	* sis.c, func.c, sis.h, interf.c: Increase max simulation time
> +	by using uint64 for relevant counters.
>
> I realize sim/erc32/ChangeLog doesn't always follow the GNU
> conventions for ChangeLog entries - it's software obtained from
> elsewhere.  It's ok with me to leave as is, but I defer to someone
> else with an opinion.
>
>    
What specifically are you noticing here?

I looked around and didn't spot anything too offensive.

FWIW Doug I think you have a script which is helping with
your ChangeLog entries and it has (or had) a bug.  Look
at this one from sim/ChangeLog:

2010-02-11  Doug Evans <dje@sebabeach.org>

     * cris/cpuv10.h, * cris/cpuv32.h, * cris/cris-desc.c,
     * cris/cris-desc.h, * cris/decodev10.c, * cris/decodev32.c,
     * cris/modelv10.c, * cris/modelv32.c, * cris/semcrisv10f-switch.c,
     * cris/semcrisv32f-switch.c: Regenerate.

I don't think there should be a ", *" between the files. :-D

My helper script has its own oddities. LOL
> 6) I'm assuming this change has been well tested.
>    
I've used it for RTEMS testing.

--joel
RTEMS

[-- Attachment #2: sis-V4.diff --]
[-- Type: text/plain, Size: 10187 bytes --]

Index: sim/erc32/ChangeLog
===================================================================
RCS file: /cvs/src/src/sim/erc32/ChangeLog,v
retrieving revision 1.31
diff -u -r1.31 ChangeLog
--- sim/erc32/ChangeLog	14 Apr 2010 07:38:04 -0000	1.31
+++ sim/erc32/ChangeLog	4 May 2010 21:14:55 -0000
@@ -1,3 +1,9 @@
+2010-04-20  Tiemen Schut    <T.Schut@sron.nl>
+
+	* erc32.c, sis.c, func.c, sis.h, interf.c: Increase max simulation
+	time by using uint64 for relevant counters.  Change prototype
+	of sis_memory_write() to const unsigned char *.
+
 2010-04-14  Mike Frysinger  <vapier@gentoo.org>
 
 	* interp.c (sim_write): Add const to buf arg.
Index: sim/erc32/erc32.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/erc32.c,v
retrieving revision 1.2
diff -u -r1.2 erc32.c
--- sim/erc32/erc32.c	11 Nov 2008 22:20:54 -0000	1.2
+++ sim/erc32/erc32.c	4 May 2010 21:14:55 -0000
@@ -1860,9 +1860,9 @@
 
 int
 sis_memory_write(addr, data, length)
-    uint32          addr;
-    char           *data;
-    uint32          length;
+    uint32               addr;
+    const unsigned char *data;
+    uint32               length;
 {
     char           *mem;
 
Index: sim/erc32/func.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/func.c,v
retrieving revision 1.4
diff -u -r1.4 func.c
--- sim/erc32/func.c	8 Jul 2005 08:04:54 -0000	1.4
+++ sim/erc32/func.c	4 May 2010 21:14:55 -0000
@@ -421,7 +421,7 @@
 	    }
 	} else if (strncmp(cmd1, "cont", clen) == 0) {
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 0);
 	    }
@@ -472,7 +472,7 @@
 	    if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) {
 		stat = run_sim(sregs, VAL(cmd2), 0);
 	    } else {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    }
 	    daddr = sregs->pc;
 	    sim_halt();
@@ -544,7 +544,7 @@
 	    reset_all();
 	    reset_stat(sregs);
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 0);
+		stat = run_sim(sregs, UINT64_MAX, 0);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 0);
 	    }
@@ -560,7 +560,7 @@
 	    sim_halt();
 	} else if (strncmp(cmd1, "tcont", clen) == 0) {
 	    sregs->tlimit = limcalc(sregs->freq);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else if (strncmp(cmd1, "tgo", clen) == 0) {
@@ -573,7 +573,7 @@
 	    sregs->pc = len & ~3;
 	    sregs->npc = sregs->pc + 4;
 	    printf("resuming at 0x%08x\n",sregs->pc);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else if (strncmp(cmd1, "tlimit", clen) == 0) {
@@ -583,7 +583,7 @@
 		sregs->tlimit / sregs->freq / 1000);
 	} else if (strncmp(cmd1, "tra", clen) == 0) {
 	    if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
-		stat = run_sim(sregs, -1, 1);
+		stat = run_sim(sregs, UINT64_MAX, 1);
 	    } else {
 		stat = run_sim(sregs, VAL(cmd1), 1);
 	    }
@@ -595,7 +595,7 @@
 	    reset_all();
 	    reset_stat(sregs);
 	    sregs->tlimit = limcalc(sregs->freq);
-	    stat = run_sim(sregs, -1, 0);
+	    stat = run_sim(sregs, UINT64_MAX, 0);
 	    daddr = sregs->pc;
 	    sim_halt();
 	} else
@@ -833,7 +833,7 @@
 event(cfunc, arg, delta)
     void            (*cfunc) ();
     int32           arg;
-    uint32          delta;
+    uint64          delta;
 {
     struct evcell  *ev1, *evins;
 
@@ -900,7 +900,8 @@
 
     struct evcell  *evrem;
     void            (*cfunc) ();
-    uint32          arg, endtime;
+    uint32          arg;
+    uint64          endtime;
 
 #ifdef STAT
     sregs->fholdt += sregs->fhold;
@@ -938,7 +939,8 @@
 {
     struct evcell  *evrem;
     void            (*cfunc) ();
-    int32           arg, endtime;
+    int32           arg;
+    uint64          endtime;
 
     if (ebase.eq.nxt == NULL)
 	printf("Warning: event queue empty - power-down mode not entered\n");
Index: sim/erc32/interf.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/interf.c,v
retrieving revision 1.7
diff -u -r1.7 interf.c
--- sim/erc32/interf.c	14 Apr 2010 07:38:04 -0000	1.7
+++ sim/erc32/interf.c	4 May 2010 21:14:55 -0000
@@ -37,8 +37,6 @@
 
 #define PSR_CWP 0x7
 
-#define	VAL(x)	strtol(x,(char **)NULL,0)
-
 extern struct disassemble_info dinfo;
 extern struct pstate sregs;
 extern struct estate ebase;
@@ -69,7 +67,7 @@
 int
 run_sim(sregs, icount, dis)
     struct pstate  *sregs;
-    unsigned int    icount;
+    uint64          icount;
     int             dis;
 {
     int             mexc, irq;
@@ -234,7 +232,7 @@
 	    } else
 	    if (strcmp(argv[stat], "-freq") == 0) {
 		if ((stat + 1) < argc) {
-		    freq = VAL(argv[++stat]);
+		    freq = strtol(argv[++stat], (char **)NULL, 0);
 		}
 	    } else {
 		(*sim_callback->printf_filtered) (sim_callback,
@@ -338,10 +336,10 @@
 
 int
 sim_fetch_register(sd, regno, buf, length)
-     SIM_DESC sd;
-    int             regno;
-    unsigned char  *buf;
-     int length;
+    SIM_DESC sd;
+    int regno;
+    unsigned char *buf;
+    int length;
 {
     get_regi(&sregs, regno, buf);
     return -1;
@@ -349,10 +347,10 @@
 
 int
 sim_write(sd, mem, buf, length)
-     SIM_DESC sd;
-    SIM_ADDR             mem;
+    SIM_DESC sd;
+    SIM_ADDR mem;
     const unsigned char  *buf;
-    int             length;
+    int length;
 {
     return (sis_memory_write(mem, buf, length));
 }
@@ -461,7 +459,7 @@
 void
 sim_resume(SIM_DESC sd, int step, int siggnal)
 {
-    simstat = run_sim(&sregs, -1, 0);
+    simstat = run_sim(&sregs, UINT64_MAX, 0);
 
     if (sis_gdb_break) flush_windows ();
 }
Index: sim/erc32/sis.c
===================================================================
RCS file: /cvs/src/src/sim/erc32/sis.c,v
retrieving revision 1.3
diff -u -r1.3 sis.c
--- sim/erc32/sis.c	9 Jun 2008 22:55:27 -0000	1.3
+++ sim/erc32/sis.c	4 May 2010 21:14:55 -0000
@@ -82,7 +82,7 @@
 int
 run_sim(sregs, icount, dis)
     struct pstate  *sregs;
-    unsigned int    icount;
+    uint64          icount;
     int             dis;
 {
     int             irq, mexc, deb, asi;
Index: sim/erc32/sis.h
===================================================================
RCS file: /cvs/src/src/sim/erc32/sis.h,v
retrieving revision 1.2
diff -u -r1.2 sis.h
--- sim/erc32/sis.h	9 Jun 2002 15:45:46 -0000	1.2
+++ sim/erc32/sis.h	4 May 2010 21:14:55 -0000
@@ -23,6 +23,7 @@
 #include "ansidecl.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
+#include <stdint.h>
 
 #include "end.h"
 
@@ -52,8 +53,8 @@
 typedef double  float64;	/* 64-bit float */
 
 /* FIXME: what about host compilers that don't support 64-bit ints? */
-typedef unsigned long long uint64; /* 64-bit unsigned int */
-typedef long long int64;	/* 64-bit signed int */
+typedef uint64_t uint64; /* 64-bit unsigned int */
+typedef int64_t int64;	/* 64-bit signed int */
 
 struct pstate {
 
@@ -108,22 +109,22 @@
     float32         freq;	/* Simulated processor frequency */
 
 
-    uint32          tottime;
-    uint32          ninst;
-    uint32          fholdt;
-    uint32          holdt;
-    uint32          icntt;
-    uint32          finst;
-    uint32          simstart;
-    uint32          starttime;
-    uint32          tlimit;	/* Simulation time limit */
-    uint32          pwdtime;	/* Cycles in power-down mode */
-    uint32          nstore;	/* Number of load instructions */
-    uint32          nload;	/* Number of store instructions */
-    uint32          nannul;	/* Number of annuled instructions */
-    uint32          nbranch;	/* Number of branch instructions */
+    uint64          tottime;
+    uint64          ninst;
+    uint64          fholdt;
+    uint64          holdt;
+    uint64          icntt;
+    uint64          finst;
+    uint64          simstart;
+    uint64          starttime;
+    uint64          tlimit;	/* Simulation time limit */
+    uint64          pwdtime;	/* Cycles in power-down mode */
+    uint64          nstore;	/* Number of load instructions */
+    uint64          nload;	/* Number of store instructions */
+    uint64          nannul;	/* Number of annuled instructions */
+    uint64          nbranch;	/* Number of branch instructions */
     uint32          ildreg;	/* Destination of last load instruction */
-    uint32          ildtime;	/* Last time point for load dependency */
+    uint64          ildtime;	/* Last time point for load dependency */
 
     int             rett_err;	/* IU in jmpl/restore error state (Rev.0) */
     int             jmpltime;
@@ -132,14 +133,14 @@
 struct evcell {
     void            (*cfunc) ();
     int32           arg;
-    uint32          time;
+    uint64          time;
     struct evcell  *nxt;
 };
 
 struct estate {
     struct evcell   eq;
     struct evcell  *freeq;
-    uint32          simtime;
+    uint64          simtime;
 };
 
 struct irqcell {
@@ -168,8 +169,8 @@
 				     int32 sz, int32 *ws));
 extern int	memory_write PARAMS ((int32 asi, uint32 addr, uint32 *data,
 				    int32 sz, int32 *ws));
-extern int	sis_memory_write PARAMS ((uint32 addr, char *data,
-					  uint32 length));
+extern int	sis_memory_write PARAMS ((uint32 addr,
+				    const unsigned char *data, uint32 length));
 extern int	sis_memory_read PARAMS ((uint32 addr, char *data,
 					 uint32 length));
 
@@ -186,7 +187,7 @@
 struct disassemble_info;
 extern void	dis_mem PARAMS ((uint32 addr, uint32 len,
 				 struct disassemble_info *info));
-extern void	event PARAMS ((void (*cfunc) (), int32 arg, uint32 delta));
+extern void	event PARAMS ((void (*cfunc) (), int32 arg, uint64 delta));
 extern void	set_int PARAMS ((int32 level, void (*callback) (), int32 arg));
 extern void	advance_time PARAMS ((struct pstate  *sregs));
 extern uint32	now PARAMS ((void));
@@ -205,7 +206,7 @@
 
 /* interf.c */
 extern int	run_sim PARAMS ((struct pstate *sregs,
-				 unsigned int icount, int dis));
+				 uint64 icount, int dis));
 
 /* float.c */
 extern int	get_accex PARAMS ((void));

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-04 21:16   ` Joel Sherrill
@ 2010-05-07 17:48     ` Doug Evans
  2010-05-17  2:08     ` Joel Brobecker
  1 sibling, 0 replies; 13+ messages in thread
From: Doug Evans @ 2010-05-07 17:48 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: Tiemen Schut, gdb-patches

On Tue, May 4, 2010 at 2:16 PM, Joel Sherrill <joel.sherrill@oarcorp.com> wrote:
>> 1)
>>
>> -#define        VAL(x)  strtol(x,(char **)NULL,0)
>> +#define        VAL(x)  strtoull(x,(char **)NULL,0)
>>
>> I realize VAL is only used once in interf.c but it's also defined in
>> other files as well.
>> While one could consolidate them, having the macro at all is probably
>> less preferable to just calling strtoul{,l} directly.
>> I would just remove it from interf.c and call strtoull directly.
>>
>
> I have fixed this in interf.c.  But didn't touch the other files.
> Is this OK?

Sure.

> I can do a second patch after this is merged if you want VAL killed.

Naaa, no need.

>> 2)
>>
>> @@ -338,10 +338,10 @@
>>
>>  int
>>  sim_fetch_register(sd, regno, buf, length)
>> -     SIM_DESC sd;
>> -    int             regno;
>> -    unsigned char  *buf;
>> -     int length;
>> +    SIM_DESC sd;
>> +    int regno;
>> +    unsigned char *buf;
>> +    int length;
>>  {
>>      get_regi(&sregs, regno, buf);
>>      return -1;
>> @@ -349,10 +349,10 @@
>>
>>  int
>>  sim_write(sd, mem, buf, length)
>> -     SIM_DESC sd;
>> -    SIM_ADDR             mem;
>> +    SIM_DESC sd;
>> +    SIM_ADDR mem;
>>      const unsigned char  *buf;
>> -    int             length;
>> +    int length;
>>  {
>>      return (sis_memory_write(mem, buf, length));
>>  }
>>
>> Generally, formatting changes/fixes should be separate.  I noticed a
>> few, can you remove them?
>>
>
> The ones you are citing above are my fault.  I used a
> very new version of gcc to compile this when checking
> his patch and it complained.  I got near the code and
> fixed it. Sorry.

I'm not sure what gcc complained about, but it's not important.
I noticed the whitespace changes are still there.  Am I looking at the
wrong patch?
btw, there's no need for another iteration of approvals just for that.

>> 3)
>>
>> +#include "stdint.h"
>>
>> That should be<stdint.h>
>>
>
> Fixed.

Thanks.

>>
>> 4)
>>
>> -    uint32          ildreg;    /* Destination of last load instruction */
>> +    uint64          ildreg;    /* Destination of last load instruction */
>>
>> No point in making this uint64, leave it as uint32.
>>
>>
>
> Fixed.

Thanks.

>>
>> 5)
>>
>> +       * sis.c, func.c, sis.h, interf.c: Increase max simulation time
>> +       by using uint64 for relevant counters.
>>
>> I realize sim/erc32/ChangeLog doesn't always follow the GNU
>> conventions for ChangeLog entries - it's software obtained from
>> elsewhere.  It's ok with me to leave as is, but I defer to someone
>> else with an opinion.
>>
>>
>
> What specifically are you noticing here?
>
> I looked around and didn't spot anything too offensive.

For reference sake,
compare that entry with, for example, this one:

2010-04-19  Doug Evans  <dje@google.com>

        * ser-base.c (generic_readchar): Watch for EOF in read of error_fd.
        * ser-pipe.c (pipe_open): Fix file descriptor leaks.
        (pipe_close): Ditto.

Note that there's a separate entry for each function changed.
But as I say, I wouldn't insist on this for erc32.

> FWIW Doug I think you have a script which is helping with
> your ChangeLog entries and it has (or had) a bug.  Look
> at this one from sim/ChangeLog:
>
> 2010-02-11  Doug Evans <dje@sebabeach.org>
>
>    * cris/cpuv10.h, * cris/cpuv32.h, * cris/cris-desc.c,
>    * cris/cris-desc.h, * cris/decodev10.c, * cris/decodev32.c,
>    * cris/modelv10.c, * cris/modelv32.c, * cris/semcrisv10f-switch.c,
>    * cris/semcrisv32f-switch.c: Regenerate.
>
> I don't think there should be a ", *" between the files. :-D

I loathe having one line per file, where each line says the same thing.
Too low an S/N ratio for my tastes, especially with a lot of files. :-(
So I copied a style I saw in opcodes.
If Alan [Modra] can do that in opcodes, I can do that in the sims.
[And thank goodness. :-)]

>
> My helper script has its own oddities. LOL
>>
>> 6) I'm assuming this change has been well tested.
>>
>
> I've used it for RTEMS testing.

Cool.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-04 21:16   ` Joel Sherrill
  2010-05-07 17:48     ` Doug Evans
@ 2010-05-17  2:08     ` Joel Brobecker
  2010-05-17  3:23       ` Joel Sherrill
                         ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Joel Brobecker @ 2010-05-17  2:08 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: Doug Evans, Tiemen Schut, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

Hey guys,

> Index: sim/erc32/sis.h
> ===================================================================
> RCS file: /cvs/src/src/sim/erc32/sis.h,v
> retrieving revision 1.2
> diff -u -r1.2 sis.h
> --- sim/erc32/sis.h	9 Jun 2002 15:45:46 -0000	1.2
> +++ sim/erc32/sis.h	4 May 2010 21:14:55 -0000
> @@ -23,6 +23,7 @@
>  #include "ansidecl.h"
>  #include "gdb/callback.h"
>  #include "gdb/remote-sim.h"
> +#include <stdint.h>

Unfortunately, this change breaks the build when stdint.h is not
available (Eg. sparc-solaris).

Apparently, this header was included for 2 things:
  - define two 64bit types int64 and uint64;
  - have UINT64_MAX.

I assume that the requirement was for 64bit minimum, as opposed to
exactly 64bit? Making that assumption, we can remove the need for
including stdint.h by using long long instead of int64_t (same thing
for the unsigned counterpart).  Similarly, UINT64_MAX has a well defined
value reguardless of the platform, so it can easily be defined as well.
Looking at the rest of the type definitions above, it's actually in line
with what's been done so far.

Joel: Would that work for you as well?

Doug: Would that be OK to commit? I think that the cleanest thing to do
      here would be to have some configury that would provide our own
      stdint.h when missing.  We already do that for GDB by using gnulib
      so perhaps one way to do so would be to share the gnulib between
      GDB and the sim (probably meaning moving it to the root directory).

PS: We have the same problem with rx sim, I believe. I haven't tried
    building it, though.

-- 
Joel

[-- Attachment #2: erc32-sim.diff --]
[-- Type: text/x-diff, Size: 1115 bytes --]

Fix erc32 sim build failure due to missing stdint.h.

2010-05-16  Joel Brobecker  <brobecker@adacore.com>

        * sis.h: Remove #include <stdint.h>.
        (uint64, int64): Redefine without using stdint.h.
        (UINT64_MAX): Define.

Modified: trunk/gdb/gdb-head/sim/erc32/sis.h
===================================================================
--- trunk/gdb/gdb-head/sim/erc32/sis.h	2010-05-17 01:21:31 UTC (rev 163986)
+++ trunk/gdb/gdb-head/sim/erc32/sis.h	2010-05-17 01:41:06 UTC (rev 163987)
@@ -23,7 +23,6 @@
 #include "ansidecl.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
-#include <stdint.h>
 
 #include "end.h"
 
@@ -53,9 +52,11 @@
 typedef double  float64;	/* 64-bit float */
 
 /* FIXME: what about host compilers that don't support 64-bit ints? */
-typedef uint64_t uint64; /* 64-bit unsigned int */
-typedef int64_t int64;	/* 64-bit signed int */
+typedef unsigned long long uint64; /* 64-bit unsigned int */
+typedef long long int64;	   /* 64-bit signed int */
 
+#define UINT64_MAX 18446744073709551615ULL
+
 struct pstate {
 
     float64         fd[16];	/* FPU registers */

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-17  2:08     ` Joel Brobecker
@ 2010-05-17  3:23       ` Joel Sherrill
  2010-05-17 16:37       ` Doug Evans
  2010-05-20 23:13       ` Joel Brobecker
  2 siblings, 0 replies; 13+ messages in thread
From: Joel Sherrill @ 2010-05-17  3:23 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tiemen Schut, gdb-patches

On 05/16/2010 08:57 PM, Joel Brobecker wrote:
> Hey guys,
>
>    
>> Index: sim/erc32/sis.h
>> ===================================================================
>> RCS file: /cvs/src/src/sim/erc32/sis.h,v
>> retrieving revision 1.2
>> diff -u -r1.2 sis.h
>> --- sim/erc32/sis.h	9 Jun 2002 15:45:46 -0000	1.2
>> +++ sim/erc32/sis.h	4 May 2010 21:14:55 -0000
>> @@ -23,6 +23,7 @@
>>   #include "ansidecl.h"
>>   #include "gdb/callback.h"
>>   #include "gdb/remote-sim.h"
>> +#include<stdint.h>
>>      
> Unfortunately, this change breaks the build when stdint.h is not
> available (Eg. sparc-solaris).
>
> Apparently, this header was included for 2 things:
>    - define two 64bit types int64 and uint64;
>    - have UINT64_MAX.
>
> I assume that the requirement was for 64bit minimum, as opposed to
> exactly 64bit? Making that assumption, we can remove the need for
> including stdint.h by using long long instead of int64_t (same thing
> for the unsigned counterpart).  Similarly, UINT64_MAX has a well defined
> value reguardless of the platform, so it can easily be defined as well.
> Looking at the rest of the type definitions above, it's actually in line
> with what's been done so far.
>
> Joel: Would that work for you as well?
>    
Sure. I don't have a problem with that.

RTEMS has all the C99 types and we are just in the habit of using them.

--joel
> Doug: Would that be OK to commit? I think that the cleanest thing to do
>        here would be to have some configury that would provide our own
>        stdint.h when missing.  We already do that for GDB by using gnulib
>        so perhaps one way to do so would be to share the gnulib between
>        GDB and the sim (probably meaning moving it to the root directory).
>
> PS: We have the same problem with rx sim, I believe. I haven't tried
>      building it, though.
>
>    


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-17  2:08     ` Joel Brobecker
  2010-05-17  3:23       ` Joel Sherrill
@ 2010-05-17 16:37       ` Doug Evans
  2010-05-17 16:59         ` Joel Brobecker
  2010-05-20 23:13       ` Joel Brobecker
  2 siblings, 1 reply; 13+ messages in thread
From: Doug Evans @ 2010-05-17 16:37 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Joel Sherrill, Tiemen Schut, gdb-patches

On Sun, May 16, 2010 at 6:57 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> Hey guys,
>
>> Index: sim/erc32/sis.h
>> ===================================================================
>> RCS file: /cvs/src/src/sim/erc32/sis.h,v
>> retrieving revision 1.2
>> diff -u -r1.2 sis.h
>> --- sim/erc32/sis.h   9 Jun 2002 15:45:46 -0000       1.2
>> +++ sim/erc32/sis.h   4 May 2010 21:14:55 -0000
>> @@ -23,6 +23,7 @@
>>  #include "ansidecl.h"
>>  #include "gdb/callback.h"
>>  #include "gdb/remote-sim.h"
>> +#include <stdint.h>
>
> Unfortunately, this change breaks the build when stdint.h is not
> available (Eg. sparc-solaris).

How old is this solaris?

OTOH, gdb/defs.h unconditionally includes stdint.h (I think I checked
it at the time, so I approved the patch) so I'm confused.

> Apparently, this header was included for 2 things:
>  - define two 64bit types int64 and uint64;
>  - have UINT64_MAX.
>
> I assume that the requirement was for 64bit minimum, as opposed to
> exactly 64bit? Making that assumption, we can remove the need for
> including stdint.h by using long long instead of int64_t (same thing
> for the unsigned counterpart).  Similarly, UINT64_MAX has a well defined
> value reguardless of the platform, so it can easily be defined as well.
> Looking at the rest of the type definitions above, it's actually in line
> with what's been done so far.
>
> Joel: Would that work for you as well?
>
> Doug: Would that be OK to commit? I think that the cleanest thing to do
>      here would be to have some configury that would provide our own
>      stdint.h when missing.  We already do that for GDB by using gnulib
>      so perhaps one way to do so would be to share the gnulib between
>      GDB and the sim (probably meaning moving it to the root directory).

For reference sake, there's bfd_stdint.h generated by
config/stdint.m4.  I don't know all that it handles, but again gdb
itself just includes stdint.h unconditionally.

> PS: We have the same problem with rx sim, I believe. I haven't tried
>    building it, though.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit ints
  2010-05-17 16:37       ` Doug Evans
@ 2010-05-17 16:59         ` Joel Brobecker
  0 siblings, 0 replies; 13+ messages in thread
From: Joel Brobecker @ 2010-05-17 16:59 UTC (permalink / raw)
  To: Doug Evans; +Cc: Joel Sherrill, Tiemen Schut, gdb-patches

> > Unfortunately, this change breaks the build when stdint.h is not
> > available (Eg. sparc-solaris).
> 
> How old is this solaris?

It's solaris 2.8.

> > Doug: Would that be OK to commit? I think that the cleanest thing to do
> >      here would be to have some configury that would provide our own
> >      stdint.h when missing.  We already do that for GDB by using gnulib
> >      so perhaps one way to do so would be to share the gnulib between
> >      GDB and the sim (probably meaning moving it to the root directory).
> 
> For reference sake, there's bfd_stdint.h generated by
> config/stdint.m4.  I don't know all that it handles, but again gdb
> itself just includes stdint.h unconditionally.

This is because GDB relies on gnulib providing stdint.h for us if
the system doesn't already provide it.  See gdb/gnulib/.

-- 
Joel


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-17  2:08     ` Joel Brobecker
  2010-05-17  3:23       ` Joel Sherrill
  2010-05-17 16:37       ` Doug Evans
@ 2010-05-20 23:13       ` Joel Brobecker
  2010-05-21 13:47         ` Joel Sherrill
  2 siblings, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2010-05-20 23:13 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: Doug Evans, Tiemen Schut, gdb-patches

> 2010-05-16  Joel Brobecker  <brobecker@adacore.com>
> 
>         * sis.h: Remove #include <stdint.h>.
>         (uint64, int64): Redefine without using stdint.h.
>         (UINT64_MAX): Define.

FYI: I just checked that one in.

-- 
Joel


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-20 23:13       ` Joel Brobecker
@ 2010-05-21 13:47         ` Joel Sherrill
  2010-05-21 15:06           ` Joel Brobecker
  0 siblings, 1 reply; 13+ messages in thread
From: Joel Sherrill @ 2010-05-21 13:47 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tiemen Schut, gdb-patches

On 05/20/2010 06:10 PM, Joel Brobecker wrote:
>> 2010-05-16  Joel Brobecker<brobecker@adacore.com>
>>
>>          * sis.h: Remove #include<stdint.h>.
>>          (uint64, int64): Redefine without using stdint.h.
>>          (UINT64_MAX): Define.
>>      
> FYI: I just checked that one in.
>
>    
Doug do you still want that VAL -> strtol/ll change?

--joel


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-21 13:47         ` Joel Sherrill
@ 2010-05-21 15:06           ` Joel Brobecker
  2010-05-21 15:15             ` Joel Sherrill
  0 siblings, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2010-05-21 15:06 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: Doug Evans, Tiemen Schut, gdb-patches

> >>         * sis.h: Remove #include<stdint.h>.
> >>         (uint64, int64): Redefine without using stdint.h.
> >>         (UINT64_MAX): Define.
> >FYI: I just checked that one in.
> >
> Doug do you still want that VAL -> strtol/ll change?

Can you provide more info, which change is that?

-- 
Joel


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-21 15:06           ` Joel Brobecker
@ 2010-05-21 15:15             ` Joel Sherrill
  2010-05-21 17:13               ` Doug Evans
  0 siblings, 1 reply; 13+ messages in thread
From: Joel Sherrill @ 2010-05-21 15:15 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tiemen Schut, gdb-patches

On 05/21/2010 10:05 AM, Joel Brobecker wrote:
>>>>          * sis.h: Remove #include<stdint.h>.
>>>>          (uint64, int64): Redefine without using stdint.h.
>>>>          (UINT64_MAX): Define.
>>>>          
>>> FYI: I just checked that one in.
>>>
>>>        
>> Doug do you still want that VAL ->  strtol/ll change?
>>      
> Can you provide more info, which change is that?
>    
Doug seemed to want to get rid of the "VAL" macros
in the sim/erc32 source code.  I handled one file in
this patch because it was only used once in the file
and it seemed silly to even have the macro.  The other
two files had more uses so I wanted to wait until
the maximum time to 64 bits was committed.

Here is his comment

    1)

    -#define	VAL(x)	strtol(x,(char **)NULL,0)
    +#define	VAL(x)	strtoull(x,(char **)NULL,0)


    I realize VAL is only used once in interf.c but it's also defined in
    other files as well.
    While one could consolidate them, having the macro at all is probably
    less preferable to just calling strtoul{,l} directly.
    I would just remove it from interf.c and call strtoull directly.

I have fixed this in interf.c.  But didn't touch the other files.
Is this OK?


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [patch] sim/erc32/ max simulation time extended by using 64bit  ints
  2010-05-21 15:15             ` Joel Sherrill
@ 2010-05-21 17:13               ` Doug Evans
  0 siblings, 0 replies; 13+ messages in thread
From: Doug Evans @ 2010-05-21 17:13 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: Joel Brobecker, Tiemen Schut, gdb-patches

On Fri, May 21, 2010 at 8:14 AM, Joel Sherrill
<joel.sherrill@oarcorp.com> wrote:
> On 05/21/2010 10:05 AM, Joel Brobecker wrote:
>>>>>
>>>>>         * sis.h: Remove #include<stdint.h>.
>>>>>         (uint64, int64): Redefine without using stdint.h.
>>>>>         (UINT64_MAX): Define.
>>>>>
>>>>
>>>> FYI: I just checked that one in.
>>>>
>>>>
>>>
>>> Doug do you still want that VAL ->  strtol/ll change?
>>>
>>
>> Can you provide more info, which change is that?
>>
>
> Doug seemed to want to get rid of the "VAL" macros
> in the sim/erc32 source code.  I handled one file in
> this patch because it was only used once in the file
> and it seemed silly to even have the macro.  The other
> two files had more uses so I wanted to wait until
> the maximum time to 64 bits was committed.
>
> Here is his comment
>
>   1)
>
>   -#define     VAL(x)  strtol(x,(char **)NULL,0)
>   +#define     VAL(x)  strtoull(x,(char **)NULL,0)
>
>
>   I realize VAL is only used once in interf.c but it's also defined in
>   other files as well.
>   While one could consolidate them, having the macro at all is probably
>   less preferable to just calling strtoul{,l} directly.
>   I would just remove it from interf.c and call strtoull directly.
>
> I have fixed this in interf.c.  But didn't touch the other files.
> Is this OK?

I only mentioned it because the original patch changed its definition
and instead of doing that it seemed better to just get rid of it.
But it's not critical or anything, just "IWBN".


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-05-21 16:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-23 13:25 [patch] sim/erc32/ max simulation time extended by using 64bit ints Tiemen Schut
2010-04-23 20:28 ` Doug Evans
2010-05-04 21:16   ` Joel Sherrill
2010-05-07 17:48     ` Doug Evans
2010-05-17  2:08     ` Joel Brobecker
2010-05-17  3:23       ` Joel Sherrill
2010-05-17 16:37       ` Doug Evans
2010-05-17 16:59         ` Joel Brobecker
2010-05-20 23:13       ` Joel Brobecker
2010-05-21 13:47         ` Joel Sherrill
2010-05-21 15:06           ` Joel Brobecker
2010-05-21 15:15             ` Joel Sherrill
2010-05-21 17:13               ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox