Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57794
b: refs/heads/master
c: 75ed405
h: refs/heads/master
v: v3
  • Loading branch information
Roy Huang authored and Bryan Wu committed Jun 14, 2007
1 parent a6fb68f commit 606a6cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2d50aa97d695d83ccb2341488d977e8cfe36555
refs/heads/master: 75ed405c63b3fc2402fb8ff825b0ebffcff26b57
22 changes: 22 additions & 0 deletions trunk/include/asm-blackfin/mach-common/def_LPBlackfin.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

#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"\
Expand All @@ -52,6 +58,11 @@
"%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"\
Expand All @@ -64,6 +75,12 @@

#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"\
Expand All @@ -74,6 +91,11 @@
"%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"\
Expand Down

0 comments on commit 606a6cb

Please sign in to comment.