Port-vax archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: About support for rtVAX300
Mouse wrote:
> > *(int *)vax_map_physmem(0x201ffffc,1)=(int)(0xf-7)<<16;
>
> Shouldn't that be
>
> ((int *)vax_map_physmem(0x201ffffc&~511,1))[(0x201ffffc&511)/sizeof(int)] =
> ...
Traps on the same Trap address. I even tried a mask of 4095.
Johnny worte above:
>>I actually checked the code, since I was thinking the same thing, but I
>>think not. The code at the end of vax_map_physmem looks like this:
>>
>> return addr | (phys & VAX_PGOFSET);
>>
>>Where addr is the base for the page you got. phys is the requested
>>address, which is masked down to just an offset within a page, and then
>>merged with the base address. But I might be wrong...
>>
>> Johnny
...so this shouldn't matter, since Johnnys assumption looks logical for me.
Nevertheless, most vax_map_physmem() things in other drivers seems
to map "even" addresses, since the HW-registers are locate there.
Have to find out what happens here, since I need this to put some things in
the UART too...
machdep.c:
vax_map_physmem(paddr_t phys, size_t size)
{
vaddr_t addr;
int error;
static int warned = 0;
#ifdef DEBUG
if (!iospace_inited)
panic("vax_map_physmem: called before rminit()?!?");
#endif
if (size >= LTOHPN) {
addr = uvm_km_alloc(kernel_map, size * VAX_NBPG, 0,
UVM_KMF_VAONLY);
if (addr == 0)
panic("vax_map_physmem: kernel map full");
} else {
error = extent_alloc(iomap_ex, size * VAX_NBPG, VAX_NBPG, 0,
EX_FAST | EX_NOWAIT |
(iomap_ex_malloc_safe ? EX_MALLOCOK : 0), &addr);
if (error) {
if (warned++ == 0) /* Warn only once */
printf("vax_map_physmem: iomap too small");
return 0;
}
}
ioaccess(addr, phys, size);
#ifdef PHYSMEMDEBUG
printf("vax_map_physmem: alloc'ed %d pages for paddr %lx, at %lx\n",
size, phys, addr);
#endif
return addr | (phys & VAX_PGOFSET);
}
VAX_NBPG is 4096 (1<<12) when I got this correctly which is identically
to VAX_PGOFSET.
Regards,
Holm
--
Technik Service u. Handel Tiffe, www.tsht.de, Holm Tiffe,
Freiberger Straße 42, 09600 Oberschöna, USt-Id: DE253710583
www.tsht.de, info%tsht.de@localhost, Fax +49 3731 74200, Mobil: 0172 8790 741
Home |
Main Index |
Thread Index |
Old Index