summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2005-04-14 13:55:57 +0200
committerMichael Brown2005-04-14 13:55:57 +0200
commit44c7cc8c1263c32fcad6f4b326666b4020222c21 (patch)
treea229e0ed7f8a52f7c2e7f2e4928820cc3c9a8035 /src
parentcompiler.h is now always included on the command line. (diff)
downloadipxe-44c7cc8c1263c32fcad6f4b326666b4020222c21.tar.gz
ipxe-44c7cc8c1263c32fcad6f4b326666b4020222c21.tar.xz
ipxe-44c7cc8c1263c32fcad6f4b326666b4020222c21.zip
Standardised debug mechanism in place now.
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/core/pci_io.c7
-rw-r--r--src/arch/i386/core/pic8259.c6
-rw-r--r--src/arch/i386/core/relocate.c7
-rw-r--r--src/arch/i386/drivers/net/undi.c1
-rw-r--r--src/arch/i386/firmware/pcbios/basemem.c7
-rw-r--r--src/core/pxe_export.c1
-rw-r--r--src/drivers/bus/eisa.c9
-rw-r--r--src/drivers/bus/mca.c9
-rw-r--r--src/drivers/bus/pci.c7
-rw-r--r--src/drivers/net/mtd80x.c30
10 files changed, 14 insertions, 70 deletions
diff --git a/src/arch/i386/core/pci_io.c b/src/arch/i386/core/pci_io.c
index acc396cf..ffbf53c5 100644
--- a/src/arch/i386/core/pci_io.c
+++ b/src/arch/i386/core/pci_io.c
@@ -18,13 +18,6 @@
#include "realmode.h"
#endif
-#undef DBG
-#ifdef DEBUG_PCI_IO
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/* Macros for direct PCI access */
#define CONFIG_ADDRESS 0xcf8
#define CONFIG_DATA 0xcfc
diff --git a/src/arch/i386/core/pic8259.c b/src/arch/i386/core/pic8259.c
index cc2071fc..5c00deed 100644
--- a/src/arch/i386/core/pic8259.c
+++ b/src/arch/i386/core/pic8259.c
@@ -8,12 +8,6 @@
#include "pic8259.h"
#include "realmode.h"
-#ifdef DEBUG_IRQ
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/* State of trivial IRQ handler */
irq_t trivial_irq_installed_on = IRQ_NONE;
static uint16_t trivial_irq_previous_trigger_count = 0;
diff --git a/src/arch/i386/core/relocate.c b/src/arch/i386/core/relocate.c
index 3a2702a1..834bc788 100644
--- a/src/arch/i386/core/relocate.c
+++ b/src/arch/i386/core/relocate.c
@@ -42,13 +42,6 @@ extern char _end[];
extern struct post_reloc_fn post_reloc_fns[];
extern struct post_reloc_fn post_reloc_fns_end[];
-#undef DBG
-#ifdef DEBUG_RELOCATE
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
static void relocate ( void ) {
unsigned long addr, eaddr, size;
unsigned i;
diff --git a/src/arch/i386/drivers/net/undi.c b/src/arch/i386/drivers/net/undi.c
index 0bc0d23c..a8d1741a 100644
--- a/src/arch/i386/drivers/net/undi.c
+++ b/src/arch/i386/drivers/net/undi.c
@@ -207,6 +207,7 @@ static void shoot_targets ( firing_squad_lineup_t *lineup ) {
/* Debug macros
*/
+#undef DBG
#ifdef TRACE_UNDI
#define DBG(...) printf ( __VA_ARGS__ )
#else
diff --git a/src/arch/i386/firmware/pcbios/basemem.c b/src/arch/i386/firmware/pcbios/basemem.c
index 07b5cc81..1d900b78 100644
--- a/src/arch/i386/firmware/pcbios/basemem.c
+++ b/src/arch/i386/firmware/pcbios/basemem.c
@@ -25,13 +25,6 @@
/* Local prototypes */
static void free_unused_base_memory ( void );
-#undef DBG
-#ifdef DEBUG_BASEMEM
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/*
* Return amount of free base memory in bytes
*
diff --git a/src/core/pxe_export.c b/src/core/pxe_export.c
index 991c3786..f1f7c5e3 100644
--- a/src/core/pxe_export.c
+++ b/src/core/pxe_export.c
@@ -35,6 +35,7 @@
#include "cpu.h"
#include "timer.h"
+#undef DBG
#if TRACE_PXE
#define DBG(...) printf ( __VA_ARGS__ )
#else
diff --git a/src/drivers/bus/eisa.c b/src/drivers/bus/eisa.c
index c80974a8..29d1d83d 100644
--- a/src/drivers/bus/eisa.c
+++ b/src/drivers/bus/eisa.c
@@ -4,15 +4,6 @@
#include "timer.h"
#include "eisa.h"
-#define DEBUG_EISA
-
-#undef DBG
-#ifdef DEBUG_EISA
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/*
* Ensure that there is sufficient space in the shared dev_bus
* structure for a struct pci_device.
diff --git a/src/drivers/bus/mca.c b/src/drivers/bus/mca.c
index 1715c588..1d20a665 100644
--- a/src/drivers/bus/mca.c
+++ b/src/drivers/bus/mca.c
@@ -10,15 +10,6 @@
#include "io.h"
#include "mca.h"
-#define DEBUG_MCA
-
-#undef DBG
-#ifdef DEBUG_MCA
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/*
* Ensure that there is sufficient space in the shared dev_bus
* structure for a struct pci_device.
diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c
index d23a647a..034ef114 100644
--- a/src/drivers/bus/pci.c
+++ b/src/drivers/bus/pci.c
@@ -2,13 +2,6 @@
#include "dev.h"
#include "pci.h"
-#undef DBG
-#ifdef DEBUG_PCI
-#define DBG(...) printf ( __VA_ARGS__ )
-#else
-#define DBG(...)
-#endif
-
/*
* Ensure that there is sufficient space in the shared dev_bus
* structure for a struct pci_device.
diff --git a/src/drivers/net/mtd80x.c b/src/drivers/net/mtd80x.c
index 234922c0..db6e8273 100644
--- a/src/drivers/net/mtd80x.c
+++ b/src/drivers/net/mtd80x.c
@@ -30,12 +30,6 @@
/* to get the PCI support functions, if this is a PCI NIC */
#include "pci.h"
-#if 0
-#define DBGPRNT( x ) printf x
-#else
-#define DBGPRNT( x )
-#endif
-
typedef unsigned char u8;
typedef signed char s8;
typedef unsigned short u16;
@@ -518,10 +512,10 @@ static void mtd_reset(struct nic *nic)
{
char* texts[]={"half","full","10","100","1000"};
getlinktype(nic);
- DBGPRNT(("Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] ));
+ DBG(("Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] ));
} else
{
- DBGPRNT(("No link!!!\n"));
+ DBG(("No link!!!\n"));
}
mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
@@ -563,8 +557,8 @@ static int mtd_poll(struct nic *nic, int retrieve)
/* Omit the four octet CRC from the length. */
short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;
- DBGPRNT(( " netdev_rx() normal Rx pkt length %d"
- " status %x.\n", pkt_len, rx_status));
+ DBG(( " netdev_rx() normal Rx pkt length %d"
+ " status %x.\n", pkt_len, rx_status));
nic->packetlen = pkt_len;
memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
@@ -630,7 +624,7 @@ static void mtd_transmit(
tx_status = mtdx.tx_ring[0].status;
if (currticks() >= to){
- DBGPRNT(("TX Time Out"));
+ DBG(("TX Time Out"));
} else if( tx_status & (CSL | LC | EC | UDF | HF)){
printf("Transmit error: %s %s %s %s %s.\n",
tx_status,
@@ -644,7 +638,7 @@ static void mtd_transmit(
/*hex_dump( txb, size );*/
/*pause();*/
- DBGPRNT(("TRANSMIT\n"));
+ DBG(("TRANSMIT\n"));
}
/**************************************************************************
@@ -656,7 +650,7 @@ static void mtd_disable ( struct nic *nic ) {
outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
/* Reset the chip to erase previous misconfiguration. */
mtd_reset(nic);
- DBGPRNT(("DISABLE\n"));
+ DBG(("DISABLE\n"));
}
static struct nic_operations mtd_operations = {
@@ -708,7 +702,7 @@ static int mtd_probe ( struct dev *dev ) {
return 0;
}
- DBGPRNT(("%s : ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr));
+ DBG(("%s : ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr));
/* Reset the chip to erase previous misconfiguration. */
outl(0x00000001, mtdx.ioaddr + BCR);
@@ -725,8 +719,8 @@ static int mtd_probe ( struct dev *dev ) {
if (mii_status != 0xffff && mii_status != 0x0000) {
mtdx.phys[phy_idx] = phy;
- DBGPRNT(("%s: MII PHY found at address %d, status "
- "0x%4.4x.\n", mtdx.nic_name, phy, mii_status));
+ DBG(("%s: MII PHY found at address %d, status "
+ "0x%4.4x.\n", mtdx.nic_name, phy, mii_status));
/* get phy type */
{
unsigned int data;
@@ -759,10 +753,10 @@ static int mtd_probe ( struct dev *dev ) {
/* get phy type */
if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
mtdx.PHYType = MysonPHY;
- DBGPRNT(("MysonPHY\n"));
+ DBG(("MysonPHY\n"));
} else {
mtdx.PHYType = OtherPHY;
- DBGPRNT(("OtherPHY\n"));
+ DBG(("OtherPHY\n"));
}
}