From owner-freebsd-hackers Thu Oct 10 17:05:28 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA27412 for hackers-outgoing; Thu, 10 Oct 1996 17:05:28 -0700 (PDT) Received: from clem.systemsix.com (clem.systemsix.com [198.99.86.131]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id RAA27400 for ; Thu, 10 Oct 1996 17:05:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by clem.systemsix.com (8.6.12/8.6.12) with SMTP id SAA07241 for ; Thu, 10 Oct 1996 18:04:30 -0600 Message-Id: <199610110004.SAA07241@clem.systemsix.com> X-Authentication-Warning: clem.systemsix.com: Host localhost didn't use HELO protocol X-Mailer: exmh version 1.6.5 12/11/95 From: Steve Passe To: hackers@freefall.freebsd.org Subject: PCI internals Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 10 Oct 1996 18:04:29 -0600 Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hi, I am doing the code for symmetric IO in the freeBSD SMP kernel. I currently am struggling with the PCI INTerrupt redirection code. My problem: [ code in src/sys/pci/pci.c: ] 'pci_map_int( ... )' calls 'getirq( pcici_t tag )' to find the INTerrupt to register with the kernel for use by the PCI card being setup. 'getirq()' gets the "re-directed" ISA INTerrupt from: irq = PCI_INTERRUPT_LINE_EXTRACT( pci_conf_read (tag, PCI_INTERRUPT_REG)); BUT with the MP capable boards the 8259 PIC chips are abandoned after boot and an APIC (Advanced Programmable Interrupt Controller) is used instead. This chip directly supports 24 INTs, so the PCI INTS are directly attached to its upper pins, and the "redirected" ISA INTs never reach it. The MP motherboard provides a BIOS table that tells me which PCI INTerrupt line is attached to what APIC pin. This mapping is described as: PCI bus number, PCI device number, PCI line IRQ#: INT_[ABCD] So in 'getirq()' I need to determine the PCI bus/device# of interest at the time 'getirq()' is called. From this I can determine the APIC pin, and thus the real IRQ#, to return. I am most interested in the device#, I can assumme bus0 for now (but NOT forever). Can these be determined from 'tag'? If not, how do I go about this? Please cc: me, my "hackers-digest" is slow and unreliable. -- Steve Passe | powered by smp@csn.net | FreeBSD -----BEGIN PGP PUBLIC KEY BLOCK----- Version: 2.6.2 mQCNAzHe7tEAAAEEAM274wAEEdP+grIrV6UtBt54FB5ufifFRA5ujzflrvlF8aoE 04it5BsUPFi3jJLfvOQeydbegexspPXL6kUejYt2OeptHuroIVW5+y2M2naTwqtX WVGeBP6s2q/fPPAS+g+sNZCpVBTbuinKa/C4Q6HJ++M9AyzIq5EuvO0a8Rr9AAUR tBlTdGV2ZSBQYXNzZSA8c21wQGNzbi5uZXQ+ =ds99 -----END PGP PUBLIC KEY BLOCK-----