OLD | NEW |
1 /* run front end support for arm | 1 /* run front end support for arm |
2 Copyright (C) 1995-1997, 2000-2002, 2007-2012 Free Software | 2 Copyright (C) 1995-1997, 2000-2002, 2007-2012 Free Software |
3 Foundation, Inc. | 3 Foundation, Inc. |
4 | 4 |
5 This file is part of ARM SIM. | 5 This file is part of ARM SIM. |
6 | 6 |
7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
11 | 11 |
12 This program is distributed in the hope that it will be useful, | 12 This program is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
16 | 16 |
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
19 | 19 |
20 /* This file provides the interface between the simulator and | 20 /* This file provides the interface between the simulator and |
21 run.c and gdb (when the simulator is linked with gdb). | 21 run.c and gdb (when the simulator is linked with gdb). |
22 All simulator interaction should go through this file. */ | 22 All simulator interaction should go through this file. */ |
23 | 23 |
| 24 #include "config.h" |
24 #include <stdio.h> | 25 #include <stdio.h> |
25 #include <stdarg.h> | 26 #include <stdarg.h> |
26 #include <string.h> | 27 #include <string.h> |
27 #include <bfd.h> | 28 #include <bfd.h> |
28 #include <signal.h> | 29 #include <signal.h> |
29 #include "gdb/callback.h" | 30 #include "gdb/callback.h" |
30 #include "gdb/remote-sim.h" | 31 #include "gdb/remote-sim.h" |
31 #include "armdefs.h" | 32 #include "armdefs.h" |
32 #include "armemu.h" | 33 #include "armemu.h" |
33 #include "dbg_rdi.h" | 34 #include "dbg_rdi.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 /* We wouldn't set the machine type with earlier toolchains, so we | 263 /* We wouldn't set the machine type with earlier toolchains, so we |
263 explicitly select a processor capable of supporting all ARMs in | 264 explicitly select a processor capable of supporting all ARMs in |
264 32bit mode. */ | 265 32bit mode. */ |
265 /* We choose the XScale rather than the iWMMXt, because the iWMMXt | 266 /* We choose the XScale rather than the iWMMXt, because the iWMMXt |
266 removes the FPE emulator, since it conflicts with its coprocessors. | 267 removes the FPE emulator, since it conflicts with its coprocessors. |
267 For the most generic ARM support, we want the FPE emulator in place. *
/ | 268 For the most generic ARM support, we want the FPE emulator in place. *
/ |
268 case bfd_mach_arm_XScale: | 269 case bfd_mach_arm_XScale: |
269 ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop
| ARM_v6_Prop); | 270 ARMul_SelectProcessor (state, ARM_v5_Prop | ARM_v5e_Prop | ARM_XScale_Prop
| ARM_v6_Prop); |
270 break; | 271 break; |
271 | 272 |
| 273 case bfd_mach_arm_iWMMXt2: |
272 case bfd_mach_arm_iWMMXt: | 274 case bfd_mach_arm_iWMMXt: |
273 { | 275 { |
274 extern int SWI_vector_installed; | 276 extern int SWI_vector_installed; |
275 ARMword i; | 277 ARMword i; |
276 | 278 |
277 if (! SWI_vector_installed) | 279 if (! SWI_vector_installed) |
278 { | 280 { |
279 /* Intialise the hardware vectors to zero. */ | 281 /* Intialise the hardware vectors to zero. */ |
280 if (! SWI_vector_installed) | 282 if (! SWI_vector_installed) |
281 for (i = ARMul_ResetV; i <= ARMFIQV; i += 4) | 283 for (i = ARMul_ResetV; i <= ARMFIQV; i += 4) |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 | 899 |
898 void | 900 void |
899 sim_stop_reason (sd, reason, sigrc) | 901 sim_stop_reason (sd, reason, sigrc) |
900 SIM_DESC sd ATTRIBUTE_UNUSED; | 902 SIM_DESC sd ATTRIBUTE_UNUSED; |
901 enum sim_stop *reason; | 903 enum sim_stop *reason; |
902 int *sigrc; | 904 int *sigrc; |
903 { | 905 { |
904 if (stop_simulator) | 906 if (stop_simulator) |
905 { | 907 { |
906 *reason = sim_stopped; | 908 *reason = sim_stopped; |
907 *sigrc = TARGET_SIGNAL_INT; | 909 *sigrc = GDB_SIGNAL_INT; |
908 } | 910 } |
909 else if (state->EndCondition == 0) | 911 else if (state->EndCondition == 0) |
910 { | 912 { |
911 *reason = sim_exited; | 913 *reason = sim_exited; |
912 *sigrc = state->Reg[0] & 255; | 914 *sigrc = state->Reg[0] & 255; |
913 } | 915 } |
914 else | 916 else |
915 { | 917 { |
916 *reason = sim_stopped; | 918 *reason = sim_stopped; |
917 if (state->EndCondition == RDIError_BreakpointReached) | 919 if (state->EndCondition == RDIError_BreakpointReached) |
918 » *sigrc = TARGET_SIGNAL_TRAP; | 920 » *sigrc = GDB_SIGNAL_TRAP; |
919 else if ( state->EndCondition == RDIError_DataAbort | 921 else if ( state->EndCondition == RDIError_DataAbort |
920 || state->EndCondition == RDIError_AddressException) | 922 || state->EndCondition == RDIError_AddressException) |
921 » *sigrc = TARGET_SIGNAL_BUS; | 923 » *sigrc = GDB_SIGNAL_BUS; |
922 else | 924 else |
923 *sigrc = 0; | 925 *sigrc = 0; |
924 } | 926 } |
925 } | 927 } |
926 | 928 |
927 void | 929 void |
928 sim_do_command (sd, cmd) | 930 sim_do_command (sd, cmd) |
929 SIM_DESC sd ATTRIBUTE_UNUSED; | 931 SIM_DESC sd ATTRIBUTE_UNUSED; |
930 char *cmd ATTRIBUTE_UNUSED; | 932 char *cmd ATTRIBUTE_UNUSED; |
931 { | 933 { |
932 (*sim_callback->printf_filtered) | 934 (*sim_callback->printf_filtered) |
933 (sim_callback, | 935 (sim_callback, |
934 "This simulator does not accept any commands.\n"); | 936 "This simulator does not accept any commands.\n"); |
935 } | 937 } |
936 | 938 |
937 void | 939 void |
938 sim_set_callbacks (ptr) | 940 sim_set_callbacks (ptr) |
939 host_callback *ptr; | 941 host_callback *ptr; |
940 { | 942 { |
941 sim_callback = ptr; | 943 sim_callback = ptr; |
942 } | 944 } |
943 | 945 |
944 char ** | 946 char ** |
945 sim_complete_command (SIM_DESC sd, char *text, char *word) | 947 sim_complete_command (SIM_DESC sd, char *text, char *word) |
946 { | 948 { |
947 return NULL; | 949 return NULL; |
948 } | 950 } |
OLD | NEW |