Ticket #832: pcx86-fixes.diff

File pcx86-fixes.diff, 4.3 KB (added by strauman, on 12/03/06 at 13:31:12)

pcx86-fixes.diff

Line 
1Index: c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
2===================================================================
3RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S,v
4retrieving revision 1.1.1.4
5retrieving revision 1.2
6diff -c -r1.1.1.4 -r1.2
7*** c/src/lib/libbsp/i386/pc386/startup/ldsegs.S        27 Feb 2004 02:56:16 -0000      1.1.1.4
8--- c/src/lib/libbsp/i386/pc386/startup/ldsegs.S        4 Oct 2005 03:24:00 -0000       1.2
9***************
10*** 187,192 ****
11--- 187,193 ----
12  | GDT itself
13  +--------------------------------------------------------------------------*/
14 
15+ BEGIN_DATA
16        .p2align 4
17               
18        PUBLIC (_Global_descriptor_table)
19***************
20*** 216,222 ****
21  /*---------------------------------------------------------------------------+
22  | IDT itself
23  +---------------------------------------------------------------------------*/
24- BEGIN_DATA
25        .p2align 4
26       
27        PUBLIC(Interrupt_descriptor_table)
28--- 217,222 ----
29***************
30*** 224,241 ****
31        .rept 256
32        .word 0,0,0,0
33        .endr
34- END_DATA
35               
36  /*---------------------------------------------------------------------------+
37  | Descriptor of IDT
38  +--------------------------------------------------------------------------*/
39! BEGIN_CODE
40        .p2align 4
41  SYM(idtdesc):
42        .word  (256*8 - 1)
43        .long  SYM (Interrupt_descriptor_table)
44       
45! END_CODE
46 
47      .section .m_hdr
48        .long 0x1BADB002
49--- 224,240 ----
50        .rept 256
51        .word 0,0,0,0
52        .endr
53               
54  /*---------------------------------------------------------------------------+
55  | Descriptor of IDT
56  +--------------------------------------------------------------------------*/
57!
58        .p2align 4
59  SYM(idtdesc):
60        .word  (256*8 - 1)
61        .long  SYM (Interrupt_descriptor_table)
62       
63! END_DATA
64 
65      .section .m_hdr
66        .long 0x1BADB002
67Index: c/src/lib/libbsp/i386/shared/pci/pcibios.c
68===================================================================
69RCS file: /afs/slac/g/spear/cvsrep/rtems/src-20030128/c/src/lib/libbsp/i386/shared/pci/pcibios.c,v
70retrieving revision 1.1.1.4
71retrieving revision 1.3
72diff -c -r1.1.1.4 -r1.3
73*** c/src/lib/libbsp/i386/shared/pci/pcibios.c  21 Oct 2004 18:14:39 -0000      1.1.1.4
74--- c/src/lib/libbsp/i386/shared/pci/pcibios.c  21 Oct 2004 18:39:30 -0000      1.3
75***************
76*** 281,334 ****
77  BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
78                     int instance, int *pbus, int *pdev, int *pfun )
79  {
80!    int sig;
81!    unsigned int d;
82!    unsigned short s;
83!    unsigned char bus,dev,fun,hd;
84!
85!    for (bus=0; bus<BusCountPCI(); bus++)
86!    {
87!       for (dev=0; dev<PCI_MAX_DEVICES; dev++)
88!       {
89!          sig = PCIB_DEVSIG_MAKE(bus,dev,0);
90!
91!          /* pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); */
92!          pcib_conf_read8(sig, 0xe, &hd);
93!
94!          hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1);
95!
96!          for (fun=0; fun<hd; fun++) {
97!             /*
98!              * The last devfn id/slot is special; must skip it
99!              */
100!             if( PCI_MAX_DEVICES-1 == dev && PCI_MAX_FUNCTIONS-1 == fun )
101!                break;
102!
103!             /*pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); */
104!             pcib_conf_read32(sig, 0, &d);
105!             if( d == -1 )
106!                continue;
107! #ifdef PCI_DEBUG
108!             printk("BSP_pciFindDevice: found 0x%08x at %d/%d/%d\n",d,bus,dev,fun);
109! #endif
110!             /* pci_read_config_word(bus,dev,fun,PCI_VENDOR_ID,&s); */
111!             pcib_conf_read16(sig, 0, &s);
112!             if (vendorid != s)
113!                continue;
114!
115!             /* pci_read_config_word(bus,dev,fun,PCI_DEVICE_ID,&s); */
116!             pcib_conf_read16(sig, 0x2, &s);
117!             if (deviceid == s) {
118!                if (instance--) continue;
119!                *pbus=bus;
120!                *pdev=dev;
121!                *pfun=fun;
122!                return 0;
123!             }
124!          }
125!       }
126     }
127!    return -1;
128  }
129 
130 
131--- 281,297 ----
132  BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
133                     int instance, int *pbus, int *pdev, int *pfun )
134  {
135!    int sig, rval;
136!
137!    rval = pcib_find_by_devid(vendorid, deviceid, instance, &sig);
138!
139!    if ( PCIB_ERR_SUCCESS == rval ) {
140!               *pbus = PCIB_DEVSIG_BUS(sig);
141!               *pdev = PCIB_DEVSIG_DEV(sig);
142!               *pfun = PCIB_DEVSIG_FUNC(sig);
143     }
144!
145!    return rval;
146  }
147 
148