Messages in this thread | | | Date | Thu, 26 Apr 2012 11:33:46 -0400 | From | Konrad Rzeszutek Wilk <> | Subject | Re: [Xen-devel] [PATCH] xen/apic: implement io apic read with hypercall |
| |
> >> > >> unsigned int xen_io_apic_read(unsigned apic, unsigned reg) > >> { > >> struct physdev_apic apic_op; > >> int ret; > >> > >> apic_op.apic_physbase = mpc_ioapic_addr(apic); > >> apic_op.reg = reg; > >> ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); > >> if (!ret) > >> return apic_op.value; > >> > >> /* emulate register */ > >> if (reg == 0x1) > >> return 0x00170020; > >> else if (reg == 0x0) > >> return apic << 24; > >> else > >> return -1; > > > > return 0xfd; > > Where does this magic number 0xfd come from? > > Both native_io_apic_read and xen_io_apic_read does not return 0xfd on error.
That is correct. But that is what it should have been. Suresh pointed that out sometime and I managed to lose that part in one of the commits. The earlier patch of this version did that.
Thought thinking about it this some I am not sure if 0xff is a better choice... In the end it probably does not matter the slighest.
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |