Compare commits

..

1 Commits
4.8.2 ... 4.8.1

Author SHA1 Message Date
cvs2git
058277d133 This commit was manufactured by cvs2svn to create tag 'rtems-4-8-1'.
Sprout from rtems-4-8-branch 2008-08-13 14:03:54 UTC Joel Sherrill <joel.sherrill@OARcorp.com> '2008-08-12	Joel Sherrill <joel.sherrill@OARcorp.com>'
Cherrypick from rtems-4-8-branch 2009-07-13 14:20:37 UTC cvs2git <rtems-devel@rtems.org> 'This commit was manufactured by cvs2svn to create branch 'rtems-4-8-branch'.':
    contrib/crossrpms/patches/binutils-2.17.50-cygwin-20060817-1.diff
    contrib/crossrpms/patches/gdb-6.5-bfinrtems-20071114.diff
    cpukit/libnetworking/ifaddrs.h
    cpukit/libnetworking/libc/getifaddrs.c
    cpukit/libnetworking/libc/if_indextoname.c
    cpukit/libnetworking/libc/if_nameindex.c
2009-07-13 14:20:39 +00:00
256 changed files with 12543 additions and 24399 deletions

View File

@@ -1,8 +1,3 @@
2008-09-24 Ralf Corsépius <ralf.corsepius@rtems.org>
PR 1324/bsps
* aclocal/check-bsps.m4: Add missing icecube.
2008-04-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* bootstrap: Use find . ... preinstall.am for portability reasons.

View File

@@ -4,4 +4,4 @@
# $Id$
#
RTEMS Version 4.8.2
RTEMS Version 4.8.1

View File

@@ -25,7 +25,7 @@ AC_MSG_CHECKING([for available BSPs])
bsps="$bsps mbx860_002"
bsps="$bsps mbx860_005b"
;;
gen5200) bsps="pm520_cr825 pm520_ze30 brs5l icecube";;
gen5200) bsps="pm520_cr825 pm520_ze30 brs5l";;
gen83xx) bsps="mpc8349eamds hsc_cm01";;
motorola_powerpc) bsps="mvme2307 mcp750 mtx603e mvme2100";;
pc386) bsps="pc386 pc386dx pc486 pc586 pc686 pck6";;

View File

@@ -1,4 +1,4 @@
AC_DEFUN([RTEMS_VERSIONING],
m4_define([_RTEMS_VERSION],[4.8.2]))
m4_define([_RTEMS_VERSION],[4.8.1]))
m4_define([RTEMS_API],[4.8])

View File

@@ -1,4 +1,4 @@
AC_DEFUN([RTEMS_VERSIONING],
m4_define([_RTEMS_VERSION],[4.8.2]))
m4_define([_RTEMS_VERSION],[4.8.1]))
m4_define([RTEMS_API],[4.8])

View File

@@ -1,8 +1,3 @@
2009-01-06 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1350/bsps
* network/lan91c11x.c: Do not write 65th element into 64 element array.
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -224,6 +224,9 @@ void lan91c11x_write_phy_reg(int reg, uint16_t phydata)
mask >>= 1;
}
/* Final clock bit */
bits[clk_idx++] = 0;
/* Turn off all MII Interface bits */
lan91c11x_write_reg(LAN91C11X_MGMT,
lan91c11x_read_reg(LAN91C11X_MGMT) & 0xfff0);

View File

@@ -1,8 +1,3 @@
2009-03-02 Ray Xu <rayx.cn@gmail.com>
PR 1380/bsps
* include/bsp.h: Switch to English comments.
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -30,15 +30,12 @@ extern "C" {
/* cclk=cco/(2*P) */
/* cco = cclk*2*P */
/* system clk frequecy,<=60Mhz, defined in system configuration */
#define LPC22xx_Fcclk CONFIG_ARM_CLK
#define LPC22xx_Fcclk CONFIG_ARM_CLK /* system clk frequecy,<=60Mhz, defined in system configuration */
/* Fcco 156M~320Mhz*/
/* system clk frequecy,<=60Mhz, defined in system configuration */
#define LPC22xx_Fcclk CONFIG_ARM_CLK
#define LPC22xx_Fcclk CONFIG_ARM_CLK /* system clk frequecy,<=60Mhz, defined in system configuration */
#define LPC22xx_Fcco LPC22xx_Fcclk * 4
/*VPB clk frequency,1,1/2,1/4 times of Fcclk */
#define LPC22xx_Fpclk (LPC22xx_Fcclk /4) *1
#define LPC22xx_Fpclk (LPC22xx_Fcclk /4) *1 /*VPB clk frequency,1,1/2,1/4 times of Fcclk */
@@ -79,15 +76,14 @@ extern "C" {
/**
* help file
*/
/* System configure, Fosc Fcclk Fcco Fpclk must be defined*/
#define Fosc 11059200 // osc freq,10MHz~25MHz,
// change to real one if needed
#define Fcclk (Fosc << 2) //system freq 2^n time of Fosc(1~32) <=60MHZ
#define Fcco (Fcclk <<2) //CCO freq 2,4,8,16 time of Fcclk 156MHz~320MHz
#define Fpclk (Fcclk >>2) * 1 //VPB freq only(Fcclk / 4) 1~4
#define M Fcclk / Fosc
#define P_min Fcco_MIN / (2*Fcclk) + 1;
#define P_max Fcco_MAX / (2*Fcclk);
/* ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Fosc<EFBFBD><EFBFBD>Fcclk<EFBFBD><EFBFBD>Fcco<EFBFBD><EFBFBD>Fpclk<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
#define Fosc 11059200 //<2F><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>,10MHz~25MHz<48><7A>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>һ<EFBFBD><D2BB>
#define Fcclk (Fosc << 2) //ϵͳƵ<CDB3>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD>ΪFosc<73><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(1~32)<29><><EFBFBD><EFBFBD><=60MHZ
#define Fcco (Fcclk <<2) //CCOƵ<4F>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD>ΪFcclk<6C><6B>2<EFBFBD><32>4<EFBFBD><34>8<EFBFBD><38>16<31><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΧΪ156MHz~320MHz
#define Fpclk (Fcclk >>2) * 1 //VPBʱ<42><CAB1>Ƶ<EFBFBD>ʣ<EFBFBD>ֻ<EFBFBD><D6BB>Ϊ(Fcclk / 4)<29><>1 ~ 4<><34>
#define M Fcclk / Fosc;
#define P_min Fcco_MIN / (2*Fcclk) + 1;
#define P_max Fcco_MAX / (2*Fcclk);
@@ -110,20 +106,20 @@ extern "C" {
#define SPI_CS_PIN_FUNC PINSEL0_bit.SPI_CS_PIN
// Flash definition
//#define FLASH_SIZE (0x200000-FLASH_BOOT) // Total area of Flash region in words 8 bit
#define FLASH_SIZE (0x80000-FLASH_BOOT) // Total area of Flash region in words 8 bit
//#define FLASH_SIZE (0x80000-FLASH_BOOT) // Total area of Flash region in words 8 bit
#define FLASH_BEGIN 0x80000000
#define FLASH_BASE (FLASH_BEGIN+FLASH_BOOT) //First 0x8000 bytes reserved for boot loader etc.
//#define FLASH_SIZE (0x200000-FLASH_BOOT) // Total area of Flash region in words 8 bit
#define FLASH_SIZE (0x80000-FLASH_BOOT) // Total area of Flash region in words 8 bit
//#define FLASH_SIZE (0x80000-FLASH_BOOT) // Total area of Flash region in words 8 bit
#define FLASH_BEGIN 0x80000000
#define FLASH_BASE (FLASH_BEGIN+FLASH_BOOT) //First 0x8000 bytes reserved for boot loader etc.
// SRAM definition
#define SRAM_SIZE 0x100000 // Total area of Flash region in words 8 bit
#define SRAM_BASE 0x81000000 //First 0x8000 bytes reserved for boot loader etc.
#define SRAM_SIZE 0x100000 // Total area of Flash region in words 8 bit
#define SRAM_BASE 0x81000000 //First 0x8000 bytes reserved for boot loader etc.
// CS8900A definition
#define CS8900A_BASE 0x82000000
#define CS8900A_BASE 0x82000000 //
// RTL8019AS definition
#define RTL8019AS_BASE 0x82000000
#define RTL8019AS_BASE 0x82000000 //

View File

@@ -1,8 +1,3 @@
2008-11-03 Till Straumann <strauman@slac.stanford.edu>
PR 1332: call BSP_uart_termios_set()/BSP_uart_intr_ctrl()
only from 'firstOpen' and only if this is a serial console.
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -274,20 +274,6 @@ static int console_last_close(int major, int minor, void *arg)
return 0;
}
static int ser_console_first_open(int major, int minor, void *arg)
{
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
return 0;
}
/*-------------------------------------------------------------------------+
| Console device driver OPEN entry point
+--------------------------------------------------------------------------*/
@@ -335,8 +321,6 @@ console_open(rtems_device_major_number major,
cb.write = BSP_uart_termios_write_com2;
}
cb.firstOpen = ser_console_first_open;
status = rtems_termios_open (major, minor, arg, &cb);
if(status != RTEMS_SUCCESSFUL)
@@ -345,6 +329,15 @@ console_open(rtems_device_major_number major,
return status;
}
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,13 +1,3 @@
2009-01-21 Frank Ueberschar <frank.ueberschar@dsa-volgmann.de>
PR 1354/bsps
* network/network.c: In some cases it can occur that an empty mbuf is
put on the descriptor chain. (We found it especially then when
transmitting fragmented IP Packets.) Since the actual buffer
descriptor pointer will be incremented after every inserted mbuf
(txBd = sc->txBdBase + sc->txBdHead;) even if m->m_len of the current
mbuf was zero. This leads to the bug.
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmdsflash, startup/linkcmdsram: Add

View File

@@ -548,10 +548,10 @@ fec_sendpacket(struct ifnet *ifp, struct mbuf *m)
* The IP fragmentation routine in ip_output
* can produce fragments with zero length.
*/
txBd = sc->txBdBase + sc->txBdHead;
if (m->m_len){
char *p = mtod(m, char *);
int offset = (int) p & 0x3;
txBd = sc->txBdBase + sc->txBdHead;
if (offset == 0) {
txBd->buffer = p;
txBd->length = m->m_len;

View File

@@ -1,7 +1,3 @@
2008-08-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* runtest: Attempt to prevent runaways.
2008-08-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* runtest: Major update. Now more likely not to run away.

View File

@@ -128,7 +128,7 @@ args=$*
tests="$args"
if [ ! "$tests" ]
then
set -- `ls -1 *.exe *.ralf 2>/dev/null`
set -- `echo *.exe`
tests="$*"
fi
@@ -215,7 +215,7 @@ do
fatal "Cannot currently generate device files"
fi
# Spin off the simulator in the background
# Spin off the simulator in the background
${simulator} --board=jmr3904 $tfile | \
sed -e 's/
@@ -233,8 +233,8 @@ do
milliseconds=`expr ${milliseconds} + 10`
kill -0 $pid 2> /dev/null
running=$?
if [ $running -eq 0 ] ; then
if [ ${milliseconds} -ge ${millilimit} ]; then
if [ $running -eq 0 ] ; then
if [ ${milliseconds} -ge ${millilimit} ]; then
kill -9 $pid 2> /dev/null
cat ${logfile}
echo "${testname} killed after running ${max_run_time} seconds"
@@ -243,14 +243,14 @@ do
grep "^Unhandled exception" ${logfile} >/dev/null
exceptionExit=$?
grep "^mips-core: " ${logfile} >/dev/null
badAccessExit=$?
if [ $badAccessExit -eq 0 -o $exceptionExit -eq 0 ] ; then
badAccessExit=$?
if [ $badAccessExit -eq 0 -o $exceptionExit -eq 0 ] ; then
kill -9 ${pid} >/dev/null 2>&1
cat ${logfile}
echo Ran in ${milliseconds} milliseconds
fi
else
else
# done normally
cat ${logfile}
echo "${testname} ran in ${milliseconds} milliseconds"

View File

@@ -1,8 +1,3 @@
2008-11-03 Till Straumann <strauman@slac.stanford.edu>
PR 1332: call BSP_uart_termios_set()/BSP_uart_intr_ctrl()
only from 'firstOpen' and only if this is a serial console.
2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* shared/startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -1,9 +1,3 @@
2010-03-18 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1497/bsps
* startup/bspclean.c: Do not enable interrupts while waiting for board
to reset.
2008-03-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds, startup/linkcmds.brs5l, startup/linkcmds.icecube,

View File

@@ -37,9 +37,9 @@ void bsp_cleanup( void )
/*
* Now reset the CPU
*/
_ISR_Set_level( 0 );
mpc5200.gpt[0].count_in = 0xf;
mpc5200.gpt[0].emsel = 0x9004;
while(1) ;
#endif
}

View File

@@ -1,39 +1,3 @@
2009-04-20 Kate Feng <feng1@bnl.gov>
1396/bsps
* pci/pci.c : Updated it to be consistent with the original pci.c
* written by Eric Valette. There is no change in its function.
* irq/irq_init.c : set defaultIrq->next_handler to be 0
* for BSP_SHARED_HANDLER_SUPPORT.
* network/if_1GHz/if_wm.c : fixed some bugs in the 1GHz driver.
* irq/BSP_irq.c : added supports for shared IRQ.
* pci/pci_interface.c : Enabled PCI "Read", "Read Line", and
"Read Multiple"
* Agressive Prefetch to improve the performance of the PCI based
* applications (e.g. 1GHz NIC).
* irq/BSP_irq.c : Replaced the irq/irq.c, and used GT_GPP_Value
* register to monitor the cause of the level sensitive interrupts.
* This unique solution solves various bugs in the 1GHz network drivers
* Fixed bugs in compute_pic_masks_from_prio()
2009-04-20 Kate Feng <feng1@bnl.gov>
1396/bsps
* pci/pci.c : Updated it to be consistent with the original pci.c
* written by Eric Valette. There is no change in its function.
* irq/irq_init.c : set defaultIrq->next_handler to be 0
* for BSP_SHARED_HANDLER_SUPPORT.
* network/if_1GHz/if_wm.c : fixed some bugs in the 1GHz driver.
* irq/BSP_irq.c : added supports for shared IRQ.
* pci/pci_interface.c : Enabled PCI "Read", "Read Line", and
"Read Multiple"
* Agressive Prefetch to improve the performance of the PCI based
* applications (e.g. 1GHz NIC).
* irq/BSP_irq.c : Replaced the irq/irq.c, and used GT_GPP_Value
* register to monitor the cause of the level sensitive interrupts.
* This unique solution solves various bugs in the 1GHz network drivers
* Fixed bugs in compute_pic_masks_from_prio()
2007-11-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* irq/GT64260Int.c, network/if_100MHz/Makefile.am,
@@ -42,7 +6,7 @@
2007-09-20 Kate Feng <feng1@bnl.gov>
* network/if_100MHz/GT64260eth.c: Add else.
2007-09-19 Kate Feng <feng1@bnl.gov>
* README: Update.

View File

@@ -1,8 +1,7 @@
/* GT64260TWSI.c : Two-Wire Serial Interface (TWSI) support for the GT64260
*
* Copyright (c) 2004, Brookhaven National Laboratory
* and Shuchen Kate Feng <feng1@bnl.gov>
* under the Deaprtment of Energy contract DE-AC02-98CH10886
* Copyright (c) 2004, Brookhaven National Laboratory and
* Shuchen Kate Feng <feng1@bnl.gov>
* All rights reserved.
*
* The license and distribution terms for this file may be

View File

@@ -1,9 +1,5 @@
/*
* $Id$
*
* Copyright 2003 S. Kate Feng <feng1@bnl.gov>,
* NSLS, Brookhaven National Laboratory. All rights reserved.
* under the Deaprtment of Energy contract DE-AC02-98CH10886
*/
#ifndef __GT64260TWSI_h

View File

@@ -2,7 +2,6 @@
*
* Copyright (c) 2003, 2004 Brookhaven National Laboratory
* Author: S. Kate Feng <feng1@bnl.gov>
* under the Deaprtment of Energy contract DE-AC02-98CH10886
* All rights reserved.
*
* The license and distribution terms for this file may be
@@ -30,10 +29,9 @@ unchar I2cDevByteAddr(u32 devA2A1A0, unchar byteNum)
/****************************************************************************
* I2Cread_eeprom - read EEPROM VPD from the I2C
*/
int I2Cread_eeprom(unchar I2cBusAddr,u32 devA2A1A0,u32 AddrBytes,void *pBuff,u32 numBytes)
int I2Cread_eeprom(unchar I2cBusAddr,u32 devA2A1A0,u32 AddrBytes,unchar *pBuff,u32 numBytes)
{
int status=0, lastByte=0;
unchar *ptr=(unchar *) pBuff;
switch (AddrBytes) {
case 1:
@@ -85,15 +83,12 @@ int I2Cread_eeprom(unchar I2cBusAddr,u32 devA2A1A0,u32 AddrBytes,void *pBuff,u32
/* read data from device */
for ( ; numBytes > 0; numBytes-- ) {
if ( numBytes == 1) lastByte=1;
if (GT64260TWSIread(ptr,lastByte) == -1) {
printk("numBytes %d\n", numBytes);
return (-1);
}
if (GT64260TWSIread(pBuff,lastByte) == -1) return (-1);
#ifdef I2C_DEBUG
printk("%2x ", *ptr);
printk("%2x ", *pBuff);
if ( (numBytes % 20)==0 ) printk("\n");
#endif
ptr++;
pBuff++;
}
#ifdef I2C_DEBUG
printk("\n");

View File

@@ -2,74 +2,10 @@
*
* (C) 2004, NSLS, Brookhaven National Laboratory,
* S. Kate Feng, <feng1@bnl.gov>
* under the Deaprtment of Energy contract DE-AC02-98CH10886
*
*/
extern unsigned char ConfVPD_buff[200];
typedef struct ConfVpdRec {
char VendorId[8];
char pad0[4];
char BrdId[13];
char pad1[2];
char ManAssmNum[12];
char pad2[2];
char SerialNum[7];
char pad3[2];
/* char IntClk[4];*/
uint32_t IntClk;
char pad4[3];
/*char ExtClk[4];*/
uint32_t ExtClk;
char pad5[3];
char EnetAddr0[7];
char pad6[2];
char EnetAddr1[7];
char pad7[20];
} ConfVpdRec_t;
#define VPD_BOARD_ID 8
#define VPD_ENET0_OFFSET 0x40
#define VPD_ENET1_OFFSET 0x49
/*
4D4F544F 524F4C41 0200010D 4D564D45 MOTOROLA....MVME
35353030 2D303136 33020C30 312D5733 5500-0163..01-W3
38323946 30314403 07373035 31383238 829F01D..7051828
05053B9A CA000106 0507F281 55010807 ..;.........U...
ethernet address
xxxxxxxx xxxxxxxx xxxxxxxx xxxx3701 ................
09043734 35350A04 87A6E98C 0B0C0089 ..7455..."=.....
00181002 02101000 78070B0C FFFFFFFF ........x.......
10020210 10017805 0E0FFFFF FFFFFFFF ......x.........
FFFFFF01 FF01FFFF FF0F0400 03000019 ................
0A010107 02030000 000100FF FFFFFFFF ................
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF ................
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF ................
00000000 00000000 00000000 00000000 ................
00000000 00000000 00000000 00000000 ................
00000000 00000000 00000000 00000000 ................
00000000 00000000 00000000 00000000 ................
For the MVME5500 :
Product Identifier : MVME5500-0163
Manufacturing Assembly Number : 01-W3829F01D
Serial Number : 7051828
Internal Clock Speed (Hertz) : 3B9ACA00 (&1000000000)
External Clock Speed (Hertz) : 07F28155 (&133333333)
Ethernet Address : xx xx xx xx xx xx xx
Ethernet Address : xx xx xx xx xx xx xx
Microprocessor Type : 7455
SROM/EEPROM CRC : D3223DD0 (&-752730672)
Flash0 Memory Configuration : 00 89 00 18 10 02 02 10
: 10 00 78 07
Flash1 Memory Configuration : FF FF FF FF 10 02 02 10
: 10 01 78 05
L2 Cache Configuration : FF FF FF FF FF FF FF FF
: FF 01 FF 01 FF FF FF
VPD Revision : 00 03 00 00
L3 Cache Configuration : 01 01 07 02 03 00 00 00
: 01 00
*/
#define VPD_ENET0_OFFSET 0x3c
#define VPD_ENET1_OFFSET 0x45

View File

@@ -190,7 +190,7 @@
#define GT_MPP_Control2 0xf008
#define GT_MPP_Control3 0xf00c
/* <skf> added for GT64260 */
/* <skf> added */
#define GT_MPP_SerialPortMultiplex 0xf010
#define GT_GPP_IO_Control 0xf100
@@ -790,25 +790,13 @@
#define TWSI_SFT_RST 0xc01c
/* Interrupt Controller - Interrupt Controller Registers */
/* <skf> added for GT64360 */
#define GT64360_MAIN_INT_CAUSE_LO 0x004 /* read Only */
#define GT64360_MAIN_INT_CAUSE_HI 0x00c /* read Only */
#define GT64360_CPU0_INT_MASK_LO 0x014
#define GT64360_CPU0_INT_MASK_HI 0x01c
#define GT64360_CPU0_SEL_CAUSE 0x024 /* read Only */
#define GT64360_CPU1_INT_MASK_LO 0x034
#define GT64360_CPU1_INT_MASK_HI 0x03c
#define GT64360_CPU1_SEL_CAUSE 0x044 /* read Only */
/* Section 25.2 : Table 734 <skf> */
#define GT64260_MAIN_INT_CAUSE_LO 0xc18 /* read Only */
#define GT64260_MAIN_INT_CAUSE_HI 0xc68 /* read Only */
#define GT64260_CPU_INT_MASK_LO 0xc1c
#define GT64260_CPU_INT_MASK_HI 0xc6c
#define GT64260_CPU_SEL_CAUSE 0xc70 /* read Only */
#define GT_MAIN_INT_CAUSE_LO 0xc18 /* read Only */
#define GT_MAIN_INT_CAUSE_HI 0xc68 /* read Only */
#define GT_CPU_INT_MASK_LO 0xc1c
#define GT_CPU_INT_MASK_HI 0xc6c
#define GT_CPU_SEL_CAUSE 0xc70 /* read Only */
#define GT_PCI0_INT_MASK_LO 0xc24
#define GT_PCI0_INT_MASK_HI 0xc64
#define GT_PCI0_SEL_CAUSE 0xc74 /* read Only */

View File

@@ -35,8 +35,7 @@ startup_rel_SOURCES = startup/bspstart.c \
../../powerpc/shared/startup/pretaskinghook.c \
../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
startup/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
../../shared/gnatinstallhandler.c startup/reboot.c \
../../powerpc/shared/startup/probeMemEnd.c
../../shared/gnatinstallhandler.c startup/reboot.c
startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
@@ -69,8 +68,8 @@ pci_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
include_bsp_HEADERS += irq/irq.h
noinst_PROGRAMS += irq.rel
irq_rel_SOURCES = irq/irq_init.c irq/BSP_irq.c \
../../powerpc/shared/irq/irq.c ../../powerpc/shared/irq/irq_asm.S
irq_rel_SOURCES = irq/irq_init.c irq/irq.c \
../../powerpc/shared/irq/irq_asm.S
irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
@@ -109,9 +108,8 @@ include_bsp_HEADERS += network/if_100MHz/GT64260eth.h \
network_CPPFLAGS = -D_KERNEL
noinst_PROGRAMS += network.rel
network_rel_SOURCES = network/if_100MHz/GT64260eth.c network/if_1GHz/if_wm.c \
network/if_1GHz/pci_map.c
network_rel_SOURCES = network/if_100MHz/GT64260eth.c \
network/if_1GHz/if_wm.c network/if_1GHz/pci_map.c
network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
@@ -125,8 +123,8 @@ include_bsp_HEADERS += ../../shared/vmeUniverse/VME.h vme/VMEConfig.h \
noinst_PROGRAMS += vme.rel
vme_rel_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c\
vme/vmeconfig.c ../../shared/vmeUniverse/bspVmeDmaList.c\
../shared/vme/vme_universe_dma.c
../shared/vme/vmeconfig.c ../../shared/vmeUniverse/bspVmeDmaList.c\
../shared/vme/vme_universe.c ../shared/vme/vme_universe_dma.c
vme_rel_CPPFLAGS = $(AM_CPPFLAGS)
vme_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)

View File

@@ -1,5 +1,5 @@
#
# $Id: README,v 1.4.1 Shuchen Kate Feng, NSLS, BNL (03/16/2009)
# $Id: README,v 1.3.1 Shuchen Kate Feng, NSLS, BNL (08/27/07)
#
Please reference README.booting for the boot/load process.
@@ -7,7 +7,7 @@ Please reference README.booting for the boot/load process.
For the priority setting of the Interrupt Requests (IRQs), please
reference README.irq
The BSP is built and tested on the 4.8.0 RTEMS release.
The BSP is built and tested on the 4.7.1 and 4.7.99.2 CVS RTEMS release.
I believe in valuable real-time programming, where technical neatness,
performance and truth are. I hope I still believe. Any suggestion,

View File

@@ -1,6 +1,8 @@
README.booting: written by S. Kate Feng <feng1@bnl.gov>, March 16, 2009
README.booting: written by S. Kate Feng <feng1@bnl.gov>, Aug. 28, 2007
The BSP is built and tested on the RTEMS 4.8.0 release.
The bootloader is adapted from Till Straumann's Generic Mini-loader,
which he wrote originally for the SVGM powerpc board.
The BSP is built and tested on the 4.7 CVS RTEMS release.
Booting requirement :
-------------------------
@@ -9,7 +11,12 @@ Booting requirement :
or /etc/dhcpd.conf (DHCP) properly to boot the system.
(Note : EPICS needs a NTP server).
2) Example of the boot script setup carried out on the MOTLoad
2) Please copy the prebuilt RTEMS binary (e.g. misc/rtems5500-cexp.bin)
and perhaps others (e.g. misc/st.sys) to the /tftpboot/epics/hostname/bin/
directory or the TFTPBOOT one you specified in the 'tftpGet'
command of the boot script (as shown in the following example).
3) Example of the boot script setup carried out on the MOTLoad
command line :
MVME5500> gevEdit mot-script-boot
@@ -25,14 +32,23 @@ MVME5500>
Note : (cxx.xx.xx.xx is the client IP address and
sxx.xx.xx.xx is the server IP address)
3) Other reference web sites for mvme5500 BSP:
4) Other reference web sites for mvme5500 BSP:
http://lansce.lanl.gov/EPICS/presentations/KateFeng%20RTEMS-mvme55001.ppt
http://www.nsls.bnl.gov/facility/expsys/software/EPICS/
http://www.nsls.bnl.gov/facility/expsys/software/EPICS/FAQ.txt
5) When generating code (especially C++) for this system, one should
use at least gcc-3.2 (preferrably a copy downloaded from the RTEMS
site [snapshot area] )
4) To reboot the RTEMS-MVME5500 (board reset), one can invoke the
6) To reboot the RTEMS-MVME5500 (board reset), one can invoke the
rtemsReboot() command at Cexp> prompt.
5) To get started with RTEMS/EPICS and to build development
7) Please reference http://www.slac.stanford.edu/~strauman/rtems
for the source code and installation guidance of cexp, GeSys and
other useful utilities such as telnet, nfs, and so on.
8) To get started with RTEMS/EPICS and to build development
tools and BSP, I would recommend one to reference
http://www.aps.anl.gov/epics/base/RTEMS/tutorial/
in additional to the RTEMS document.

View File

@@ -7,8 +7,7 @@
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* (C) S. Kate Feng 2003-2007 : Modified it to support the mvme5500 BSP.
*
* S. Kate Feng 2003-2007 : Modified it to support the mvme5500 BSP.
*
*/
@@ -23,57 +22,10 @@
#include <libcpu/io.h>
#include <bsp/vectors.h>
/* Board type */
typedef enum {
undefined = 0,
MVME5500,
MVME6100
} BSP_BoardTypes;
BSP_BoardTypes BSP_getBoardType();
/* Board type */
typedef enum {
Undefined,
UNIVERSE2,
TSI148,
} BSP_VMEchipTypes;
BSP_VMEchipTypes BSP_getVMEchipType();
/* The version of Discovery system controller */
typedef enum {
notdefined,
GT64260A,
GT64260B,
MV64360,
} DiscoveryChipVersion;
DiscoveryChipVersion BSP_getDiscoveryChipVersion();
#define _256M 0x10000000
#define _512M 0x20000000
#define GT64x60_REG_BASE 0xf1000000 /* Base of GT64260 Reg Space */
#define GT64x60_REG_SPACE_SIZE 0x10000 /* 64Kb Internal Reg Space */
#define GT64x60_DEV1_BASE 0xf1100000 /* Device bank1(chip select 1) base
*/
#define GT64260_DEV1_SIZE 0x00100000 /* Device bank size */
#include <bsp/bspMvme5500.h>
/* fundamental addresses for this BSP (PREPxxx are from libcpu/io.h) */
#define _IO_BASE GT64x60_REG_BASE
#define BSP_NVRAM_BASE_ADDR 0xf1110000
#define BSP_RTC_INTA_REG 0x7ff0
#define BSP_RTC_SECOND 0x7ff2
#define BSP_RTC_MINUTE 0x7ff3
#define BSP_RTC_HOUR 0x7ff4
#define BSP_RTC_DATE 0x7ff5
#define BSP_RTC_INTERRUPTS 0x7ff6
#define BSP_RTC_WATCHDOG 0x7ff7
#define _IO_BASE GT64260_REG_BASE
/* PCI0 Domain I/O space */
#define PCI0_IO_BASE 0xf0000000
@@ -120,12 +72,15 @@ DiscoveryChipVersion BSP_getDiscoveryChipVersion();
#define CONFIGURE_INTERRUPT_STACK_MEMORY (16 * 1024)
/* uart.c uses out_8 instead of outb */
#define BSP_UART_IOBASE_COM1 GT64x60_DEV1_BASE + 0x20000
#define BSP_UART_IOBASE_COM2 GT64x60_DEV1_BASE + 0x21000
#define BSP_UART_IOBASE_COM1 GT64260_DEV1_BASE + 0x20000
#define BSP_UART_IOBASE_COM2 GT64260_DEV1_BASE + 0x21000
#define BSP_CONSOLE_PORT BSP_UART_COM1 /* console */
#define BSP_UART_BAUD_BASE 115200
/*
* Vital Board data Start using DATA RESIDUAL
*/
/*
* Total memory using RESIDUAL DATA
*/
@@ -165,26 +120,19 @@ extern unsigned int BSP_heap_start;
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_i82544EI_driver_attach
#endif
extern int RTEMS_BSP_NETWORK_DRIVER_ATTACH();
extern int
RTEMS_BSP_NETWORK_DRIVER_ATTACH(/* struct rtems_bsdnet_ifconfig * */);
#define gccMemBar() RTEMS_COMPILER_MEMORY_BARRIER()
/* As per Linux, This should be in the ppc/system.h */
static inline void lwmemBar()
{
asm volatile("lwsync":::"memory");
}
static inline void io_flush()
{
asm volatile("isync":::"memory");
}
static inline void memBar()
{
asm volatile("sync":::"memory");
}
static inline void ioBar()
{
asm volatile("eieio":::"memory");
asm volatile("eieio");
}
#endif

View File

@@ -1,4 +1,4 @@
/* BSP_irq.c
/* irq.c
*
* This file contains the implementation of the function described in irq.h
*
@@ -8,25 +8,21 @@
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* Acknowledgement to Till Straumann <strauman@slac.stanford.edu>
* for some inputs in May 2004.
* Acknowledgement May 2004 : to Till Straumann <strauman@slac.stanford.edu>
* for some inputs.
*
* Copyright 2003, 2004, 2005, 2007 Shuchen Kate Feng <feng1@bnl.gov>,
* NSLS, Brookhaven National Laboratory. All rights reserved.
*
* 1) Used GT_GPP_Value register instead of the GT_GPP_Interrupt_Cause
* register to monitor the cause of the level sensitive interrupts.
* (Copyright : NDA item)
* 2) The implementation of picPrioTable[] is an original work by the
* NSLS,Brookhaven National Laboratory
* 1) Modified and added support for the MVME5500 board.
* 2) The implementation of picIsrTable[] is an original work by the
* author to optimize the software IRQ priority scheduling because
* Discovery controller does not provide H/W IRQ priority schedule.
* It ensures the fastest/faster interrupt service to the
* highest/higher priority IRQ, if pendig.
* 3) _CPU_MSR_SET() needs RTEMS_COMPILER_MEMORY_BARRIER()
*
*
*/
#include <stdio.h>
#include <rtems/system.h>
#include <bsp.h>
#include <bsp/irq.h>
@@ -43,7 +39,9 @@
#define HI_INT_CAUSE 0x40000000
#define MAX_IRQ_LOOP 20
#define MAX_IRQ_LOOP 30
#define EDGE_TRIGGER
#define _MSR_GET( _mask) \
do { \
@@ -78,42 +76,41 @@ static rtems_irq_connect_data default_rtems_entry;
/*
* location used to store initial tables used for interrupt
* management.BSP copy of the configuration
* management.
*/
static rtems_irq_global_settings BSP_config;
static rtems_irq_global_settings* internal_config;
static rtems_irq_connect_data* rtems_hdl_tbl;
static volatile unsigned *BSP_irqMask_reg[3];
static volatile unsigned *BSP_irqCause_reg[3];
static volatile unsigned BSP_irqMask_cache[3]={0,0,0};
static unsigned int BSP_GPP_mask[4]= { 1<<24, 1<<25, 1<<26, 1<<27};
static int picPrioTblPtr=0;
static int picIsrTblPtr=0;
static unsigned int GPPIrqInTbl=0;
static unsigned long long MainIrqInTbl=0;
/*
* The software developers are forbidden to setup picPrioTable[],
* The software developers are forbidden to setup picIsrTable[],
* as it is a powerful engine for the BSP to find the pending
* highest priority IRQ at run time. It ensures the fastest/faster
* interrupt service to the highest/higher priority IRQ, if pendig.
*
* The picPrioTable[96] is updated dynamically at run time
* The picIsrTable[96] is updated dynamically at run time
* based on the priority levels set at BSPirqPrioTable[96],
* while the BSP_enable_irq_at_pic(), and BSP_disable_irq_at_pic()
* while the BSP_enable_pic_irq(), and BSP_disable_pic_irq()
* commands are invoked.
*
* The picPrioTable[96] lists the enabled CPU main and GPP external interrupt
* The picIsrTable[96] lists the enabled CPU main and GPP external interrupt
* numbers [0 (lowest)- 95 (highest)] starting from the highest priority
* one to the lowest priority one. The highest priority interrupt is
* located at picPrioTable[0], and the lowest priority interrupt is located
* at picPrioTable[picPrioTblPtr-1].
* located at picIsrTable[0], and the lowest priority interrupt is located
* at picIsrTable[picIsrTblPtr-1].
*
*
*/
#define DynamicIsrTable
#ifdef DynamicIsrTable
/* BitNums for Main Interrupt Lo/High Cause, -1 means invalid bit */
static unsigned int picPrioTable[BSP_PIC_IRQ_NUMBER]={
/* BitNums for Main Interrupt Lo/High Cause and GPP, -1 means invalid bit */
static unsigned int picIsrTable[BSP_PIC_IRQ_NUMBER]={
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -124,19 +121,7 @@ static unsigned int picPrioTable[BSP_PIC_IRQ_NUMBER]={
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1 };
#else
static unsigned int picPrioTable[BSP_PIC_IRQ_NUMBER]={
80, 84, 76, 77, 32, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1 };
#endif
/*
* Check if IRQ is a MAIN CPU internal IRQ or GPP external IRQ
@@ -158,18 +143,28 @@ static inline int is_processor_irq(const rtems_irq_number irqLine)
);
}
static inline unsigned int divIrq32(unsigned irq)
{
return(irq/32);
}
static inline unsigned int modIrq32(unsigned irq)
{
return(irq%32);
}
/*
* ------------------------ RTEMS Irq helper functions ----------------
*/
/*
* Caution : this function assumes the variable "BSP_config"
* Caution : this function assumes the variable "internal_config"
* is already set and that the tables it contains are still valid
* and accessible.
*/
static void compute_pic_masks_from_prio()
{
int i,j, k, isGppMain;
int i,j, k;
unsigned long long irq_prio_mask=0;
/*
@@ -185,27 +180,26 @@ static void compute_pic_masks_from_prio()
BSP_irq_prio_mask_tbl[k][i]=0;
irq_prio_mask =0;
isGppMain =1;
break;
default :
isGppMain =0;
irq_prio_mask = (unsigned long long) (1LLU << i);
break;
}
if ( isGppMain) continue;
if (irq_prio_mask) {
for (j = 0; j <BSP_MAIN_IRQ_NUMBER; j++) {
/*
* Mask interrupts at PIC level that have a lower priority
* or <Till Straumann> a equal priority.
*/
if (BSP_config.irqPrioTbl [i] >= BSP_config.irqPrioTbl [j])
if (internal_config->irqPrioTbl [i] >= internal_config->irqPrioTbl [j])
irq_prio_mask |= (unsigned long long)(1LLU << j);
}
BSP_irq_prio_mask_tbl[0][i] = irq_prio_mask & 0xffffffff;
BSP_irq_prio_mask_tbl[1][i] = (irq_prio_mask>>32) & 0xffffffff;
#if 0
#ifdef DEBUG
printk("irq_mask_prio_tbl[%d]:0x%8x%8x\n",i,BSP_irq_prio_mask_tbl[1][i],
BSP_irq_prio_mask_tbl[0][i]);
#endif
@@ -213,18 +207,17 @@ static void compute_pic_masks_from_prio()
BSP_irq_prio_mask_tbl[2][i] = 1<<i;
/* Compute for the GPP priority interrupt mask */
for (j=BSP_GPP_IRQ_LOWEST_OFFSET; j <BSP_PROCESSOR_IRQ_LOWEST_OFFSET; j++) {
if (BSP_config.irqPrioTbl [i] >= BSP_config.irqPrioTbl [j])
if (internal_config->irqPrioTbl [i] >= internal_config->irqPrioTbl [j])
BSP_irq_prio_mask_tbl[2][i] |= 1 << (j-BSP_GPP_IRQ_LOWEST_OFFSET);
}
#if 0
printk("GPPirq_mask_prio_tbl[%d]:0x%8x\n",i,BSP_irq_prio_mask_tbl[2][i]);
#endif
}
}
}
static void UpdateMainIrqTbl(int irqNum)
{
int i=0, j, k, shifted=0;
int i=0, j, shifted=0;
switch (irqNum) {
case BSP_MAIN_GPP7_0_IRQ:
@@ -244,25 +237,23 @@ static void UpdateMainIrqTbl(int irqNum)
((irqNum>BSP_MICH_IRQ_MAX_OFFSET) &&
(!(( 1 << (irqNum-BSP_GPP_IRQ_LOWEST_OFFSET)) & GPPIrqInTbl))))
{
while ( picPrioTable[i]!=-1) {
if (BSP_config.irqPrioTbl[irqNum]>BSP_config.irqPrioTbl[picPrioTable[i]]) {
while ( picIsrTable[i]!=-1) {
if (internal_config->irqPrioTbl[irqNum]>internal_config->irqPrioTbl[picIsrTable[i]]) {
/* all other lower priority entries shifted right */
for (j=picPrioTblPtr;j>i; j--) {
picPrioTable[j]=picPrioTable[j-1];
}
picPrioTable[i]=irqNum;
for (j=picIsrTblPtr;j>i; j--)
picIsrTable[j]=picIsrTable[j-1];
picIsrTable[i]=irqNum;
shifted=1;
break;
}
i++;
}
if (!shifted) picPrioTable[picPrioTblPtr] =irqNum;
if (!shifted) picIsrTable[picIsrTblPtr]=irqNum;
if (irqNum >BSP_MICH_IRQ_MAX_OFFSET)
GPPIrqInTbl |= (1<< (irqNum-BSP_GPP_IRQ_LOWEST_OFFSET));
else
MainIrqInTbl |= (unsigned long long)(1LLU << irqNum);
picPrioTblPtr++;
picIsrTblPtr++;
}
#ifdef SHOW_MORE_INIT_SETTINGS
val2 = (MainIrqInTbl>>32) & 0xffffffff;
@@ -276,7 +267,7 @@ static void UpdateMainIrqTbl(int irqNum)
static void CleanMainIrqTbl(int irqNum)
{
int i, j, k;
int i, j;
switch (irqNum) {
case BSP_MAIN_GPP7_0_IRQ:
@@ -292,96 +283,84 @@ static void CleanMainIrqTbl(int irqNum)
(( 1 << (irqNum-BSP_GPP_IRQ_LOWEST_OFFSET)) & GPPIrqInTbl)))
{ /* If entry in table*/
for (i=0; i<64; i++) {
if (picPrioTable[i]==irqNum) {/*remove it from the entry */
if (picIsrTable[i]==irqNum) {/*remove it from the entry */
/* all other lower priority entries shifted left */
for (j=i;j<picPrioTblPtr; j++) {
picPrioTable[j]=picPrioTable[j+1];
}
for (j=i;j<picIsrTblPtr; j++)
picIsrTable[j]=picIsrTable[j+1];
if (irqNum >BSP_MICH_IRQ_MAX_OFFSET)
GPPIrqInTbl &= ~(1<< (irqNum-BSP_GPP_IRQ_LOWEST_OFFSET));
else
MainIrqInTbl &= ~(1LLU << irqNum);
picPrioTblPtr--;
picIsrTblPtr--;
break;
}
}
}
}
void BSP_enable_irq_at_pic(const rtems_irq_number irqNum)
void BSP_enable_pic_irq(const rtems_irq_number irqNum)
{
unsigned bitNum, regNum;
unsigned int level;
bitNum = (((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET)%32;
regNum = (((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET)>>5;
bitNum = modIrq32(((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET);
regNum = divIrq32(((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET);
rtems_interrupt_disable(level);
#ifdef DynamicIsrTable
UpdateMainIrqTbl((int) irqNum);
#endif
BSP_irqMask_cache[regNum] |= (1 << bitNum);
out_le32(BSP_irqMask_reg[regNum], BSP_irqMask_cache[regNum]);
while (in_le32(BSP_irqMask_reg[regNum]) != BSP_irqMask_cache[regNum]);
memBar();
rtems_interrupt_enable(level);
}
void BSP_disable_irq_at_pic(const rtems_irq_number irqNum)
void BSP_disable_pic_irq(const rtems_irq_number irqNum)
{
unsigned bitNum, regNum;
unsigned int level;
bitNum = (((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET)%32;
regNum = (((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET)>>5;
bitNum = modIrq32(((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET);
regNum = divIrq32(((unsigned int)irqNum) - BSP_MICL_IRQ_LOWEST_OFFSET);
rtems_interrupt_disable(level);
#ifdef DynamicIsrTable
CleanMainIrqTbl((int) irqNum);
#endif
BSP_irqMask_cache[regNum] &= ~(1 << bitNum);
out_le32(BSP_irqMask_reg[regNum], BSP_irqMask_cache[regNum]);
while (in_le32(BSP_irqMask_reg[regNum]) != BSP_irqMask_cache[regNum]);
memBar();
rtems_interrupt_enable(level);
}
/* Use shared/irq : 2008 */
int BSP_setup_the_pic(rtems_irq_global_settings* config)
int BSP_setup_the_pic() /* adapt the same name as shared/irq */
{
int i;
BSP_config = *config;
/* Get ready for discovery BSP */
BSP_irqMask_reg[0]= (volatile unsigned int *) (GT64260_REG_BASE + GT_CPU_INT_MASK_LO);
BSP_irqMask_reg[1]= (volatile unsigned int *) (GT64260_REG_BASE + GT_CPU_INT_MASK_HI);
BSP_irqMask_reg[2]= (volatile unsigned int *) (GT64260_REG_BASE + GT_GPP_Interrupt_Mask);
switch(BSP_getDiscoveryChipVersion()) {
case GT64260B:
case GT64260A:
/* Get ready for discovery BSP */
BSP_irqMask_reg[0]= (volatile unsigned int *) (GT64x60_REG_BASE + GT64260_CPU_INT_MASK_LO);
BSP_irqMask_reg[1]= (volatile unsigned int *) (GT64x60_REG_BASE + GT64260_CPU_INT_MASK_HI);
BSP_irqCause_reg[0]= (volatile unsigned int *) (GT64x60_REG_BASE + GT64260_MAIN_INT_CAUSE_LO);
BSP_irqCause_reg[1]= (volatile unsigned int *) (GT64x60_REG_BASE + GT64260_MAIN_INT_CAUSE_HI);
break;
default:
printk("Not supported by this BSP yet\n");
return(0);
break;
}
BSP_irqCause_reg[0]= (volatile unsigned int *) (GT64260_REG_BASE + GT_MAIN_INT_CAUSE_LO);
BSP_irqCause_reg[1]= (volatile unsigned int *) (GT64260_REG_BASE + GT_MAIN_INT_CAUSE_HI);
BSP_irqCause_reg[2]= (volatile unsigned int *) (GT64260_REG_BASE + GT_GPP_Interrupt_Cause);
BSP_irqMask_reg[2]= (volatile unsigned int *) (GT64x60_REG_BASE + GT_GPP_Interrupt_Mask);
BSP_irqCause_reg[2]= (volatile unsigned int *) (GT64x60_REG_BASE + GT_GPP_Value);
#ifdef EDGE_TRIGGER
/* Page 401, Table 598:
* Comm Unit Arbiter Control register :
* bit 10:GPP interrupts as level sensitive(1) or edge sensitive(0).
* MOTload default is set as level sensitive(1). Set it agin to make sure.
* We set the GPP interrupts to be edge sensitive.
* MOTload default is set as level sensitive(1).
*/
outl((inl(GT_CommUnitArb_Ctrl)& (~(1<<10))), GT_CommUnitArb_Ctrl);
#else
outl((inl(GT_CommUnitArb_Ctrl)| (1<<10)), GT_CommUnitArb_Ctrl);
#endif
#if 0
printk("BSP_irqMask_reg[0] = 0x%x, BSP_irqCause_reg[0] 0x%x\n",
@@ -395,7 +374,7 @@ int BSP_setup_the_pic(rtems_irq_global_settings* config)
in_le32(BSP_irqCause_reg[2]));
#endif
/* Initialize the interrupt related registers */
/* Initialize the interrupt related GT64260 registers */
for (i=0; i<3; i++) {
out_le32(BSP_irqCause_reg[i], 0);
out_le32(BSP_irqMask_reg[i], 0);
@@ -419,21 +398,186 @@ int BSP_setup_the_pic(rtems_irq_global_settings* config)
*
*/
for (i=BSP_MICL_IRQ_LOWEST_OFFSET; i < BSP_PROCESSOR_IRQ_LOWEST_OFFSET ; i++) {
if ( BSP_config.irqHdlTbl[i].hdl != BSP_config.defaultEntry.hdl) {
BSP_enable_irq_at_pic(i);
BSP_config.irqHdlTbl[i].on(&BSP_config.irqHdlTbl[i]);
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
BSP_enable_pic_irq(i);
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
}
else {
BSP_config.irqHdlTbl[i].off(&BSP_config.irqHdlTbl[i]);
BSP_disable_irq_at_pic(i);
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
BSP_disable_pic_irq(i);
}
}
for (i= BSP_MAIN_GPP7_0_IRQ; i < BSP_MAIN_GPP31_24_IRQ; i++)
BSP_enable_irq_at_pic(i);
return(1);
}
/*
* This function check that the value given for the irq line
* is valid.
*/
static int isValidInterrupt(int irq)
{
if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
return 0;
return 1;
}
/*
* ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
*/
int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
if (!isValidInterrupt(irq->name)) {
printk("Invalid interrupt vector %d\n",irq->name);
return 0;
}
/*
* Check if default handler is actually connected. If not issue an error.
* You must first get the current handler via i386_get_current_idt_entry
* and then disconnect it using i386_delete_idt_entry.
* RATIONALE : to always have the same transition by forcing the user
* to get the previous handler before accepting to disconnect.
*/
rtems_interrupt_disable(level);
if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
rtems_interrupt_enable(level);
printk("IRQ vector %d already connected\n",irq->name);
return 0;
}
/*
* store the data provided by user
*/
rtems_hdl_tbl[irq->name] = *irq;
#ifdef BSP_SHARED_HANDLER_SUPPORT
rtems_hdl_tbl[irq->name].next_handler = (void *)-1;
#endif
if (is_pic_irq(irq->name)) {
/*
* Enable PIC irq : Main Interrupt Cause Low and High & GPP external
*/
#ifdef DEBUG_IRQ
printk("PIC irq %d\n",irq->name);
#endif
BSP_enable_pic_irq(irq->name);
}
else {
if (is_processor_irq(irq->name)) {
/*
* Enable exception at processor level
*/
}
}
/*
* Enable interrupt on device
*/
irq->on(irq);
rtems_interrupt_enable(level);
return 1;
}
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
{
if (!isValidInterrupt(irq->name)) {
return 0;
}
*irq = rtems_hdl_tbl[irq->name];
return 1;
}
int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
{
unsigned int level;
if (!isValidInterrupt(irq->name)) {
return 0;
}
/*
* Check if default handler is actually connected. If not issue an error.
* You must first get the current handler via i386_get_current_idt_entry
* and then disconnect it using i386_delete_idt_entry.
* RATIONALE : to always have the same transition by forcing the user
* to get the previous handler before accepting to disconnect.
*/
if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
return 0;
}
rtems_interrupt_disable(level);
/*
* disable PIC interrupt
*/
if (is_pic_irq(irq->name))
BSP_disable_pic_irq(irq->name);
else {
if (is_processor_irq(irq->name)) {
/*
* disable exception at processor level
*/
}
}
/*
* Disable interrupt on device
*/
irq->off(irq);
/*
* restore the default irq value
*/
rtems_hdl_tbl[irq->name] = default_rtems_entry;
rtems_interrupt_enable(level);
return 1;
}
/*
* ------------------------ RTEMS Global Irq Handler Mngt Routines ----------------
*/
int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
{
unsigned int level;
int i;
/*
* Store various code accelerators
*/
internal_config = config;
default_rtems_entry = config->defaultEntry;
rtems_hdl_tbl = config->irqHdlTbl;
rtems_interrupt_disable(level);
if ( !BSP_setup_the_pic() ) {
printk("PIC setup failed; leaving IRQs OFF\n");
return 0;
}
for (i= BSP_MAIN_GPP7_0_IRQ; i <= BSP_MAIN_GPP31_24_IRQ; i++)
BSP_enable_pic_irq(i);
rtems_interrupt_enable(level);
return 1;
}
int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
{
*config = internal_config;
return 0;
}
/*
* High level IRQ handler called from shared_raw_irq_code_entry
*/
@@ -442,62 +586,85 @@ void C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
{
register unsigned msr, new_msr;
unsigned long irqCause[3]={0, 0,0};
register unsigned long selectCause;
unsigned oldMask[3]={0,0,0};
int loop=0, wloop=0, i=0, j;
register irq=0, group=0;
register unsigned i=0, j, irq=0, bitmask=0, group=0;
if (excNum == ASM_DEC_VECTOR) {
_MSR_GET(msr);
new_msr = msr | MSR_EE;
_MSR_SET(new_msr);
BSP_config.irqHdlTbl[BSP_DECREMENTER].hdl(BSP_config.irqHdlTbl[BSP_DECREMENTER].handle);
rtems_hdl_tbl[BSP_DECREMENTER].hdl(rtems_hdl_tbl[BSP_DECREMENTER].handle);
_MSR_SET(msr);
return;
}
for (j=0; j<3; j++ ) oldMask[j] = BSP_irqMask_cache[j];
for (j=0; j<3; j++) irqCause[j] = in_le32(BSP_irqCause_reg[j]) & in_le32(BSP_irqMask_reg[j]);
while (((irq = picPrioTable[i++])!=-1)&& (loop++ < MAX_IRQ_LOOP))
{
if (irqCause[group= irq/32] & ( 1<<(irq % 32))) {
if ((selectCause= in_le32((volatile unsigned *)0xf1000c70)) & HI_INT_CAUSE ){
irqCause[1] = (selectCause & BSP_irqMask_cache[1]);
irqCause[2] = in_le32(BSP_irqCause_reg[2]) & BSP_irqMask_cache[2];
}
else {
irqCause[0] = (selectCause & BSP_irqMask_cache[0]);
if ((irqCause[1] =(in_le32((volatile unsigned *)0xf1000c68)&BSP_irqMask_cache[1])))
irqCause[2] = in_le32(BSP_irqCause_reg[2]) & BSP_irqMask_cache[2];
}
while ((irq = picIsrTable[i++])!=-1)
{
if (irqCause[group=(irq/32)] && (irqCause[group]&(bitmask=(1<<(irq % 32))))) {
for (j=0; j<3; j++)
BSP_irqMask_cache[j] &= (~ BSP_irq_prio_mask_tbl[j][irq]);
out_le32(BSP_irqMask_reg[0], BSP_irqMask_cache[0]);
out_le32(BSP_irqMask_reg[1], BSP_irqMask_cache[1]);
out_le32(BSP_irqMask_reg[2], BSP_irqMask_cache[2]);
in_le32(BSP_irqMask_reg[2]);
RTEMS_COMPILER_MEMORY_BARRIER();
out_le32((volatile unsigned *)0xf1000c1c, BSP_irqMask_cache[0]);
out_le32((volatile unsigned *)0xf1000c6c, BSP_irqMask_cache[1]);
out_le32((volatile unsigned *)0xf100f10c, BSP_irqMask_cache[2]);
in_le32((volatile unsigned *)0xf100f10c);
#ifdef EDGE_TRIGGER
if (irq > BSP_MICH_IRQ_MAX_OFFSET)
out_le32(BSP_irqCause_reg[2], ~bitmask);/* Till Straumann: Ack the edge triggered GPP IRQ */
#endif
_MSR_GET(msr);
new_msr = msr | MSR_EE;
_MSR_SET(new_msr);
/* handler */
#ifdef BSP_SHARED_HANDLER_SUPPORT
{
rtems_irq_connect_data* vchain;
for( vchain = &BSP_config.irqHdlTbl[irq];
(vchain->hdl != BSP_config.defaultEntry.hdl && ((int)vchain != -1) );
vchain = (rtems_irq_connect_data*)vchain->next_handler )
{
vchain->hdl(vchain->handle);
}
}
#else
BSP_config.irqHdlTbl[irq].hdl(BSP_config.irqHdlTbl[irq].handle);
#endif
rtems_hdl_tbl[irq].hdl(rtems_hdl_tbl[irq].handle);
_MSR_SET(msr);
for (j=0; j<3; j++ ) BSP_irqMask_cache[j] = oldMask[j];
out_le32(BSP_irqMask_reg[0], oldMask[0]);
out_le32(BSP_irqMask_reg[1], oldMask[1]);
out_le32(BSP_irqMask_reg[2], oldMask[2]);
in_le32(BSP_irqMask_reg[2]);
break;
}
}
out_le32((volatile unsigned *)0xf1000c1c, oldMask[0]);
out_le32((volatile unsigned *)0xf1000c6c, oldMask[1]);
out_le32((volatile unsigned *)0xf100f10c, oldMask[2]);
in_le32((volatile unsigned *)0xf100f10c);
}
void _ThreadProcessSignalsFromIrq (BSP_Exception_frame* ctx)
{
/*
* Process pending signals that have not already been
* processed by _Thread_Displatch. This happens quite
* unfrequently : the ISR must have posted an action
* to the current running thread.
*/
if ( _Thread_Do_post_task_switch_extension ||
_Thread_Executing->do_post_task_switch_extension ) {
_Thread_Executing->do_post_task_switch_extension = FALSE;
_API_extensions_Run_postswitch();
}
/*
* I plan to process other thread related events here.
* This will include DEBUG session requested from keyboard...
*/
}
/* Only print part of the entries for now */
@@ -505,10 +672,10 @@ void BSP_printPicIsrTbl()
{
int i;
printf("picPrioTable[12]={ irq# :");
printk("picIsrTable[12]={");
for (i=0; i<12; i++)
printf("%d,", picPrioTable[i]);
printf("}\n");
printk("%d,", picIsrTable[i]);
printk("}\n");
printf("GPPIrqInTbl: 0x%x :\n", GPPIrqInTbl);
printk("GPPIrqInTbl: 0x%x :\n", GPPIrqInTbl);
}

View File

@@ -29,8 +29,7 @@
#ifndef LIBBSP_POWERPC_MVME5500_IRQ_IRQ_H
#define LIBBSP_POWERPC_MVME5500_IRQ_IRQ_H
#define BSP_SHARED_HANDLER_SUPPORT 1
/*#define BSP_SHARED_HANDLER_SUPPORT 1*/
#include <rtems/irq.h>
#define BSP_ASM_IRQ_VECTOR_BASE 0x0
@@ -85,11 +84,11 @@
/*
* Summary
*/
#define BSP_IRQ_NUMBER (BSP_PIC_IRQ_NUMBER + BSP_PROCESSOR_IRQ_NUMBER)
#define BSP_IRQ_NUMBER (BSP_MISC_IRQ_MAX_OFFSET + 1)
#define BSP_MAIN_IRQ_NUMBER (64)
#define BSP_PIC_IRQ_NUMBER (96)
#define BSP_LOWEST_OFFSET (0)
#define BSP_MAX_OFFSET (BSP_LOWEST_OFFSET + BSP_IRQ_NUMBER - 1)
#define BSP_LOWEST_OFFSET (BSP_MICL_IRQ_LOWEST_OFFSET)
#define BSP_MAX_OFFSET (BSP_MISC_IRQ_MAX_OFFSET)
/* Main CPU interrupt cause (Low) */
#define BSP_MAIN_TIMER0_1_IRQ (BSP_MICL_IRQ_LOWEST_OFFSET+8)

View File

@@ -41,18 +41,10 @@ static int connected() {return 1;}
static rtems_irq_connect_data rtemsIrq[BSP_IRQ_NUMBER];
static rtems_irq_global_settings initial_config;
#ifdef BSP_SHARED_HANDLER_SUPPORT
static rtems_irq_connect_data defaultIrq = {
/* vectorIdex, hdl ,handle , on , off , isOn ,next_handler, */
0, nop_func , NULL , nop_func , nop_func , not_connected, 0
};
#else
static rtems_irq_connect_data defaultIrq = {
/* vectorIdex, hdl , handle , on , off , isOn */
0, nop_func , NULL , nop_func , nop_func , not_connected
};
#endif
rtems_irq_prio BSPirqPrioTable[BSP_PIC_IRQ_NUMBER]={
/*
@@ -148,6 +140,27 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
printk("Done setup irq mngt configuration\n");
#endif
/*
* We must connect the raw irq handler for the two
* expected interrupt sources : decrementer and external interrupts.
*/
vectorDesc.exceptIndex = ASM_DEC_VECTOR;
vectorDesc.hdl.vector = ASM_DEC_VECTOR;
vectorDesc.hdl.raw_hdl = decrementer_exception_vector_prolog_code;
vectorDesc.hdl.raw_hdl_size = (unsigned) decrementer_exception_vector_prolog_code_size;
vectorDesc.on = nop_func;
vectorDesc.off = nop_func;
vectorDesc.isOn = connected;
if (!ppc_set_exception (&vectorDesc)) {
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
}
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
vectorDesc.hdl.raw_hdl_size = (unsigned) external_exception_vector_prolog_code_size;
if (!ppc_set_exception (&vectorDesc)) {
BSP_panic("Unable to initialize RTEMS external raw exception\n");
}
#ifdef TRACE_IRQ_INIT
printk("RTEMS IRQ management is now operationnal\n");
#endif

View File

@@ -2,16 +2,23 @@
*
* Copyright (c) 2003,2004 Brookhaven National Laboratory
* S. Kate Feng <feng1@bnl.gov>
* All rights reserved
* All rights reserved
*
* Acknowledgements:
* netBSD : Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
* Marvell : NDA document for the discovery system controller
* The author referenced two RTEMS network drivers of other NICs.
* rtems : 1) dec21140.c, a network driver for for TULIP based Ethernet Controller
* (C) 1999 Emmanuel Raguet. raguet@crf.canon.fr
*
* 2) yellowfin.c, a network driver for the SVGM5 BSP.
* Stanford Linear Accelerator Center, Till Straumann
*
* Some notes from the author, S. Kate Feng :
*
* 1) Mvme5500 uses Eth0 (controller 0) of the GT64260 to implement
* the 10/100 BaseT Ethernet with PCI Master Data Byte Swap control.
* the 10/100 BaseT Ethernet with PCI Master Data Byte Swap\
* control.
* 2) Implemented hardware snoop instead of software snoop
* to ensure SDRAM cache coherency. (Copyright : NDA item)
* 3) Added S/W support for multi mbuf. (TODO : Let the H/W do it)
@@ -48,7 +55,6 @@
#include <sys/sockio.h> /* SIOCADDMULTI, SIOC... */
#include <net/if.h>
#include <net/if_dl.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
@@ -104,7 +110,7 @@ enum GTeth_hash_op {
#define ET_MINLEN 64 /* minimum message length */
static int GTeth_ifioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data);
static int GTeth_ifioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static void GTeth_ifstart (struct ifnet *);
static void GTeth_ifchange(struct GTeth_softc *sc);
static void GTeth_init_rx_ring(struct GTeth_softc *sc);
@@ -163,8 +169,8 @@ static void GT64260eth_isr()
outl( ~cause,ETH0_EICR); /* clear the ICR */
if ( (!cause) || (cause & 0x803d00)) {
sc->if_errsts[sc->if_err_ptr2]=cause;
if ( (++sc->if_err_ptr2) == IF_ERR_BUFSZE) sc->if_err_ptr2=0; /* Till Straumann */
sc->intr_errsts[sc->intr_err_ptr2++]=cause;
sc->intr_err_ptr2 %=INTR_ERR_SIZE; /* Till Straumann */
events |= ERR_EVENT;
}
@@ -195,7 +201,7 @@ static void GT64260eth_isr()
static rtems_irq_connect_data GT64260ethIrqData={
BSP_MAIN_ETH0_IRQ,
(rtems_irq_hdl) GT64260eth_isr,
(rtems_irq_hdl_param) NULL,
NULL,
(rtems_irq_enable) GT64260eth_irq_on,
(rtems_irq_disable) GT64260eth_irq_off,
(rtems_irq_is_enabled) GT64260eth_irq_is_on,
@@ -324,15 +330,20 @@ static void GT64260eth_ifinit(void *arg)
GTeth_hash_fill(sc);
#endif
sc->if_err_ptr1=0;
sc->if_err_ptr2=0;
for (i=0; i< IF_ERR_BUFSZE; i++) sc->if_errsts[i]=0;
sc->intr_err_ptr1=0;
sc->intr_err_ptr2=0;
for (i=0; i< INTR_ERR_SIZE; i++) sc->intr_errsts[i]=0;
/* initialize the hardware (we are holding the network semaphore at this point) */
(void)GT64260eth_init_hw(sc);
/* launch network daemon */
sc->daemonTid = rtems_bsdnet_newproc(GT_ETH_TASK_NAME,4096,GT64260eth_daemon,arg);
/* NOTE:
* in ss-20011025 (and later) any task created by 'bsdnet_newproc' is
* wrapped by code which acquires the network semaphore...
*/
sc->daemonTid = rtems_bsdnet_newproc(GT_ETH_TASK_NAME,4096,GT64260eth_daemon,arg);
/* Tell the world that we're running */
sc->arpcom.ac_if.if_flags |= IFF_RUNNING;
@@ -353,11 +364,9 @@ int rtems_GT64260eth_driver_attach(struct rtems_bsdnet_ifconfig *config, int att
unit = rtems_bsdnet_parse_driver_name(config, &name);
if (unit < 0) return 0;
if ( !strncmp((const char *)name,"autoz",5))
memcpy(name,"gtMHz",5);
printk("\nAttaching GT64260 built-in 10/100 MHz NIC%d\n", unit);
printk("RTEMS-mvme5500 BSP Copyright (c) 2004, Brookhaven National Lab., Shuchen Kate Feng\n");
printk("\nEthernet driver name %s unit %d \n",name, unit);
printk("(c) 2004, Brookhaven National Lab. <feng1@bnl.gov> (RTEMS/mvme5500 port)\n");
/* Make certain elements e.g. descriptor lists are aligned. */
softc_mem = rtems_bsdnet_malloc(sizeof(*sc) + SOFTC_ALIGN, M_FREE, M_NOWAIT);
@@ -379,25 +388,31 @@ int rtems_GT64260eth_driver_attach(struct rtems_bsdnet_ifconfig *config, int att
/* try to read HW address from the device if not overridden
* by config
*/
if (config->hardware_address)
memcpy((void *)sc->arpcom.ac_enaddr,(const void *) config->hardware_address, ETHER_ADDR_LEN);
else
memcpy((void *)sc->arpcom.ac_enaddr, (const void *) &ConfVPD_buff[VPD_ENET0_OFFSET], ETHER_ADDR_LEN);
if (config->hardware_address) {
memcpy(hwaddr, config->hardware_address, ETHER_ADDR_LEN);
} else {
printk("Read EEPROM ");
for (i = 0; i < 6; i++)
hwaddr[i] = ConfVPD_buff[VPD_ENET0_OFFSET+i];
}
#ifdef GT_DEBUG
printk("using MAC addr from device:");
for (i = 0; i < ETHER_ADDR_LEN; i++) printk("%x:", sc->arpcom.ac_enaddr[i]);
for (i = 0; i < ETHER_ADDR_LEN; i++) printk("%x:", hwaddr[i]);
printk("\n");
#endif
memcpy(sc->arpcom.ac_enaddr, hwaddr, ETHER_ADDR_LEN);
ifp = &sc->arpcom.ac_if;
sc->sc_pcr = inl(ETH0_EPCR);
sc->sc_pcxr = inl(ETH0_EPCXR);
sc->sc_intrmask = inl(ETH0_EIMR) | ETH_IR_MIIPhySTC;
#ifdef GT_DEBUG
printk("address %s\n", ether_sprintf(hwaddr));
#ifdef GT_DEBUG
printk(", pcr %x, pcxr %x ", sc->sc_pcr, sc->sc_pcxr);
#endif
@@ -496,6 +511,7 @@ static void GT64260eth_stats(struct GTeth_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
#if 0
printf(" Rx Interrupts:%-8lu\n", sc->stats.rxInterrupts);
printf(" Receive Packets:%-8lu\n", ifp->if_ipackets);
printf(" Receive errors:%-8lu\n", ifp->if_ierrors);
@@ -504,10 +520,18 @@ static void GT64260eth_stats(struct GTeth_softc *sc)
printf(" Oversized Frames:%-8lu\n", sc->stats.length_errors);
printf(" Active Rxqs:%-8u\n", sc->rxq_active);
printf(" Tx Interrupts:%-8lu\n", sc->stats.txInterrupts);
#endif
printf("Multi-BuffTx Packets:%-8lu\n", sc->stats.txMultiBuffPacket);
printf("Multi-BuffTx max len:%-8lu\n", sc->stats.txMultiMaxLen);
printf("SingleBuffTx max len:%-8lu\n", sc->stats.txSinglMaxLen);
printf("Multi-BuffTx maxloop:%-8lu\n", sc->stats.txMultiMaxLoop);
printf("Tx buffer max len :%-8lu\n", sc->stats.txBuffMaxLen);
#if 0
printf(" Transmitt Packets:%-8lu\n", ifp->if_opackets);
printf(" Transmitt errors:%-8lu\n", ifp->if_oerrors);
printf(" Tx/Rx collisions:%-8lu\n", ifp->if_collisions);
printf(" Active Txqs:%-8u\n", sc->txq_nactive);
#endif
}
void GT64260eth_printStats()
@@ -515,7 +539,7 @@ void GT64260eth_printStats()
GT64260eth_stats(root_GT64260eth_dev);
}
static int GTeth_ifioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data)
static int GTeth_ifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct GTeth_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *) data;
@@ -561,7 +585,7 @@ static int GTeth_ifioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data)
if (error == ENETRESET) {
if (ifp->if_flags & IFF_RUNNING)
GTeth_ifchange(sc);
else
else
error = 0;
}
break;
@@ -838,7 +862,6 @@ static void GTeth_txq_free(struct GTeth_softc *sc, unsigned cmdsts)
--sc->txq_nactive;
}
#if 0
static int txq_high_limit(struct GTeth_softc *sc)
{
/*
@@ -878,7 +901,6 @@ static int txq_high_limit(struct GTeth_softc *sc)
} /* end if ( TX_RING_SIZE == sc->txq_nactive + TXQ_HiLmt_OFF) */
return 0;
}
#endif
static int GT64260eth_sendpacket(struct GTeth_softc *sc,struct mbuf *m)
{
@@ -894,8 +916,10 @@ static int GT64260eth_sendpacket(struct GTeth_softc *sc,struct mbuf *m)
*/
intrmask = sc->sc_intrmask;
if ( !(m->m_next)) /* single buffer packet */
if ( !(m->m_next)) {/* single buffer packet */
sc->txq_mbuf[index]= m;
sc->stats.txSinglMaxLen= MAX(m->m_len, sc->stats.txSinglMaxLen);
}
else /* multiple mbufs in this packet */
{
struct mbuf *mtp, *mdest;
@@ -923,7 +947,9 @@ static int GT64260eth_sendpacket(struct GTeth_softc *sc,struct mbuf *m)
printk("%d ",mtp->m_len);
#endif
len += mtp->m_len;
sc->stats.txBuffMaxLen=MAX(mtp->m_len,sc->stats.txBuffMaxLen);
}
sc->stats.txMultiMaxLoop=MAX(loop, sc->stats.txMultiMaxLoop);
#if 0
printk("\n");
#endif
@@ -931,6 +957,8 @@ static int GT64260eth_sendpacket(struct GTeth_softc *sc,struct mbuf *m)
/* free old mbuf chain */
m_freem(m);
sc->txq_mbuf[index] = m = mdest;
sc->stats.txMultiBuffPacket++;
sc->stats.txMultiMaxLen= MAX(m->m_len, sc->stats.txMultiMaxLen);
}
if (m->m_len < ET_MINLEN) m->m_len = ET_MINLEN;
@@ -1109,10 +1137,12 @@ static void GTeth_tx_stop(struct GTeth_softc *sc)
sc->arpcom.ac_if.if_timer = 0;
}
/* TOCHECK : Should it be about rx or tx ? */
static void GTeth_ifchange(struct GTeth_softc *sc)
{
if (GTeth_debug>0) printk("GTeth_ifchange(");
if (GTeth_debug>5) printk("(pcr=%#x,imr=%#x)",inl(ETH0_EPCR),inl(ETH0_EIMR));
/* printk("SIOCADDMULTI (SIOCDELMULTI): is it about rx or tx ?\n");*/
outl(sc->sc_pcr | ETH_EPCR_EN, ETH0_EPCR);
outl(sc->sc_intrmask, ETH0_EIMR);
GTeth_ifstart(&sc->arpcom.ac_if);
@@ -1415,11 +1445,10 @@ static void GTeth_hash_init(struct GTeth_softc *sc)
#endif
}
#ifdef GT64260eth_DEBUG
static void GT64260eth_error(struct GTeth_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
unsigned int intr_status= sc->if_errsts[sc->if_err_ptr1];
unsigned int intr_status= sc->intr_errsts[sc->intr_err_ptr1];
/* read and reset the status; because this is written
* by the ISR, we must disable interrupts here
@@ -1442,10 +1471,10 @@ static void GT64260eth_error(struct GTeth_softc *sc)
else
printk("%s%d: Ghost interrupt ?\n",ifp->if_name,
ifp->if_unit);
sc->if_errsts[sc->if_err_ptr1]=0;
if ( (++sc->if_err_ptr1) == IF_ERR_BUFSZE) sc->if_err_ptr1=0; /* Till Straumann */
sc->intr_errsts[sc->intr_err_ptr1++]=0;
sc->intr_err_ptr1 %= INTR_ERR_SIZE; /* Till Straumann */
}
#endif
/* The daemon does all of the work; RX, TX and cleaning up buffers/descriptors */
static void GT64260eth_daemon(void *arg)
@@ -1455,6 +1484,13 @@ static void GT64260eth_daemon(void *arg)
struct mbuf *m=0;
struct ifnet *ifp=&sc->arpcom.ac_if;
#if 0
/* see comments in GT64260eth_init(); in newer versions of
* rtems, we hold the network semaphore at this point
*/
rtems_semaphore_release(sc->daemonSync);
#endif
/* NOTE: our creator possibly holds the bsdnet_semaphore.
* since that has PRIORITY_INVERSION enabled, our
* subsequent call to bsdnet_event_receive() will
@@ -1512,9 +1548,7 @@ static void GT64260eth_daemon(void *arg)
ifp->if_flags &= ~IFF_OACTIVE;
/* Log errors and other uncommon events. */
#ifdef GT64260eth_DEBUG
if (events & ERR_EVENT) GT64260eth_error(sc);
#endif
if (events & ERR_EVENT) GT64260eth_error(sc);
} /* end for(;;) { rtems_bsdnet_event_receive() .....*/
ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);

View File

@@ -4,7 +4,6 @@
* All rights reserved.
*
* RTEMS/Mvme5500 port 2004 by S. Kate Feng, <feng1@bnl.gov>,
* under the Deaprtment of Energy contract DE-AC02-98CH10886
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,7 +50,7 @@
#define RX_RING_SIZE 16
#define HASH_TABLE_SIZE 16
#define HASH_DRAM_SIZE HASH_TABLE_SIZE*1024 /* size of DRAM for hash table */
#define IF_ERR_BUFSZE 16
#define INTR_ERR_SIZE 16
enum GTeth_txprio {
GE_TXPRIO_HI=1,
@@ -71,9 +70,9 @@ struct GTeth_softc {
struct mbuf* txq_mbuf[TX_RING_SIZE]; /* transmit buffer memory */
struct mbuf* rxq_mbuf[RX_RING_SIZE]; /* receive buffer memory */
struct GTeth_softc *next_module;
volatile unsigned int if_errsts[IF_ERR_BUFSZE]; /* capture the right intr_status */
unsigned int if_err_ptr1; /* ptr used in GTeth_error() */
unsigned int if_err_ptr2; /* ptr used in ISR */
volatile unsigned int intr_errsts[INTR_ERR_SIZE]; /* capture the right intr_status */
unsigned int intr_err_ptr1; /* ptr used in GTeth_error() */
unsigned int intr_err_ptr2; /* ptr used in ISR */
struct ifqueue txq_pendq; /* these are ready to go to the GT */
unsigned int txq_pending;
unsigned int txq_lo; /* next to be given to GT DMA */
@@ -126,7 +125,13 @@ struct GTeth_softc {
/* statistics */
struct {
volatile unsigned long rxInterrupts;
volatile unsigned long txInterrupts;
unsigned long txMultiBuffPacket;
unsigned long txMultiMaxLen;
unsigned long txSinglMaxLen;
unsigned long txMultiMaxLoop;
unsigned long txBuffMaxLen;
unsigned long length_errors;
unsigned long frame_errors;
unsigned long crc_errors;

View File

@@ -1,6 +1,5 @@
/*
* Copyright (c) 2004,2005, 2008 RTEMS/Mvme5500 port by S. Kate Feng <feng1@bnl.gov>
* under the Deaprtment of Energy contract DE-AC02-98CH10886
* Copyright (c) 2004,2005 RTEMS/Mvme5500 port by S. Kate Feng <feng1@bnl.gov>
* Brookhaven National Laboratory, All rights reserved
*
* Acknowledgements:
@@ -26,7 +25,8 @@
* hardware auto-neg. state machine disabled. PCI control "snoop
* to WB region", MII mode (PHY) instead of TBI mode.
* 6) We currently only use 32-bit (instead of 64-bit) DMA addressing.
* 7) Implementation for Jumbo Frame and TCP checksum is not yet completed.
* 7) Support for checksum offloading and TCP segmentation offload will
* be available for releasing in 2008, upon request, if I still believe.
*
*/
@@ -34,11 +34,8 @@
#define INET
/*#define RTEMS_ETHERMTU_JUMBO*/
#include <rtems.h>
#include <rtems/bspIo.h> /* printk */
#include <stdio.h> /* printf for statistics */
#include <string.h>
@@ -67,7 +64,6 @@
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <net/ethernet.h>
#ifdef INET
#include <netinet/in_var.h>
@@ -86,7 +82,7 @@
#define i82544EI_TASK_NAME "IGHZ"
#define SOFTC_ALIGN 4095
#define IF_ERR_BUFSZE 16
#define INTR_ERR_SIZE 16
/*#define WM_DEBUG*/
#ifdef WM_DEBUG
@@ -113,12 +109,12 @@ int wm_debug = WM_DEBUG_TX|WM_DEBUG_RX|WM_DEBUG_LINK;
#define ALL_EVENTS (KILL_EVENT|START_TRANSMIT_EVENT|RX_EVENT|TX_EVENT|ERR_EVENT|INIT_EVENT)
/* <skf> used 64 in 4.8.0, TOD; try 4096 */
#define NTXDESC 256
#define NTXDESC 128
#define NTXDESC_MASK (NTXDESC - 1)
#define WM_NEXTTX(x) (((x) + 1) & NTXDESC_MASK)
#define NRXDESC 256
#define NRXDESC 64
#define NRXDESC_MASK (NRXDESC - 1)
#define WM_NEXTRX(x) (((x) + 1) & NRXDESC_MASK)
#define WM_PREVRX(x) (((x) - 1) & NRXDESC_MASK)
@@ -127,10 +123,9 @@ int wm_debug = WM_DEBUG_TX|WM_DEBUG_RX|WM_DEBUG_LINK;
#define WM_CDTXOFF(x) WM_CDOFF(sc_txdescs[(x)])
#define WM_CDRXOFF(x) WM_CDOFF(sc_rxdescs[(x)])
#define TXQ_HiLmt_OFF 32
#define TXQ_HiLmt_OFF 64
static uint32_t TxDescCmd;
static unsigned BSP_1GHz_membase;
/*
* Software state per device.
@@ -141,9 +136,9 @@ struct wm_softc {
struct mbuf *txs_mbuf[NTXDESC]; /* transmit buffer memory */
struct mbuf *rxs_mbuf[NRXDESC]; /* receive buffer memory */
struct wm_softc *next_module;
volatile unsigned int if_errsts[IF_ERR_BUFSZE]; /* intr_status */
unsigned int if_err_ptr1; /* ptr used in i82544EI_error() */
unsigned int if_err_ptr2; /* ptr used in ISR */
volatile unsigned int intr_errsts[INTR_ERR_SIZE]; /* intr_status */
unsigned int intr_err_ptr1; /* ptr used in i82544EI_error() */
unsigned int intr_err_ptr2; /* ptr used in ISR */
int txs_firstdesc; /* first descriptor in packet */
int txs_lastdesc; /* last descriptor in packet */
int txs_ndesc; /* # of descriptors used */
@@ -173,16 +168,15 @@ struct wm_softc {
int sc_rxptr; /* next ready Rx descriptor/queue ent */
int sc_rxdiscard;
int sc_rxlen;
uint32_t sc_ctrl; /* prototype CTRL register */
#if 0
uint32_t sc_ctrl_ext; /* prototype CTRL_EXT register */
#endif
uint32_t sc_icr; /* prototype interrupt bits */
uint32_t sc_tctl; /* prototype TCTL register */
uint32_t sc_rctl; /* prototype RCTL register */
uint32_t sc_tipg; /* prototype TIPG register */
uint32_t sc_fcrtl; /* prototype FCRTL register */
uint32_t sc_pba; /* prototype PBA register */
int sc_mchash_type; /* multicast filter offset */
@@ -190,6 +184,11 @@ struct wm_softc {
struct {
volatile unsigned long rxInterrupts;
volatile unsigned long txInterrupts;
unsigned long txMultiBuffPacket;
unsigned long txMultiMaxLen;
unsigned long txSinglMaxLen;
unsigned long txMultiMaxLoop;
unsigned long txBuffMaxLen;
unsigned long linkInterrupts;
unsigned long length_errors;
unsigned long frame_errors;
@@ -225,20 +224,20 @@ struct wm_softc {
static struct wm_softc *root_i82544EI_dev = NULL;
static void i82544EI_ifstart(struct ifnet *ifp);
static int wm_ioctl(struct ifnet *ifp, ioctl_command_t cmd,caddr_t data);
static int wm_ioctl(struct ifnet *ifp, u_long cmd,uint32_t data);
static void i82544EI_ifinit(void *arg);
static void wm_stop(struct ifnet *ifp, int disable);
static void wm_gmii_mediainit(struct wm_softc *sc);
static void wm_rxdrain(struct wm_softc *sc);
static int wm_add_rxbuf(struct wm_softc *sc, int idx);
static int wm_read_eeprom(struct wm_softc *sc,int word,int wordcnt, uint16_t *data);
static void i82544EI_daemon(void *arg);
static void wm_set_filter(struct wm_softc *sc);
static void i82544EI_rx(struct wm_softc *sc);
static void i82544EI_isr(rtems_irq_hdl_param handle);
static void i82544EI_isr();
static void i82544EI_sendpacket(struct wm_softc *sc, struct mbuf *m);
extern int pci_mem_find(), pci_io_find(), pci_get_capability();
extern char * ether_sprintf1();
static void i82544EI_irq_on(const rtems_irq_connect_data *irq)
{
@@ -270,7 +269,6 @@ static int i82544EI_irq_is_on(const rtems_irq_connect_data *irq)
static rtems_irq_connect_data i82544IrqData={
BSP_GPP_82544_IRQ,
(rtems_irq_hdl) i82544EI_isr,
(rtems_irq_hdl_param) NULL,
(rtems_irq_enable) i82544EI_irq_on,
(rtems_irq_disable) i82544EI_irq_off,
(rtems_irq_is_enabled) i82544EI_irq_is_on,
@@ -290,12 +288,9 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
unit = rtems_bsdnet_parse_driver_name(config, &name);
if (unit < 0) return 0;
if ( !strncmp((const char *)name,"autoz",5))
memcpy(name,"gtGHz",5);
printk("\nAttaching MVME5500 1GHz NIC%d\n", unit);
printk("RTEMS-mvme5500 BSP Copyright (c) 2004,2005,2008 Shuchen Kate Feng \n");
printk("\nEthernet driver name %s unit %d \n",name, unit);
printk("Copyright (c) 2004,2005 S. Kate Feng <feng1@bnl.gov> (RTEMS/mvme5500 port)\n");
/* Make sure certain elements e.g. descriptor lists are aligned.*/
softc_mem = rtems_bsdnet_malloc(sizeof(*sc) + SOFTC_ALIGN, M_FREE, M_NOWAIT);
@@ -321,16 +316,13 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
if ( pci_mem_find(b,d,f,PCI_MAPREG_START, &sc->sc_membase, &sc->sc_memsize))
rtems_panic("i82544EI: unable to map memory space\n");
printk("Memory base addr 0x%x\n", sc->sc_membase);
BSP_1GHz_membase= sc->sc_membase;
#ifdef WM_DEBUG
printk("Memory base addr 0x%x\n", sc->sc_membase);
printk("txdesc[0] addr:0x%x, rxdesc[0] addr:0x%x, sizeof sc %d\n",&sc->sc_txdescs[0], &sc->sc_rxdescs[0], sizeof(*sc));
#endif
sc->sc_ctrl=CSR_READ(sc,WMREG_CTRL);
sc->sc_ctrl |=CSR_READ(sc,WMREG_CTRL);
/*
* Determine a few things about the bus we're connected to.
*/
@@ -368,10 +360,11 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
enaddr[4] = myea[2] & 0xff;
enaddr[5] = myea[2] >> 8;
memcpy(sc->arpcom.ac_enaddr, enaddr, ETHER_ADDR_LEN);
#ifdef WM_DEBUG
printk("%s: Ethernet address %s\n", sc->dv_xname,
ether_sprintf(enaddr));
ether_sprintf1(enaddr));
#endif
/*
@@ -402,39 +395,13 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
CSR_WRITE(sc,WMREG_CTRL_EXT, sc->sc_ctrl_ext);
#endif
/*
* Determine if we're TBI or GMII mode, and initialize the
* media structures accordingly.
*/
if ((CSR_READ(sc, WMREG_STATUS) & STATUS_TBIMODE) != 0) {
/* 1000BASE-X : fiber (TBI mode)
wm_tbi_mediainit(sc); */
} else { /* 1000BASE-T : copper (internal PHY mode), for the mvme5500 */
wm_gmii_mediainit(sc);
}
ifp = &sc->arpcom.ac_if;
/* set this interface's name and unit */
ifp->if_unit = unit;
ifp->if_name = name;
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
#ifdef RTEMS_ETHERMTU_JUMBO
sc->arpcom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
ifp->if_mtu = config->mtu ? config->mtu : ETHERMTU_JUMBO;
#else
ifp->if_mtu = config->mtu ? config->mtu : ETHERMTU;
#endif
#ifdef RTEMS_CKSUM_OFFLOAD
/* < skf> The following is really not related to jumbo frame
sc->arpcom.ec_capabilities |= ETHERCAP_VLAN_MTU;*/
ifp->if_capabilities |= IFCAP_CSUM_IPv4_Tx | IFCAP_CSUM_IPv4_Rx |
IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx |
IFCAP_CSUM_TCPv6_Tx | IFCAP_CSUM_UDPv6_Tx |
IFCAP_TSOv4; /* TCP segmentation offload. */
#endif
ifp->if_ioctl = wm_ioctl;
ifp->if_start = i82544EI_ifstart;
/* ifp->if_watchdog = wm_watchdog;*/
@@ -449,8 +416,7 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
rtems_build_name('I','G','H','Z'),0,0,0,&sc->daemonSync))
rtems_panic("i82544EI: semaphore creation failed");
i82544IrqData.handle= (rtems_irq_hdl_param) sc;
/* sc->next_module = root_i82544EI_dev;*/
sc->next_module = root_i82544EI_dev;
root_i82544EI_dev = sc;
/* Attach the interface. */
@@ -463,39 +429,6 @@ int rtems_i82544EI_driver_attach(struct rtems_bsdnet_ifconfig *config, int attac
return(1);
}
/*
* wm_reset:
*
* Reset the i82544 chip.
*/
static void wm_reset(struct wm_softc *sc)
{
int i;
sc->sc_pba = sc->arpcom.ac_if.if_mtu > 8192 ? PBA_40K : PBA_48K;
CSR_WRITE(sc, WMREG_PBA, sc->sc_pba);
/* device reset */
CSR_WRITE(sc, WMREG_CTRL, CTRL_RST);
rtems_bsp_delay(10000);
for (i = 0; i < 1000; i++) {
if ((CSR_READ(sc, WMREG_CTRL) & CTRL_RST) == 0)
break;
rtems_bsp_delay(20);
}
if (CSR_READ(sc, WMREG_CTRL) & CTRL_RST)
printk("Intel 82544 1GHz reset failed to complete\n");
sc->sc_ctrl_ext = CSR_READ(sc,WMREG_CTRL_EXT);
sc->sc_ctrl_ext |= CTRL_EXT_EE_RST;
CSR_WRITE(sc, WMREG_CTRL_EXT, sc->sc_ctrl_ext);
CSR_READ(sc, WMREG_STATUS);
/* Wait for EEPROM reload */
rtems_bsp_delay(2000);
sc->sc_ctrl= CSR_READ(sc, WMREG_CTRL);
}
/*
* i82544EI_ifstart: [ifnet interface function]
*
@@ -528,21 +461,27 @@ static void i82544EI_stats(struct wm_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
printf(" Ghost Interrupts:%-8lu\n", sc->stats.ghostInterrupts);
printf(" Rx Interrupts:%-8lu\n", sc->stats.rxInterrupts);
printf(" Rx Interrupts:%-8u\n", sc->stats.rxInterrupts);
printf(" Receive Packets:%-8u\n", CSR_READ(sc,WMREG_GPRC));
printf(" Receive Overrun:%-8lu\n", sc->stats.rxOvrRunInterrupts);
printf(" Receive Overrun:%-8u\n", sc->stats.rxOvrRunInterrupts);
printf(" Receive errors:%-8u\n", CSR_READ(sc,WMREG_RXERRC));
printf(" Rx sequence error:%-8lu\n", sc->stats.rxSeqErr);
printf(" Rx /C/ ordered:%-8lu\n", sc->stats.rxC_ordered);
printf(" Rx sequence error:%-8u\n", sc->stats.rxSeqErr);
printf(" Rx /C/ ordered:%-8u\n", sc->stats.rxC_ordered);
printf(" Rx Length Errors:%-8u\n", CSR_READ(sc,WMREG_RLEC));
printf(" Tx Interrupts:%-8lu\n", sc->stats.txInterrupts);
printf(" Tx Interrupts:%-8u\n", sc->stats.txInterrupts);
#if 0
printf("Multi-BuffTx Packets:%-8u\n", sc->stats.txMultiBuffPacket);
printf("Multi-BuffTx max len:%-8u\n", sc->stats.txMultiMaxLen);
printf("SingleBuffTx max len:%-8u\n", sc->stats.txSinglMaxLen);
printf("Multi-BuffTx maxloop:%-8u\n", sc->stats.txMultiMaxLoop);
printf("Tx buffer max len :%-8u\n", sc->stats.txBuffMaxLen);
#endif
printf(" Transmitt Packets:%-8u\n", CSR_READ(sc,WMREG_GPTC));
printf(" Transmitt errors:%-8lu\n", ifp->if_oerrors);
printf(" Active Txqs:%-8lu\n", sc->txq_nactive);
printf(" Transmitt errors:%-8u\n", ifp->if_oerrors);
printf(" Active Txqs:%-8u\n", sc->txq_nactive);
printf(" collisions:%-8u\n", CSR_READ(sc,WMREG_COLC));
printf(" Crc Errors:%-8u\n", CSR_READ(sc,WMREG_CRCERRS));
printf(" Link Status Change:%-8lu\n", sc->stats.linkStatusChng);
printf(" Link Status Change:%-8u\n", sc->stats.linkStatusChng);
}
/*
@@ -550,7 +489,7 @@ static void i82544EI_stats(struct wm_softc *sc)
*
* Handle control requests from the operator.
*/
static int wm_ioctl(struct ifnet *ifp, ioctl_command_t cmd,caddr_t data)
static int wm_ioctl(struct ifnet *ifp, u_long cmd,uint32_t data)
{
struct wm_softc *sc = ifp->if_softc;
int error=0;
@@ -582,9 +521,9 @@ static int wm_ioctl(struct ifnet *ifp, ioctl_command_t cmd,caddr_t data)
*
* Interrupt service routine.
*/
static void i82544EI_isr(rtems_irq_hdl_param handle)
static void i82544EI_isr()
{
volatile struct wm_softc *sc = (struct wm_softc *) handle;
volatile struct wm_softc *sc = root_i82544EI_dev;
uint32_t icr;
rtems_event_set events=0;
@@ -608,8 +547,8 @@ static void i82544EI_isr(rtems_irq_hdl_param handle)
events |= INIT_EVENT;
}
if (icr & ICR_RXSEQ) /* framing error */ {
sc->if_errsts[sc->if_err_ptr2]=icr;
if ((++sc->if_err_ptr2)==IF_ERR_BUFSZE) sc->if_err_ptr2=0;/* Till Straumann */
sc->intr_errsts[sc->intr_err_ptr2++]=icr;
sc->intr_err_ptr2 %=INTR_ERR_SIZE; /* Till Straumann */
events |= ERR_EVENT;
sc->stats.rxSeqErr++;
}
@@ -667,12 +606,15 @@ static void i82544EI_sendpacket(struct wm_softc *sc, struct mbuf *m)
* The other way is effective for packets < 2K
*/
if ( ((y=(len+mtp->m_len)) > sizeof(union mcluster))) {
printk(" >%d, use next descriptor\n", sizeof(union mcluster));
printk(">2048, use next descriptor\n");
break;
}
memcpy((void *)pt,(char *)mtp->m_data, mtp->m_len);
pt += mtp->m_len;
len += mtp->m_len;
#if 0
sc->stats.txSinglMaxLen= MAX(mtp->m_len, sc->stats.txSinglMaxLen);
#endif
} /* end for loop */
mdest->m_len=len;
sc->txs_mbuf[sc->txq_next] = mdest;
@@ -686,8 +628,15 @@ static void i82544EI_sendpacket(struct wm_softc *sc, struct mbuf *m)
sc->txq_free--;
else
rtems_panic("i8254EI : no more free descriptors");
#if 0
sc->stats.txMultiMaxLen= MAX(mdest->m_len, sc->stats.txMultiMaxLen);
sc->stats.txMultiBuffPacket++;
#endif
} /* end for while */
/* free old mbuf chain */
#if 0
sc->stats.txMultiMaxLoop=MAX(loop, sc->stats.txMultiMaxLoop);
#endif
m_freem(m);
m=0;
} /* end multiple mbufs */
@@ -793,11 +742,12 @@ static void i82544EI_rx(struct wm_softc *sc)
sc->dv_xname, i));
status = sc->sc_rxdescs[i].wrx_status;
if ((status & WRX_ST_DD) == 0) break; /* descriptor not done */
errors = sc->sc_rxdescs[i].wrx_errors;
len = le16toh(sc->sc_rxdescs[i].wrx_len);
m = sc->rxs_mbuf[i];
if ((status & WRX_ST_DD) == 0) break; /* descriptor not done */
if (sc->sc_rxdiscard) {
printk("RX: discarding contents of descriptor %d\n", i);
wm_init_rxdesc(sc, i);
@@ -869,46 +819,16 @@ static int i82544EI_init_hw(struct wm_softc *sc)
int i,error;
uint8_t cksumfields;
#if 0
/* KATETODO : sc_align_tweak */
/*
* *_HDR_ALIGNED_P is constant 1 if __NO_STRICT_ALIGMENT is set.
* There is a small but measurable benefit to avoiding the adjusment
* of the descriptor so that the headers are aligned, for normal mtu,
* on such platforms. One possibility is that the DMA itself is
* slightly more efficient if the front of the entire packet (instead
* of the front of the headers) is aligned.
*
* Note we must always set align_tweak to 0 if we are using
* jumbo frames.
*/
#ifdef __NO_STRICT_ALIGNMENT
sc->sc_align_tweak = 0;
#else
if ((ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN) > (MCLBYTES - 2))
sc->sc_align_tweak = 0;
else
sc->sc_align_tweak = 2;
#endif /* __NO_STRICT_ALIGNMENT */
#endif
/* Cancel any pending I/O. */
wm_stop(ifp, 0);
/* update statistics before reset */
ifp->if_collisions += CSR_READ(sc, WMREG_COLC);
ifp->if_ierrors += CSR_READ(sc, WMREG_RXERRC);
/* Reset the chip to a known state. */
wm_reset(sc);
/* Initialize the error buffer ring */
sc->if_err_ptr1=0;
sc->if_err_ptr2=0;
for (i=0; i< IF_ERR_BUFSZE; i++) sc->if_errsts[i]=0;
sc->intr_err_ptr1=0;
sc->intr_err_ptr2=0;
for (i=0; i< INTR_ERR_SIZE; i++) sc->intr_errsts[i]=0;
/* Initialize the transmit descriptor ring. */
memset( (void *) sc->sc_txdescs, 0, sizeof(sc->sc_txdescs));
memset(sc->sc_txdescs, 0, sizeof(sc->sc_txdescs));
sc->txq_free = NTXDESC;
sc->txq_next = 0;
sc->txs_lastdesc = 0;
@@ -927,8 +847,8 @@ static int i82544EI_init_hw(struct wm_softc *sc)
CSR_WRITE(sc,WMREG_TDLEN, sizeof(sc->sc_txdescs));
CSR_WRITE(sc,WMREG_TDH, 0);
CSR_WRITE(sc,WMREG_TDT, 0);
CSR_WRITE(sc,WMREG_TIDV, 0 );
/* CSR_WRITE(sc,WMREG_TADV, 128); not for 82544 */
CSR_WRITE(sc,WMREG_TIDV, 64 );
CSR_WRITE(sc,WMREG_TADV, 128);
CSR_WRITE(sc,WMREG_TXDCTL, TXDCTL_PTHRESH(0) |
TXDCTL_HTHRESH(0) | TXDCTL_WTHRESH(0));
@@ -942,11 +862,10 @@ static int i82544EI_init_hw(struct wm_softc *sc)
* Set up checksum offload parameters for
* this packet.
*/
#ifdef RTEMS_CKSUM_OFFLOAD
if (m0->m_pkthdr.csum_flags & (M_CSUM_TSOv4|M_CSUM_TSOv6|
M_CSUM_IPv4|M_CSUM_TCPv4|M_CSUM_UDPv4|
M_CSUM_TCPv6|M_CSUM_UDPv6)) {
if (wm_tx_offload(sc, txs, &TxDescCmd,&cksumfields) != 0) {
#ifdef CKSUM_OFFLOAD
if (m0->m_pkthdr.csum_flags &
(M_CSUM_IPv4|M_CSUM_TCPv4|M_CSUM_UDPv4)) {
if (wm_tx_cksum(sc, txs, &TxDescCmd,&cksumfields) != 0) {
/* Error message already displayed. */
continue;
}
@@ -954,7 +873,7 @@ static int i82544EI_init_hw(struct wm_softc *sc)
#endif
TxDescCmd = 0;
cksumfields = 0;
#ifdef RTEMS_CKSUM_OFFLOAD
#ifdef CKSUM_OFFLOAD
}
#endif
@@ -973,14 +892,14 @@ static int i82544EI_init_hw(struct wm_softc *sc)
* Initialize the receive descriptor and receive job
* descriptor rings.
*/
memset( (void *) sc->sc_rxdescs, 0, sizeof(sc->sc_rxdescs));
memset(sc->sc_rxdescs, 0, sizeof(sc->sc_rxdescs));
CSR_WRITE(sc,WMREG_RDBAH, 0);
CSR_WRITE(sc,WMREG_RDBAL, WM_CDRXADDR(sc));
CSR_WRITE(sc,WMREG_RDLEN, sizeof(sc->sc_rxdescs));
CSR_WRITE(sc,WMREG_RDH, 0);
CSR_WRITE(sc,WMREG_RDT, 0);
CSR_WRITE(sc,WMREG_RDTR, 0 |RDTR_FPD);
/* CSR_WRITE(sc, WMREG_RADV, 256); not for 82544. */
CSR_WRITE(sc, WMREG_RADV, 256);
for (i = 0; i < NRXDESC; i++) {
if (sc->rxs_mbuf[i] == NULL) {
@@ -1024,13 +943,12 @@ static int i82544EI_init_hw(struct wm_softc *sc)
CSR_WRITE(sc,WMREG_FCRTH, FCRTH_DFLT);
CSR_WRITE(sc,WMREG_FCRTL, sc->sc_fcrtl);
/*KATETO CSR_WRITE(sc,WMREG_FCTTV, FCTTV_DFLT);*/
CSR_WRITE(sc,WMREG_FCTTV, 0x100);
CSR_WRITE(sc,WMREG_FCTTV, FCTTV_DFLT);
sc->sc_ctrl &= ~CTRL_VME;
/* KATETODo : not here.
Configures flow control settings after link is established
sc->sc_ctrl |= CTRL_TFCE | CTRL_RFCE; */
/*sc->sc_ctrl |= CTRL_TFCE | CTRL_RFCE;*/
/* enable Big Endian Mode for the powerPC
sc->sc_ctrl |= CTRL_BEM;*/
/* Write the control registers. */
CSR_WRITE(sc,WMREG_CTRL, sc->sc_ctrl);
@@ -1038,21 +956,7 @@ static int i82544EI_init_hw(struct wm_softc *sc)
CSR_WRITE(sc,WMREG_CTRL_EXT, sc->sc_ctrl_ext);
#endif
/* MOTLoad : WMREG_RXCSUM (0x5000)= 0, no Rx checksum offloading */
#ifdef RTEMS_CKSUM_OFFLOAD
/*
* Set up checksum offload parameters.
*/
reg = CSR_READ(sc, WMREG_RXCSUM);
reg &= ~(RXCSUM_IPOFL | RXCSUM_IPV6OFL | RXCSUM_TUOFL);
if (ifp->if_capenable & IFCAP_CSUM_IPv4_Rx)
reg |= RXCSUM_IPOFL;
if (ifp->if_capenable & (IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx))
reg |= RXCSUM_IPOFL | RXCSUM_TUOFL;
if (ifp->if_capenable & (IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_UDPv6_Rx))
reg |= RXCSUM_IPV6OFL | RXCSUM_TUOFL;
CSR_WRITE(sc, WMREG_RXCSUM, reg);
#endif
/* MOTLoad : WMREG_RXCSUM (0x5000)= 0, no Rx checksum offloading */
/*
* Set up the interrupt registers.
@@ -1081,8 +985,7 @@ static int i82544EI_init_hw(struct wm_softc *sc)
* we resolve the media type.
*/
sc->sc_tctl = TCTL_EN | TCTL_PSP | TCTL_CT(TX_COLLISION_THRESHOLD) |
TCTL_COLD(TX_COLLISION_DISTANCE_FDX) |
TCTL_RTLC /* transmit on late collision */;
TCTL_COLD(TX_COLLISION_DISTANCE_FDX) | TCTL_RTLC; /*transmitter enable*/
/*
* Set up the receive control register; we actually program
@@ -1090,31 +993,14 @@ static int i82544EI_init_hw(struct wm_softc *sc)
* address offset type 0.
*
* Only the i82544 has the ability to strip the incoming
* CRC, so we don't enable that feature. (TODO: |RCTL_SECRC)
* CRC, so we don't enable that feature. (TODO)
*/
sc->sc_mchash_type = 0;
sc->sc_rctl = RCTL_EN | RCTL_LBM_NONE | RCTL_RDMTS_1_2 | RCTL_LPE |
RCTL_DPF | RCTL_MO(sc->sc_mchash_type)|RCTL_SECRC;
RCTL_DPF | RCTL_MO(sc->sc_mchash_type);
if (MCLBYTES == 2048) {
sc->sc_rctl |= RCTL_2k;
} else {
switch(MCLBYTES) {
case 4096:
sc->sc_rctl |= RCTL_BSEX | RCTL_BSEX_4k;
break;
case 8192:
sc->sc_rctl |= RCTL_BSEX | RCTL_BSEX_8k;
break;
case 16384:
sc->sc_rctl |= RCTL_BSEX | RCTL_BSEX_16k;
break;
default:
rtems_panic("wm_init: MCLBYTES %d unsupported",
MCLBYTES);
break;
}
}
/* (MCLBYTES == 2048) */
sc->sc_rctl |= RCTL_2k;
#ifdef WM_DEBUG
printk("RDBAL 0x%x,RDLEN %d, RDT %d\n",CSR_READ(sc,WMREG_RDBAL),CSR_READ(sc,WMREG_RDLEN), CSR_READ(sc,WMREG_RDT));
@@ -1132,24 +1018,6 @@ static int i82544EI_init_hw(struct wm_softc *sc)
return(0);
}
void BSP_rdTIDV()
{
printf("Reg TIDV: 0x%x\n", in_le32((volatile unsigned *) (BSP_1GHz_membase+WMREG_TIDV)));
}
void BSP_rdRDTR()
{
printf("Reg RDTR: 0x%x\n", in_le32((volatile unsigned *) (BSP_1GHz_membase+WMREG_RDTR)));
}
void BSP_setTIDV(int val)
{
out_le32((volatile unsigned *) (BSP_1GHz_membase+WMREG_TIDV), val);
}
void BSP_setRDTR(int val)
{
out_le32((volatile unsigned *) (BSP_1GHz_membase+WMREG_RDTR), val);
}
/*
* i82544EI_ifinit: [ifnet interface function]
*
@@ -1365,7 +1233,6 @@ static int wm_read_eeprom_uwire(struct wm_softc *sc, int word, int wordcnt, uint
return (0);
}
#if 0
/*
* wm_acquire_eeprom:
*
@@ -1397,7 +1264,6 @@ static int wm_acquire_eeprom(struct wm_softc *sc)
return (0);
}
#endif
/*
* wm_read_eeprom:
@@ -1502,7 +1368,7 @@ static void wm_set_filter(struct wm_softc *sc)
mta_reg = WMREG_CORDOVA_MTA;
sc->sc_rctl &= ~(RCTL_BAM | RCTL_UPE | RCTL_MPE);
if (ifp->if_flags & IFF_BROADCAST)
/* if (ifp->if_flags & IFF_BROADCAST)*/
sc->sc_rctl |= RCTL_BAM;
if (ifp->if_flags & IFF_PROMISC) {
sc->sc_rctl |= RCTL_UPE;
@@ -1572,11 +1438,12 @@ static void wm_set_filter(struct wm_softc *sc)
static void i82544EI_error(struct wm_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
unsigned long intr_status= sc->if_errsts[sc->if_err_ptr1];
unsigned long intr_status= sc->intr_errsts[sc->intr_err_ptr1++];
/* read and reset the status; because this is written
* by the ISR, we must disable interrupts here
*/
sc->intr_err_ptr1 %=INTR_ERR_SIZE; /* Till Straumann */
if (intr_status) {
printk("Error %s%d:", ifp->if_name, ifp->if_unit);
if (intr_status & ICR_RXSEQ) {
@@ -1586,8 +1453,6 @@ static void i82544EI_error(struct wm_softc *sc)
}
else
printk("%s%d: Ghost interrupt ?\n",ifp->if_name,ifp->if_unit);
sc->if_errsts[sc->if_err_ptr1]=0;
if ( (++sc->if_err_ptr1) == IF_ERR_BUFSZE) sc->if_err_ptr1=0; /* Till Straumann */
}
void i82544EI_printStats()
@@ -1628,7 +1493,7 @@ static void i82544EI_daemon(void *arg)
&events);
if (KILL_EVENT & events) break;
if (events & RX_EVENT) i82544EI_rx(sc); /* in ISR instead */
if (events & RX_EVENT) i82544EI_rx(sc);
/* clean up and try sending packets */
do {
@@ -1636,7 +1501,6 @@ static void i82544EI_daemon(void *arg)
while (sc->txq_free>0) {
if (sc->txq_free>TXQ_HiLmt_OFF) {
m=0;
IF_DEQUEUE(&ifp->if_snd,m);
if (m==0) break;
i82544EI_sendpacket(sc, m);
@@ -1645,6 +1509,7 @@ static void i82544EI_daemon(void *arg)
i82544EI_txq_done(sc);
break;
}
if (events & RX_EVENT) i82544EI_rx(sc);
}
/* we leave this loop
* - either because there's no free buffer
@@ -1652,7 +1517,7 @@ static void i82544EI_daemon(void *arg)
* - or there's nothing to send (IF_DEQUEUE
* returned 0
*/
} while (m);
} while (m && sc->txq_free);
ifp->if_flags &= ~IFF_OACTIVE;
@@ -1689,65 +1554,3 @@ static void i82544EI_daemon(void *arg)
*/
rtems_task_delete(RTEMS_SELF);
}
/*
* wm_gmii_reset:
*
* Reset the PHY.
*/
static void wm_gmii_reset(struct wm_softc *sc)
{
CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl | CTRL_PHY_RESET);
rtems_bsp_delay(20000);
CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl);
rtems_bsp_delay(20000);
}
/*
* wm_gmii_mediainit:
*
* Initialize media for use on 1000BASE-T devices.
*/
static void wm_gmii_mediainit(struct wm_softc *sc)
{
/* struct ifnet *ifp = &sc->arpcom.ac_if;*/
/* We have MII. */
sc->sc_flags |= WM_F_HAS_MII;
sc->sc_tipg = TIPG_1000T_DFLT; /* 0x602008 */
/*
* Let the chip set speed/duplex on its own based on
* signals from the PHY.
* XXXbouyer - I'm not sure this is right for the 80003,
* the em driver only sets CTRL_SLU here - but it seems to work.
*/
sc->sc_ctrl |= CTRL_SLU;
CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl);
wm_gmii_reset(sc);
#if 0
/* Initialize our media structures and probe the GMII. */
sc->sc_mii.mii_ifp = ifp;
sc->sc_mii.mii_readreg = wm_gmii_i82544_readreg;
sc->sc_mii.mii_writereg = wm_gmii_i82544_writereg;
sc->sc_mii.mii_statchg = wm_gmii_statchg;
ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, wm_gmii_mediachange,
wm_gmii_mediastatus);
mii_attach(&sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
MII_OFFSET_ANY, MIIF_DOPAUSE);
if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);
ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);
} else
ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
#endif
}

View File

@@ -5,9 +5,6 @@
* All rights reserved.
*
* Written by Jason R. Thorpe for Wasabi Systems, Inc.
* Some are added by Shuchen Kate Feng <feng1@bnl.gov>,
* NSLS, Brookhaven National Laboratory. All rights reserved.
* under the Deaprtment of Energy contract DE-AC02-98CH10886
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,7 +56,7 @@ typedef struct wiseman_addr {
* The receive descriptor ring must be aligned to a 4K boundary,
* and there must be an even multiple of 8 descriptors in the ring.
*/
typedef volatile struct wiseman_rxdesc {
typedef struct wiseman_rxdesc {
wiseman_addr_t wrx_addr; /* buffer address */
uint16_t wrx_len; /* buffer length */
@@ -106,7 +103,7 @@ typedef struct wiseman_tx_fields {
uint8_t wtxu_options; /* options */
uint16_t wtxu_vlan; /* VLAN info */
} __attribute__((__packed__)) wiseman_txfields_t;
typedef volatile struct wiseman_txdesc {
typedef struct wiseman_txdesc {
wiseman_addr_t wtx_addr; /* buffer address */
uint32_t wtx_cmdlen; /* command and length */
wiseman_txfields_t wtx_fields; /* fields; see below */

View File

@@ -3,7 +3,6 @@
/*-
* Copyright (c) 2004, 2005 Brookhaven National Laboratory
* S. Kate Feng <feng1@bnl.gov>
* under the Deaprtment of Energy contract DE-AC02-98CH10886
*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
* All rights reserved.

View File

@@ -4,7 +4,6 @@
* Copyright (c) 1995, 1996, 1999, 2000
* Christopher G. Demetriou. All rights reserved.
* Copyright (c) 1994, 1996 Charles M. Hannum. All rights reserved.
* Copyright (C) 2007 Brookhaven National Laboratory, Shuchen Kate Feng
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,7 +30,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <bsp.h>
/*
* PCI Class and Revision Register; defines type and revision of device.
@@ -307,7 +305,7 @@
#define PCI_MAPREG_MEM64_ADDR_MASK 0xfffffffffffffff0ULL
#define PCI_MAPREG_IO_ADDR(mr) \
((mr+PCI0_IO_BASE) & PCI_MAPREG_IO_ADDR_MASK)
((mr) & PCI_MAPREG_IO_ADDR_MASK)
#define PCI_MAPREG_IO_SIZE(mr) \
(PCI_MAPREG_IO_ADDR(mr) & -PCI_MAPREG_IO_ADDR(mr))
#define PCI_MAPREG_IO_ADDR_MASK 0xfffffffc

View File

@@ -6,8 +6,7 @@
* Copyright (C) 2001, 2003 Till Straumann <strauman@slac.stanford.edu>
*
* Copyright (C) 2004 S. Kate Feng, <feng1@bnl.gov>
* wrote it to support the MVME5500 board,
* under the Deaprtment of Energy contract DE-AC02-98CH10886.
* wrote it to support the MVME5500 board.
*
*/
#include <libcpu/io.h>
@@ -24,53 +23,51 @@
#define PCI_INVALID_VENDORDEVICEID 0xffffffff
#define PCI_MULTI_FUNCTION 0x80
#define HOSTBRIDGET_ERROR 0xf0000000
unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet)
{
unsigned long pcidata=0;
unsigned short val;
int PciLocal, busNumber=0, loop;
unsigned int pcidata, pcidata1;
int PciLocal, busNumber=0;
/* On the mvme5500 board, the GT64260B system controller had the MCP
* signal pulled up high. Thus, the MCP signal is not used as it is
* on other boards such as mvme2307.
*/
if (enableMCP) return(-1);
for (PciLocal=0; PciLocal<2; PciLocal++ ) {
pci_read_config_word(busNumber,
0,
0,
PCI_STATUS,
&val);
if ( (val & PCI_STATUS_CLRERR_MASK) && (!quiet))
printk("Before _BSP_clear_hostbridge_errors(): PCI %d sts was 0x%x\n",
PciLocal, val);
if (!busNumber)
pcidata |= val;
else
pcidata |= (val <<16);
for (PciLocal=0; PciLocal<1; PciLocal++ ) {
pci_read_config_dword(busNumber,
0,
0,
PCI_COMMAND,
&pcidata);
for ( loop=0; loop < 10; loop++) {
/* Clear the error on the host bridge */
pci_write_config_word(busNumber,
if (!quiet)
printk("Before _BSP_clear_hostbridge_errors(): 0x%x, cause 0x%x\n",
pcidata, inl(0x1d58));
outl(0,0x1d58);
/* Clear the error on the host bridge */
pcidata1= pcidata;
pcidata1 |= PCI_STATUS_CLRERR_MASK;
pcidata1 |= 0x140;
pci_write_config_dword(busNumber,
0,
0,
PCI_STATUS,
PCI_STATUS_CLRERR_MASK);
PCI_COMMAND,
pcidata1);
pci_read_config_word(busNumber,
pci_read_config_dword(busNumber,
0,
0,
PCI_STATUS,
&val);
if ( !(val & PCI_STATUS_CLRERR_MASK))
break;
else {
if (loop==9)
printk("BSP_clear_hostbridge_errors(): unable to clear pending hostbridge errors\n");
}
}
busNumber += BSP_MAX_PCI_BUS_ON_PCI0;
PCI_COMMAND,
&pcidata1);
if (!quiet) printk("After _BSP_clear_hostbridge_errors(): sts 0x%x\n",
pcidata1);
if (pcidata1 & HOSTBRIDGET_ERROR) printk("BSP_clear_hostbridge_errors(): unable to clear pending hostbridge errors\n");
busNumber += BSP_MAX_PCI_BUS_ON_PCI0;
}
return(pcidata);
return(pcidata & HOSTBRIDGET_ERROR);
}

View File

@@ -46,7 +46,7 @@
#define PCI_IO_BASE_ADDR PCI_BASE_ADDRESS_5
#define PCI_STATUS_CLRERR_MASK 0xf900 /* <SKF> */
#define PCI_STATUS_CLRERR_MASK 0xf9000000 /* <SKF> */
#define PCI_BARE_IntMemEn 0x200

View File

@@ -16,28 +16,26 @@
* pci.c,v 1.2 2002/05/14 17:10:16 joel Exp
*
* Copyright 2004, Brookhaven National Laboratory and
* Shuchen K. Feng, <feng1@bnl.gov>, 2004, 2008
*
* - to be consistent with the original pci.c written by Eric Valette
* - added 2nd PCI support for discovery based PCI bridge (e.g. mvme5500/mvme6100)
* - added bus support for the expansion of PMCSpan as per request by Peter
* Shuchen K. Feng, <feng1@bnl.gov>, 2004
* - modified and added support for MVME5500 board
* - added 2nd PCI support for the mvme5500/GT64260 PCI bridge
* - added bus support for the expansion of PMCSpan, thanks to
* Peter Dufault (dufault@hda.com) for inputs.
*/
#define PCI_MAIN
#include <libcpu/io.h>
#include <rtems/bspIo.h> /* printk */
#include <bsp/irq.h>
#include <bsp/pci.h>
#include <bsp/gtreg.h>
#include <bsp/gtpcireg.h>
#include <bsp.h>
#include <stdio.h>
#include <string.h>
#define PCI_DEBUG 0
#define PCI_PRINT 1
#define PCI_PRINT 0
/* allow for overriding these definitions */
#ifndef PCI_CONFIG_ADDR
@@ -58,31 +56,17 @@
#define PCI_MULTI_FUNCTION 0x80
#define HOSTBRIDGET_ERROR 0xf0000000
#define GT64x60_PCI_CONFIG_ADDR GT64x60_REG_BASE + PCI_CONFIG_ADDR
#define GT64x60_PCI_CONFIG_DATA GT64x60_REG_BASE + PCI_CONFIG_DATA
#define GT64x60_PCI1_CONFIG_ADDR GT64x60_REG_BASE + PCI1_CONFIG_ADDR
#define GT64x60_PCI1_CONFIG_DATA GT64x60_REG_BASE + PCI1_CONFIG_DATA
static int numPCIDevs=0;
static DiscoveryChipVersion BSP_sysControllerVersion = 0;
static BSP_VMEchipTypes BSP_VMEinterface = 0;
static pci_config BSP_pci[2]={
{(volatile unsigned char*) (GT64x60_PCI_CONFIG_ADDR),
(volatile unsigned char*) (GT64x60_PCI_CONFIG_DATA),
0 /* defined at BSP_pci_configuration */},
{(volatile unsigned char*) (GT64x60_PCI1_CONFIG_ADDR),
(volatile unsigned char*) (GT64x60_PCI1_CONFIG_DATA),
0 /* defined at BSP_pci_configuration */}
};
/* define a shortcut */
#define pci BSP_pci_configuration
static int numPCIDevs=0;
extern void pci_interface();
/* Pack RegNum,FuncNum,DevNum,BusNum,and ConfigEnable for
* PCI Configuration Address Register
*/
#define pciConfigPack(bus,dev,func,offset)\
((offset&~3)<<24)|(PCI_DEVFN(dev,func)<<16)|(bus<<8)|0x80
(((func&7)<<8)|((dev&0x1f )<<11)|(( bus&0xff)<<16)|(offset&0xfc))|0x80000000
/*
* Bit encode for PCI_CONFIG_HEADER_TYPE register
@@ -91,36 +75,44 @@ unsigned char ucMaxPCIBus=0;
/* Please note that PCI0 and PCI1 does not correlate with the busNum 0 and 1.
*/
static int indirect_pci_read_config_byte(unsigned char bus,unsigned char dev,unsigned char func,
static int direct_pci_read_config_byte(unsigned char bus,unsigned char dev,unsigned char func,
unsigned char offset,unsigned char *val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char*) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char*) PCI1_CONFIG_DATA;
}
else {
config_addr = pci.pci_config_addr;
config_data = pci.pci_config_data;
}
*val = 0xff;
if (offset & ~0xff) return PCIBIOS_BAD_REGISTER_NUMBER;
#if 0
printk("addr %x, data %x, pack %x \n", BSP_pci[n].pci_config_addr),
BSP_pci[n].config_data,pciConfigPack(bus,dev,func,offset));
printk("addr %x, data %x, pack %x \n", config_addr,
config_data,pciConfigPack(bus,dev,func,offset));
#endif
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
*val = in_8(BSP_pci[n].pci_config_data + (offset&3));
outl(pciConfigPack(bus,dev,func,offset),config_addr);
*val = inb(config_data + (offset&3));
return PCIBIOS_SUCCESSFUL;
}
static int indirect_pci_read_config_word(unsigned char bus, unsigned char dev,
static int direct_pci_read_config_word(unsigned char bus, unsigned char dev,
unsigned char func, unsigned char offset, unsigned short *val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char*) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char*) PCI1_CONFIG_DATA;
}
else {
config_addr = (volatile unsigned char*) pci.pci_config_addr;
config_data = (volatile unsigned char*) pci.pci_config_data;
}
*val = 0xffff;
@@ -129,101 +121,123 @@ unsigned char func, unsigned char offset, unsigned short *val)
printk("addr %x, data %x, pack %x \n", config_addr,
config_data,pciConfigPack(bus,dev,func,offset));
#endif
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
*val = in_le16(BSP_pci[n].pci_config_data + (offset&2));
outl(pciConfigPack(bus,dev,func,offset),config_addr);
*val = inw(config_data + (offset&2));
return PCIBIOS_SUCCESSFUL;
}
static int indirect_pci_read_config_dword(unsigned char bus, unsigned char dev,
static int direct_pci_read_config_dword(unsigned char bus, unsigned char dev,
unsigned char func, unsigned char offset, unsigned int *val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char*) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char*) PCI1_CONFIG_DATA;
}
else {
config_addr = (volatile unsigned char*) pci.pci_config_addr;
config_data = (volatile unsigned char*) pci.pci_config_data;
}
*val = 0xffffffff;
if ((offset&3)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER;
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
*val = in_le32(BSP_pci[n].pci_config_data);
#if 0
printk("addr %x, data %x, pack %x \n", config_addr,
pci.pci_config_data,pciConfigPack(bus,dev,func,offset));
#endif
outl(pciConfigPack(bus,dev,func,offset),config_addr);
*val = inl(config_data);
return PCIBIOS_SUCCESSFUL;
}
static int indirect_pci_write_config_byte(unsigned char bus, unsigned char dev,unsigned char func, unsigned char offset, unsigned char val)
static int direct_pci_write_config_byte(unsigned char bus, unsigned char dev,unsigned char func, unsigned char offset, unsigned char val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char*) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char*) PCI1_CONFIG_DATA;
}
else {
config_addr = pci.pci_config_addr;
config_data = pci.pci_config_data;
}
if (offset & ~0xff) return PCIBIOS_BAD_REGISTER_NUMBER;
#if 0
printk("addr %x, data %x, pack %x \n", config_addr,
config_data,pciConfigPack(bus,dev,func,offset));
#endif
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
out_8(BSP_pci[n].pci_config_data + (offset&3), val);
outl(pciConfigPack(bus,dev,func,offset), config_addr);
outb(val, config_data + (offset&3));
return PCIBIOS_SUCCESSFUL;
}
static int indirect_pci_write_config_word(unsigned char bus, unsigned char dev,unsigned char func, unsigned char offset, unsigned short val)
static int direct_pci_write_config_word(unsigned char bus, unsigned char dev,unsigned char func, unsigned char offset, unsigned short val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char*) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char*) PCI1_CONFIG_DATA;
}
else {
config_addr = (volatile unsigned char*) pci.pci_config_addr;
config_data = (volatile unsigned char*) pci.pci_config_data;
}
if ((offset&1)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER;
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
out_le16(BSP_pci[n].pci_config_data + (offset&3), val);
#if 0
printk("addr %x, data %x, pack %x \n", config_addr,
config_data,pciConfigPack(bus,dev,func,offset));
#endif
outl(pciConfigPack(bus,dev,func,offset),config_addr);
outw(val, config_data + (offset&3));
return PCIBIOS_SUCCESSFUL;
}
static int indirect_pci_write_config_dword(unsigned char bus,unsigned char dev,unsigned char func, unsigned char offset, unsigned int val)
static int direct_pci_write_config_dword(unsigned char bus,unsigned char dev,unsigned char func, unsigned char offset, unsigned int val)
{
int n=0;
volatile unsigned char *config_addr, *config_data;
if (bus>= BSP_MAX_PCI_BUS_ON_PCI0) {
bus-=BSP_MAX_PCI_BUS_ON_PCI0;
n=1;
config_addr = (volatile unsigned char *) PCI1_CONFIG_ADDR;
config_data = (volatile unsigned char *) PCI1_CONFIG_DATA;
}
else {
config_addr = (volatile unsigned char*) pci.pci_config_addr;
config_data = (volatile unsigned char*) pci.pci_config_data;
}
if ((offset&3)|| (offset & ~0xff)) return PCIBIOS_BAD_REGISTER_NUMBER;
out_be32(BSP_pci[n].pci_config_addr, pciConfigPack(bus,dev,func,offset));
out_le32(BSP_pci[n].pci_config_data, val);
#if 0
printk("addr %x, data %x, pack %x \n", config_addr,
config_data,pciConfigPack(bus,dev,func,offset));
#endif
outl(pciConfigPack(bus,dev,func,offset),config_addr);
outl(val,config_data);
return PCIBIOS_SUCCESSFUL;
}
const pci_config_access_functions pci_indirect_functions = {
indirect_pci_read_config_byte,
indirect_pci_read_config_word,
indirect_pci_read_config_dword,
indirect_pci_write_config_byte,
indirect_pci_write_config_word,
indirect_pci_write_config_dword
const pci_config_access_functions pci_direct_functions = {
direct_pci_read_config_byte,
direct_pci_read_config_word,
direct_pci_read_config_dword,
direct_pci_write_config_byte,
direct_pci_write_config_word,
direct_pci_write_config_dword
};
pci_config BSP_pci_configuration = {
(volatile unsigned char*) (GT64x60_PCI_CONFIG_ADDR),
(volatile unsigned char*) (GT64x60_PCI_CONFIG_DATA),
&pci_indirect_functions};
DiscoveryChipVersion BSP_getDiscoveryChipVersion()
{
return(BSP_sysControllerVersion);
}
BSP_VMEchipTypes BSP_getVMEchipType()
{
return(BSP_VMEinterface);
}
pci_config BSP_pci_configuration = {(volatile unsigned char*) PCI_CONFIG_ADDR,
(volatile unsigned char*)PCI_CONFIG_DATA,
&pci_direct_functions};
/*
* This routine determines the maximum bus number in the system.
@@ -234,12 +248,12 @@ BSP_VMEchipTypes BSP_getVMEchipType()
int pci_initialize()
{
int deviceFound;
unsigned char ucBusNumber, ucSlotNumber, ucFnNumber, ucNumFuncs, data8;
uint32_t ulHeader, ulClass, ulDeviceID;
#if PCI_DEBUG
uint32_t pcidata;
#endif
unsigned char ucBusNumber, ucSlotNumber, ucFnNumber, ucNumFuncs;
unsigned int ulHeader;
unsigned int pcidata, ulClass, ulDeviceID;
pci_interface();
/*
* Scan PCI0 and PCI1 buses
*/
@@ -265,36 +279,12 @@ int pci_initialize()
if (!deviceFound) deviceFound=1;
switch(ulDeviceID) {
case (PCI_VENDOR_ID_MARVELL+(PCI_DEVICE_ID_MARVELL_GT6426xAB<<16)):
pci_read_config_byte(0,0,0,PCI_REVISION_ID, &data8);
switch(data8) {
case 0x10:
BSP_sysControllerVersion = GT64260A;
#if PCI_PRINT
printk("Marvell GT64260A (Discovery I) hostbridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
case 0x20:
BSP_sysControllerVersion = GT64260B;
#if PCI_PRINT
printk("Marvell GT64260B (Discovery I) hostbridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
default:
printk("Undefined revsion of GT64260 chip\n");
break;
}
break;
case (PCI_VENDOR_ID_MARVELL+(PCI_DEVICE_ID_MARVELL_GT64360<<16)):
BSP_sysControllerVersion = MV64360;
#if PCI_PRINT
printk("Marvell GT64360 (Discovery II) hostbridge detected at bus%d slot%d\n",
printk("Marvell GT6426xA/B hostbridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
case (PCI_VENDOR_ID_PLX2+(PCI_DEVICE_ID_PLX2_PCI6154_HB2<<16)):
BSP_VMEinterface = UNIVERSE2;
#if PCI_PRINT
printk("PLX PCI6154 PCI-PCI bridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
@@ -304,13 +294,6 @@ int pci_initialize()
#if PCI_PRINT
printk("TUNDRA PCI-VME bridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
case (PCI_VENDOR_ID_TUNDRA+(PCI_DEVICE_ID_TUNDRA_TSI148<<16)):
BSP_VMEinterface = TSI148;
#if PCI_PRINT
printk("TUNDRA Tsi148 PCI/X-VME bridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
case (PCI_VENDOR_ID_INTEL+(PCI_DEVICE_INTEL_82544EI_COPPER<<16)):
@@ -320,21 +303,14 @@ int pci_initialize()
#endif
break;
case (PCI_VENDOR_ID_DEC+(PCI_DEVICE_ID_DEC_21150<<16)):
#if PCI_PRINT
#if PCI_PRINT
printk("DEC21150 PCI-PCI bridge detected at bus%d slot%d\n",
ucBusNumber,ucSlotNumber);
#endif
break;
default :
#if PCI_PRINT
printk("BSP unlisted vendor, Bus%d Slot%d DeviceID 0x%x \n",
ucBusNumber,ucSlotNumber, ulDeviceID);
#endif
/* Kate Feng : device not supported by BSP needs to remap the IRQ line on mvme5500/mvme6100 */
pci_read_config_byte(ucBusNumber,ucSlotNumber,0,PCI_INTERRUPT_LINE,&data8);
if (data8 < BSP_GPP_IRQ_LOWEST_OFFSET) pci_write_config_byte(ucBusNumber,
ucSlotNumber,0,PCI_INTERRUPT_LINE,BSP_GPP_IRQ_LOWEST_OFFSET+data8);
break;
}
@@ -427,6 +403,34 @@ int pci_initialize()
#endif
}
pci_read_config_dword(ucBusNumber,
ucSlotNumber,
0,
PCI_COMMAND,
&pcidata);
#if PCI_DEBUG
printk("MOTLoad command staus 0x%x, ", pcidata);
#endif
/* Clear the error on the host bridge */
if ( (ucBusNumber==0) && (ucSlotNumber==0))
pcidata |= PCI_STATUS_CLRERR_MASK;
/* Enable bus,I/O and memory master access. */
pcidata |= (PCI_COMMAND_MASTER|PCI_COMMAND_IO|PCI_COMMAND_MEMORY);
pci_write_config_dword(ucBusNumber,
ucSlotNumber,
0,
PCI_COMMAND,
pcidata);
pci_read_config_dword(ucBusNumber,
ucSlotNumber,
0,
PCI_COMMAND,
&pcidata);
#if PCI_DEBUG
printk("Now command/staus 0x%x\n", pcidata);
#endif
}
if (deviceFound) ucMaxPCIBus++;
} /* for (ucBusNumber=0; ucBusNumber<BSP_MAX_PCI_BUS; ... */
@@ -434,7 +438,6 @@ int pci_initialize()
printk("number of PCI buses: %d, numPCIDevs %d\n",
pci_bus_count(), numPCIDevs);
#endif
pci_interface(BSP_sysControllerVersion);
return(0);
}

View File

@@ -14,7 +14,8 @@
*
* pci.h,v 1.2 2002/05/14 17:10:16 joel Exp
*
* S. Kate Feng : Added support for Marvell and PLX. 2004, 2007.
* S. Kate Feng : Added support for Marvell and PLX. 3/5/2004.
*/
#ifndef RTEMS_PCI_H
@@ -22,31 +23,26 @@
#include <rtems/pci.h>
/************ Beginning of added by Kate Feng **********************/
#define PCI_CAPABILITY_LIST_POINTER 0x34
#define PCI_CAPABILITY_LIST_POINTER 0x34 /* <SKF> */
/* Device classes and subclasses */
#define PCI_CLASS_GT6426xAB_BRIDGE_PCI 0x0580
#define PCI_CLASS_GT6426xAB_BRIDGE_PCI 0x0580 /* <SKF> */
/*
* Vendor and card ID's: sort these numerically according to vendor
* (and according to card ID within vendor). Send all updates to
* <linux-pcisupport@cck.uni-kl.de>.
*/
#define PCI_VENDOR_ID_MARVELL 0x11ab
#define PCI_DEVICE_ID_MARVELL_GT6426xAB 0x6430
#define PCI_DEVICE_ID_MARVELL_GT64360 0x6460
#define PCI_VENDOR_ID_MARVELL 0x11ab /* <SKF> */
#define PCI_DEVICE_ID_MARVELL_GT6426xAB 0x6430 /* <SKF> */
/* Note : The PLX Technology Inc. had the old VENDOR_ID.
* See PCI_VENDOR_ID_PLX, PCI_VENDOR_ID_PLX_9050, ..etc.
*/
#define PCI_VENDOR_ID_PLX2 0x3388
#define PCI_DEVICE_ID_PLX2_PCI6154_HB2 0x26
#define PCI_VENDOR_ID_PLX2 0x3388 /* <SKF> */
#define PCI_DEVICE_ID_PLX2_PCI6154_HB2 0x26 /* <SKF> */
#define PCI_DEVICE_ID_TUNDRA_TSI148 0x0148
#define PCI_DEVICE_INTEL_82544EI_COPPER 0x1008
/* end of added by Kate Feng */
#define PCI_DEVICE_INTEL_82544EI_COPPER 0x1008 /* <SKF> */
struct _pin_routes
{

View File

@@ -7,14 +7,10 @@
* found in the file LICENSE in this distribution.
*
* 8/17/2006 : S. Kate Feng
* uses in_le32()/out_le32(), instead of inl()/outl() for compatibility.
* uses in_le32()/out_le32(), instead of inl()/outl() so that
* it is easier to be ported.
*
* 11/2008 : Enable "PCI Read Agressive Prefetch",
* "PCI Read Line Agressive Prefetch", and
* "PCI Read Multiple Agressive Prefetch" to improve the
* performance of the PCI based applications (e.g. 1GHz NIC).
*/
#include <libcpu/io.h>
#include <rtems/bspIo.h> /* printk */
@@ -23,29 +19,55 @@
#include <bsp/gtreg.h>
#include <bsp/gtpcireg.h>
#define REG32_READ(reg) in_le32((volatile unsigned int *)(GT64260_REG_BASE+reg))
#define REG32_WRITE(data, reg) out_le32((volatile unsigned int *)(GT64260_REG_BASE+reg), data)
#define PCI_DEBUG 0
#if 0
#define CPU2PCI_ORDER
#define PCI2CPU_ORDER
#endif
/* PCI Read Agressive Prefetch Enable (1<<16 ),
* PCI Read Line Agressive Prefetch Enable( 1<<17),
* PCI Read Multiple Agressive Prefetch Enable (1<<18).
/* Please reference the GT64260B datasheet, for the PCI interface,
* Synchronization Barriers and PCI ordering.
*
* Some PCI devices require Synchronization Barriers or PCI ordering
* for synchronization (only one mechanism allowed. See section 11.1.2).
* To use the former mechanism(default), one needs to call
* CPU0_PciEnhanceSync() or CPU1_PciEnhanceSync() to perform software
* synchronization between the CPU and PCI activities.
*
* To use the PCI-ordering, one can call pciToCpuSync() to trigger
* the PCI-to-CPU sync barrier after the out_xx(). In this mode,
* PCI configuration reads suffer sync barrier latency. Please reference
* the datasheet to explore other options.
*
* Note : If PCI_ORDERING is needed for the PCI0, while disabling the
* deadlock for the PCI0, one should keep the CommDLEn bit enabled
* for the deadlock mechanism so that the 10/100 MB ethernet will
* function correctly.
*
*/
#ifdef PCI2CPU_ORDER
#define PCI_ACCCTLBASEL_VALUE 0x01079000
#else
#define PCI_ACCCTLBASEL_VALUE 0x01071000
#endif
/*#define PCI_ORDERING*/
#define EN_SYN_BAR /* take MOTLoad default for enhanced SYN Barrier mode */
/*#define PCI_DEADLOCK*/
#ifdef PCI_ORDERING
#define PCI_ACCCTLBASEL_VALUE 0x01009000
#else
#define PCI_ACCCTLBASEL_VALUE 0x01001000
#endif
#define ConfSBDis 0x10000000 /* 1: disable, 0: enable */
#define IOSBDis 0x20000000 /* 1: disable, 0: enable */
#define ConfIOSBDis 0x30000000
#define CpuPipeline 0x00002000 /* optional, 1:enable, 0:disable */
#define CPU0_SYNC_TRIGGER 0xD0 /* CPU0 Sync Barrier trigger */
#define CPU0_SYNC_VIRTUAL 0xC0 /* CPU0 Sync Barrier Virtual */
#define CPU1_SYNC_TRIGGER 0xD8 /* CPU1 Sync Barrier trigger */
#define CPU1_SYNC_VIRTUAL 0xC8 /* CPU1 Sync Barrier Virtual */
/* CPU to PCI ordering register */
#define DLOCK_ORDER_REG 0x2D0 /* Deadlock and Ordering register */
#define PCI0OrEn 0x00000001
@@ -64,35 +86,74 @@
#define ADDR_PIPELINE 0x00020000
void pciAccessInit(void);
void pciAccessInit();
void pci_interface(void)
void pci_interface()
{
#ifdef CPU2PCI_ORDER
/* MOTLOad deafult : 0x07ff8600 */
out_le32((volatile unsigned int *)(GT64x60_REG_BASE+CNT_SYNC_REG), 0x07fff600);
#ifdef PCI_DEADLOCK
REG32_WRITE(0x07fff600, CNT_SYNC_REG);
#endif
#ifdef PCI_ORDERING
/* Let's leave this to be MOTLOad deafult : 0x80070000
REG32_WRITE(0xc0070000, DLOCK_ORDER_REG);*/
/* Leave the CNT_SYNC_REG b/c MOTload default had the SyncBarMode set to 1 */
#endif
/* asserts SERR upon various detection */
out_le32((volatile unsigned int *)(GT64x60_REG_BASE+0xc28), 0x3fffff);
pciAccessInit();
}
void pciAccessInit(void)
/* asserts SERR upon various detection */
REG32_WRITE(0x3fffff, 0xc28);
pciAccessInit();
}
/* Use MOTLoad default for Writeback Priority and Buffer Depth
*/
void pciAccessInit()
{
unsigned int PciLocal, data;
for (PciLocal=0; PciLocal < 2; PciLocal++) {
data = in_le32((volatile unsigned int *)(GT64x60_REG_BASE+PCI0_ACCESS_CNTL_BASE0_LOW+(PciLocal * 0x80)));
#if 0
printk("PCI%d_ACCESS_CNTL_BASE0_LOW was 0x%x\n",PciLocal,data);
#endif
/* MOTLoad combines the two banks of SDRAM into
* one PCI access control because the top = 0x1ff
*/
data = REG32_READ(GT_SCS0_Low_Decode) & 0xfff;
data |= PCI_ACCCTLBASEL_VALUE;
data &= ~0x300000;
out_le32((volatile unsigned int *)(GT64x60_REG_BASE+PCI0_ACCESS_CNTL_BASE0_LOW+(PciLocal * 0x80)), data);
#if 0
printf("PCI%d_ACCESS_CNTL_BASE0_LOW now 0x%x\n",PciLocal,in_le32((volatile unsigned int *)(GT64x60_REG_BASE+PCI0_ACCESS_CNTL_BASE0_LOW+(PciLocal * 0x80))));
REG32_WRITE(data, PCI0_ACCESS_CNTL_BASE0_LOW+(PciLocal * 0x80));
#if PCI_DEBUG
printk("PCI%d_ACCESS_CNTL_BASE0_LOW 0x%x\n",PciLocal,REG32_READ(PCI_ACCESS_CNTL_BASE0_LOW+(PciLocal * 0x80)));
#endif
}
}
/* Sync Barrier Trigger. A write to the CPU_SYNC_TRIGGER register triggers
* the sync barrier process. The three bits, define which buffers should
* be flushed.
* Bit 0 = PCI0 slave write buffer.
* Bit 1 = PCI1 slave write buffer.
* Bit 2 = SDRAM snoop queue.
*/
void CPU0_PciEnhanceSync(unsigned int syncVal)
{
REG32_WRITE(syncVal,CPU0_SYNC_TRIGGER);
while (REG32_READ(CPU0_SYNC_VIRTUAL));
}
void CPU1_PciEnhanceSync(unsigned int syncVal)
{
REG32_WRITE(syncVal,CPU1_SYNC_TRIGGER);
while (REG32_READ(CPU1_SYNC_VIRTUAL));
}
/* Currently, if PCI_ordering is used for synchronization, configuration
* reads is programmed to be the PCI slave "synchronization barrier"
* cycles.
*/
void pciToCpuSync(int pci_num)
{
unsigned char data;
unsigned char bus=0;
if (pci_num) bus += BSP_MAX_PCI_BUS_ON_PCI0;
pci_read_config_byte(bus,0,0,4, &data);
}

View File

@@ -7,7 +7,7 @@
*
*
* Kate Feng <feng1@bnl.gov>, modified it to support the mvme5500 board.
* Under the Deaprtment of Energy contract DE-AC02-98CH10886.
*
*/
#define PCI_INVALID_VENDORDEVICEID 0xffffffff

View File

@@ -1,6 +1,3 @@
/* Copyright 2003, Shuchen Kate Feng <feng1@bnl.gov>,
* NSLS,Brookhaven National Laboratory
*/
#include <bsp.h>
#include <rtems/bspIo.h>
#include <libcpu/stackTrace.h>

View File

@@ -17,9 +17,10 @@
* Modified to support the Synergy VGM & Motorola PowerPC boards
* (C) by Till Straumann, <strauman@slac.stanford.edu>, 2002, 2004, 2005
*
* Modified to support the mvme5500 BSP
* (C) S. Kate Feng,Brookhaven National Lab <feng1@bnl.gov>, 2003, 2004, 2005, 2008
*
* Modified to support the MVME5500 board.
* Also, the settings of L1, L2, and L3 caches is not necessary here.
* (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003, 2004, 2005
*
* $Id$
*/
@@ -41,7 +42,6 @@
#include <libcpu/cpuIdent.h>
#include <bsp/vectors.h>
#include <bsp/bspException.h>
#include <bsp/VPD.h>
#include <rtems/bspIo.h>
#include <rtems/sptables.h>
@@ -50,7 +50,8 @@
#undef __RTEMS_APPLICATION__
#endif
/*efine SHOW_MORE_INIT_SETTINGS
/*
#define SHOW_MORE_INIT_SETTINGS
#define SHOW_LCR1_REGISTER
#define SHOW_LCR2_REGISTER
#define SHOW_LCR3_REGISTER
@@ -73,7 +74,6 @@ extern void BSP_vme_config(void);
SPR_RW(SPRG0)
SPR_RW(SPRG1)
extern uint32_t probeMemoryEnd();
typedef struct CmdLineRec_ {
unsigned long size;
@@ -96,10 +96,6 @@ typedef struct CmdLineRec_ {
#define MAX_LOADER_ADD_PARM 80
char loaderParam[MAX_LOADER_ADD_PARM];
BSP_BoardTypes BSP_boardType=0;
DiscoveryChipVersion BSP_controller_version;
/*
* Total memory using RESIDUAL DATA
*/
@@ -226,11 +222,6 @@ int i=cmdline_end-cmdline_start;
cmdline_buf[i]=0;
}
BSP_BoardTypes BSP_getBoardType()
{
return BSP_boardType;
}
/*
* bsp_start
*
@@ -242,7 +233,6 @@ void bsp_start( void )
#ifdef CONF_VPD
int i;
#endif
int x;
unsigned char *stack;
unsigned long *r1sp;
#ifdef SHOW_LCR1_REGISTER
@@ -260,8 +250,6 @@ void bsp_start( void )
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
Triv121PgTbl pt=0;
ConfVpdRec_t *pVPD = (ConfVpdRec_t *) &ConfVPD_buff[0];
/* Till Straumann: 4/2005
* Need to map the system registers early, so we can printk...
@@ -272,11 +260,12 @@ void bsp_start( void )
*/
setdbat(2, PCI0_MEM_BASE, PCI0_MEM_BASE, 0x10000000, IO_PAGE);
/* map the PCI 0, 1 Domain I/O space, GT64260B registers,
* Flash Bank 0 and Flash Bank 2.
/* Till Straumann: 2004
* map the PCI 0, 1 Domain I/O space, GT64260B registers
* and the reserved area so that the size is the power of 2.
*
*/
setdbat(3,PCI0_IO_BASE, PCI0_IO_BASE, 0x10000000, IO_PAGE);
setdbat(3,PCI0_IO_BASE, PCI0_IO_BASE, 0x2000000, IO_PAGE);
/*
@@ -333,33 +322,39 @@ void bsp_start( void )
*/
Cpu_table.exceptions_in_RAM = TRUE;
initialize_exceptions();
/* <SKF> pci_initialize() before BSP_rtems_irq_mng_init to identify the version of the
* Discovery chip.
*/
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Going to start PCI buses scanning and initialization\n");
#endif
pci_initialize();
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Number of PCI buses found is : %d\n", pci_bus_count());
#endif
/*
* Initalize RTEMS IRQ system
*/
BSP_rtems_irq_mng_init(0);
/*
* Init MMU block address translation to enable hardware
* access
* More PCI1 memory mapping to be done after BSP_pgtbl_activate.
*/
printk("-----------------------------------------\n");
printk("Welcome to %s on MVME5500\n", _RTEMS_version );
printk("Welcome to %s on MVME5500-0163\n", _RTEMS_version );
printk("-----------------------------------------\n");
BSP_mem_size = probeMemoryEnd();
#ifdef TEST_RETURN_TO_PPCBUG
printk("Hit <Enter> to return to PPCBUG monitor\n");
printk("When Finished hit GO. It should print <Back from monitor>\n");
debug_getc();
_return_to_ppcbug();
printk("Back from monitor\n");
_return_to_ppcbug();
#endif /* TEST_RETURN_TO_PPCBUG */
#ifdef TEST_RAW_EXCEPTION_CODE
printk("Testing exception handling Part 1\n");
/*
* Cause a software exception
*/
__asm__ __volatile ("sc");
/*
* Check we can still catch exceptions and returned coorectly.
*/
printk("Testing exception handling Part 2\n");
__asm__ __volatile ("sc");
#endif
BSP_mem_size = _512M;
/* TODO: calculate the BSP_bus_frequency using the REF_CLK bit of System Status register */
/* rtems_bsp_delay_in_bus_cycles are defined in registers.h */
BSP_bus_frequency = 133333333;
BSP_processor_frequency = 1000000000;
@@ -406,6 +401,11 @@ void bsp_start( void )
BSP_Configuration.work_space_start = work_space_start;
/*
* Initalize RTEMS IRQ system
*/
BSP_rtems_irq_mng_init(0);
#ifdef SHOW_LCR2_REGISTER
l2cr = get_L2CR();
printk("Initial L2CR value = %x\n", l2cr);
@@ -429,7 +429,30 @@ void bsp_start( void )
BSP_pgtbl_activate(pt);
}
if ( I2Cread_eeprom(0xa8, 0,2, (void *) pVPD, sizeof(ConfVpdRec_t)))
/*
* PCI 1 domain memory space
*/
setdbat(1, PCI1_MEM_BASE, PCI1_MEM_BASE, 0x10000000, IO_PAGE);
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Going to start PCI buses scanning and initialization\n");
#endif
pci_initialize();
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Number of PCI buses found is : %d\n", pci_bus_count());
#endif
/* Install our own exception handler (needs PCI) */
globalExceptHdl = BSP_exceptionHandler;
/* clear hostbridge errors. MCP signal is not used on the MVME5500
* PCI config space scanning code will trip otherwise :-(
*/
_BSP_clear_hostbridge_errors(0, 1 /*quiet*/);
/* Read Configuration Vital Product Data (VPD) */
if ( I2Cread_eeprom(0xa8, 4,2, &ConfVPD_buff[0], 150))
printk("I2Cread_eeprom() error \n");
else {
#ifdef CONF_VPD
@@ -438,27 +461,13 @@ void bsp_start( void )
printk("%2x ", ConfVPD_buff[i]);
if ((i % 20)==0 ) printk("\n");
}
printk("\n");
#endif
}
/*
* PCI 1 domain memory space
*/
setdbat(1, PCI1_MEM_BASE, PCI1_MEM_BASE, 0x10000000, IO_PAGE);
/* Install our own exception handler (needs PCI) */
globalExceptHdl = BSP_exceptionHandler;
#if 1
/* clear hostbridge errors. MCP signal is not used on the MVME5500
* PCI config space scanning code will trip otherwise :-(
*/
_BSP_clear_hostbridge_errors(0, 1 /*quiet*/);
#endif
#ifdef SHOW_MORE_INIT_SETTINGS
printk("MSR %x \n", _read_MSR());
printk("Exit from bspstart\n");
#endif
}

View File

@@ -11,7 +11,6 @@
/* Author: Till Straumann, <strauman@slac.stanford.edu>, 4/2002
* Kate Feng <feng1@bnl.gov> ported it to MVME5500, 4/2004
*
*/
void

View File

@@ -1,9 +1,3 @@
/* Copyright 2003, Shuchen Kate Feng <feng1@bnl.gov>,
* NSLS,Brookhaven National Laboratory
*
* Ported it from powerpc/shared/console/reboot.c for mvme5500
*
*/
#include <rtems.h>
#include <bsp.h>
#include <rtems/bspIo.h>
@@ -18,5 +12,5 @@ void rtemsReboot()
printk("RTEMS terminated; Rebooting ...\n");
/* Mvme5500 board reset : 2004 S. Kate Feng <feng1@bnl.gov> */
out_8((volatile unsigned char*) (GT64x60_DEV1_BASE +2), 0x80);
out_8((volatile unsigned char*) (GT64260_DEV1_BASE +2), 0x80);
}

View File

@@ -1,132 +0,0 @@
/* vmeconfig.c,v 1.1.2.2 2003/03/25 16:46:01 joel Exp */
/* Standard VME bridge configuration for PPC boards */
/* Copyright Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 */
/* Copyright 2004, Brookhaven National Lab. and S. Kate Feng <feng1@bnl.gov>
* Modified to support the MVME5500, 3/2004
*/
#include <bsp.h>
#include <bsp/VME.h>
#include <bsp/VMEConfig.h>
#include <bsp/vmeUniverse.h>
#include <bsp/irq.h>
#include <libcpu/bat.h>
/* Use a weak alias for the VME configuration.
* This permits individual applications to override
* this routine.
* They may even create an 'empty'
*
* void BSP_vme_config(void) {}
*
* which will avoid linking in the Universe driver
* at all :-).
*/
void BSP_vme_config(void) __attribute__ (( weak, alias("__BSP_default_vme_config") ));
/* translate through host bridge and vme master window of vme bridge */
int
BSP_vme2local_adrs(unsigned long am, unsigned long vmeaddr, unsigned long *plocaladdr)
{
int rval=vmeUniverseXlateAddr(1,0,am,vmeaddr,plocaladdr);
*plocaladdr+=PCI_MEM_BASE;
return rval;
}
/* how a CPU address is mapped to the VME bus (if at all) */
int
BSP_local2vme_adrs(unsigned long am, unsigned long localaddr, unsigned long *pvmeaddr)
{
return vmeUniverseXlateAddr(0, 0, am,localaddr+PCI_DRAM_OFFSET,pvmeaddr);
}
int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg)
{
return(vmeUniverseInstallISR(vector, handler, arg));
}
int
BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *arg)
{
return(vmeUniverseRemoveISR(vector, handler, arg));
}
/* retrieve the currently installed ISR for a given vector */
BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg)
{
return(vmeUniverseISRGet(vector, parg));
}
int BSP_enableVME_int_lvl(unsigned int level)
{
return(vmeUniverseIntEnable(level));
}
int BSP_disableVME_int_lvl(unsigned int level)
{
return(vmeUniverseIntDisable(level));
}
void
__BSP_default_vme_config(void)
{
vmeUniverseInit();
vmeUniverseReset();
/* setup a PCI0 area to map the VME bus */
setdbat(0,_VME_A32_WIN0_ON_PCI, _VME_A32_WIN0_ON_PCI, 0x10000000, IO_PAGE);
/* map VME address ranges */
vmeUniverseMasterPortCfg(
0,
VME_AM_EXT_SUP_DATA,
_VME_A32_WIN0_ON_VME,
_VME_A32_WIN0_ON_PCI,
0x0F000000);
vmeUniverseMasterPortCfg(
1,
VME_AM_STD_SUP_DATA,
0x00000000,
_VME_A24_ON_PCI,
0x00ff0000);
vmeUniverseMasterPortCfg(
2,
VME_AM_SUP_SHORT_IO,
0x00000000,
_VME_A16_ON_PCI,
0x00010000);
#ifdef _VME_DRAM_OFFSET
/* map our memory to VME */
vmeUniverseSlavePortCfg(
0,
VME_AM_EXT_SUP_DATA| VME_AM_IS_MEMORY,
_VME_DRAM_OFFSET,
PCI_DRAM_OFFSET,
BSP_mem_size);
/* make sure the host bridge PCI master is enabled */
vmeUniverseWriteReg(
vmeUniverseReadReg(UNIV_REGOFF_PCI_CSR) | UNIV_PCI_CSR_BM,
UNIV_REGOFF_PCI_CSR);
#endif
/* stdio is not yet initialized; the driver will revert to printk */
vmeUniverseMasterPortsShow(0);
vmeUniverseSlavePortsShow(0);
/* install the VME insterrupt manager */
vmeUniverseInstallIrqMgrAlt(1,
0, BSP_GPP_IRQ_LOWEST_OFFSET + 12,
1, BSP_GPP_IRQ_LOWEST_OFFSET + 13,
2, BSP_GPP_IRQ_LOWEST_OFFSET + 14,
3, BSP_GPP_IRQ_LOWEST_OFFSET + 15,
-1);
}

View File

@@ -153,15 +153,6 @@ static int console_first_open(int major, int minor, void *arg)
ttyS[minor].name);
rtems_fatal_error_occurred(status);
}
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(minor,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(minor, BSP_UART_INTR_CTRL_TERMIOS);
return 0;
}
@@ -213,6 +204,14 @@ console_open(rtems_device_major_number major,
return status;
}
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(minor,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(minor, BSP_UART_INTR_CTRL_TERMIOS);
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,8 +1,3 @@
2009-03-09 Antoine Lacroix <antoine.lacroix at sodern.fr>
PR 1391/bsps
* startup/spurious.c: Format was %d but had leading 0x.
2008-08-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: All SPARC executables should include

View File

@@ -33,7 +33,7 @@ rtems_isr bsp_spurious_handler(
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
switch (real_trap) {

View File

@@ -1,8 +1,3 @@
2009-03-09 Antoine Lacroix <antoine.lacroix at sodern.fr>
PR 1391/bsps
* startup/spurious.c: Format was %d but had leading 0x.
2008-08-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: All SPARC executables should include

View File

@@ -33,7 +33,7 @@ rtems_isr bsp_spurious_handler(
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
switch (real_trap) {

View File

@@ -1,8 +1,3 @@
2009-03-09 Antoine Lacroix <antoine.lacroix at sodern.fr>
PR 1391/bsps
* startup/spurious.c: Format was %d but had leading 0x.
2008-08-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: All SPARC executables should include

View File

@@ -38,7 +38,7 @@ rtems_isr bsp_spurious_handler(
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
printk( "Unexpected trap (%2d) at address 0x%08x\n", real_trap, isf->tpc);
printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
switch (real_trap) {

View File

@@ -6,8 +6,11 @@ EXTRA_DIST =
SUBDIRS = @HOST_SUBDIRS@ @TARGET_SUBDIRS@
DIST_SUBDIRS =
DIST_SUBDIRS = cygwin
DIST_SUBDIRS += mingw32
DIST_SUBDIRS += solaris2.7
DIST_SUBDIRS += rtems4.8
DIST_SUBDIRS += autotools
EXTRA_DIST += specstrip

View File

@@ -5,9 +5,9 @@
include $(top_srcdir)/mkspec.am
AUTOCONF_VERS = 2.61
AUTOCONF_RPMREL = 7
AUTOCONF_RPMREL = 5
include ./autoconf.am
AUTOMAKE_VERS = 1.10
AUTOMAKE_RPMREL = 7
AUTOMAKE_RPMREL = 5
include ./automake.am

View File

@@ -1,2 +0,0 @@
Source0: ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{srcvers}.tar.bz2

View File

@@ -1,5 +1,5 @@
%define srcvers @AUTOCONF_VERS@
%define rpmvers %{expand:%(echo "@AUTOCONF_VERS@" | tr - _ )}
%define rpmvers 2.61
%define srcvers 2.61
%if "%{_prefix}" != "/usr"
%define name @rpmprefix@autoconf
@@ -13,7 +13,7 @@ License: GPL
URL: http://www.gnu.org/software/autoconf
Group: Development/Tools
Version: %{rpmvers}
Release: @AUTOCONF_RPMREL@
Release: @AUTOCONF_RPMREL@%{?dist}
Summary: Tool for automatically generating GNU style Makefile.in's
%if "%{_prefix}" != "/usr"
@@ -24,14 +24,11 @@ Provides: @rpmprefix@autoconf-rtems = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl m4 gawk emacs
%if "%{version}" >= "2.62"
BuildRequires: m4 >= 1.4.5
%endif
Requires: m4 gawk
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
@SOURCES@
Source0: ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{srcvers}.tar.bz2
%description
GNU's Autoconf is a tool for configuring source code and Makefiles.
@@ -48,7 +45,6 @@ their use.
%prep
%setup -q -n autoconf-%{srcvers}
%{?PATCH0:%patch0 -p1}
# Work around rpm inserting bogus perl-module deps
cat << \EOF > %{name}-prov

View File

@@ -4,12 +4,9 @@ AUTOCONF_SUBPACKAGES += $(top_srcdir)/binutils/rpm-install.add
AUTOCONF_SUBPACKAGES += $(top_srcdir)/common/clean.add
AUTOCONF_SUBPACKAGES += $(top_srcdir)/autotools/target-autoconf.add
autoconf.spec.in: $(AUTOCONF_SUBPACKAGES) Makefile.in $(srcdir)/autoconf-sources.add
autoconf.spec.in: $(AUTOCONF_SUBPACKAGES) Makefile.in
cat $(AUTOCONF_SUBPACKAGES) | sed \
-e "/[@]SOURCES[@]/r $(srcdir)/autoconf-sources.add" \
-e "/[@]SOURCES[@]/d" \
-e "s/[@]AUTOCONF_VERS[@]/$(AUTOCONF_VERS)/" \
-e "s/[@]AUTOCONF_RPMREL[@]/$(AUTOCONF_RPMREL)%{?dist}/" > $@
-e "s/[@]AUTOCONF_RPMREL[@]/$(AUTOCONF_RPMREL)/" > $@
CLEANFILES += autoconf.spec.in

View File

@@ -1,2 +0,0 @@
Source0: ftp://ftp.gnu.org/gnu/automake/automake-%{srcvers}.tar.bz2

View File

@@ -1,5 +1,5 @@
%define rpmvers @AUTOMAKE_VERS@
%define srcvers @AUTOMAKE_VERS@
%define rpmvers 1.10
%define srcvers 1.10
%define amvers 1.10
%if "%{_prefix}" != "/usr"
@@ -15,7 +15,7 @@ URL: http://sources.redhat.com/automake
License: GPL
Group: Development/Tools
Version: %{rpmvers}
Release: @AUTOMAKE_RPMREL@
Release: @AUTOMAKE_RPMREL@%{?dist}
Summary: Tool for automatically generating GNU style Makefile.in's
%if "%{_prefix}" != "/usr"
@@ -25,16 +25,12 @@ Provides: @rpmprefix@automake-rtems = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: %{requirements} perl
%if "%{version}" < "1.11"
# automake >= 1.11 ships man-pages
BuildRequires: help2man
%endif
BuildRequires: %{requirements} perl help2man
Requires: %{requirements}
Requires(post): /sbin/install-info
Requires(preun):/sbin/install-info
@SOURCES@
Source0: ftp://ftp.gnu.org/gnu/automake/automake-%{srcvers}.tar.bz2
%description
Automake is a tool for automatically generating "Makefile.in"s from
@@ -45,7 +41,6 @@ standards.
%prep
%setup -q -n automake-%{srcvers}
%{?PATCH0:%patch0 -p1}
# Work around rpm inserting bogus perl-module deps
cat << \EOF > %{name}-prov
@@ -78,8 +73,6 @@ make
rm -rf "$RPM_BUILD_ROOT"
make DESTDIR=${RPM_BUILD_ROOT} install
%if "%{version}" < "1.11"
# automake >= 1.11 ships man-pages
install -m 755 -d $RPM_BUILD_ROOT/%{_mandir}/man1
for i in $RPM_BUILD_ROOT%{_bindir}/aclocal \
$RPM_BUILD_ROOT%{_bindir}/automake ;
@@ -88,7 +81,6 @@ do
help2man $i > `basename $i`.1
install -m 644 `basename $i`.1 $RPM_BUILD_ROOT/%{_mandir}/man1
done
%endif
%if "%{_prefix}" != "/usr"
mkdir -p $RPM_BUILD_ROOT%{_datadir}/aclocal

View File

@@ -4,12 +4,9 @@ AUTOMAKE_SUBPACKAGES += $(top_srcdir)/binutils/rpm-install.add
AUTOMAKE_SUBPACKAGES += $(top_srcdir)/common/clean.add
AUTOMAKE_SUBPACKAGES += $(top_srcdir)/autotools/target-automake.add
automake.spec.in: $(AUTOMAKE_SUBPACKAGES) Makefile.am $(srcdir)/automake-sources.add
automake.spec.in: $(AUTOMAKE_SUBPACKAGES) Makefile.in
cat $(AUTOMAKE_SUBPACKAGES) | sed \
-e "/[@]SOURCES[@]/r $(srcdir)/automake-sources.add" \
-e "/[@]SOURCES[@]/d" \
-e "s/[@]AUTOMAKE_VERS[@]/$(AUTOMAKE_VERS)/g" \
-e "s/[@]AUTOMAKE_RPMREL[@]/$(AUTOMAKE_RPMREL)%{?dist}/g" > $@
-e "s/[@]AUTOMAKE_RPMREL[@]/$(AUTOMAKE_RPMREL)/" > $@
CLEANFILES += automake.spec.in

View File

@@ -1,184 +0,0 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%define _prefix /opt/rtems-4.8
%define _exec_prefix %{_prefix}
%define _bindir %{_exec_prefix}/bin
%define _sbindir %{_exec_prefix}/sbin
%define _libexecdir %{_exec_prefix}/libexec
%define _datarootdir %{_prefix}/share
%define _datadir %{_datarootdir}
%define _sysconfdir %{_prefix}/etc
%define _sharedstatedir %{_prefix}/com
%define _localstatedir %{_prefix}/var
%define _includedir %{_prefix}/include
%define _libdir %{_exec_prefix}/%{_lib}
%define _mandir %{_datarootdir}/man
%define _infodir %{_datarootdir}/info
%define _localedir %{_datarootdir}/locale
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define srcvers 2.61
%define rpmvers %{expand:%(echo "2.61" | tr - _ )}
%define name rtems-4.8-autoconf
Name: %{name}
License: GPL
URL: http://www.gnu.org/software/autoconf
Group: Development/Tools
Version: %{rpmvers}
Release: 7%{?dist}
Summary: Tool for automatically generating GNU style Makefile.in's
Obsoletes: rtems-4.8-autoconf-rtems < %{version}-%{release}
Provides: rtems-4.8-autoconf-rtems = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl m4 gawk emacs
%if "%{version}" >= "2.62"
BuildRequires: m4 >= 1.4.5
%endif
Requires: m4 gawk
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Source0: ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{srcvers}.tar.bz2
%description
GNU's Autoconf is a tool for configuring source code and Makefiles.
Using Autoconf, programmers can create portable and configurable
packages, since the person building the package is allowed to
specify various configuration options.
You should install Autoconf if you are developing software and you'd
like to use it to create shell scripts which will configure your
source code packages.
Note that the Autoconf package is not required for the end user who
may be configuring software with an Autoconf-generated script;
Autoconf is only required for the generation of the scripts, not
their use.
%prep
%setup -q -n autoconf-%{srcvers}
%{?PATCH0:%patch0 -p1}
# Work around rpm inserting bogus perl-module deps
cat << \EOF > %{name}-prov
#!/bin/sh
%{__perl_provides} $* |\
sed -e '/^perl(Autom4te/d'
EOF
%define __perl_provides %{_builddir}/autoconf-%{srcvers}/%{name}-prov
chmod +x %{__perl_provides}
cat << \EOF > %{name}-requ
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/^perl(Autom4te/d'
EOF
%define __perl_requires %{_builddir}/autoconf-%{srcvers}/%{name}-requ
chmod +x %{__perl_requires}
%build
./configure --prefix=%{_prefix} --infodir=%{_infodir} --mandir=%{_mandir} \
--bindir=%{_bindir} --datadir=%{_datadir}
make
%install
rm -rf "${RPM_BUILD_ROOT}"
make DESTDIR=${RPM_BUILD_ROOT} install
# Create this directory to prevent the corresponding line
# in %%files below to fail
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp
# RTEMS's standards.info comes from binutils
rm -f $RPM_BUILD_ROOT%{_infodir}/standards.info*
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
touch $RPM_BUILD_ROOT%{_infodir}/dir
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
# Fix up brp-compress to handle %%_prefix != /usr
*/brp-compress*)
b=$(basename $a)
sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
-e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz ||:
%preun
if [ $1 -eq 0 ]; then
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/autoconf.info.gz ||:
fi
%files
%defattr(-,root,root)
# %doc AUTHORS COPYING ChangeLog NEWS README THANKS
%dir %{_bindir}
%{_bindir}/*
%dir %{_infodir}
%ghost %{_infodir}/dir
%{_infodir}/autoconf.info*
%dir %{_mandir}
%dir %{_mandir}/man1
%{_mandir}/man1/*
%dir %{_datadir}
%{_datadir}/autoconf
%exclude %{_datadir}/emacs/site-lisp

View File

@@ -1,195 +0,0 @@
#
# Please send bugfixes or comments to
# http://www.rtems.org/bugzilla
#
%define _prefix /opt/rtems-4.8
%define _exec_prefix %{_prefix}
%define _bindir %{_exec_prefix}/bin
%define _sbindir %{_exec_prefix}/sbin
%define _libexecdir %{_exec_prefix}/libexec
%define _datarootdir %{_prefix}/share
%define _datadir %{_datarootdir}
%define _sysconfdir %{_prefix}/etc
%define _sharedstatedir %{_prefix}/com
%define _localstatedir %{_prefix}/var
%define _includedir %{_prefix}/include
%define _libdir %{_exec_prefix}/%{_lib}
%define _mandir %{_datarootdir}/man
%define _infodir %{_datarootdir}/info
%define _localedir %{_datarootdir}/locale
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%else
%define _host_rpmprefix %{nil}
%endif
%define rpmvers 1.10
%define srcvers 1.10
%define amvers 1.10
%define name rtems-4.8-automake
%define requirements rtems-4.8-autoconf >= 2.60
Name: %{name}
URL: http://sources.redhat.com/automake
License: GPL
Group: Development/Tools
Version: %{rpmvers}
Release: 7%{?dist}
Summary: Tool for automatically generating GNU style Makefile.in's
Obsoletes: rtems-4.8-automake-rtems < %{version}-%{release}
Provides: rtems-4.8-automake-rtems = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: %{requirements} perl
%if "%{version}" < "1.11"
# automake >= 1.11 ships man-pages
BuildRequires: help2man
%endif
Requires: %{requirements}
Requires(post): /sbin/install-info
Requires(preun):/sbin/install-info
Source0: ftp://ftp.gnu.org/gnu/automake/automake-%{srcvers}.tar.bz2
%description
Automake is a tool for automatically generating "Makefile.in"s from
files called "Makefile.am". "Makefile.am" is basically a series of
"make" macro definitions (with rules being thrown in occasionally).
The generated "Makefile.in"s are compatible to the GNU Makefile
standards.
%prep
%setup -q -n automake-%{srcvers}
%{?PATCH0:%patch0 -p1}
# Work around rpm inserting bogus perl-module deps
cat << \EOF > %{name}-prov
#!/bin/sh
%{__perl_provides} $* |\
sed -e '/^perl(Automake/d'
EOF
%define __perl_provides %{_builddir}/automake-%{srcvers}/%{name}-prov
chmod +x %{__perl_provides}
cat << \EOF > %{name}-requ
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/^perl(Automake/d'
EOF
%define __perl_requires %{_builddir}/automake-%{srcvers}/%{name}-requ
chmod +x %{__perl_requires}
%build
PATH=%{_bindir}:$PATH
# Don't use %%configure, it replaces config.sub/config.guess with the
# outdated versions bundled with rpm.
./configure --prefix=%{_prefix} --infodir=%{_infodir} --mandir=%{_mandir} \
--bindir=%{_bindir} --datadir=%{_datadir} \
--docdir=%{_datadir}/automake-%{amvers}/doc
make
%install
rm -rf "$RPM_BUILD_ROOT"
make DESTDIR=${RPM_BUILD_ROOT} install
%if "%{version}" < "1.11"
# automake >= 1.11 ships man-pages
install -m 755 -d $RPM_BUILD_ROOT/%{_mandir}/man1
for i in $RPM_BUILD_ROOT%{_bindir}/aclocal \
$RPM_BUILD_ROOT%{_bindir}/automake ;
do
perllibdir=$RPM_BUILD_ROOT/%{_datadir}/automake-%{amvers} \
help2man $i > `basename $i`.1
install -m 644 `basename $i`.1 $RPM_BUILD_ROOT/%{_mandir}/man1
done
%endif
mkdir -p $RPM_BUILD_ROOT%{_datadir}/aclocal
echo "/usr/share/aclocal" > $RPM_BUILD_ROOT%{_datadir}/aclocal/dirlist
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
touch $RPM_BUILD_ROOT%{_infodir}/dir
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
# Fix up brp-compress to handle %%_prefix != /usr
*/brp-compress*)
b=$(basename $a)
sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
-e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/automake.info.gz ||:
%preun
if [ $1 -eq 0 ]; then
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/automake.info.gz ||:
fi
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README THANKS
%dir %{_bindir}
%{_bindir}/aclocal*
%{_bindir}/automake*
%dir %{_infodir}
%ghost %{_infodir}/dir
%{_infodir}/automake.info*.gz
%dir %{_mandir}
%dir %{_mandir}/man1
%{_mandir}/man1/*
%dir %{_datadir}
%{_datadir}/aclocal
%{_datadir}/aclocal-%{amvers}
%{_datadir}/automake-%{amvers}

View File

@@ -38,7 +38,6 @@ fi
%files -n @rpmprefix@binutils-common
%defattr(-,root,root)
%sysdir %{_prefix}
%sysdir %{_infodir}
%ghost %{_infodir}/dir
%{_infodir}/as.info*

View File

@@ -11,7 +11,9 @@ License: GPL/LGPL
URL: http://sources.redhat.com/binutils
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{_host_rpmprefix}gcc
%if "%{_build}" != "%{_host}"
BuildRequires: @rpmprefix@%{_host}-gcc
%endif
%if "%{binutils_version}" >= "2.18"
# Bug in bfd: Doesn't build without texinfo installed

View File

@@ -45,9 +45,6 @@
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/@tool_target@-windres%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/@tool_target@-windres*
fi
if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/@tool_target@-windmc%{_exeext}; then
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/@tool_target@-windmc*
fi
cd ..

View File

@@ -13,7 +13,6 @@ GNU binutils targetting @tool_target@.
%files -n @rpmprefix@@tool_target@-binutils
%defattr(-,root,root)
%sysdir %{_prefix}
%sysdir %{_mandir}
%sysdir %{_mandir}/man1
%{_mandir}/man1/@tool_target@-*.1*

View File

@@ -4,45 +4,25 @@
#
%if "%{_prefix}" != "/usr"
%define _prefix @_prefix@
%define _exec_prefix %{_prefix}
%define _bindir %{_exec_prefix}/bin
%define _sbindir %{_exec_prefix}/sbin
%define _libexecdir %{_exec_prefix}/libexec
%define _datarootdir %{_prefix}/share
%define _datadir %{_datarootdir}
%define _sysconfdir %{_prefix}/etc
%define _sharedstatedir %{_prefix}/com
%define _localstatedir %{_prefix}/var
%define _includedir %{_prefix}/include
%define _libdir %{_exec_prefix}/%{_lib}
%define _mandir %{_datarootdir}/man
%define _infodir %{_datarootdir}/info
%define _localedir %{_datarootdir}/locale
%define _prefix @_prefix@
%define _infodir %{_prefix}/info
%define _mandir %{_prefix}/man
%endif
%ifos cygwin cygwin32 mingw mingw32
%define _exeext .exe
%define debug_package %{nil}
%define _libdir %{_exec_prefix}/lib
%else
%define _exeext %{nil}
%endif
%ifos cygwin cygwin32
%define optflags -O3 -pipe -march=i486 -funroll-loops
%endif
%ifos mingw mingw32
%if %{defined _mingw32_cflags}
%define optflags %{_mingw32_cflags}
%else
%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
%endif
%define _libdir %{_exec_prefix}/lib
%define debug_package %{nil}
%endif
%if "%{_build}" != "%{_host}"
%define _host_rpmprefix %{_host}-
%define _host_rpmprefix @rpmprefix@%{_host}-
%else
%define _host_rpmprefix %{nil}
%endif

View File

@@ -111,6 +111,8 @@ AC_SUBST(SPECSTRIP_OPTS)
AS_IF([test "${host}" != "${build}"],[
AC_MSG_CHECKING(for RPM OS)
case "$host" in
i?86-*cygwin*) RPM_OS=cygwin ;;
i?86-*mingw*) RPM_OS=mingw32 ;;
sparc-*solaris*) RPM_OS=solaris2.7 ;;
*)
AC_MSG_ERROR([Unsupported host ${host}])
@@ -135,6 +137,15 @@ AC_SUBST(rtems_api,RTEMS_API)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([cygwin/Makefile])
AC_CONFIG_FILES([cygwin/i686/Makefile])
AC_CONFIG_FILES([mingw32/Makefile])
AC_CONFIG_FILES([mingw32/i686/Makefile])
AC_CONFIG_FILES([solaris2.7/Makefile])
AC_CONFIG_FILES([solaris2.7/sparc/Makefile])
AC_CONFIG_FILES([rtems4.8/Makefile])
AC_CONFIG_FILES([rtems4.8/arm/Makefile])
AC_CONFIG_FILES([rtems4.8/bfin/Makefile])

View File

@@ -0,0 +1,16 @@
%build
%if "%{_prefix}" != "/usr"
export PATH="%{_bindir}:${PATH}"
%endif
mkdir -p build
cd build
../rtems-%{cpukit_pkgvers}/configure \
--prefix=%{_prefix} \
--target=@tool_target@ \
--enable-multilib \
--disable-rtemsbsp
make all RTEMS_BSP=
cd ..

View File

@@ -0,0 +1,24 @@
%define cpukit_pkgvers @CPUKIT_PKGVERS@
%define cpukit_version @CPUKIT_VERS@
%define cpukit_rpmvers %{expand:%(echo "@CPUKIT_VERS@" | tr - _ )}
Name: @rpmprefix@@tool_target@-cpukit
Summary: @tool_target@ cpukit
Group: Development/Tools
Version: %{cpukit_rpmvers}
Release: @CPUKIT_RPMREL@%{?dist}
License: GPL
URL: http://cpukit.gnu.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%define _use_internal_dependency_generator 0
BuildRequires: @rpmprefix@@tool_target@-gcc
@SOURCES@
%description
RTEMS cpukit for @tool_target@.

View File

@@ -0,0 +1,11 @@
%install
rm -rf $RPM_BUILD_ROOT
%if "%{_prefix}" != "/usr"
export PATH="%{_bindir}:${PATH}"
%endif
cd build
make DESTDIR=$RPM_BUILD_ROOT install
cd ..
rm -rf $RPM_BUILD_ROOT%{_prefix}/share/man
rm -rf $RPM_BUILD_ROOT%{_prefix}/bin

View File

@@ -0,0 +1,6 @@
%prep
%setup -c -T -n %{name}-%{version}
%setup -q -T -D -n %{name}-%{version} -a0
@PREP@

View File

@@ -0,0 +1,49 @@
# Extract %%__os_install_post into os_install_post~
cat << \EOF > os_install_post~
%__os_install_post
EOF
# Generate customized brp-*scripts
cat os_install_post~ | while read a x y; do
case $a in
# Prevent brp-strip* from trying to handle foreign binaries
*/brp-strip*)
b=$(basename $a)
sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
chmod a+x $b
;;
%if "%{_prefix}" != "/usr"
# Fix up brp-compress to handle %%_prefix != /usr
*/brp-compress*)
b=$(basename $a)
sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
chmod a+x $b
;;
%endif
esac
done
sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
%if "%{_prefix}" != "/usr"
-e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
%endif
< os_install_post~ > os_install_post
%define __os_install_post . ./os_install_post
cat << EOF > %{_builddir}/%{name}-%{cpukit_rpmvers}/find-provides
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/@tool_target@/(lib|include|sys-root)' \
| grep -v '^${RPM_BUILD_ROOT}%{cpukitlib}/@tool_target@/' | %__find_provides
EOF
chmod +x %{_builddir}/%{name}-%{cpukit_rpmvers}/find-provides
%define __find_provides %{_builddir}/%{name}-%{cpukit_rpmvers}/find-provides
cat << EOF > %{_builddir}/%{name}-%{cpukit_rpmvers}/find-requires
#!/bin/sh
grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/@tool_target@/(lib|include|sys-root)' \
| grep -v '^${RPM_BUILD_ROOT}%{cpukitlib}/@tool_target@/' | %__find_requires
EOF
chmod +x %{_builddir}/%{name}-%{cpukit_rpmvers}/find-requires
%define __find_requires %{_builddir}/%{name}-%{cpukit_rpmvers}/find-requires

View File

@@ -0,0 +1,8 @@
%description -n @rpmprefix@@tool_target@-cpukit
GNU cc compiler for @tool_target@.
%files -n @rpmprefix@@tool_target@-cpukit
%sysdir %{_prefix}
%{_prefix}/@tool_target@
# Violates the FHS
%exclude %{_prefix}/make

View File

@@ -32,8 +32,7 @@
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
%else
# gcc is not ready to be compiled with -std=gnu99
CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
CC="%{__cc} ${RPM_OPT_FLAGS}" \
%endif
../gcc-%{gcc_pkgvers}/configure \
--prefix=%{_prefix} \

View File

@@ -30,7 +30,7 @@ BuildRequires: gmp-devel >= 4.1
BuildRequires: %{_host_rpmprefix}gmp-devel
BuildRequires: %{_host_rpmprefix}mpfr-devel
%endif
%if 0%{?fedora} >= 8
%if "%{?fedora}" >= "8"
BuildRequires: mpfr-devel >= 2.3.0
%endif
%if "%{?suse}" > "10.3"
@@ -50,7 +50,7 @@ BuildRequires: @rpmprefix@@tool_target@-gcc
BuildRequires: flex bison
%if %build_f95
BuildRequires: gmp-devel >= 4.1
%if 0%{?fedora} >= 8
%if "%{?fedora}" >= "8"
BuildRequires: mpfr-devel >= 2.2.1
%endif
%endif

View File

@@ -25,7 +25,7 @@
%endif
%if %build_objc
%setup -q -T -D -n %{name}-%{version} -a5
%setup -T -D -n %{name}-%{version} -a5
%{?PATCH5:%patch5 -p0}
%endif

View File

@@ -47,27 +47,3 @@ EOF
chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
%ifnarch noarch
# Extract %%__debug_install_post into debug_install_post~
cat << \EOF > debug_install_post~
%__debug_install_post
EOF
# Generate customized debug_install_post script
cat debug_install_post~ | while read a x y; do
case $a in
# Prevent find-debuginfo.sh* from trying to handle foreign binaries
*/find-debuginfo.sh)
b=$(basename $a)
sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
chmod a+x $b
;;
esac
done
sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
< debug_install_post~ > debug_install_post
%define __debug_install_post . ./debug_install_post
%endif

View File

@@ -44,10 +44,6 @@ GNU cc compiler for @tool_target@.
%endif
%endif
%if "%{gcc_version}" >= "4.3.0"
%dir %{gcclib}/@tool_target@/%{gcc_version}/include-fixed
%endif
%dir %{gccexec}
%dir %{gccexec}/@tool_target@
%dir %{gccexec}/@tool_target@/%{gcc_version}

View File

@@ -15,15 +15,12 @@
--without-included-gettext \
--disable-win32-registry \
--disable-werror \
%{build_sim} \
--enable-sim \
%if "%{gdb_version}" >= "6.7"
--with-system-readline \
%endif
%if "%{gdb_version}" >= "6.6"
--with-expat \
%endif
%if "%{gdb_version}" >= "6.8.50"
--without-python \
%endif
--with-sysroot=%{_prefix}/@tool_target@/sys-root \
--prefix=%{_prefix} --bindir=%{_bindir} \

View File

@@ -12,41 +12,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{_host_rpmprefix}gcc
%define build_sim --enable-sim
%if "%{_build}" != "%{_host}"
# psim doesn't support Cdn-X
%if "@tool_target@" == "powerpc-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%endif
%ifos mingw mingw32
# Mingw lacks functions required by the simulator
%if "@tool_target@" == "sparc-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%if "@tool_target@" == "h8300-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%if "%{gdb_version}" >= "6.8.50"
%if "@tool_target@" == "m32c-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%endif
%if "@tool_target@" == "lm32-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%if "@tool_target@" == "mipstx39-rtems@rtems_api@"
%define build_sim --disable-sim
%endif
%endif
%if "%{gdb_version}" >= "6.6"
# suse
%if "%{?suse}"
%if "%{?suse}" >= "10.3"
BuildRequires: libexpat-devel
%else
# Fedora/CentOS/Cygwin/MinGW
BuildRequires: expat
%endif
%else
# fedora/redhat/cygwin
BuildRequires: %{_host_rpmprefix}expat-devel
%endif
%endif

View File

@@ -0,0 +1,97 @@
--- binutils-2.16.1/bfd/config.bfd 31 Jan 2005 17:18:47 -0000 1.181
+++ binutils-2.16.1/bfd/config.bfd 5 Jul 2005 15:32:00 -0000
@@ -369,7 +369,12 @@
targ_selvecs=bfd_elf32_frv_vec
;;
- h8300*-*-elf)
+ h8300*-*-rtemscoff*)
+ targ_defvec=h8300coff_vec
+ targ_underscore=yes
+ ;;
+
+ h8300*-*-elf | h8300*-*-rtems*)
targ_defvec=bfd_elf32_h8300_vec
targ_underscore=yes
;;
--- binutils-2.16.1/gas/configure.tgt 31 Jan 2005 17:18:51 -0000 1.3
+++ binutils-2.16.1/gas/configure.tgt 5 Jul 2005 15:32:03 -0000
@@ -163,9 +163,9 @@
hppa-*-bsd*) fmt=som em=hppa ;;
hppa-*-hiux*) fmt=som em=hppa ;;
- h8300-*-rtems*) fmt=coff ;;
+ h8300-*-rtemscoff*) fmt=coff ;;
h8300-*-coff) fmt=coff ;;
- h8300-*-elf) fmt=elf ;;
+ h8300-*-elf | h8300-*-rtems*) fmt=elf ;;
h8500-*-rtems*) fmt=coff ;;
h8500-*-coff) fmt=coff ;;
--- binutils-2.16.1/ld/configure.tgt 8 Feb 2005 19:54:27 -0000 1.165
+++ binutils-2.16.1/ld/configure.tgt 5 Jul 2005 15:32:18 -0000
@@ -280,10 +280,10 @@
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
xscale-*-coff) targ_emul=armcoff ;;
xscale-*-elf) targ_emul=armelf ;;
-h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
+h8300-*-hms* | h8300-*-coff* | h8300-*-rtemscoff*)
targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn"
;;
-h8300-*-elf*)
+h8300-*-elf* | h8300-*-rtems*)
targ_emul=h8300elf;
targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
;;
--- binutils-2.16.1/bfd/archive.c 3 Mar 2005 11:40:56 -0000 1.34
+++ binutils-2.16.1/bfd/archive.c 8 Jul 2005 06:28:30 -0000
@@ -1308,6 +1308,13 @@
#define getgid() 0
#endif
+static void print_ar_size( struct ar_hdr* hdr, int val )
+{
+ char buffer[sizeof(hdr->ar_size)+1];
+ sprintf(buffer,"%-10d", val);
+ memcpy(hdr->ar_size,buffer,sizeof(hdr->ar_size));
+}
+
/* Takes a filename, returns an arelt_data for it, or NULL if it can't
make one. The filename must refer to a filename in the filesystem.
The filename field of the ar_hdr will NOT be initialized. If member
@@ -1368,7 +1375,7 @@
#endif
sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid);
sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode);
- sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size);
+ print_ar_size(hdr, (long) status.st_size);
/* Correct for a lossage in sprintf whereby it null-terminates. I cannot
understand how these C losers could design such a ramshackle bunch of
IO operations. */
@@ -1660,7 +1667,7 @@
memset (&hdr, 0, sizeof (struct ar_hdr));
strcpy (hdr.ar_name, ename);
/* Round size up to even number in archive header. */
- sprintf (&(hdr.ar_size[0]), "%-10d",
+ print_ar_size(&hdr,
(int) ((elength + 1) & ~(bfd_size_type) 1));
strncpy (hdr.ar_fmag, ARFMAG, 2);
for (i = 0; i < sizeof (struct ar_hdr); i++)
@@ -1913,7 +1920,7 @@
sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
- sprintf (hdr.ar_size, "%-10d", (int) mapsize);
+ print_ar_size(&hdr, (int) mapsize);
strncpy (hdr.ar_fmag, ARFMAG, 2);
for (i = 0; i < sizeof (struct ar_hdr); i++)
if (((char *) (&hdr))[i] == '\0')
@@ -2068,7 +2075,7 @@
memset (&hdr, 0, sizeof (struct ar_hdr));
hdr.ar_name[0] = '/';
- sprintf (hdr.ar_size, "%-10d", (int) mapsize);
+ print_ar_size (&hdr, (int) mapsize);
sprintf (hdr.ar_date, "%ld", (long) time (NULL));
/* This, at least, is what Intel coff sets the values to. */
sprintf ((hdr.ar_uid), "%d", 0);

View File

@@ -0,0 +1,556 @@
diff -uNr binutils-2.17.orig/bfd/bfd-in2.h binutils-2.17/bfd/bfd-in2.h
--- binutils-2.17.orig/bfd/bfd-in2.h 2006-03-26 01:38:42.000000000 +0100
+++ binutils-2.17/bfd/bfd-in2.h 2006-10-21 13:53:23.000000000 +0200
@@ -643,6 +643,12 @@
DYN_NO_NEEDED = 8
};
+enum notice_asneeded_action {
+ notice_as_needed,
+ notice_not_needed,
+ notice_needed
+};
+
extern bfd_boolean bfd_elf_record_link_assignment
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean);
diff -uNr binutils-2.17.orig/bfd/bfd-in.h binutils-2.17/bfd/bfd-in.h
--- binutils-2.17.orig/bfd/bfd-in.h 2006-03-16 13:20:15.000000000 +0100
+++ binutils-2.17/bfd/bfd-in.h 2006-10-21 13:53:23.000000000 +0200
@@ -636,6 +636,12 @@
DYN_NO_NEEDED = 8
};
+enum notice_asneeded_action {
+ notice_as_needed,
+ notice_not_needed,
+ notice_needed
+};
+
extern bfd_boolean bfd_elf_record_link_assignment
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean);
diff -uNr binutils-2.17.orig/bfd/ChangeLog binutils-2.17/bfd/ChangeLog
--- binutils-2.17.orig/bfd/ChangeLog 2006-06-23 20:18:16.000000000 +0200
+++ binutils-2.17/bfd/ChangeLog 2006-10-21 13:53:23.000000000 +0200
@@ -1,3 +1,25 @@
+2006-08-08 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/2724
+ * coffcode.h (coff_new_section_hook): Only modify the section
+ symbol of sections which were created by the user.
+
+2006-07-19 Alan Modra <amodra@bigpond.net.au>
+
+ * bfd-in.h (enum notice_asneeded_action): Define.
+ * bfd-in2.h: Regenerate.
+ * elflink.c (elf_link_add_object_symbols): Call linker "notice"
+ function with NULL name for as-needed handling.
+
+2006-07-12 Matthew R. Dempsky <mrd@alkemio.org>
+
+ * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
+
+2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * Makefile.am: Clear RELEASE.
+ * Makefile.in: Regenerated.
+
2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
* configure.in: Update version to 2.17.
diff -uNr binutils-2.17.orig/bfd/coffcode.h binutils-2.17/bfd/coffcode.h
--- binutils-2.17.orig/bfd/coffcode.h 2005-10-25 19:40:09.000000000 +0200
+++ binutils-2.17/bfd/coffcode.h 2006-10-21 13:53:24.000000000 +0200
@@ -1546,9 +1546,6 @@
static bfd_boolean
coff_new_section_hook (bfd * abfd, asection * section)
{
- combined_entry_type *native;
- bfd_size_type amt;
-
section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
#ifdef RS6000COFF_C
@@ -1560,27 +1557,34 @@
section->alignment_power = bfd_xcoff_data_align_power (abfd);
#endif
- /* Allocate aux records for section symbols, to store size and
- related info.
-
- @@ The 10 is a guess at a plausible maximum number of aux entries
- (but shouldn't be a constant). */
- amt = sizeof (combined_entry_type) * 10;
- native = bfd_zalloc (abfd, amt);
- if (native == NULL)
- return FALSE;
-
- /* We don't need to set up n_name, n_value, or n_scnum in the native
- symbol information, since they'll be overridden by the BFD symbol
- anyhow. However, we do need to set the type and storage class,
- in case this symbol winds up getting written out. The value 0
- for n_numaux is already correct. */
-
- native->u.syment.n_type = T_NULL;
- native->u.syment.n_sclass = C_STAT;
+ /* PR binutils/2724: Only real sections have a symbol that
+ has the coff_symbol_type structure allocated for it. */
+ if (! bfd_is_const_section (section))
+ {
+ combined_entry_type *native;
+ bfd_size_type amt;
+
+ /* Allocate aux records for section symbols, to store size and
+ related info.
+
+ @@ The 10 is a guess at a plausible maximum number of aux entries
+ (but shouldn't be a constant). */
+ amt = sizeof (combined_entry_type) * 10;
+ native = bfd_zalloc (abfd, amt);
+ if (native == NULL)
+ return FALSE;
- coffsymbol (section->symbol)->native = native;
+ /* We don't need to set up n_name, n_value, or n_scnum in the native
+ symbol information, since they'll be overridden by the BFD symbol
+ anyhow. However, we do need to set the type and storage class,
+ in case this symbol winds up getting written out. The value 0
+ for n_numaux is already correct. */
+ native->u.syment.n_type = T_NULL;
+ native->u.syment.n_sclass = C_STAT;
+ coffsymbol (section->symbol)->native = native;
+ }
+
coff_set_custom_section_alignment (abfd, section,
coff_section_alignment_table,
coff_section_alignment_table_size);
diff -uNr binutils-2.17.orig/bfd/cpu-m68k.c binutils-2.17/bfd/cpu-m68k.c
--- binutils-2.17.orig/bfd/cpu-m68k.c 2006-03-25 11:24:27.000000000 +0100
+++ binutils-2.17/bfd/cpu-m68k.c 2006-10-21 13:53:24.000000000 +0200
@@ -202,6 +202,9 @@
if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
/* Merge m68k machine. */
return a->mach > b->mach ? a : b;
+ else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
+ /* CPU32 is compatible with itself. */
+ return a;
else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
&& b->mach >= bfd_mach_mcf_isa_a_nodiv)
{
diff -uNr binutils-2.17.orig/bfd/elflink.c binutils-2.17/bfd/elflink.c
--- binutils-2.17.orig/bfd/elflink.c 2006-05-22 17:06:36.000000000 +0200
+++ binutils-2.17/bfd/elflink.c 2006-10-21 13:53:24.000000000 +0200
@@ -3496,6 +3496,13 @@
if (alloc_mark == NULL)
goto error_free_vers;
+ /* Make a special call to the linker "notice" function to
+ tell it that we are about to handle an as-needed lib. */
+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
+ notice_as_needed))
+ return FALSE;
+
+
/* Clone the symbol table and sym hashes. Remember some
pointers into the symbol table, and dynamic symbol count. */
old_hash = (char *) old_tab + tabsize;
@@ -4169,6 +4176,12 @@
}
}
+ /* Make a special call to the linker "notice" function to
+ tell it that symbols added for crefs may need to be removed. */
+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
+ notice_not_needed))
+ return FALSE;
+
free (old_tab);
objalloc_free_block ((struct objalloc *) htab->root.table.memory,
alloc_mark);
@@ -4179,6 +4192,9 @@
if (old_tab != NULL)
{
+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
+ notice_needed))
+ return FALSE;
free (old_tab);
old_tab = NULL;
}
diff -uNr binutils-2.17.orig/bfd/version.h binutils-2.17/bfd/version.h
--- binutils-2.17.orig/bfd/version.h 2006-06-23 20:14:41.000000000 +0200
+++ binutils-2.17/bfd/version.h 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20060623
+#define BFD_VERSION_DATE 20061021
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff -uNr binutils-2.17.orig/binutils/ChangeLog binutils-2.17/binutils/ChangeLog
--- binutils-2.17.orig/binutils/ChangeLog 2006-06-12 15:05:03.000000000 +0200
+++ binutils-2.17/binutils/ChangeLog 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,8 @@
+2006-08-15 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/3039
+ * wrstabs.c (stab_tag_type): Initialize 'size'.
+
2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
* po/Make-in (pdf, ps): New dummy targets.
diff -uNr binutils-2.17.orig/binutils/wrstabs.c binutils-2.17/binutils/wrstabs.c
--- binutils-2.17.orig/binutils/wrstabs.c 2006-03-16 13:20:16.000000000 +0100
+++ binutils-2.17/binutils/wrstabs.c 2006-10-21 13:53:24.000000000 +0200
@@ -1869,7 +1869,7 @@
{
struct stab_write_handle *info = (struct stab_write_handle *) p;
long index;
- unsigned int size;
+ unsigned int size = 0;
index = stab_get_struct_index (info, name, id, kind, &size);
if (index < 0)
diff -uNr binutils-2.17.orig/gas/ChangeLog binutils-2.17/gas/ChangeLog
--- binutils-2.17.orig/gas/ChangeLog 2006-06-12 15:05:03.000000000 +0200
+++ binutils-2.17/gas/ChangeLog 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,8 @@
+2006-07-19 Mat Hostetter <mat@lcs.mit.edu>
+
+ * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where
+ when file and line unknown.
+
2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
* po/Make-in (pdf, ps): New dummy targets.
diff -uNr binutils-2.17.orig/gas/symbols.c binutils-2.17/gas/symbols.c
--- binutils-2.17.orig/gas/symbols.c 2006-01-09 18:14:40.000000000 +0100
+++ binutils-2.17/gas/symbols.c 2006-10-21 13:53:24.000000000 +0200
@@ -928,13 +928,11 @@
&& seg_right != undefined_section)
{
if (right)
- as_bad_where (file, line,
- _("invalid sections for operation on `%s' and `%s' setting `%s'"),
- S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
+ as_bad (_("invalid sections for operation on `%s' and `%s' setting `%s'"),
+ S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
else
- as_bad_where (file, line,
- _("invalid section for operation on `%s' setting `%s'"),
- S_GET_NAME (left), S_GET_NAME (symp));
+ as_bad (_("invalid section for operation on `%s' setting `%s'"),
+ S_GET_NAME (left), S_GET_NAME (symp));
}
}
}
diff -uNr binutils-2.17.orig/ld/ChangeLog binutils-2.17/ld/ChangeLog
--- binutils-2.17.orig/ld/ChangeLog 2006-06-12 15:07:28.000000000 +0200
+++ binutils-2.17/ld/ChangeLog 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,20 @@
+2006-07-19 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.h (handle_asneeded_cref): Declare.
+ * ldcref.c: Include objalloc.h.
+ (old_table, old_tab, alloc_mark): New variables.
+ (tabsize, entsize, refsize, old_symcount): Likewise.
+ (add_cref): Use bfd_hash_allocate for refs.
+ (handle_asneeded_cref): New function.
+ * ldmain.c (notice): Call handle_asneeded_cref for NULL name.
+
+2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
+
+ Backport:
+ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
+ * ldlang.c (lang_size_sections_1): Don't check mem regions for
+ os->ignored sections.
+
2006-06-12 Fred Fish <fnf@specifix.com>
* emulparams/elf32bmip.sh (OTHER_SECTIONS): Keep the
diff -uNr binutils-2.17.orig/ld/configure.tgt binutils-2.17/ld/configure.tgt
--- binutils-2.17.orig/ld/configure.tgt 2006-04-05 14:41:57.000000000 +0200
+++ binutils-2.17/ld/configure.tgt 2006-10-21 13:53:24.000000000 +0200
@@ -83,7 +83,8 @@
avr-*-*) targ_emul=avr2
targ_extra_emuls="avr1 avr3 avr4 avr5"
;;
-bfin-*-elf) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+bfin-*-elf | bfin-*-rtems*)
+ targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
bfin-*-uclinux*) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
cr16c-*-elf*) targ_emul=elf32cr16c
;;
diff -uNr binutils-2.17.orig/ld/emulparams/h8300elf.sh binutils-2.17/ld/emulparams/h8300elf.sh
--- binutils-2.17.orig/ld/emulparams/h8300elf.sh 2005-12-22 18:43:34.000000000 +0100
+++ binutils-2.17/ld/emulparams/h8300elf.sh 2006-10-21 13:53:24.000000000 +0200
@@ -17,7 +17,7 @@
TINY_DATA_SECTION=".tinydata 0xff8000 :
{
*(.tinydata)
- _tinydata = .;
+ ${RELOCATING+ _tinydata = .; }
}"
TINY_BSS_SECTION=".tinybss : AT (_tinydata)
{
diff -uNr binutils-2.17.orig/ld/ldcref.c binutils-2.17/ld/ldcref.c
--- binutils-2.17.orig/ld/ldcref.c 2006-03-16 13:20:16.000000000 +0100
+++ binutils-2.17/ld/ldcref.c 2006-10-21 13:53:24.000000000 +0200
@@ -27,6 +27,7 @@
#include "sysdep.h"
#include "bfdlink.h"
#include "libiberty.h"
+#include "objalloc.h"
#include "ld.h"
#include "ldmain.h"
@@ -101,6 +102,15 @@
static size_t cref_symcount;
+/* Used to take a snapshot of the cref hash table when starting to
+ add syms from an as-needed library. */
+static struct bfd_hash_entry **old_table;
+static unsigned int old_size;
+static void *old_tab;
+static void *alloc_mark;
+static size_t tabsize, entsize, refsize;
+static size_t old_symcount;
+
/* Create an entry in a cref hash table. */
static struct bfd_hash_entry *
@@ -165,7 +175,9 @@
if (r == NULL)
{
- r = xmalloc (sizeof *r);
+ r = bfd_hash_allocate (&cref_table.root, sizeof *r);
+ if (r == NULL)
+ einfo (_("%X%P: cref alloc failed: %E\n"));
r->next = h->refs;
h->refs = r;
r->abfd = abfd;
@@ -182,6 +194,123 @@
r->def = TRUE;
}
+/* Called before loading an as-needed library to take a snapshot of
+ the cref hash table, and after we have loaded or found that the
+ library was not needed. */
+
+bfd_boolean
+handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
+ enum notice_asneeded_action act)
+{
+ unsigned int i;
+
+ if (!cref_initialized)
+ return TRUE;
+
+ if (act == notice_as_needed)
+ {
+ char *old_ent, *old_ref;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ entsize += cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ refsize += sizeof (struct cref_hash_entry);
+ }
+ }
+
+ tabsize = cref_table.root.size * sizeof (struct bfd_hash_entry *);
+ old_tab = xmalloc (tabsize + entsize + refsize);
+
+ alloc_mark = bfd_hash_allocate (&cref_table.root, 1);
+ if (alloc_mark == NULL)
+ return FALSE;
+
+ memcpy (old_tab, cref_table.root.table, tabsize);
+ old_ent = (char *) old_tab + tabsize;
+ old_ref = (char *) old_ent + entsize;
+ old_table = cref_table.root.table;
+ old_size = cref_table.root.size;
+ old_symcount = cref_symcount;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ memcpy (old_ent, p, cref_table.root.entsize);
+ old_ent = (char *) old_ent + cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ {
+ memcpy (old_ref, r, sizeof (struct cref_hash_entry));
+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ }
+ }
+ }
+ return TRUE;
+ }
+
+ if (act == notice_not_needed)
+ {
+ char *old_ent, *old_ref;
+
+ if (old_tab == NULL)
+ {
+ /* The only way old_tab can be NULL is if the cref hash table
+ had not been initialised when notice_as_needed. */
+ bfd_hash_table_free (&cref_table.root);
+ cref_initialized = FALSE;
+ return TRUE;
+ }
+
+ old_ent = (char *) old_tab + tabsize;
+ old_ref = (char *) old_ent + entsize;
+ cref_table.root.table = old_table;
+ cref_table.root.size = old_size;
+ memcpy (cref_table.root.table, old_tab, tabsize);
+ cref_symcount = old_symcount;
+
+ for (i = 0; i < cref_table.root.size; i++)
+ {
+ struct bfd_hash_entry *p;
+ struct cref_hash_entry *c;
+ struct cref_ref *r;
+
+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
+ {
+ memcpy (p, old_ent, cref_table.root.entsize);
+ old_ent = (char *) old_ent + cref_table.root.entsize;
+ c = (struct cref_hash_entry *) p;
+ for (r = c->refs; r != NULL; r = r->next)
+ {
+ memcpy (r, old_ref, sizeof (struct cref_hash_entry));
+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ }
+ }
+ }
+
+ objalloc_free_block ((struct objalloc *) cref_table.root.memory,
+ alloc_mark);
+ }
+ else if (act != notice_needed)
+ return FALSE;
+
+ free (old_tab);
+ old_tab = NULL;
+ return TRUE;
+}
+
/* Copy the addresses of the hash table entries into an array. This
is called via cref_hash_traverse. We also fill in the demangled
name. */
diff -uNr binutils-2.17.orig/ld/ld.h binutils-2.17/ld/ld.h
--- binutils-2.17.orig/ld/ld.h 2005-09-30 13:42:04.000000000 +0200
+++ binutils-2.17/ld/ld.h 2006-10-21 13:53:24.000000000 +0200
@@ -1,6 +1,6 @@
/* ld.h -- general linker header file
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005
+ 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -282,6 +282,7 @@
extern int yyparse (void);
extern void add_cref (const char *, bfd *, asection *, bfd_vma);
+extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
extern void output_cref (FILE *);
extern void check_nocrossrefs (void);
extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
diff -uNr binutils-2.17.orig/ld/ldlang.c binutils-2.17/ld/ldlang.c
--- binutils-2.17.orig/ld/ldlang.c 2006-06-12 15:05:04.000000000 +0200
+++ binutils-2.17/ld/ldlang.c 2006-10-21 13:53:24.000000000 +0200
@@ -4207,7 +4207,8 @@
/* If a loadable section is using the default memory
region, and some non default memory regions were
defined, issue an error message. */
- if (!IGNORE_SECTION (os->bfd_section)
+ if (!os->ignored
+ && !IGNORE_SECTION (os->bfd_section)
&& ! link_info.relocatable
&& check_regions
&& strcmp (os->region->name,
diff -uNr binutils-2.17.orig/ld/ldmain.c binutils-2.17/ld/ldmain.c
--- binutils-2.17.orig/ld/ldmain.c 2006-04-06 20:52:45.000000000 +0200
+++ binutils-2.17/ld/ldmain.c 2006-10-21 13:53:24.000000000 +0200
@@ -1511,6 +1511,13 @@
asection *section,
bfd_vma value)
{
+ if (name == NULL)
+ {
+ if (command_line.cref || nocrossref_list != NULL)
+ return handle_asneeded_cref (abfd, value);
+ return TRUE;
+ }
+
if (! info->notice_all
|| (info->notice_hash != NULL
&& bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
diff -uNr binutils-2.17.orig/ld/testsuite/ChangeLog binutils-2.17/ld/testsuite/ChangeLog
--- binutils-2.17.orig/ld/testsuite/ChangeLog 2006-06-12 15:44:33.000000000 +0200
+++ binutils-2.17/ld/testsuite/ChangeLog 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,17 @@
+2006-07-12 Richard Sandiford <richard@codesourcery.com>
+
+ * ld-m68k/merge-ok-1c.d: New test.
+ * ld-m68k/m68k.exp: Run it.
+
+2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
+
+ Backport:
+ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
+ * ld-scripts/empty-orphan.d: Update again.
+
+ * ld-scripts/empty-orphan.t: Discard .reginfo.
+ * ld-scripts/empty-orphan.d: Update.
+
2006-06-12 Daniel Jacobowitz <dan@codesourcery.com>
Backport:
diff -uNr binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp binutils-2.17/ld/testsuite/ld-m68k/m68k.exp
--- binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp 2006-03-25 11:24:27.000000000 +0100
+++ binutils-2.17/ld/testsuite/ld-m68k/m68k.exp 2006-10-21 13:53:24.000000000 +0200
@@ -53,3 +53,4 @@
run_dump_test "merge-error-1e"
run_dump_test "merge-ok-1a"
run_dump_test "merge-ok-1b"
+run_dump_test "merge-ok-1c"
diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d
--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d 2005-03-17 17:20:39.000000000 +0100
+++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d 2006-10-21 13:53:24.000000000 +0200
@@ -1,3 +1,6 @@
#source: empty-orphan.s
#ld: -T empty-orphan.t
-#error: no memory region specified for loadable section
+#readelf: -l --wide
+#...
+ +LOAD +[x0-9a-f]+ [x0]+70000000 [x0]+70000000 [x0]+(2|4|8|10|20|40|80) .*
+#pass
diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t
--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t 2005-03-17 17:20:39.000000000 +0100
+++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t 2006-10-21 13:53:24.000000000 +0200
@@ -17,5 +17,6 @@
.text : { *(.text) } > text_mem : text_phdr
.data : { *(.data) } > data_mem : data_phdr
.bss : { *(.bss) } > data_mem : data_phdr
+ /DISCARD/ : { *(.reginfo) }
/* .orphan_data is an orphan */
}

View File

@@ -0,0 +1,24 @@
diff -Naur binutils-20060817-1.orig/configure binutils-20060817-1/configure
--- binutils-20060817-1.orig/configure 2006-08-17 07:00:58.000000000 +0200
+++ binutils-20060817-1/configure 2008-03-12 03:52:57.000000000 +0100
@@ -3681,7 +3681,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -Naur binutils-20060817-1.orig/configure.in binutils-20060817-1/configure.in
--- binutils-20060817-1.orig/configure.in 2006-08-17 07:00:58.000000000 +0200
+++ binutils-20060817-1/configure.in 2008-03-12 03:52:57.000000000 +0100
@@ -2232,7 +2232,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"

View File

@@ -0,0 +1,14 @@
diff -uNr binutils-2.17.50.orig/ld/configure.tgt binutils-2.17.50/ld/configure.tgt
--- binutils-2.17.50.orig/ld/configure.tgt 2007-04-04 13:02:39.000000000 -0500
+++ binutils-2.17.50/ld/configure.tgt 2007-05-25 05:17:14.000000000 -0500
@@ -113,6 +113,10 @@
targ_extra_emuls="elf32bfinfd"
targ_extra_libpath=$targ_extra_emuls
;;
+bfin-*-rtems*) targ_emul=elf32bfin;
+ targ_extra_emuls="elf32bfinfd"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
bfin-*-uclinux*) targ_emul=elf32bfin;
targ_extra_emuls="elf32bfinfd"
targ_extra_libpath=$targ_extra_emuls

View File

@@ -0,0 +1,14 @@
diff -uNr binutils-2.17.90.orig/ld/configure.tgt binutils-2.17.90/ld/configure.tgt
--- binutils-2.17.90.orig/ld/configure.tgt 2007-08-06 22:00:19.000000000 +0200
+++ binutils-2.17.90/ld/configure.tgt 2007-08-07 08:42:24.000000000 +0200
@@ -113,6 +113,10 @@
targ_extra_emuls="elf32bfinfd"
targ_extra_libpath=$targ_extra_emuls
;;
+bfin-*-rtems*) targ_emul=elf32bfin;
+ targ_extra_emuls="elf32bfinfd"
+ targ_extra_libpath=$targ_extra_emuls
+ ;;
bfin-*-uclinux*) targ_emul=elf32bfin;
targ_extra_emuls="elf32bfinfd"
targ_extra_libpath=$targ_extra_emuls

View File

@@ -0,0 +1,27 @@
diff -uNr gcc-3.4.6.orig/gcc/collect2.c gcc-3.4.6/gcc/collect2.c
--- gcc-3.4.6.orig/gcc/collect2.c 2005-01-10 16:25:23.000000000 +0100
+++ gcc-3.4.6/gcc/collect2.c 2007-11-13 08:48:13.000000000 +0100
@@ -1534,7 +1534,7 @@
if (redir)
{
/* Open response file. */
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IWUSR | S_IRUSR);
/* Duplicate the stdout and stderr file handles
so they can be restored later. */
diff -uNr gcc-3.4.6.orig/gcc/Makefile.in gcc-3.4.6/gcc/Makefile.in
--- gcc-3.4.6.orig/gcc/Makefile.in 2005-02-24 10:26:59.000000000 +0100
+++ gcc-3.4.6/gcc/Makefile.in 2007-11-13 08:48:20.000000000 +0100
@@ -2945,9 +2945,9 @@
install-driver: installdirs xgcc$(exeext)
-rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
- -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)
+ -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
-( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) )
+ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) )
-if [ -f gcc-cross$(exeext) ] ; then \
if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \

View File

@@ -0,0 +1,14 @@
--- gcc-4.0.3.orig/gcc/Makefile.in 2006-08-22 05:51:40.000000000 -0500
+++ gcc-4.0.3/gcc/Makefile.in 2006-08-22 05:48:01.000000000 -0500
@@ -3275,9 +3275,9 @@
install-driver: installdirs xgcc$(exeext)
-rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
- -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)
+ -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
-( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) )
+ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) )
-if [ -f gcc-cross$(exeext) ] ; then \
if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \

View File

@@ -0,0 +1,31 @@
diff -uNr gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h gcc-4.2.1/gcc/config/arm/rtems-elf.h
--- gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h 2005-11-21 23:56:34.000000000 +0100
+++ gcc-4.2.1/gcc/config/arm/rtems-elf.h 2007-07-20 06:56:39.000000000 +0200
@@ -27,6 +27,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/c4x/rtems.h gcc-4.2.1/gcc/config/c4x/rtems.h
--- gcc-4.2.1.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
+++ gcc-4.2.1/gcc/config/c4x/rtems.h 2007-07-20 06:56:39.000000000 +0200
@@ -24,6 +24,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/mips/elf.h gcc-4.2.1/gcc/config/mips/elf.h
--- gcc-4.2.1.orig/gcc/config/mips/elf.h 2006-10-08 09:35:47.000000000 +0200
+++ gcc-4.2.1/gcc/config/mips/elf.h 2007-07-20 06:56:39.000000000 +0200
@@ -49,6 +49,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1

View File

@@ -0,0 +1,49 @@
diff -uNr gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h gcc-4.2.1/gcc/config/arm/rtems-elf.h
--- gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h 2005-11-21 23:56:34.000000000 +0100
+++ gcc-4.2.1/gcc/config/arm/rtems-elf.h 2007-07-20 06:56:39.000000000 +0200
@@ -27,6 +27,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/c4x/rtems.h gcc-4.2.1/gcc/config/c4x/rtems.h
--- gcc-4.2.1.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
+++ gcc-4.2.1/gcc/config/c4x/rtems.h 2007-07-20 06:56:39.000000000 +0200
@@ -24,6 +24,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/m68k/t-rtems gcc-4.2.1/gcc/config/m68k/t-rtems
--- gcc-4.2.1.orig/gcc/config/m68k/t-rtems 2005-02-07 06:13:25.000000000 +0100
+++ gcc-4.2.1/gcc/config/m68k/t-rtems 2007-08-04 10:15:11.000000000 +0200
@@ -1,7 +1,11 @@
# Custom multilibs for RTEMS
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m528x/mcpu32/m68030/m68040/m68060
+MULTILIB_OPTIONS += m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
-MULTILIB_MATCHES += m5200=m528x
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_MATCHES += m5200=m5206e
+MULTILIB_EXCEPTIONS = m68000/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_EXCEPTIONS += mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_EXCEPTIONS += m5200/m68881 m5200/msoft-float
+MULTILIB_EXCEPTIONS += m528x/m68881 m528x/msoft-float
diff -uNr gcc-4.2.1.orig/gcc/config/mips/elf.h gcc-4.2.1/gcc/config/mips/elf.h
--- gcc-4.2.1.orig/gcc/config/mips/elf.h 2006-10-08 09:35:47.000000000 +0200
+++ gcc-4.2.1/gcc/config/mips/elf.h 2007-07-20 06:56:39.000000000 +0200
@@ -49,6 +49,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1

View File

@@ -0,0 +1,119 @@
diff -uNr gcc-4.2.1.orig/configure gcc-4.2.1/configure
--- gcc-4.2.1.orig/configure 2007-06-21 01:07:21.000000000 +0200
+++ gcc-4.2.1/configure 2007-11-11 16:35:26.000000000 +0100
@@ -3743,7 +3743,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -uNr gcc-4.2.1.orig/configure.in gcc-4.2.1/configure.in
--- gcc-4.2.1.orig/configure.in 2007-05-30 15:48:07.000000000 +0200
+++ gcc-4.2.1/configure.in 2007-11-11 16:35:26.000000000 +0100
@@ -2246,7 +2246,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -uNr gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h gcc-4.2.1/gcc/config/arm/rtems-elf.h
--- gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h 2005-11-21 23:56:34.000000000 +0100
+++ gcc-4.2.1/gcc/config/arm/rtems-elf.h 2007-11-11 16:35:26.000000000 +0100
@@ -27,6 +27,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/c4x/rtems.h gcc-4.2.1/gcc/config/c4x/rtems.h
--- gcc-4.2.1.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
+++ gcc-4.2.1/gcc/config/c4x/rtems.h 2007-11-11 16:35:26.000000000 +0100
@@ -24,6 +24,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/m68k/t-rtems gcc-4.2.1/gcc/config/m68k/t-rtems
--- gcc-4.2.1.orig/gcc/config/m68k/t-rtems 2005-02-07 06:13:25.000000000 +0100
+++ gcc-4.2.1/gcc/config/m68k/t-rtems 2007-11-11 16:35:26.000000000 +0100
@@ -1,7 +1,11 @@
# Custom multilibs for RTEMS
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m528x/mcpu32/m68030/m68040/m68060
+MULTILIB_OPTIONS += m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
-MULTILIB_MATCHES += m5200=m528x
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_MATCHES += m5200=m5206e
+MULTILIB_EXCEPTIONS = m68000/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_EXCEPTIONS += mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_EXCEPTIONS += m5200/m68881 m5200/msoft-float
+MULTILIB_EXCEPTIONS += m528x/m68881 m528x/msoft-float
diff -uNr gcc-4.2.1.orig/gcc/config/mips/elf.h gcc-4.2.1/gcc/config/mips/elf.h
--- gcc-4.2.1.orig/gcc/config/mips/elf.h 2006-10-08 09:35:47.000000000 +0200
+++ gcc-4.2.1/gcc/config/mips/elf.h 2007-11-11 16:35:26.000000000 +0100
@@ -49,6 +49,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
diff -uNr gcc-4.2.1.orig/gcc/configure gcc-4.2.1/gcc/configure
--- gcc-4.2.1.orig/gcc/configure 2007-01-02 04:44:31.000000000 +0100
+++ gcc-4.2.1/gcc/configure 2007-11-11 17:19:41.000000000 +0100
@@ -7654,7 +7654,7 @@
echo "configure:7654: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
- 4.[4-9]*)
+ 4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*)
gcc_cv_prog_makeinfo_modern=yes;;
*) gcc_cv_prog_makeinfo_modern=no;;
esac
@@ -13937,9 +13937,7 @@
ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
if echo "$ld_ver" | grep GNU > /dev/null; then
ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
diff -uNr gcc-4.2.1.orig/gcc/configure.ac gcc-4.2.1/gcc/configure.ac
--- gcc-4.2.1.orig/gcc/configure.ac 2007-01-02 04:44:31.000000000 +0100
+++ gcc-4.2.1/gcc/configure.ac 2007-11-11 17:19:41.000000000 +0100
@@ -878,7 +878,7 @@
# that we can use it.
gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [4.[4-9]*])
+ [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
if test $gcc_cv_prog_makeinfo_modern = no; then
MAKEINFO="$MISSING makeinfo"
AC_MSG_WARN([
@@ -2094,9 +2094,7 @@
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \

View File

@@ -0,0 +1,133 @@
diff -uNr gcc-4.2.1.orig/configure gcc-4.2.1/configure
--- gcc-4.2.1.orig/configure 2007-06-21 01:07:21.000000000 +0200
+++ gcc-4.2.1/configure 2007-11-29 14:28:13.000000000 +0100
@@ -3743,7 +3743,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -uNr gcc-4.2.1.orig/configure.in gcc-4.2.1/configure.in
--- gcc-4.2.1.orig/configure.in 2007-05-30 15:48:07.000000000 +0200
+++ gcc-4.2.1/configure.in 2007-11-29 14:28:13.000000000 +0100
@@ -2246,7 +2246,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -uNr gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h gcc-4.2.1/gcc/config/arm/rtems-elf.h
--- gcc-4.2.1.orig/gcc/config/arm/rtems-elf.h 2005-11-21 23:56:34.000000000 +0100
+++ gcc-4.2.1/gcc/config/arm/rtems-elf.h 2007-11-29 14:28:13.000000000 +0100
@@ -27,6 +27,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/c4x/rtems.h gcc-4.2.1/gcc/config/c4x/rtems.h
--- gcc-4.2.1.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
+++ gcc-4.2.1/gcc/config/c4x/rtems.h 2007-11-29 14:28:13.000000000 +0100
@@ -24,6 +24,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.1.orig/gcc/config/m68k/t-rtems gcc-4.2.1/gcc/config/m68k/t-rtems
--- gcc-4.2.1.orig/gcc/config/m68k/t-rtems 2005-02-07 06:13:25.000000000 +0100
+++ gcc-4.2.1/gcc/config/m68k/t-rtems 2007-11-29 14:30:08.000000000 +0100
@@ -1,7 +1,14 @@
# Custom multilibs for RTEMS
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m528x/mcpu32/m68030/m68040/m68060/m5307/m5407/mcfv4e
+MULTILIB_OPTIONS += m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
-MULTILIB_MATCHES += m5200=m528x
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_MATCHES += m5200=m5206e
+MULTILIB_EXCEPTIONS = m68000/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_EXCEPTIONS += mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_EXCEPTIONS += m5200/m68881 m5200/msoft-float
+MULTILIB_EXCEPTIONS += m528x/m68881 m528x/msoft-float
+MULTILIB_EXCEPTIONS += m5307/m68881 m5307/msoft-float
+MULTILIB_EXCEPTIONS += m5407/m68881 m5407/msoft-float
+MULTILIB_EXCEPTIONS += mcfv4e/m68881 mcfv4e/msoft-float
diff -uNr gcc-4.2.1.orig/gcc/config/mips/elf.h gcc-4.2.1/gcc/config/mips/elf.h
--- gcc-4.2.1.orig/gcc/config/mips/elf.h 2006-10-08 09:35:47.000000000 +0200
+++ gcc-4.2.1/gcc/config/mips/elf.h 2007-11-29 14:28:13.000000000 +0100
@@ -49,6 +49,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
diff -uNr gcc-4.2.1.orig/gcc/configure gcc-4.2.1/gcc/configure
--- gcc-4.2.1.orig/gcc/configure 2007-01-02 04:44:31.000000000 +0100
+++ gcc-4.2.1/gcc/configure 2007-11-29 14:28:13.000000000 +0100
@@ -7654,7 +7654,7 @@
echo "configure:7654: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
- 4.[4-9]*)
+ 4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*)
gcc_cv_prog_makeinfo_modern=yes;;
*) gcc_cv_prog_makeinfo_modern=no;;
esac
@@ -13937,9 +13937,7 @@
ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q`
if echo "$ld_ver" | grep GNU > /dev/null; then
ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
diff -uNr gcc-4.2.1.orig/gcc/configure.ac gcc-4.2.1/gcc/configure.ac
--- gcc-4.2.1.orig/gcc/configure.ac 2007-01-02 04:44:31.000000000 +0100
+++ gcc-4.2.1/gcc/configure.ac 2007-11-29 14:28:13.000000000 +0100
@@ -878,7 +878,7 @@
# that we can use it.
gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [4.[4-9]*])
+ [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
if test $gcc_cv_prog_makeinfo_modern = no; then
MAKEINFO="$MISSING makeinfo"
AC_MSG_WARN([
@@ -2094,9 +2094,7 @@
if echo "$ld_ver" | grep GNU > /dev/null; then
changequote(,)dnl
ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
- -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \
+ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
-e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \
diff -uNr gcc-4.2.1.orig/gcc/gthr-rtems.h gcc-4.2.1/gcc/gthr-rtems.h
--- gcc-4.2.1.orig/gcc/gthr-rtems.h 2005-06-25 04:02:01.000000000 +0200
+++ gcc-4.2.1/gcc/gthr-rtems.h 2007-11-29 14:30:08.000000000 +0100
@@ -38,7 +38,6 @@
#define __GTHREADS 1
#define __GTHREAD_ONCE_INIT 0
-#define __GTHREAD_MUTEX_INIT 0
#define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION rtems_gxx_recursive_mutex_init

View File

@@ -0,0 +1,63 @@
diff -uNr gcc-4.2.2.orig/gcc/config/arm/rtems-elf.h gcc-4.2.2/gcc/config/arm/rtems-elf.h
--- gcc-4.2.2.orig/gcc/config/arm/rtems-elf.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.2/gcc/config/arm/rtems-elf.h 2007-11-27 18:50:47.000000000 +0100
@@ -26,6 +26,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.2.orig/gcc/config/c4x/rtems.h gcc-4.2.2/gcc/config/c4x/rtems.h
--- gcc-4.2.2.orig/gcc/config/c4x/rtems.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.2/gcc/config/c4x/rtems.h 2007-11-27 18:50:47.000000000 +0100
@@ -23,6 +23,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -uNr gcc-4.2.2.orig/gcc/config/m68k/t-rtems gcc-4.2.2/gcc/config/m68k/t-rtems
--- gcc-4.2.2.orig/gcc/config/m68k/t-rtems 2005-02-07 06:13:25.000000000 +0100
+++ gcc-4.2.2/gcc/config/m68k/t-rtems 2007-11-27 18:50:47.000000000 +0100
@@ -1,7 +1,14 @@
# Custom multilibs for RTEMS
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m528x/mcpu32/m68030/m68040/m68060/m5307/m5407/mcfv4e
+MULTILIB_OPTIONS += m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
-MULTILIB_MATCHES += m5200=m528x
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_MATCHES += m5200=m5206e
+MULTILIB_EXCEPTIONS = m68000/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_EXCEPTIONS += mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_EXCEPTIONS += m5200/m68881 m5200/msoft-float
+MULTILIB_EXCEPTIONS += m528x/m68881 m528x/msoft-float
+MULTILIB_EXCEPTIONS += m5307/m68881 m5307/msoft-float
+MULTILIB_EXCEPTIONS += m5407/m68881 m5407/msoft-float
+MULTILIB_EXCEPTIONS += mcfv4e/m68881 mcfv4e/msoft-float
diff -uNr gcc-4.2.2.orig/gcc/config/mips/elf.h gcc-4.2.2/gcc/config/mips/elf.h
--- gcc-4.2.2.orig/gcc/config/mips/elf.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.2/gcc/config/mips/elf.h 2007-11-27 18:50:47.000000000 +0100
@@ -48,6 +48,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
diff -uNr gcc-4.2.2.orig/gcc/gthr-rtems.h gcc-4.2.2/gcc/gthr-rtems.h
--- gcc-4.2.2.orig/gcc/gthr-rtems.h 2005-06-25 04:02:01.000000000 +0200
+++ gcc-4.2.2/gcc/gthr-rtems.h 2007-11-28 04:39:49.000000000 +0100
@@ -38,7 +38,6 @@
#define __GTHREADS 1
#define __GTHREAD_ONCE_INIT 0
-#define __GTHREAD_MUTEX_INIT 0
#define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION rtems_gxx_recursive_mutex_init

View File

@@ -0,0 +1,87 @@
diff -Naur gcc-4.2.3.orig/configure gcc-4.2.3/configure
--- gcc-4.2.3.orig/configure 2007-09-15 02:42:24.000000000 +0200
+++ gcc-4.2.3/configure 2008-05-08 06:07:51.000000000 +0200
@@ -1260,7 +1260,7 @@
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
;;
*-*-rtems*)
- noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libgloss ${libgcj}"
;;
# The tpf target doesn't support gdb yet.
*-*-tpf*)
diff -Naur gcc-4.2.3.orig/configure.in gcc-4.2.3/configure.in
--- gcc-4.2.3.orig/configure.in 2007-09-15 02:42:24.000000000 +0200
+++ gcc-4.2.3/configure.in 2008-05-08 06:07:51.000000000 +0200
@@ -420,7 +420,7 @@
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
;;
*-*-rtems*)
- noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-libiberty target-libgloss ${libgcj}"
;;
# The tpf target doesn't support gdb yet.
*-*-tpf*)
diff -Naur gcc-4.2.3.orig/gcc/config/arm/rtems-elf.h gcc-4.2.3/gcc/config/arm/rtems-elf.h
--- gcc-4.2.3.orig/gcc/config/arm/rtems-elf.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/arm/rtems-elf.h 2008-05-08 06:07:51.000000000 +0200
@@ -26,6 +26,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
+ builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -Naur gcc-4.2.3.orig/gcc/config/c4x/rtems.h gcc-4.2.3/gcc/config/c4x/rtems.h
--- gcc-4.2.3.orig/gcc/config/c4x/rtems.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/c4x/rtems.h 2008-05-08 06:07:51.000000000 +0200
@@ -23,6 +23,5 @@
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__rtems__"); \
- builtin_define ("__USE_INIT_FINI__"); \
builtin_assert ("system=rtems"); \
} while (0)
diff -Naur gcc-4.2.3.orig/gcc/config/m68k/t-rtems gcc-4.2.3/gcc/config/m68k/t-rtems
--- gcc-4.2.3.orig/gcc/config/m68k/t-rtems 2005-02-07 06:13:25.000000000 +0100
+++ gcc-4.2.3/gcc/config/m68k/t-rtems 2008-05-08 06:07:51.000000000 +0200
@@ -1,7 +1,14 @@
# Custom multilibs for RTEMS
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/m528x/mcpu32/m68030/m68040/m68060/m5307/m5407/mcfv4e
+MULTILIB_OPTIONS += m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
-MULTILIB_MATCHES += m5200=m528x
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_MATCHES += m5200=m5206e
+MULTILIB_EXCEPTIONS = m68000/msoft-float m68040/m68881 m68060/m68881
+MULTILIB_EXCEPTIONS += mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_EXCEPTIONS += m5200/m68881 m5200/msoft-float
+MULTILIB_EXCEPTIONS += m528x/m68881 m528x/msoft-float
+MULTILIB_EXCEPTIONS += m5307/m68881 m5307/msoft-float
+MULTILIB_EXCEPTIONS += m5407/m68881 m5407/msoft-float
+MULTILIB_EXCEPTIONS += mcfv4e/m68881 mcfv4e/msoft-float
diff -Naur gcc-4.2.3.orig/gcc/config/mips/elf.h gcc-4.2.3/gcc/config/mips/elf.h
--- gcc-4.2.3.orig/gcc/config/mips/elf.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/mips/elf.h 2008-05-08 06:07:51.000000000 +0200
@@ -48,6 +48,4 @@
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
-#define NO_IMPLICIT_EXTERN_C 1
-
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
diff -Naur gcc-4.2.3.orig/gcc/gthr-rtems.h gcc-4.2.3/gcc/gthr-rtems.h
--- gcc-4.2.3.orig/gcc/gthr-rtems.h 2005-06-25 04:02:01.000000000 +0200
+++ gcc-4.2.3/gcc/gthr-rtems.h 2008-05-08 06:07:51.000000000 +0200
@@ -38,7 +38,6 @@
#define __GTHREADS 1
#define __GTHREAD_ONCE_INIT 0
-#define __GTHREAD_MUTEX_INIT 0
#define __GTHREAD_MUTEX_INIT_FUNCTION rtems_gxx_mutex_init
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION rtems_gxx_recursive_mutex_init

View File

@@ -1,6 +1,6 @@
diff -Naur gdb-6.5.orig/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
diff -uNr gdb-6.5.orig/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
--- gdb-6.5.orig/bfd/sysdep.h 2005-05-05 20:51:14.000000000 +0200
+++ gdb-6.5/bfd/sysdep.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/bfd/sysdep.h 2007-11-14 13:49:35.000000000 +0100
@@ -135,7 +135,7 @@
#endif
@@ -10,9 +10,9 @@ diff -Naur gdb-6.5.orig/bfd/sysdep.h gdb-6.5/bfd/sysdep.h
#endif
#ifdef HAVE_FTELLO
diff -Naur gdb-6.5.orig/configure gdb-6.5/configure
diff -uNr gdb-6.5.orig/configure gdb-6.5/configure
--- gdb-6.5.orig/configure 2006-05-02 02:16:50.000000000 +0200
+++ gdb-6.5/configure 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/configure 2007-11-14 13:48:46.000000000 +0100
@@ -3648,7 +3648,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
@@ -22,9 +22,9 @@ diff -Naur gdb-6.5.orig/configure gdb-6.5/configure
:
else
MAKEINFO="$MISSING makeinfo"
diff -Naur gdb-6.5.orig/configure.in gdb-6.5/configure.in
diff -uNr gdb-6.5.orig/configure.in gdb-6.5/configure.in
--- gdb-6.5.orig/configure.in 2006-06-21 07:16:16.000000000 +0200
+++ gdb-6.5/configure.in 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/configure.in 2007-11-14 13:48:46.000000000 +0100
@@ -2217,7 +2217,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
@@ -34,9 +34,9 @@ diff -Naur gdb-6.5.orig/configure.in gdb-6.5/configure.in
:
else
MAKEINFO="$MISSING makeinfo"
diff -Naur gdb-6.5.orig/gdb/bfin-tdep.c gdb-6.5/gdb/bfin-tdep.c
diff -uNr gdb-6.5.orig/gdb/bfin-tdep.c gdb-6.5/gdb/bfin-tdep.c
--- gdb-6.5.orig/gdb/bfin-tdep.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/bfin-tdep.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/bfin-tdep.c 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,1341 @@
+/* Target-dependent code for Analog Devices Blackfin processer, for GDB.
+
@@ -1379,9 +1379,9 @@ diff -Naur gdb-6.5.orig/gdb/bfin-tdep.c gdb-6.5/gdb/bfin-tdep.c
+{
+ gdbarch_register (bfd_arch_bfin, bfin_gdbarch_init, bfin_dump_tdep);
+}
diff -Naur gdb-6.5.orig/gdb/bfin-tdep.h gdb-6.5/gdb/bfin-tdep.h
diff -uNr gdb-6.5.orig/gdb/bfin-tdep.h gdb-6.5/gdb/bfin-tdep.h
--- gdb-6.5.orig/gdb/bfin-tdep.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/bfin-tdep.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/bfin-tdep.h 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,180 @@
+/* Target-dependent code for Analog Devices Blackfin processer, for GDB.
+
@@ -1563,17 +1563,17 @@ diff -Naur gdb-6.5.orig/gdb/bfin-tdep.h gdb-6.5/gdb/bfin-tdep.h
+ for that function, if one exists. If no canonical descriptor could
+ be found, return 0. */
+CORE_ADDR bfin_fdpic_find_canonical_descriptor (CORE_ADDR entry_point);
diff -Naur gdb-6.5.orig/gdb/config/bfin/bfin.mt gdb-6.5/gdb/config/bfin/bfin.mt
diff -uNr gdb-6.5.orig/gdb/config/bfin/bfin.mt gdb-6.5/gdb/config/bfin/bfin.mt
--- gdb-6.5.orig/gdb/config/bfin/bfin.mt 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/config/bfin/bfin.mt 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/config/bfin/bfin.mt 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,4 @@
+TDEPFILES= bfin-tdep.o solib.o solib-bfin.o
+DEPRECATED_TM_FILE= solib.h
+SIM_OBS= remote-sim.o
+SIM= ../sim/bfin/libsim.a
diff -Naur gdb-6.5.orig/gdb/configure.tgt gdb-6.5/gdb/configure.tgt
diff -uNr gdb-6.5.orig/gdb/configure.tgt gdb-6.5/gdb/configure.tgt
--- gdb-6.5.orig/gdb/configure.tgt 2006-04-21 01:18:48.000000000 +0200
+++ gdb-6.5/gdb/configure.tgt 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/configure.tgt 2007-11-14 13:49:35.000000000 +0100
@@ -14,6 +14,7 @@
am33_2.0*) gdb_target_cpu=mn10300 ;;
arm*) gdb_target_cpu=arm ;;
@@ -1592,9 +1592,9 @@ diff -Naur gdb-6.5.orig/gdb/configure.tgt gdb-6.5/gdb/configure.tgt
cris*) gdb_target=cris ;;
# OBSOLETE d10v-*-*) gdb_target=d10v ;;
diff -Naur gdb-6.5.orig/gdb/gdbarch.c gdb-6.5/gdb/gdbarch.c
diff -uNr gdb-6.5.orig/gdb/gdbarch.c gdb-6.5/gdb/gdbarch.c
--- gdb-6.5.orig/gdb/gdbarch.c 2006-04-18 21:20:06.000000000 +0200
+++ gdb-6.5/gdb/gdbarch.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbarch.c 2007-11-14 13:49:35.000000000 +0100
@@ -235,6 +235,7 @@
gdbarch_register_reggroup_p_ftype *register_reggroup_p;
gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
@@ -1661,9 +1661,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbarch.c gdb-6.5/gdb/gdbarch.c
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff -Naur gdb-6.5.orig/gdb/gdbarch.h gdb-6.5/gdb/gdbarch.h
diff -uNr gdb-6.5.orig/gdb/gdbarch.h gdb-6.5/gdb/gdbarch.h
--- gdb-6.5.orig/gdb/gdbarch.h 2006-04-18 21:20:06.000000000 +0200
+++ gdb-6.5/gdb/gdbarch.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbarch.h 2007-11-14 13:49:35.000000000 +0100
@@ -1404,6 +1404,11 @@
extern const struct regset * gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size);
extern void set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, gdbarch_regset_from_core_section_ftype *regset_from_core_section);
@@ -1676,9 +1676,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbarch.h gdb-6.5/gdb/gdbarch.h
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff -Naur gdb-6.5.orig/gdb/gdbarch.sh gdb-6.5/gdb/gdbarch.sh
diff -uNr gdb-6.5.orig/gdb/gdbarch.sh gdb-6.5/gdb/gdbarch.sh
--- gdb-6.5.orig/gdb/gdbarch.sh 2006-04-18 21:20:06.000000000 +0200
+++ gdb-6.5/gdb/gdbarch.sh 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbarch.sh 2007-11-14 13:49:35.000000000 +0100
@@ -662,6 +662,8 @@
# Return the appropriate register set for a core file section with
# name SECT_NAME and size SECT_SIZE.
@@ -1688,9 +1688,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbarch.sh gdb-6.5/gdb/gdbarch.sh
EOF
}
diff -Naur gdb-6.5.orig/gdb/gdbserver/configure.srv gdb-6.5/gdb/gdbserver/configure.srv
diff -uNr gdb-6.5.orig/gdb/gdbserver/configure.srv gdb-6.5/gdb/gdbserver/configure.srv
--- gdb-6.5.orig/gdb/gdbserver/configure.srv 2006-05-09 17:21:19.000000000 +0200
+++ gdb-6.5/gdb/gdbserver/configure.srv 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbserver/configure.srv 2007-11-14 13:49:35.000000000 +0100
@@ -23,6 +23,11 @@
srv_linux_usrregs=yes
srv_linux_thread_db=yes
@@ -1703,9 +1703,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbserver/configure.srv gdb-6.5/gdb/gdbserver/config
crisv32-*-linux*) srv_regobj=reg-crisv32.o
srv_tgtobj="linux-low.o linux-crisv32-low.o"
srv_linux_regsets=yes
diff -Naur gdb-6.5.orig/gdb/gdbserver/linux-bfin-low.c gdb-6.5/gdb/gdbserver/linux-bfin-low.c
diff -uNr gdb-6.5.orig/gdb/gdbserver/linux-bfin-low.c gdb-6.5/gdb/gdbserver/linux-bfin-low.c
--- gdb-6.5.orig/gdb/gdbserver/linux-bfin-low.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/gdbserver/linux-bfin-low.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbserver/linux-bfin-low.c 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,101 @@
+/* GNU/Linux/BFIN specific low level interface, for the remote server for GDB.
+
@@ -1808,9 +1808,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbserver/linux-bfin-low.c gdb-6.5/gdb/gdbserver/lin
+ 0,
+ bfin_breakpoint_at,
+};
diff -Naur gdb-6.5.orig/gdb/gdbserver/Makefile.in gdb-6.5/gdb/gdbserver/Makefile.in
diff -uNr gdb-6.5.orig/gdb/gdbserver/Makefile.in gdb-6.5/gdb/gdbserver/Makefile.in
--- gdb-6.5.orig/gdb/gdbserver/Makefile.in 2006-03-15 17:26:02.000000000 +0100
+++ gdb-6.5/gdb/gdbserver/Makefile.in 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/gdbserver/Makefile.in 2007-11-14 13:49:35.000000000 +0100
@@ -119,9 +119,9 @@
$(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \
$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
@@ -1850,9 +1850,9 @@ diff -Naur gdb-6.5.orig/gdb/gdbserver/Makefile.in gdb-6.5/gdb/gdbserver/Makefile
reg-cris.o : reg-cris.c $(regdef_h)
reg-cris.c : $(srcdir)/../regformats/reg-cris.dat $(regdat_sh)
sh $(regdat_sh) $(srcdir)/../regformats/reg-cris.dat reg-cris.c
diff -Naur gdb-6.5.orig/gdb/Makefile.in gdb-6.5/gdb/Makefile.in
diff -uNr gdb-6.5.orig/gdb/Makefile.in gdb-6.5/gdb/Makefile.in
--- gdb-6.5.orig/gdb/Makefile.in 2006-05-12 22:53:15.000000000 +0200
+++ gdb-6.5/gdb/Makefile.in 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/Makefile.in 2007-11-14 13:49:35.000000000 +0100
@@ -581,6 +581,7 @@
elf_sh_h = $(INCLUDE_DIR)/elf/sh.h
elf_arm_h = $(INCLUDE_DIR)/elf/arm.h $(elf_reloc_macros_h)
@@ -1907,9 +1907,9 @@ diff -Naur gdb-6.5.orig/gdb/Makefile.in gdb-6.5/gdb/Makefile.in
solib-frv.o: solib-frv.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(gdbcore_h) $(solist_h) $(frv_tdep_h) $(objfiles_h) $(symtab_h) \
$(language_h) $(command_h) $(gdbcmd_h) $(elf_frv_h)
diff -Naur gdb-6.5.orig/gdb/regformats/reg-bfin.dat gdb-6.5/gdb/regformats/reg-bfin.dat
diff -uNr gdb-6.5.orig/gdb/regformats/reg-bfin.dat gdb-6.5/gdb/regformats/reg-bfin.dat
--- gdb-6.5.orig/gdb/regformats/reg-bfin.dat 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/regformats/reg-bfin.dat 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/regformats/reg-bfin.dat 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,63 @@
+name:bfin
+expedite:pc,sp,fp
@@ -1974,9 +1974,9 @@ diff -Naur gdb-6.5.orig/gdb/regformats/reg-bfin.dat gdb-6.5/gdb/regformats/reg-b
+32:fdpic_exec
+32:fdpic_interp
+32:ipend
diff -Naur gdb-6.5.orig/gdb/remote.c gdb-6.5/gdb/remote.c
diff -uNr gdb-6.5.orig/gdb/remote.c gdb-6.5/gdb/remote.c
--- gdb-6.5.orig/gdb/remote.c 2006-05-05 22:08:45.000000000 +0200
+++ gdb-6.5/gdb/remote.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/remote.c 2007-11-14 13:49:35.000000000 +0100
@@ -1912,7 +1912,9 @@
inferior_ptid = remote_current_thread (inferior_ptid);
@@ -1988,9 +1988,9 @@ diff -Naur gdb-6.5.orig/gdb/remote.c gdb-6.5/gdb/remote.c
putpkt ("?"); /* Initiate a query from remote machine. */
immediate_quit--;
diff -Naur gdb-6.5.orig/gdb/solib-bfin.c gdb-6.5/gdb/solib-bfin.c
diff -uNr gdb-6.5.orig/gdb/solib-bfin.c gdb-6.5/gdb/solib-bfin.c
--- gdb-6.5.orig/gdb/solib-bfin.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/solib-bfin.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/solib-bfin.c 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,1231 @@
+/* Handle Blackfin (FDPIC) shared libraries for GDB, the GNU Debugger.
+ Copyright 2006
@@ -3223,9 +3223,9 @@ diff -Naur gdb-6.5.orig/gdb/solib-bfin.c gdb-6.5/gdb/solib-bfin.c
+ NULL, /* FIXME: i18n: */
+ &setdebuglist, &showdebuglist);
+}
diff -Naur gdb-6.5.orig/gdb/testsuite/gdb.asm/asm-source.exp gdb-6.5/gdb/testsuite/gdb.asm/asm-source.exp
diff -uNr gdb-6.5.orig/gdb/testsuite/gdb.asm/asm-source.exp gdb-6.5/gdb/testsuite/gdb.asm/asm-source.exp
--- gdb-6.5.orig/gdb/testsuite/gdb.asm/asm-source.exp 2006-05-02 00:21:35.000000000 +0200
+++ gdb-6.5/gdb/testsuite/gdb.asm/asm-source.exp 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/testsuite/gdb.asm/asm-source.exp 2007-11-14 13:49:35.000000000 +0100
@@ -51,6 +51,15 @@
"xscale-*-*" {
set asm-arch arm
@@ -3242,9 +3242,9 @@ diff -Naur gdb-6.5.orig/gdb/testsuite/gdb.asm/asm-source.exp gdb-6.5/gdb/testsui
"d10v-*-*" {
set asm-arch d10v
}
diff -Naur gdb-6.5.orig/gdb/testsuite/gdb.asm/bfin.inc gdb-6.5/gdb/testsuite/gdb.asm/bfin.inc
diff -uNr gdb-6.5.orig/gdb/testsuite/gdb.asm/bfin.inc gdb-6.5/gdb/testsuite/gdb.asm/bfin.inc
--- gdb-6.5.orig/gdb/testsuite/gdb.asm/bfin.inc 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/gdb/testsuite/gdb.asm/bfin.inc 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/gdb/testsuite/gdb.asm/bfin.inc 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,44 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
@@ -3290,9 +3290,9 @@ diff -Naur gdb-6.5.orig/gdb/testsuite/gdb.asm/bfin.inc gdb-6.5/gdb/testsuite/gdb
+ .long \value
+ .endm
+
diff -Naur gdb-6.5.orig/include/gdb/sim-bfin.h gdb-6.5/include/gdb/sim-bfin.h
diff -uNr gdb-6.5.orig/include/gdb/sim-bfin.h gdb-6.5/include/gdb/sim-bfin.h
--- gdb-6.5.orig/include/gdb/sim-bfin.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/include/gdb/sim-bfin.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/include/gdb/sim-bfin.h 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,84 @@
+/* This file defines the interface between the Blackfin simulator and GDB.
+
@@ -3378,9 +3378,9 @@ diff -Naur gdb-6.5.orig/include/gdb/sim-bfin.h gdb-6.5/include/gdb/sim-bfin.h
+ SIM_BFIN_IPEND_REGNUM
+};
+
diff -Naur gdb-6.5.orig/sim/bfin/acconfig.h gdb-6.5/sim/bfin/acconfig.h
diff -uNr gdb-6.5.orig/sim/bfin/acconfig.h gdb-6.5/sim/bfin/acconfig.h
--- gdb-6.5.orig/sim/bfin/acconfig.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/acconfig.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/acconfig.h 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,15 @@
+
+/* Define to 1 if NLS is requested. */
@@ -3397,10 +3397,10 @@ diff -Naur gdb-6.5.orig/sim/bfin/acconfig.h gdb-6.5/sim/bfin/acconfig.h
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
diff -Naur gdb-6.5.orig/sim/bfin/bfin-dis.c gdb-6.5/sim/bfin/bfin-dis.c
diff -uNr gdb-6.5.orig/sim/bfin/bfin-dis.c gdb-6.5/sim/bfin/bfin-dis.c
--- gdb-6.5.orig/sim/bfin/bfin-dis.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/bfin-dis.c 2009-01-22 08:21:17.000000000 +0100
@@ -0,0 +1,3095 @@
+++ gdb-6.5/sim/bfin/bfin-dis.c 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,3088 @@
+/* Simulator for Analog Devices Blackfin processer.
+
+ Copyright (C) 2005 Free Software Foundation, Inc.
@@ -3431,13 +3431,6 @@ diff -Naur gdb-6.5.orig/sim/bfin/bfin-dis.c gdb-6.5/sim/bfin/bfin-dis.c
+#include "opcode/bfin.h"
+#include "bfin-sim.h"
+
+/* HACK: Work around mingw32 lacking SIGTRAP */
+#ifdef _WIN32
+#ifndef SIGTRAP
+#define SIGTRAP 5
+#endif
+#endif
+
+#define M_S2RND 1
+#define M_T 2
+#define M_W32 3
@@ -6496,9 +6489,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/bfin-dis.c gdb-6.5/sim/bfin/bfin-dis.c
+ for (i = 0; i < n_stores; i++)
+ *stores[i].addr = stores[i].val;
+}
diff -Naur gdb-6.5.orig/sim/bfin/bfin-sim.h gdb-6.5/sim/bfin/bfin-sim.h
diff -uNr gdb-6.5.orig/sim/bfin/bfin-sim.h gdb-6.5/sim/bfin/bfin-sim.h
--- gdb-6.5.orig/sim/bfin/bfin-sim.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/bfin-sim.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/bfin-sim.h 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,124 @@
+/* Simulator for Analog Devices Blackfin processer.
+
@@ -6624,9 +6617,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/bfin-sim.h gdb-6.5/sim/bfin/bfin-sim.h
+
+extern void interp_insn_bfin (bu32);
+
diff -Naur gdb-6.5.orig/sim/bfin/config.in gdb-6.5/sim/bfin/config.in
diff -uNr gdb-6.5.orig/sim/bfin/config.in gdb-6.5/sim/bfin/config.in
--- gdb-6.5.orig/sim/bfin/config.in 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/config.in 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/config.in 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,158 @@
+/* config.in. Generated automatically from configure.in by autoheader. */
+
@@ -6786,9 +6779,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/config.in gdb-6.5/sim/bfin/config.in
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
diff -Naur gdb-6.5.orig/sim/bfin/configure gdb-6.5/sim/bfin/configure
diff -uNr gdb-6.5.orig/sim/bfin/configure gdb-6.5/sim/bfin/configure
--- gdb-6.5.orig/sim/bfin/configure 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/configure 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/configure 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,8672 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
@@ -15462,9 +15455,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/configure gdb-6.5/sim/bfin/configure
+fi
+
+
diff -Naur gdb-6.5.orig/sim/bfin/configure.ac gdb-6.5/sim/bfin/configure.ac
diff -uNr gdb-6.5.orig/sim/bfin/configure.ac gdb-6.5/sim/bfin/configure.ac
--- gdb-6.5.orig/sim/bfin/configure.ac 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/configure.ac 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/configure.ac 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,12 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.59)dnl
@@ -15478,9 +15471,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/configure.ac gdb-6.5/sim/bfin/configure.ac
+AC_CHECK_HEADERS(unistd.h)
+
+SIM_AC_OUTPUT
diff -Naur gdb-6.5.orig/sim/bfin/interp.c gdb-6.5/sim/bfin/interp.c
diff -uNr gdb-6.5.orig/sim/bfin/interp.c gdb-6.5/sim/bfin/interp.c
--- gdb-6.5.orig/sim/bfin/interp.c 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/interp.c 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/interp.c 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,651 @@
+/* Simulator for Analog Devices Blackfin processer.
+
@@ -16133,9 +16126,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/interp.c gdb-6.5/sim/bfin/interp.c
+ return -1; // disables size checking in gdb
+}
+
diff -Naur gdb-6.5.orig/sim/bfin/Makefile.in gdb-6.5/sim/bfin/Makefile.in
diff -uNr gdb-6.5.orig/sim/bfin/Makefile.in gdb-6.5/sim/bfin/Makefile.in
--- gdb-6.5.orig/sim/bfin/Makefile.in 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/Makefile.in 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/Makefile.in 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,29 @@
+# Makefile template for Configure for the Blackfin simulator.
+# Copyright (C) 2005 Free Software Foundation, Inc.
@@ -16166,9 +16159,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/Makefile.in gdb-6.5/sim/bfin/Makefile.in
+
+interp.o: interp.c $(INCLUDE)
+bfin-dis.o: bfin-dis.c $(INCLUDE)
diff -Naur gdb-6.5.orig/sim/bfin/syscall.h gdb-6.5/sim/bfin/syscall.h
diff -uNr gdb-6.5.orig/sim/bfin/syscall.h gdb-6.5/sim/bfin/syscall.h
--- gdb-6.5.orig/sim/bfin/syscall.h 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.5/sim/bfin/syscall.h 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/bfin/syscall.h 2007-11-14 13:49:35.000000000 +0100
@@ -0,0 +1,41 @@
+/* This file is copied from newlib. Do not edit this alone. */
+
@@ -16211,9 +16204,9 @@ diff -Naur gdb-6.5.orig/sim/bfin/syscall.h gdb-6.5/sim/bfin/syscall.h
+
+#define SYS_utime 201
+#define SYS_wait 202
diff -Naur gdb-6.5.orig/sim/configure gdb-6.5/sim/configure
diff -uNr gdb-6.5.orig/sim/configure gdb-6.5/sim/configure
--- gdb-6.5.orig/sim/configure 2006-05-05 19:11:19.000000000 +0200
+++ gdb-6.5/sim/configure 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/configure 2007-11-14 13:49:35.000000000 +0100
@@ -273,6 +273,7 @@
ac_unique_file="Makefile.in"
@@ -16236,9 +16229,9 @@ diff -Naur gdb-6.5.orig/sim/configure gdb-6.5/sim/configure
cris-*-* | crisv32-*-*)
diff -Naur gdb-6.5.orig/sim/configure.ac gdb-6.5/sim/configure.ac
diff -uNr gdb-6.5.orig/sim/configure.ac gdb-6.5/sim/configure.ac
--- gdb-6.5.orig/sim/configure.ac 2006-05-05 19:11:19.000000000 +0200
+++ gdb-6.5/sim/configure.ac 2009-01-22 08:19:21.000000000 +0100
+++ gdb-6.5/sim/configure.ac 2007-11-14 13:49:35.000000000 +0100
@@ -52,6 +52,10 @@
testsuite=yes
common=yes

View File

@@ -1,6 +1,6 @@
diff -Naur gdb-6.6.orig/bfd/sysdep.h gdb-6.6/bfd/sysdep.h
diff -uNr gdb-6.6.orig/bfd/sysdep.h gdb-6.6/bfd/sysdep.h
--- gdb-6.6.orig/bfd/sysdep.h 2005-05-05 20:51:14.000000000 +0200
+++ gdb-6.6/bfd/sysdep.h 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/bfd/sysdep.h 2007-12-14 17:51:58.000000000 +0100
@@ -135,7 +135,7 @@
#endif
@@ -10,9 +10,9 @@ diff -Naur gdb-6.6.orig/bfd/sysdep.h gdb-6.6/bfd/sysdep.h
#endif
#ifdef HAVE_FTELLO
diff -Naur gdb-6.6.orig/configure gdb-6.6/configure
diff -uNr gdb-6.6.orig/configure gdb-6.6/configure
--- gdb-6.6.orig/configure 2006-11-15 00:26:39.000000000 +0100
+++ gdb-6.6/configure 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/configure 2007-12-14 17:51:58.000000000 +0100
@@ -3679,7 +3679,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
@@ -22,9 +22,9 @@ diff -Naur gdb-6.6.orig/configure gdb-6.6/configure
:
else
MAKEINFO="$MISSING makeinfo"
diff -Naur gdb-6.6.orig/configure.in gdb-6.6/configure.in
diff -uNr gdb-6.6.orig/configure.in gdb-6.6/configure.in
--- gdb-6.6.orig/configure.in 2006-12-18 08:22:58.000000000 +0100
+++ gdb-6.6/configure.in 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/configure.in 2007-12-14 17:51:58.000000000 +0100
@@ -2228,7 +2228,7 @@
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
@@ -34,9 +34,9 @@ diff -Naur gdb-6.6.orig/configure.in gdb-6.6/configure.in
:
else
MAKEINFO="$MISSING makeinfo"
diff -Naur gdb-6.6.orig/gdb/arch-utils.c gdb-6.6/gdb/arch-utils.c
diff -uNr gdb-6.6.orig/gdb/arch-utils.c gdb-6.6/gdb/arch-utils.c
--- gdb-6.6.orig/gdb/arch-utils.c 2006-11-10 20:20:35.000000000 +0100
+++ gdb-6.6/gdb/arch-utils.c 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/gdb/arch-utils.c 2007-12-14 17:51:58.000000000 +0100
@@ -349,6 +349,15 @@
};
static const char *set_endian_string;
@@ -53,9 +53,9 @@ diff -Naur gdb-6.6.orig/gdb/arch-utils.c gdb-6.6/gdb/arch-utils.c
/* Called by ``show endian''. */
static void
diff -Naur gdb-6.6.orig/gdb/arch-utils.h gdb-6.6/gdb/arch-utils.h
diff -uNr gdb-6.6.orig/gdb/arch-utils.h gdb-6.6/gdb/arch-utils.h
--- gdb-6.6.orig/gdb/arch-utils.h 2006-11-10 20:20:35.000000000 +0100
+++ gdb-6.6/gdb/arch-utils.h 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/gdb/arch-utils.h 2007-12-14 17:51:58.000000000 +0100
@@ -126,6 +126,10 @@
extern int legacy_register_sim_regno (int regnum);
@@ -67,9 +67,9 @@ diff -Naur gdb-6.6.orig/gdb/arch-utils.h gdb-6.6/gdb/arch-utils.h
/* Return the selected architecture's name, or NULL if no architecture
was explicitly selected. */
extern const char *selected_architecture_name (void);
diff -Naur gdb-6.6.orig/gdb/ChangeLog.rtems gdb-6.6/gdb/ChangeLog.rtems
diff -uNr gdb-6.6.orig/gdb/ChangeLog.rtems gdb-6.6/gdb/ChangeLog.rtems
--- gdb-6.6.orig/gdb/ChangeLog.rtems 1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.6/gdb/ChangeLog.rtems 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/gdb/ChangeLog.rtems 2007-12-14 17:51:58.000000000 +0100
@@ -0,0 +1,6 @@
+2007-02-08 Daniel Jacobowitz <dan@codesourcery.com>
+
@@ -77,9 +77,9 @@ diff -Naur gdb-6.6.orig/gdb/ChangeLog.rtems gdb-6.6/gdb/ChangeLog.rtems
+ * arch-utils.h (selected_byte_order): New prototype.
+ * remote-sim.c (gdbsim_open): Use selected_byte_order.
+
diff -Naur gdb-6.6.orig/gdb/memory-map.c gdb-6.6/gdb/memory-map.c
diff -uNr gdb-6.6.orig/gdb/memory-map.c gdb-6.6/gdb/memory-map.c
--- gdb-6.6.orig/gdb/memory-map.c 2006-10-05 21:42:31.000000000 +0200
+++ gdb-6.6/gdb/memory-map.c 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/gdb/memory-map.c 2007-12-14 17:51:58.000000000 +0100
@@ -141,10 +141,10 @@
{
if (strcmp (data->property_name, "blocksize") == 0)
@@ -92,9 +92,9 @@ diff -Naur gdb-6.6.orig/gdb/memory-map.c gdb-6.6/gdb/memory-map.c
data->currently_parsing->attrib.blocksize
= strtoul (data->character_data, &end, 0);
if (*end != '\0')
diff -Naur gdb-6.6.orig/gdb/remote-sim.c gdb-6.6/gdb/remote-sim.c
diff -uNr gdb-6.6.orig/gdb/remote-sim.c gdb-6.6/gdb/remote-sim.c
--- gdb-6.6.orig/gdb/remote-sim.c 2006-11-10 20:20:36.000000000 +0100
+++ gdb-6.6/gdb/remote-sim.c 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/gdb/remote-sim.c 2007-12-14 17:51:58.000000000 +0100
@@ -504,9 +504,9 @@
+ 50) /* slack */ ;
arg_buf = (char *) alloca (len);
@@ -108,21 +108,9 @@ diff -Naur gdb-6.6.orig/gdb/remote-sim.c gdb-6.6/gdb/remote-sim.c
{
case BFD_ENDIAN_BIG:
strcat (arg_buf, " -E big");
diff -Naur gdb-6.6.orig/sim/common/sim-signal.c gdb-6.6/sim/common/sim-signal.c
--- gdb-6.6.orig/sim/common/sim-signal.c 2005-11-29 03:43:06.000000000 +0100
+++ gdb-6.6/sim/common/sim-signal.c 2009-07-24 08:28:24.000000000 +0200
@@ -27,7 +27,7 @@
to not think the process has died (so it can be debugged at the point of
failure). */
-#ifdef _MSC_VER
+#ifdef _WIN32
#ifndef SIGTRAP
#define SIGTRAP 5
#endif
diff -Naur gdb-6.6.orig/sim/erc32/erc32.c gdb-6.6/sim/erc32/erc32.c
diff -uNr gdb-6.6.orig/sim/erc32/erc32.c gdb-6.6/sim/erc32/erc32.c
--- gdb-6.6.orig/sim/erc32/erc32.c 1999-04-16 03:35:00.000000000 +0200
+++ gdb-6.6/sim/erc32/erc32.c 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/sim/erc32/erc32.c 2007-12-14 17:51:58.000000000 +0100
@@ -413,7 +413,7 @@
if (rom8) mec_memcfg &= ~0x20000;
else mec_memcfg |= 0x20000;
@@ -132,9 +120,9 @@ diff -Naur gdb-6.6.orig/sim/erc32/erc32.c gdb-6.6/sim/erc32/erc32.c
mem_romsz = (128 * 1024) << ((mec_memcfg >> 18) & 7);
if (sparclite_board) {
diff -Naur gdb-6.6.orig/sim/erc32/exec.c gdb-6.6/sim/erc32/exec.c
diff -uNr gdb-6.6.orig/sim/erc32/exec.c gdb-6.6/sim/erc32/exec.c
--- gdb-6.6.orig/sim/erc32/exec.c 2005-03-07 12:09:05.000000000 +0100
+++ gdb-6.6/sim/erc32/exec.c 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/sim/erc32/exec.c 2007-12-14 17:51:58.000000000 +0100
@@ -1713,7 +1713,7 @@
sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
@@ -153,9 +141,9 @@ diff -Naur gdb-6.6.orig/sim/erc32/exec.c gdb-6.6/sim/erc32/exec.c
}
#endif
if (sregs->fpstate == FP_EXC_PE) {
diff -Naur gdb-6.6.orig/sim/ppc/ppc-instructions gdb-6.6/sim/ppc/ppc-instructions
diff -uNr gdb-6.6.orig/sim/ppc/ppc-instructions gdb-6.6/sim/ppc/ppc-instructions
--- gdb-6.6.orig/sim/ppc/ppc-instructions 2006-11-29 16:25:26.000000000 +0100
+++ gdb-6.6/sim/ppc/ppc-instructions 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/sim/ppc/ppc-instructions 2007-12-14 17:52:11.000000000 +0100
@@ -3402,6 +3402,14 @@
case spr_dec:
*rT = cpu_get_decrementer(processor);
@@ -171,9 +159,9 @@ diff -Naur gdb-6.6.orig/sim/ppc/ppc-instructions gdb-6.6/sim/ppc/ppc-instruction
case spr_tbu:
case spr_tbl:
/* NOTE - these SPR's are not readable. Use mftb[ul] */
diff -Naur gdb-6.6.orig/sim/ppc/ppc-spr-table gdb-6.6/sim/ppc/ppc-spr-table
diff -uNr gdb-6.6.orig/sim/ppc/ppc-spr-table gdb-6.6/sim/ppc/ppc-spr-table
--- gdb-6.6.orig/sim/ppc/ppc-spr-table 2003-06-22 18:48:12.000000000 +0200
+++ gdb-6.6/sim/ppc/ppc-spr-table 2009-07-24 08:13:48.000000000 +0200
+++ gdb-6.6/sim/ppc/ppc-spr-table 2007-12-14 17:52:11.000000000 +0100
@@ -32,6 +32,8 @@
SRR0:26:0:0
SRR1:27:0:0

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More