1#ifndef NVRAM_H
2#define NVRAM_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
16typedef struct Nvram {
17 Object parent;
18} Nvram;
19
20typedef struct NvramClass {
21 InterfaceClass parent;
22
23 uint32_t (*read)(Nvram *obj, uint32_t addr);
24 void (*write)(Nvram *obj, uint32_t addr, uint32_t val);
25 void (*toggle_lock)(Nvram *obj, int lock);
26} NvramClass;
27
28Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
29 int base_year, int type);
30Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
31 uint32_t io_base, uint16_t size, int base_year,
32 int type);
33
34#endif
35