1 /* cpu.h --- declarations for the RL78 core.
3 Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
5 Contributed by Red Hat, Inc.
7 This file is part of the GNU simulators.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef SIM_RL78_CPU_H_
24 #define SIM_RL78_CPU_H_
29 #include "opcode/rl78.h"
38 extern int rl78_in_gdb
;
40 SI
get_reg (RL78_Register
);
41 SI
set_reg (RL78_Register
, SI
);
46 extern const char * const reg_names
[];
49 void set_flags (int mask
, int newbits
);
53 const char *bits (int v
, int b
);
55 int condition_true (RL78_Condition cond_id
, int val
);
57 /* Instruction step return codes.
58 Suppose one of the decode_* functions below returns a value R:
59 - If RL78_STEPPED (R), then the single-step completed normally.
60 - If RL78_HIT_BREAK (R), then the program hit a breakpoint.
61 - If RL78_EXITED (R), then the program has done an 'exit' system
62 call, and the exit code is RL78_EXIT_STATUS (R).
63 - If RL78_STOPPED (R), then a signal (number RL78_STOP_SIG (R)) was
66 For building step return codes:
67 - RL78_MAKE_STEPPED is the return code for finishing a normal step.
68 - RL78_MAKE_HIT_BREAK is the return code for hitting a breakpoint.
69 - RL78_MAKE_EXITED (C) is the return code for exiting with status C.
70 - RL78_MAKE_STOPPED (S) is the return code for stopping on signal S. */
71 #define RL78_MAKE_STEPPED() (1)
72 #define RL78_MAKE_HIT_BREAK() (2)
73 #define RL78_MAKE_EXITED(c) (((int) (c) << 8) + 3)
74 #define RL78_MAKE_STOPPED(s) (((int) (s) << 8) + 4)
76 #define RL78_STEPPED(r) ((r) == RL78_MAKE_STEPPED ())
77 #define RL78_HIT_BREAK(r) ((r) == RL78_MAKE_HIT_BREAK ())
78 #define RL78_EXITED(r) (((r) & 0xff) == 3)
79 #define RL78_EXIT_STATUS(r) ((r) >> 8)
80 #define RL78_STOPPED(r) (((r) & 0xff) == 4)
81 #define RL78_STOP_SIG(r) ((r) >> 8)
83 /* The step result for the current step. Global to allow
84 communication between the stepping function and the system
86 extern int step_result
;
88 extern int decode_opcode (void);
90 extern int trace_register_words
;
91 extern void trace_register_changes (void);
92 extern void generate_access_exception (void);
93 extern jmp_buf decode_jmp_buf
;
95 extern long long total_clocks
;
96 extern int pending_clocks
;
97 extern int timer_enabled
;
98 extern void dump_counts_per_insn (const char * filename
);
99 extern unsigned int counts_per_insn
[0x100000];
This page took 0.070609 seconds and 5 git commands to generate.