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

[Xen-devel] What function pointer does %%gs contain?

To: <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] What function pointer does %%gs contain?
From: "Liu, Benjamin" <benjamin.liu@xxxxxxxxx>
Date: Mon, 18 Oct 2004 15:31:13 +0800
Delivery-date: Mon, 18 Oct 2004 08:35:08 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Thread-index: AcS05HIaYMtWGPNXS5i7QL7i7okirw==
Thread-topic: What function pointer does %%gs contain?
I'm searching Xen's source code to understand exception handling. I've
pasted a piece of code below.

In arch/x86/x86_32/entry.S:
error_code:
        pushl %fs
        pushl %es
        pushl %ds
        pushl %eax
        xorl  %eax,%eax
        pushl %ebp
        pushl %edi
        pushl %esi
        pushl %edx
        decl  %eax                      # eax = -1
        pushl %ecx
        pushl %ebx
        cld
        movl  %gs,%ecx
        movl  ORIG_EAX(%esp), %esi      # get the error code
        movl  GS(%esp), %edi            # get the function address
        movl  %eax, ORIG_EAX(%esp)
        movl  %ecx, GS(%esp)
        movl  $(__HYPERVISOR_DS),%edx
        movl  %edx,%ds
        movl  %edx,%es
        movl  %edx,%fs
        movl  %edx,%gs
        movl  %esp,%edx
        pushl %esi                      # push the error code
        pushl %edx                      # push the pt_regs pointer
        GET_CURRENT(%ebx)
        call  *%edi
        addl  $8,%esp
        movb  CS(%esp),%al
        testb $3,%al
        je    restore_all_xen
        jmp   process_guest_exception_and_events

But I can not understand what function does following sentence refer to
        movl  GS(%esp), %edi            # get the function address
Where does it come from?

Thanks,
Benjamin


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>