Setting up repository
[linux-libre-firmware.git] / ath9k_htc / sboot / magpie_1_1 / sboot / athos / src / xtos / deprecated.S
1 // deprecated.S -- Deprecated assembler functions
2
3 // Copyright (c) 2003-2010 Tensilica Inc.
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining
6 // a copy of this software and associated documentation files (the
7 // "Software"), to deal in the Software without restriction, including
8 // without limitation the rights to use, copy, modify, merge, publish,
9 // distribute, sublicense, and/or sell copies of the Software, and to
10 // permit persons to whom the Software is furnished to do so, subject to
11 // the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included
14 // in all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 #include <xtensa/coreasm.h>
25 #include <xtensa/config/specreg.h>
26 #include "xtos-internal.h"
27
28
29
30         .text 
31
32 /*
33         void _xtos_timer_<N>_delta(int cycles)
34
35         Set the timer from the current ccount.
36         DEPRECATED.  PLEASE USE xthal_set_ccompare() AND xthal_get_ccount()
37         INSTEAD, OR USE DIFFERENT ALGORITHM THAT UPDATES CCOMPAREn RELATIVE TO
38         LAST CCOMPAREn FOR DRIFT-FREE PERIODIC TIMER INTERRUPTS.
39 */
40         .macro  define_timer_delta      num, numtimers
41         .if ((\num-\numtimers) & ~0xFFF)        // num < numtimers ?
42         .align 4 
43         .global _xtos_timer_&num&_delta
44         .type _xtos_timer_&num&_delta,@function
45 _xtos_timer_&num&_delta:
46         abi_entry
47         rsr     a3, CCOUNT
48         add     a3, a3, a2
49         wsr     a3, CCOMPARE_0+&num&
50         abi_return
51         .size _xtos_timer_&num&_delta, . - _xtos_timer_&num&_delta
52         .endif
53         .endm
54
55
56
57 #if   defined(__SPLIT__t0_delta)
58
59         define_timer_delta      0, XCHAL_NUM_TIMERS
60
61 #elif defined(__SPLIT__t1_delta)
62
63         define_timer_delta      1, XCHAL_NUM_TIMERS
64
65 #elif defined(__SPLIT__t2_delta)
66
67         define_timer_delta      2, XCHAL_NUM_TIMERS
68
69 #elif defined(__SPLIT__t3_delta)
70
71         define_timer_delta      3, XCHAL_NUM_TIMERS
72
73
74 #elif defined(__SPLIT__read_ints)
75
76         //
77         // u32 _xtos_read_ints( void )
78         // 
79         // _xtos_read_ints() reads the INTERRUPT register and returns it.
80         // DEPRECATED.  PLEASE USE xthal_get_interrupt() INSTEAD.
81         // [Kept temporarily because it was documented in T1050 System SW Ref Manual.]
82         //
83         .text 
84         .align 4 
85         .global _xtos_read_ints
86         .type _xtos_read_ints,@function
87 _xtos_read_ints:
88         abi_entry
89 #if XCHAL_HAVE_INTERRUPTS
90         rsr     a2, INTERRUPT
91 #else /*XCHAL_HAVE_INTERRUPTS*/
92         movi    a2, 0
93 #endif /*XCHAL_HAVE_INTERRUPTS*/
94         abi_return
95         .size   _xtos_read_ints, . - _xtos_read_ints
96
97
98 #elif defined(__SPLIT__clear_ints)
99
100         //
101         // void _xtos_clear_ints( u32 mask )
102         //
103         // _xtos_clear_ints() clears selected bits of the INTERRUPT register.
104         // DEPRECATED.  PLEASE USE xthal_set_intclear() INSTEAD.
105         // [Kept temporarily because it was documented in T1050 System SW Ref Manual.]
106         //
107         .text 
108         .align 4 
109         .global _xtos_clear_ints
110         .type _xtos_clear_ints,@function
111 _xtos_clear_ints:
112         abi_entry
113 #if XCHAL_HAVE_INTERRUPTS
114         wsr     a2, INTCLEAR
115 #endif /*XCHAL_HAVE_INTERRUPTS*/
116         abi_return
117         .size   _xtos_clear_ints, . - _xtos_clear_ints
118
119 #endif /* splitting */
120