1 /* Handle cache related addresses.
3 Copyright (C) 1996-2024 Free Software Foundation, Inc.
4 Contributed by Cygnus Solutions and Mike Frysinger.
6 This file is part of the GNU simulators.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* This must come before any other includes. */
27 #include "dv-m32r_cache.h"
34 cris_io_write_buffer (struct hw
*me
, const void *source
,
35 int space
, address_word addr
, unsigned nr_bytes
)
37 SIM_DESC sd
= hw_system (me
);
40 /* MSPR support is deprecated but is kept in for upward compatibility
41 with existing overlay support. */
45 if ((*(const char *) source
& MSPR_PURGE
) != 0)
50 if ((*(const char *) source
& MCCR_CP
) != 0)
60 attach_regs (struct hw
*me
, struct m32r_cache_hw
*hw
)
62 address_word attach_address
;
65 reg_property_spec reg
;
67 if (hw_find_property (me
, "reg") == NULL
)
68 hw_abort (me
, "Missing \"reg\" property");
70 if (!hw_find_reg_array_property (me
, "reg", 0, ®
))
71 hw_abort (me
, "\"reg\" property must contain three addr/size entries");
73 hw_unit_address_to_attach_address (hw_parent (me
),
75 &attach_space
, &attach_address
, me
);
76 hw_unit_size_to_attach_size (hw_parent (me
), ®
.size
, &attach_size
, me
);
78 hw_attach_address (hw_parent (me
),
79 0, attach_space
, attach_address
, attach_size
, me
);
83 m32r_cache_finish (struct hw
*me
)
85 struct m32r_cache_hw
*hw
;
87 hw
= HW_ZALLOC (me
, struct m32r_cache_hw
);
89 set_hw_io_write_buffer (me
, cris_io_write_buffer
);
94 const struct hw_descriptor dv_m32r_cache_descriptor
[] = {
95 { "m32r_cache", m32r_cache_finish
, },