This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Add micromips support to the MIPS simulator


> > No, they are required for some of the macros used in the file so they need
> to
> > stay in.
> 
> this needs to be documented as to why.  other ports don't need this, and
> it sounds like something wrong with the mips port that should be fixed at
> some point.

The definitions come from the *_support.h files generated by igen and are required 
because they are used in some of the macros in the micromipsrun.c file.  
Unfortunately we can not just blindly include the *_support.h files to get these 
definitions because some of the defines in these files are specific for a particular 
configuration of the simulator for example instruction word size is 16 bits for 
micromips16 and 32 bits for micromips32.  This means we could break future code 
changes by doing this, so a safer approach is to just extract the defines that 
we need to get the file to compile.  

I have added a comment above the defines which explains this.  The diff from my
previous patch is below.

Ok to commit?

Many thanks,



Andrew


diff --git a/sim/mips/micromipsrun.c b/sim/mips/micromipsrun.c
index 7dd10d7..c39138b 100644
--- a/sim/mips/micromipsrun.c
+++ b/sim/mips/micromipsrun.c
@@ -26,6 +26,14 @@
 #include "bfd.h"
 #include "sim-engine.h"
 
+/* These definitions come from the *_support.h files generated by igen and are
+   required because they are used in some of the macros in the code below.
+   Unfortunately we can not just blindly include the *_support.h files to get
+   these definitions because some of the defines in these files are specific
+   for a particular configuration of the simulator for example instruction word
+   size is 16 bits for micromips16 and 32 bits for micromips32.  This means we
+   could break future code changes by doing this, so a safer approach is to just
+   extract the defines that we need to get this file to compile.  */
 #define SD sd
 #define CPU cpu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]