Changeset 7fc78da in mainline


Ignore:
Timestamp:
2006-03-13T20:53:02Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a19bdf8
Parents:
b419162
Message:

New IPC synchronous call.
Widened syscall to support up to 5 parameters.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    rb419162 r7fc78da  
    3232int main(int argc, char *argv[])
    3333{
     34        ipc_data_t ipcdata;
     35
    3436        version_print();
    3537
    36         ipc_call_sync(0, 1, 2);
    37 
     38        ipc_call_sync(0, 1, 2, &ipcdata);
     39       
    3840        return 0;
    3941}
  • libc/arch/ia32/src/syscall.c

    rb419162 r7fc78da  
    2929#include <libc.h>
    3030
    31 sysarg_t __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3)
     31sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3,
     32                   const sysarg_t p4, const syscall_t id)
    3233{
    3334        sysarg_t ret;
     
    3637                "int $0x30\n"
    3738                : "=a" (ret)
    38                 : "a" (id),
    39                   "b" (p1),
    40                   "c" (p2),
    41                   "d" (p3)
     39                : "a" (p1),
     40                  "b" (p2),
     41                  "c" (p3),
     42                  "d" (p4),
     43                  "S" (id)
    4244        );
    4345       
  • libc/arch/mips32/src/syscall.c

    rb419162 r7fc78da  
    3030
    3131sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
    32                    const sysarg_t p3, const syscall_t id)
     32                   const sysarg_t p3, const sysarg_t p4,
     33                   const syscall_t id)
    3334{
    3435        register sysarg_t __mips_reg_a0 asm("$4") = p1;
    3536        register sysarg_t __mips_reg_a1 asm("$5") = p2;
    3637        register sysarg_t __mips_reg_a2 asm("$6") = p3;
    37         register sysarg_t __mips_reg_a3 asm("$7") = id;
     38        register sysarg_t __mips_reg_a3 asm("$7") = p4;
     39        register sysarg_t __mips_reg_t0 asm("$8") = id;
    3840        register sysarg_t __mips_reg_v0 asm("$2");
    3941       
     
    4446                  "r" (__mips_reg_a1),
    4547                  "r" (__mips_reg_a2),
    46                   "r" (__mips_reg_a3)
     48                  "r" (__mips_reg_a3),
     49                  "r" (__mips_reg_t0)
    4750        );
    4851       
  • libc/include/libc.h

    rb419162 r7fc78da  
    3434#include <kernel/syscall/syscall.h>
    3535
    36 #define __SYSCALL0(id) __syscall(0, 0, 0, id)
    37 #define __SYSCALL1(id, p1) __syscall(p1, 0, 0, id)
    38 #define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, id)
    39 #define __SYSCALL3(id, p1, p2, p3) __syscall(p1,p2,p3,id)
     36#define __SYSCALL0(id) __syscall(0, 0, 0, 0, id)
     37#define __SYSCALL1(id, p1) __syscall(p1, 0, 0, 0, id)
     38#define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, 0, id)
     39#define __SYSCALL3(id, p1, p2, p3) __syscall(p1,p2,p3, 0, id)
     40#define __SYSCALL4(id, p1, p2, p3, p4) __syscall(p1,p2,p3,p4,id)
    4041
    4142extern void __main(void);
    4243extern void __exit(void);
    4344extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
    44                           const sysarg_t p3, const syscall_t id);
     45                          const sysarg_t p3, const sysarg_t p4,
     46                          const syscall_t id);
    4547
    4648
  • libipc/generic/ipc.c

    rb419162 r7fc78da  
    3030#include <libc.h>
    3131
    32 static inline ipc_callid_t _ipc_call(int phoneid, int arg1, int arg2)
     32int ipc_call_sync(int phoneid, int arg1, int arg2, ipc_data_t *resdata)
    3333{
    34         __SYSCALL3(SYS_IPC_CALL, phoneid, arg1, arg2);
    35 }
    36 
    37 int ipc_call_sync(int phoneid, int arg1, int arg2)
    38 {
    39         ipc_data_t resdata;
    40 
    41         _ipc_call(phoneid, arg1, arg2);
    42         ipc_wait_for_call(&resdata,0);
     34        return __SYSCALL4(SYS_IPC_CALL_SYNC, phoneid, arg1, arg2,
     35                          (sysarg_t)resdata);
    4336}
    4437
  • libipc/include/ipc.h

    rb419162 r7fc78da  
    3737
    3838
    39 extern int ipc_call_sync(int phoneid, int arg1, int arg2);
     39extern int ipc_call_sync(int phoneid, int arg1, int arg2, ipc_data_t *resdata);
    4040extern int ipc_wait_for_call(ipc_data_t *data, int flags);
    4141
Note: See TracChangeset for help on using the changeset viewer.