-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GIC v3 function gicd_set_ipriorityr funtion is buggy ! need update like above #640
Comments
Why do you need to do the read, mask and write manually? The register is R/W according to |
please read with care the specs: it is not so easy you pointed it |
Well, but that only means that for interrupt ID m the corresponding address is |
Yes, its is a bitfield of 4 fields and each field is accessible as a byte. The read-modify-write sequence will not work in a multi core system unless there can be global locking scheme shared across multiple software stacks.
Please let us know if you see any corruption of priority values with that implementation. |
void gicd_set_ipriorityr(unsigned int base, unsigned int id, unsigned int pri)
{
//read/modify/write 8 bits
unsigned n = id >> IPRIORITYR_SHIFT;
// select the byte within the word
unsigned int bit_shift = (id & 0x3) << 3;
unsigned int prior_val = GET_REG_WORD_VAL(base + GICD_IPRIORITYR + (n << 2));
prior_val &= ~(GIC_PRI_MASK << bit_shift);
prior_val |= ((pri & GIC_PRI_MASK) << bit_shift);
SET_REG_WORD(base + GICD_IPRIORITYR + (n << 2), prior_val);
}
The text was updated successfully, but these errors were encountered: