My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sw_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  * @brief header file for common io functions.
25  */
26 
27 #ifndef __LIB_IO_H_
28 #define __LIB_IO_H_
29 
30 #include <sw_types.h>
31 
32 
41 static inline u8 sw_readb(volatile void *addr)
42 {
43  return *(u8*)addr;
44 }
45 
52 static inline void sw_writeb(u8 data, volatile void *addr)
53 {
54  *(u8*)addr = data;
55 }
56 
64 static inline u16 sw_readw(volatile void *addr)
65 {
66  return *(u16*)addr;
67 }
68 
75 static inline void sw_writew(u16 data, volatile void *addr)
76 {
77  *(u16*)addr = data;
78 }
79 
87 static inline u32 sw_readl(volatile void *addr)
88 {
89  return *(u32*)addr;
90 }
91 
98 static inline void sw_writel(u32 data, volatile void *addr)
99 {
100  *(u32*)addr = data;
101 }
102 
103 #endif /* __LIB_IO_H_ */
u8 * data
Definition: fat32.c:40