Somethimes rb_hd, rb_tl can point to different addresses, so
change tsleep/wakeup to use constant addresses
2) Change tsleep wait channel from tty* to ptc* to avoid collisions
for debug purposes.
* SUCH DAMAGE.
*
* from: @(#)tty_pty.c 7.21 (Berkeley) 5/30/91
* SUCH DAMAGE.
*
* from: @(#)tty_pty.c 7.21 (Berkeley) 5/30/91
- * $Id: tty_pty.c,v 1.11 1994/04/03 19:40:01 ache Exp $
+ * $Id: tty_pty.c,v 1.12 1994/04/05 10:12:41 ache Exp $
#endif
#define BUFSIZ 100 /* Chunk size iomoved to/from user */
#endif
#define BUFSIZ 100 /* Chunk size iomoved to/from user */
+#define PTCREAD_SLEEP_ADDR(tp) ((caddr_t)&tp->t_out + 1)
+#define PTCWRITE_SLEEP_ADDR(tp) ((caddr_t)&tp->t_raw + 1)
static void ptcwakeup(struct tty *, int);
static void ptcwakeup(struct tty *, int);
pti->pt_selr = 0;
pti->pt_flags &= ~PF_RCOLL;
}
pti->pt_selr = 0;
pti->pt_flags &= ~PF_RCOLL;
}
- wakeup((caddr_t)&tp->t_out->rb_tl);
+ wakeup(PTCREAD_SLEEP_ADDR(tp));
}
if (flag & FWRITE) {
if (pti->pt_selw) {
}
if (flag & FWRITE) {
if (pti->pt_selw) {
pti->pt_selw = 0;
pti->pt_flags &= ~PF_WCOLL;
}
pti->pt_selw = 0;
pti->pt_flags &= ~PF_WCOLL;
}
- wakeup((caddr_t)&tp->t_raw->rb_hd);
+ wakeup(PTCWRITE_SLEEP_ADDR(tp));
return (0); /* EOF */
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
return (0); /* EOF */
if (flag & IO_NDELAY)
return (EWOULDBLOCK);
- if (error = tsleep((caddr_t)&tp->t_out->rb_tl, TTIPRI | PCATCH,
- ttyin, 0))
+ if (error = tsleep(PTCREAD_SLEEP_ADDR(tp), TTIPRI | PCATCH,
+ "ptcin", 0))
return (error);
}
if (pti->pt_flags & (PF_PKT|PF_UCNTL))
return (error);
}
if (pti->pt_flags & (PF_PKT|PF_UCNTL))
return (EWOULDBLOCK);
return (0);
}
return (EWOULDBLOCK);
return (0);
}
- if (error = tsleep((caddr_t)&tp->t_raw->rb_hd, TTOPRI | PCATCH,
- ttyout, 0)) {
+ if (error = tsleep(PTCWRITE_SLEEP_ADDR(tp), TTOPRI | PCATCH,
+ "ptcout", 0)) {
/* adjust for data copied in but not written */
uio->uio_resid += cc;
return (error);
/* adjust for data copied in but not written */
uio->uio_resid += cc;
return (error);