]> git.proxmox.com Git - qemu.git/blame - hw/nvram.h
Merge remote branch 'kwolf/for-anthony' into staging
[qemu.git] / hw / nvram.h
CommitLineData
87ecb68b
PB
1#ifndef NVRAM_H
2#define NVRAM_H
3
4/* NVRAM helpers */
c227f099
AL
5typedef uint32_t (*nvram_read_t)(void *private, uint32_t addr);
6typedef void (*nvram_write_t)(void *private, uint32_t addr, uint32_t val);
7typedef struct nvram_t {
87ecb68b 8 void *opaque;
c227f099
AL
9 nvram_read_t read_fn;
10 nvram_write_t write_fn;
11} nvram_t;
87ecb68b 12
c227f099
AL
13void NVRAM_set_byte (nvram_t *nvram, uint32_t addr, uint8_t value);
14uint8_t NVRAM_get_byte (nvram_t *nvram, uint32_t addr);
15void NVRAM_set_word (nvram_t *nvram, uint32_t addr, uint16_t value);
16uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
17void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
18uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
19void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
b55266b5 20 const char *str, uint32_t max);
c227f099
AL
21int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
22void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
87ecb68b 23 uint32_t start, uint32_t count);
c227f099 24int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
b55266b5 25 const char *arch,
87ecb68b
PB
26 uint32_t RAM_size, int boot_device,
27 uint32_t kernel_image, uint32_t kernel_size,
28 const char *cmdline,
29 uint32_t initrd_image, uint32_t initrd_size,
30 uint32_t NVRAM_image,
31 int width, int height, int depth);
43a34704 32typedef struct M48t59State M48t59State;
87ecb68b
PB
33
34void m48t59_write (void *private, uint32_t addr, uint32_t val);
35uint32_t m48t59_read (void *private, uint32_t addr);
36void m48t59_toggle_lock (void *private, int lock);
43a34704
BS
37M48t59State *m48t59_init_isa(uint32_t io_base, uint16_t size, int type);
38M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
39 uint32_t io_base, uint16_t size, int type);
9596ebb7 40void m48t59_set_addr (void *opaque, uint32_t addr);
87ecb68b
PB
41
42#endif /* !NVRAM_H */