Changeset 15d0046 in mainline for kernel/arch/ia32/src/context.S


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/context.S

    r8db09e4 r15d0046  
    2727#
    2828
    29 #include <arch/context_offset.h>
     29#include <arch/context_struct.h>
    3030
    3131.text
     
    4141#
    4242context_save_arch:
    43         movl 0(%esp),%eax       # save pc value into eax       
    44         movl 4(%esp),%edx       # address of the context variable to save context to
     43        movl 0(%esp), %eax      # save pc value into eax       
     44        movl 4(%esp), %edx      # address of the context variable to save context to
    4545
    46                 # save registers to given structure
    47         CONTEXT_SAVE_ARCH_CORE %edx %eax
     46        # save registers to given structure
     47        movl %esp, CONTEXT_OFFSET_SP(%edx)      # %esp -> ctx->sp
     48        movl %eax, CONTEXT_OFFSET_PC(%edx)      # %eip -> ctx->pc
     49        movl %ebx, CONTEXT_OFFSET_EBX(%edx)     # %ebx -> ctx->ebx
     50        movl %esi, CONTEXT_OFFSET_ESI(%edx)     # %esi -> ctx->esi
     51        movl %edi, CONTEXT_OFFSET_EDI(%edx)     # %edi -> ctx->edi
     52        movl %ebp, CONTEXT_OFFSET_EBP(%edx)     # %ebp -> ctx->ebp
    4853
    49         xorl %eax,%eax          # context_save returns 1
     54        xorl %eax, %eax         # context_save returns 1
    5055        incl %eax
    5156        ret
     
    5863#
    5964context_restore_arch:
    60         movl 4(%esp),%eax       # address of the context variable to restore context from
     65        movl 4(%esp), %eax      # address of the context variable to restore context from
    6166
    62                 # restore registers from given structure
    63         CONTEXT_RESTORE_ARCH_CORE %eax %edx
     67        # restore registers from given structure
     68        movl CONTEXT_OFFSET_SP(%eax), %esp      # ctx->sp -> %esp
     69        movl CONTEXT_OFFSET_PC(%eax), %edx      # ctx->pc -> \pc
     70        movl CONTEXT_OFFSET_EBX(%eax), %ebx     # ctx->ebx -> %ebx
     71        movl CONTEXT_OFFSET_ESI(%eax), %esi     # ctx->esi -> %esi
     72        movl CONTEXT_OFFSET_EDI(%eax), %edi     # ctx->edi -> %edi
     73        movl CONTEXT_OFFSET_EBP(%eax), %ebp     # ctx->ebp -> %ebp
    6474
    65         movl %edx,0(%esp)       # put saved pc on stack
    66         xorl %eax,%eax          # context_restore returns 0
     75        movl %edx, 0(%esp)      # put saved pc on stack
     76        xorl %eax, %eax         # context_restore returns 0
    6777        ret
     78
Note: See TracChangeset for help on using the changeset viewer.