powerpc bootloader: Remove warnings

This code is shared by multiple PowerPC BSPs including all
motorola_powerpc variants.
This commit is contained in:
Joel Sherrill
2014-10-09 16:40:20 -05:00
parent f95f212af4
commit 4abbc567ee
7 changed files with 57 additions and 29 deletions

View File

@@ -1,6 +1,8 @@
/* /*
* bootldr.h -- Include file for bootloader. * bootldr.h -- Include file for bootloader.
* */
/*
* Copyright (C) 1998, 1999 Gabriel Paubert, paubert@iram.es * Copyright (C) 1998, 1999 Gabriel Paubert, paubert@iram.es
* *
* Modified to compile in RTEMS development environment * Modified to compile in RTEMS development environment
@@ -206,6 +208,19 @@ void cleanup_v86_mess(void);
void em86_main(struct pci_dev *); void em86_main(struct pci_dev *);
int find_max_mem(struct pci_dev *); int find_max_mem(struct pci_dev *);
/*
* Prototypes for calls from assembly and across files.
*/
typedef struct _x86 x86;
int em86_trap(x86 *p);
void decompress_kernel(int kernel_size, void * zimage_start, int len,
void * initrd_start, int initrd_len );
void boot_udelay(uint32_t _microseconds);
void setup_hw(void);
void _handler(int vec, ctxt *p);
int early_setup(u_long image_size);
void mm_init(u_long image_size);
#endif #endif
#ifdef ASM #ifdef ASM

View File

@@ -1,6 +1,8 @@
/* /*
* em86.c -- Include file for bootloader. * em86.c -- Include file for bootloader.
* */
/*
* Copyright (C) 1998, 1999 Gabriel Paubert, paubert@iram.es * Copyright (C) 1998, 1999 Gabriel Paubert, paubert@iram.es
* *
* Modified to compile in RTEMS development environment * Modified to compile in RTEMS development environment
@@ -132,7 +134,7 @@ static void dump86(x86 * p){
#define dump86(x) #define dump86(x)
#endif #endif
int bios86pci(x86 * p) { static int bios86pci(x86 * p) {
unsigned reg=ld_le16(&DI); unsigned reg=ld_le16(&DI);
reg_type2 tmp; reg_type2 tmp;
@@ -190,21 +192,21 @@ int bios86pci(x86 * p) {
return 0; return 0;
} }
void push2(x86 *p, unsigned value) { static void push2(x86 *p, unsigned value) {
unsigned char * sbase= p->ssbase; unsigned char * sbase= p->ssbase;
unsigned newsp = (ld_le16(&SP)-2)&0xffff; unsigned newsp = (ld_le16(&SP)-2)&0xffff;
st_le16(&SP,newsp); st_le16(&SP,newsp);
st_le16((unsigned short *)(sbase+newsp), value); st_le16((unsigned short *)(sbase+newsp), value);
} }
unsigned pop2(x86 *p) { static unsigned pop2(x86 *p) {
unsigned char * sbase=p->ssbase; unsigned char * sbase=p->ssbase;
unsigned oldsp = ld_le16(&SP); unsigned oldsp = ld_le16(&SP);
st_le16(&SP,oldsp+2); st_le16(&SP,oldsp+2);
return ld_le16((unsigned short *)(sbase+oldsp)); return ld_le16((unsigned short *)(sbase+oldsp));
} }
int int10h(x86 * p) { /* Process BIOS video interrupt */ static int int10h(x86 * p) { /* Process BIOS video interrupt */
unsigned vector; unsigned vector;
vector=ld_le32((uint32_t *)p->vbase+0x10); vector=ld_le32((uint32_t *)p->vbase+0x10);
if (((vector&0xffff0000)>>16)==0xc000) { if (((vector&0xffff0000)>>16)==0xc000) {
@@ -240,7 +242,7 @@ int int10h(x86 * p) { /* Process BIOS video interrupt */
} }
} }
int process_softint(x86 * p) { static int process_softint(x86 * p) {
#if 0 #if 0
if (p->parm1!=0x10 || AH!=0x0e) { if (p->parm1!=0x10 || AH!=0x0e) {
printf("Soft interrupt\n"); printf("Soft interrupt\n");

View File

@@ -5,14 +5,26 @@
* from newlib or rtems because they are not compiled with the right option!!! * from newlib or rtems because they are not compiled with the right option!!!
* *
* You've been warned!!!. * You've been warned!!!.
* */
* CopyRight (C) 1998, 1999 valette@crf.canon.fr
/*
* Copyright (C) 1998, 1999 valette@crf.canon.fr
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE. * http://www.rtems.org/license/LICENSE.
*/ */
/*
* Provide our own prototypes to avoid warnings and risk getting inlined
* conflicts from the normal header files.
*/
void* memset(void *p, int c, unsigned int n);
void* memcpy(void *dst, const void * src, unsigned int n);
char* strcat(char * dest, const char * src);
int strlen(const char* string);
void* memset(void *p, int c, unsigned int n) void* memset(void *p, int c, unsigned int n)
{ {
char *q =p; char *q =p;

View File

@@ -86,7 +86,7 @@ void hang(const char *s, u_long x, ctxt *p) {
exit(); exit();
}; };
void *zalloc(void *x, unsigned items, unsigned size) static void *zalloc(void *x, unsigned items, unsigned size)
{ {
void *p = salloc(items*size); void *p = salloc(items*size);
@@ -96,7 +96,7 @@ void *zalloc(void *x, unsigned items, unsigned size)
return p; return p;
} }
void zfree(void *x, void *addr, unsigned nb) static void zfree(void *x, void *addr, unsigned nb)
{ {
sfree(addr); sfree(addr);
} }
@@ -230,9 +230,11 @@ void decompress_kernel(int kernel_size, void * zimage_start, int len,
static int ticks_per_ms=0; static int ticks_per_ms=0;
/* this is from rtems_bsp_delay from libcpu */ /*
* This is based on rtems_bsp_delay from libcpu
*/
void void
boot_udelay(uint32_t _microseconds) boot_udelay(uint32_t _microseconds)
{ {
uint32_t start, ticks, now; uint32_t start, ticks, now;
@@ -252,9 +254,6 @@ setup_hw(void)
struct pci_dev *default_vga; struct pci_dev *default_vga;
int timer, err; int timer, err;
u_short default_vga_cmd; u_short default_vga_cmd;
static unsigned int indic;
indic = 0;
res=bd->residual; res=bd->residual;
default_vga=NULL; default_vga=NULL;

View File

@@ -129,7 +129,6 @@ void print_maps(map *, const char *);
/* The handler used for all exceptions although for now it is only /* The handler used for all exceptions although for now it is only
* designed to properly handle MMU interrupts to fill the hash table. * designed to properly handle MMU interrupts to fill the hash table.
*/ */
void _handler(int vec, ctxt *p) { void _handler(int vec, ctxt *p) {
map *area; map *area;
struct _mm_private *mm = (struct _mm_private *) bd->mm_private; struct _mm_private *mm = (struct _mm_private *) bd->mm_private;
@@ -424,7 +423,7 @@ MEM_MAP seg_fix[] = {
* data. This routine changes some things in a way that the bootloader and * data. This routine changes some things in a way that the bootloader and
* linux are happy. * linux are happy.
*/ */
void static void
fix_residual( RESIDUAL *res ) fix_residual( RESIDUAL *res )
{ {
#if 0 #if 0

View File

@@ -713,7 +713,7 @@ static const struct pci_bootloader_config_access_functions direct_functions = {
direct_pci_write_config_dword direct_pci_write_config_dword
}; };
void pci_read_bases(struct pci_dev *dev, unsigned int howmany) static void pci_read_bases(struct pci_dev *dev, unsigned int howmany)
{ {
unsigned int reg, nextreg; unsigned int reg, nextreg;
@@ -798,7 +798,7 @@ void pci_read_bases(struct pci_dev *dev, unsigned int howmany)
} }
} }
u_int pci_scan_bus(struct pci_bus *bus) static u_int pci_scan_bus(struct pci_bus *bus)
{ {
unsigned int devfn, max; unsigned int devfn, max;
uint32_t class; uint32_t class;

View File

@@ -443,15 +443,15 @@ int debug_tstc(void)
#define vidmem ((__io_ptr)(ptr_mem_map->isa_mem_base+0xb8000)) #define vidmem ((__io_ptr)(ptr_mem_map->isa_mem_base+0xb8000))
void vacuum_putc(u_char c) { static void vacuum_putc(u_char c) {
console_global_data.vacuum_sent++; console_global_data.vacuum_sent++;
} }
int vacuum_getc(void) { static int vacuum_getc(void) {
return -1; return -1;
} }
int vacuum_tstc(void) { static int vacuum_tstc(void) {
return 0; return 0;
} }
@@ -496,7 +496,7 @@ static void pfree(void* p)
} }
#endif #endif
void log_putc(const u_char c) { static void log_putc(const u_char c) {
console_log *l; console_log *l;
for(l=console_global_data.log; l; l=l->next) { for(l=console_global_data.log; l; l=l->next) {
if (l->offset<PAGE_LOG_CHARS) break; if (l->offset<PAGE_LOG_CHARS) break;
@@ -549,19 +549,19 @@ void flush_log(void) {
#error "BSP probably didn't define a console port" #error "BSP probably didn't define a console port"
#endif #endif
void serial_putc(const u_char c) static void serial_putc(const u_char c)
{ {
while ((INL_CONSOLE_INB(lsr) & LSR_THRE) == 0) ; while ((INL_CONSOLE_INB(lsr) & LSR_THRE) == 0) ;
INL_CONSOLE_OUTB(thr, c); INL_CONSOLE_OUTB(thr, c);
} }
int serial_getc(void) static int serial_getc(void)
{ {
while ((INL_CONSOLE_INB(lsr) & LSR_DR) == 0) ; while ((INL_CONSOLE_INB(lsr) & LSR_DR) == 0) ;
return (INL_CONSOLE_INB(rbr)); return (INL_CONSOLE_INB(rbr));
} }
int serial_tstc(void) static int serial_tstc(void)
{ {
return ((INL_CONSOLE_INB(lsr) & LSR_DR) != 0); return ((INL_CONSOLE_INB(lsr) & LSR_DR) != 0);
} }
@@ -592,7 +592,7 @@ cursor(int x, int y)
vga_outb(0x15, pos); vga_outb(0x15, pos);
} }
void static void
vga_putc(const u_char c) vga_putc(const u_char c)
{ {
int x,y; int x,y;
@@ -811,7 +811,7 @@ int kbdreset(void)
return 0; return 0;
} }
int kbd_tstc(void) static int kbd_tstc(void)
{ {
return ((kbd_inb(KBD_STATUS_REG) & KBD_STAT_OBF) != 0); return ((kbd_inb(KBD_STATUS_REG) & KBD_STAT_OBF) != 0);
} }
@@ -895,6 +895,7 @@ void printk(const char *fmt, ...) {
va_start(args, fmt); va_start(args, fmt);
i = k_vsprintf(buf, fmt, args); i = k_vsprintf(buf, fmt, args);
(void) i; /* avoid set but not used warning */
va_end(args); va_end(args);
my_puts((u_char*)buf); my_puts((u_char*)buf);
} }