static void atari_nvram_proc_read()

in atari/nvram.c [178:242]


static void atari_nvram_proc_read(unsigned char *nvram, struct seq_file *seq,
				  void *offset)
{
	int checksum;
	int i;
	unsigned int vmode;

	spin_lock_irq(&rtc_lock);
	checksum = __nvram_check_checksum();
	spin_unlock_irq(&rtc_lock);

	seq_printf(seq, "Checksum status  : %svalid\n", checksum ? "" : "not ");

	seq_puts(seq, "Boot preference  : ");
	for (i = ARRAY_SIZE(boot_prefs) - 1; i >= 0; --i)
		if (nvram[1] == boot_prefs[i].val) {
			seq_printf(seq, "%s\n", boot_prefs[i].name);
			break;
		}
	if (i < 0)
		seq_printf(seq, "0x%02x (undefined)\n", nvram[1]);

	seq_printf(seq, "SCSI arbitration : %s\n",
		   (nvram[16] & 0x80) ? "on" : "off");
	seq_puts(seq, "SCSI host ID     : ");
	if (nvram[16] & 0x80)
		seq_printf(seq, "%d\n", nvram[16] & 7);
	else
		seq_puts(seq, "n/a\n");

	if (!MACH_IS_FALCON)
		return;

	seq_puts(seq, "OS language      : ");
	if (nvram[6] < ARRAY_SIZE(languages))
		seq_printf(seq, "%s\n", languages[nvram[6]]);
	else
		seq_printf(seq, "%u (undefined)\n", nvram[6]);
	seq_puts(seq, "Keyboard language: ");
	if (nvram[7] < ARRAY_SIZE(languages))
		seq_printf(seq, "%s\n", languages[nvram[7]]);
	else
		seq_printf(seq, "%u (undefined)\n", nvram[7]);
	seq_puts(seq, "Date format      : ");
	seq_printf(seq, dateformat[nvram[8] & 7],
		   nvram[9] ? nvram[9] : '/', nvram[9] ? nvram[9] : '/');
	seq_printf(seq, ", %dh clock\n", nvram[8] & 16 ? 24 : 12);
	seq_puts(seq, "Boot delay       : ");
	if (nvram[10] == 0)
		seq_puts(seq, "default\n");
	else
		seq_printf(seq, "%ds%s\n", nvram[10],
			   nvram[10] < 8 ? ", no memory test" : "");

	vmode = (nvram[14] << 8) | nvram[15];
	seq_printf(seq,
		   "Video mode       : %s colors, %d columns, %s %s monitor\n",
		   colors[vmode & 7], vmode & 8 ? 80 : 40,
		   vmode & 16 ? "VGA" : "TV", vmode & 32 ? "PAL" : "NTSC");
	seq_printf(seq,
		   "                   %soverscan, compat. mode %s%s\n",
		   vmode & 64 ? "" : "no ", vmode & 128 ? "on" : "off",
		   vmode & 256 ?
		   (vmode & 16 ? ", line doubling" : ", half screen") : "");
}