goldfish_rtc.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Goldfish virtual platform RTC
  3. *
  4. * Copyright (C) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * For more details on Google Goldfish virtual platform refer:
  7. * https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms and conditions of the GNU General Public License,
  11. * version 2 or later, as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with
  19. * this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef HW_RTC_GOLDFISH_RTC_H
  22. #define HW_RTC_GOLDFISH_RTC_H
  23. #include "hw/sysbus.h"
  24. #include "qom/object.h"
  25. #define TYPE_GOLDFISH_RTC "goldfish_rtc"
  26. OBJECT_DECLARE_SIMPLE_TYPE(GoldfishRTCState, GOLDFISH_RTC)
  27. struct GoldfishRTCState {
  28. SysBusDevice parent_obj;
  29. MemoryRegion iomem;
  30. QEMUTimer *timer;
  31. qemu_irq irq;
  32. uint64_t tick_offset;
  33. uint64_t tick_offset_vmstate;
  34. uint64_t alarm_next;
  35. uint32_t alarm_running;
  36. uint32_t irq_pending;
  37. uint32_t irq_enabled;
  38. uint32_t time_high;
  39. bool big_endian;
  40. };
  41. #endif