瀏覽代碼

Standardised debug mechanism in place now.

tags/v0.9.3
Michael Brown 19 年之前
父節點
當前提交
44c7cc8c12

+ 0
- 7
src/arch/i386/core/pci_io.c 查看文件

@@ -18,13 +18,6 @@
18 18
 #include "realmode.h"
19 19
 #endif
20 20
 
21
-#undef DBG
22
-#ifdef DEBUG_PCI_IO
23
-#define DBG(...) printf ( __VA_ARGS__ )
24
-#else
25
-#define DBG(...)
26
-#endif
27
-
28 21
 /* Macros for direct PCI access */
29 22
 #define CONFIG_ADDRESS	0xcf8
30 23
 #define CONFIG_DATA	0xcfc

+ 0
- 6
src/arch/i386/core/pic8259.c 查看文件

@@ -8,12 +8,6 @@
8 8
 #include "pic8259.h"
9 9
 #include "realmode.h"
10 10
 
11
-#ifdef DEBUG_IRQ
12
-#define DBG(...) printf ( __VA_ARGS__ )
13
-#else
14
-#define DBG(...)
15
-#endif
16
-
17 11
 /* State of trivial IRQ handler */
18 12
 irq_t trivial_irq_installed_on = IRQ_NONE;
19 13
 static uint16_t trivial_irq_previous_trigger_count = 0;

+ 0
- 7
src/arch/i386/core/relocate.c 查看文件

@@ -42,13 +42,6 @@ extern char _end[];
42 42
 extern struct post_reloc_fn post_reloc_fns[];
43 43
 extern struct post_reloc_fn post_reloc_fns_end[];
44 44
 
45
-#undef DBG
46
-#ifdef DEBUG_RELOCATE
47
-#define DBG(...) printf ( __VA_ARGS__ )
48
-#else
49
-#define DBG(...)
50
-#endif
51
-
52 45
 static void relocate ( void ) {
53 46
 	unsigned long addr, eaddr, size;
54 47
 	unsigned i;

+ 1
- 0
src/arch/i386/drivers/net/undi.c 查看文件

@@ -207,6 +207,7 @@ static void shoot_targets ( firing_squad_lineup_t *lineup ) {
207 207
 /* Debug macros
208 208
  */
209 209
 
210
+#undef DBG
210 211
 #ifdef TRACE_UNDI
211 212
 #define DBG(...) printf ( __VA_ARGS__ )
212 213
 #else

+ 0
- 7
src/arch/i386/firmware/pcbios/basemem.c 查看文件

@@ -25,13 +25,6 @@
25 25
 /* Local prototypes */
26 26
 static void free_unused_base_memory ( void );
27 27
 
28
-#undef DBG
29
-#ifdef DEBUG_BASEMEM
30
-#define DBG(...) printf ( __VA_ARGS__ )
31
-#else
32
-#define DBG(...)
33
-#endif
34
-
35 28
 /*
36 29
  * Return amount of free base memory in bytes
37 30
  *

+ 1
- 0
src/core/pxe_export.c 查看文件

@@ -35,6 +35,7 @@
35 35
 #include "cpu.h"
36 36
 #include "timer.h"
37 37
 
38
+#undef DBG
38 39
 #if TRACE_PXE
39 40
 #define DBG(...) printf ( __VA_ARGS__ )
40 41
 #else

+ 0
- 9
src/drivers/bus/eisa.c 查看文件

@@ -4,15 +4,6 @@
4 4
 #include "timer.h"
5 5
 #include "eisa.h"
6 6
 
7
-#define DEBUG_EISA
8
-
9
-#undef DBG
10
-#ifdef DEBUG_EISA
11
-#define DBG(...) printf ( __VA_ARGS__ )
12
-#else
13
-#define DBG(...)
14
-#endif
15
-
16 7
 /*
17 8
  * Ensure that there is sufficient space in the shared dev_bus
18 9
  * structure for a struct pci_device.

+ 0
- 9
src/drivers/bus/mca.c 查看文件

@@ -10,15 +10,6 @@
10 10
 #include "io.h"
11 11
 #include "mca.h"
12 12
 
13
-#define DEBUG_MCA
14
-
15
-#undef DBG
16
-#ifdef DEBUG_MCA
17
-#define DBG(...) printf ( __VA_ARGS__ )
18
-#else
19
-#define DBG(...)
20
-#endif
21
-
22 13
 /*
23 14
  * Ensure that there is sufficient space in the shared dev_bus
24 15
  * structure for a struct pci_device.

+ 0
- 7
src/drivers/bus/pci.c 查看文件

@@ -2,13 +2,6 @@
2 2
 #include "dev.h"
3 3
 #include "pci.h"
4 4
 
5
-#undef DBG
6
-#ifdef DEBUG_PCI
7
-#define DBG(...) printf ( __VA_ARGS__ )
8
-#else
9
-#define DBG(...)
10
-#endif
11
-
12 5
 /*
13 6
  * Ensure that there is sufficient space in the shared dev_bus
14 7
  * structure for a struct pci_device.

+ 12
- 18
src/drivers/net/mtd80x.c 查看文件

@@ -30,12 +30,6 @@
30 30
 /* to get the PCI support functions, if this is a PCI NIC */
31 31
 #include "pci.h"
32 32
 
33
-#if 0
34
-#define DBGPRNT( x ) printf x
35
-#else
36
-#define DBGPRNT( x )
37
-#endif
38
-
39 33
 typedef unsigned char u8;
40 34
 typedef signed char s8;
41 35
 typedef unsigned short u16;
@@ -518,10 +512,10 @@ static void mtd_reset(struct nic *nic)
518 512
     {
519 513
         char* texts[]={"half","full","10","100","1000"};
520 514
         getlinktype(nic);
521
-        DBGPRNT(("Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] ));
515
+        DBG(("Link is OK : %s %s\n", texts[mtdx.duplexmode-1], texts[mtdx.line_speed+1] ));
522 516
     } else
523 517
     {
524
-        DBGPRNT(("No link!!!\n"));
518
+        DBG(("No link!!!\n"));
525 519
     }
526 520
 
527 521
     mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
@@ -563,8 +557,8 @@ static int mtd_poll(struct nic *nic, int retrieve)
563 557
         /* Omit the four octet CRC from the length. */
564 558
         short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;
565 559
 
566
-        DBGPRNT(( "  netdev_rx() normal Rx pkt length %d"
567
-                  " status %x.\n", pkt_len, rx_status));
560
+        DBG(( "  netdev_rx() normal Rx pkt length %d"
561
+	      " status %x.\n", pkt_len, rx_status));
568 562
 
569 563
         nic->packetlen = pkt_len;
570 564
         memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
@@ -630,7 +624,7 @@ static void mtd_transmit(
630 624
 
631 625
     tx_status = mtdx.tx_ring[0].status;
632 626
     if (currticks() >= to){
633
-        DBGPRNT(("TX Time Out"));
627
+        DBG(("TX Time Out"));
634 628
     } else if( tx_status & (CSL | LC | EC | UDF | HF)){
635 629
         printf("Transmit error: %s %s %s %s %s.\n",
636 630
                tx_status,
@@ -644,7 +638,7 @@ static void mtd_transmit(
644 638
     /*hex_dump( txb, size );*/
645 639
     /*pause();*/
646 640
 
647
-    DBGPRNT(("TRANSMIT\n"));
641
+    DBG(("TRANSMIT\n"));
648 642
 }
649 643
 
650 644
 /**************************************************************************
@@ -656,7 +650,7 @@ static void mtd_disable ( struct nic *nic ) {
656 650
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
657 651
     /* Reset the chip to erase previous misconfiguration. */
658 652
     mtd_reset(nic);
659
-    DBGPRNT(("DISABLE\n"));
653
+    DBG(("DISABLE\n"));
660 654
 }
661 655
 
662 656
 static struct nic_operations mtd_operations = {
@@ -708,7 +702,7 @@ static int mtd_probe ( struct dev *dev ) {
708 702
         return 0;
709 703
     }
710 704
 
711
-    DBGPRNT(("%s : ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr));
705
+    DBG(("%s : ioaddr %#hX, addr %!\n",mtdx.nic_name, mtdx.ioaddr, nic->node_addr));
712 706
 
713 707
     /* Reset the chip to erase previous misconfiguration. */
714 708
     outl(0x00000001, mtdx.ioaddr + BCR);
@@ -725,8 +719,8 @@ static int mtd_probe ( struct dev *dev ) {
725 719
             if (mii_status != 0xffff && mii_status != 0x0000) {
726 720
                 mtdx.phys[phy_idx] = phy;
727 721
 
728
-                DBGPRNT(("%s: MII PHY found at address %d, status "
729
-                         "0x%4.4x.\n", mtdx.nic_name, phy, mii_status));
722
+                DBG(("%s: MII PHY found at address %d, status "
723
+		     "0x%4.4x.\n", mtdx.nic_name, phy, mii_status));
730 724
                 /* get phy type */
731 725
                 {
732 726
                     unsigned int data;
@@ -759,10 +753,10 @@ static int mtd_probe ( struct dev *dev ) {
759 753
         /* get phy type */
760 754
         if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
761 755
             mtdx.PHYType = MysonPHY;
762
-            DBGPRNT(("MysonPHY\n"));
756
+            DBG(("MysonPHY\n"));
763 757
         } else {
764 758
             mtdx.PHYType = OtherPHY;
765
-            DBGPRNT(("OtherPHY\n"));
759
+            DBG(("OtherPHY\n"));
766 760
         }
767 761
     }
768 762
 

Loading…
取消
儲存