2
* Creation Date: <2003/12/19 18:46:21 samuel>
3
* Time-stamp: <2004/04/12 16:27:12 samuel>
9
* Copyright (C) 2003, 2004 Samuel Rydh (samuel@ibrium.se)
11
* This program is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU General Public License
18
#include "kernel/kernel.h"
19
#include "arch/common/nvram.h"
20
#include "libc/vsprintf.h"
21
#include "libc/string.h"
23
#include "osi_calls.h"
33
fatal_error( const char *err )
35
printk("Fatal error: %s\n", err );
40
panic( const char *err )
42
printk("Panic: %s\n", err );
45
/* won't come here... this keeps the gcc happy */
51
/************************************************************************/
52
/* print using OSI interface */
53
/************************************************************************/
58
printk( const char *fmt, ... )
65
i = vnsprintf(buf, sizeof(buf), fmt, args);
68
for( p=buf; *p; p++ ) {
71
if( do_indent++ == 1 ) {
82
/************************************************************************/
84
/************************************************************************/
86
static int ttychar = -1;
91
return OSI_CallAvailable( OSI_TTY_GETC );
101
ttychar = OSI_TTYGetc();
104
return (ttychar >= 0);
116
return OSI_TTYGetc();
133
/************************************************************************/
134
/* MOL specific stuff */
135
/************************************************************************/
138
arch_nvram_size( void )
140
return OSI_NVRamSize();
144
arch_nvram_put( char *buf )
146
int i, size = arch_nvram_size();
148
for( i=0; i<size; i++ )
149
OSI_WriteNVRamByte( i, buf[i] );
153
arch_nvram_get( char *buf )
155
int i, size = arch_nvram_size();
157
/* support for zapping the nvram */
158
if( get_bool_res("zap_nvram") == 1 ) {
159
memset( buf, 0, size );
163
for( i=0; i<size; i++ )
164
buf[i] = OSI_ReadNVRamByte( i );