diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-09-19 14:43:36 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-10-02 15:55:06 +0000 |
commit | a25954a9d96f97f288a8701b3048a470773102ee (patch) | |
tree | 2eb9a575aa80376d97d3828beb3966e4bbfac956 /src/arch | |
parent | f469ee610f1fb355a485f96de9ce6c976b48df50 (diff) | |
download | gem5-a25954a9d96f97f288a8701b3048a470773102ee.tar.xz |
arch-arm: Create helper for sending events (SEV)
Events can be generated by devices, so we need an interface devices
can use to notify events to PEs.
Change-Id: I330575e7d116388d5f9260ef4400b0feaa861f3e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21301
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/isa/insts/misc.isa | 8 | ||||
-rw-r--r-- | src/arch/arm/utility.cc | 9 | ||||
-rw-r--r-- | src/arch/arm/utility.hh | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/arch/arm/isa/insts/misc.isa b/src/arch/arm/isa/insts/misc.isa index 92a6b53f1..ecf09aab5 100644 --- a/src/arch/arm/isa/insts/misc.isa +++ b/src/arch/arm/isa/insts/misc.isa @@ -1,6 +1,6 @@ // -*- mode:c++ -*- -// Copyright (c) 2010-2013,2017-2018 ARM Limited +// Copyright (c) 2010-2013,2017-2019 ARM Limited // All rights reserved // // The license below extends only to copyright in the software and shall @@ -784,11 +784,9 @@ let {{ ThreadContext *oc = sys->getThreadContext(x); if (oc == xc->tcBase()) continue; + // Wake CPU with interrupt if they were sleeping - if (oc->readMiscReg(MISCREG_SEV_MAILBOX) == 0) { - // Post Interrupt and wake cpu if needed - oc->getCpuPtr()->postInterrupt(oc->threadId(), INT_SEV, 0); - } + sendEvent(oc); } ''' sevIop = InstObjParams("sev", "SevInst", "PredOp", \ diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc index 924024d0e..d68850c5f 100644 --- a/src/arch/arm/utility.cc +++ b/src/arch/arm/utility.cc @@ -192,6 +192,15 @@ copyRegs(ThreadContext *src, ThreadContext *dest) dynamic_cast<TLB *>(dest->getDTBPtr())->invalidateMiscReg(); } +void +sendEvent(ThreadContext *tc) +{ + if (tc->readMiscReg(MISCREG_SEV_MAILBOX) == 0) { + // Post Interrupt and wake cpu if needed + tc->getCpuPtr()->postInterrupt(tc->threadId(), INT_SEV, 0); + } +} + bool inSecureState(ThreadContext *tc) { diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index 3a1506114..96f6843c3 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -117,6 +117,10 @@ copyMiscRegs(ThreadContext *src, ThreadContext *dest) void initCPU(ThreadContext *tc, int cpuId); +/** Send an event (SEV) to a specific PE if there isn't + * already a pending event */ +void sendEvent(ThreadContext *tc); + static inline bool inUserMode(CPSR cpsr) { |