Changeset 37b451f7 in mainline for arch/amd64/src/asm_utils.S


Ignore:
Timestamp:
2006-02-07T02:22:44Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
65640fef
Parents:
dd4d6b0
Message:

Added (finally!) userspace to AMD64.
It does not work on Simics *$U&%&$&*#. Broken simics!!!
There should be probably LEA instead of MOV/ADD, but LEA does not
work in neither qemu nor bochs. Any other simulator to test? :-/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/asm_utils.S

    rdd4d6b0 r37b451f7  
    193193       
    194194syscall_entry:
    195         # TODO: Switch to kernel stack
     195        # Switch to hidden gs   
     196        swapgs
     197
     198        # TODO: I would like LEA instead of thes 2 instrs,
     199        # why does not it work???
     200        mov %gs:0, %r10     # We have a stack in r10
     201        addq $0x0ff0, %r10
     202       
     203        movq %rsp, 0(%r10)  # Save old stack pointer to stack
     204        movq %r10, %rsp     # Change to new stack
     205        pushq %rcx          # Return address
     206        pushq %r11          # Save flags
     207
     208        # Switch back to remain consistent
     209        swapgs
     210
     211        movq %r9, %rcx      # Exchange last parameter as a third
    196212        call syscall_handler
    197         # Switch back
    198         sysret
     213       
     214        popq %r11
     215        popq %rcx
     216        movq 0(%rsp), %rsp
     217        sysretq
    199218               
    200219.data
Note: See TracChangeset for help on using the changeset viewer.