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

TOMOYO Linux Cross Reference
Linux/arch/loongarch/include/asm/io.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 ] ~

Diff markup

Differences between /arch/loongarch/include/asm/io.h (Architecture ppc) and /arch/sparc64/include/asm-sparc64/io.h (Architecture sparc64)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 2020-2022 Loongson Technology    
  4  */                                               
  5 #ifndef _ASM_IO_H                                 
  6 #define _ASM_IO_H                                 
  7                                                   
  8 #include <linux/kernel.h>                         
  9 #include <linux/types.h>                          
 10                                                   
 11 #include <asm/addrspace.h>                        
 12 #include <asm/cpu.h>                              
 13 #include <asm/page.h>                             
 14 #include <asm/pgtable-bits.h>                     
 15 #include <asm/string.h>                           
 16                                                   
 17 extern void __init __iomem *early_ioremap(u64     
 18 extern void __init early_iounmap(void __iomem     
 19                                                   
 20 #define early_memremap early_ioremap              
 21 #define early_memunmap early_iounmap              
 22                                                   
 23 #ifdef CONFIG_ARCH_IOREMAP                        
 24                                                   
 25 static inline void __iomem *ioremap_prot(phys_    
 26                                          unsig    
 27 {                                                 
 28         switch (prot_val & _CACHE_MASK) {         
 29         case _CACHE_CC:                           
 30                 return (void __iomem *)(unsign    
 31         case _CACHE_SUC:                          
 32                 return (void __iomem *)(unsign    
 33         case _CACHE_WUC:                          
 34                 return (void __iomem *)(unsign    
 35         default:                                  
 36                 return NULL;                      
 37         }                                         
 38 }                                                 
 39                                                   
 40 #define ioremap(offset, size)           \         
 41         ioremap_prot((offset), (size), pgprot_    
 42                                                   
 43 #define iounmap(addr)                   ((void    
 44                                                   
 45 #endif                                            
 46                                                   
 47 /*                                                
 48  * On LoongArch, ioremap() has two variants, i    
 49  * They map bus memory into CPU space, the map    
 50  * (_CACHE_SUC), uncachable but accelerated by    
 51  * cachable (_CACHE_CC) respectively for CPU a    
 52  *                                                
 53  * @offset:    bus address of the memory          
 54  * @size:      size of the resource to map        
 55  */                                               
 56 #define ioremap_wc(offset, size)        \         
 57         ioremap_prot((offset), (size),  \         
 58                 pgprot_val(wc_enabled ? PAGE_K    
 59                                                   
 60 #define ioremap_cache(offset, size)     \         
 61         ioremap_prot((offset), (size), pgprot_    
 62                                                   
 63 #define mmiowb() wmb()                            
 64                                                   
 65 /*                                                
 66  * String version of I/O memory access operati    
 67  */                                               
 68 extern void __memset_io(volatile void __iomem     
 69 extern void __memcpy_toio(volatile void __iome    
 70 extern void __memcpy_fromio(void *to, const vo    
 71 #define memset_io(c, v, l)     __memset_io((c)    
 72 #define memcpy_fromio(a, c, l) __memcpy_fromio    
 73 #define memcpy_toio(c, a, l)   __memcpy_toio((    
 74                                                   
 75 #define __io_aw() mmiowb()                        
 76                                                   
 77 #ifdef CONFIG_KFENCE                              
 78 #define virt_to_phys(kaddr)                       
 79 ({                                                
 80         (likely((unsigned long)kaddr < vm_map_    
 81         page_to_phys(tlb_virt_to_page((unsigne    
 82 })                                                
 83                                                   
 84 #define phys_to_virt(paddr)                       
 85 ({                                                
 86         extern char *__kfence_pool;               
 87         (unlikely(__kfence_pool == NULL)) ? __    
 88         page_address(phys_to_page((unsigned lo    
 89 })                                                
 90 #endif                                            
 91                                                   
 92 #include <asm-generic/io.h>                       
 93                                                   
 94 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE            
 95 extern int valid_phys_addr_range(phys_addr_t a    
 96 extern int valid_mmap_phys_addr_range(unsigned    
 97                                                   
 98 #endif /* _ASM_IO_H */                            
 99                                                   

~ [ 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