/* Read a 32 bit IO APIC register. 
This routine reads the specified IO APIC register using indirect addressing.  */
static __pinned_func uint32_t __IoApicGet(int32_t offset)
/* Read a 32 bit IO APIC register. 
This routine reads the specified IO APIC register using indirect addressing.  */
static __pinned_func uint32_t __IoApicGet(int32_t offset)
{
	uint32_t value;
	unsigned int key;
	key = irq_lock();
	*((volatile uint32_t *) (IOAPIC_REG + IOAPIC_IND)) = (unsigned char)offset;
	value = *((volatile uint32_t *)(IOAPIC_REG + IOAPIC_DATA));
	irq_unlock(key);
	return value;
}