Changeset f2ef7fd in mainline for uspace/lib/libc/arch


Ignore:
Timestamp:
2008-10-05T21:20:13Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6198611
Parents:
1d132ae
Message:

Support for SYSENTER on ia32.

Location:
uspace/lib/libc/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/amd64/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_amd64_SYSCALL_H_
    3838
     39#define LIBARCH_SYSCALL_GENERIC
     40
    3941#include <syscall.h>
    4042
  • uspace/lib/libc/arch/arm32/include/syscall.h

    r1d132ae rf2ef7fd  
    3131 */
    3232/** @file
    33  *  @brief Empty.
     33 *  @brief
    3434 */
    3535
    3636#ifndef LIBC_arm32_SYSCALL_H_
    3737#define LIBC_arm32_SYSCALL_H_
     38
     39#define LIBARCH_SYSCALL_GENERIC
    3840
    3941#include <syscall.h>
  • uspace/lib/libc/arch/ia32/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_ia32_SYSCALL_H_
    3838
    39 #include <syscall.h>
     39#include <sys/types.h>
     40#include <kernel/syscall/syscall.h>
     41
     42#define __syscall0      __syscall_sysenter
     43#define __syscall1      __syscall_sysenter
     44#define __syscall2      __syscall_sysenter
     45#define __syscall3      __syscall_sysenter
     46#define __syscall4      __syscall_sysenter
     47#define __syscall5      __syscall_int
     48#define __syscall6      __syscall_int
     49
     50extern sysarg_t
     51__syscall_sysenter(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
     52     const sysarg_t, const sysarg_t, const syscall_t);
     53
     54extern sysarg_t
     55__syscall_int(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
     56     const sysarg_t, const sysarg_t, const syscall_t);
    4057
    4158#endif
  • uspace/lib/libc/arch/ia32/src/syscall.S

    r1d132ae rf2ef7fd  
    2929.text
    3030
    31 /** Syscall wrapper.
     31/** Syscall wrapper - INT $0x30 version.
    3232 *
    3333 * Mind the order of arguments. First two arguments and the syscall number go to
     
    3535 * could benefit from this and not save unused registers on the stack.
    3636 */
    37 .global __syscall
    38 __syscall:
     37.global __syscall_int
     38__syscall_int:
    3939        pushl %ebx
    4040        pushl %esi
     
    5454        popl %ebx
    5555        ret
     56
     57
     58/** Syscall wrapper - SYSENTER version.
     59 *
     60 * This is an optimized version of syscall for four or less arguments.  Note
     61 * that EBP and EDI are used to remember user stack address and the return
     62 * address. The kernel part doesn't save DS, ES and FS so the handler restores
     63 * these to the selector immediately following CS (it must be the flat data
     64 * segment, otherwise the SYSENTER wouldn't work in the first place).
     65 */
     66.global __syscall_sysenter
     67__syscall_sysenter:
     68        pushl %ebx
     69        pushl %esi
     70        pushl %edi
     71        pushl %ebp
     72        mov %esp, %ebp
     73        lea ra, %edi
     74        movl 20(%esp), %edx     # First argument.
     75        movl 24(%esp), %ecx     # Second argument.
     76        movl 28(%esp), %ebx     # Third argument.
     77        movl 32(%esp), %esi     # Fourth argument.
     78        movl 44(%esp), %eax     # Syscall number.
     79        sysenter
     80ra:
     81        movw %cs, %cx
     82        addw $8, %cx
     83        movw %cx, %ds
     84        movw %cx, %es
     85        movw %cx, %fs
     86        popl %ebp
     87        popl %edi
     88        popl %esi
     89        popl %ebx
     90        ret
  • uspace/lib/libc/arch/ia64/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_ia64_SYSCALL_H_
    3838
     39#define LIBARCH_SYSCALL_GENERIC
     40
    3941#include <syscall.h>
    4042
  • uspace/lib/libc/arch/mips32/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_mips32_SYSCALL_H_
    3838
     39#define LIBARCH_SYSCALL_GENERIC
     40
    3941#include <syscall.h>
    4042
  • uspace/lib/libc/arch/ppc32/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_ppc32_SYSCALL_H_
    3838
     39#define LIBARCH_SYSCALL_GENERIC
     40
    3941#include <syscall.h>
    4042
  • uspace/lib/libc/arch/ppc64/include/syscall.h

    r1d132ae rf2ef7fd  
    3737#define LIBC_ppc64_SYSCALL_H_
    3838
     39#define LIBARCH_SYSCALL_GENERIC
     40
    3941#include <syscall.h>
    4042
  • uspace/lib/libc/arch/sparc64/include/syscall.h

    r1d132ae rf2ef7fd  
    3939#include <kernel/syscall/syscall.h>
    4040
     41#define __syscall0      __syscall
     42#define __syscall1      __syscall
     43#define __syscall2      __syscall
     44#define __syscall3      __syscall
     45#define __syscall4      __syscall
     46#define __syscall5      __syscall
     47#define __syscall6      __syscall
     48
    4149static inline sysarg_t
    4250__syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3,
Note: See TracChangeset for help on using the changeset viewer.