endpoint migration for drivers.
mostly renaming message field names to the new names. tty stored process numbers in chars in tty and pty structs - now ints.
This commit is contained in:
@@ -795,19 +795,19 @@ PUBLIC void do_video(message *m)
|
||||
do_map= (m->REQUEST == MIOCMAP); /* else unmap */
|
||||
|
||||
/* Get request structure */
|
||||
r= sys_vircopy(m->PROC_NR, D,
|
||||
r= sys_vircopy(m->IO_ENDPT, D,
|
||||
(vir_bytes)m->ADDRESS,
|
||||
SELF, D, (vir_bytes)&mapreq, sizeof(mapreq));
|
||||
if (r != OK)
|
||||
{
|
||||
tty_reply(TASK_REPLY, m->m_source, m->PROC_NR,
|
||||
tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT,
|
||||
r);
|
||||
return;
|
||||
}
|
||||
r= sys_vm_map(m->PROC_NR, do_map,
|
||||
r= sys_vm_map(m->IO_ENDPT, do_map,
|
||||
(phys_bytes)mapreq.base, mapreq.size,
|
||||
mapreq.offset);
|
||||
tty_reply(TASK_REPLY, m->m_source, m->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
|
||||
return;
|
||||
}
|
||||
r= ENOTTY;
|
||||
@@ -819,7 +819,7 @@ PUBLIC void do_video(message *m)
|
||||
m->m_type, m->m_source);
|
||||
r= EINVAL;
|
||||
}
|
||||
tty_reply(TASK_REPLY, m->m_source, m->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
|
||||
@@ -1058,7 +1058,7 @@ message *m_ptr; /* pointer to request message */
|
||||
vir_bytes src;
|
||||
int count;
|
||||
int result = OK;
|
||||
int proc_nr = m_ptr->DIAG_PROC_NR;
|
||||
int proc_nr = m_ptr->DIAG_ENDPT;
|
||||
if (proc_nr == SELF) proc_nr = m_ptr->m_source;
|
||||
|
||||
src = (vir_bytes) m_ptr->DIAG_PRINT_BUF;
|
||||
@@ -1204,7 +1204,7 @@ message *m;
|
||||
if (!machine.vdu_ega) return(ENOTTY);
|
||||
result = ga_program(seq1); /* bring font memory into view */
|
||||
|
||||
result = sys_physcopy(m->PROC_NR, D, (vir_bytes) m->ADDRESS,
|
||||
result = sys_physcopy(m->IO_ENDPT, D, (vir_bytes) m->ADDRESS,
|
||||
NONE, PHYS_SEG, (phys_bytes) GA_VIDEO_ADDRESS, (phys_bytes)GA_FONT_SIZE);
|
||||
|
||||
result = ga_program(seq2); /* restore */
|
||||
|
||||
@@ -220,7 +220,7 @@ message *m;
|
||||
{
|
||||
/* Should record proc */
|
||||
kbdp->req_size= m->COUNT;
|
||||
kbdp->req_proc= m->PROC_NR;
|
||||
kbdp->req_proc= m->IO_ENDPT;
|
||||
kbdp->req_addr= (vir_bytes)m->ADDRESS;
|
||||
kbdp->incaller= m->m_source;
|
||||
r= SUSPEND;
|
||||
@@ -236,7 +236,7 @@ message *m;
|
||||
if (n <= 0)
|
||||
panic("TTY", "do_kbd(READ): bad n", n);
|
||||
r= sys_vircopy(SELF, D, (vir_bytes)&kbdp->buf[kbdp->offset],
|
||||
m->PROC_NR, D, (vir_bytes) m->ADDRESS, n);
|
||||
m->IO_ENDPT, D, (vir_bytes) m->ADDRESS, n);
|
||||
if (r == OK)
|
||||
{
|
||||
kbdp->offset= (kbdp->offset+n) % KBD_BUFSZ;
|
||||
@@ -260,7 +260,7 @@ message *m;
|
||||
*/
|
||||
for (i= 0; i<m->COUNT; i++)
|
||||
{
|
||||
r= sys_vircopy(m->PROC_NR, D, (vir_bytes) m->ADDRESS+i,
|
||||
r= sys_vircopy(m->IO_ENDPT, D, (vir_bytes) m->ADDRESS+i,
|
||||
SELF, D, (vir_bytes)&c, 1);
|
||||
if (r != OK)
|
||||
break;
|
||||
@@ -274,8 +274,8 @@ message *m;
|
||||
r= OK;
|
||||
break;
|
||||
case DEV_SELECT:
|
||||
ops = m->PROC_NR & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m->PROC_NR & SEL_NOTIFY) ? 1 : 0;
|
||||
ops = m->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
|
||||
|
||||
r= 0;
|
||||
if (kbdp->avail && (ops & SEL_RD))
|
||||
@@ -296,7 +296,7 @@ message *m;
|
||||
kio_leds_t leds;
|
||||
unsigned char b;
|
||||
|
||||
r= sys_vircopy(m->PROC_NR, D, (vir_bytes) m->ADDRESS,
|
||||
r= sys_vircopy(m->IO_ENDPT, D, (vir_bytes) m->ADDRESS,
|
||||
SELF, D, (vir_bytes)&leds, sizeof(leds));
|
||||
if (r != OK)
|
||||
break;
|
||||
@@ -330,7 +330,7 @@ message *m;
|
||||
kio_bell_t bell;
|
||||
clock_t ticks;
|
||||
|
||||
r= sys_vircopy(m->PROC_NR, D, (vir_bytes) m->ADDRESS,
|
||||
r= sys_vircopy(m->IO_ENDPT, D, (vir_bytes) m->ADDRESS,
|
||||
SELF, D, (vir_bytes)&bell, sizeof(bell));
|
||||
if (r != OK)
|
||||
break;
|
||||
@@ -352,7 +352,7 @@ message *m;
|
||||
m->m_type, m->m_source);
|
||||
r= EINVAL;
|
||||
}
|
||||
tty_reply(TASK_REPLY, m->m_source, m->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ message *m;
|
||||
}
|
||||
|
||||
m->m_type = DEV_REVIVE;
|
||||
m->REP_PROC_NR= kbdp->req_proc;
|
||||
m->REP_ENDPT= kbdp->req_proc;
|
||||
m->REP_STATUS= r;
|
||||
return 1;
|
||||
}
|
||||
@@ -927,7 +927,7 @@ message *m;
|
||||
{
|
||||
/* Load a new keymap. */
|
||||
int result;
|
||||
result = sys_vircopy(m->PROC_NR, D, (vir_bytes) m->ADDRESS,
|
||||
result = sys_vircopy(m->IO_ENDPT, D, (vir_bytes) m->ADDRESS,
|
||||
SELF, D, (vir_bytes) keymap,
|
||||
(vir_bytes) sizeof(keymap));
|
||||
return(result);
|
||||
|
||||
@@ -34,16 +34,16 @@ typedef struct pty {
|
||||
|
||||
/* Read call on /dev/ptypX. */
|
||||
char rdsendreply; /* send a reply (instead of notify) */
|
||||
char rdcaller; /* process making the call (usually FS) */
|
||||
char rdproc; /* process that wants to read from the pty */
|
||||
int rdcaller; /* process making the call (usually FS) */
|
||||
int rdproc; /* process that wants to read from the pty */
|
||||
vir_bytes rdvir; /* virtual address in readers address space */
|
||||
int rdleft; /* # bytes yet to be read */
|
||||
int rdcum; /* # bytes written so far */
|
||||
|
||||
/* Write call to /dev/ptypX. */
|
||||
char wrsendreply; /* send a reply (instead of notify) */
|
||||
char wrcaller; /* process making the call (usually FS) */
|
||||
char wrproc; /* process that wants to write to the pty */
|
||||
int wrcaller; /* process making the call (usually FS) */
|
||||
int wrproc; /* process that wants to write to the pty */
|
||||
vir_bytes wrvir; /* virtual address in writers address space */
|
||||
int wrleft; /* # bytes yet to be written */
|
||||
int wrcum; /* # bytes written so far */
|
||||
@@ -103,17 +103,17 @@ message *m_ptr;
|
||||
break;
|
||||
}
|
||||
#if DEAD_CODE
|
||||
if (numap_local(m_ptr->PROC_NR, (vir_bytes) m_ptr->ADDRESS,
|
||||
if (numap_local(m_ptr->IO_ENDPT, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->COUNT) == 0) {
|
||||
#else
|
||||
if ((r = sys_umap(m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
if ((r = sys_umap(m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->COUNT, &p)) != OK) {
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
pp->rdsendreply = TRUE;
|
||||
pp->rdcaller = m_ptr->m_source;
|
||||
pp->rdproc = m_ptr->PROC_NR;
|
||||
pp->rdproc = m_ptr->IO_ENDPT;
|
||||
pp->rdvir = (vir_bytes) m_ptr->ADDRESS;
|
||||
pp->rdleft = m_ptr->COUNT;
|
||||
pty_start(pp);
|
||||
@@ -144,18 +144,18 @@ message *m_ptr;
|
||||
break;
|
||||
}
|
||||
#if DEAD_CODE
|
||||
if (numap_local(m_ptr->PROC_NR, (vir_bytes) m_ptr->ADDRESS,
|
||||
if (numap_local(m_ptr->IO_ENDPT, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->COUNT) == 0) {
|
||||
r = EFAULT;
|
||||
#else
|
||||
if ((r = sys_umap(m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
if ((r = sys_umap(m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->COUNT, &p)) != OK) {
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
pp->wrsendreply = TRUE;
|
||||
pp->wrcaller = m_ptr->m_source;
|
||||
pp->wrproc = m_ptr->PROC_NR;
|
||||
pp->wrproc = m_ptr->IO_ENDPT;
|
||||
pp->wrvir = (vir_bytes) m_ptr->ADDRESS;
|
||||
pp->wrleft = m_ptr->COUNT;
|
||||
handle_events(tp);
|
||||
@@ -192,11 +192,11 @@ message *m_ptr;
|
||||
break;
|
||||
|
||||
case CANCEL:
|
||||
if (m_ptr->PROC_NR == pp->rdproc) {
|
||||
if (m_ptr->IO_ENDPT == pp->rdproc) {
|
||||
/* Cancel a read from a PTY. */
|
||||
pp->rdleft = pp->rdcum = 0;
|
||||
}
|
||||
if (m_ptr->PROC_NR == pp->wrproc) {
|
||||
if (m_ptr->IO_ENDPT == pp->wrproc) {
|
||||
/* Cancel a write to a PTY. */
|
||||
pp->wrleft = pp->wrcum = 0;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ message *m_ptr;
|
||||
default:
|
||||
r = EINVAL;
|
||||
}
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -511,7 +511,7 @@ PUBLIC int pty_status(message *m_ptr)
|
||||
pp->rdcaller == m_ptr->m_source)
|
||||
{
|
||||
m_ptr->m_type = DEV_REVIVE;
|
||||
m_ptr->REP_PROC_NR = pp->rdproc;
|
||||
m_ptr->REP_ENDPT = pp->rdproc;
|
||||
m_ptr->REP_STATUS = pp->rdcum;
|
||||
|
||||
pp->rdleft = pp->rdcum = 0;
|
||||
@@ -524,7 +524,7 @@ PUBLIC int pty_status(message *m_ptr)
|
||||
pp->wrcaller == m_ptr->m_source)
|
||||
{
|
||||
m_ptr->m_type = DEV_REVIVE;
|
||||
m_ptr->REP_PROC_NR = pp->wrproc;
|
||||
m_ptr->REP_ENDPT = pp->wrproc;
|
||||
if (pp->wrcum == 0)
|
||||
m_ptr->REP_STATUS = EIO;
|
||||
else
|
||||
@@ -596,8 +596,8 @@ PRIVATE int pty_select(tty_t *tp, message *m)
|
||||
pty_t *pp = tp->tty_priv;
|
||||
int ops, ready_ops = 0, watch;
|
||||
|
||||
ops = m->PROC_NR & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m->PROC_NR & SEL_NOTIFY) ? 1 : 0;
|
||||
ops = m->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
|
||||
|
||||
ready_ops = select_try_pty(tp, ops);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* DEV_STATUS: FS wants to know status for SELECT or REVIVE
|
||||
* CANCEL: terminate a previous incomplete system call immediately
|
||||
*
|
||||
* m_type TTY_LINE PROC_NR COUNT TTY_SPEK TTY_FLAGS ADDRESS
|
||||
* m_type TTY_LINE IO_ENDPT COUNT TTY_SPEK TTY_FLAGS ADDRESS
|
||||
* ---------------------------------------------------------------------------
|
||||
* | HARD_INT | | | | | | |
|
||||
* |-------------+---------+---------+---------+---------+---------+---------|
|
||||
@@ -302,7 +302,7 @@ PUBLIC void main(void)
|
||||
if (tty_mess.m_source != LOG_PROC_NR)
|
||||
{
|
||||
tty_reply(TASK_REPLY, tty_mess.m_source,
|
||||
tty_mess.PROC_NR, ENXIO);
|
||||
tty_mess.IO_ENDPT, ENXIO);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ PUBLIC void main(void)
|
||||
printf("Warning, TTY got unexpected request %d from %d\n",
|
||||
tty_mess.m_type, tty_mess.m_source);
|
||||
tty_reply(TASK_REPLY, tty_mess.m_source,
|
||||
tty_mess.PROC_NR, EINVAL);
|
||||
tty_mess.IO_ENDPT, EINVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ message *m_ptr;
|
||||
|
||||
/* Suspended request finished. Send a REVIVE. */
|
||||
m_ptr->m_type = DEV_REVIVE;
|
||||
m_ptr->REP_PROC_NR = tp->tty_inproc;
|
||||
m_ptr->REP_ENDPT = tp->tty_inproc;
|
||||
m_ptr->REP_STATUS = tp->tty_incum;
|
||||
|
||||
tp->tty_inleft = tp->tty_incum = 0;
|
||||
@@ -370,7 +370,7 @@ message *m_ptr;
|
||||
|
||||
/* Suspended request finished. Send a REVIVE. */
|
||||
m_ptr->m_type = DEV_REVIVE;
|
||||
m_ptr->REP_PROC_NR = tp->tty_outproc;
|
||||
m_ptr->REP_ENDPT = tp->tty_outproc;
|
||||
m_ptr->REP_STATUS = tp->tty_outcum;
|
||||
|
||||
tp->tty_outcum = 0;
|
||||
@@ -421,7 +421,7 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
if (more_verbose) printf("do_read: EINVAL\n");
|
||||
r = EINVAL;
|
||||
} else
|
||||
if (sys_umap(m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS, m_ptr->COUNT,
|
||||
if (sys_umap(m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS, m_ptr->COUNT,
|
||||
&phys_addr) != OK) {
|
||||
if (more_verbose) printf("do_read: EFAULT\n");
|
||||
r = EFAULT;
|
||||
@@ -429,7 +429,7 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
/* Copy information from the message to the tty struct. */
|
||||
tp->tty_inrepcode = TASK_REPLY;
|
||||
tp->tty_incaller = m_ptr->m_source;
|
||||
tp->tty_inproc = m_ptr->PROC_NR;
|
||||
tp->tty_inproc = m_ptr->IO_ENDPT;
|
||||
tp->tty_in_vir = (vir_bytes) m_ptr->ADDRESS;
|
||||
tp->tty_inleft = m_ptr->COUNT;
|
||||
|
||||
@@ -474,7 +474,7 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
}
|
||||
}
|
||||
if (more_verbose) printf("do_read: replying %d\n", r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
|
||||
if (tp->tty_select_ops)
|
||||
select_retry(tp);
|
||||
}
|
||||
@@ -499,14 +499,14 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
if (m_ptr->COUNT <= 0) {
|
||||
r = EINVAL;
|
||||
} else
|
||||
if (sys_umap(m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS, m_ptr->COUNT,
|
||||
if (sys_umap(m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS, m_ptr->COUNT,
|
||||
&phys_addr) != OK) {
|
||||
r = EFAULT;
|
||||
} else {
|
||||
/* Copy message parameters to the tty structure. */
|
||||
tp->tty_outrepcode = TASK_REPLY;
|
||||
tp->tty_outcaller = m_ptr->m_source;
|
||||
tp->tty_outproc = m_ptr->PROC_NR;
|
||||
tp->tty_outproc = m_ptr->IO_ENDPT;
|
||||
tp->tty_out_vir = (vir_bytes) m_ptr->ADDRESS;
|
||||
tp->tty_outleft = m_ptr->COUNT;
|
||||
|
||||
@@ -526,7 +526,7 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
tp->tty_outrepcode = REVIVE;
|
||||
}
|
||||
}
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -602,7 +602,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
case TCGETS:
|
||||
/* Get the termios attributes. */
|
||||
r = sys_vircopy(SELF, D, (vir_bytes) &tp->tty_termios,
|
||||
m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
(vir_bytes) size);
|
||||
break;
|
||||
|
||||
@@ -612,7 +612,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
if (tp->tty_outleft > 0) {
|
||||
/* Wait for all ongoing output processing to finish. */
|
||||
tp->tty_iocaller = m_ptr->m_source;
|
||||
tp->tty_ioproc = m_ptr->PROC_NR;
|
||||
tp->tty_ioproc = m_ptr->IO_ENDPT;
|
||||
tp->tty_ioreq = m_ptr->REQUEST;
|
||||
tp->tty_iovir = (vir_bytes) m_ptr->ADDRESS;
|
||||
r = SUSPEND;
|
||||
@@ -623,14 +623,14 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
/*FALL THROUGH*/
|
||||
case TCSETS:
|
||||
/* Set the termios attributes. */
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) &tp->tty_termios, (vir_bytes) size);
|
||||
if (r != OK) break;
|
||||
setattr(tp);
|
||||
break;
|
||||
|
||||
case TCFLSH:
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) ¶m.i, (vir_bytes) size);
|
||||
if (r != OK) break;
|
||||
switch (param.i) {
|
||||
@@ -642,7 +642,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
break;
|
||||
|
||||
case TCFLOW:
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) ¶m.i, (vir_bytes) size);
|
||||
if (r != OK) break;
|
||||
switch (param.i) {
|
||||
@@ -668,12 +668,12 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
|
||||
case TIOCGWINSZ:
|
||||
r = sys_vircopy(SELF, D, (vir_bytes) &tp->tty_winsize,
|
||||
m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
(vir_bytes) size);
|
||||
break;
|
||||
|
||||
case TIOCSWINSZ:
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) &tp->tty_winsize, (vir_bytes) size);
|
||||
sigchar(tp, SIGWINCH);
|
||||
break;
|
||||
@@ -682,12 +682,12 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
case TIOCGETP:
|
||||
compat_getp(tp, ¶m.sg);
|
||||
r = sys_vircopy(SELF, D, (vir_bytes) ¶m.sg,
|
||||
m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
(vir_bytes) size);
|
||||
break;
|
||||
|
||||
case TIOCSETP:
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) ¶m.sg, (vir_bytes) size);
|
||||
if (r != OK) break;
|
||||
compat_setp(tp, ¶m.sg);
|
||||
@@ -696,12 +696,12 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
case TIOCGETC:
|
||||
compat_getc(tp, ¶m.tc);
|
||||
r = sys_vircopy(SELF, D, (vir_bytes) ¶m.tc,
|
||||
m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
(vir_bytes) size);
|
||||
break;
|
||||
|
||||
case TIOCSETC:
|
||||
r = sys_vircopy( m_ptr->PROC_NR, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS,
|
||||
SELF, D, (vir_bytes) ¶m.tc, (vir_bytes) size);
|
||||
if (r != OK) break;
|
||||
compat_setc(tp, ¶m.tc);
|
||||
@@ -741,7 +741,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
}
|
||||
|
||||
/* Send the reply. */
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -762,12 +762,12 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
if (m_ptr->COUNT & R_BIT) r = EACCES;
|
||||
} else {
|
||||
if (!(m_ptr->COUNT & O_NOCTTY)) {
|
||||
tp->tty_pgrp = m_ptr->PROC_NR;
|
||||
tp->tty_pgrp = m_ptr->IO_ENDPT;
|
||||
r = 1;
|
||||
}
|
||||
tp->tty_openct++;
|
||||
}
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, r);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -788,7 +788,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
tp->tty_winsize = winsize_defaults;
|
||||
setattr(tp);
|
||||
}
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, OK);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, OK);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -806,7 +806,7 @@ message *m_ptr; /* pointer to message sent to task */
|
||||
int mode;
|
||||
|
||||
/* Check the parameters carefully, to avoid cancelling twice. */
|
||||
proc_nr = m_ptr->PROC_NR;
|
||||
proc_nr = m_ptr->IO_ENDPT;
|
||||
mode = m_ptr->COUNT;
|
||||
if ((mode & R_BIT) && tp->tty_inleft != 0 && proc_nr == tp->tty_inproc) {
|
||||
/* Process was reading when killed. Clean up input. */
|
||||
@@ -1476,7 +1476,7 @@ int status; /* reply code */
|
||||
message tty_mess;
|
||||
|
||||
tty_mess.m_type = code;
|
||||
tty_mess.REP_PROC_NR = proc_nr;
|
||||
tty_mess.REP_ENDPT = proc_nr;
|
||||
tty_mess.REP_STATUS = status;
|
||||
|
||||
if ((status = send(replyee, &tty_mess)) != OK) {
|
||||
@@ -1672,8 +1672,8 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
{
|
||||
int ops, ready_ops = 0, watch;
|
||||
|
||||
ops = m_ptr->PROC_NR & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m_ptr->PROC_NR & SEL_NOTIFY) ? 1 : 0;
|
||||
ops = m_ptr->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
|
||||
watch = (m_ptr->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
|
||||
|
||||
ready_ops = select_try(tp, ops);
|
||||
|
||||
@@ -1682,7 +1682,7 @@ register message *m_ptr; /* pointer to message sent to the task */
|
||||
tp->tty_select_proc = m_ptr->m_source;
|
||||
}
|
||||
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->PROC_NR, ready_ops);
|
||||
tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, ready_ops);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1968,7 +1968,7 @@ message *m_ptr;
|
||||
message reply_mess;
|
||||
|
||||
minor = m_ptr->TTY_LINE;
|
||||
proc = m_ptr->PROC_NR;
|
||||
proc = m_ptr->IO_ENDPT;
|
||||
func = m_ptr->REQUEST;
|
||||
spek = m_ptr->m2_l1;
|
||||
flags = m_ptr->m2_l2;
|
||||
@@ -2016,7 +2016,7 @@ message *m_ptr;
|
||||
r = ENOTTY;
|
||||
}
|
||||
reply_mess.m_type = TASK_REPLY;
|
||||
reply_mess.REP_PROC_NR = m_ptr->PROC_NR;
|
||||
reply_mess.REP_ENDPT = m_ptr->IO_ENDPT;
|
||||
reply_mess.REP_STATUS = r;
|
||||
reply_mess.m2_l1 = erki;
|
||||
reply_mess.m2_l2 = flags;
|
||||
|
||||
@@ -58,26 +58,26 @@ typedef struct tty {
|
||||
char tty_reprint; /* 1 when echoed input messed up, else 0 */
|
||||
char tty_escaped; /* 1 when LNEXT (^V) just seen, else 0 */
|
||||
char tty_inhibited; /* 1 when STOP (^S) just seen (stops output) */
|
||||
char tty_pgrp; /* slot number of controlling process */
|
||||
int tty_pgrp; /* slot number of controlling process */
|
||||
char tty_openct; /* count of number of opens of this tty */
|
||||
|
||||
/* Information about incomplete I/O requests is stored here. */
|
||||
char tty_inrepcode; /* reply code, TASK_REPLY or REVIVE */
|
||||
char tty_inrevived; /* set to 1 if revive callback is pending */
|
||||
char tty_incaller; /* process that made the call (usually FS) */
|
||||
char tty_inproc; /* process that wants to read from tty */
|
||||
int tty_incaller; /* process that made the call (usually FS) */
|
||||
int tty_inproc; /* process that wants to read from tty */
|
||||
vir_bytes tty_in_vir; /* virtual address where data is to go */
|
||||
int tty_inleft; /* how many chars are still needed */
|
||||
int tty_incum; /* # chars input so far */
|
||||
char tty_outrepcode; /* reply code, TASK_REPLY or REVIVE */
|
||||
char tty_outrevived; /* set to 1 if revive callback is pending */
|
||||
char tty_outcaller; /* process that made the call (usually FS) */
|
||||
char tty_outproc; /* process that wants to write to tty */
|
||||
int tty_outrepcode; /* reply code, TASK_REPLY or REVIVE */
|
||||
int tty_outrevived; /* set to 1 if revive callback is pending */
|
||||
int tty_outcaller; /* process that made the call (usually FS) */
|
||||
int tty_outproc; /* process that wants to write to tty */
|
||||
vir_bytes tty_out_vir; /* virtual address where data comes from */
|
||||
int tty_outleft; /* # chars yet to be output */
|
||||
int tty_outcum; /* # chars output so far */
|
||||
char tty_iocaller; /* process that made the call (usually FS) */
|
||||
char tty_ioproc; /* process that wants to do an ioctl */
|
||||
int tty_iocaller; /* process that made the call (usually FS) */
|
||||
int tty_ioproc; /* process that wants to do an ioctl */
|
||||
int tty_ioreq; /* ioctl request code */
|
||||
vir_bytes tty_iovir; /* virtual address of ioctl buffer */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user