drivers: ioapic: fix the cast for the offset
The cast for the offset variable will make incorrect register access when it is over 0x80. Change the char cast to unsigned char to fix it. Fixes #49803. Signed-off-by: Enjia Mai <enjia.mai@intel.com>
This commit is contained in:
parent
933a987d75
commit
24f989cd90
1 changed files with 2 additions and 2 deletions
|
@ -438,7 +438,7 @@ static uint32_t __IoApicGet(int32_t offset)
|
|||
|
||||
key = irq_lock();
|
||||
|
||||
*((volatile uint32_t *) (IOAPIC_REG + IOAPIC_IND)) = (char)offset;
|
||||
*((volatile uint32_t *) (IOAPIC_REG + IOAPIC_IND)) = (unsigned char)offset;
|
||||
value = *((volatile uint32_t *)(IOAPIC_REG + IOAPIC_DATA));
|
||||
|
||||
irq_unlock(key);
|
||||
|
@ -463,7 +463,7 @@ static void __IoApicSet(int32_t offset, uint32_t value)
|
|||
|
||||
key = irq_lock();
|
||||
|
||||
*(volatile uint32_t *)(IOAPIC_REG + IOAPIC_IND) = (char)offset;
|
||||
*(volatile uint32_t *)(IOAPIC_REG + IOAPIC_IND) = (unsigned char)offset;
|
||||
*((volatile uint32_t *)(IOAPIC_REG + IOAPIC_DATA)) = value;
|
||||
|
||||
irq_unlock(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue