diff options
author | Hervé Poussineau <hpoussin@reactos.org> | 2015-03-02 22:23:27 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2015-03-10 09:18:56 +0000 |
commit | 43745328881e839124d3d589644732cb65052819 (patch) | |
tree | c5679b87deee51fd58fb8bc8f5572ce097cd4e98 /include/hw/timer | |
parent | 051ddccde29924cb200df3bca3db8c1a2aa10974 (diff) |
m48t59: add a Nvram interface
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
CC: Andreas Färber <afaerber@suse.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include/hw/timer')
-rw-r--r-- | include/hw/timer/m48t59.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h index 8217522291..ddbbda26af 100644 --- a/include/hw/timer/m48t59.h +++ b/include/hw/timer/m48t59.h @@ -1,6 +1,9 @@ #ifndef NVRAM_H #define NVRAM_H +#include "qemu-common.h" +#include "qom/object.h" + /* NVRAM helpers */ typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr); typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val); @@ -34,4 +37,25 @@ M48t59State *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size, M48t59State *m48t59_init(qemu_irq IRQ, hwaddr mem_base, uint32_t io_base, uint16_t size, int type); +#define TYPE_NVRAM "nvram" + +#define NVRAM_CLASS(klass) \ + OBJECT_CLASS_CHECK(NvramClass, (klass), TYPE_NVRAM) +#define NVRAM_GET_CLASS(obj) \ + OBJECT_GET_CLASS(NvramClass, (obj), TYPE_NVRAM) +#define NVRAM(obj) \ + INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM) + +typedef struct Nvram { + Object parent; +} Nvram; + +typedef struct NvramClass { + InterfaceClass parent; + + uint32_t (*read)(Nvram *obj, uint32_t addr); + void (*write)(Nvram *obj, uint32_t addr, uint32_t val); + void (*toggle_lock)(Nvram *obj, int lock); +} NvramClass; + #endif /* !NVRAM_H */ |