acpi: add aml_sleep()
[qemu/ar7.git] / include / hw / platform-bus.h
blobbd42b838099526cb914500339fdd9f4d4187bab5
1 #ifndef HW_PLATFORM_BUS_H
2 #define HW_PLATFORM_BUS_H 1
4 /*
5 * Platform Bus device to support dynamic Sysbus devices
7 * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved.
9 * Author: Alexander Graf, <agraf@suse.de>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
25 #include "hw/sysbus.h"
27 typedef struct PlatformBusDevice PlatformBusDevice;
29 #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device"
30 #define PLATFORM_BUS_DEVICE(obj) \
31 OBJECT_CHECK(PlatformBusDevice, (obj), TYPE_PLATFORM_BUS_DEVICE)
32 #define PLATFORM_BUS_DEVICE_CLASS(klass) \
33 OBJECT_CLASS_CHECK(PlatformBusDeviceClass, (klass), TYPE_PLATFORM_BUS_DEVICE)
34 #define PLATFORM_BUS_DEVICE_GET_CLASS(obj) \
35 OBJECT_GET_CLASS(PlatformBusDeviceClass, (obj), TYPE_PLATFORM_BUS_DEVICE)
37 struct PlatformBusDevice {
38 /*< private >*/
39 SysBusDevice parent_obj;
40 Notifier notifier;
41 bool done_gathering;
43 /*< public >*/
44 uint32_t mmio_size;
45 MemoryRegion mmio;
47 uint32_t num_irqs;
48 qemu_irq *irqs;
49 unsigned long *used_irqs;
52 int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev,
53 int n);
54 hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
55 int n);
57 #endif /* !HW_PLATFORM_BUS_H */