]> git.proxmox.com Git - mirror_qemu.git/blame - target/arm/idau.h
Move QOM typedefs and add missing includes
[mirror_qemu.git] / target / arm / idau.h
CommitLineData
181962fd
PM
1/*
2 * QEMU ARM CPU -- interface for the Arm v8M IDAU
3 *
4 * Copyright (c) 2018 Linaro Ltd
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see
18 * <http://www.gnu.org/licenses/gpl-2.0.html>
19 *
20 * In the v8M architecture, the IDAU is a small piece of hardware
21 * typically implemented in the SoC which provides board or SoC
22 * specific security attribution information for each address that
23 * the CPU performs MPU/SAU checks on. For QEMU, we model this with a
24 * QOM interface which is implemented by the board or SoC object and
25 * connected to the CPU using a link property.
26 */
27
28#ifndef TARGET_ARM_IDAU_H
29#define TARGET_ARM_IDAU_H
30
31#include "qom/object.h"
32
33#define TYPE_IDAU_INTERFACE "idau-interface"
34#define IDAU_INTERFACE(obj) \
35 INTERFACE_CHECK(IDAUInterface, (obj), TYPE_IDAU_INTERFACE)
db1015e9 36typedef struct IDAUInterfaceClass IDAUInterfaceClass;
181962fd
PM
37#define IDAU_INTERFACE_CLASS(class) \
38 OBJECT_CLASS_CHECK(IDAUInterfaceClass, (class), TYPE_IDAU_INTERFACE)
39#define IDAU_INTERFACE_GET_CLASS(obj) \
40 OBJECT_GET_CLASS(IDAUInterfaceClass, (obj), TYPE_IDAU_INTERFACE)
41
aa1b35b9 42typedef struct IDAUInterface IDAUInterface;
181962fd
PM
43
44#define IREGION_NOTVALID -1
45
db1015e9 46struct IDAUInterfaceClass {
181962fd
PM
47 InterfaceClass parent;
48
49 /* Check the specified address and return the IDAU security information
50 * for it by filling in iregion, exempt, ns and nsc:
51 * iregion: IDAU region number, or IREGION_NOTVALID if not valid
52 * exempt: true if address is exempt from security attribution
53 * ns: true if the address is NonSecure
54 * nsc: true if the address is NonSecure-callable
55 */
56 void (*check)(IDAUInterface *ii, uint32_t address, int *iregion,
57 bool *exempt, bool *ns, bool *nsc);
db1015e9 58};
181962fd
PM
59
60#endif