2 * This file is part of the coreinfo project.
4 * Copyright (C) 2008 Uwe Hermann <uwe@hermann-uwe.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
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
22 #ifdef CONFIG_MODULE_NVRAM
25 * Dump 256 bytes of NVRAM.
27 static void dump_nvram(WINDOW *win, int row, int col)
31 for (i = 1; i < 257; i++) {
32 mvwprintw(win, row + y, col + x, "%02x ", nvram_read(i - 1));
35 y++; /* Start a newline after 16 bytes. */
39 y++; /* Add an empty line after 64 bytes. */
45 static int nvram_module_redraw(WINDOW *win)
47 print_module_title(win, "NVRAM Dump");
48 dump_nvram(win, 2, 1);
52 static int nvram_module_init(void)
57 struct coreinfo_module nvram_module = {
59 .init = nvram_module_init,
60 .redraw = nvram_module_redraw,
65 struct coreinfo_module nvram_module = {