1 /* This file is part of the program psim.
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 typedef struct _vm vm
;
26 typedef struct _vm_data_map vm_data_map
;
27 typedef struct _vm_instruction_map vm_instruction_map
;
30 /* each PowerPC requires two virtual memory maps */
37 (vm_data_map
*) vm_create_data_map
41 (vm_instruction_map
*) vm_create_instruction_map
45 /* address translation, if the translation is invalid
46 these will not return */
49 (unsigned_word
) vm_real_data_addr
50 (vm_data_map
*data_map
,
57 (unsigned_word
) vm_real_instruction_addr
58 (vm_instruction_map
*instruction_map
,
63 /* generic block transfers. Dependant on the presence of the
64 PROCESSOR arg, either returns the number of bytes transfered or (if
65 PROCESSOR is non NULL) aborts the simulation */
68 (int) vm_data_map_read_buffer
77 (int) vm_data_map_write_buffer
82 int violate_read_only_section
,
87 /* fetch the next instruction from memory */
90 (instruction_word
) vm_instruction_map_read
91 (vm_instruction_map
*instruction_map
,
96 /* read data from memory */
98 #define DECLARE_VM_DATA_MAP_READ_N(N) \
100 (unsigned_##N) vm_data_map_read_##N \
106 DECLARE_VM_DATA_MAP_READ_N(1)
107 DECLARE_VM_DATA_MAP_READ_N(2)
108 DECLARE_VM_DATA_MAP_READ_N(4)
109 DECLARE_VM_DATA_MAP_READ_N(8)
110 DECLARE_VM_DATA_MAP_READ_N(word
)
113 /* write data to memory */
115 #define DECLARE_VM_DATA_MAP_WRITE_N(N) \
117 (void) vm_data_map_write_##N \
119 unsigned_word addr, \
124 DECLARE_VM_DATA_MAP_WRITE_N(1)
125 DECLARE_VM_DATA_MAP_WRITE_N(2)
126 DECLARE_VM_DATA_MAP_WRITE_N(4)
127 DECLARE_VM_DATA_MAP_WRITE_N(8)
128 DECLARE_VM_DATA_MAP_WRITE_N(word
)
131 /* update vm data structures due to a synchronization point */
134 (void) vm_synchronize_context
144 /* update vm data structures due to a TLB operation */
147 (void) vm_page_tlb_invalidate_entry
152 (void) vm_page_tlb_invalidate_all