arch/arm64: Support FEAT_CCIDX
[coreboot2.git] / util / nvramtool / accessors / cmos-mem.c
blob619a68a2c6ee5d5b69c36a2af4c1955b96283d4c
1 #include <assert.h>
2 #include "cmos_lowlevel.h"
4 static void mem_hal_init(void* data);
5 static unsigned char mem_hal_read(unsigned addr);
6 static void mem_hal_write(unsigned addr, unsigned char value);
7 static void mem_set_iopl(int level);
9 static unsigned char* mem_hal_data = (unsigned char*)-1;
10 static void mem_hal_init(void *data)
12 mem_hal_data = data;
15 static unsigned char mem_hal_read(unsigned index)
17 assert(mem_hal_data != (unsigned char*)-1);
18 return mem_hal_data[index];
21 static void mem_hal_write(unsigned index, unsigned char value)
23 assert(mem_hal_data != (unsigned char*)-1);
24 mem_hal_data[index] = value;
27 static void mem_set_iopl(__attribute__ ((unused)) int level)
31 cmos_access_t memory_hal = {
32 .init = mem_hal_init,
33 .read = mem_hal_read,
34 .write = mem_hal_write,
35 .set_iopl = mem_set_iopl,