Changeset f2ef7fd in mainline for uspace


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
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/trace.c

    r1d132ae rf2ef7fd  
    3636#include <stdlib.h>
    3737#include <unistd.h>
    38 #include <syscall.h>
    3938#include <ipc/ipc.h>
    4039#include <fibril.h>
     
    4443#include <task.h>
    4544#include <loader/loader.h>
     45
     46#include <libc.h>
    4647
    4748// Temporary: service and method names
  • 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,
  • uspace/lib/libc/generic/udebug.c

    r1d132ae rf2ef7fd  
    3535#include <udebug.h>
    3636#include <sys/types.h>
    37 #include <syscall.h>
    3837#include <ipc/ipc.h>
    3938#include <async.h>
  • uspace/lib/libc/include/libc.h

    r1d132ae rf2ef7fd  
    4040#include <libarch/syscall.h>
    4141
    42 #define __SYSCALL0(id) __syscall(0, 0, 0, 0, 0, 0, id)
    43 #define __SYSCALL1(id, p1) __syscall(p1, 0, 0, 0, 0, 0, id)
    44 #define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, 0, 0, 0, id)
    45 #define __SYSCALL3(id, p1, p2, p3) __syscall(p1, p2, p3, 0, 0, 0, id)
    46 #define __SYSCALL4(id, p1, p2, p3, p4) __syscall(p1, p2, p3, p4, 0, 0, id)
    47 #define __SYSCALL5(id, p1, p2, p3, p4, p5) __syscall(p1, p2, p3, p4, p5, 0, id)
     42#define __SYSCALL0(id) __syscall0(0, 0, 0, 0, 0, 0, id)
     43#define __SYSCALL1(id, p1) __syscall1(p1, 0, 0, 0, 0, 0, id)
     44#define __SYSCALL2(id, p1, p2) __syscall2(p1, p2, 0, 0, 0, 0, id)
     45#define __SYSCALL3(id, p1, p2, p3) __syscall3(p1, p2, p3, 0, 0, 0, id)
     46#define __SYSCALL4(id, p1, p2, p3, p4) __syscall4(p1, p2, p3, p4, 0, 0, id)
     47#define __SYSCALL5(id, p1, p2, p3, p4, p5) __syscall5(p1, p2, p3, p4, p5, 0, id)
    4848#define __SYSCALL6(id, p1, p2, p3, p4, p5, p6) \
    49     __syscall(p1, p2, p3, p4, p5, p6,id)
     49    __syscall6(p1, p2, p3, p4, p5, p6, id)
    5050
    5151extern void __main(void *pcb_ptr);
  • uspace/lib/libc/include/syscall.h

    r1d132ae rf2ef7fd  
    3333 * @file
    3434 * @brief       Syscall function declaration for architectures that don't
    35  *              inline syscalls.
     35 *              inline syscalls or architectures that handle syscalls
     36 *              according to the number of arguments.
    3637 */
    3738
     
    3940#define LIBC_SYSCALL_H_
    4041
     42#ifndef LIBARCH_SYSCALL_GENERIC
     43#error "You can't include this file directly."
     44#endif
     45
    4146#include <sys/types.h>
    4247#include <kernel/syscall/syscall.h>
     48
     49#define __syscall0      __syscall
     50#define __syscall1      __syscall
     51#define __syscall2      __syscall
     52#define __syscall3      __syscall
     53#define __syscall4      __syscall
     54#define __syscall5      __syscall
     55#define __syscall6      __syscall
    4356
    4457extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
Note: See TracChangeset for help on using the changeset viewer.