1 /* This file is part of the program psim.
3 Copyright (C) 1994-1996, 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.
23 #error "N must be #defined"
26 /* NOTE: see end of file for #undef of these macros */
27 #define unsigned_N XCONCAT2(unsigned_,N)
28 #define T2H_N XCONCAT2(T2H_,N)
29 #define H2T_N XCONCAT2(H2T_,N)
31 #define core_map_read_N XCONCAT2(core_map_read_,N)
32 #define core_map_write_N XCONCAT2(core_map_write_,N)
34 INLINE_CORE(unsigned_N
)
35 core_map_read_N(core_map
*map
,
40 core_mapping
*mapping
= core_map_find_mapping(map
,
46 if (WITH_CALLBACK_MEMORY
&& mapping
->device
!= NULL
) {
48 if (device_io_read_buffer(mapping
->device
,
52 sizeof(unsigned_N
), /* nr_bytes */
54 cia
) != sizeof(unsigned_N
))
55 device_error(mapping
->device
, "internal error - core_read_N() - io_read_buffer should not fail");
59 return T2H_N(*(unsigned_N
*)core_translate(mapping
, addr
));
65 core_map_write_N(core_map
*map
,
71 core_mapping
*mapping
= core_map_find_mapping(map
,
77 if (WITH_CALLBACK_MEMORY
&& mapping
->device
!= NULL
) {
78 unsigned_N data
= H2T_N(val
);
79 if (device_io_write_buffer(mapping
->device
,
83 sizeof(unsigned_N
), /* nr_bytes */
85 cia
) != sizeof(unsigned_N
))
86 device_error(mapping
->device
, "internal error - core_write_N() - io_write_buffer should not fail");
89 *(unsigned_N
*)core_translate(mapping
, addr
) = H2T_N(val
);
92 /* NOTE: see start of file for #define of these macros */
96 #undef core_map_read_N
97 #undef core_map_write_N
This page took 0.030381 seconds and 4 git commands to generate.