mirror of
https://github.com/fail0verflow/mini.git
synced 2024-06-03 17:58:52 +02:00
move usbgecko defines to Makefile, fix warnings
This commit is contained in:
parent
f432ae5661
commit
f742371e9e
7
Makefile
7
Makefile
|
@ -1,5 +1,12 @@
|
||||||
include starlet.mk
|
include starlet.mk
|
||||||
|
|
||||||
|
# disables debug spew over usbgecko
|
||||||
|
#CFLAGS += -DNDEBUG
|
||||||
|
# enables LFCR linefeeds for usbgecko output, useful for some terminal apps
|
||||||
|
#CFLAGS += -DGECKO_LFCR
|
||||||
|
# uses the 'safe' version of the usbgecko receive and send functions
|
||||||
|
#CFLAGS += -DGECKO_SAFE
|
||||||
|
|
||||||
ASFLAGS += -D_LANGUAGE_ASSEMBLY
|
ASFLAGS += -D_LANGUAGE_ASSEMBLY
|
||||||
CFLAGS += -DCAN_HAZ_IRQ -DCAN_HAZ_IPC
|
CFLAGS += -DCAN_HAZ_IRQ -DCAN_HAZ_IPC
|
||||||
LDSCRIPT = mini.ld
|
LDSCRIPT = mini.ld
|
||||||
|
|
2
boot2.c
2
boot2.c
|
@ -217,8 +217,10 @@ int boot2_load(int copy)
|
||||||
memset(boot2_iv, 0, 16);
|
memset(boot2_iv, 0, 16);
|
||||||
memcpy(boot2_iv, &tmd.contents.index, 2); //just zero anyway...
|
memcpy(boot2_iv, &tmd.contents.index, 2); //just zero anyway...
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
u32 *kp = (u32*)boot2_key;
|
u32 *kp = (u32*)boot2_key;
|
||||||
gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]);
|
gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]);
|
||||||
|
#endif
|
||||||
|
|
||||||
boot2_content_size = (tmd.contents.size + 15) & ~15;
|
boot2_content_size = (tmd.contents.size + 15) & ~15;
|
||||||
gecko_printf("boot2 content size: 0x%x (padded: 0x%x)\n",
|
gecko_printf("boot2 content size: 0x%x (padded: 0x%x)\n",
|
||||||
|
|
|
@ -55,6 +55,8 @@ void exception_initialize(void)
|
||||||
|
|
||||||
void exc_handler(u32 type, u32 spsr, u32 *regs)
|
void exc_handler(u32 type, u32 spsr, u32 *regs)
|
||||||
{
|
{
|
||||||
|
(void) spsr;
|
||||||
|
|
||||||
if (type > 8) type = 8;
|
if (type > 8) type = 8;
|
||||||
gecko_printf("\nException %d (%s):\n", type, exceptions[type]);
|
gecko_printf("\nException %d (%s):\n", type, exceptions[type]);
|
||||||
|
|
||||||
|
|
11
gecko.c
11
gecko.c
|
@ -23,9 +23,6 @@ Copyright (C) 2009 Andre Heider "dhewg" <dhewg@wiibrew.org>
|
||||||
#include "powerpc_elf.h"
|
#include "powerpc_elf.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
|
|
||||||
//#define GECKO_LFCR
|
|
||||||
//#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)
|
||||||
|
@ -56,6 +53,7 @@ static u32 _gecko_getid(void)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
static u32 _gecko_sendbyte(u8 sendbyte)
|
static u32 _gecko_sendbyte(u8 sendbyte)
|
||||||
{
|
{
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
@ -64,6 +62,7 @@ static u32 _gecko_sendbyte(u8 sendbyte)
|
||||||
return 1; // Return 1 if byte was sent
|
return 1; // Return 1 if byte was sent
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static u32 _gecko_recvbyte(u8 *recvbyte)
|
static u32 _gecko_recvbyte(u8 *recvbyte)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +77,7 @@ static u32 _gecko_recvbyte(u8 *recvbyte)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GECKO_SAFE
|
#if !defined(NDEBUG) && defined(GECKO_SAFE)
|
||||||
static u32 _gecko_checksend(void)
|
static u32 _gecko_checksend(void)
|
||||||
{
|
{
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
@ -135,7 +134,7 @@ static int gecko_recvbuffer(void *buffer, u32 size)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef GECKO_SAFE
|
#if !defined(NDEBUG) && !defined(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;
|
||||||
|
@ -175,7 +174,7 @@ static int gecko_recvbuffer_safe(void *buffer, u32 size)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GECKO_SAFE
|
#if !defined(NDEBUG) && defined(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;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys, os, struct, sha
|
import sys, os, struct
|
||||||
|
|
||||||
loaderfile = sys.argv[1]
|
loaderfile = sys.argv[1]
|
||||||
elffile = sys.argv[2]
|
elffile = sys.argv[2]
|
||||||
|
|
2
nand.c
2
nand.c
|
@ -249,6 +249,8 @@ void nand_initialize(void)
|
||||||
|
|
||||||
int nand_correct(u32 pageno, void *data, void *ecc)
|
int nand_correct(u32 pageno, void *data, void *ecc)
|
||||||
{
|
{
|
||||||
|
(void) pageno;
|
||||||
|
|
||||||
u8 *dp = (u8*)data;
|
u8 *dp = (u8*)data;
|
||||||
u32 *ecc_read = (u32*)((u8*)ecc+0x30);
|
u32 *ecc_read = (u32*)((u8*)ecc+0x30);
|
||||||
u32 *ecc_calc = (u32*)((u8*)ecc+0x40);
|
u32 *ecc_calc = (u32*)((u8*)ecc+0x40);
|
||||||
|
|
2
utils.c
2
utils.c
|
@ -18,7 +18,7 @@ Copyright (C) 2008, 2009 Hector Martin "marcan" <marcan@marcansoft.com>
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifndef LOADER
|
#if !defined(LOADER) && !defined(NDEBUG)
|
||||||
static char ascii(char s) {
|
static char ascii(char s) {
|
||||||
if(s < 0x20) return '.';
|
if(s < 0x20) return '.';
|
||||||
if(s > 0x7E) return '.';
|
if(s > 0x7E) return '.';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user