From owner-freebsd-hackers Sun Mar 18 13: 5: 7 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from linux.ssc.nsu.ru (linux.ssc.nsu.ru [193.124.219.91]) by hub.freebsd.org (Postfix) with SMTP id 5E9D637B71F for ; Sun, 18 Mar 2001 13:04:47 -0800 (PST) (envelope-from danfe@inet.ssc.nsu.ru) Received: (qmail 25894 invoked from network); 18 Mar 2001 21:04:43 -0000 Received: from inet.ssc.nsu.ru (62.76.110.12) by hub.freebsd.org with SMTP; 18 Mar 2001 21:04:43 -0000 Received: from localhost (danfe@localhost) by inet.ssc.nsu.ru (8.9.3/8.9.3) with ESMTP id CAA07380 for ; Mon, 19 Mar 2001 02:16:23 +0600 Date: Mon, 19 Mar 2001 02:16:23 +0600 (NOVT) From: Alexey Dokuchaev To: freebsd-hackers@freebsd.org Subject: Some PCI-related programming things Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello there, Under linux, PCI stuff is generally done thru set of pci* functions, while under FreeBSD there are ioctls provided by pci driver. I've been doing some code migration from linux to FreeBSD, and got thru most of it, except for things like this one: . . . pcibios_read_config_dword(bus_id, func_id, PCI_BASE_ADDRESS_0, &addr_0); addr_0 &= PCI_BASE_ADDRESS_IO_MASK; pcibios_read_config_dword(bus_id, func_id, PCI_BASE_ADDRESS_1, &addr_1); addr_1 &= PCI_BASE_ADDRESS_MEM_MASK; . . . I am not quite sure how to code the same thing under FreeBSD, particulary: pi.pi_width = 4; pi.pi_reg = ioctl(fd, PCIOCREAD, &pi); Could anyone give me an example for both addr_0 and addr_1 (that is, translation of the linux code I cited above?) I will really appreciate any help with regard to this. Thanks in advance. -- Alexey. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message