Переглянути джерело

Standardised debug mechanism in place now.

tags/v0.9.3
Michael Brown 19 роки тому
джерело
коміт
44c7cc8c12

+ 0
- 7
src/arch/i386/core/pci_io.c Переглянути файл

18
 #include "realmode.h"
18
 #include "realmode.h"
19
 #endif
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
 /* Macros for direct PCI access */
21
 /* Macros for direct PCI access */
29
 #define CONFIG_ADDRESS	0xcf8
22
 #define CONFIG_ADDRESS	0xcf8
30
 #define CONFIG_DATA	0xcfc
23
 #define CONFIG_DATA	0xcfc

+ 0
- 6
src/arch/i386/core/pic8259.c Переглянути файл

8
 #include "pic8259.h"
8
 #include "pic8259.h"
9
 #include "realmode.h"
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
 /* State of trivial IRQ handler */
11
 /* State of trivial IRQ handler */
18
 irq_t trivial_irq_installed_on = IRQ_NONE;
12
 irq_t trivial_irq_installed_on = IRQ_NONE;
19
 static uint16_t trivial_irq_previous_trigger_count = 0;
13
 static uint16_t trivial_irq_previous_trigger_count = 0;

+ 0
- 7
src/arch/i386/core/relocate.c Переглянути файл

42
 extern struct post_reloc_fn post_reloc_fns[];
42
 extern struct post_reloc_fn post_reloc_fns[];
43
 extern struct post_reloc_fn post_reloc_fns_end[];
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
 static void relocate ( void ) {
45
 static void relocate ( void ) {
53
 	unsigned long addr, eaddr, size;
46
 	unsigned long addr, eaddr, size;
54
 	unsigned i;
47
 	unsigned i;

+ 1
- 0
src/arch/i386/drivers/net/undi.c Переглянути файл

207
 /* Debug macros
207
 /* Debug macros
208
  */
208
  */
209
 
209
 
210
+#undef DBG
210
 #ifdef TRACE_UNDI
211
 #ifdef TRACE_UNDI
211
 #define DBG(...) printf ( __VA_ARGS__ )
212
 #define DBG(...) printf ( __VA_ARGS__ )
212
 #else
213
 #else

+ 0
- 7
src/arch/i386/firmware/pcbios/basemem.c Переглянути файл

25
 /* Local prototypes */
25
 /* Local prototypes */
26
 static void free_unused_base_memory ( void );
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
  * Return amount of free base memory in bytes
29
  * Return amount of free base memory in bytes
37
  *
30
  *

+ 1
- 0
src/core/pxe_export.c Переглянути файл

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

+ 0
- 9
src/drivers/bus/eisa.c Переглянути файл

4
 #include "timer.h"
4
 #include "timer.h"
5
 #include "eisa.h"
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
  * Ensure that there is sufficient space in the shared dev_bus
8
  * Ensure that there is sufficient space in the shared dev_bus
18
  * structure for a struct pci_device.
9
  * structure for a struct pci_device.

+ 0
- 9
src/drivers/bus/mca.c Переглянути файл

10
 #include "io.h"
10
 #include "io.h"
11
 #include "mca.h"
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
  * Ensure that there is sufficient space in the shared dev_bus
14
  * Ensure that there is sufficient space in the shared dev_bus
24
  * structure for a struct pci_device.
15
  * structure for a struct pci_device.

+ 0
- 7
src/drivers/bus/pci.c Переглянути файл

2
 #include "dev.h"
2
 #include "dev.h"
3
 #include "pci.h"
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
  * Ensure that there is sufficient space in the shared dev_bus
6
  * Ensure that there is sufficient space in the shared dev_bus
14
  * structure for a struct pci_device.
7
  * structure for a struct pci_device.

+ 12
- 18
src/drivers/net/mtd80x.c Переглянути файл

30
 /* to get the PCI support functions, if this is a PCI NIC */
30
 /* to get the PCI support functions, if this is a PCI NIC */
31
 #include "pci.h"
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
 typedef unsigned char u8;
33
 typedef unsigned char u8;
40
 typedef signed char s8;
34
 typedef signed char s8;
41
 typedef unsigned short u16;
35
 typedef unsigned short u16;
518
     {
512
     {
519
         char* texts[]={"half","full","10","100","1000"};
513
         char* texts[]={"half","full","10","100","1000"};
520
         getlinktype(nic);
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
     } else
516
     } else
523
     {
517
     {
524
-        DBGPRNT(("No link!!!\n"));
518
+        DBG(("No link!!!\n"));
525
     }
519
     }
526
 
520
 
527
     mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
521
     mtdx.crvalue |= /*TxEnable |*/ RxEnable | TxThreshold;
563
         /* Omit the four octet CRC from the length. */
557
         /* Omit the four octet CRC from the length. */
564
         short pkt_len = ((rx_status & FLNGMASK) >> FLNGShift) - 4;
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
         nic->packetlen = pkt_len;
563
         nic->packetlen = pkt_len;
570
         memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
564
         memcpy(nic->packet, mtdx.cur_rx->skbuff, pkt_len);
630
 
624
 
631
     tx_status = mtdx.tx_ring[0].status;
625
     tx_status = mtdx.tx_ring[0].status;
632
     if (currticks() >= to){
626
     if (currticks() >= to){
633
-        DBGPRNT(("TX Time Out"));
627
+        DBG(("TX Time Out"));
634
     } else if( tx_status & (CSL | LC | EC | UDF | HF)){
628
     } else if( tx_status & (CSL | LC | EC | UDF | HF)){
635
         printf("Transmit error: %s %s %s %s %s.\n",
629
         printf("Transmit error: %s %s %s %s %s.\n",
636
                tx_status,
630
                tx_status,
644
     /*hex_dump( txb, size );*/
638
     /*hex_dump( txb, size );*/
645
     /*pause();*/
639
     /*pause();*/
646
 
640
 
647
-    DBGPRNT(("TRANSMIT\n"));
641
+    DBG(("TRANSMIT\n"));
648
 }
642
 }
649
 
643
 
650
 /**************************************************************************
644
 /**************************************************************************
656
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
650
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
657
     /* Reset the chip to erase previous misconfiguration. */
651
     /* Reset the chip to erase previous misconfiguration. */
658
     mtd_reset(nic);
652
     mtd_reset(nic);
659
-    DBGPRNT(("DISABLE\n"));
653
+    DBG(("DISABLE\n"));
660
 }
654
 }
661
 
655
 
662
 static struct nic_operations mtd_operations = {
656
 static struct nic_operations mtd_operations = {
708
         return 0;
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
     /* Reset the chip to erase previous misconfiguration. */
707
     /* Reset the chip to erase previous misconfiguration. */
714
     outl(0x00000001, mtdx.ioaddr + BCR);
708
     outl(0x00000001, mtdx.ioaddr + BCR);
725
             if (mii_status != 0xffff && mii_status != 0x0000) {
719
             if (mii_status != 0xffff && mii_status != 0x0000) {
726
                 mtdx.phys[phy_idx] = phy;
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
                 /* get phy type */
724
                 /* get phy type */
731
                 {
725
                 {
732
                     unsigned int data;
726
                     unsigned int data;
759
         /* get phy type */
753
         /* get phy type */
760
         if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
754
         if (inl(mtdx.ioaddr + PHYIDENTIFIER) == MysonPHYID ) {
761
             mtdx.PHYType = MysonPHY;
755
             mtdx.PHYType = MysonPHY;
762
-            DBGPRNT(("MysonPHY\n"));
756
+            DBG(("MysonPHY\n"));
763
         } else {
757
         } else {
764
             mtdx.PHYType = OtherPHY;
758
             mtdx.PHYType = OtherPHY;
765
-            DBGPRNT(("OtherPHY\n"));
759
+            DBG(("OtherPHY\n"));
766
         }
760
         }
767
     }
761
     }
768
 
762
 

Завантаження…
Відмінити
Зберегти