bde3e617ce319d369730e93d338b6de7a9dc3e5e
2 Copyright (C) 1998-2021 Free Software Foundation, Inc.
3 Contributed by Cygnus Solutions.
5 This file is part of GDB, the GNU debugger.
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
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
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/>. */
20 /* This must come before any other includes. */
28 /* Allocate space for all cpus in the simulator.
29 Space for the cpu must currently exist prior to parsing ARGV. */
30 /* ??? wip. better solution must wait. */
33 sim_cpu_alloc_all (SIM_DESC sd
, int ncpus
)
37 for (c
= 0; c
< ncpus
; ++c
)
38 STATE_CPU (sd
, c
) = sim_cpu_alloc (sd
);
42 /* Allocate space for a cpu object.
43 EXTRA_BYTES is additional space to allocate for the sim_cpu struct. */
46 sim_cpu_alloc (SIM_DESC sd
)
51 extra_bytes
+= cgen_cpu_max_extra_bytes (sd
);
54 return zalloc (sizeof (sim_cpu
) + extra_bytes
);
57 /* Free all resources held by all cpus. */
60 sim_cpu_free_all (SIM_DESC sd
)
64 for (c
= 0; c
< MAX_NR_PROCESSORS
; ++c
)
65 if (STATE_CPU (sd
, c
))
66 sim_cpu_free (STATE_CPU (sd
, c
));
69 /* Free all resources used by CPU. */
72 sim_cpu_free (sim_cpu
*cpu
)
80 sim_pc_get (sim_cpu
*cpu
)
82 return (* CPU_PC_FETCH (cpu
)) (cpu
);
86 sim_pc_set (sim_cpu
*cpu
, sim_cia newval
)
88 (* CPU_PC_STORE (cpu
)) (cpu
, newval
);
This page took 0.036615 seconds and 3 git commands to generate.