]> git.proxmox.com Git - mirror_qemu.git/blob - include/hw/timer/m48t59.h
qom: make interface types abstract
[mirror_qemu.git] / include / hw / timer / m48t59.h
1 #ifndef HW_M48T59_H
2 #define HW_M48T59_H
3
4 #include "qemu-common.h"
5 #include "qom/object.h"
6
7 #define TYPE_NVRAM "nvram"
8
9 #define NVRAM_CLASS(klass) \
10 OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM)
11 #define NVRAM_GET_CLASS(obj) \
12 OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM)
13 #define NVRAM(obj) \
14 INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM)
15
16 typedef struct Nvram Nvram;
17
18 typedef struct NvramClass {
19 InterfaceClass parent;
20
21 uint32_t (*read)(Nvram *obj, uint32_t addr);
22 void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
23 void (*toggle_lock)(Nvram *obj, int lock);
24 } NvramClass;
25
26 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
27 int base_year, int type);
28 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
29 uint32_t io_base, uint16_t size, int base_year,
30 int type);
31
32 #endif /* HW_M48T59_H */