GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / arch / arm / common / src / lib_physio.S
blob5cfb2c793c13387bd1600e916a3c438cbf10740e
1 /*  *********************************************************************
2     *  Broadcom Common Firmware Environment (CFE)
3     *  
4     *  Physical memory peek/poke routines       File: lib_physio.S
5     *  
6     *  Little stub routines to allow access to arbitrary physical
7     *  addresses.  In most cases this should not be needed, as
8     *  many physical addresses are within kseg1, but this handles
9     *  the cases that are not automagically, so we don't need
10     *  to mess up the code with icky macros and such.
11     *  
12     *  Author:
13     *  
14     *********************************************************************  
15     *
16     *  Copyright 2000,2001,2002,2003
17     *  Broadcom Corporation. All rights reserved.
18     *  
19     *  This software is furnished under license and may be used and 
20     *  copied only in accordance with the following terms and 
21     *  conditions.  Subject to these conditions, you may download, 
22     *  copy, install, use, modify and distribute modified or unmodified 
23     *  copies of this software in source and/or binary form.  No title 
24     *  or ownership is transferred hereby.
25     *  
26     *  1) Any source code used, modified or distributed must reproduce 
27     *     and retain this copyright notice and list of conditions 
28     *     as they appear in the source file.
29     *  
30     *  2) No right is granted to use any trade name, trademark, or 
31     *     logo of Broadcom Corporation.  The "Broadcom Corporation" 
32     *     name may not be used to endorse or promote products derived 
33     *     from this software without the prior written permission of 
34     *     Broadcom Corporation.
35     *  
36     *  3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
37     *     IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
38     *     WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
39     *     PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT 
40     *     SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN 
41     *     PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
42     *     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
43     *     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
44     *     GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
45     *     BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
46     *     OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
47     *     TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF 
48     *     THE POSSIBILITY OF SUCH DAMAGE.
49     ********************************************************************* */
52 #include <arminc.h>
53 #include <armmacros.h>
56 /*  *********************************************************************
57     *  PHYSOP(inst,a)
58     *  
59     *  Macro to construct code for doing the physical I/O
60     *  We try to avoid messing with KX or doing 64-bit stuff
61     *  unless necessary.
62     *  
63     *  r0: addr / return value
64     *  r1: value
65     *      
66     *  Return value:
67     *      nothing
68     ********************************************************************* */
70 /*  *********************************************************************
71     *  phys_read8 - read 8-bit bytes
72     ********************************************************************* */
74 FUNC(phys_read8)
75         ldrb  r1, [r0]
76         mov  r0, r1
77         mov  pc, lr
78 END(phys_read8)
80 /*  *********************************************************************
81     *  phys_read16 - read 16-bit shorts
82     ********************************************************************* */
84 FUNC(phys_read16)
85         ldrh  r1, [r0]
86         mov  r0, r1
87         mov  pc, lr
88 END(phys_read16)
90 /*  *********************************************************************
91     *  phys_read32 - read 32-bit ints
92     ********************************************************************* */
94 FUNC(phys_read32)
95         ldr  r1, [r0]
96         mov  r0, r1
97         mov  pc, lr
98 END(phys_read32)
100 /*  *********************************************************************
101     *  phys_read64 - read 64-bit longs
102     ********************************************************************* */
104 FUNC(phys_read64)
105         ldr  r1, [r0]
106         mov  r0, r1
107         mov  pc, lr
108 END(phys_read64)
110 /*  *********************************************************************
111     *  phys_write8 - write 8-bit bytes
112     ********************************************************************* */
114 FUNC(phys_write8)
115         /* r0: addr, r1: value */
116         strb r1, [r0]
117         mov  pc, lr
118 END(phys_write8)
120 /*  *********************************************************************
121     *  phys_write16 - write 16-bit shorts
122     ********************************************************************* */
124 FUNC(phys_write16)
125         /* r0: addr, r1: value */
126         strh r1, [r0]
127         mov  pc, lr
128 END(phys_write16)
130 /*  *********************************************************************
131     *  phys_write32 - write 32-bit longs
132     ********************************************************************* */
134 FUNC(phys_write32)
135         /* r0: addr, r1: value */
136         str r1, [r0]
137         mov  pc, lr
138 END(phys_write32)
140 /*  *********************************************************************
141     *  phys_write64 - write 64-bit longs
142     ********************************************************************* */
143 FUNC(phys_write64)
144         /* r0: addr, r1: value */
145         str r1, [r0]
146         mov  pc, lr
147 END(phys_write64)
150 /*  *********************************************************************
151     *  End
152     ********************************************************************* */