Subject: user mapping pci memory
To: None <port-alpha@NetBSD.ORG>
From: Eric Hoffman <hoffman@caida.org>
List: port-alpha
Date: 03/10/1997 02:29:12
I have a memory-mapped pci device that seems to work fine from kernel
space via bus_mem_[read|write]_4 after use of bus_mem_map.
however, 32-bit aligned 32-bit writes from process space into the
same region invariably panic the machine with a verbose
"panic: machine check: vec 0x660, pc = 0x120000804, ra = 0x1200007d4"
the pcivga driver has the following code in mmap commented out:
rv = alpha_btop(k0segtophys(sc->sc_dc->dc_crtat) + offset);
which shouldn't be necessary in my case given that I already have a
physical address. looking at this memory region this address is in
(7ffffe011000000) and the implementation of bus_mem_write_4 it would
seem that this access should work. the only disturbing thing that I've
found in poking around is that assumption that the physical page
address as returned by the mmap call will fit in an int.
the machine in an apecs pci running 1.2. any hints would be greatly
appreciated.