13 #include <linux/kernel.h>
16 #include <asm/uaccess.h>
18 #include <asm/machdep.h>
22 static unsigned int nvram_size;
23 static unsigned char nvram_buf[4];
26 static unsigned char chrp_nvram_read(
int addr)
32 if (addr >= nvram_size) {
34 current->comm, addr, nvram_size);
39 __pa(nvram_buf), 1) != 0) || 1 != done)
43 spin_unlock_irqrestore(&nvram_lock, flags);
48 static void chrp_nvram_write(
int addr,
unsigned char val)
53 if (addr >= nvram_size) {
55 current->comm, addr, nvram_size);
61 __pa(nvram_buf), 1) != 0) || 1 != done)
63 spin_unlock_irqrestore(&nvram_lock, flags);
69 const unsigned int *nbytes_p;
77 if (nbytes_p ==
NULL || proplen !=
sizeof(
unsigned int)) {
82 nvram_size = *nbytes_p;
87 ppc_md.nvram_read_val = chrp_nvram_read;
88 ppc_md.nvram_write_val = chrp_nvram_write;