mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
051ddccde2
commit
4374532888
2 changed files with 83 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue