~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/include/asm/virt.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Copyright (c) 2012 Linaro Limited.
  4  */
  5 
  6 #ifndef VIRT_H
  7 #define VIRT_H
  8 
  9 #include <asm/ptrace.h>
 10 
 11 /*
 12  * Flag indicating that the kernel was not entered in the same mode on every
 13  * CPU.  The zImage loader stashes this value in an SPSR, so we need an
 14  * architecturally defined flag bit here.
 15  */
 16 #define BOOT_CPU_MODE_MISMATCH  PSR_N_BIT
 17 
 18 #ifndef __ASSEMBLY__
 19 #include <asm/cacheflush.h>
 20 
 21 #ifdef CONFIG_ARM_VIRT_EXT
 22 /*
 23  * __boot_cpu_mode records what mode the primary CPU was booted in.
 24  * A correctly-implemented bootloader must start all CPUs in the same mode:
 25  * if it fails to do this, the flag BOOT_CPU_MODE_MISMATCH is set to indicate
 26  * that some CPU(s) were booted in a different mode.
 27  *
 28  * This allows the kernel to flag an error when the secondaries have come up.
 29  */
 30 extern int __boot_cpu_mode;
 31 
 32 static inline void sync_boot_mode(void)
 33 {
 34         /*
 35          * As secondaries write to __boot_cpu_mode with caches disabled, we
 36          * must flush the corresponding cache entries to ensure the visibility
 37          * of their writes.
 38          */
 39         sync_cache_r(&__boot_cpu_mode);
 40 }
 41 
 42 #else
 43 #define __boot_cpu_mode (SVC_MODE)
 44 #define sync_boot_mode()
 45 #endif
 46 
 47 #ifndef ZIMAGE
 48 void hyp_mode_check(void);
 49 
 50 /* Reports the availability of HYP mode */
 51 static inline bool is_hyp_mode_available(void)
 52 {
 53         return ((__boot_cpu_mode & MODE_MASK) == HYP_MODE &&
 54                 !(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH));
 55 }
 56 
 57 /* Check if the bootloader has booted CPUs in different modes */
 58 static inline bool is_hyp_mode_mismatched(void)
 59 {
 60         return !!(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH);
 61 }
 62 
 63 static inline bool is_kernel_in_hyp_mode(void)
 64 {
 65         return false;
 66 }
 67 
 68 #endif
 69 
 70 #else
 71 
 72 /* Only assembly code should need those */
 73 
 74 #define HVC_SET_VECTORS 0
 75 #define HVC_SOFT_RESTART 1
 76 
 77 #endif /* __ASSEMBLY__ */
 78 
 79 #define HVC_STUB_ERR    0xbadca11
 80 
 81 #endif /* ! VIRT_H */
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php