lkml.org 
[lkml]   [2012]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2012-04-26 17:45    [W:0.268 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site