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

TOMOYO Linux Cross Reference
Linux/arch/hexagon/lib/io.c

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-only
  2 /*
  3  * I/O access functions for Hexagon
  4  *
  5  * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  6  */
  7 
  8 #include <asm/io.h>
  9 
 10 /*  These are all FIFO routines!  */
 11 
 12 /*
 13  * __raw_readsw - read words a short at a time
 14  * @addr:  source address
 15  * @data:  data address
 16  * @len: number of shorts to read
 17  */
 18 void __raw_readsw(const void __iomem *addr, void *data, int len)
 19 {
 20         const volatile short int *src = (short int *) addr;
 21         short int *dst = (short int *) data;
 22 
 23         if ((u32)data & 0x1)
 24                 panic("unaligned pointer to readsw");
 25 
 26         while (len-- > 0)
 27                 *dst++ = *src;
 28 
 29 }
 30 EXPORT_SYMBOL(__raw_readsw);
 31 
 32 /*
 33  * __raw_writesw - read words a short at a time
 34  * @addr:  source address
 35  * @data:  data address
 36  * @len: number of shorts to read
 37  */
 38 void __raw_writesw(void __iomem *addr, const void *data, int len)
 39 {
 40         const short int *src = (short int *)data;
 41         volatile short int *dst = (short int *)addr;
 42 
 43         if ((u32)data & 0x1)
 44                 panic("unaligned pointer to writesw");
 45 
 46         while (len-- > 0)
 47                 *dst = *src++;
 48 
 49 
 50 }
 51 EXPORT_SYMBOL(__raw_writesw);
 52 
 53 /*  Pretty sure len is pre-adjusted for the length of the access already */
 54 void __raw_readsl(const void __iomem *addr, void *data, int len)
 55 {
 56         const volatile long *src = (long *) addr;
 57         long *dst = (long *) data;
 58 
 59         if ((u32)data & 0x3)
 60                 panic("unaligned pointer to readsl");
 61 
 62         while (len-- > 0)
 63                 *dst++ = *src;
 64 
 65 
 66 }
 67 EXPORT_SYMBOL(__raw_readsl);
 68 
 69 void __raw_writesl(void __iomem *addr, const void *data, int len)
 70 {
 71         const long *src = (long *)data;
 72         volatile long *dst = (long *)addr;
 73 
 74         if ((u32)data & 0x3)
 75                 panic("unaligned pointer to writesl");
 76 
 77         while (len-- > 0)
 78                 *dst = *src++;
 79 
 80 
 81 }
 82 EXPORT_SYMBOL(__raw_writesl);
 83 

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