[PATCH 22/57][Arm][GAS] Add support for MVE instructions: vmlaldav, vmlalv, vmlsldav...
[binutils-gdb.git] / sim / common / dv-core.c
blob3e2bcaa52fb0693ced912cba45fba9dcc343373d
1 /* The common simulator framework for GDB, the GNU Debugger.
3 Copyright 2002-2019 Free Software Foundation, Inc.
5 Contributed by Andrew Cagney and Red Hat.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "sim-main.h"
24 #include "hw-main.h"
26 /* DEVICE
28 core - root of the device tree
30 DESCRIPTION
32 The core device, positioned at the root of the device tree appears
33 to its child devices as a normal device just like every other
34 device in the tree.
36 Internally it is implemented using a core object. Requests to
37 attach (or detach) address spaces are passed to that core object.
38 Requests to transfer (DMA) data are reflected back down the device
39 tree using the core_map data transfer methods.
41 PROPERTIES
43 None.
48 static void
49 dv_core_attach_address_callback (struct hw *me,
50 int level,
51 int space,
52 address_word addr,
53 address_word nr_bytes,
54 struct hw *client)
56 HW_TRACE ((me, "attach - level=%d, space=%d, addr=0x%lx, nr_bytes=%ld, client=%s",
57 level, space, (unsigned long) addr, (unsigned long) nr_bytes, hw_path (client)));
58 /* NOTE: At preset the space is assumed to be zero. Perhaphs the
59 space should be mapped onto something for instance: space0 -
60 unified memory; space1 - IO memory; ... */
61 sim_core_attach (hw_system (me),
62 NULL, /*cpu*/
63 level,
64 access_read_write_exec,
65 space, addr,
66 nr_bytes,
67 0, /* modulo */
68 client,
69 NULL);
73 static unsigned
74 dv_core_dma_read_buffer_callback (struct hw *me,
75 void *dest,
76 int space,
77 unsigned_word addr,
78 unsigned nr_bytes)
80 return sim_core_read_buffer (hw_system (me),
81 NULL, /*CPU*/
82 space, /*???*/
83 dest,
84 addr,
85 nr_bytes);
89 static unsigned
90 dv_core_dma_write_buffer_callback (struct hw *me,
91 const void *source,
92 int space,
93 unsigned_word addr,
94 unsigned nr_bytes,
95 int violate_read_only_section)
97 return sim_core_write_buffer (hw_system (me),
98 NULL, /*cpu*/
99 space, /*???*/
100 source,
101 addr,
102 nr_bytes);
106 static void
107 dv_core_finish (struct hw *me)
109 set_hw_attach_address (me, dv_core_attach_address_callback);
110 set_hw_dma_write_buffer (me, dv_core_dma_write_buffer_callback);
111 set_hw_dma_read_buffer (me, dv_core_dma_read_buffer_callback);
114 const struct hw_descriptor dv_core_descriptor[] = {
115 { "core", dv_core_finish, },
116 { NULL, NULL },