mirror of
https://github.com/fail0verflow/mini.git
synced 2025-02-26 08:13:36 +01:00
Optional mini debug spew with gecko safe functions.
This commit is contained in:
parent
ef02581dda
commit
57c185afe5
2
boot2.c
2
boot2.c
@ -193,7 +193,7 @@ int boot2_load(int copy)
|
|||||||
nand_wait();
|
nand_wait();
|
||||||
// boot1 doesn't actually do this, but it's probably a good idea to try to correct 1-bit errors anyway
|
// boot1 doesn't actually do this, but it's probably a good idea to try to correct 1-bit errors anyway
|
||||||
if(nand_correct(page, sector_buf, ecc_buf) < 0) {
|
if(nand_correct(page, sector_buf, ecc_buf) < 0) {
|
||||||
gecko_printf("boot2 map candidate page %d is uncorrectable, trying anyway\n", page);
|
gecko_printf("boot2 map candidate page 0x%x is uncorrectable, trying anyway\n", page);
|
||||||
}
|
}
|
||||||
mapno = find_valid_map(maps);
|
mapno = find_valid_map(maps);
|
||||||
if(mapno >= 0) {
|
if(mapno >= 0) {
|
||||||
|
12
gecko.c
12
gecko.c
@ -34,6 +34,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "powerpc_elf.h"
|
#include "powerpc_elf.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
|
//#define GECKO_SAFE
|
||||||
|
|
||||||
static u8 gecko_console_enabled = 0;
|
static u8 gecko_console_enabled = 0;
|
||||||
|
|
||||||
static u32 _gecko_command(u32 command)
|
static u32 _gecko_command(u32 command)
|
||||||
@ -86,7 +88,7 @@ static u32 _gecko_recvbyte(u8 *recvbyte)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#ifdef GECKO_SAFE
|
||||||
static u32 _gecko_checksend(void)
|
static u32 _gecko_checksend(void)
|
||||||
{
|
{
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
@ -143,6 +145,7 @@ static int gecko_recvbuffer(void *buffer, u32 size)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GECKO_SAFE
|
||||||
static int gecko_sendbuffer(const void *buffer, u32 size)
|
static int gecko_sendbuffer(const void *buffer, u32 size)
|
||||||
{
|
{
|
||||||
u32 left = size;
|
u32 left = size;
|
||||||
@ -156,6 +159,7 @@ static int gecko_sendbuffer(const void *buffer, u32 size)
|
|||||||
}
|
}
|
||||||
return (size - left);
|
return (size - left);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static int gecko_recvbuffer_safe(void *buffer, u32 size)
|
static int gecko_recvbuffer_safe(void *buffer, u32 size)
|
||||||
@ -173,7 +177,9 @@ static int gecko_recvbuffer_safe(void *buffer, u32 size)
|
|||||||
}
|
}
|
||||||
return (size - left);
|
return (size - left);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GECKO_SAFE
|
||||||
static int gecko_sendbuffer_safe(const void *buffer, u32 size)
|
static int gecko_sendbuffer_safe(const void *buffer, u32 size)
|
||||||
{
|
{
|
||||||
u32 left = size;
|
u32 left = size;
|
||||||
@ -235,7 +241,11 @@ int gecko_printf(const char *fmt, ...)
|
|||||||
i = vsprintf(buffer, fmt, args);
|
i = vsprintf(buffer, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
|
#ifdef GECKO_SAFE
|
||||||
|
return gecko_sendbuffer_safe(buffer, i);
|
||||||
|
#else
|
||||||
return gecko_sendbuffer(buffer, i);
|
return gecko_sendbuffer(buffer, i);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user