Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Dec 1998 17:19:29 -0800
From:      Mike Smith <mike@smith.net.au>
To:        Chris Ficklin <Chris_Ficklin@serengeti.com>
Cc:        freebsd-hardware@FreeBSD.ORG
Subject:   Re: accessing PCI memory under 2.2.2 
Message-ID:  <199812100119.RAA01687@dingo.cdrom.com>
In-Reply-To: Your message of "Wed, 09 Dec 1998 16:49:11 CST." <3.0.32.19981209164910.00a3c9e0@prismnet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812100119.RAA01687>