pl031.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * ARM AMBA PrimeCell PL031 RTC
  3. *
  4. * Copyright (c) 2007 CodeSourcery
  5. *
  6. * This file is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Contributions after 2012-01-13 are licensed under the terms of the
  11. * GNU GPL, version 2 or (at your option) any later version.
  12. */
  13. #ifndef HW_RTC_PL031_H
  14. #define HW_RTC_PL031_H
  15. #include "hw/sysbus.h"
  16. #include "qemu/timer.h"
  17. #include "qom/object.h"
  18. #define TYPE_PL031 "pl031"
  19. OBJECT_DECLARE_SIMPLE_TYPE(PL031State, PL031)
  20. struct PL031State {
  21. SysBusDevice parent_obj;
  22. MemoryRegion iomem;
  23. QEMUTimer *timer;
  24. qemu_irq irq;
  25. /*
  26. * Needed to preserve the tick_count across migration, even if the
  27. * absolute value of the rtc_clock is different on the source and
  28. * destination.
  29. */
  30. uint32_t tick_offset_vmstate;
  31. uint32_t tick_offset;
  32. bool tick_offset_migrated;
  33. bool migrate_tick_offset;
  34. uint32_t mr;
  35. uint32_t lr;
  36. uint32_t cr;
  37. uint32_t im;
  38. uint32_t is;
  39. };
  40. #endif