Made compiler more picky by adding -Wall to CFLAGS.

This showed up more warnings where some are already fixed.
This commit is contained in:
Markus Fröschle
2012-10-14 09:24:25 +00:00
parent ae64ac19de
commit be0bd52d45
10 changed files with 63 additions and 77 deletions

View File

@@ -39,14 +39,9 @@
<externalSettings/> <externalSettings/>
<extensions> <extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.linuxtools.internal.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions> </extensions>
</storageModule> </storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -57,6 +52,9 @@
<option id="cdt.managedbuild.option.gnu.cross.path.1369935770" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/> <option id="cdt.managedbuild.option.gnu.cross.path.1369935770" name="Path" superClass="cdt.managedbuild.option.gnu.cross.path"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1544284446" isAbstract="false" osList="all"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1544284446" isAbstract="false" osList="all"/>
<builder buildPath="${workspace_loc:/BaS_GNU}" id="cdt.managedbuild.builder.gnu.cross.2120667679" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder"/> <builder buildPath="${workspace_loc:/BaS_GNU}" id="cdt.managedbuild.builder.gnu.cross.2120667679" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1136616288" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.2090138476" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.359669870" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler"/>
</toolChain> </toolChain>
</folderInfo> </folderInfo>
<fileInfo id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.Makefile" name="Makefile" rcbsApplicability="disable" resourcePath="Makefile" toolsToInvoke=""/> <fileInfo id="cdt.managedbuild.toolchain.gnu.cross.base.500844171.756690686.Makefile" name="Makefile" rcbsApplicability="disable" resourcePath="Makefile" toolsToInvoke=""/>

View File

@@ -17,10 +17,6 @@
<key>org.eclipse.cdt.make.core.append_environment</key> <key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key> <key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value> <value></value>
@@ -30,8 +26,8 @@
<value>make</value> <value>make</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key> <key>org.eclipse.cdt.make.core.buildLocation</key>
<value>clean</value> <value>${workspace_loc:/BaS_GNU}</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.contents</key> <key>org.eclipse.cdt.make.core.contents</key>
@@ -49,17 +45,13 @@
<key>org.eclipse.cdt.make.core.enableFullBuild</key> <key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key> <key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value> <value>false</value>
</dictionary> </dictionary>
</arguments> </arguments>
</buildCommand> </buildCommand>

View File

@@ -18,7 +18,7 @@ CC=$(TCPREFIX)gcc
LD=$(TCPREFIX)ld LD=$(TCPREFIX)ld
INCLUDE=-Iinclude INCLUDE=-Iinclude
CFLAGS=-mcpu=5474 -Wno-multichar -Os -fomit-frame-pointer CFLAGS=-mcpu=5474 -Wall -Wno-multichar -Os -fomit-frame-pointer
SRCDIR=sources SRCDIR=sources
OBJDIR=objs OBJDIR=objs

View File

@@ -3,13 +3,9 @@ MEMORY {
} }
SECTIONS { SECTIONS {
_Bas_base = ABSOLUTE(0x1FE00000); _Bas_base = ABSOLUTE(0x1FE00000);
_tos_base = ABSOLUTE(0xe00000);
/* Board Memory map definitions from linker command files:
* __SDRAM,__SDRAM_SIZE, __CODE_FLASH, __CODE_FLASH_SIZE
* linker symbols must be defined in the linker command file.
*/
/* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */ /* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */
___BOOT_FLASH = ABSOLUTE(0xE0000000); ___BOOT_FLASH = ABSOLUTE(0xE0000000);
___BOOT_FLASH_SIZE = ABSOLUTE(0x00800000); ___BOOT_FLASH_SIZE = ABSOLUTE(0x00800000);
@@ -20,12 +16,6 @@ SECTIONS {
/* VIDEO RAM BASIS */ /* VIDEO RAM BASIS */
__VRAM = ABSOLUTE(0x60000000); __VRAM = ABSOLUTE(0x60000000);
/*
* MCF5475 Derivative Memory map definitions from linker command files:
* __MBAR, __MMUBAR, __RAMBAR0, __RAMBAR0_SIZE, __RAMBAR1, __RAMBAR1_SIZE
* linker symbols must be defined in the linker command file.
*/
/* Memory mapped registers */ /* Memory mapped registers */
__MBAR = ABSOLUTE(0xFF000000); __MBAR = ABSOLUTE(0xFF000000);
__MMUBAR = ABSOLUTE(0xFF040000); __MMUBAR = ABSOLUTE(0xFF040000);

View File

@@ -9,6 +9,7 @@
#include "startcf.h" #include "startcf.h"
extern uint32_t Bas_base[]; extern uint32_t Bas_base[];
extern uint8_t tos_base[];
/* imported routines */ /* imported routines */
extern int mmu_init(); extern int mmu_init();
@@ -64,9 +65,9 @@ void wait_1us(void)
void BaS(void) void BaS(void)
{ {
int az_sectors; int az_sectors;
int sd_status,i; int i;
uint8_t *src; uint8_t *src;
uint8_t *dst; uint8_t *dst = tos_base;
uint32_t *adr; uint32_t *adr;
az_sectors = sd_card_init(); az_sectors = sd_card_init();
@@ -113,7 +114,7 @@ copy_firetos:
} }
} }
if (!DIP_SWITCH & (1 << 6)) /* switch #6 on ? */ if (!(DIP_SWITCH & (1 << 6))) /* switch #6 on ? */
{ {
if (MCF_PSC3_PSCRB_8BIT == 0x81) if (MCF_PSC3_PSCRB_8BIT == 0x81)
{ {

View File

@@ -1,6 +1,6 @@
/********************************************************/ /*
/* exception vectoren intialisieren * initialize exception vectors
/********************************************************/ */
#include "startcf.h" #include "startcf.h"
@@ -287,9 +287,9 @@ no_protect_vectors:
lea timer0(pc),a1 lea timer0(pc),a1
move.l a1,0x1f8(a0) move.l a1,0x1f8(a0)
rts rts
/********************************************************/ /*
/* exception vector routinen * exception vector routines
/********************************************************/ */
vector_table_start: vector_table_start:
std_exc_vec: std_exc_vec:
move.w #0x2700,sr // disable interrupt move.w #0x2700,sr // disable interrupt
@@ -609,9 +609,10 @@ sev_sup6:
movem.l (a7),d0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a5 // register zur<EFBFBD>ck
rts rts
blinker:.long 0 blinker:.long 0
/**************************************************/
/* pseudo dma */ /*
/**************************************************/ * pseudo dma */
*/
acsi_dma: // atari dma acsi_dma: // atari dma
move.l a1,-(a7) move.l a1,-(a7)
move.l d1,-(a7) move.l d1,-(a7)
@@ -672,9 +673,9 @@ acsi_dma_end:
move.l (a7)+,d1 move.l (a7)+,d1
move.l (a7)+,a1 move.l (a7)+,a1
rts rts
/**************************************************/ /*
/* irq 7 = pseudo bus error */ * irq 7 = pseudo bus error */
/**************************************************/ */
irq7: irq7:
lea -12(sp),sp lea -12(sp),sp
movem.l d0/a0,(sp) movem.l d0/a0,(sp)
@@ -696,9 +697,9 @@ irq7:
move.l (sp)+,a0 move.l (sp)+,a0
rts // Forward to the Access Error handler rts // Forward to the Access Error handler
/**************************************************/ /*
/* psc3 com PIC MCF */ * psc3 com PIC MCF */
/**************************************************/ */
psc3: psc3:
move.w #0x2700,sr // disable interrupt move.w #0x2700,sr // disable interrupt
lea -20(a7),a7 lea -20(a7),a7
@@ -734,9 +735,10 @@ psc3_fertig:
movem.l (a7),d0-d2/a0/a3 // register zur<EFBFBD>ck movem.l (a7),d0-d2/a0/a3 // register zur<EFBFBD>ck
lea 20(a7),a7 lea 20(a7),a7
RTE RTE
/**************************************************/
/* timer 0: video change later also others /*
/**************************************************/ * timer 0: video change later also others
*/
timer0: timer0:
move #0x2700,sr move #0x2700,sr
// halt // halt

View File

@@ -1,6 +1,6 @@
/********************************************************************/ /*
/* INIT ACR und MMU /* * INIT ACR and MMU
/********************************************************************/ */
#include "startcf.h" #include "startcf.h"
@@ -177,9 +177,9 @@ _mmu_init:
nop nop
rts rts
/********************************************************************/ /*
/* MMU table search /* * MMU table search
/********************************************************************/ */
_mmutr_miss: _mmutr_miss:
bsr cpusha bsr cpusha
and.l #0xFFF00000,d0 and.l #0xFFF00000,d0

View File

@@ -19,7 +19,7 @@ uint8_t sd_com(uint32_t cmd)
uint8_t res; uint8_t res;
MCF_DSPI_DTFR = cmd; MCF_DSPI_DTFR = cmd;
while (! MCF_DSPI_DSR & (1 << 7)); while (! (MCF_DSPI_DSR & (1 << 7)));
res = MCF_DSPI_DRFR; res = MCF_DSPI_DRFR;
MCF_DSPI_DSR = -1L; MCF_DSPI_DSR = -1L;
@@ -87,9 +87,10 @@ void sd_card_idle(void)
int sd_card_init(void) int sd_card_init(void)
{ {
return 0; /* for now, just to make the compiler happy */
long az_sectors;
#ifdef _NOT_USED_ #ifdef _NOT_USED_
long az_sectors;
asm asm
{ {
lea MCF_PSC0_PSCTB_8BIT,a1 lea MCF_PSC0_PSCTB_8BIT,a1

View File

@@ -1,6 +1,6 @@
/********************************************************/ /*
/* user/supervisor handler * user/supervisor handler
/********************************************************/ */
#include "startcf.h" #include "startcf.h"
@@ -33,7 +33,7 @@ _privileg_violation:
lea _rt_mod,a0 // zugriff setzen lea _rt_mod,a0 // zugriff setzen
tst.b (a0) // vom rt_supervisormodus? tst.b (a0) // vom rt_supervisormodus?
bne pv_work // ja-> bne pv_work // ja->
// tats<EFBFBD>chlich privileg violation // tats<EFBFBD>chlich privileg violation
mov3q.l #-1,(a0) // sr_mod setzen mov3q.l #-1,(a0) // sr_mod setzen
move.l usp,a5 // usp holen move.l usp,a5 // usp holen
move.l a5,8(a0) // sichern move.l a5,8(a0) // sichern
@@ -52,7 +52,7 @@ _privileg_violation:
move.l 12(a0),a5 // rt_vbr move.l 12(a0),a5 // rt_vbr
lea 0x18(a5),a5 // vector lea 0x18(a5),a5 // vector
move.l (a5),16(a7) // vector privileg violation move.l (a5),16(a7) // vector privileg violation
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// privileg violation // privileg violation
@@ -149,7 +149,7 @@ pv_a7_usp: move.l 4(a0),a5 // rt_ssp -> a5
pv_ax_usp: pv_ax_usp:
move.l a5,8(a0) // usp -> rt_usp move.l a5,8(a0) // usp -> rt_usp
addq.l #2,16(a7) // next addq.l #2,16(a7) // next
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// usp->a0 // usp->a0
@@ -175,7 +175,7 @@ pv_usp_a6:
move.l a5,a6 move.l a5,a6
pv_usp_ax: pv_usp_ax:
addq.l #2,16(a7) // next addq.l #2,16(a7) // next
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// rte // rte
@@ -196,7 +196,7 @@ pv_rte:
move.l 8(a0),a5 // rt_usp holen move.l 8(a0),a5 // rt_usp holen
pv_rte_sup: pv_rte_sup:
move.l a5,usp // usp setzen move.l a5,usp // usp setzen
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// stop // stop
@@ -241,7 +241,7 @@ stop7:
stop #0x2700 stop #0x2700
stop_weiter: stop_weiter:
addq.l #4,16(a7) // next addq.l #4,16(a7) // next
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// movec ??????? // movec ???????
@@ -335,7 +335,7 @@ pv_46:
move.b 1(a5),d0 move.b 1(a5),d0
cmp.b #0xfc,d0 //#d16->sr cmp.b #0xfc,d0 //#d16->sr
beq im_sr //ja-> beq im_sr //ja->
//move dx->sr (sr und rt_mod ist supervisor sonst w<EFBFBD>re es privileg violation //move dx->sr (sr und rt_mod ist supervisor sonst w<EFBFBD>re es privileg violation
cmp.b #0xc0,d0 //d0->sr? cmp.b #0xc0,d0 //d0->sr?
bne d1_sr //nein-> bne d1_sr //nein->
move.w 2(a7),d0 //hier ist d0 gesichert move.w 2(a7),d0 //hier ist d0 gesichert
@@ -389,7 +389,7 @@ pv_set_sr_end:
move.l a5,usp // setzen move.l a5,usp // setzen
pv_sre2: pv_sre2:
move.w d0,14(a7) // sr setzen move.w d0,14(a7) // sr setzen
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// code 0x40xx ***************************************** // code 0x40xx *****************************************
@@ -442,7 +442,7 @@ nsr_d7:
halt halt
sr_dx_end: sr_dx_end:
addq.l #2,16(a7) // next addq.l #2,16(a7) // next
movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck movem.l (a7),d0/a0/a5 // register zur<EFBFBD>ck
lea 12(a7),a7 lea 12(a7),a7
rte rte
// strldsr // strldsr
@@ -577,7 +577,7 @@ cfa_setloop:
move.l _rt_cacr,d0 // holen move.l _rt_cacr,d0 // holen
movec d0,cacr // setzen movec d0,cacr // setzen
move.w d2,sr // alte interrupt maske move.w d2,sr // alte interrupt maske
movem.l (a7),d0-d2/a0 // register zur<EFBFBD>ck movem.l (a7),d0-d2/a0 // register zur<EFBFBD>ck
lea 16(a7),a7 lea 16(a7),a7
rts rts

View File

@@ -223,7 +223,7 @@ void init_fpga(void)
MCF_GPIO_PODR_FEC1L |= (1 << 1); MCF_GPIO_PODR_FEC1L |= (1 << 1);
MCF_GPIO_PODR_FEC1L |= (1 << 2); MCF_GPIO_PODR_FEC1L |= (1 << 2);
while ((!MCF_GPIO_PPDSDR_FEC1L & (1 << 0)) && (!MCF_GPIO_PPDSDR_FEC1L & (1 << 5))); while ((! (MCF_GPIO_PPDSDR_FEC1L & (1 << 0))) && (! (MCF_GPIO_PPDSDR_FEC1L & (1 << 5))));
wait_10us(); wait_10us();
MCF_GPIO_PODR_FEC1L |= (1 << 2); MCF_GPIO_PODR_FEC1L |= (1 << 2);
@@ -273,7 +273,7 @@ void init_fpga(void)
MCF_GPIO_PODR_FEC1L |= 1; MCF_GPIO_PODR_FEC1L |= 1;
MCF_GPIO_PODR_FEC1L &= ~1; MCF_GPIO_PODR_FEC1L &= ~1;
} }
} while ((!MCF_GPIO_PPDSDR_FEC1L & (1 << 5)) && (fpga_data < FPGA_FLASH_DATA_END)); } while (!(MCF_GPIO_PPDSDR_FEC1L & (1 << 5)) && (fpga_data < FPGA_FLASH_DATA_END));
if (fpga_data < FPGA_FLASH_DATA_END) if (fpga_data < FPGA_FLASH_DATA_END)
{ {
@@ -460,10 +460,10 @@ void init_PCI(void) {
/* Configure Initiator Windows */ /* Configure Initiator Windows */
/* initiator window 0 base / translation adress register */ /* initiator window 0 base / translation adress register */
MCF_PCI_PCIIW0BTAR = PCI_MEMORY_OFFSET + ((PCI_MEMORY_SIZE -1) >> 8) & 0xffff0000; MCF_PCI_PCIIW0BTAR = (PCI_MEMORY_OFFSET + ((PCI_MEMORY_SIZE -1) >> 8)) & 0xffff0000;
/* initiator window 1 base / translation adress register */ /* initiator window 1 base / translation adress register */
MCF_PCI_PCIIW1BTAR = PCI_IO_OFFSET + ((PCI_IO_SIZE - 1) >> 8) & 0xffff0000; MCF_PCI_PCIIW1BTAR = (PCI_IO_OFFSET + ((PCI_IO_SIZE - 1) >> 8)) & 0xffff0000;
/* initiator window 2 base / translation address register */ /* initiator window 2 base / translation address register */
MCF_PCI_PCIIW2BTAR = 0L; /* not used */ MCF_PCI_PCIIW2BTAR = 0L; /* not used */
@@ -725,6 +725,8 @@ void init_ac97(void) {
if ((va & 0x80000fff) == 0x80000800) { if ((va & 0x80000fff) == 0x80000800) {
vb = MCF_PSC2_PSCTB_AC97; vb = MCF_PSC2_PSCTB_AC97;
vc = MCF_PSC2_PSCTB_AC97; vc = MCF_PSC2_PSCTB_AC97;
/* FIXME: that looks suspicious */
if ((va & 0xE0000fff) == 0xE0000800 & vb == 0x02000000 & vc == 0x00000000) { if ((va & 0xE0000fff) == 0xE0000800 & vb == 0x02000000 & vc == 0x00000000) {
goto livo;} goto livo;}
} }