Lines Matching defs:L

116 	    (nmap = pread(mapfd, Pmap, statb.st_size, 0L)) <= 0 ||
161 auxv[naux].a_un.a_val = 0L;
1183 struct ps_lwphandle *L;
1185 while ((L = P->hashtab[i]) != NULL)
1186 Lfree_internal(P, L);
3105 struct ps_lwphandle *L;
3108 (L = *Lp) != NULL; Lp = &L->lwp_hash)
3109 if (L->lwp_id == lwpid)
3123 struct ps_lwphandle *L;
3139 else if ((L = malloc(sizeof (struct ps_lwphandle))) == NULL)
3147 (void) memset(L, 0, sizeof (*L));
3148 L->lwp_ctlfd = -1;
3149 L->lwp_statfd = -1;
3150 L->lwp_proc = P;
3151 L->lwp_id = lwpid;
3152 *Lp = L; /* insert into the hash table */
3155 if (getlwpstatus(P, lwpid, &L->lwp_status) == -1) {
3159 L->lwp_state = PS_DEAD;
3162 return (L);
3188 L->lwp_statfd = fd;
3190 if (pread(fd, &L->lwp_status, sizeof (L->lwp_status), (off_t)0) < 0) {
3219 L->lwp_ctlfd = fd;
3221 L->lwp_state =
3222 ((L->lwp_status.pr_flags & (PR_STOPPED|PR_ISTOP))
3228 return (L);
3231 Lfree_internal(P, L);
3267 Lfree(struct ps_lwphandle *L)
3269 struct ps_prochandle *P = L->lwp_proc;
3272 Lfree_internal(P, L);
3277 Lfree_internal(struct ps_prochandle *P, struct ps_lwphandle *L)
3279 *Lfind(P, L->lwp_id) = L->lwp_hash; /* delete from hash table */
3280 if (L->lwp_ctlfd >= 0)
3281 (void) close(L->lwp_ctlfd);
3282 if (L->lwp_statfd >= 0)
3283 (void) close(L->lwp_statfd);
3286 (void) memset(L, 0, sizeof (*L));
3287 L->lwp_ctlfd = -1;
3288 L->lwp_statfd = -1;
3290 free(L);
3297 Lstate(struct ps_lwphandle *L)
3299 return (L->lwp_state);
3308 Lctlfd(struct ps_lwphandle *L)
3310 return (L->lwp_ctlfd);
3319 Lpsinfo(struct ps_lwphandle *L)
3321 if (Plwp_getpsinfo(L->lwp_proc, L->lwp_id, &L->lwp_psinfo) == -1)
3324 return (&L->lwp_psinfo);
3333 Lstatus(struct ps_lwphandle *L)
3335 return (&L->lwp_status);
3342 Lprochandle(struct ps_lwphandle *L)
3344 return (L->lwp_proc);
3352 Lsync(struct ps_lwphandle *L)
3354 int ctlfd = L->lwp_ctlfd;
3359 if (L->lwp_flags & SETHOLD) {
3363 iov[n].iov_base = (caddr_t)&L->lwp_status.pr_lwphold;
3364 iov[n++].iov_len = sizeof (L->lwp_status.pr_lwphold);
3366 if (L->lwp_flags & SETREGS) {
3370 iov[n].iov_base = (caddr_t)&L->lwp_status.pr_reg[0];
3371 iov[n++].iov_len = sizeof (L->lwp_status.pr_reg);
3377 L->lwp_flags &= ~(SETHOLD|SETREGS);
3386 Lstopstatus(struct ps_lwphandle *L,
3390 int ctlfd = L->lwp_ctlfd;
3395 switch (L->lwp_state) {
3416 dprintf("Lstopstatus: corrupted state: %d\n", L->lwp_state);
3436 if (L->lwp_state == PS_DEAD)
3444 Lsync(L);
3446 if (pread(L->lwp_statfd, &L->lwp_status,
3447 sizeof (L->lwp_status), (off_t)0) < 0)
3458 L->lwp_state = PS_LOST;
3479 L->lwp_state = PS_UNDEAD;
3485 if ((L->lwp_status.pr_flags & (PR_STOPPED|PR_ISTOP))
3487 L->lwp_state = PS_RUN;
3495 L->lwp_state = PS_STOP;
3498 prldump("Lstopstatus", &L->lwp_status);
3500 switch (L->lwp_status.pr_why) {
3521 Lwait(struct ps_lwphandle *L, uint_t msec)
3523 return (Lstopstatus(L, PCWSTOP, msec));
3530 Lstop(struct ps_lwphandle *L, uint_t msec)
3532 return (Lstopstatus(L, PCSTOP, msec));
3539 Ldstop(struct ps_lwphandle *L)
3541 return (Lstopstatus(L, PCDSTOP, 0));
3548 Lgetareg(struct ps_lwphandle *L, int regno, prgreg_t *preg)
3555 if (L->lwp_state != PS_STOP) {
3560 *preg = L->lwp_status.pr_reg[regno];
3568 Lputareg(struct ps_lwphandle *L, int regno, prgreg_t reg)
3575 if (L->lwp_state != PS_STOP) {
3580 L->lwp_status.pr_reg[regno] = reg;
3581 L->lwp_flags |= SETREGS; /* set registers before continuing */
3586 Lsetrun(struct ps_lwphandle *L,
3590 int ctlfd = L->lwp_ctlfd;
3600 if (L->lwp_state != PS_STOP &&
3601 (L->lwp_status.pr_flags & sbits) == 0) {
3606 Lsync(L); /* flush registers */
3616 } else if (sig && sig != L->lwp_status.pr_cursig) {
3631 L->lwp_proc->info_valid = 0; /* will need to update map and file info */
3632 L->lwp_proc->state = PS_RUN;
3633 L->lwp_state = PS_RUN;
3637 if (errno != EBUSY || L->lwp_status.pr_why != PR_JOBCONTROL)
3638 return (Lstopstatus(L, PCNULL, 0));
3645 Lclearsig(struct ps_lwphandle *L)
3647 int ctlfd = L->lwp_ctlfd;
3652 L->lwp_status.pr_cursig = 0;
3657 Lclearfault(struct ps_lwphandle *L)
3659 int ctlfd = L->lwp_ctlfd;
3673 Lxecbkpt(struct ps_lwphandle *L, ulong_t saved)
3675 struct ps_prochandle *P = L->lwp_proc;
3678 if (L->lwp_state != PS_STOP) {
3683 Lsync(L);
3684 error = execute_bkpt(L->lwp_ctlfd,
3685 &P->status.pr_flttrace, &L->lwp_status.pr_lwphold,
3686 L->lwp_status.pr_reg[R_PC], saved);
3687 rv = Lstopstatus(L, PCNULL, 0);
3690 if (L->lwp_status.pr_why == PR_JOBCONTROL &&
3692 L->lwp_state = PS_RUN;
3709 Lxecwapt(struct ps_lwphandle *L, const prwatch_t *wp)
3711 struct ps_prochandle *P = L->lwp_proc;
3714 if (L->lwp_state != PS_STOP) {
3719 Lsync(L);
3720 error = execute_wapt(L->lwp_ctlfd,
3721 &P->status.pr_flttrace, &L->lwp_status.pr_lwphold, wp);
3722 rv = Lstopstatus(L, PCNULL, 0);
3725 if (L->lwp_status.pr_why == PR_JOBCONTROL &&
3727 L->lwp_state = PS_RUN;
3740 Lstack(struct ps_lwphandle *L, stack_t *stkp)
3742 struct ps_prochandle *P = L->lwp_proc;
3743 uintptr_t addr = L->lwp_status.pr_ustack;
3763 Lmain_stack(struct ps_lwphandle *L, stack_t *stkp)
3765 struct ps_prochandle *P = L->lwp_proc;
3767 if (Lstack(L, stkp) != 0)
3779 ucontext_t *ctxp = (void *)L->lwp_status.pr_oldcontext;
3786 ucontext32_t *ctxp = (void *)L->lwp_status.pr_oldcontext;
3801 Lalt_stack(struct ps_lwphandle *L, stack_t *stkp)
3803 if (L->lwp_status.pr_altstack.ss_flags & SS_DISABLE) {
3808 *stkp = L->lwp_status.pr_altstack;