diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-05-31 16:33:22 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-05-31 16:33:22 +0000 |
commit | b2afc258dc6e87bfc5684bb87eb38b52d0138212 (patch) | |
tree | 85b6d7555add9a52db420896b840087cb168f07f | |
parent | 3651319d45b400899392751ae76a141be2b7de20 (diff) | |
download | rockbox-b2afc258dc6e87bfc5684bb87eb38b52d0138212.tar.gz rockbox-b2afc258dc6e87bfc5684bb87eb38b52d0138212.zip |
Old patch from FS#7832: Sprinkle 'volatile' in the various inline assembler statements, needed for the driver to work when compiled with newer gcc, should make no functional difference with the currently used version
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21147 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/coldfire/pcf50606-coldfire.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/firmware/target/coldfire/pcf50606-coldfire.c b/firmware/target/coldfire/pcf50606-coldfire.c index 8ee38840d6..03c22a12e9 100644 --- a/firmware/target/coldfire/pcf50606-coldfire.c +++ b/firmware/target/coldfire/pcf50606-coldfire.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #define SCL_HI_IN and_l(~SCL_BIT, &SCL_GPIO_ENABLE); while(!SCL); | 61 | #define SCL_HI_IN and_l(~SCL_BIT, &SCL_GPIO_ENABLE); while(!SCL); |
62 | 62 | ||
63 | #define DELAY \ | 63 | #define DELAY \ |
64 | asm ( \ | 64 | asm volatile ( \ |
65 | "move.l %[dly],%%d0 \n" \ | 65 | "move.l %[dly],%%d0 \n" \ |
66 | "1: \n" \ | 66 | "1: \n" \ |
67 | "subq.l #1,%%d0 \n" \ | 67 | "subq.l #1,%%d0 \n" \ |
@@ -89,7 +89,7 @@ void pcf50606_i2c_recalc_delay(int cpu_clock) | |||
89 | inline void pcf50606_i2c_start(void) | 89 | inline void pcf50606_i2c_start(void) |
90 | { | 90 | { |
91 | #ifdef USE_ASM | 91 | #ifdef USE_ASM |
92 | asm ( | 92 | asm volatile ( |
93 | "not.l %[sdab] \n" /* SDA_HI_IN */ | 93 | "not.l %[sdab] \n" /* SDA_HI_IN */ |
94 | "and.l %[sdab],(8,%[sdard]) \n" | 94 | "and.l %[sdab],(8,%[sdard]) \n" |
95 | "not.l %[sdab] \n" | 95 | "not.l %[sdab] \n" |
@@ -139,7 +139,7 @@ inline void pcf50606_i2c_start(void) | |||
139 | inline void pcf50606_i2c_stop(void) | 139 | inline void pcf50606_i2c_stop(void) |
140 | { | 140 | { |
141 | #ifdef USE_ASM | 141 | #ifdef USE_ASM |
142 | asm ( | 142 | asm volatile ( |
143 | "or.l %[sdab],(8,%[sdard]) \n" /* SDA_LO_OUT */ | 143 | "or.l %[sdab],(8,%[sdard]) \n" /* SDA_LO_OUT */ |
144 | 144 | ||
145 | "move.l %[dly],%%d0 \n" /* DELAY */ | 145 | "move.l %[dly],%%d0 \n" /* DELAY */ |
@@ -186,7 +186,7 @@ inline void pcf50606_i2c_stop(void) | |||
186 | inline void pcf50606_i2c_ack(bool ack) | 186 | inline void pcf50606_i2c_ack(bool ack) |
187 | { | 187 | { |
188 | #ifdef USE_ASM | 188 | #ifdef USE_ASM |
189 | asm ( | 189 | asm volatile ( |
190 | "tst.b %[ack] \n" /* if (!ack) */ | 190 | "tst.b %[ack] \n" /* if (!ack) */ |
191 | "bne.s 1f \n" | 191 | "bne.s 1f \n" |
192 | 192 | ||
@@ -245,7 +245,7 @@ inline bool pcf50606_i2c_getack(void) | |||
245 | bool ret; | 245 | bool ret; |
246 | 246 | ||
247 | #ifdef USE_ASM | 247 | #ifdef USE_ASM |
248 | asm ( | 248 | asm volatile ( |
249 | "not.l %[sdab] \n" /* SDA_HI_IN */ | 249 | "not.l %[sdab] \n" /* SDA_HI_IN */ |
250 | "and.l %[sdab],(8,%[sdard]) \n" | 250 | "and.l %[sdab],(8,%[sdard]) \n" |
251 | "not.l %[sdab] \n" | 251 | "not.l %[sdab] \n" |
@@ -375,7 +375,7 @@ unsigned char pcf50606_i2c_inb(bool ack) | |||
375 | unsigned char byte = 0; | 375 | unsigned char byte = 0; |
376 | 376 | ||
377 | #ifdef USE_ASM | 377 | #ifdef USE_ASM |
378 | asm ( | 378 | asm volatile ( |
379 | "not.l %[sdab] \n" /* SDA_HI_IN */ | 379 | "not.l %[sdab] \n" /* SDA_HI_IN */ |
380 | "and.l %[sdab],(8,%[sdard]) \n" | 380 | "and.l %[sdab],(8,%[sdard]) \n" |
381 | "not.l %[sdab] \n" | 381 | "not.l %[sdab] \n" |
@@ -550,3 +550,4 @@ int pcf50606_write(int address, unsigned char val) | |||
550 | { | 550 | { |
551 | return pcf50606_write_multiple(address, &val, 1); | 551 | return pcf50606_write_multiple(address, &val, 1); |
552 | } | 552 | } |
553 | |||