*.mk configuration files modified for compatibility with latest version
of Mentor Sourcery CodeBench Lite toolchain (https://sourcery.mentor.com/GNUToolchain/release2641). All detected issues fixed.
This commit is contained in:
@@ -15,7 +15,7 @@ extern struct buf *getnewbuf();
|
||||
|
||||
/*
|
||||
* Variable naming conventions
|
||||
*
|
||||
*
|
||||
* root - this is the number of the device entry in the disks[] array
|
||||
* part - the minor number of a device entry, which represents the partition
|
||||
* number, or 0 for the whole disk
|
||||
@@ -75,7 +75,7 @@ const struct diskentry disks[] = {
|
||||
|
||||
#ifdef SDRAMP_ENABLED
|
||||
{sdramp_preinit, no_init, no_deinit, sdramp_open, sdramp_size, sdramp_read, sdramp_write, 0, RD_PREPART},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef FLASH_ENABLED
|
||||
{flash_init, no_init, no_deinit, flash_open, flash_size, flash_read, flash_write, 0, RD_READONLY},
|
||||
@@ -164,8 +164,9 @@ static inline int init_device(int root,int flag)
|
||||
|
||||
for(i=0; i<4; i++)
|
||||
{
|
||||
dflags[root].start[i] = mbr->partitions[i].lbastart>>1;
|
||||
dflags[root].len[i] = mbr->partitions[i].lbalength>>1;
|
||||
struct partition part = mbr->partitions[i];
|
||||
dflags[root].start[i] = part.lbastart >> 1;
|
||||
dflags[root].len[i] = part.lbalength >> 1;
|
||||
}
|
||||
dflags[root].blocks = disks[root].size(unit);
|
||||
brelse(bp);
|
||||
@@ -320,7 +321,7 @@ void rdstrategy(register struct buf *bp)
|
||||
|
||||
void update_mbr(int unit)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
int rdioctl (dev_t dev, register u_int cmd, caddr_t addr, int flag)
|
||||
@@ -337,7 +338,7 @@ int rdioctl (dev_t dev, register u_int cmd, caddr_t addr, int flag)
|
||||
{
|
||||
bflush(major(dev));
|
||||
init_device(major(dev),S_SILENT);
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -432,7 +433,7 @@ dev_t get_boot_device()
|
||||
rdclose(makedev(i,0),0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return bd;
|
||||
#endif
|
||||
}
|
||||
@@ -610,7 +611,7 @@ struct buf *prepartition_device(char *devname)
|
||||
dev[pos] = 0;
|
||||
p++;
|
||||
}
|
||||
|
||||
|
||||
if((*p) == ':')
|
||||
{
|
||||
p++;
|
||||
@@ -670,7 +671,7 @@ struct buf *prepartition_device(char *devname)
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(pnum > 0)
|
||||
{
|
||||
mbr->bootsig = 0xAA55;
|
||||
|
||||
@@ -28,6 +28,15 @@ ifndef GCCPREFIX
|
||||
LDFLAGS =
|
||||
endif
|
||||
|
||||
# Mentor Sourcery CodeBench Lite toolchain
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# You can download a Linux or Windows binary package from
|
||||
# https://sourcery.mentor.com/GNUToolchain/release2641
|
||||
ifndef GCCPREFIX
|
||||
GCCPREFIX = /usr/local/mips-2013.11/bin/mips-sde-elf-
|
||||
LDFLAGS = -Wl,--oformat=elf32-tradlittlemips
|
||||
endif
|
||||
|
||||
# chipKIT MPIDE on Mac OS X
|
||||
ifneq (,$(wildcard /Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr))
|
||||
AVRDUDE = /Applications/Mpide.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude \
|
||||
|
||||
@@ -103,7 +103,7 @@ void spi_close(int dno)
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
if (spi_devices[dno].cs_tris != NULL) {
|
||||
// Revert the CS pin to input.
|
||||
TRIS_CLR(*spi_devices[dno].cs_tris) = 1<<spi_devices[dno].cs_pin;
|
||||
@@ -121,11 +121,11 @@ void spi_select(int dno)
|
||||
{
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
if (spi_devices[dno].cs_tris == NULL)
|
||||
if (spi_devices[dno].cs_tris == NULL)
|
||||
return;
|
||||
|
||||
spi_devices[dno].bus->brg = spi_devices[dno].baud;
|
||||
@@ -139,11 +139,11 @@ void spi_deselect(int dno)
|
||||
{
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
if (spi_devices[dno].cs_tris == NULL)
|
||||
if (spi_devices[dno].cs_tris == NULL)
|
||||
return;
|
||||
|
||||
LAT_SET(*spi_devices[dno].cs_tris) = 1<<spi_devices[dno].cs_pin;
|
||||
@@ -155,10 +155,10 @@ void spi_set(int dno, unsigned int set)
|
||||
{
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
spi_devices[dno].mode |= set;
|
||||
}
|
||||
|
||||
@@ -168,10 +168,10 @@ void spi_clr(int dno, unsigned int set)
|
||||
{
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
spi_devices[dno].mode &= ~set;
|
||||
}
|
||||
|
||||
@@ -181,10 +181,10 @@ unsigned int spi_status(int dno)
|
||||
{
|
||||
if(dno >= MAXSPIDEV)
|
||||
return 0;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return 0;
|
||||
|
||||
|
||||
return spi_devices[dno].bus->stat;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ unsigned char spi_transfer(int dno, unsigned char data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return 0xF0;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return 0xF1;
|
||||
|
||||
@@ -229,10 +229,10 @@ void spi_bulk_write_32_be(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
nread = 0;
|
||||
nwritten = words;
|
||||
|
||||
@@ -245,7 +245,7 @@ void spi_bulk_write_32_be(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
(void) spi_devices[dno].bus->buf;
|
||||
nread++;
|
||||
@@ -263,10 +263,10 @@ void spi_bulk_write_32(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
nread = 0;
|
||||
nwritten = words;
|
||||
|
||||
@@ -279,7 +279,7 @@ void spi_bulk_write_32(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
(void) spi_devices[dno].bus->buf;
|
||||
nread++;
|
||||
@@ -297,10 +297,10 @@ void spi_bulk_write_16(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
nread = 0;
|
||||
nwritten = words;
|
||||
|
||||
@@ -313,7 +313,7 @@ void spi_bulk_write_16(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
(void) spi_devices[dno].bus->buf;
|
||||
nread++;
|
||||
@@ -326,18 +326,18 @@ void spi_bulk_write(int dno, unsigned int len, unsigned char *data)
|
||||
{
|
||||
unsigned char *data8 = data;
|
||||
unsigned int i;
|
||||
unsigned char in,out;
|
||||
unsigned char out;
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
for(i=0; i<len; i++)
|
||||
{
|
||||
out = *data8;
|
||||
in = spi_transfer(dno, out);
|
||||
spi_transfer(dno, out);
|
||||
data8++;
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void spi_bulk_read_32_be(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -371,7 +371,7 @@ void spi_bulk_read_32_be(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*data32++ = mips_bswap(spi_devices[dno].bus->buf);
|
||||
nread++;
|
||||
@@ -389,7 +389,7 @@ void spi_bulk_read_32(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -405,7 +405,7 @@ void spi_bulk_read_32(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*data32++ = spi_devices[dno].bus->buf;
|
||||
nread++;
|
||||
@@ -423,7 +423,7 @@ void spi_bulk_read_16(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -439,7 +439,7 @@ void spi_bulk_read_16(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*data16++ = mips_bswap(spi_devices[dno].bus->buf);
|
||||
nread++;
|
||||
@@ -456,7 +456,7 @@ void spi_bulk_read(int dno, unsigned int len, unsigned char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -479,7 +479,7 @@ void spi_bulk_rw_32_be(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -495,7 +495,7 @@ void spi_bulk_rw_32_be(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*read32++ = mips_bswap(spi_devices[dno].bus->buf);
|
||||
nread++;
|
||||
@@ -514,7 +514,7 @@ void spi_bulk_rw_32(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -530,7 +530,7 @@ void spi_bulk_rw_32(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*read32++ = spi_devices[dno].bus->buf;
|
||||
nread++;
|
||||
@@ -549,7 +549,7 @@ void spi_bulk_rw_16(int dno, unsigned int len, char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
@@ -565,7 +565,7 @@ void spi_bulk_rw_16(int dno, unsigned int len, char *data)
|
||||
nwritten--;
|
||||
}
|
||||
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
if(!(spi_devices[dno].bus->stat & PIC32_SPISTAT_SPIRBE))
|
||||
{
|
||||
*read16++ = mips_bswap(spi_devices[dno].bus->buf);
|
||||
nread++;
|
||||
@@ -582,7 +582,7 @@ void spi_bulk_rw(int dno, unsigned int len, unsigned char *data)
|
||||
|
||||
if(dno >= MAXSPIDEV)
|
||||
return;
|
||||
|
||||
|
||||
if(spi_devices[dno].bus==NULL)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user