summaryrefslogtreecommitdiff
path: root/src/arch/riscv/locked_mem.hh
diff options
context:
space:
mode:
authorAlec Roelke <ar4jc@virginia.edu>2017-03-21 12:58:25 -0400
committerAlec Roelke <ar4jc@virginia.edu>2017-04-05 20:21:59 +0000
commita8f1f9811c3fdb1cf59f6d37540ad40e4699561f (patch)
tree2fea02557b6c8d72b1c6c5a411f97fd567c67b50 /src/arch/riscv/locked_mem.hh
parent6b7d30688d44952fcbb98b3e0f2bfc5155f1f9a5 (diff)
downloadgem5-a8f1f9811c3fdb1cf59f6d37540ad40e4699561f.tar.xz
riscv: fix Linux problems with LR and SC ops
Some of the functions in the Linux toolchain that allocate memory make use of paired LR and SC instructions, which didn't work properly for that toolchain. This patch fixes that so attempting to use those functions doesn't cause an endless loop of failed SC instructions. Change-Id: If27696323dd6229a0277818e3744fbdf7180fca7 Reviewed-on: https://gem5-review.googlesource.com/2340 Maintainer: Alec Roelke <ar4jc@virginia.edu> Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/riscv/locked_mem.hh')
-rw-r--r--src/arch/riscv/locked_mem.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/riscv/locked_mem.hh b/src/arch/riscv/locked_mem.hh
index 4a809206c..d7fc0ca5a 100644
--- a/src/arch/riscv/locked_mem.hh
+++ b/src/arch/riscv/locked_mem.hh
@@ -67,7 +67,7 @@ const int WARN_FAILURE = 10000;
// RISC-V allows multiple locks per hart, but each SC has to unlock the most
// recent one, so we use a stack here.
-static std::stack<Addr> locked_addrs;
+extern std::stack<Addr> locked_addrs;
template <class XC> inline void
handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask)