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

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/octeon/cvmx-scratch.h

Version: ~ [ linux-5.7 ] ~ [ linux-5.6.15 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.43 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.125 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.182 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.225 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.225 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.84 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /***********************license start***************
  2  * Author: Cavium Networks
  3  *
  4  * Contact: support@caviumnetworks.com
  5  * This file is part of the OCTEON SDK
  6  *
  7  * Copyright (c) 2003-2008 Cavium Networks
  8  *
  9  * This file is free software; you can redistribute it and/or modify
 10  * it under the terms of the GNU General Public License, Version 2, as
 11  * published by the Free Software Foundation.
 12  *
 13  * This file is distributed in the hope that it will be useful, but
 14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
 16  * NONINFRINGEMENT.  See the GNU General Public License for more
 17  * details.
 18  *
 19  * You should have received a copy of the GNU General Public License
 20  * along with this file; if not, write to the Free Software
 21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 22  * or visit http://www.gnu.org/licenses/.
 23  *
 24  * This file may also be available under a different license from Cavium.
 25  * Contact Cavium Networks for more information
 26  ***********************license end**************************************/
 27 
 28 /**
 29  *
 30  * This file provides support for the processor local scratch memory.
 31  * Scratch memory is byte addressable - all addresses are byte addresses.
 32  *
 33  */
 34 
 35 #ifndef __CVMX_SCRATCH_H__
 36 #define __CVMX_SCRATCH_H__
 37 
 38 /*
 39  * Note: This define must be a long, not a long long in order to
 40  * compile without warnings for both 32bit and 64bit.
 41  */
 42 #define CVMX_SCRATCH_BASE       (-32768l)       /* 0xffffffffffff8000 */
 43 
 44 /**
 45  * Reads an 8 bit value from the processor local scratchpad memory.
 46  *
 47  * @address: byte address to read from
 48  *
 49  * Returns value read
 50  */
 51 static inline uint8_t cvmx_scratch_read8(uint64_t address)
 52 {
 53         return *CASTPTR(volatile uint8_t, CVMX_SCRATCH_BASE + address);
 54 }
 55 
 56 /**
 57  * Reads a 16 bit value from the processor local scratchpad memory.
 58  *
 59  * @address: byte address to read from
 60  *
 61  * Returns value read
 62  */
 63 static inline uint16_t cvmx_scratch_read16(uint64_t address)
 64 {
 65         return *CASTPTR(volatile uint16_t, CVMX_SCRATCH_BASE + address);
 66 }
 67 
 68 /**
 69  * Reads a 32 bit value from the processor local scratchpad memory.
 70  *
 71  * @address: byte address to read from
 72  *
 73  * Returns value read
 74  */
 75 static inline uint32_t cvmx_scratch_read32(uint64_t address)
 76 {
 77         return *CASTPTR(volatile uint32_t, CVMX_SCRATCH_BASE + address);
 78 }
 79 
 80 /**
 81  * Reads a 64 bit value from the processor local scratchpad memory.
 82  *
 83  * @address: byte address to read from
 84  *
 85  * Returns value read
 86  */
 87 static inline uint64_t cvmx_scratch_read64(uint64_t address)
 88 {
 89         return *CASTPTR(volatile uint64_t, CVMX_SCRATCH_BASE + address);
 90 }
 91 
 92 /**
 93  * Writes an 8 bit value to the processor local scratchpad memory.
 94  *
 95  * @address: byte address to write to
 96  * @value:   value to write
 97  */
 98 static inline void cvmx_scratch_write8(uint64_t address, uint64_t value)
 99 {
100         *CASTPTR(volatile uint8_t, CVMX_SCRATCH_BASE + address) =
101             (uint8_t) value;
102 }
103 
104 /**
105  * Writes a 32 bit value to the processor local scratchpad memory.
106  *
107  * @address: byte address to write to
108  * @value:   value to write
109  */
110 static inline void cvmx_scratch_write16(uint64_t address, uint64_t value)
111 {
112         *CASTPTR(volatile uint16_t, CVMX_SCRATCH_BASE + address) =
113             (uint16_t) value;
114 }
115 
116 /**
117  * Writes a 16 bit value to the processor local scratchpad memory.
118  *
119  * @address: byte address to write to
120  * @value:   value to write
121  */
122 static inline void cvmx_scratch_write32(uint64_t address, uint64_t value)
123 {
124         *CASTPTR(volatile uint32_t, CVMX_SCRATCH_BASE + address) =
125             (uint32_t) value;
126 }
127 
128 /**
129  * Writes a 64 bit value to the processor local scratchpad memory.
130  *
131  * @address: byte address to write to
132  * @value:   value to write
133  */
134 static inline void cvmx_scratch_write64(uint64_t address, uint64_t value)
135 {
136         *CASTPTR(volatile uint64_t, CVMX_SCRATCH_BASE + address) = value;
137 }
138 
139 #endif /* __CVMX_SCRATCH_H__ */
140 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp