Home | History | Annotate | Download | only in include
History log of /src/sys/arch/m68k/include/pmap_motorola.h
RevisionDateAuthorComments
 1.43  31-Dec-2023  thorpej Provide a vtophys() function like other platforms do, and implement
kvtop() (which will be g/c'd shortly) in terms of it.
 1.42  27-Dec-2023  thorpej Stop using magic numbers for the MMU root pointer attributes and the
Translation Control register, and also get rid of "#if PGSHIFT == ..."
where those magic numbers are used.

Instead, define new macros: MMU51_SRP_BITS, MMU51_CRP_BITS, MMU51_TCR_BITS,
and MMU40_TCR_BITS, in terms of the definitions in mmu_{40,51}.h. These
automagically adapt to 8K and 4K pages based on the machine-specific value
of PGSHIFT.
 1.41  26-Dec-2023  thorpej Move active_pmap() and active_user_pmap() macros into pmap_motorola.c
 1.40  26-Dec-2023  thorpej - G/C the PMAP_ACTIVATE() macro, just call loadustp() directly.
- In pmap_activate(), rather than checking for an idle LWP and skipping
the loadustp() in that case, just check if the pmap being activate is
the kernel pmap. Also, KASSERT() that the specified lwp is the current
lwp.
 1.39  25-Dec-2023  thorpej loadustp(): Optimize for the overwhelmingly common case of "not the HP MMU".
Rather than converting the level 1 table address to a page number before
calling loadustp() only to have loadustp() convert it back to an address
for the '851, '030, '040, and '060, instead pass the address and convert
to a page number only in the case of the HP MMU.

This is a wash on HP MMU machines (9000/320 and 9000/350), and saves at
least 4 instructions (2x moveq + 2x lsXl) on every context switch on
everything else.
 1.38  26-Sep-2023  tsutsui Remove trailing spaces and TABs.
 1.37  19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.36  14-Mar-2020  ad pmap_remove_all(): Return a boolean value to indicate the behaviour. If
true, all mappings have been removed, the pmap is totally cleared out, and
UVM can then avoid doing the work to call pmap_remove() for each map entry.
If false, either nothing has been done, or some helpful arch-specific voodoo
has taken place.
 1.35  01-Feb-2020  tsutsui Use "__nothing" macro defined in <sys/cdefs.h> for empty pmap_update().

Suggested by pgoyette@ in PR/54869.
 1.34  29-Oct-2011  tsutsui branches: 1.34.54; 1.34.60;
Use pool(9) for struct pv_entry allocations rather than
uvm_km_alloc(9)/uvm_km_free(9) and ancient homegrown pv_page_info structures.

Calling uvm_km_free(9) during pmap_remove(9) could cause rw_lock error
in uvm_unmap1() as noted in PR port-m68k/45519.

NetBSD/x68k (both real X68030 and XM6i emulator) still gets weird panic
(corrupted kernel stack pointer?) on some heavy load:
---
panic: MMU fault
Stopped in pid 363.1 (X68k) at netbsd:cpu_Debugger+0x6: unlk a6
db> tr
cpu_Debugger(4012004,8,1cbb528,2a618e0,2a5b000) + 6
db>
---
but it also occurs without this change so there might be some more bugs
in m68k pmap...
 1.33  03-Jun-2011  tsutsui - remove simple_lock(9) and use atomic_ops(3) to account pmap reference count,
perrequest from rmind@
- while here no need to export struct pmap on sun2/sun3/sun3x

No particular problem for a week on hp300 and sun3x kernels with disabled
tcp_vtw which has been broken for a month on low memory machines.
 1.32  06-Jan-2011  tsutsui branches: 1.32.2; 1.32.6;
Use #ifdef CACHE_HAVE_VAC rather than #ifdef M68K_MMU_HP where
the pmap code indends.
(though currently only MMU_HP machines have VAC in pmap_motorola ports)
 1.31  02-Jan-2011  tsutsui Make pmap_aliasmask unsigned and declare it in <m68k/pmap_motorola.h>.

XXX: does anyone still have working HP320 or HP350 with 020+HP_MMU+VAC?
 1.30  06-Jun-2010  he Only include opt_m68k_arch.h if _KERNEL_OPT is defined, so that librump
builds again. OK'ed by mrg@.
 1.29  06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.28  13-Dec-2009  tsutsui branches: 1.28.2; 1.28.4;
- update some comments
- use unsigned constant for shift op
 1.27  11-Dec-2009  tsutsui Define SYSMAP_VA in <m68k/pmap_motorola.h>
where the Sysmap pointer is declared.
 1.26  11-Dec-2009  tsutsui Refactoring MD segment related definitions on m68k ports:
- move macro SEGSHIFT, NBSEG, and SEGOFSET from <machine/param.h>
to <m68k/pmap_motorola.h> where they should belong
- also simplify NBSEG macro for both 020/030 and 040/060 cases
- also move m68k_trunc_seg(), m68k_round_seg(), and m68k_seg_offset()
(that use SEGOFSET) from <m68k/param.h> to <m68k/pmap_motorola.h>
- add comments about each segment size value used on pmap_motorola
implementation
- add TIA_SIZE, TIA_SHIFT, TIB_SIZE, and TIB_SHIFT macro which can be
used for ste/pte index sizes
- use proper vaddr_t cast instead of unsigned for SEGOFSET/PGOFSET macro

Tested on atari, hp300, and news68k.
 1.25  08-Dec-2009  tsutsui Remove unused M68K_SEG_SIZE macro. All sources use NBSEG directly.

XXX: It looks NBSEG definitions in <machine/param.h>
XXX: for all m68k port are incorrect, since 1997 or 2002.
 1.24  06-Dec-2009  tsutsui Move initialization of protection_codes[] and kernel_pmap()
from MD pmap bootstrap sources to common pmap_bootstrap_finalize().

Tested on atari, hp300, mac68k, and news68k.

XXX: Why is protection_codes[] array initialized at run time?
 1.23  06-Dec-2009  tsutsui pm_stfree in struct pmap is a bitmap value so make it unsigned.
 1.22  02-Dec-2009  tsutsui Add a common pmap_bootstrap_finalize() function which initializes
lwp0 uarea, curlwp, and curpcb after MMU is turned on, using
lwp0uarea variable saved during pmap_bootstrap() (or equivalent functions)
for pmap_motorola based ports. Discussed with rmind@.
 1.21  26-Aug-2009  thorpej Minor tweak to the pv_table management in the Hibler-derived m68k pmaps:
The head of the list is now a pv_header, which contains the first pv_entry
as well as a 16-bit attributes field (replaces the pmap_attributes array
plus the pv_entry::pv_flags field) as a 16-bit count of caller-specified
cache-inhibited mappings.

Tested on hp300 (shared pmap_motorola.c), changes to atari and amiga copies
are purely mechanical.
 1.20  17-Jan-2009  tsutsui Move extern decls for Sysseg, Sysptmap, Sysptsize, mem_size, virtual_avail,
virtual_end, and protection_codes[] to common <m68k/pmap_motorola.h>,
and also make protection_codes[] unsigned.

XXX: avail_start and avail_end should also be moved, but it causes
XXX: -Wshadow warnings in uvm/uvm_page.c:uvm_page_physload() and
XXX: I don't have a good idea of alternative names for now.
 1.19  28-Dec-2008  tsutsui Use the global kernel_pmap_ptr pointer in each MD pmap_bootstrap.c
(where MMU is not enabled yet) and make kernel_pmap_store static again.
Also consistently use uintptr_t on address conversion in RELOC() macro.

Tested on hp300 (PA != VA) and news68k (PA == VA).
 1.18  10-Dec-2008  tsutsui Restore kernel_pmap_store declaration since it's still used by
most m68k ports in pmap_bootstrap.c.
 1.17  10-Dec-2008  pooka Make kernel_pmap_ptr a const. Requested by steve_martin.
 1.16  06-Jan-2008  dsl branches: 1.16.6; 1.16.10; 1.16.16; 1.16.18;
include sys/simplelock.h
 1.15  17-Oct-2007  garbled branches: 1.15.2; 1.15.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.14  07-Jun-2007  tsutsui branches: 1.14.10;
Enable _pmap_set_page_cacheable(), _pmap_set_page_cacheinhibit() and
_pmap_page_is_cacheable() on all pmap_motorola.c ports and add
BUS_DMA_COHERENT support (from mvme68k) to common m68k bus_dma.c.

Tested with (not-yet-integrated) MI Sonic Ethernet driver on mac68k
http://mail-index.netbsd.org/port-mac68k/2007/06/07/0000.html
and ok'ed by thorpej.
 1.13  12-May-2007  mhitch Changes to enable support of 8K pagesize.
 1.12  05-Mar-2007  tsutsui branches: 1.12.2; 1.12.4; 1.12.10;
Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
 1.11  04-Mar-2007  tsutsui Move declarations of CADDR1 and CADDR2 from m68k/pmap_motorola.c
to <m68k/pmap_motorola.h>.
 1.10  16-Feb-2006  perry branches: 1.10.20;
Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
 1.9  24-Dec-2005  perry branches: 1.9.2; 1.9.4; 1.9.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.8  11-Dec-2005  christos merge ktrace-lwp.
 1.7  01-Apr-2005  yamt branches: 1.7.2;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.6  17-Jan-2005  atatat branches: 1.6.2;
Convert the PMAP_PREFER() macro from two arguments (offset and hint)
to four (adding size and direction).

In order for topdown uvm to be an option on ports using PMAP_PREFER,
they will need to "prefer" lower addresses if topdown is being used.
Additionally, at least one port also needs to know the size.
 1.5  28-Aug-2004  thorpej branches: 1.5.4;
De-__P
 1.4  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3  02-Apr-2003  thorpej branches: 1.3.2;
Use PAGE_SIZE rather than NBPG.
 1.2  05-Nov-2002  chs branches: 1.2.2;
merge pmap.c for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.1  03-Nov-2002  chs merge pmap.h for all 4k-page motorola-MMU (or compatible) m68k platforms.
 1.2.2.2  11-Nov-2002  nathanw Catch up to -current
 1.2.2.1  05-Nov-2002  nathanw file pmap_motorola.h was added on branch nathanw_sa on 2002-11-11 21:59:38 +0000
 1.3.2.6  01-Apr-2005  skrll Sync with HEAD.
 1.3.2.5  17-Jan-2005  skrll Sync with HEAD.
 1.3.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.3.2.2  03-Sep-2004  skrll Sync with HEAD
 1.3.2.1  03-Aug-2004  skrll Sync with HEAD
 1.5.4.1  29-Apr-2005  kent sync with -current
 1.6.2.1  23-Feb-2005  yamt change mac68k's kernel address space layout in order to simplify
interaction between upper layer of the vm during bootstrap.
- move Sysmap to the end of address space.
- move IOBase etc immediately after proc0 uarea.
- tweak virtual_avail/end accordingly.

tested by Chuck Silvers, on his quadra 950.
XXX this breaks other m68k platforms. i'll fix them later.
 1.7.2.2  21-Jan-2008  yamt sync with head
 1.7.2.1  03-Sep-2007  yamt sync with head.
 1.9.6.1  22-Apr-2006  simonb Sync with head.
 1.9.4.1  09-Sep-2006  rpaulo sync with head
 1.9.2.1  18-Feb-2006  yamt sync with head.
 1.10.20.2  17-May-2007  yamt sync with head.
 1.10.20.1  12-Mar-2007  rmind Sync with HEAD.
 1.12.10.2  26-Jun-2007  garbled Sync with HEAD.
 1.12.10.1  22-May-2007  matt Update to HEAD.
 1.12.4.1  11-Jul-2007  mjf Sync with head.
 1.12.2.2  09-Jun-2007  ad Sync with head.
 1.12.2.1  27-May-2007  ad Sync with head.
 1.14.10.2  09-Jan-2008  matt sync with HEAD
 1.14.10.1  06-Nov-2007  matt sync with HEAD
 1.15.8.1  08-Jan-2008  bouyer Sync with HEAD
 1.15.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.16.18.1  19-Jan-2009  skrll Sync with HEAD.
 1.16.16.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.10.4  11-Aug-2010  yamt sync with head.
 1.16.10.3  11-Mar-2010  yamt sync with head
 1.16.10.2  16-Sep-2009  yamt sync with head
 1.16.10.1  04-May-2009  yamt sync with head.
 1.16.6.1  17-Jan-2009  mjf Sync with HEAD.
 1.28.4.3  12-Jun-2011  rmind sync with head
 1.28.4.2  05-Mar-2011  rmind sync with head
 1.28.4.1  03-Jul-2010  rmind sync with head
 1.28.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.32.6.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.32.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.34.60.1  29-Feb-2020  ad Sync with head.
 1.34.54.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed