/* sys_process.c 6.1 83/07/29 */
#include "../machine/reg.h"
#include "../machine/psl.h"
#include "../machine/pte.h"
* Used to pass trace command from
* parent to child being traced.
* This data base cannot be
uap
= (struct a
*)u
.u_ap
;
u
.u_procp
->p_flag
|= STRC
;
if (p
== 0 || p
->p_stat
!= SSTOP
|| p
->p_ppid
!= u
.u_procp
->p_pid
||
sleep((caddr_t
)&ipc
, IPCPRI
);
sleep((caddr_t
)&ipc
, IPCPRI
);
u
.u_r
.r_val1
= ipc
.ip_data
;
{R0
,R1
,R2
,R3
,R4
,R5
,R6
,R7
,R8
,R9
,R10
,R11
,AP
,FP
,SP
,PC
};
((physadr)(p)+((o)/sizeof(((physadr)0)->r[0])))
* Code that the child process
* executes to implement the command
* of the parent process in tracing.
register struct text
*xp
;
if (ipc
.ip_lock
!= u
.u_procp
->p_pid
)
u
.u_procp
->p_slptime
= 0;
if (!useracc((caddr_t
)ipc
.ip_addr
, 4, B_READ
))
ipc
.ip_data
= fuiword((caddr_t
)ipc
.ip_addr
);
if (!useracc((caddr_t
)ipc
.ip_addr
, 4, B_READ
))
ipc
.ip_data
= fuword((caddr_t
)ipc
.ip_addr
);
if (i
<0 || i
>= ctob(UPAGES
))
ipc
.ip_data
= *(int *)PHYSOFF(&u
, i
);
/* Must set up to allow writing */
* If text, must assure exclusive use
if (xp
= u
.u_procp
->p_textp
) {
if (xp
->x_count
!=1 || xp
->x_iptr
->i_mode
&ISVTX
)
xp
->x_iptr
->i_flag
&= ~ITEXT
;
if ((i
= suiword((caddr_t
)ipc
.ip_addr
, ipc
.ip_data
)) < 0) {
if (chgprot((caddr_t
)ipc
.ip_addr
, RW
) &&
chgprot((caddr_t
)ipc
.ip_addr
+(sizeof(int)-1), RW
))
i
= suiword((caddr_t
)ipc
.ip_addr
, ipc
.ip_data
);
(void) chgprot((caddr_t
)ipc
.ip_addr
, RO
);
(void) chgprot((caddr_t
)ipc
.ip_addr
+(sizeof(int)-1), RO
);
if (suword((caddr_t
)ipc
.ip_addr
, 0) < 0)
(void) suword((caddr_t
)ipc
.ip_addr
, ipc
.ip_data
);
p
= (int *)PHYSOFF(&u
, i
);
for (i
=0; i
<NIPCREG
; i
++)
if (p
== &u
.u_ar0
[ipcreg
[i
]])
ipc
.ip_data
|= PSL_USERSET
;
ipc
.ip_data
&= ~PSL_USERCLR
;
/* set signal and continue */
/* one version causes a trace-trap */
if ((int)ipc
.ip_addr
!= 1)
u
.u_ar0
[PC
] = (int)ipc
.ip_addr
;
if ((unsigned)ipc
.ip_data
> NSIG
)
u
.u_procp
->p_cursig
= ipc
.ip_data
; /* see issig */
exit(u
.u_procp
->p_cursig
);