From owner-freebsd-hardware Wed Dec 9 17:40:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA01247 for freebsd-hardware-outgoing; Wed, 9 Dec 1998 17:40:30 -0800 (PST) (envelope-from owner-freebsd-hardware@FreeBSD.ORG) Received: from dingo.cdrom.com (ppp-db.dialup.hilink.com.au [203.2.144.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA01237 for ; Wed, 9 Dec 1998 17:40:26 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id RAA01687; Wed, 9 Dec 1998 17:19:30 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199812100119.RAA01687@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Chris Ficklin cc: freebsd-hardware@FreeBSD.ORG Subject: Re: accessing PCI memory under 2.2.2 In-reply-to: Your message of "Wed, 09 Dec 1998 16:49:11 CST." <3.0.32.19981209164910.00a3c9e0@prismnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 09 Dec 1998 17:19:29 -0800 From: Mike Smith Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I'm having difficulty accessing the memory on a PCI adapter I'm writing a > driver for. I map the memory with pci_map_mem and am using the pointer > returned to me in the va parameter. When I try to to write the memory, > what I read back is not the same. Compare your usage with that in other drivers that do memory-mapped I/O. It sounds like you're not necessarily getting it quite right. > I'm using copyin/copyout to write/read > the memory from buffers passed from user space. That's bad; you should use uiomove so that you can be called from kernel space as well. > Also, if I try to access > the memory on the board directly (ie with a printf) the machine locks up. > Does anyone have any ideas what may be wrong. With no actual numbers, hardware documentation, probe output, etc., no, but it's something that you're going to have a better chance of resolving if you look at other code that does the same stuff and compare it with yours. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message