WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: 'pallavi jk' <pallutai@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: RE: [Xen-devel] GET_CURRENT macro in entry.S
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Wed, 31 Dec 2008 10:50:15 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 30 Dec 2008 18:51:01 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <a55a39a90812290845l3c081e1mf648111283814b01@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <a55a39a90812290845l3c081e1mf648111283814b01@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aclp1PMG3uzka4U4R6+7/G2PcRUBBQBHUsUw
Thread-topic: [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.
 
Thanks,
Kevin


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.

-Pallavi
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>