diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-12-28 18:30:50 +0100 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-12-28 18:38:39 +0100 |
commit | 8536acbc9f7b527d72011110ec15baa85ed278a8 (patch) | |
tree | d1187d080ef3cae1343bbd4b10a0967ed9b39e3e /board-js2x | |
parent | 23c9ac89811b6c01f6f54860eeb3c77252a3b6a8 (diff) | |
download | SLOF-8536acbc9f7b527d72011110ec15baa85ed278a8.zip SLOF-8536acbc9f7b527d72011110ec15baa85ed278a8.tar.gz SLOF-8536acbc9f7b527d72011110ec15baa85ed278a8.tar.bz2 |
Enabled -Wmissing-prototypes and -Wstrict-prototypes CFLAGS and cleaned up
These two compiler flags for additional warnings help to improve the quality
of the source code: Removed some unused code and fixed some obvious bugs.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'board-js2x')
-rw-r--r-- | board-js2x/llfw/stage2.c | 29 | ||||
-rw-r--r-- | board-js2x/llfw/u4mem.c | 21 | ||||
-rw-r--r-- | board-js2x/rtas/rtas_out.c | 9 | ||||
-rw-r--r-- | board-js2x/rtas/rtas_pci.c | 29 |
4 files changed, 45 insertions, 43 deletions
diff --git a/board-js2x/llfw/stage2.c b/board-js2x/llfw/stage2.c index 9cc9801..d05a494 100644 --- a/board-js2x/llfw/stage2.c +++ b/board-js2x/llfw/stage2.c @@ -34,11 +34,16 @@ typedef void (*pInterruptFunc_t) (void); pInterruptFunc_t vectorTable[0x2E << 1]; -void c_memInit(uint64_t r3, uint64_t r4); +extern void proceedInterrupt(void); -void proceedInterrupt(); +/* Prototypes for functions in this file: */ +void c_interrupt(uint64_t vecNum); +void set_exceptionVector(int num, void *func); +int io_getchar(char *ch); +void early_c_entry(uint64_t start_addr); -void + +static void exception_forward(void) { uint64_t val; @@ -102,22 +107,6 @@ io_getchar(char *ch) return retVal; } -uint64_t -get_dec(void) -{ - return 0xdeadaffe; -} - -void -set_dec(uint64_t val) -{ -} - -uint64_t -tb_frequency(void) -{ - return 0; -} void copy_from_flash(uint64_t cnt, uint64_t src, uint64_t dest); @@ -134,7 +123,7 @@ const uint32_t CrcTableLow[16] = { 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD }; -unsigned long +static unsigned long check_flash_image(unsigned long rombase, unsigned long length, unsigned long start_crc) { diff --git a/board-js2x/llfw/u4mem.c b/board-js2x/llfw/u4mem.c index c3e6494..17fa857 100644 --- a/board-js2x/llfw/u4mem.c +++ b/board-js2x/llfw/u4mem.c @@ -3355,9 +3355,9 @@ u4_start( eccerror_t *f_ecc_pt ) #undef RND +#if 0 void u4_memtest(uint8_t argCnt, char *pArgs[], uint64_t flags) - { #define TEND 99 #define TCHK 100 @@ -3786,7 +3786,9 @@ mtend: and32_ci( MCCR_R, ~( IBIT(6) | IBIT(7) ) ); } +#endif +#if 0 void u4_dump(uint8_t argCnt, char *pArgs[], uint64_t flags) { @@ -3830,8 +3832,9 @@ u4_dump(uint8_t argCnt, char *pArgs[], uint64_t flags) printf( "scrub start (0x%04X): 0x%08X\r\n", (uint16_t) MSRSR_R, load32_ci( MSRSR_R ) ); printf( "scrub end (0x%04X): 0x%08X\r\n", (uint16_t) MSRER_R, load32_ci( MSRER_R ) ); } +#endif -int32_t +static int32_t u4_memBegin( eccerror_t *f_ecc_pt ) { int32_t i; @@ -3962,8 +3965,9 @@ u4_memBegin( eccerror_t *f_ecc_pt ) return RET_OK; } -static int32_t scrubstarted = 0; +#if 0 +static int32_t scrubstarted = 0; void u4_scrubStart(uint8_t argCnt, char *pArgs[], uint64_t flags ) { @@ -3990,7 +3994,9 @@ u4_scrubStart(uint8_t argCnt, char *pArgs[], uint64_t flags ) store32_ci( MSCR_R, IBIT(1) ); printf( "\r\nscrub started\r\n" ); } +#endif +#if 0 void u4_scrubEnd(uint8_t argCnt, char *pArgs[], uint64_t flags ) { @@ -3998,7 +4004,9 @@ u4_scrubEnd(uint8_t argCnt, char *pArgs[], uint64_t flags ) scrubstarted = 0; printf( "\r\nscrub stopped\r\n" ); } +#endif +#if 0 void u4_memwr(uint8_t argCnt, char *pArgs[], uint64_t flags ) { @@ -4015,6 +4023,7 @@ u4_memwr(uint8_t argCnt, char *pArgs[], uint64_t flags ) } } +#endif void u4memInit() @@ -4054,9 +4063,3 @@ u4memInit() } while( ret < RET_ERR ); } - -void -monitorDDR2( uint8_t argCnt, char *pArgs[], uint64_t flags ) -{ - u4memInit(); -} diff --git a/board-js2x/rtas/rtas_out.c b/board-js2x/rtas/rtas_out.c index 8da1dd4..ce4c00b 100644 --- a/board-js2x/rtas/rtas_out.c +++ b/board-js2x/rtas/rtas_out.c @@ -18,10 +18,15 @@ #include <unistd.h> #include <rtas.h> #include <hw.h> +#include "rtas_board.h" volatile unsigned char *uart; volatile unsigned char u4Flag; +void io_init(void); +unsigned long check_flash_image(unsigned long rombase, unsigned long length, + unsigned long start_crc); + void io_init(void) { @@ -72,12 +77,12 @@ sbrk(int incr __attribute((unused))) -int +void rtas_display_character(rtas_args_t * pArgs) { int retVal = 0; display_char((char) pArgs->args[0]); - return retVal; + pArgs->args[1] = retVal; } unsigned long diff --git a/board-js2x/rtas/rtas_pci.c b/board-js2x/rtas/rtas_pci.c index 610c326..55dbf53 100644 --- a/board-js2x/rtas/rtas_pci.c +++ b/board-js2x/rtas/rtas_pci.c @@ -12,9 +12,11 @@ #include <stdint.h> #include <rtas.h> #include <hw.h> +#include "rtas_board.h" -int -rtas_ibm_read_pci_config (rtas_args_t *rtas_args) { +void +rtas_ibm_read_pci_config (rtas_args_t *rtas_args) +{ int retVal = 0; uint64_t addr = ((uint64_t) rtas_args->args[1]) << 32; // high 32 bits of PHB UID addr |= (rtas_args->args[2] & 0xFFFFFFFF); // low 32 bits of PHB UID @@ -34,11 +36,12 @@ rtas_ibm_read_pci_config (rtas_args_t *rtas_args) { else retVal = -3; /* Bad arguments */ - return retVal; + rtas_args->args[4] = retVal; } -int -rtas_ibm_write_pci_config (rtas_args_t *rtas_args) { +void +rtas_ibm_write_pci_config (rtas_args_t *rtas_args) +{ int retVal = 0; uint64_t addr = ((uint64_t) rtas_args->args[1]) << 32; // high 32 bits of PHB UID addr |= (rtas_args->args[2] & 0xFFFFFFFF); // low 32 bits of PHB UID @@ -60,11 +63,12 @@ rtas_ibm_write_pci_config (rtas_args_t *rtas_args) { else retVal = -3; /* Bad arguments */ - return retVal; + rtas_args->args[5] = retVal; } -int -rtas_read_pci_config (rtas_args_t *rtas_args) { +void +rtas_read_pci_config (rtas_args_t *rtas_args) +{ int retVal = 0; unsigned long addr = rtas_args->args[0]; unsigned int size = rtas_args->args[1]; @@ -83,11 +87,12 @@ rtas_read_pci_config (rtas_args_t *rtas_args) { else retVal = -3; /* Bad arguments */ - return retVal; + rtas_args->args[2] = retVal; } -int -rtas_write_pci_config (rtas_args_t *rtas_args) { +void +rtas_write_pci_config (rtas_args_t *rtas_args) +{ int retVal = 0; unsigned long addr = rtas_args->args[0]; unsigned int size = rtas_args->args[1]; @@ -107,5 +112,5 @@ rtas_write_pci_config (rtas_args_t *rtas_args) { else retVal = -3; /* Bad arguments */ - return retVal; + rtas_args->args[3] = retVal; } |