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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
  • 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


 


Rackspace

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