locked_mem.hh (11151:ca4ea9b5c052) locked_mem.hh (11357:6668387fa488)
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 50 unchanged lines hidden (view full) ---

59#include "mem/request.hh"
60
61namespace ArmISA
62{
63template <class XC>
64inline void
65handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask)
66{
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 50 unchanged lines hidden (view full) ---

59#include "mem/request.hh"
60
61namespace ArmISA
62{
63template <class XC>
64inline void
65handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask)
66{
67 DPRINTF(LLSC,"%s: handleing snoop for address: %#x locked: %d\n",
67 // Should only every see invalidations / direct writes
68 assert(pkt->isInvalidate() || pkt->isWrite());
69
70 DPRINTF(LLSC,"%s: handling snoop for address: %#x locked: %d\n",
68 xc->getCpuPtr()->name(),pkt->getAddr(),
69 xc->readMiscReg(MISCREG_LOCKFLAG));
70 if (!xc->readMiscReg(MISCREG_LOCKFLAG))
71 return;
72
73 Addr locked_addr = xc->readMiscReg(MISCREG_LOCKADDR) & cacheBlockMask;
74 // If no caches are attached, the snoop address always needs to be masked
75 Addr snoop_addr = pkt->getAddr() & cacheBlockMask;
76
71 xc->getCpuPtr()->name(),pkt->getAddr(),
72 xc->readMiscReg(MISCREG_LOCKFLAG));
73 if (!xc->readMiscReg(MISCREG_LOCKFLAG))
74 return;
75
76 Addr locked_addr = xc->readMiscReg(MISCREG_LOCKADDR) & cacheBlockMask;
77 // If no caches are attached, the snoop address always needs to be masked
78 Addr snoop_addr = pkt->getAddr() & cacheBlockMask;
79
77 DPRINTF(LLSC,"%s: handleing snoop for address: %#x locked addr: %#x\n",
80 DPRINTF(LLSC,"%s: handling snoop for address: %#x locked addr: %#x\n",
78 xc->getCpuPtr()->name(),snoop_addr, locked_addr);
79 if (locked_addr == snoop_addr) {
80 DPRINTF(LLSC,"%s: address match, clearing lock and signaling sev\n",
81 xc->getCpuPtr()->name());
82 xc->setMiscReg(MISCREG_LOCKFLAG, false);
83 // Implement ARMv8 WFE/SEV semantics
84 xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
85 xc->getCpuPtr()->wakeup(xc->threadId());

--- 66 unchanged lines hidden ---
81 xc->getCpuPtr()->name(),snoop_addr, locked_addr);
82 if (locked_addr == snoop_addr) {
83 DPRINTF(LLSC,"%s: address match, clearing lock and signaling sev\n",
84 xc->getCpuPtr()->name());
85 xc->setMiscReg(MISCREG_LOCKFLAG, false);
86 // Implement ARMv8 WFE/SEV semantics
87 xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
88 xc->getCpuPtr()->wakeup(xc->threadId());

--- 66 unchanged lines hidden ---