Hello Nikos Nikoleris,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/31516
to review the following change.
Change subject: dev-arm: Implement LevelSensitive PPIs in GICv3
......................................................................
dev-arm: Implement LevelSensitive PPIs in GICv3
Change-Id: I7f28408eff7d502427c4486518c83506893f4a7a
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-by: Nikos Nikoleris <[email protected]>
---
M src/dev/arm/gic_v3.cc
M src/dev/arm/gic_v3_redistributor.cc
M src/dev/arm/gic_v3_redistributor.hh
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/dev/arm/gic_v3.cc b/src/dev/arm/gic_v3.cc
index 8e75b1c..83f2c83 100644
--- a/src/dev/arm/gic_v3.cc
+++ b/src/dev/arm/gic_v3.cc
@@ -193,8 +193,12 @@
}
void
-Gicv3::clearPPInt(uint32_t num, uint32_t cpu)
+Gicv3::clearPPInt(uint32_t int_id, uint32_t cpu)
{
+ panic_if(cpu >= redistributors.size(), "Invalid cpuID clearing PPI!");
+ DPRINTF(Interrupt, "Gicv3::clearPPInt(): received PPI %d
cpuTarget %#x\n",
+ int_id, cpu);
+ redistributors[cpu]->clearPPInt(int_id);
}
void
diff --git a/src/dev/arm/gic_v3_redistributor.cc
b/src/dev/arm/gic_v3_redistributor.cc
index 5fceed5..dfccbc4 100644
--- a/src/dev/arm/gic_v3_redistributor.cc
+++ b/src/dev/arm/gic_v3_redistributor.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 ARM Limited
+ * Copyright (c) 2019-2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -716,6 +716,17 @@
}
void
+Gicv3Redistributor::clearPPInt(uint32_t int_id)
+{
+ assert((int_id >= Gicv3::SGI_MAX) &&
+ (int_id < Gicv3::SGI_MAX + Gicv3::PPI_MAX));
+
+ if (isLevelSensitive(int_id)) {
+ irqPending[int_id] = false;
+ }
+}
+
+void
Gicv3Redistributor::sendSGI(uint32_t int_id, Gicv3::GroupId group, bool ns)
{
assert(int_id < Gicv3::SGI_MAX);
@@ -977,7 +988,9 @@
void
Gicv3Redistributor::activateIRQ(uint32_t int_id)
{
- irqPending[int_id] = false;
+ if (!isLevelSensitive(int_id)) {
+ irqPending[int_id] = false;
+ }
irqActive[int_id] = true;
}
diff --git a/src/dev/arm/gic_v3_redistributor.hh
b/src/dev/arm/gic_v3_redistributor.hh
index ee92bc7..aaf7e28 100644
--- a/src/dev/arm/gic_v3_redistributor.hh
+++ b/src/dev/arm/gic_v3_redistributor.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 ARM Limited
+ * Copyright (c) 2019-2020 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -221,6 +221,13 @@
void update();
void updateDistributor();
+ protected:
+
+ bool isLevelSensitive(uint32_t int_id) const
+ {
+ return irqConfig[int_id] == Gicv3::INT_LEVEL_SENSITIVE;
+ }
+
public:
Gicv3Redistributor(Gicv3 * gic, uint32_t cpu_id);
@@ -228,6 +235,7 @@
void init();
uint64_t read(Addr addr, size_t size, bool is_secure_access);
void sendPPInt(uint32_t int_id);
+ void clearPPInt(uint32_t int_id);
void write(Addr addr, uint64_t data, size_t size, bool
is_secure_access);
};
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31516
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I7f28408eff7d502427c4486518c83506893f4a7a
Gerrit-Change-Number: 31516
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s