summaryrefslogtreecommitdiff
path: root/src/dev/arm/gic_pl390.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2013-10-17 10:20:45 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2013-10-17 10:20:45 -0500
commit2f7b012ced325bc4a1490044b97acbd9d0b5bbcf (patch)
tree07a53d44517dc3a1ecd291bcc2a0ebe3b93319cb /src/dev/arm/gic_pl390.cc
parentcf266f05a97b7a0e613fd10cb01f38fec6a4f16c (diff)
downloadgem5-2f7b012ced325bc4a1490044b97acbd9d0b5bbcf.tar.xz
arm: Fix a GIC mask register bug
This resulted in a kernel printk that said, "GIC CPU mask not found - kernel will fail to boot."
Diffstat (limited to 'src/dev/arm/gic_pl390.cc')
-rw-r--r--src/dev/arm/gic_pl390.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dev/arm/gic_pl390.cc b/src/dev/arm/gic_pl390.cc
index a33ec800f..1acfdc707 100644
--- a/src/dev/arm/gic_pl390.cc
+++ b/src/dev/arm/gic_pl390.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 ARM Limited
+ * Copyright (c) 2010, 2013 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -232,7 +232,12 @@ Pl390::readDistributor(PacketPtr pkt)
}
} else {
assert(ctx_id < sys->numRunningContexts());
- pkt->set<uint32_t>(ctx_id);
+ // convert the CPU id number into a bit mask
+ uint32_t ctx_mask = power(2, ctx_id);
+ // replicate the 8-bit mask 4 times in a 32-bit word
+ ctx_mask |= ctx_mask << 8;
+ ctx_mask |= ctx_mask << 16;
+ pkt->set<uint32_t>(ctx_mask);
}
goto done;
}