2
0

platform-bus.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef HW_PLATFORM_BUS_H
  2. #define HW_PLATFORM_BUS_H
  3. /*
  4. * Platform Bus device to support dynamic Sysbus devices
  5. *
  6. * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved.
  7. *
  8. * Author: Alexander Graf, <agraf@suse.de>
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  22. */
  23. #include "hw/sysbus.h"
  24. #include "qom/object.h"
  25. #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device"
  26. OBJECT_DECLARE_SIMPLE_TYPE(PlatformBusDevice, PLATFORM_BUS_DEVICE)
  27. struct PlatformBusDevice {
  28. /*< private >*/
  29. SysBusDevice parent_obj;
  30. /*< public >*/
  31. uint32_t mmio_size;
  32. MemoryRegion mmio;
  33. uint32_t num_irqs;
  34. qemu_irq *irqs;
  35. unsigned long *used_irqs;
  36. };
  37. int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev,
  38. int n);
  39. hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,
  40. int n);
  41. void platform_bus_link_device(PlatformBusDevice *pbus, SysBusDevice *sbdev);
  42. #endif /* HW_PLATFORM_BUS_H */