mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Add some debug macros and correct nvram_init() call for other PPC
architectures (Laurent Vivier). git-svn-id: svn://coreboot.org/openbios/openbios-devel@264 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -18,6 +18,13 @@
|
||||
#include "openbios/bindings.h"
|
||||
#include "openbios/nvram.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_NVRAM
|
||||
#define DPRINTF(fmt, args...) \
|
||||
do { printk("NVRAM: " fmt , ##args); } while (0)
|
||||
#else
|
||||
#define DPRINTF(fmt, args...) do {} while(0)
|
||||
#endif
|
||||
|
||||
#define DEF_SYSTEM_SIZE 0xc10
|
||||
|
||||
#define NV_SIG_SYSTEM 0x70
|
||||
@@ -228,7 +235,7 @@ nvram_seek( nvram_ibuf_t *nd )
|
||||
int pos_hi = POP();
|
||||
int pos_lo = POP();
|
||||
|
||||
/* printk("NVRAM: seek %08x %08x\n", pos_hi, pos_lo ); */
|
||||
DPRINTF("seek %08x %08x\n", pos_hi, pos_lo );
|
||||
nd->mark_lo = pos_lo;
|
||||
nd->mark_hi = pos_hi;
|
||||
|
||||
@@ -254,7 +261,7 @@ nvram_read( nvram_ibuf_t *nd )
|
||||
n++;
|
||||
}
|
||||
PUSH(n);
|
||||
/* printk("NVRAM: read %08x %x -- %x\n", (int)p, len, n); */
|
||||
DPRINTF("read %08x %x -- %x\n", (int)p, len, n);
|
||||
}
|
||||
|
||||
/* ( addr len -- actual ) */
|
||||
@@ -270,13 +277,14 @@ nvram_write( nvram_ibuf_t *nd )
|
||||
n++;
|
||||
}
|
||||
PUSH(n);
|
||||
/* printk("NVRAM: write %08x %x -- %x\n", (int)p, len, n ); */
|
||||
DPRINTF("write %08x %x -- %x\n", (int)p, len, n );
|
||||
}
|
||||
|
||||
/* ( -- size ) */
|
||||
static void
|
||||
nvram_size( __attribute__((unused)) nvram_ibuf_t *nd )
|
||||
{
|
||||
DPRINTF("nvram_size %d\n", nvram.size);
|
||||
PUSH( nvram.size );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user