X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/5c9f46613a83ebfc29a5b1f099448259e96a98f0..eb6b6ca394357805f2bdba989abae309f718b4d8:/osfmk/arm/proc_reg.h diff --git a/osfmk/arm/proc_reg.h b/osfmk/arm/proc_reg.h index 9dc5e2ec8..c5921cede 100644 --- a/osfmk/arm/proc_reg.h +++ b/osfmk/arm/proc_reg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2016 Apple Inc. All rights reserved. + * Copyright (c) 2007-2018 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -29,28 +29,28 @@ * @OSF_COPYRIGHT@ */ /* CMU_ENDHIST */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -61,19 +61,8 @@ /* * Processor registers for ARM */ -#ifndef _ARM_PROC_REG_H_ -#define _ARM_PROC_REG_H_ - -#if __ARM_KERNEL_PROTECT__ -/* - * This feature is not currently implemented for 32-bit ARM CPU architectures. - * A discussion of this feature for 64-bit ARM CPU architectures can be found - * in the ARM64 version of this file. - */ -#if __arm__ -#error __ARM_KERNEL_PROTECT__ is not supported on ARM32 -#endif -#endif /* __ARM_KERNEL_PROTECT__ */ +#ifndef _ARM_PROC_REG_H_ +#define _ARM_PROC_REG_H_ #if defined (__arm64__) #include @@ -82,116 +71,199 @@ #endif #if defined (ARMA7) -#define __ARM_ARCH__ 7 -#define __ARM_SUB_ARCH__ CPU_ARCH_ARMv7k -#define __ARM_VMSA__ 7 -#define __ARM_VFP__ 3 +#define __ARM_ARCH__ 7 +#define __ARM_SUB_ARCH__ CPU_ARCH_ARMv7k +#define __ARM_VMSA__ 7 +#define __ARM_VFP__ 3 #if defined(__XNU_UP__) -#define __ARM_SMP__ 0 +#define __ARM_SMP__ 0 #else -#define __ARM_SMP__ 1 +#define __ARM_SMP__ 1 /* For SMP kernels, force physical aperture to be mapped at PTE level so that its mappings * can be updated to reflect cache attribute changes on alias mappings. This prevents * prefetched physical aperture cachelines from becoming dirty in L1 due to a write to * an uncached alias mapping on the same core. Subsequent uncached writes from another * core may not snoop this line, and the dirty line may end up being evicted later to * effectively overwrite the uncached writes from other cores. */ -#define __ARM_PTE_PHYSMAP__ 1 +#define __ARM_PTE_PHYSMAP__ 1 #endif /* __ARMA7_SMP__ controls whether we are consistent with the A7 MP_CORE spec; needed because entities other than * the xnu-managed processors may need to snoop our cache operations. */ -#define __ARMA7_SMP__ 1 -#define __ARM_COHERENT_CACHE__ 1 -#define __ARM_L1_PTW__ 1 -#define __ARM_DEBUG__ 7 -#define __ARM_USER_PROTECT__ 1 -#define __ARM_TIME_TIMEBASE_ONLY__ 1 - -#elif defined (APPLECYCLONE) -#define __ARM_ARCH__ 8 -#define __ARM_VMSA__ 8 -#define __ARM_SMP__ 1 -#define __ARM_VFP__ 4 -#define __ARM_COHERENT_CACHE__ 1 -#define __ARM_COHERENT_IO__ 1 -#define __ARM_IC_NOALIAS_ICACHE__ 1 -#define __ARM_L1_PTW__ 1 -#define __ARM_DEBUG__ 7 -#define __ARM_ENABLE_SWAP__ 1 -#define __ARM_V8_CRYPTO_EXTENSIONS__ 1 -#define __ARM64_PMAP_SUBPAGE_L1__ 1 -#define __ARM_KERNEL_PROTECT__ 1 +#define __ARMA7_SMP__ 1 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_USER_PROTECT__ 1 +#define __ARM_TIME_TIMEBASE_ONLY__ 1 #elif defined (APPLETYPHOON) -#define __ARM_ARCH__ 8 -#define __ARM_VMSA__ 8 -#define __ARM_SMP__ 1 -#define __ARM_VFP__ 4 -#define __ARM_COHERENT_CACHE__ 1 -#define __ARM_COHERENT_IO__ 1 -#define __ARM_IC_NOALIAS_ICACHE__ 1 -#define __ARM_L1_PTW__ 1 -#define __ARM_DEBUG__ 7 -#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 #define __ARM_V8_CRYPTO_EXTENSIONS__ 1 -#define __ARM64_PMAP_SUBPAGE_L1__ 1 -#define __ARM_KERNEL_PROTECT__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_KERNEL_PROTECT__ 1 #elif defined (APPLETWISTER) -#define __ARM_ARCH__ 8 -#define __ARM_VMSA__ 8 -#define __ARM_SMP__ 1 -#define __ARM_VFP__ 4 -#define __ARM_COHERENT_CACHE__ 1 -#define __ARM_COHERENT_IO__ 1 -#define __ARM_IC_NOALIAS_ICACHE__ 1 -#define __ARM_L1_PTW__ 1 -#define __ARM_DEBUG__ 7 -#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 #define __ARM_V8_CRYPTO_EXTENSIONS__ 1 -#define __ARM_16K_PG__ 1 -#define __ARM64_PMAP_SUBPAGE_L1__ 1 -#define __ARM_KERNEL_PROTECT__ 1 +#define __ARM_16K_PG__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_KERNEL_PROTECT__ 1 #elif defined (APPLEHURRICANE) -#define __ARM_ARCH__ 8 -#define __ARM_VMSA__ 8 -#define __ARM_SMP__ 1 -#define __ARM_VFP__ 4 -#define __ARM_COHERENT_CACHE__ 1 -#define __ARM_COHERENT_IO__ 1 -#define __ARM_IC_NOALIAS_ICACHE__ 1 -#define __ARM_L1_PTW__ 1 -#define __ARM_DEBUG__ 7 -#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 #define __ARM_V8_CRYPTO_EXTENSIONS__ 1 -#define __ARM_16K_PG__ 1 +#define __ARM_16K_PG__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_KERNEL_PROTECT__ 1 +#define __ARM_GLOBAL_SLEEP_BIT__ 1 +#define __ARM_PAN_AVAILABLE__ 1 + +#elif defined (APPLEMONSOON) +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_AMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_V8_CRYPTO_EXTENSIONS__ 1 +#define __ARM_16K_PG__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_KERNEL_PROTECT__ 1 +#define __ARM_GLOBAL_SLEEP_BIT__ 1 +#define __ARM_PAN_AVAILABLE__ 1 +#define __ARM_WKDM_ISA_AVAILABLE__ 1 +#define __PLATFORM_WKDM_ALIGNMENT_MASK__ (0x3FULL) +#define __PLATFORM_WKDM_ALIGNMENT_BOUNDARY__ (64) +#define __ARM_CLUSTER_COUNT__ 2 + +#elif defined (APPLEVORTEX) +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_V8_CRYPTO_EXTENSIONS__ 1 +#define __ARM_16K_PG__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_GLOBAL_SLEEP_BIT__ 1 +#define __ARM_PAN_AVAILABLE__ 1 +#define __ARM_WKDM_ISA_AVAILABLE__ 1 +#define __PLATFORM_WKDM_ALIGNMENT_MASK__ (0x3FULL) +#define __PLATFORM_WKDM_ALIGNMENT_BOUNDARY__ (64) +#define __ARM_CLUSTER_COUNT__ 2 + +#elif defined (APPLELIGHTNING) +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_AMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_COHERENT_IO__ 1 +#define __ARM_IC_NOALIAS_ICACHE__ 1 +#define __ARM_DEBUG__ 7 +#define __ARM_ENABLE_SWAP__ 1 +#define __ARM_V8_CRYPTO_EXTENSIONS__ 1 +#define __ARM_16K_PG__ 1 +#define __ARM64_PMAP_SUBPAGE_L1__ 1 +#define __ARM_GLOBAL_SLEEP_BIT__ 1 +#define __ARM_PAN_AVAILABLE__ 1 +#define __ARM_WKDM_ISA_AVAILABLE__ 1 +#define __PLATFORM_WKDM_ALIGNMENT_MASK__ (0x3FULL) +#define __PLATFORM_WKDM_ALIGNMENT_BOUNDARY__ (64) +#define __ARM_CLUSTER_COUNT__ 2 +#define +#define __APCFG_SUPPORTED__ 1 +#define __ARM_RANGE_TLBI__ 1 + +#elif defined (BCM2837) +#define __ARM_ARCH__ 8 +#define __ARM_VMSA__ 8 +#define __ARM_SMP__ 1 +#define __ARM_VFP__ 4 +#define __ARM_COHERENT_CACHE__ 1 +#define __ARM_DEBUG__ 7 #define __ARM64_PMAP_SUBPAGE_L1__ 1 -#define __ARM_KERNEL_PROTECT__ 1 -#define __ARM_GLOBAL_SLEEP_BIT__ 1 -#define __ARM_PAN_AVAILABLE__ 1 - #else #error processor not supported #endif +#if __ARM_42BIT_PA_SPACE__ +/* For now, force the issue! */ +#undef __ARM64_PMAP_SUBPAGE_L1__ +#endif /* __ARM_42BIT_PA_SPACE__ */ + +#if __ARM_KERNEL_PROTECT__ +/* + * This feature is not currently implemented for 32-bit ARM CPU architectures. + * A discussion of this feature for 64-bit ARM CPU architectures can be found + * in the ARM64 version of this file. + */ +#if __arm__ +#error __ARM_KERNEL_PROTECT__ is not supported on ARM32 +#endif /* __arm__ */ +#endif /* __ARM_KERNEL_PROTECT__ */ + #if defined(ARM_BOARD_WFE_TIMEOUT_NS) #define __ARM_ENABLE_WFE_ 1 -#else +#else /* defined(ARM_BOARD_WFE_TIMEOUT_NS) */ #define __ARM_ENABLE_WFE_ 0 -#endif +#endif /* defined(ARM_BOARD_WFE_TIMEOUT_NS) */ +/* + * The clutch scheduler is enabled only on non-AMP platforms for now. + */ +#if !__ARM_AMP__ && CONFIG_CLUTCH +#define CONFIG_SCHED_CLUTCH 1 +#else /* !__ARM_AMP__ && CONFIG_CLUTCH */ +#define CONFIG_SCHED_CLUTCH 0 +#endif /* !__ARM_AMP__ && CONFIG_CLUTCH */ + +#if __ARM_AMP__ || CONFIG_SCHED_CLUTCH +#define CONFIG_THREAD_GROUPS 1 +#else /* __ARM_AMP__ || CONFIG_SCHED_CLUTCH */ #define CONFIG_THREAD_GROUPS 0 +#endif +#ifdef XNU_KERNEL_PRIVATE -#ifdef XNU_KERNEL_PRIVATE +#if __ARM_VFP__ +#define ARM_VFP_DEBUG 0 +#endif /* __ARM_VFP__ */ -#if __ARM_VFP__ -#define ARM_VFP_DEBUG 0 -#endif - -#endif +#endif /* XNU_KERNEL_PRIVATE */ @@ -207,105 +279,109 @@ * +-----------------------------------------------------------+ */ -/* - * Flags +/* + * Flags */ -#define PSR_NF 0x80000000 /* Negative/Less than */ -#define PSR_ZF 0x40000000 /* Zero */ -#define PSR_CF 0x20000000 /* Carry/Borrow/Extend */ -#define PSR_VF 0x10000000 /* Overflow */ -#define PSR_QF 0x08000000 /* saturation flag (QADD ARMv5) */ +#define PSR_NF 0x80000000 /* Negative/Less than */ +#define PSR_ZF 0x40000000 /* Zero */ +#define PSR_CF 0x20000000 /* Carry/Borrow/Extend */ +#define PSR_VF 0x10000000 /* Overflow */ +#define PSR_QF 0x08000000 /* saturation flag (QADD ARMv5) */ /* * Modified execution mode flags */ -#define PSR_JF 0x01000000 /* Jazelle flag (BXJ ARMv5) */ -#define PSR_EF 0x00000200 /* mixed-endian flag (SETEND ARMv6) */ -#define PSR_AF 0x00000100 /* precise abort flag (ARMv6) */ -#define PSR_TF 0x00000020 /* thumb flag (BX ARMv4T) */ -#define PSR_TFb 5 /* thumb flag (BX ARMv4T) */ +#define PSR_JF 0x01000000 /* Jazelle flag (BXJ ARMv5) */ +#define PSR_EF 0x00000200 /* mixed-endian flag (SETEND ARMv6) */ +#define PSR_AF 0x00000100 /* precise abort flag (ARMv6) */ +#define PSR_TF 0x00000020 /* thumb flag (BX ARMv4T) */ +#define PSR_TFb 5 /* thumb flag (BX ARMv4T) */ /* * Interrupts */ -#define PSR_IRQFb 7 /* IRQ : 0 = IRQ enable */ -#define PSR_IRQF 0x00000080 /* IRQ : 0 = IRQ enable */ -#define PSR_FIQF 0x00000040 /* FIQ : 0 = FIQ enable */ +#define PSR_IRQFb 7 /* IRQ : 0 = IRQ enable */ +#define PSR_IRQF 0x00000080 /* IRQ : 0 = IRQ enable */ +#define PSR_FIQF 0x00000040 /* FIQ : 0 = FIQ enable */ /* * CPU mode */ -#define PSR_USER_MODE 0x00000010 /* User mode */ -#define PSR_FIQ_MODE 0x00000011 /* FIQ mode */ -#define PSR_IRQ_MODE 0x00000012 /* IRQ mode */ -#define PSR_SVC_MODE 0x00000013 /* Supervisor mode */ -#define PSR_ABT_MODE 0x00000017 /* Abort mode */ -#define PSR_UND_MODE 0x0000001B /* Undefined mode */ +#define PSR_USER_MODE 0x00000010 /* User mode */ +#define PSR_FIQ_MODE 0x00000011 /* FIQ mode */ +#define PSR_IRQ_MODE 0x00000012 /* IRQ mode */ +#define PSR_SVC_MODE 0x00000013 /* Supervisor mode */ +#define PSR_ABT_MODE 0x00000017 /* Abort mode */ +#define PSR_UND_MODE 0x0000001B /* Undefined mode */ -#define PSR_MODE_MASK 0x0000001F -#define PSR_IS_KERNEL(psr) (((psr) & PSR_MODE_MASK) != PSR_USER_MODE) -#define PSR_IS_USER(psr) (((psr) & PSR_MODE_MASK) == PSR_USER_MODE) +#define PSR_MODE_MASK 0x0000001F +#define PSR_IS_KERNEL(psr) (((psr) & PSR_MODE_MASK) != PSR_USER_MODE) +#define PSR_IS_USER(psr) (((psr) & PSR_MODE_MASK) == PSR_USER_MODE) -#define PSR_USERDFLT PSR_USER_MODE -#define PSR_USER_MASK (PSR_AF | PSR_IRQF | PSR_FIQF | PSR_MODE_MASK) -#define PSR_USER_SET PSR_USER_MODE +#define PSR_USERDFLT PSR_USER_MODE +#define PSR_USER_MASK (PSR_AF | PSR_IRQF | PSR_FIQF | PSR_MODE_MASK) +#define PSR_USER_SET PSR_USER_MODE -#define PSR_INTMASK PSR_IRQF /* Interrupt disable */ +#define PSR_INTMASK PSR_IRQF /* Interrupt disable */ /* * FPEXC: Floating-Point Exception Register */ -#define FPEXC_EX 0x80000000 /* Exception status */ -#define FPEXC_EX_BIT 31 -#define FPEXC_EN 0x40000000 /* VFP : 1 = EN enable */ -#define FPEXC_EN_BIT 30 +#define FPEXC_EX 0x80000000 /* Exception status */ +#define FPEXC_EX_BIT 31 +#define FPEXC_EN 0x40000000 /* VFP : 1 = EN enable */ +#define FPEXC_EN_BIT 30 /* * FPSCR: Floating-point Status and Control Register */ -#define FPSCR_DN 0x02000000 /* Default NaN */ -#define FPSCR_FZ 0x01000000 /* Flush to zero */ +#define FPSCR_DN 0x02000000 /* Default NaN */ +#define FPSCR_FZ 0x01000000 /* Flush to zero */ -#define FPSCR_DEFAULT FPSCR_DN | FPSCR_FZ +#define FPSCR_DEFAULT FPSCR_DN | FPSCR_FZ /* - * FSR registers + * FSR registers * * IFSR: Instruction Fault Status Register * DFSR: Data Fault Status Register */ -#define FSR_ALIGN 0x00000001 /* Alignment */ -#define FSR_DEBUG 0x00000002 /* Debug (watch/break) */ -#define FSR_ICFAULT 0x00000004 /* Fault on instruction cache maintenance */ -#define FSR_SFAULT 0x00000005 /* Translation Section */ -#define FSR_PFAULT 0x00000007 /* Translation Page */ -#define FSR_SACCESS 0x00000003 /* Section access */ -#define FSR_PACCESS 0x00000006 /* Page Access */ -#define FSR_SDOM 0x00000009 /* Domain Section */ -#define FSR_PDOM 0x0000000B /* Domain Page */ -#define FSR_SPERM 0x0000000D /* Permission Section */ -#define FSR_PPERM 0x0000000F /* Permission Page */ -#define FSR_EXT 0x00001000 /* External (Implementation Defined Classification) */ - -#define FSR_MASK 0x0000040F /* Valid bits */ -#define FSR_ALIGN_MASK 0x0000040D /* Valid bits to check align */ - -#define DFSR_WRITE 0x00000800 /* write data abort fault */ - -#if defined (ARMA7) || defined (APPLE_ARM64_ARCH_FAMILY) - -#define TEST_FSR_VMFAULT(status) \ - (((status) == FSR_PFAULT) \ - || ((status) == FSR_PPERM) \ - || ((status) == FSR_SFAULT) \ - || ((status) == FSR_SPERM) \ - || ((status) == FSR_ICFAULT) \ - || ((status) == FSR_SACCESS) \ - || ((status) == FSR_PACCESS)) +#define FSR_ALIGN 0x00000001 /* Alignment */ +#define FSR_DEBUG 0x00000002 /* Debug (watch/break) */ +#define FSR_ICFAULT 0x00000004 /* Fault on instruction cache maintenance */ +#define FSR_SFAULT 0x00000005 /* Translation Section */ +#define FSR_PFAULT 0x00000007 /* Translation Page */ +#define FSR_SACCESS 0x00000003 /* Section access */ +#define FSR_PACCESS 0x00000006 /* Page Access */ +#define FSR_SDOM 0x00000009 /* Domain Section */ +#define FSR_PDOM 0x0000000B /* Domain Page */ +#define FSR_SPERM 0x0000000D /* Permission Section */ +#define FSR_PPERM 0x0000000F /* Permission Page */ +#define FSR_EXT 0x00001000 /* External (Implementation Defined Classification) */ + +#define FSR_MASK 0x0000040F /* Valid bits */ +#define FSR_ALIGN_MASK 0x0000040D /* Valid bits to check align */ + +#define DFSR_WRITE 0x00000800 /* write data abort fault */ + +#if defined (ARMA7) || defined (APPLE_ARM64_ARCH_FAMILY) || defined (BCM2837) + +#define TEST_FSR_VMFAULT(status) \ + (((status) == FSR_PFAULT) \ + || ((status) == FSR_PPERM) \ + || ((status) == FSR_SFAULT) \ + || ((status) == FSR_SPERM) \ + || ((status) == FSR_ICFAULT) \ + || ((status) == FSR_SACCESS) \ + || ((status) == FSR_PACCESS)) + +#define TEST_FSR_TRANSLATION_FAULT(status) \ + (((status) == FSR_SFAULT) \ + || ((status) == FSR_PFAULT)) #else @@ -320,101 +396,106 @@ #if defined (ARMA7) /* I-Cache */ -#define MMU_I_CLINE 5 /* cache line size as 1<>1)&0x1)<>1)&0x1)<>2)&0x1)<>2)&0x1)<> PTE_SHIFT) /* number of ptes per page */ - -#define ARM_PTE_EMPTY 0x00000000 /* unasigned - invalid entry */ - /* markers for (invalid) PTE for a page sent to compressor */ -#define ARM_PTE_COMPRESSED ARM_PTE_TEX1 /* compressed... */ -#define ARM_PTE_COMPRESSED_ALT ARM_PTE_TEX2 /* ... and was "alt_acct" */ -#define ARM_PTE_COMPRESSED_MASK (ARM_PTE_COMPRESSED | ARM_PTE_COMPRESSED_ALT) -#define ARM_PTE_IS_COMPRESSED(x) \ - ((((x) & 0x3) == 0) && /* PTE is not valid... */ \ - ((x) & ARM_PTE_COMPRESSED) && /* ...has "compressed" marker" */ \ - ((!((x) & ~ARM_PTE_COMPRESSED_MASK)) || /* ...no other bits */ \ - (panic("compressed PTE %p 0x%x has extra bits 0x%x: corrupted?", \ - &(x), (x), (x) & ~ARM_PTE_COMPRESSED_MASK), FALSE))) - -#define ARM_PTE_TYPE_FAULT 0x00000000 /* fault entry type */ -#define ARM_PTE_TYPE 0x00000002 /* small page entry type */ -#define ARM_PTE_TYPE_MASK 0x00000002 /* mask to get pte type */ - -#define ARM_PTE_NG_MASK 0x00000800 /* mask to determine notGlobal bit */ -#define ARM_PTE_NG 0x00000800 /* value for a per-process mapping */ - -#define ARM_PTE_SHSHIFT 10 -#define ARM_PTE_SH_MASK 0x00000400 /* shared (SMP) mapping mask */ -#define ARM_PTE_SH 0x00000400 /* shared (SMP) mapping */ - -#define ARM_PTE_CBSHIFT 2 -#define ARM_PTE_CB(x) ((x)<>1)&0x1)<>2)&0x1)<> PTE_SHIFT) /* number of ptes per page */ + +#define ARM_PTE_EMPTY 0x00000000 /* unasigned - invalid entry */ + +#define ARM_PTE_TYPE_FAULT 0x00000000 /* fault entry type */ +#define ARM_PTE_TYPE_VALID 0x00000002 /* valid L2 entry */ +#define ARM_PTE_TYPE 0x00000002 /* small page entry type */ +#define ARM_PTE_TYPE_MASK 0x00000002 /* mask to get pte type */ + +#define ARM_PTE_NG_MASK 0x00000800 /* mask to determine notGlobal bit */ +#define ARM_PTE_NG 0x00000800 /* value for a per-process mapping */ + +#define ARM_PTE_SHSHIFT 10 +#define ARM_PTE_SHMASK 0x00000400 /* shared (SMP) mapping mask */ +#define ARM_PTE_SH 0x00000400 /* shared (SMP) mapping */ + +#define ARM_PTE_CBSHIFT 2 +#define ARM_PTE_CB(x) ((x)<>1)&0x1)<>2)&0x1)<