5 #ifdef SYSCALLS_SUPPORT
8 #include <sys/ptrace.h>
11 #define SYSCALL_NAME "__sendrec"
13 #define SYSCALL_OFFSET 0xF
14 #define SYSCALL_OLD 0x21CD
16 #define SYSCALL_OFFSET 0xE
17 #define SYSCALL_OLD 0x20CD
22 void start_syscall(addr
)
30 intaddr
= symbolvalue( SYSCALL_NAME
, TRUE
);
33 intaddr
+= SYSCALL_OFFSET
;
37 Printf("Using %lx as syscall address\n",addr
);
40 old
= breakpt(intaddr
,"\n");
42 /* Check instruction */
43 if ( (old
& 0xFFFF) == SYSCALL_OLD
)
51 unsigned reg_ax
,reg_bx
;
53 if ( addr
!= intaddr
) return;
55 Printf("syscall to ");
57 reg_ax
= get_reg(curpid
,reg_addr("AX"));
60 case 0: Printf(" PM ");
62 case 1: Printf(" VFS ");
64 case 2: Printf(" INET ");
66 default: Printf("Invalid dest = %d", reg_ax
);
71 reg_bx
= get_reg(curpid
,reg_addr("BX"));
72 decode_message(reg_bx
);
75 tstart(T_STEP
, 0, 0, 1);
77 /* Check return code */
78 reg_ax
= get_reg(curpid
,reg_addr("AX"));
80 Printf("syscall failed AX=%d\n",reg_ax
);
85 #endif /* SYSCALLS_SUPPORT */