diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/d10v/gencode.c | 2 | ||||
-rw-r--r-- | sim/or1k/cpu.c | 32 | ||||
-rw-r--r-- | sim/or1k/cpu.h | 14 | ||||
-rw-r--r-- | sim/or1k/or1k.c | 4 | ||||
-rw-r--r-- | sim/or1k/traps.c | 2 | ||||
-rw-r--r-- | sim/testsuite/common/bits-tst.c | 5 |
6 files changed, 55 insertions, 4 deletions
diff --git a/sim/d10v/gencode.c b/sim/d10v/gencode.c index 3a37bac..763e2f5 100644 --- a/sim/d10v/gencode.c +++ b/sim/d10v/gencode.c @@ -150,5 +150,5 @@ write_opcodes (void) printf ("},\n"); } } - printf ("{ 0,0,0,0,0,0,0,(void (*)())0,0,{0,0,0}},\n};\n"); + printf ("{ 0,0,0,0,0,0,0,0,0,{0,0,0}},\n};\n"); } diff --git a/sim/or1k/cpu.c b/sim/or1k/cpu.c index c75e2a0..14e43cc 100644 --- a/sim/or1k/cpu.c +++ b/sim/or1k/cpu.c @@ -1100,6 +1100,38 @@ or1k32bf_h_sys_esr15_set (SIM_CPU *current_cpu, USI newval) SET_H_SYS_ESR15 (newval); } +/* Get the value of h-sys-coreid. */ + +USI +or1k32bf_h_sys_coreid_get (SIM_CPU *current_cpu) +{ + return GET_H_SYS_COREID (); +} + +/* Set a value for h-sys-coreid. */ + +void +or1k32bf_h_sys_coreid_set (SIM_CPU *current_cpu, USI newval) +{ + SET_H_SYS_COREID (newval); +} + +/* Get the value of h-sys-numcores. */ + +USI +or1k32bf_h_sys_numcores_get (SIM_CPU *current_cpu) +{ + return GET_H_SYS_NUMCORES (); +} + +/* Set a value for h-sys-numcores. */ + +void +or1k32bf_h_sys_numcores_set (SIM_CPU *current_cpu, USI newval) +{ + SET_H_SYS_NUMCORES (newval); +} + /* Get the value of h-sys-gpr0. */ USI diff --git a/sim/or1k/cpu.h b/sim/or1k/cpu.h index 7f8a340..ab2c062 100644 --- a/sim/or1k/cpu.h +++ b/sim/or1k/cpu.h @@ -408,6 +408,16 @@ SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_ESR14), (x));\ do { \ SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_ESR15), (x));\ ;} while (0) +#define GET_H_SYS_COREID() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_COREID)) +#define SET_H_SYS_COREID(x) \ +do { \ +SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_COREID), (x));\ +;} while (0) +#define GET_H_SYS_NUMCORES() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_NUMCORES)) +#define SET_H_SYS_NUMCORES(x) \ +do { \ +SET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_NUMCORES), (x));\ +;} while (0) #define GET_H_SYS_GPR0() GET_H_SPR (ORSI (SLLSI (SPR_GROUP_SYS, 11), SPR_INDEX_SYS_GPR0)) #define SET_H_SYS_GPR0(x) \ do { \ @@ -3379,6 +3389,10 @@ USI or1k32bf_h_sys_esr14_get (SIM_CPU *); void or1k32bf_h_sys_esr14_set (SIM_CPU *, USI); USI or1k32bf_h_sys_esr15_get (SIM_CPU *); void or1k32bf_h_sys_esr15_set (SIM_CPU *, USI); +USI or1k32bf_h_sys_coreid_get (SIM_CPU *); +void or1k32bf_h_sys_coreid_set (SIM_CPU *, USI); +USI or1k32bf_h_sys_numcores_get (SIM_CPU *); +void or1k32bf_h_sys_numcores_set (SIM_CPU *, USI); USI or1k32bf_h_sys_gpr0_get (SIM_CPU *); void or1k32bf_h_sys_gpr0_set (SIM_CPU *, USI); USI or1k32bf_h_sys_gpr1_get (SIM_CPU *); diff --git a/sim/or1k/or1k.c b/sim/or1k/or1k.c index 2d1f7f8..73ab6f0 100644 --- a/sim/or1k/or1k.c +++ b/sim/or1k/or1k.c @@ -206,6 +206,10 @@ or1k_cpu_init (SIM_DESC sd, sim_cpu *current_cpu, const USI or1k_vr, /* Clear the floating point control status register. */ SET_H_SYS_FPCSR (0); + + /* Set this as the one and only core. */ + SET_H_SYS_NUMCORES (1); + SET_H_SYS_COREID (0); } void diff --git a/sim/or1k/traps.c b/sim/or1k/traps.c index 753bfff..d1113ac 100644 --- a/sim/or1k/traps.c +++ b/sim/or1k/traps.c @@ -224,6 +224,8 @@ or1k32bf_mfspr (sim_cpu *current_cpu, USI addr) case SPR_ADDR (SYS, PPC): case SPR_ADDR (SYS, FPCSR): case SPR_ADDR (SYS, EPCR0): + case SPR_ADDR (SYS, COREID): + case SPR_ADDR (SYS, NUMCORES): case SPR_ADDR (MAC, MACLO): case SPR_ADDR (MAC, MACHI): break; diff --git a/sim/testsuite/common/bits-tst.c b/sim/testsuite/common/bits-tst.c index a30753e..95ca450 100644 --- a/sim/testsuite/common/bits-tst.c +++ b/sim/testsuite/common/bits-tst.c @@ -1,4 +1,5 @@ # 2 "bits-tst.c" +#include <string.h> /* Drive the bit test routines */ @@ -320,9 +321,7 @@ check_bits (int call, int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int errors = 0; |