pci_pir.c (267992) | pci_pir.c (282274) |
---|---|
1/*- 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000, BSDi 5 * Copyright (c) 2004, John Baldwin <jhb@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000, BSDi 5 * Copyright (c) 2004, John Baldwin <jhb@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/i386/pci/pci_pir.c 267992 2014-06-28 03:56:17Z hselasky $"); | 31__FBSDID("$FreeBSD: head/sys/i386/pci/pci_pir.c 282274 2015-04-30 15:48:48Z jhb $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/bus.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/module.h> 39#include <sys/sysctl.h> --- 92 unchanged lines hidden (view full) --- 132void 133pci_pir_open(void) 134{ 135 struct PIR_table *pt; 136 uint32_t sigaddr; 137 int i; 138 uint8_t ck, *cv; 139 | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/bus.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/module.h> 39#include <sys/sysctl.h> --- 92 unchanged lines hidden (view full) --- 132void 133pci_pir_open(void) 134{ 135 struct PIR_table *pt; 136 uint32_t sigaddr; 137 int i; 138 uint8_t ck, *cv; 139 |
140#ifdef XEN 141 return; 142#else | |
143 /* Don't try if we've already found a table. */ 144 if (pci_route_table != NULL) 145 return; 146 147 /* Look for $PIR and then _PIR. */ 148 sigaddr = bios_sigsearch(0, "$PIR", 4, 16, 0); 149 if (sigaddr == 0) 150 sigaddr = bios_sigsearch(0, "_PIR", 4, 16, 0); 151 if (sigaddr == 0) 152 return; | 140 /* Don't try if we've already found a table. */ 141 if (pci_route_table != NULL) 142 return; 143 144 /* Look for $PIR and then _PIR. */ 145 sigaddr = bios_sigsearch(0, "$PIR", 4, 16, 0); 146 if (sigaddr == 0) 147 sigaddr = bios_sigsearch(0, "_PIR", 4, 16, 0); 148 if (sigaddr == 0) 149 return; |
153#endif | 150 |
154 /* If we found something, check the checksum and length. */ 155 /* XXX - Use pmap_mapdev()? */ 156 pt = (struct PIR_table *)(uintptr_t)BIOS_PADDRTOVADDR(sigaddr); 157 if (pt->pt_header.ph_length <= sizeof(struct PIR_header)) 158 return; 159 for (cv = (u_int8_t *)pt, ck = 0, i = 0; 160 i < (pt->pt_header.ph_length); i++) 161 ck += cv[i]; --- 314 unchanged lines hidden (view full) --- 476static int 477pci_pir_biosroute(int bus, int device, int func, int pin, int irq) 478{ 479 struct bios_regs args; 480 481 args.eax = PCIBIOS_ROUTE_INTERRUPT; 482 args.ebx = (bus << 8) | (device << 3) | func; 483 args.ecx = (irq << 8) | (0xa + pin); | 151 /* If we found something, check the checksum and length. */ 152 /* XXX - Use pmap_mapdev()? */ 153 pt = (struct PIR_table *)(uintptr_t)BIOS_PADDRTOVADDR(sigaddr); 154 if (pt->pt_header.ph_length <= sizeof(struct PIR_header)) 155 return; 156 for (cv = (u_int8_t *)pt, ck = 0, i = 0; 157 i < (pt->pt_header.ph_length); i++) 158 ck += cv[i]; --- 314 unchanged lines hidden (view full) --- 473static int 474pci_pir_biosroute(int bus, int device, int func, int pin, int irq) 475{ 476 struct bios_regs args; 477 478 args.eax = PCIBIOS_ROUTE_INTERRUPT; 479 args.ebx = (bus << 8) | (device << 3) | func; 480 args.ecx = (irq << 8) | (0xa + pin); |
484#ifdef XEN 485 return (0); 486#else | |
487 return (bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL))); | 481 return (bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL))); |
488#endif | |
489} 490 491 492/* 493 * Route a PCI interrupt using a link device from the $PIR. 494 */ 495int 496pci_pir_route_interrupt(int bus, int device, int func, int pin) --- 258 unchanged lines hidden --- | 482} 483 484 485/* 486 * Route a PCI interrupt using a link device from the $PIR. 487 */ 488int 489pci_pir_route_interrupt(int bus, int device, int func, int pin) --- 258 unchanged lines hidden --- |