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."
This commit is contained in:
Ali Saidi 2013-10-17 10:20:45 -05:00
parent cf266f05a9
commit 2f7b012ced

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010 ARM Limited * Copyright (c) 2010, 2013 ARM Limited
* All rights reserved * All rights reserved
* *
* The license below extends only to copyright in the software and shall * The license below extends only to copyright in the software and shall
@ -232,7 +232,12 @@ Pl390::readDistributor(PacketPtr pkt)
} }
} else { } else {
assert(ctx_id < sys->numRunningContexts()); 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; goto done;
} }