1 /* Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
2 Copyright (C) 1998, Cygnus Solutions
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "sim-inline.c"
28 #include "semantics.h"
33 #include "sim-assert.h"
38 /* greater or equal to zero => table */
43 typedef struct _idecode_table_entry
{
47 void *function_or_table
;
48 } idecode_table_entry
;
57 sim_cpu
*processor
= NULL
;
58 instruction_address cia
;
59 int current_cpu
= next_cpu_nr
;
60 instruction_word instruction_0
;
62 /* Hard coded main loop. Not pretty, but should work. */
63 ASSERT(current_cpu
>= 0 && current_cpu
< NUMBER_CPUS
);
65 cia
= CPU_CIA (0); /* Only the 5900 uses this. */
66 processor
= STATE_CPU (sd
, 0); /* Only the 5900 uses this. */
87 cia
= CPU_CIA (processor
);
88 instruction_0
= IMEM (cia
);
90 #if defined (ENGINE_ISSUE_PREFIX_HOOK)
91 ENGINE_ISSUE_PREFIX_HOOK();
94 cia
= idecode_issue(sd
, instruction_0
, cia
);
96 #if defined (ENGINE_ISSUE_POSTFIX_HOOK)
97 ENGINE_ISSUE_POSTFIX_HOOK();
100 /* Update the instruction address */
101 CPU_CIA (processor
) = cia
;
117 /* process any events */
118 if (sim_events_tick (sd
))
120 sim_events_process (sd
);
125 #endif /* _ENGINE_C_*/