1/*	$NetBSD: pmap.h,v 1.42.4.1 2023/12/29 20:21:39 martin Exp $	*/
 2
 3#ifndef _POWERPC_PMAP_H_
 4#define _POWERPC_PMAP_H_
 5
 6#ifdef _KERNEL_OPT
 7#include "opt_ppcarch.h"
 8#include "opt_modular.h"
 9#endif
10
11#if !defined(_MODULE)
12
13#if defined(PPC_BOOKE)
14#include <powerpc/booke/pmap.h>
15#elif defined(PPC_IBM4XX)
16#include <powerpc/ibm4xx/pmap.h>
17#elif defined(PPC_OEA) || defined (PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
18#include <powerpc/oea/pmap.h>
19#elif defined(_KERNEL)
20#error unknown PPC variant
21#endif
22
23#ifndef PMAP_DIRECT_MAPPED_LEN
24#define	PMAP_DIRECT_MAPPED_LEN	(~0UL)
25#endif
26
27#endif /* !_MODULE */
28
29#if !defined(_LOCORE) && (defined(MODULAR) || defined(_MODULE))
30/*
31 * Both BOOKE and OEA use __HAVE_VM_PAGE_MD but IBM4XX doesn't so define
32 * a compatible vm_page_md so that struct vm_page is the same size for all
33 * PPC variants.
34 */
35#ifndef __HAVE_VM_PAGE_MD
36#define __HAVE_VM_PAGE_MD
37#define VM_MDPAGE_INIT(pg) __nothing
38
39struct vm_page_md {
40	uintptr_t mdpg_dummy[5];
41};
42#endif /* !__HAVE_VM_PAGE_MD */
43
44__CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
45
46#ifndef __HAVE_PMAP_PV_TRACK
47/*
48 * We need empty stubs for modules shared with all sub-archs.
49 */
50#define	__HAVE_PMAP_PV_TRACK
51#define	PMAP_PV_TRACK_ONLY_STUBS
52#include <uvm/pmap/pmap_pvt.h>
53#endif /* !__HAVE_PMAP_PV_TRACK */
54
55#endif /* !LOCORE && (MODULAR || _MODULE) */
56
57#endif /* !_POWERPC_PMAP_H_ */