Subject: port-mips/31915: provide centralized wired_map logic
To: None <port-mips-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <garrett_damore@tadpole.com>
List: netbsd-bugs
Date: 10/25/2005 20:37:00
>Number:         31915
>Category:       port-mips
>Synopsis:       provide centralized wired_map logic
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 25 20:37:00 +0000 2005
>Originator:     Garrett D'Amore
>Release:        3.99.10
>Organization:
Tadpole Computer, Inc.
>Environment:
NetBSD 3.99.10 (PB1000) #20: Tue Oct 25 10:55:21 PDT 2005
        garrett@zippy:/home/garrett/work/meteor/netbsd/src/sys/arch/evbmips/comp
>Description:
In order to support the Alchemy's large (36-bit) physical address space, we need to be able to use wired TLB entries.

To do this, we need a little bit of assembler code added to the mipsXX_subr.S file (and supporting header), and we also need a very simple mips3_wired_map.c (and supporting wired_map.h).

The ARC port already has simliar logic, we borrow from that port, but we provide a much simpler (and smaller) bit of wired_map logic in the C code.

The resulting C code is only used by my Alchemy changes at the moment, but it is quite small, with size reporting only 776 bytes used.  Nonetheless, I can conditionalize its inclusion if necessary.

The assembler routine adds only 108 bytes (on MIPS 32, it may be slightly larger on MIPS 64), and it is shared by both my Alchemy PCI code, and the ARC port.

These changes are written to be as cleanly reusable for other ports as possible, which is why I'm requesting to put them in the generic mips port rather than just sticking them in evbmips somewhere.
>How-To-Repeat:

>Fix:
My diffs will be attached shortly.  Note that they currently do not conditionalize addition of the wired_map logic, but it would be fairly straight-forward to do so by adding another configuration option(4), if someone is concerned about the ~800 bytes used by this on ports that don't strictly need it.