2 * This file is part of the LinuxBIOS project.
4 * Copyright (C) 2000 AG Electronics Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 /* Definitions for nvram devices - these are flash or eeprom devices used to
21 store information across power cycles and resets. Though they are byte
22 addressable, writes must be committed to allow flash devices to write
28 typedef struct nvram_device
30 unsigned (*size)(struct nvram_device *data);
31 int (*read_block)(struct nvram_device *dev, unsigned offset,
32 unsigned char *data, unsigned length);
33 int (*write_byte)(struct nvram_device *dev, unsigned offset, unsigned char byte);
34 void (*commit)(struct nvram_device *data);
38 int nvram_init (nvram_device *dev);
39 void nvram_clear(void);
41 extern nvram_device pcrtc_nvram;
42 extern void nvram_putenv(const char *name, const char *value);
43 extern int nvram_getenv(const char *name, char *buffer, unsigned size);
45 typedef const struct nvram_constant
51 extern nvram_constant hardcoded_environment[];