~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to mit-pthreads/machdep/syscall-template-alpha-osf1.S

  • Committer: bk at mysql
  • Date: 2000-07-31 19:29:14 UTC
  • Revision ID: sp1r-bk@work.mysql.com-20000731192914-08846
Import changeset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <asm.h>
 
2
#include <regdef.h>
 
3
#define COMPAT_43
 
4
#include <syscall.h>
 
5
 
 
6
#undef SYSCALL
 
7
 
 
8
/* Kernel syscall interface:
 
9
   Input:
 
10
        v0 - system call number
 
11
        a* - arguments, as in C
 
12
   Output:
 
13
        a3 - zero iff successful
 
14
        v0 - errno value on failure, else result
 
15
 
 
16
   This macro is similar to SYSCALL in asm.h, but not completely.
 
17
   There's room for optimization, if we assume this will continue to
 
18
   be assembled as one file.
 
19
 
 
20
   This macro expansions does not include the return instruction.
 
21
   If there's no other work to be done, use something like:
 
22
        SYSCALL(foo) ; ret
 
23
   If there is other work to do (in fork, maybe?), do it after the
 
24
   SYSCALL invocation.  */
 
25
 
 
26
#define SYSCALL(x) \
 
27
        .align  4                                       ;\
 
28
        .globl  machdep_sys_##x                         ;\
 
29
        .ent    machdep_sys_##x, 0                      ;\
 
30
machdep_sys_##x:                                        ;\
 
31
        .frame  sp,0,ra                                 ;\
 
32
        ldiq    v0, SYS_##x                             ;\
 
33
        CHMK()                                          ;\
 
34
        beq     a3, 2f                                  ;\
 
35
        br      gp, 1f                                  ;\
 
36
1:                                                      ;\
 
37
        /* Load gp so we can find cerror to jump to.  */;\
 
38
        ldgp    gp, 0(gp)                               ;\
 
39
        jmp     zero, machdep_cerror                            ;\
 
40
2:
 
41
 
 
42
#define SIMPLE_SYSCALL(x)       SYSCALL(x) ; ret ; .end machdep_sys_##x
 
43
 
 
44
#define XSYSCALL(x)     SIMPLE_SYSCALL(x)
 
45
 
 
46
XSYSCALL(SYSCALL_NAME)