[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] GET_CURRENT macro in entry.S

Bottom of stack is cpu_info structure:
struct cpu_info {
    struct cpu_user_regs guest_cpu_user_regs;
    unsigned int         processor_id;
    struct vcpu         *current_vcpu;
Below code locates cpu_info on current stack (esp), and then fetch current_vcpu pointer into ebx.

From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of pallavi jk
Sent: Tuesday, December 30, 2008 12:45 AM
To: xen-devel@xxxxxxxxxxxxxxxxxxx; Keir Fraser; Jeremy Fitzhardinge
Subject: [Xen-devel] GET_CURRENT macro in entry.S

I am unable to understand what this macro in  entry.S does. Can someone please explain its working?
#define GET_CURRENT(reg)         \
        movl $STACK_SIZE-4, reg; \
        orl  %esp, reg;          \
        andl $~3,reg;            \
        movl (reg),reg;

Also, how does the address of "struct vcpu" come in %ebx ? How do I obtain it?

Please help.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.