mirror of
https://github.com/fail0verflow/mini.git
synced 2025-02-21 05:52:01 +01:00
trivial whitespace fixes
This commit is contained in:
parent
49c33236df
commit
8e1f68f0cb
12
boot2.c
12
boot2.c
@ -142,7 +142,8 @@ static inline u32 boot2_page_translate(u32 page)
|
||||
static int read_to(u32 bytes)
|
||||
{
|
||||
if(bytes > (valid_blocks * BLOCK_SIZE * PAGE_SIZE)) {
|
||||
gecko_printf("tried to read %d boot2 bytes (%d pages), but only %d blocks (%d pages) are valid!\n", bytes, (bytes+(PAGE_SIZE-1)) / PAGE_SIZE, valid_blocks, valid_blocks * BLOCK_SIZE);
|
||||
gecko_printf("tried to read %d boot2 bytes (%d pages), but only %d blocks (%d pages) are valid!\n",
|
||||
bytes, (bytes+(PAGE_SIZE-1)) / PAGE_SIZE, valid_blocks, valid_blocks * BLOCK_SIZE);
|
||||
return -1;
|
||||
}
|
||||
while(bytes > ((u32)pages_read * PAGE_SIZE)) {
|
||||
@ -186,7 +187,8 @@ int boot2_load(int copy)
|
||||
}
|
||||
mapno = find_valid_map(maps);
|
||||
if(mapno >= 0) {
|
||||
gecko_printf("found valid boot2 blockmap at page 0x%x, submap %d, generation %d\n", page, mapno, maps[mapno].generation);
|
||||
gecko_printf("found valid boot2 blockmap at page 0x%x, submap %d, generation %d\n",
|
||||
page, mapno, maps[mapno].generation);
|
||||
if(maps[mapno].generation >= good_blockmap.generation) {
|
||||
memcpy(&good_blockmap, &maps[mapno], sizeof(boot2blockmap));
|
||||
found = 1;
|
||||
@ -270,7 +272,8 @@ int boot2_load(int copy)
|
||||
gecko_printf("boot2 title key: %08x%08x%08x%08x\n", kp[0], kp[1], kp[2], kp[3]);
|
||||
|
||||
boot2_content_size = (boot2_tmd.boot_content.size + 15) & ~15;
|
||||
gecko_printf("boot2 content size: 0x%x (padded: 0x%x)\n", (u32)boot2_tmd.boot_content.size, boot2_content_size);
|
||||
gecko_printf("boot2 content size: 0x%x (padded: 0x%x)\n",
|
||||
(u32)boot2_tmd.boot_content.size, boot2_content_size);
|
||||
|
||||
// read content
|
||||
if(read_to(hdr->data_offset + boot2_content_size) < 0) {
|
||||
@ -285,7 +288,7 @@ int boot2_load(int copy)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void boot2_init() {
|
||||
void boot2_init(void) {
|
||||
boot2_copy = -1;
|
||||
boot2_initialized = 0;
|
||||
if(boot2_load(0) < 0) {
|
||||
@ -359,7 +362,6 @@ u32 boot2_ipc(volatile ipc_request *req)
|
||||
} else {
|
||||
ipc_post(req->code, req->tag, 1, -1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case IPC_BOOT2_TMD:
|
||||
|
@ -7,6 +7,7 @@ Copyright (C) 2008, 2009 Sven Peter <svenpeter@gmail.com>
|
||||
# This code is licensed to you under the terms of the GNU GPL, version 2;
|
||||
# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||
*/
|
||||
|
||||
#ifndef __BSDTYPES_H__
|
||||
#define __BSDTYPES_H__
|
||||
|
||||
|
6
crypto.c
6
crypto.c
@ -40,7 +40,7 @@ void crypto_read_seeprom(void)
|
||||
seeprom_read(&seeprom, 0, sizeof(seeprom) / 2);
|
||||
}
|
||||
|
||||
void crypto_initialize()
|
||||
void crypto_initialize(void)
|
||||
{
|
||||
crypto_read_otp();
|
||||
crypto_read_seeprom();
|
||||
@ -70,7 +70,7 @@ void crypto_ipc(volatile ipc_request *req)
|
||||
|
||||
static int _aes_irq = 0;
|
||||
|
||||
void aes_irq()
|
||||
void aes_irq(void)
|
||||
{
|
||||
_aes_irq = 1;
|
||||
}
|
||||
@ -99,7 +99,7 @@ void aes_set_iv(u8 *iv)
|
||||
}
|
||||
}
|
||||
|
||||
void aes_empty_iv()
|
||||
void aes_empty_iv(void)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 4; i++)
|
||||
|
11
diskio.c
11
diskio.c
@ -20,7 +20,6 @@ Copyright (C) 2008, 2009 Haxx Enterprises <bushing@gmail.com>
|
||||
static u8 buffer[512] MEM2_BSS ALIGNED(32);
|
||||
|
||||
// Initialize a Drive
|
||||
|
||||
DSTATUS disk_initialize (BYTE drv) {
|
||||
if (sdmmc_check_card(SDMMC_DEFAULT_DEVICE) == SDMMC_NO_CARD)
|
||||
return STA_NOINIT;
|
||||
@ -29,10 +28,7 @@ DSTATUS disk_initialize (BYTE drv) {
|
||||
return disk_status(drv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Return Disk Status
|
||||
|
||||
DSTATUS disk_status (BYTE drv) {
|
||||
(void)drv;
|
||||
if (sdmmc_check_card(SDMMC_DEFAULT_DEVICE) == SDMMC_INSERTED)
|
||||
@ -41,10 +37,7 @@ DSTATUS disk_status (BYTE drv) {
|
||||
return STA_NODISK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Read Sector(s)
|
||||
|
||||
DRESULT disk_read (BYTE drv, BYTE *buff, DWORD sector, BYTE count) {
|
||||
int i;
|
||||
(void)drv;
|
||||
@ -57,10 +50,7 @@ DRESULT disk_read (BYTE drv, BYTE *buff, DWORD sector, BYTE count) {
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Write Sector(s)
|
||||
|
||||
#if _READONLY == 0
|
||||
DRESULT disk_write (BYTE drv, const BYTE *buff, DWORD sector, BYTE count) {
|
||||
int i;
|
||||
@ -84,4 +74,3 @@ DRESULT disk_ioctl (BYTE drv, BYTE ctrl, void *buff) {
|
||||
return RES_PARERR;
|
||||
}
|
||||
#endif /* _USE_IOCTL */
|
||||
|
||||
|
@ -18,7 +18,8 @@ Copyright (C) 2008, 2009 Haxx Enterprises <bushing@gmail.com>
|
||||
#include "panic.h"
|
||||
|
||||
const char *exceptions[] = {
|
||||
"RESET", "UNDEFINED INSTR", "SWI", "INSTR ABORT", "DATA ABORT", "RESERVED", "IRQ", "FIQ", "(unknown exception type)"
|
||||
"RESET", "UNDEFINED INSTR", "SWI", "INSTR ABORT", "DATA ABORT",
|
||||
"RESERVED", "IRQ", "FIQ", "(unknown exception type)"
|
||||
};
|
||||
|
||||
const char *aborts[] = {
|
||||
|
10
hollywood.h
10
hollywood.h
@ -99,7 +99,6 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
#define HW_OTPDATA (HW_REG_BASE + 0x1f0)
|
||||
#define HW_VERSION (HW_REG_BASE + 0x214)
|
||||
|
||||
|
||||
/* NAND Registers */
|
||||
|
||||
#define NAND_REG_BASE 0xd010000
|
||||
@ -114,8 +113,6 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
#define NAND_UNK1 (NAND_REG_BASE + 0x018)
|
||||
#define NAND_UNK2 (NAND_REG_BASE + 0x01c)
|
||||
|
||||
|
||||
|
||||
/* AES Registers */
|
||||
|
||||
#define AES_REG_BASE 0xd020000
|
||||
@ -126,8 +123,6 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
#define AES_KEY (AES_REG_BASE + 0x00c)
|
||||
#define AES_IV (AES_REG_BASE + 0x010)
|
||||
|
||||
|
||||
|
||||
/* SHA-1 Registers */
|
||||
|
||||
#define SHA_REG_BASE 0xd030000
|
||||
@ -140,8 +135,6 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
#define SHA_H3 (SHA_REG_BASE + 0x014)
|
||||
#define SHA_H4 (SHA_REG_BASE + 0x018)
|
||||
|
||||
|
||||
|
||||
/* SD Host Controller Registers */
|
||||
|
||||
#define SDHC_REG_BASE 0xd070000
|
||||
@ -173,8 +166,6 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
|
||||
#define EXI_BOOT_BASE (EXI_REG_BASE+0x040)
|
||||
|
||||
|
||||
|
||||
/* MEMORY CONTROLLER Registers */
|
||||
|
||||
#define MEM_REG_BASE 0xd8b4000
|
||||
@ -185,4 +176,3 @@ Copyright (C) 2008, 2009 John Kelley <wiidev@kelley.ca>
|
||||
#define MEM_FLUSHACK (MEM_REG_BASE+0x22a)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -4,10 +4,6 @@
|
||||
|
||||
#ifndef _INTEGER
|
||||
|
||||
#if 0
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
||||
/* These types must be 16-bit, 32-bit or larger integer */
|
||||
typedef int INT;
|
||||
typedef unsigned int UINT;
|
||||
@ -31,7 +27,5 @@ typedef unsigned long DWORD;
|
||||
/* Boolean type */
|
||||
typedef enum { FALSE = 0, TRUE } BOOL;
|
||||
|
||||
#endif
|
||||
|
||||
#define _INTEGER
|
||||
#endif
|
||||
|
7
memory.h
7
memory.h
@ -48,26 +48,31 @@ static inline u32 get_cr(void)
|
||||
__asm__ volatile ( "mrc\tp15, 0, %0, c1, c0, 0" : "=r" (data) );
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline u32 get_ttbr(void)
|
||||
{
|
||||
u32 data;
|
||||
__asm__ volatile ( "mrc\tp15, 0, %0, c2, c0, 0" : "=r" (data) );
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline u32 get_dacr(void)
|
||||
{
|
||||
u32 data;
|
||||
__asm__ volatile ( "mrc\tp15, 0, %0, c3, c0, 0" : "=r" (data) );
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline void set_cr(u32 data)
|
||||
{
|
||||
__asm__ volatile ( "mcr\tp15, 0, %0, c1, c0, 0" :: "r" (data) );
|
||||
}
|
||||
|
||||
static inline void set_ttbr(u32 data)
|
||||
{
|
||||
__asm__ volatile ( "mcr\tp15, 0, %0, c2, c0, 0" :: "r" (data) );
|
||||
}
|
||||
|
||||
static inline void set_dacr(u32 data)
|
||||
{
|
||||
__asm__ volatile ( "mcr\tp15, 0, %0, c3, c0, 0" :: "r" (data) );
|
||||
@ -79,12 +84,14 @@ static inline u32 get_dfsr(void)
|
||||
__asm__ volatile ( "mrc\tp15, 0, %0, c5, c0, 0" : "=r" (data) );
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline u32 get_ifsr(void)
|
||||
{
|
||||
u32 data;
|
||||
__asm__ volatile ( "mrc\tp15, 0, %0, c5, c0, 1" : "=r" (data) );
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline u32 get_far(void)
|
||||
{
|
||||
u32 data;
|
||||
|
4
nand.h
4
nand.h
@ -40,9 +40,7 @@ void nand_read_cluster(u32 clusterno, void *data);
|
||||
#define NAND_ECC_UNCORRECTABLE -1
|
||||
|
||||
int nand_correct(u32 pageno, void *data, void *ecc);
|
||||
|
||||
void nand_initialize();
|
||||
|
||||
void nand_initialize(void);
|
||||
void nand_ipc(volatile ipc_request *req);
|
||||
|
||||
#endif
|
||||
|
@ -46,7 +46,7 @@ void powerpc_upload_stub(u32 entry)
|
||||
clear32(HW_EXICTRL, EXICTRL_ENABLE_EXI);
|
||||
}
|
||||
|
||||
void powerpc_hang()
|
||||
void powerpc_hang(void)
|
||||
{
|
||||
clear32(HW_RESETS, 0x30);
|
||||
udelay(100);
|
||||
@ -54,7 +54,7 @@ void powerpc_hang()
|
||||
udelay(100);
|
||||
}
|
||||
|
||||
void powerpc_reset()
|
||||
void powerpc_reset(void)
|
||||
{
|
||||
// enable the broadway IPC interrupt
|
||||
write32(HW_PPCIRQMASK, (1<<30));
|
||||
|
Loading…
x
Reference in New Issue
Block a user