Changeset 3cc110f in mainline


Ignore:
Timestamp:
2009-10-22T17:35:18Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5328d63
Parents:
8e000b8d
Message:

Autodetect SYSENTER support in uspace.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/userspace.c

    r8e000b8d r3cc110f  
    7070                "movl %[uarg], %%eax\n"
    7171               
    72                 /* %ebx is defined to hold pcb_ptr - set it to 0 */
    73                 "xorl %%ebx, %%ebx\n"
     72                /* %edi is defined to hold pcb_ptr - set it to 0 */
     73                "xorl %%edi, %%edi\n"
    7474               
    7575                "iret\n"
  • uspace/lib/libc/arch/ia32/src/entry.s

    r8e000b8d r3cc110f  
    2727#
    2828
     29INTEL_CPUID_STANDARD = 1
     30INTEL_SEP = 11
     31
    2932.section .init, "ax"
    3033
     
    3538## User-space task entry point
    3639#
    37 # %ebx contains the PCB pointer
     40# %edi contains the PCB pointer
    3841#
    3942__entry:
     
    4447        # Do not set %gs, it contains descriptor that can see TLS
    4548
     49        # Detect the mechanism used for making syscalls
     50        movl $(INTEL_CPUID_STANDARD), %eax
     51        cpuid
     52        bt $(INTEL_SEP), %edx
     53        jnc 0f
     54        leal __syscall_fast_func, %eax
     55        movl $__syscall_fast, (%eax)
     560:
     57
    4658        # Pass the PCB pointer to __main as the first argument
    47         pushl %ebx
     59        pushl %edi
    4860        call __main
    4961
  • uspace/srv/loader/arch/ia32/ia32.s

    r8e000b8d r3cc110f  
    4040        movl 0x8(%ebp), %eax
    4141
    42         # %ebx := pcb
    43         # pcb is passed to the entry point int %ebx
    44         mov 0xc(%ebp), %ebx
     42        # %edi := pcb
     43        # pcb is passed to the entry point in %edi
     44        mov 0xc(%ebp), %edi
    4545
    4646        # Save a tiny bit of stack space
Note: See TracChangeset for help on using the changeset viewer.