My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cpu_io.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * header file for CPU I/O or Memory read/write functions
25  *
26  */
27 
28 #ifndef _TZ_CPU_IO_H__
29 #define _TZ_CPU_IO_H__
30 
31 #include <sw_types.h>
32 
33 #define __swab32(x) \
34  ((u32)( \
35  (((u32)(x) & (u32)0x000000ffUL) << 24) | \
36  (((u32)(x) & (u32)0x0000ff00UL) << 8) | \
37  (((u32)(x) & (u32)0x00ff0000UL) >> 8) | \
38  (((u32)(x) & (u32)0xff000000UL) >> 24) ))
39 
40 #define __be32_to_cpu(x) __swab32((x))
41 
42 
43 
51 static inline u8 sw_cpu_in_8(volatile u8 * addr)
52 {
53  return *addr;
54 }
55 
62 static inline void sw_cpu_out_8(volatile u8 * addr, u8 data)
63 {
64  *addr = data;
65 }
66 
74 static inline u16 sw_cpu_in_le16(volatile u16 * addr)
75 {
76  return *addr;
77 }
78 
85 static inline void sw_cpu_out_le16(volatile u16 * addr, u16 data)
86 {
87  *addr = data;
88 }
89 
97 static inline u32 sw_cpu_in_le32(volatile u32 * addr)
98 {
99  return *addr;
100 }
101 
108 static inline void sw_cpu_out_le32(volatile u32 * addr, u32 data)
109 {
110  *addr = data;
111 }
112 
113 #endif
u8 * data
Definition: fat32.c:40