1216174Snwhitehorn/*-
2216174Snwhitehorn * Copyright (C) 2010 Nathan Whitehorn
3216174Snwhitehorn * All rights reserved.
4216174Snwhitehorn *
5216174Snwhitehorn * Redistribution and use in source and binary forms, with or without
6216174Snwhitehorn * modification, are permitted provided that the following conditions
7216174Snwhitehorn * are met:
8216174Snwhitehorn * 1. Redistributions of source code must retain the above copyright
9216174Snwhitehorn *    notice, this list of conditions and the following disclaimer.
10216174Snwhitehorn * 2. Redistributions in binary form must reproduce the above copyright
11216174Snwhitehorn *    notice, this list of conditions and the following disclaimer in the
12216174Snwhitehorn *    documentation and/or other materials provided with the distribution.
13216174Snwhitehorn *
14216174Snwhitehorn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15216174Snwhitehorn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16216174Snwhitehorn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17216174Snwhitehorn * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18216174Snwhitehorn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19216174Snwhitehorn * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20216174Snwhitehorn * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21216174Snwhitehorn * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22216174Snwhitehorn * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23216174Snwhitehorn * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24216174Snwhitehorn *
25216174Snwhitehorn * $FreeBSD: releng/11.0/sys/powerpc/aim/mmu_oea64.h 279252 2015-02-24 21:37:20Z nwhitehorn $
26216174Snwhitehorn */
27216174Snwhitehorn
28216174Snwhitehorn#ifndef _POWERPC_AIM_MMU_OEA64_H
29216174Snwhitehorn#define _POWERPC_AIM_MMU_OEA64_H
30216174Snwhitehorn
31216174Snwhitehorn#include <machine/mmuvar.h>
32216174Snwhitehorn
33216174Snwhitehornextern mmu_def_t oea64_mmu;
34216174Snwhitehorn
35216174Snwhitehorn/*
36216174Snwhitehorn * Helper routines
37216174Snwhitehorn */
38216174Snwhitehorn
39216174Snwhitehorn/* Allocate physical memory for use in moea64_bootstrap. */
40216174Snwhitehornvm_offset_t	moea64_bootstrap_alloc(vm_size_t, u_int);
41279252Snwhitehorn/* Set an LPTE structure to match the contents of a PVO */
42279252Snwhitehornvoid	moea64_pte_from_pvo(const struct pvo_entry *pvo, struct lpte *lpte);
43216174Snwhitehorn
44216174Snwhitehorn/*
45279252Snwhitehorn * Flags
46279252Snwhitehorn */
47279252Snwhitehorn
48279252Snwhitehorn#define MOEA64_PTE_PROT_UPDATE	1
49279252Snwhitehorn#define MOEA64_PTE_INVALIDATE	2
50279252Snwhitehorn
51279252Snwhitehorn/*
52216174Snwhitehorn * Bootstrap subroutines
53216174Snwhitehorn *
54216174Snwhitehorn * An MMU_BOOTSTRAP() implementation looks like this:
55216174Snwhitehorn *   moea64_early_bootstrap();
56216174Snwhitehorn *   Allocate Page Table
57216174Snwhitehorn *   moea64_mid_bootstrap();
58216174Snwhitehorn *   Add mappings for MMU resources
59216174Snwhitehorn *   moea64_late_bootstrap();
60216174Snwhitehorn */
61216174Snwhitehorn
62216174Snwhitehornvoid		moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernelstart,
63216174Snwhitehorn		    vm_offset_t kernelend);
64216174Snwhitehornvoid		moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelstart,
65216174Snwhitehorn		    vm_offset_t kernelend);
66216174Snwhitehornvoid		moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart,
67216174Snwhitehorn		    vm_offset_t kernelend);
68216174Snwhitehorn
69216174Snwhitehorn/*
70216174Snwhitehorn * Statistics
71216174Snwhitehorn */
72216174Snwhitehorn
73216174Snwhitehornextern u_int	moea64_pte_valid;
74216174Snwhitehornextern u_int	moea64_pte_overflow;
75216174Snwhitehorn
76216174Snwhitehorn/*
77216174Snwhitehorn * State variables
78216174Snwhitehorn */
79216174Snwhitehorn
80216174Snwhitehornextern int		moea64_large_page_shift;
81255418Snwhitehornextern uint64_t		moea64_large_page_size;
82216174Snwhitehornextern u_int		moea64_pteg_count;
83216174Snwhitehornextern u_int		moea64_pteg_mask;
84216174Snwhitehorn
85216174Snwhitehorn#endif /* _POWERPC_AIM_MMU_OEA64_H */
86216174Snwhitehorn
87