Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
mips
include
asm
octeon
cvmx-scratch.h
Go to the documentation of this file.
1
/***********************license start***************
2
* Author: Cavium Networks
3
*
4
* Contact:
[email protected]
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
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
51
static
inline
uint8_t
cvmx_scratch_read8(
uint64_t
address
)
52
{
53
return
*
CASTPTR
(
volatile
uint8_t
,
CVMX_SCRATCH_BASE
+ address);
54
}
55
63
static
inline
uint16_t
cvmx_scratch_read16(
uint64_t
address
)
64
{
65
return
*
CASTPTR
(
volatile
uint16_t
,
CVMX_SCRATCH_BASE
+ address);
66
}
67
75
static
inline
uint32_t
cvmx_scratch_read32(
uint64_t
address
)
76
{
77
return
*
CASTPTR
(
volatile
uint32_t
,
CVMX_SCRATCH_BASE
+ address);
78
}
79
87
static
inline
uint64_t
cvmx_scratch_read64(
uint64_t
address
)
88
{
89
return
*
CASTPTR
(
volatile
uint64_t
,
CVMX_SCRATCH_BASE
+ address);
90
}
91
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
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
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
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__ */
Generated on Thu Jan 10 2013 13:10:43 for Linux Kernel by
1.8.2