Subversion Repositories HelenOS

Rev

Rev 2479 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2479 Rev 2607
Line 33... Line 33...
33
  * @ingroup libcmips32eb  
33
  * @ingroup libcmips32eb  
34
 */
34
 */
35
 
35
 
36
#include <libc.h>
36
#include <libc.h>
37
 
37
 
38
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
38
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3,
39
           const sysarg_t p3, const sysarg_t p4,
39
    const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id)
40
           const syscall_t id)
-
 
41
{
40
{
42
    register sysarg_t __mips_reg_a0 asm("$4") = p1;
41
    register sysarg_t __mips_reg_a0 asm("$4") = p1;
43
    register sysarg_t __mips_reg_a1 asm("$5") = p2;
42
    register sysarg_t __mips_reg_a1 asm("$5") = p2;
44
    register sysarg_t __mips_reg_a2 asm("$6") = p3;
43
    register sysarg_t __mips_reg_a2 asm("$6") = p3;
45
    register sysarg_t __mips_reg_a3 asm("$7") = p4;
44
    register sysarg_t __mips_reg_a3 asm("$7") = p4;
-
 
45
    register sysarg_t __mips_reg_t0 asm("$8") = p5;
-
 
46
    register sysarg_t __mips_reg_t1 asm("$9") = p6;
46
    register sysarg_t __mips_reg_v0 asm("$2") = id;
47
    register sysarg_t __mips_reg_v0 asm("$2") = id;
47
   
48
   
48
    asm volatile (
49
    asm volatile (
49
        "syscall\n"
50
        "syscall\n"
50
        : "=r" (__mips_reg_v0)
51
        : "=r" (__mips_reg_v0)
51
        : "r" (__mips_reg_a0),
52
        : "r" (__mips_reg_a0),
52
          "r" (__mips_reg_a1),
53
          "r" (__mips_reg_a1),
53
          "r" (__mips_reg_a2),
54
          "r" (__mips_reg_a2),
54
          "r" (__mips_reg_a3),
55
          "r" (__mips_reg_a3),
-
 
56
          "r" (__mips_reg_t0),
-
 
57
          "r" (__mips_reg_t1),
55
          "r" (__mips_reg_v0)
58
          "r" (__mips_reg_v0)
56
        : "%ra" /* We are a function call, although C does not
59
        : "%ra" /* We are a function call, although C does not
57
             * know it */
60
             * know it */
58
    );
61
    );
59
   
62