diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-01-10 22:02:26 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-01-10 22:02:26 +0000 |
commit | b42509b14f9fb7f9640cc078e7cd1b6e71872c22 (patch) | |
tree | 28e1fd6556aeb57a23d86577f9520e3227135654 | |
parent | 7c5169d4c5f1e7b7b2cb0a8ebe247991d3ee8632 (diff) | |
download | rockbox-b42509b14f9fb7f9640cc078e7cd1b6e71872c22.tar.gz rockbox-b42509b14f9fb7f9640cc078e7cd1b6e71872c22.zip |
Jean-Philippe Bernardy: TCC730 adjustments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5556 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/system.h | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index 09efbeeda4..74074d543f 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -100,7 +100,7 @@ static inline unsigned short SWAB16(unsigned short value) | |||
100 | /* | 100 | /* |
101 | result[15..8] = value[ 7..0]; | 101 | result[15..8] = value[ 7..0]; |
102 | result[ 7..0] = value[15..8]; | 102 | result[ 7..0] = value[15..8]; |
103 | */ | 103 | */ |
104 | { | 104 | { |
105 | short result; | 105 | short result; |
106 | asm volatile ("swap.b\t%1,%0" : "=r"(result) : "r"(value)); | 106 | asm volatile ("swap.b\t%1,%0" : "=r"(result) : "r"(value)); |
@@ -111,7 +111,7 @@ static inline unsigned long SWAW32(unsigned long value) | |||
111 | /* | 111 | /* |
112 | result[31..16] = value[15.. 0]; | 112 | result[31..16] = value[15.. 0]; |
113 | result[15.. 0] = value[31..16]; | 113 | result[15.. 0] = value[31..16]; |
114 | */ | 114 | */ |
115 | { | 115 | { |
116 | long result; | 116 | long result; |
117 | asm volatile ("swap.w\t%1,%0" : "=r"(result) : "r"(value)); | 117 | asm volatile ("swap.w\t%1,%0" : "=r"(result) : "r"(value)); |
@@ -124,7 +124,7 @@ static inline unsigned long SWAB32(unsigned long value) | |||
124 | result[23..16] = value[15.. 8]; | 124 | result[23..16] = value[15.. 8]; |
125 | result[15.. 8] = value[23..16]; | 125 | result[15.. 8] = value[23..16]; |
126 | result[ 7.. 0] = value[31..24]; | 126 | result[ 7.. 0] = value[31..24]; |
127 | */ | 127 | */ |
128 | { | 128 | { |
129 | asm volatile ("swap.b\t%0,%0\n" | 129 | asm volatile ("swap.b\t%0,%0\n" |
130 | "swap.w\t%0,%0\n" | 130 | "swap.w\t%0,%0\n" |
@@ -159,7 +159,7 @@ static inline unsigned short SWAB16(unsigned short value) | |||
159 | /* | 159 | /* |
160 | result[15..8] = value[ 7..0]; | 160 | result[15..8] = value[ 7..0]; |
161 | result[ 7..0] = value[15..8]; | 161 | result[ 7..0] = value[15..8]; |
162 | */ | 162 | */ |
163 | { | 163 | { |
164 | return (value >> 8) | (value << 8); | 164 | return (value >> 8) | (value << 8); |
165 | } | 165 | } |
@@ -170,13 +170,54 @@ static inline unsigned long SWAB32(unsigned long value) | |||
170 | result[23..16] = value[15.. 8]; | 170 | result[23..16] = value[15.. 8]; |
171 | result[15.. 8] = value[23..16]; | 171 | result[15.. 8] = value[23..16]; |
172 | result[ 7.. 0] = value[31..24]; | 172 | result[ 7.. 0] = value[31..24]; |
173 | */ | 173 | */ |
174 | { | 174 | { |
175 | unsigned short hi = SWAB16(value >> 16); | 175 | unsigned short hi = SWAB16(value >> 16); |
176 | unsigned short lo = SWAB16(value & 0xffff); | 176 | unsigned short lo = SWAB16(value & 0xffff); |
177 | return (lo << 16) | hi; | 177 | return (lo << 16) | hi; |
178 | } | 178 | } |
179 | 179 | ||
180 | #elif CONFIG_CPU == TCC730 | ||
181 | |||
182 | extern void* interrupt_vector[16] __attribute__ ((section(".idata"))); | ||
183 | |||
184 | extern void ddma_transfer(int dir, int mem, long intAddr, void* extAddr, | ||
185 | int num); | ||
186 | |||
187 | static inline void clear_watchdog(void) | ||
188 | { | ||
189 | WDTCON = 0x0A; | ||
190 | } | ||
191 | |||
192 | |||
193 | #define HIGHEST_IRQ_LEVEL (1<<15) | ||
194 | static inline int set_irq_level(int level) | ||
195 | { | ||
196 | return 0; | ||
197 | } | ||
198 | |||
199 | static inline unsigned short SWAB16(unsigned short value) | ||
200 | /* | ||
201 | result[15..8] = value[ 7..0]; | ||
202 | result[ 7..0] = value[15..8]; | ||
203 | */ | ||
204 | { | ||
205 | return (value >> 8) | (value << 8); | ||
206 | } | ||
207 | |||
208 | static inline unsigned long SWAB32(unsigned long value) | ||
209 | /* | ||
210 | result[31..24] = value[ 7.. 0]; | ||
211 | result[23..16] = value[15.. 8]; | ||
212 | result[15.. 8] = value[23..16]; | ||
213 | result[ 7.. 0] = value[31..24]; | ||
214 | */ | ||
215 | { | ||
216 | unsigned short hi = SWAB16(value >> 16); | ||
217 | unsigned long lo = SWAB16(value & 0xffff); | ||
218 | return (lo << 16) | hi; | ||
219 | } | ||
220 | |||
180 | #endif | 221 | #endif |
181 | #endif | 222 | #endif |
182 | 223 | ||