4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Kernel boot-time interfaces for handling MMU mappings before the HAT proper
38 * is running (i.e. before khat_running is set).
41 #include <sys/mach_mmu.h>
45 extern void kbm_init(struct xboot_info
*);
48 * Interface to remap the page table window, also used by HAT during init.
50 extern void *kbm_remap_window(paddr_t physaddr
, int writeable
);
53 * Find the next mapping at or above VA, if found returns non-zero and sets:
54 * - va : virtual address
55 * - pfn : pfn of real address
56 * - size : pagesize of the mapping
57 * - prot : protections
59 extern int kbm_probe(uintptr_t *va
, size_t *len
, pfn_t
*pfn
, uint_t
*prot
);
64 extern void kbm_map(uintptr_t va
, paddr_t pa
, uint_t level
, uint_t is_kernel
);
67 extern void kbm_map_ma(maddr_t ma
, uintptr_t va
, uint_t level
);
71 * unmap a single 4K page at VA
73 extern void kbm_unmap(uintptr_t va
);
76 * Remap a single 4K page at VA (always PROT_READ|PROT_WRITE).
77 * Returns the pfn of the old mapping.
79 extern pfn_t
kbm_remap(uintptr_t va
, pfn_t pfn
);
82 * Make a page mapping read only
84 extern void kbm_read_only(uintptr_t va
, paddr_t pa
);
88 * interface for kmdb to map a physical page, stack is only 1 deep
90 extern void *kbm_push(paddr_t pa
);
91 extern void kbm_pop(void);
94 * These are needed by mmu_init()
96 extern int kbm_nx_support
;
97 extern int kbm_pae_support
;
98 extern int kbm_largepage_support
;
101 * The size of memory mapped for the initial kernel nucleus text
102 * and data regions setup by the boot loader. needed for startup
104 extern uint_t kbm_nucleus_size
;
110 #endif /* _KBOOT_MMU_H */