coreboot-kgpe-d16/util/nvramtool/accessors/cmos-mem.c
Patrick Georgi 1e916e0766 Move CMOS handling into separate files in accessors
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6313 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2011-01-28 07:54:11 +00:00

37 lines
827 B
C

#include <assert.h>
#include "cmos_lowlevel.h"
static void mem_hal_init(void* data);
static unsigned char mem_hal_read(unsigned addr);
static void mem_hal_write(unsigned addr, unsigned char value);
static void mem_set_iopl(int level);
static unsigned char* mem_hal_data = (unsigned char*)-1;
static void mem_hal_init(void *data)
{
mem_hal_data = data;
}
static unsigned char mem_hal_read(unsigned index)
{
assert(mem_hal_data != (unsigned char*)-1);
return mem_hal_data[index];
}
static void mem_hal_write(unsigned index, unsigned char value)
{
assert(mem_hal_data != (unsigned char*)-1);
mem_hal_data[index] = value;
}
static void mem_set_iopl(__attribute__ ((unused)) int level)
{
}
cmos_access_t memory_hal = {
.init = mem_hal_init,
.read = mem_hal_read,
.write = mem_hal_write,
.set_iopl = mem_set_iopl,
};