Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libxenon/drivers/diskio/ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ xenon_atapi_inquiry_model(struct xenon_ata_device *dev) {

buf[8 + 24] = '\0';
strncpy(dev->model, &buf[8], sizeof(dev->model));
printf("ATAPI inquiry model: %s %d\n", dev->model);
printf("ATAPI inquiry model: %s\n", dev->model);

return 0;
}
Expand Down Expand Up @@ -703,7 +703,7 @@ xenon_ata_init1(struct xenon_ata_device *dev, uint32_t ioaddress, uint32_t ioadd
xenon_ata_regget2(dev, XENON_ATA_REG2_CONTROL);
xenon_ata_regget2(dev, XENON_ATA_REG2_CONTROL);

printf("SATA device at %08lx\n", dev->ioaddress);
printf("SATA device at %08x\n", dev->ioaddress);

return 0;
}
Expand Down
18 changes: 14 additions & 4 deletions libxenon/drivers/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Copyright (C) 2010-2011 Hector Martin "marcan" <hector@marcansoft.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
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#pragma GCC diagnostic ignored "-Wint-conversion"
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-variable"

#include <fcntl.h>
#include <libfdt/libfdt.h>
Expand All @@ -18,6 +25,7 @@ see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#include <time/time.h>
#include <unistd.h>
#include <xenon_soc/xenon_power.h>
#include <console/console.h>

#include "elf.h"
#include "elf_abi.h"
Expand Down Expand Up @@ -355,7 +363,7 @@ static int elf_VerifyHeaders(void *addr, int size) {
for (int i = 0; i < ehdr->e_phnum; i++) {
phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff + (i * sizeof(Elf32_Phdr)));
if (phdr->p_offset + phdr->p_filesz > size) {
printf("ELF: Program header %d exceeds file size! (0x%.8X > 0x%.8X)\n",
printf("ELF: Program header exceeds file size! (0x%.8X > 0x%.8X)\n",
phdr->p_offset + phdr->p_filesz, size);
return -1;
}
Expand All @@ -371,7 +379,7 @@ int elf_runFromMemory(void *addr, int size) {
int i;

if (elf_VerifyHeaders(addr, size) != 0) {
printf(" * Elf headers invalid, abort!\n", addr);
printf(" * Elf headers invalid, abort!\n");
return -1;
}

Expand All @@ -386,7 +394,7 @@ int elf_runFromMemory(void *addr, int size) {
return -1;
}

printf(" * Executing @ 0x%.8X size 0x%.8X...\n", addr, size);
printf(" * Executing @ %p size 0x%.8X...\n", addr, size);
shutdown_drivers();

// relocate our code
Expand Down Expand Up @@ -625,7 +633,7 @@ void kernel_relocate_initrd(void *start, size_t size) {
initrd_start = INITRD_RELOC_START;
initrd_size = size;

printf("Initrd at %p/0x%lx: %ld bytes (%ldKiB)\n", initrd_start,
printf("Initrd at %p/0x%x: %d bytes (%dKiB)\n", initrd_start,
(u32)PHYSADDR((u32)initrd_start), initrd_size, initrd_size / 1024);
}

Expand All @@ -651,3 +659,5 @@ void kernel_build_cmdline(const char *parameters, const char *root) {

printf("Kernel command line: '%s'\n", bootargs);
}

#pragma GCC diagnostic pop
9 changes: 8 additions & 1 deletion libxenon/drivers/iso9660/iso9660.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ ISO9660 systems, as these were used as references as well.

*/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wbool-compare"
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"

#include <iso9660/iso9660.h>
#include <xetypes.h>
#include <ppc/atomic.h>
Expand Down Expand Up @@ -1223,4 +1228,6 @@ const char *ISO9660_GetVolumeLabel(const char *name)
if (!check_dev_name(name, devname, sizeof(devname)))
return NULL;
return name;
}
}

#pragma GCC diagnostic pop
4 changes: 1 addition & 3 deletions libxenon/drivers/lwip/xenon/netif/enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <ppc/cache.h>
#include <pci/io.h>
#include <xenon_smc/xenon_gpio.h>
#include <malloc.h>

#define TX_DESCRIPTOR_NUM 0x10
#define RX_DESCRIPTOR_NUM 0x10
Expand Down Expand Up @@ -385,7 +386,6 @@ static void
enet_input(struct netif *netif)
{
struct enet_context *context = (struct enet_context *) netif->state;
struct eth_hdr *ethhdr;
struct pbuf *p;

p = enet_linkinput(context);
Expand All @@ -397,8 +397,6 @@ enet_input(struct netif *netif)
lwip_stats.link.recv++;
#endif /* LINK_STATS */

ethhdr = p->payload;

/* pass to network layer */
if (ethernet_input(p, netif) != ERR_OK) {
pbuf_free(p);
Expand Down
10 changes: 8 additions & 2 deletions libxenon/drivers/ppc/c_except.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wrestrict"
#pragma GCC diagnostic ignored "-Wformat-overflow"

#include <console/console.h>
#include <ppc/cache.h>
#include <ppc/register.h>
Expand Down Expand Up @@ -51,7 +55,7 @@ static void _cpu_print_stack(void *pc,void *lr,void *r1)
sprintf(text,"%s%p",text,(void*)l);
break;
default:
if(p && p->up) sprintf(text,"%s%p",text,(u32)(p->up->lr));
if(p && p->up) sprintf(text,"%s0x%x",text,(u32)(p->up->lr));
break;
}
}
Expand All @@ -78,7 +82,7 @@ void crashdump(u32 exception,u64 * context)
console_clrscr();

if (exception){
sprintf(text,"\nException vector! (%p)\n\n",exception);
sprintf(text,"\nException vector! (0x%x)\n\n",exception);
}else{
strcpy(text,"\nSegmentation fault!\n\n");
}
Expand Down Expand Up @@ -119,3 +123,5 @@ void crashdump(u32 exception,u64 * context)
}
}
}

#pragma GCC diagnostic pop
10 changes: 5 additions & 5 deletions libxenon/drivers/ppc/cache.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ memdcbt:
add %r4, %r4, %r3

1:
dcbt %r0, %r5
dcbt 0, %r5
addic %r5, %r5, CACHELINE_SIZE /* also clears carry */
subic. %r4, %r4, CACHELINE_SIZE
bge 1b
Expand All @@ -28,7 +28,7 @@ memdcbst:
add %r4, %r4, %r3

1:
dcbst %r0, %r5
dcbst 0, %r5
addic %r5, %r5, CACHELINE_SIZE /* also clears carry */
subic. %r4, %r4, CACHELINE_SIZE
bge 1b
Expand All @@ -45,7 +45,7 @@ memdcbf:
add %r4, %r4, %r3

1:
dcbf %r0, %r5
dcbf 0, %r5
addic %r5, %r5, CACHELINE_SIZE /* also clears carry */
subic. %r4, %r4, CACHELINE_SIZE
bge 1b
Expand All @@ -62,8 +62,8 @@ memicbi:
add %r4, %r4, %r3

1:
dcbst %r0, %r5
icbi %r0, %r5
dcbst 0, %r5
icbi 0, %r5
addic %r5, %r5, CACHELINE_SIZE /* also clears carry */
subic. %r4, %r4, CACHELINE_SIZE
bge 1b
Expand Down
5 changes: 5 additions & 0 deletions libxenon/drivers/usb/tinyehci/ehci.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
*/


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#pragma GCC diagnostic ignored "-Wunused-function"

/* magic numbers that can affect system performance */
#define EHCI_TUNE_CERR 0 /* 0-3 qtd retries; 0 == don't stop */ /* by Hermes: i have replaced 3 by 0 and now it don�t hang when i extract the device*/
Expand Down Expand Up @@ -1065,3 +1068,5 @@ int ehci_get_device_list(struct ehci_hcd * ehci, u8 maxdev, u8 b0, u8*num, u16*b

#include "usb2.c"
#include "usbstorage.c"

#pragma GCC diagnostic pop
2 changes: 1 addition & 1 deletion libxenon/drivers/usb/tinyehci/tinyehci.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static s32 EHCI_do_one(u32 idx,u32 addr)
ehci->caps = (void *)addr;
ehci->regs = (void *)(addr + HC_LENGTH(ehci_readl(&ehci->caps->hc_capbase)));

printf("Initialising EHCI bus %d at %p\n",idx,addr);
printf("Initialising EHCI bus %d at 0x%x\n",idx,addr);

/* Setup EHCI */
ehci->hcs_params = ehci_readl(&ehci->caps->hcs_params);
Expand Down
9 changes: 7 additions & 2 deletions libxenon/drivers/utils/debug.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wframe-address"

#include <stdlib.h>
#include <debug.h>
#include <ppc/register.h>
Expand Down Expand Up @@ -25,7 +28,7 @@ static int seems_valid(unsigned int p){
return p>=0x80000000 && p<(unsigned int)elfldr_start;
}

#define DO_RA(x) if(seems_valid(addr) && x<max_depth){ addr=(unsigned int)__builtin_return_address(x); printf("%p; ",addr); }
#define DO_RA(x) if(seems_valid(addr) && x<max_depth){ addr=(unsigned int)__builtin_return_address(x); printf("0x%x; ",addr); }

void stack_trace(int max_depth)
{
Expand Down Expand Up @@ -71,4 +74,6 @@ void data_breakpoint(void * address, int on_read, int on_write)
db|=2;

mtspr(dabr,db);
}
}

#pragma GCC diagnostic pop
4 changes: 2 additions & 2 deletions libxenon/drivers/utils/gmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static char sccsid[] = "@(#)gmon.c 8.1 (Berkeley) 6/4/93";
#include <fcntl.h>
#include <unistd.h>
#include <debug.h>
#include <stdlib.h>

char *minbrk;

Expand Down Expand Up @@ -174,9 +175,8 @@ _mcleanup()
if (p->state == GMON_PROF_ERROR)
ERR("_mcleanup: tos overflow\n");

size_t size = sizeof(clockinfo);

#if 0
size_t size = sizeof(clockinfo);
mib[0] = CTL_KERN;
mib[1] = KERN_CLOCKRATE;
if (sysctl(mib, 2, &clockinfo, &size, NULL, 0) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion libxenon/drivers/xb360/xb360.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ int xenon_logical_nand_data_ok()
int xenon_get_logical_nand_data(void* buf, unsigned int offset, unsigned int len)
{
if (xenon_logical_nand_data_ok() == 0)
memcpy(buf, (const void*)(0x80000200C8000000ULL + offset), len);
memcpy(buf, (const void*)(0x80000200C8000000ULL + (void *)offset), len);
else
return -1;
return 0;
Expand Down
5 changes: 3 additions & 2 deletions libxenon/drivers/xenon_nand/xenon_sfcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <time/time.h>
#include <xb360/xb360.h>
#include "xenon_sfcx.h"
Expand Down Expand Up @@ -594,7 +595,7 @@ int try_rawflash_internal(char *filename, bool ignoreMetadataCheck)
size = RAW_NAND_64;
else if((size != 0x1080000)&& (size != RAW_NAND_64)) // 16 M size
{
printf("error: %s - size %d is not valid image size!\n", filename, size);
printf("error: %s - size %ld is not valid image size!\n", filename, size);
close(f);
return -1;
}
Expand Down Expand Up @@ -628,7 +629,7 @@ int try_rawflash_internal(char *filename, bool ignoreMetadataCheck)
if (f < 0)
return f; //Can't open file!

printf("%s opened OK, attempting to write 0x%x bytes to flash...\n",filename, size);
printf("%s opened OK, attempting to write 0x%lx bytes to flash...\n",filename, size);
if(rawflash_writeImage(size, f) == 1)
printf("image written, shut down now!\n");
else
Expand Down
2 changes: 1 addition & 1 deletion libxenon/drivers/xenon_smc/xenon_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void uprintf(const char* format, ...) {
va_start(args, format);
char tmp[2048];
vsprintf(tmp, format, args);
uart_puts(tmp);
uart_puts((unsigned char *)tmp);
va_end(args);
}

Expand Down
1 change: 1 addition & 0 deletions libxenon/drivers/xenon_soc/xenon_power.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ int xenon_run_thread_task(int thread, void *stack, void *task);
int xenon_is_thread_task_running(int thread);
void xenon_sleep_thread(int thread);
void xenon_set_single_thread_mode();
int xenon_get_speed();

#ifdef __cplusplus
};
Expand Down
2 changes: 1 addition & 1 deletion libxenon/drivers/xenos/edram.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ int edram_p2(int r3, int r4, int r5, int r6, int r7, int r8, int r9, int r10)
udelay(5000);
if (xenos_read32(0x3c94) & 0x80000000)
{
printf("ping test: %08lx\n", xenos_read32(0x3c94));
printf("ping test: %08x\n", xenos_read32(0x3c94));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion libxenon/drivers/xenos/xenos.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void xenos_ana_write(int addr, uint32_t reg)
cycle++;
}
if (cycle == 1000)
printf("\nxenos_ana_write - addr: 0x%X reg: 0x%X - FAILED!\n");
printf("\nxenos_ana_write - addr: 0x%X reg: 0x%X - FAILED!\n", addr, reg);
}

static int isCoronaOrWinchester()
Expand Down
5 changes: 2 additions & 3 deletions libxenon/ports/xenon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ INCLUDES = -I ../../drivers -I ../../include \
CFLAGS = -g -mcpu=cell -mtune=cell -Os \
-maltivec \
-ffunction-sections -fdata-sections \
-Wall -Wno-format -Wno-attributes -I. -DBYTE_ORDER=BIG_ENDIAN \
-Wall -Werror -I. -DBYTE_ORDER=BIG_ENDIAN \
-m32 -fno-pic -mpowerpc64 \
-D_CFE_=1 -DENDIAN_BIG=1 \
$(INCLUDES)

# we need to fix the toolchain to work with multilib here.
LIBDIR32 = $(DEVKITXENON)/xenon/lib/32/

CXXFLAGS = $(CFLAGS) -fpermissive -Wno-sign-compare -Werror=int-to-pointer-cast \
-Werror=pointer-to-int-cast -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-variable
CXXFLAGS = $(CFLAGS) -fpermissive

AFLAGS = -Iinclude -m32 $(INCLUDES)

Expand Down
3 changes: 3 additions & 0 deletions libxenon/startup/xenon/crt1.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "xetypes.h"
#include <stdlib.h>

extern int main(int argc, char **argv);

void call_ctors(void)
{
Expand Down
4 changes: 2 additions & 2 deletions libxenon/startup/xenon/startup_from_xell.S
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ return_to_xell:

1: lwz %r8,0(%r5) //Memcopy
stw %r8,0(%r6)
dcbst %r0,%r6 //Flush cache to ram
icbi %r0,%r6
dcbst 0,%r6 //Flush cache to ram
icbi 0,%r6
sync 0
isync
addi %r6,%r6,4
Expand Down
Loading