Blackfin arch: fix bug ad1836 fails to build properly for BF533-EZKIT
authorRoy Huang <roy.huang@analog.com>
Thu, 14 Jun 2007 04:54:44 +0000 (12:54 +0800)
committerBryan Wu <bryan.wu@analog.com>
Thu, 14 Jun 2007 04:54:44 +0000 (12:54 +0800)
bug log here: http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3166

Signed-off-by: Roy Huang <roy.huang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
include/asm-blackfin/mach-common/def_LPBlackfin.h

index 76103526aec1c94dfab649f9a03e35f8dfdb0e6c..be1ece8c0c2775c277023ad74c88067054ee830e 100644 (file)
 
 #if defined(ANOMALY_05000198)
 
+#define bfin_read8(addr) ({ unsigned char __v; \
+               __asm__ __volatile__ ("NOP;\n\t" \
+                       "%0 = b[%1] (z);\n\t" \
+                       : "=d"(__v) : "a"(addr)); \
+               __v; })
+
 #define bfin_read16(addr) ({ unsigned __v; \
                        __asm__ __volatile__ ("NOP;\n\t"\
                                                                "%0 = w[%1] (z);\n\t"\
                                             "%0 = [%1];\n\t"\
   : "=d"(__v) : "a"(addr)); __v; })
 
+#define bfin_write8(addr, val) ({ \
+               __asm__ __volatile__ ("NOP;\n\t" \
+                       "b[%0] = %1;\n\t" \
+                       : : "a"(addr), "d"(val) : "memory");})
+
 #define bfin_write16(addr,val) ({\
                       __asm__ __volatile__ ("NOP;\n\t"\
                                             "w[%0] = %1;\n\t"\
 
 #else
 
+#define bfin_read8(addr) ({ unsigned char __v; \
+               __asm__ __volatile__ ( \
+                       "%0 = b[%1] (z);\n\t" \
+                       :"=d"(__v) : "a"(addr)); \
+               __v; })
+
 #define bfin_read16(addr) ({ unsigned __v; \
                        __asm__ __volatile__ (\
                                                                "%0 = w[%1] (z);\n\t"\
                                             "%0 = [%1];\n\t"\
   : "=d"(__v) : "a"(addr)); __v; })
 
+#define bfin_write8(addr, val) ({ \
+               __asm__ __volatile__ ( \
+                       "b[%0] = %1; \n\t" \
+                       ::"a"(addr), "d"(val) : "memory");})
+
 #define bfin_write16(addr,val) ({\
                       __asm__ __volatile__ (\
                                             "w[%0] = %1;\n\t"\