Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

loadustp() takes a page number, not an address for segment table



I was trying to use a pool for the m68k segment tables, and was almost to the point of tearing my hair out when everything looked like it was all set up correctly, but kept failing on the first access to a user address. It faulted "forever" with an indication that the root descriptor entry was bad. I verified that the root pointer wasn't required to be on a page boundary (since the current pmap has the root table at the beginning of a page).

I finally looked at PMAP_ACTIVATE(), which is used to load the user segement table pointer and found that it does:
                loadustp(m68k_btop((paddr_t)(pmap)->pm_stpa));
Looking at the amiga implementation of loadustp(), it shifts the argument
back to an address before loading the MMU register.

It looks like this is a legacy from the very first m68k port, the hp300. The hp300 uses the page number directly for HP MMU, and does the shift back to an address for m68k MMUs. I think every m68k port (except for the sun[23] ones) have been derived from the hp300 pmap, and probably has done the same thing. All those ports are now using the common pmap_motorola.c, but each port provides their own loadustp().

I would like to change that so that loadustp() takes the physical address of the root table directly (and the hp300 would convert it appropriately for the HP MMU).

--
Michael L. Hitch                        mhitch%montana.edu@localhost
Computer Consultant
Information Technology Center
Montana State University        Bozeman, MT     USA


Home | Main Index | Thread Index | Old Index