locked_mem.hh (11357:6668387fa488) locked_mem.hh (12218:8c5db15dc8e7)
1/*
1/*
2 * Copyright (c) 2012-2013 ARM Limited
2 * Copyright (c) 2012-2013,2017 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

143 }
144
145 // store conditional failed already, so don't issue it to mem
146 return false;
147 }
148 return true;
149}
150
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

143 }
144
145 // store conditional failed already, so don't issue it to mem
146 return false;
147 }
148 return true;
149}
150
151template <class XC>
152inline void
153globalClearExclusive(XC *xc)
154{
155 // A spinlock would typically include a Wait For Event (WFE) to
156 // conserve energy. The ARMv8 architecture specifies that an event
157 // is automatically generated when clearing the exclusive monitor
158 // to wake up the processor in WFE.
159 DPRINTF(LLSC,"Clearing lock and signaling sev\n");
160 xc->setMiscReg(MISCREG_LOCKFLAG, false);
161 // Implement ARMv8 WFE/SEV semantics
162 xc->setMiscReg(MISCREG_SEV_MAILBOX, true);
163 xc->getCpuPtr()->wakeup(xc->threadId());
164}
151
152} // namespace ArmISA
153
154#endif
165
166} // namespace ArmISA
167
168#endif