summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-02-02 08:46:27 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-02-02 12:08:15 -0600
commit2b2e409d8dc95d5bc941e5e451823b76848e1170 (patch)
treeffd2fc03882088e538ac45ea4d2fe3391329a43b /c
parentWhite space correction. (diff)
downloadrtems-2b2e409d8dc95d5bc941e5e451823b76848e1170.tar.bz2
LEON3: change d-cache snoop detect implementation
PR 2010/bsps The previous code only checked if d-cache snooping was implemented, however snooping may be available but not enabled which may lead to driver bugs. Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/bspstart.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
index f6aafb2e22..9cad164d1f 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
@@ -36,19 +36,19 @@ extern void amba_initialize(void);
* set_snooping
*
* Read the data cache configuration register to determine if
- * bus snooping is available. This is needed for some drivers so
- * that they can select the most efficient copy routines.
+ * bus snooping is available and enabled. This is needed for some
+ * drivers so that they can select the most efficient copy routines.
*
*/
static inline int set_snooping(void)
{
int tmp;
- __asm__ (" lda [%1] 2, %0 "
+ __asm__ (" lda [%%g0] 2, %0 "
: "=r"(tmp)
- : "r"(0xC)
+ :
);
- return (tmp >> 27) & 1;
+ return (tmp >> 23) & 1;
}
/* ASM-function used to get the CPU-Index on calling LEON3 CPUs */