spapr: Simplify error handling in spapr_phb_realize()
[qemu/ar7.git] / include / hw / rtc / goldfish_rtc.h
blob9bd8924f5f00bd7fa646a8ca8a5f82873e0e6572
1 /*
2 * Goldfish virtual platform RTC
4 * Copyright (C) 2019 Western Digital Corporation or its affiliates.
6 * For more details on Google Goldfish virtual platform refer:
7 * https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
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.
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.
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/>.
22 #ifndef HW_RTC_GOLDFISH_RTC_H
23 #define HW_RTC_GOLDFISH_RTC_H
25 #include "hw/sysbus.h"
27 #define TYPE_GOLDFISH_RTC "goldfish_rtc"
28 #define GOLDFISH_RTC(obj) \
29 OBJECT_CHECK(GoldfishRTCState, (obj), TYPE_GOLDFISH_RTC)
31 typedef struct GoldfishRTCState {
32 SysBusDevice parent_obj;
34 MemoryRegion iomem;
35 QEMUTimer *timer;
36 qemu_irq irq;
38 uint64_t tick_offset;
39 uint64_t tick_offset_vmstate;
40 uint64_t alarm_next;
41 uint32_t alarm_running;
42 uint32_t irq_pending;
43 uint32_t irq_enabled;
44 uint32_t time_high;
45 } GoldfishRTCState;
47 #endif