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:
Ben Gras
2006-03-03 10:21:45 +00:00
parent 7967177710
commit f877da3aec
18 changed files with 164 additions and 154 deletions

View File

@@ -29,9 +29,8 @@ $(LIBDRIVER):
cd $d/libdriver && $(MAKE)
# install with other drivers
install: /sbin/$(DRIVER)
/sbin/$(DRIVER): $(DRIVER)
install -o root -cs $? $@
install: $(DRIVER)
install -o root -cs $? /sbin/$(DRIVER)
# clean up local files
clean:

View File

@@ -90,7 +90,7 @@ PUBLIC int do_diagnostics(message *m)
* user. It also saves a copy in a local buffer so that messages can be
* reviewed at a later time.
*/
int proc_nr;
int proc_nr_e;
vir_bytes src;
int count;
char c;
@@ -98,8 +98,8 @@ PUBLIC int do_diagnostics(message *m)
static char diagbuf[10240];
/* Change SELF to actual process number. */
if ((proc_nr = m->DIAG_PROC_NR) == SELF)
m->DIAG_PROC_NR = proc_nr = m->m_source;
if ((proc_nr_e = m->DIAG_ENDPT) == SELF)
m->DIAG_ENDPT = proc_nr_e = m->m_source;
/* Now also make a copy for the private buffer at the LOG server, so
* that the messages can be reviewed at a later time.
@@ -107,7 +107,7 @@ PUBLIC int do_diagnostics(message *m)
src = (vir_bytes) m->DIAG_PRINT_BUF;
count = m->DIAG_BUF_COUNT;
while (count > 0 && i < sizeof(diagbuf)-1) {
if (sys_datacopy(proc_nr, src, SELF, (vir_bytes) &c, 1) != OK)
if (sys_datacopy(proc_nr_e, src, SELF, (vir_bytes) &c, 1) != OK)
break; /* stop copying on error */
src ++;
count --;

View File

@@ -23,7 +23,7 @@ int c;
if ((c == 0 && buf_count > 0) || buf_count == sizeof(print_buf)) {
m.DIAG_BUF_COUNT = buf_count;
m.DIAG_PRINT_BUF = print_buf;
m.DIAG_PROC_NR = SELF;
m.DIAG_ENDPT = SELF;
m.m_type = DIAGNOSTICS; /* request TTY to output this buffer */
_sendrec(TTY_PROC_NR, &m); /* if it fails, we give up */
buf_count = 0; /* clear buffer for next batch */

View File

@@ -346,14 +346,14 @@ PRIVATE void do_status(message *m_ptr)
if(logdevices[d].log_proc_nr && logdevices[d].log_revive_alerted
&& logdevices[d].log_source == m_ptr->m_source) {
m.m_type = DEV_REVIVE;
m.REP_PROC_NR = logdevices[d].log_proc_nr;
m.REP_ENDPT = logdevices[d].log_proc_nr;
m.REP_STATUS = logdevices[d].log_status;
send(m_ptr->m_source, &m);
logdevices[d].log_proc_nr = 0;
logdevices[d].log_revive_alerted = 0;
#if LOG_DEBUG
printf("revived %d with %d bytes\n",
m.REP_PROC_NR, m.REP_STATUS);
m.REP_ENDPT, m.REP_STATUS);
#endif
return;
}
@@ -447,10 +447,10 @@ message *m_ptr;
return EINVAL;
}
ops = m_ptr->PROC_NR & (SEL_RD|SEL_WR|SEL_ERR);
ops = m_ptr->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
/* Read blocks when there is no log. */
if((m_ptr->PROC_NR & SEL_RD) && logdevices[d].log_size > 0) {
if((m_ptr->IO_ENDPT & SEL_RD) && logdevices[d].log_size > 0) {
#if LOG_DEBUG
printf("log can read; size %d\n", logdevices[d].log_size);
#endif
@@ -458,13 +458,13 @@ message *m_ptr;
}
/* Write never blocks. */
if(m_ptr->PROC_NR & SEL_WR) ready_ops |= SEL_WR;
if(m_ptr->IO_ENDPT & SEL_WR) ready_ops |= SEL_WR;
/* Enable select calback if no operations were
* ready to go, but operations were requested,
* and notify was enabled.
*/
if((m_ptr->PROC_NR & SEL_NOTIFY) && ops && !ready_ops) {
if((m_ptr->IO_ENDPT & SEL_NOTIFY) && ops && !ready_ops) {
logdevices[d].log_selected |= ops;
logdevices[d].log_select_proc = m_ptr->m_source;
#if LOG_DEBUG