sim: ppc: track closed state of file descriptors 0, 1, and 2.
[deliverable/binutils-gdb.git] / sim / h8300 / sim-main.h
index 6acf901d5de0ca8fa9ba53e432778011fd04d049..6dbc1ac1c2b2475af14999ed8a7827bdee9ca5c9 100644 (file)
@@ -1,5 +1,6 @@
 /* Main header for the Hitachi h8/300 architecture.  */
 
+#include "config.h"
 #include "bfd.h"
 
 #ifndef SIM_MAIN_H
@@ -27,7 +28,7 @@
 /* avolkov: 
    Next 2 macros are ugly for any workstation, but while they're work.
    Memory size MUST be configurable.  */
-#define H8300H_MSIZE (1 << 18
+#define H8300H_MSIZE (1 << 24
 #define H8300S_MSIZE (1 << 24) 
 
 #define CSIZE 1024
@@ -86,10 +87,6 @@ enum h8_typecodes {
 };
 
 #include "sim-basics.h"
-
-/* Define sim_cia.  */
-typedef unsigned32 sim_cia;
-
 #include "sim-base.h"
 
 /* Structure used to describe addressing */
@@ -137,7 +134,7 @@ struct _sim_cpu {
 
 /* The sim_state struct.  */
 struct sim_state {
-  struct _sim_cpu *cpu;
+  sim_cpu *cpu[MAX_NR_PROCESSORS];
   unsigned int sim_cache_size;
   decoded_inst *sim_cache;
   unsigned short *cache_idx;
@@ -152,9 +149,6 @@ struct sim_state {
 
 /* The current state of the processor; registers, memory, etc.  */
 
-#define CIA_GET(CPU)           (cpu_get_pc (CPU))
-#define CIA_SET(CPU, VAL)      (cpu_set_pc ((CPU), (VAL)))
-#define STATE_CPU(SD, N)       ((SD)->cpu)     /* Single Processor.  */
 #define cpu_set_pc(CPU, VAL)   (((CPU)->pc)  = (VAL))
 #define cpu_get_pc(CPU)                (((CPU)->pc))
 
@@ -164,7 +158,9 @@ struct sim_state {
 /* Local version of macros for decoding exit status.  
    (included here rather than try to find target version of wait.h)
 */
-#define SIM_WIFEXITED(V) (((V) & 0xff) == 0)
-#define SIM_WEXITSTATUS(V) ((V) >> 8)
+#define SIM_WIFEXITED(V)       (((V) & 0xff) == 0)
+#define SIM_WIFSTOPPED(V)      (!SIM_WIFEXITED (V))
+#define SIM_WEXITSTATUS(V)     (((V) >> 8) & 0xff)
+#define SIM_WSTOPSIG(V)                ((V) & 0x7f)
 
 #endif /* SIM_MAIN_H */
This page took 0.026167 seconds and 4 git commands to generate.