4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/t_lock.h>
33 #include <sys/cpuvar.h>
34 #include <sys/systm.h>
39 #include <vm/seg_kmem.h>
41 #include <sys/cmn_err.h>
42 #include <sys/debug.h>
45 * ppcopy() and pagezero() have moved to i86/vm/vm_machdep.c
49 * Architecures with a vac use this routine to quickly make
50 * a vac-aligned mapping. We don't have a vac, so we don't
51 * care about that - just make this simple.
55 ppmapin(page_t
*pp
, uint_t vprot
, caddr_t avoid
)
59 va
= vmem_alloc(heap_arena
, PAGESIZE
, VM_SLEEP
);
60 hat_memload(kas
.a_hat
, va
, pp
, vprot
| HAT_NOSYNC
, HAT_LOAD_LOCK
);
67 hat_unload(kas
.a_hat
, va
, PAGESIZE
, HAT_UNLOAD_UNLOCK
);
68 vmem_free(heap_arena
, va
, PAGESIZE
);
73 * Map the page pointed to by pp into the kernel virtual address space.
74 * This routine is used by the rootnexus.
77 i86_pp_map(page_t
*pp
, caddr_t kaddr
)
79 hat_devload(kas
.a_hat
, kaddr
, MMU_PAGESIZE
, page_pptonum(pp
),
80 HAT_STORECACHING_OK
| PROT_READ
| PROT_WRITE
| HAT_NOSYNC
,
85 * Map the page containing the virtual address into the kernel virtual address
86 * space. This routine is used by the rootnexus.
89 i86_va_map(caddr_t vaddr
, struct as
*asp
, caddr_t kaddr
)
93 pfnum
= hat_getpfnum(asp
->a_hat
, vaddr
);
94 hat_devload(kas
.a_hat
, kaddr
, MMU_PAGESIZE
, pfnum
,
95 HAT_STORECACHING_OK
| PROT_READ
| PROT_WRITE
| HAT_NOSYNC
,