int BufLength;
int RevivePending; /* process waiting for this dev? */
int ReviveStatus; /* return val when proc unblocked */
- int ReviveProcNr; /* the process to unblock */
+ endpoint_t ReviveProcNr; /* the process to unblock */
cp_grant_id_t ReviveGrant; /* grant id associated with io */
void *UserBuf; /* address of user's data buffer */
int ReadyToRevive; /* are we ready to revive process?*/
- int NotifyProcNr; /* process to send notify to (FS) */
+ endpoint_t SourceProcNr; /* process to send notify to (FS) */
u32_t FragSize; /* dma fragment size */
char *DmaBuf; /* the dma buffer; extra space for
page alignment */
/* Field names for messages to block and character device drivers. */
#define DEVICE m2_i1 /* major-minor device */
-#define IO_ENDPT m2_i2 /* which (proc/endpoint) wants I/O? */
+#define USER_ENDPT m2_i2 /* which endpoint initiated this call? */
#define COUNT m2_i3 /* how many bytes to transfer */
#define REQUEST m2_i3 /* ioctl request code */
#define POSITION m2_l1 /* file offset (low 4 bytes) */
#define DL_TASK_REPLY (DL_RS_BASE + 2)
/* Field names for data link layer messages. */
-#define DL_ENDPT m2_i2
+#define DL_ENDPT_LEGACY m2_i2 /* obsolete; will be removed */
#define DL_COUNT m2_i3
#define DL_MODE m2_l1
#define DL_FLAGS m2_l1
#define ABRT_MON_LEN m1_i3 /* length of monitor params */
#define ABRT_MON_ADDR m1_p1 /* virtual address of monitor params */
+/* Field names for SYS_IOPENABLE. */
+#define IOP_ENDPT m2_l1 /* target endpoint */
+
/* Field names for _UMAP, _VIRCOPY, _PHYSCOPY. */
#define CP_SRC_SPACE m5_s1 /* T or D space (stack is also D) */
#define CP_SRC_ENDPT m5_i1 /* process to copy from */
return atapi_load_eject(current_port, 0, FALSE /*load*/);
case DIOCOPENCT:
- return sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
+ return sys_safecopyto(m->m_source, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes) ¤t_port->open_count,
sizeof(current_port->open_count), D);
if (current_port->state != STATE_GOOD_DEV)
return EIO;
- if ((r = sys_safecopyfrom(m->IO_ENDPT,
+ if ((r = sys_safecopyfrom(m->m_source,
(cp_grant_id_t) m->IO_GRANT, 0, (vir_bytes) &val,
sizeof(val), D)) != OK)
return r;
if ((r = gen_get_wcache(current_port, 0, &val)) != OK)
return r;
- return sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
+ return sys_safecopyto(m->m_source, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes) &val, sizeof(val), D);
}
return EINVAL;
if (m->REQUEST == DIOCTIMEOUT) {
- r= sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
+ r= sys_safecopyfrom(m->m_source, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&timeout, sizeof(timeout), D);
if(r != OK)
timeout_usecs = timeout;
}
- r= sys_safecopyto(m->IO_ENDPT,
+ r= sys_safecopyto(m->m_source,
(cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&prev, sizeof(prev), D);
int count;
if (w_prepare(m->DEVICE) == NULL) return ENXIO;
count = w_wn->open_ct;
- r= sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
+ r= sys_safecopyto(m->m_source, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&count, sizeof(count), D);
if(r != OK)
/* Copy in the next batch. */
batch = MIN(m->DL_COUNT - i, NR_IOREQS);
- r = sys_safecopyfrom(m->DL_ENDPT, m->DL_GRANT, off,
+ r = sys_safecopyfrom(m->m_source, m->DL_GRANT, off,
(vir_bytes) iovec, batch * sizeof(iovec[0]), D);
if (r != OK)
panic("vector copy failed: %d", r);
for (j = 0, iovp = iovec; j < batch && left > 0; j++, iovp++) {
size = MIN(iovp->iov_size, left);
- r = sys_safecopyto(m->DL_ENDPT, iovp->iov_grant, 0,
+ r = sys_safecopyto(m->m_source, iovp->iov_grant, 0,
(vir_bytes) pos, size, D);
if (r != OK)
panic("safe copy failed: %d", r);
/* Copy in the next batch. */
batch = MIN(m->DL_COUNT - i, NR_IOREQS);
- r = sys_safecopyfrom(m->DL_ENDPT, m->DL_GRANT, off,
+ r = sys_safecopyfrom(m->m_source, m->DL_GRANT, off,
(vir_bytes) iovec, batch * sizeof(iovec[0]), D);
if (r != OK)
panic("vector copy failed: %d", r);
skip = 0;
if (size > ATL2_TXD_BUFSIZE - pos) {
skip = ATL2_TXD_BUFSIZE - pos;
- r = sys_safecopyfrom(m->DL_ENDPT,
+ r = sys_safecopyfrom(m->m_source,
iovp->iov_grant, 0,
(vir_bytes) (state.txd_base + pos),
skip, D);
pos = 0;
}
- r = sys_safecopyfrom(m->DL_ENDPT, iovp->iov_grant,
+ r = sys_safecopyfrom(m->m_source, iovp->iov_grant,
skip, (vir_bytes) (state.txd_base + pos),
size - skip, D);
if (r != OK)
*/
int r;
- sys_safecopyto(m->DL_ENDPT, m->DL_GRANT, 0,
+ sys_safecopyto(m->m_source, m->DL_GRANT, 0,
(vir_bytes) &state.stat, sizeof(state.stat), D);
m->m_type = DL_STAT_REPLY;
int count;
if (w_prepare(m->DEVICE) == NULL) return ENXIO;
count = w_wn->open_ct;
- r=sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t)m->IO_GRANT,
+ r=sys_safecopyto(m->m_source, (cp_grant_id_t)m->IO_GRANT,
0, (vir_bytes)&count, sizeof(count), D);
if(r != OK)
dep = &de_state;
- if ((rc = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0UL,
+ if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0UL,
(vir_bytes)&dep->de_stat,
sizeof(dep->de_stat), 0)) != OK)
panic(str_CopyErrMsg, rc);
/* Setup the iovec entry to allow copying into
client layer
*/
- dep->de_read_iovec.iod_proc_nr = mp->DL_ENDPT;
- de_get_userdata_s(mp->DL_ENDPT, (cp_grant_id_t) mp->DL_GRANT, 0,
+ dep->de_read_iovec.iod_proc_nr = mp->m_source;
+ de_get_userdata_s(mp->m_source, (cp_grant_id_t) mp->DL_GRANT, 0,
mp->DL_COUNT, dep->de_read_iovec.iod_iovec);
dep->de_read_iovec.iod_iovec_s = mp->DL_COUNT;
dep->de_read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
buffer = descr->buf1;
iovp = &dep->de_write_iovec;
- iovp->iod_proc_nr = mp->DL_ENDPT;
- de_get_userdata_s(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ iovp->iod_proc_nr = mp->m_source;
+ de_get_userdata_s(mp->m_source, mp->DL_GRANT, 0,
mp->DL_COUNT, iovp->iod_iovec);
iovp->iod_iovec_s = mp->DL_COUNT;
iovp->iod_grant = (cp_grant_id_t) mp->DL_GRANT;
typedef struct iovec_dat_s {
iovec_s_t iod_iovec[IOVEC_NR];
int iod_iovec_s;
- int iod_proc_nr;
+ endpoint_t iod_proc_nr;
cp_grant_id_t iod_grant;
vir_bytes iod_iovec_offset;
} iovec_dat_s_t;
}
assert(!(dep->de_flags & DEF_PACK_SEND));
- get_userdata_s(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ get_userdata_s(mp->m_source, mp->DL_GRANT, 0,
(count > IOVEC_NR ? IOVEC_NR : count) *
sizeof(dep->de_write_iovec_s.iod_iovec[0]),
dep->de_write_iovec_s.iod_iovec);
dep->de_write_iovec_s.iod_iovec_s = count;
- dep->de_write_iovec_s.iod_proc_nr = mp->DL_ENDPT;
+ dep->de_write_iovec_s.iod_proc_nr = mp->m_source;
dep->de_write_iovec_s.iod_grant = mp->DL_GRANT;
dep->de_write_iovec_s.iod_iovec_offset = 0;
if(dep->de_flags & DEF_READING)
panic("dp8390: read already in progress");
- get_userdata_s(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ get_userdata_s(mp->m_source, mp->DL_GRANT, 0,
(count > IOVEC_NR ? IOVEC_NR : count) *
sizeof(dep->de_read_iovec_s.iod_iovec[0]),
dep->de_read_iovec_s.iod_iovec);
dep->de_read_iovec_s.iod_iovec_s = count;
- dep->de_read_iovec_s.iod_proc_nr = mp->DL_ENDPT;
+ dep->de_read_iovec_s.iod_proc_nr = mp->m_source;
dep->de_read_iovec_s.iod_grant = mp->DL_GRANT;
dep->de_read_iovec_s.iod_iovec_offset = 0;
if (dep->de_mode == DEM_SINK)
{
- put_userdata_s(mp->DL_ENDPT, (vir_bytes) mp->DL_GRANT,
+ put_userdata_s(mp->m_source, (vir_bytes) mp->DL_GRANT,
(vir_bytes) sizeof(dep->de_stat), &dep->de_stat);
mp->m_type= DL_STAT_REPLY;
dep->de_stat.ets_frameAll += inb_reg0(dep, DP_CNTR1);
dep->de_stat.ets_missedP += inb_reg0(dep, DP_CNTR2);
- put_userdata_s(mp->DL_ENDPT, mp->DL_GRANT,
+ put_userdata_s(mp->m_source, mp->DL_GRANT,
sizeof(dep->de_stat), &dep->de_stat);
mp->m_type= DL_STAT_REPLY;
{
iovec_t iod_iovec[IOVEC_NR];
int iod_iovec_s;
- int iod_proc_nr;
+ endpoint_t iod_proc_nr;
vir_bytes iod_iovec_addr;
} iovec_dat_t;
if (dep->de_flags & DEF_SENDING) /* Is sending in progress? */
panic("send already in progress ");
- dep->de_write_iovec.iod_proc_nr = mp->DL_ENDPT;
- get_userdata_s(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ dep->de_write_iovec.iod_proc_nr = mp->m_source;
+ get_userdata_s(mp->m_source, mp->DL_GRANT, 0,
mp->DL_COUNT, dep->de_write_iovec.iod_iovec);
dep->de_write_iovec.iod_iovec_s = mp->DL_COUNT;
dep->de_write_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
if (dep->de_flags & DEF_READING) /* Reading in progress */
panic("read already in progress");
- dep->de_read_iovec.iod_proc_nr = mp->DL_ENDPT;
- get_userdata_s(mp->DL_ENDPT, (cp_grant_id_t) mp->DL_GRANT, 0,
+ dep->de_read_iovec.iod_proc_nr = mp->m_source;
+ get_userdata_s(mp->m_source, (cp_grant_id_t) mp->DL_GRANT, 0,
mp->DL_COUNT, dep->de_read_iovec.iod_iovec);
dep->de_read_iovec.iod_iovec_s = mp->DL_COUNT;
dep->de_read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
dep = &de_state;
if (dep->de_mode == DEM_ENABLED) (*dep->de_getstatsf) (dep);
- if ((rc = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ if ((rc = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)&dep->de_stat,
(vir_bytes) sizeof(dep->de_stat), 0)) != OK)
panic(CopyErrMsg, rc);
typedef struct iovec_dat_s {
iovec_s_t iod_iovec[IOVEC_NR];
int iod_iovec_s;
- int iod_proc_nr;
+ endpoint_t iod_proc_nr;
cp_grant_id_t iod_grant;
vir_bytes iod_iovec_offset;
} iovec_dat_s_t;
/*
* Copy the I/O vector table.
*/
- if ((r = sys_safecopyfrom(e->tx_message.DL_ENDPT,
+ if ((r = sys_safecopyfrom(e->tx_message.m_source,
e->tx_message.DL_GRANT, 0,
(vir_bytes) iovec, e->tx_message.DL_COUNT *
sizeof(iovec_s_t), D)) != OK)
E1000_DEBUG(4, ("iovec[%d] = %d\n", i, size));
/* Copy bytes to TX queue buffers. */
- if ((r = sys_safecopyfrom(e->tx_message.DL_ENDPT,
+ if ((r = sys_safecopyfrom(e->tx_message.m_source,
iovec[i].iov_grant, 0,
(vir_bytes) e->tx_buffer +
(tail * E1000_IOBUF_SIZE),
/*
* Copy the I/O vector table first.
*/
- if ((r = sys_safecopyfrom(e->rx_message.DL_ENDPT,
+ if ((r = sys_safecopyfrom(e->rx_message.m_source,
e->rx_message.DL_GRANT, 0,
(vir_bytes) iovec, e->rx_message.DL_COUNT *
sizeof(iovec_s_t), D)) != OK)
E1000_DEBUG(4, ("iovec[%d] = %lu[%d]\n",
i, iovec[i].iov_size, size));
- if ((r = sys_safecopyto(e->rx_message.DL_ENDPT, iovec[i].iov_grant,
+ if ((r = sys_safecopyto(e->rx_message.m_source, iovec[i].iov_grant,
0, (vir_bytes) e->rx_buffer + bytes +
(cur * E1000_IOBUF_SIZE),
size, D)) != OK)
stats.ets_CDheartbeat = 0;
stats.ets_OWC = 0;
- sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0, (vir_bytes)&stats,
+ sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
sizeof(stats), D);
mp->m_type = DL_STAT_REPLY;
if((r=send(mp->m_source, mp)) != OK)
msg.m_type = DEV_OPEN;
msg.DEVICE = driver[which].minor;
- msg.IO_ENDPT = self_ep;
+ msg.USER_ENDPT = self_ep;
r = sendrec(driver[which].endpt, &msg);
if (r != OK) {
msg.m_type = DEV_IOCTL_S;
msg.REQUEST = DIOCGETP;
msg.DEVICE = driver[which].minor;
- msg.IO_ENDPT = self_ep;
+ msg.USER_ENDPT = self_ep;
msg.IO_GRANT = (char *) gid;
r = sendrec(driver[which].endpt, &msg);
msg.m_type = DEV_CLOSE;
msg.DEVICE = driver[which].minor;
- msg.IO_ENDPT = self_ep;
+ msg.USER_ENDPT = self_ep;
r = sendrec(driver[which].endpt, &msg);
if (r != OK) {
/* Fill in the last bits of the message. */
mess->DEVICE = driver[which].minor;
- mess->IO_ENDPT = self_ep;
+ mess->USER_ENDPT = self_ep;
/* Send the message asynchronously. */
amp = &amsgtable[which];
/* Request message. */
static message m_in;
static endpoint_t who_e; /* m_source */
-static endpoint_t proc_e; /* IO_ENDPT */
+static endpoint_t proc_e; /* USER_ENDPT */
static cp_grant_id_t grant_id; /* IO_GRANT */
/* Data buffers. */
*/
if (flag_rw == FLT_WRITE)
- return sys_safecopyfrom(proc_e, grant_id, 0,
+ return sys_safecopyfrom(who_e, grant_id, 0,
(vir_bytes) buffer, size, D);
else
- return sys_safecopyto(proc_e, grant_id, 0,
+ return sys_safecopyto(who_e, grant_id, 0,
(vir_bytes) buffer, size, D);
}
bytes = MIN(size, iov[i].iov_size);
if (flag_rw == FLT_WRITE)
- r = sys_safecopyfrom(proc_e,
+ r = sys_safecopyfrom(who_e,
(vir_bytes) iov[i].iov_addr, 0,
(vir_bytes) bufp, bytes, D);
else
- r = sys_safecopyto(proc_e,
+ r = sys_safecopyto(who_e,
(vir_bytes) iov[i].iov_addr, 0,
(vir_bytes) bufp, bytes, D);
*/
sizepart.size = convert(get_raw_size());
- if(sys_safecopyto(proc_e, (vir_bytes) grant_id, 0,
+ if(sys_safecopyto(who_e, (vir_bytes) grant_id, 0,
(vir_bytes) &sizepart,
sizeof(struct partition), D) != OK) {
printf("Filter: DIOCGETP safecopyto failed\n");
}
who_e = m_in.m_source;
- proc_e = m_in.IO_ENDPT;
+ proc_e = m_in.USER_ENDPT;
grant_id = (cp_grant_id_t) m_in.IO_GRANT;
/* Forword the request message to the drivers. */
assert(!(fp->fxp_flags & FF_SEND_AVAIL));
assert(!(fp->fxp_flags & FF_PACK_SENT));
- iov_endpt= mp->DL_ENDPT;
+ iov_endpt= mp->m_source;
iov_grant= mp->DL_GRANT;
size= 0;
packlen= rfd_res & RFDSZ_SIZE;
- iov_endpt = mp->DL_ENDPT;
+ iov_endpt = mp->m_source;
iov_grant = mp->DL_GRANT;
size= 0;
stats.ets_CDheartbeat= 0;
stats.ets_OWC= fp->fxp_stat.sc_tx_latecol;
- r= sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0, (vir_bytes)&stats,
+ r= sys_safecopyto(mp->m_source, mp->DL_GRANT, 0, (vir_bytes)&stats,
sizeof(stats), D);
if (r != OK)
panic("fxp_getstat_s: sys_safecopyto failed: %d", r);
*
* The valid messages and their parameters are:
*
- * m_type DL_ENDPT DL_COUNT DL_MODE DL_GRANT
- * |--------------+---------+----------+---------+---------|
- * | DL_WRITEV_S | endpt | count | | grant |
- * |--------------|---------|----------|---------|---------|
- * | DL_READV_S | endpt | count | | grant |
- * |--------------|---------|----------|---------|---------|
- * | DL_CONF | | | mode | |
- * |--------------|---------|----------|---------|---------|
- * | DL_GETSTAT_S | endpt | | | grant |
- * |--------------|---------|----------|---------|---------|
- * | hardware int | | | | |
- * |--------------|---------|----------|---------|---------|
+ * m_type DL_COUNT DL_MODE DL_GRANT
+ * |--------------+----------+---------+---------|
+ * | DL_WRITEV_S | count | | grant |
+ * |--------------|----------|---------|---------|
+ * | DL_READV_S | count | | grant |
+ * |--------------|----------|---------|---------|
+ * | DL_CONF | | mode | |
+ * |--------------|----------|---------|---------|
+ * | DL_GETSTAT_S | | | grant |
+ * |--------------|----------|---------|---------|
+ * | hardware int | | | |
+ * |--------------|----------|---------|---------|
*
* The messages sent are:
*
ec->client= mp->m_source;
count = mp->DL_COUNT;
- r = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)ec->read_iovec.iod_iovec,
(count > IOVEC_NR ? IOVEC_NR : count) *
sizeof(iovec_s_t), D);
if (r != OK)
panic("do_vread_s: sys_safecopyfrom failed: %d", r);
ec->read_iovec.iod_iovec_s = count;
- ec->read_iovec.iod_proc_nr = mp->DL_ENDPT;
+ ec->read_iovec.iod_proc_nr = mp->m_source;
ec->read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
ec->read_iovec.iod_iovec_offset = 0;
}
/* convert the message to write_iovec */
- r = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)ec->write_iovec.iod_iovec,
(count > IOVEC_NR ? IOVEC_NR : count) *
sizeof(iovec_s_t), D);
if (r != OK)
panic("do_vwrite_s: sys_safecopyfrom failed: %d", r);
ec->write_iovec.iod_iovec_s = count;
- ec->write_iovec.iod_proc_nr = mp->DL_ENDPT;
+ ec->write_iovec.iod_proc_nr = mp->m_source;
ec->write_iovec.iod_grant = mp->DL_GRANT;
ec->write_iovec.iod_iovec_offset = 0;
ec= &ec_state;
- r = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes)&ec->eth_stat, sizeof(ec->eth_stat), D);
if (r != OK)
{
iovec_s_t iod_iovec[IOVEC_NR];
int iod_iovec_s;
- int iod_proc_nr;
+ endpoint_t iod_proc_nr;
cp_grant_id_t iod_grant;
vir_bytes iod_iovec_offset;
} iovec_dat_t;
found_pending = FALSE;
for (i = 0; i < NR_DEVS && !found_pending; i++) {
log = &logdevices[i];
- if(log->log_proc_nr) {
+ if(log->log_source != NONE) {
is_read_pending = TRUE;
}
if(log->log_selected) {
NULL /* HW int */
};
-extern int device_caller;
+extern int device_endpt;
/* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) );
logdevices[i].log_select_alerted =
logdevices[i].log_selected =
logdevices[i].log_select_ready_ops = 0;
- logdevices[i].log_proc_nr = 0;
+ logdevices[i].log_source = NONE;
logdevices[i].log_revive_alerted = 0;
}
LOGINC(log->log_read, overflow);
}
- if(log->log_size > 0 && log->log_proc_nr && !log->log_revive_alerted) {
+ if(log->log_size > 0 && log->log_source != NONE &&
+ !log->log_revive_alerted) {
/* Someone who was suspended on read can now
* be revived.
*/
log->log_status = subread(log, log->log_iosize,
- log->log_proc_nr, log->log_user_grant,
+ log->log_source, log->log_user_grant,
log->log_user_offset);
m.m_type = DEV_REVIVE;
printf("log`subwrite: send to %d failed: %d\n",
log->log_source, r);
}
- log->log_proc_nr = 0;
+ log->log_source = NONE;
}
if(log->log_size > 0)
case MINOR_KLOG:
if (opcode == DEV_GATHER_S) {
- if (log->log_proc_nr || count < 1) {
+ if (log->log_source != NONE || count < 1) {
/* There's already someone hanging to read, or
* no real I/O requested.
*/
if(accumulated_read)
return OK;
/* No data available; let caller block. */
- log->log_proc_nr = proc_nr;
+ log->log_source = proc_nr;
log->log_iosize = count;
log->log_user_grant = grant;
log->log_user_offset = 0;
log->log_revive_alerted = 0;
- /* Device_caller is a global in drivers library. */
- log->log_source = device_caller;
+ /* device_endpt is a global in drivers library. */
+ log->log_proc_nr = device_endpt;
#if LOG_DEBUG
printf("blocked %d (%d)\n",
log->log_source, log->log_proc_nr);
d = m_ptr->TTY_LINE;
if(d < 0 || d >= NR_DEVS)
return EINVAL;
- logdevices[d].log_proc_nr = 0;
+ logdevices[d].log_proc_nr = NONE;
logdevices[d].log_revive_alerted = 0;
return(OK);
}
return EINVAL;
}
- ops = m_ptr->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
+ ops = m_ptr->USER_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
/* Read blocks when there is no log. */
- if((m_ptr->IO_ENDPT & SEL_RD) && logdevices[d].log_size > 0) {
+ if((m_ptr->USER_ENDPT & SEL_RD) && logdevices[d].log_size > 0) {
#if LOG_DEBUG
printf("log can read; size %d\n", logdevices[d].log_size);
#endif
}
/* Write never blocks. */
- if(m_ptr->IO_ENDPT & SEL_WR) ready_ops |= SEL_WR;
+ if(m_ptr->USER_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->IO_ENDPT & SEL_NOTIFY) && ops && !ready_ops) {
+ if((m_ptr->USER_ENDPT & SEL_NOTIFY) && ops && !ready_ops) {
logdevices[d].log_selected |= ops;
logdevices[d].log_select_proc = m_ptr->m_source;
#if LOG_DEBUG
log_read, /* read mark */
log_write; /* write mark */
#if SUSPENDABLE
- int log_proc_nr,
- log_source,
- log_iosize,
+ endpoint_t log_proc_nr,
+ log_source;
+ int log_iosize,
log_revive_alerted,
- log_status; /* proc that is blocking on read */
+ log_status;
cp_grant_id_t log_user_grant;
vir_bytes log_user_offset;
#endif
if (m_prepare(m_ptr->DEVICE) == NULL) return(ENXIO);
if (m_device == MEM_DEV)
{
- r = sys_enable_iop(m_ptr->IO_ENDPT);
+ r = sys_enable_iop(m_ptr->USER_ENDPT);
if (r != OK)
{
printf("m_do_open: sys_enable_iop failed for %d: %d\n",
- m_ptr->IO_ENDPT, r);
+ m_ptr->USER_ENDPT, r);
return r;
}
}
if ((dv = m_prepare(dev)) == NULL) return(ENXIO);
/* Get request structure */
- s= sys_safecopyfrom(m_ptr->IO_ENDPT, (vir_bytes)m_ptr->IO_GRANT,
+ s= sys_safecopyfrom(m_ptr->m_source, (vir_bytes)m_ptr->IO_GRANT,
0, (vir_bytes)&ramdev_size, sizeof(ramdev_size), D);
if (s != OK)
return s;
if (i + n > count)
n = count - i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) orp->or_iovec_s,
n * sizeof(orp->or_iovec_s[0]), D);
if (cps != OK)
printf("Orinoco: invalid pkt size\n");
}
- cps = sys_safecopyfrom(mp->DL_ENDPT, iovp->iov_grant,
+ cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
0, (vir_bytes) databuf + o, s, D);
if (cps != OK)
printf("orinoco: sys_safecopyfrom failed:%d\n",
if (i + n > count)
n = count - i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes)orp->or_iovec_s,
n * sizeof(orp->or_iovec_s[0]), D);
if (cps != OK)
assert (length > size);
s = length - size;
}
- cps = sys_safecopyto(mp->DL_ENDPT, iovp->iov_grant, 0,
+ cps = sys_safecopyto(mp->m_source, iovp->iov_grant, 0,
(vir_bytes) databuf + o, s, D);
if (cps != OK)
panic("orinoco: warning: sys_safecopy failed: %d", cps);
stats = orp->or_stat;
- r = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats), D);
if(r != OK) {
panic("or_getstat_s: sys_safecopyto failed: %d", r);
* DEV_WRITE: a process wants to write on a terminal
* CANCEL: terminate a previous incomplete system call immediately
*
- * m_type TTY_LINE IO_ENDPT COUNT ADDRESS
+ * m_type TTY_LINE USER_ENDPT COUNT ADDRESS
* |-------------+---------+---------+---------+---------|
* | DEV_OPEN | | | | |
* |-------------+---------+---------+---------+---------|
* with the sys_outb() messages exchanged.
*/
-PRIVATE int caller; /* process to tell when printing done (FS) */
+PRIVATE endpoint_t caller; /* process to tell when printing done (FS) */
PRIVATE int revive_pending; /* set to true if revive is pending */
PRIVATE int revive_status; /* revive status */
PRIVATE int done_status; /* status of last output completion */
PRIVATE unsigned const char *optr; /* ptr to next char in obuf to print */
PRIVATE int orig_count; /* original byte count */
PRIVATE int port_base; /* I/O port for printer */
-PRIVATE int proc_nr; /* user requesting the printing */
+PRIVATE endpoint_t proc_nr; /* user requesting the printing */
PRIVATE cp_grant_id_t grant_nr; /* grant on which print happens */
PRIVATE int user_left; /* bytes of output left in user buf */
PRIVATE vir_bytes user_vir_d; /* offset in user buf */
break;
default:
reply(TASK_REPLY, pr_mess.m_source,
- pr_mess.IO_ENDPT, EINVAL);
+ pr_mess.USER_ENDPT, EINVAL);
}
continue;
}
do_initialize(); /* initialize */
/* fall through */
case DEV_CLOSE:
- reply(TASK_REPLY, pr_mess.m_source, pr_mess.IO_ENDPT, OK);
+ reply(TASK_REPLY, pr_mess.m_source, pr_mess.USER_ENDPT, OK);
break;
case DEV_WRITE_S: do_write(&pr_mess); break;
case DEV_STATUS: do_status(&pr_mess); break;
case CANCEL: do_cancel(&pr_mess); break;
default:
- reply(TASK_REPLY, pr_mess.m_source, pr_mess.IO_ENDPT, EINVAL);
+ reply(TASK_REPLY, pr_mess.m_source, pr_mess.USER_ENDPT,
+ EINVAL);
}
}
}
else if (m_ptr->COUNT <= 0) r = EINVAL;
/* Reply to FS, no matter what happened, possible SUSPEND caller. */
- reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
/* If no errors occurred, continue printing with SUSPENDED caller.
* First wait until the printer is online to prevent stupid errors.
*/
if (SUSPEND == r) {
caller = m_ptr->m_source;
- proc_nr = m_ptr->IO_ENDPT;
+ proc_nr = m_ptr->USER_ENDPT;
user_left = m_ptr->COUNT;
orig_count = m_ptr->COUNT;
user_vir_d = 0; /* Offset. */
* but rely on FS to handle the EINTR reply and de-suspension properly.
*/
- if (writing && m_ptr->IO_ENDPT == proc_nr) {
+ if (writing && m_ptr->USER_ENDPT == proc_nr) {
oleft = 0; /* cancel output by interrupt handler */
writing = FALSE;
revive_pending = FALSE;
}
- reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, EINTR);
+ reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, EINTR);
}
/*===========================================================================*
if ( (chunk = user_left) > sizeof obuf) chunk = sizeof obuf;
- s=sys_safecopyfrom(proc_nr, grant_nr, user_vir_d, (vir_bytes) obuf,
+ s=sys_safecopyfrom(caller, grant_nr, user_vir_d, (vir_bytes) obuf,
chunk, D);
if(s != OK) {
if (i+n > count)
n= count-i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
n * sizeof(rep->re_iovec_s[0]), D);
if (cps != OK) {
}
#if 0
- if (sys_umap(mp->DL_ENDPT, D, iovp->iov_addr, s, &dst_phys) != OK)
+ if (sys_umap(mp->m_source, D, iovp->iov_addr, s, &dst_phys) != OK)
panic("umap_local failed");
#endif
assert(o<RX_BUFSIZE);
s1= RX_BUFSIZE-o;
- cps = sys_safecopyto(mp->DL_ENDPT,
+ cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, 0,
(vir_bytes) rep->v_re_rx_buf+o, s1, D);
if (cps != OK) {
panic("rl_readv_s: sys_safecopyto failed: %d",
cps);
}
- cps = sys_safecopyto(mp->DL_ENDPT,
+ cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, s1,
(vir_bytes) rep->v_re_rx_buf, s-s1, S);
if (cps != OK) {
}
else
{
- cps = sys_safecopyto(mp->DL_ENDPT,
+ cps = sys_safecopyto(mp->m_source,
iovp->iov_grant, 0,
(vir_bytes) rep->v_re_rx_buf+o, s, D);
if (cps != OK)
n= IOVEC_NR;
if (i+n > count)
n= count-i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
n * sizeof(rep->re_iovec_s[0]), D);
if (cps != OK) {
if (size + s > ETH_MAX_PACK_SIZE_TAGGED) {
panic("invalid packet size");
}
- cps = sys_safecopyfrom(mp->DL_ENDPT, iovp->iov_grant,
+ cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
0, (vir_bytes) ret, s, D);
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
stats= rep->re_stat;
- r = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats), D);
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);
n = IOVEC_NR;
if (i + n > count)
n = count-i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
n * sizeof(rep->re_iovec_s[0]), D);
if (cps != OK) {
s = packlen-size;
}
- cps = sys_safecopyto(mp->DL_ENDPT, iovp->iov_grant, 0,
+ cps = sys_safecopyto(mp->m_source, iovp->iov_grant, 0,
(vir_bytes) rep->re_rx[index].v_ret_buf + size, s, D);
if (cps != OK)
panic("rl_readv_s: sys_safecopyto failed: %d", cps);
n = IOVEC_NR;
if (i + n > count)
n = count - i;
- cps = sys_safecopyfrom(mp->DL_ENDPT, mp->DL_GRANT, iov_offset,
+ cps = sys_safecopyfrom(mp->m_source, mp->DL_GRANT, iov_offset,
(vir_bytes) rep->re_iovec_s,
n * sizeof(rep->re_iovec_s[0]), D);
if (cps != OK) {
if (size + s > ETH_MAX_PACK_SIZE_TAGGED)
panic("invalid packet size");
- cps = sys_safecopyfrom(mp->DL_ENDPT, iovp->iov_grant,
+ cps = sys_safecopyfrom(mp->m_source, iovp->iov_grant,
0, (vir_bytes) ret, s, D);
if (cps != OK) {
panic("rl_writev_s: sys_safecopyfrom failed: %d", cps);
stats = rep->re_stat;
- r = sys_safecopyto(mp->DL_ENDPT, mp->DL_GRANT, 0,
+ r = sys_safecopyto(mp->m_source, mp->DL_GRANT, 0,
(vir_bytes) &stats, sizeof(stats), D);
if (r != OK)
panic("rl_getstat_s: sys_safecopyto failed: %d", r);
*/
do {
if (count > sizeof(buf)) count = sizeof(buf);
- if ((result = sys_safecopyfrom(tp->tty_outproc, tp->tty_outgrant,
+ if ((result = sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
tp->tty_outoffset, (vir_bytes) buf, count, D)) != OK)
break;
tp->tty_outoffset += count;
do_map= (m->REQUEST == TIOCMAPMEM); /* else unmap */
- r = sys_safecopyfrom(m->IO_ENDPT,
+ r = sys_safecopyfrom(m->m_source,
(cp_grant_id_t) m->IO_GRANT, 0,
(vir_bytes) &mapreqvm, sizeof(mapreqvm), D);
if (r != OK)
{
printf("tty: sys_safecopyfrom failed\n");
- tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT,
- r);
+ tty_reply(TASK_REPLY, m->m_source,
+ m->USER_ENDPT, r);
return;
}
/* In safe ioctl mode, the POSITION field contains
* the endpt number of the original requestor.
- * IO_ENDPT is always FS.
+ * USER_ENDPT is always FS.
*/
if(do_map) {
mapreqvm.vaddr_ret = vm_map_phys(m->POSITION,
(void *) mapreqvm.phys_offset, mapreqvm.size);
- if((r = sys_safecopyto(m->IO_ENDPT,
+ if((r = sys_safecopyto(m->m_source,
(cp_grant_id_t) m->IO_GRANT, 0,
(vir_bytes) &mapreqvm,
sizeof(mapreqvm), D)) != OK) {
r = vm_unmap_phys(m->POSITION,
mapreqvm.vaddr, mapreqvm.size);
}
- tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m->m_source, m->USER_ENDPT, r);
return;
}
}
m->m_type, m->m_source);
r= EINVAL;
}
- tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m->m_source, m->USER_ENDPT, r);
}
if (!machine.vdu_ega) return(ENOTTY);
result = ga_program(seq1); /* bring font memory into view */
- if(sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT, 0,
+ if(sys_safecopyfrom(m->m_source, (cp_grant_id_t) m->IO_GRANT, 0,
(vir_bytes) font_memory, GA_FONT_SIZE, D) != OK) {
- printf("tty: copying from %d failed\n", m->IO_ENDPT);
+ printf("tty: copying from %d failed\n", m->m_source);
return EFAULT;
}
{
/* Should record proc */
kbdp->req_size= m->COUNT;
- kbdp->req_proc= m->IO_ENDPT;
+ kbdp->req_proc= m->USER_ENDPT;
kbdp->req_grant= (cp_grant_id_t) m->IO_GRANT;
kbdp->req_addr_offset= 0;
kbdp->incaller= m->m_source;
n= KBD_BUFSZ-kbdp->offset;
if (n <= 0)
panic("do_kbd(READ): bad n: %d", n);
- r= sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT, 0,
+ r= sys_safecopyto(m->m_source, (cp_grant_id_t) m->IO_GRANT, 0,
(vir_bytes) &kbdp->buf[kbdp->offset], n, D);
if (r == OK)
{
*/
for (i= 0; i<m->COUNT; i++)
{
- r= sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t)
+ r= sys_safecopyfrom(m->m_source, (cp_grant_id_t)
m->IO_GRANT, i, (vir_bytes) &c, 1, D);
if (r != OK)
break;
r= OK;
break;
case DEV_SELECT:
- ops = m->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
- watch = (m->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
+ ops = m->USER_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
+ watch = (m->USER_ENDPT & SEL_NOTIFY) ? 1 : 0;
r= 0;
if (kbdp->avail && (ops & SEL_RD))
unsigned char b;
- r= sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t)
+ r= sys_safecopyfrom(m->m_source, (cp_grant_id_t)
m->IO_GRANT, 0, (vir_bytes) &leds,
sizeof(leds), D);
if (r != OK)
kio_bell_t bell;
clock_t ticks;
- r = sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t)
+ r = sys_safecopyfrom(m->m_source, (cp_grant_id_t)
m->IO_GRANT, 0, (vir_bytes) &bell,
sizeof(bell), D);
if (r != OK)
m->m_type, m->m_source);
r= EINVAL;
}
- tty_reply(TASK_REPLY, m->m_source, m->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m->m_source, m->USER_ENDPT, r);
}
if (n <= 0)
panic("kbd_status: bad n: %d", n);
kbdp->req_size= 0;
- r= sys_safecopyto(kbdp->req_proc, kbdp->req_grant, 0,
+ r= sys_safecopyto(kbdp->incaller, kbdp->req_grant, 0,
(vir_bytes)&kbdp->buf[kbdp->offset], n, D);
if (r == OK)
{
message *m;
{
/* Load a new keymap. */
- return sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
+ return sys_safecopyfrom(m->m_source, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes) keymap, (vir_bytes) sizeof(keymap), D);
}
}
pp->rdsendreply = TRUE;
pp->rdcaller = m_ptr->m_source;
- pp->rdproc = m_ptr->IO_ENDPT;
+ pp->rdproc = m_ptr->USER_ENDPT;
pp->rdgrant = (cp_grant_id_t) m_ptr->IO_GRANT;
pp->rdoffset = 0;
pp->rdleft = m_ptr->COUNT;
}
pp->wrsendreply = TRUE;
pp->wrcaller = m_ptr->m_source;
- pp->wrproc = m_ptr->IO_ENDPT;
+ pp->wrproc = m_ptr->USER_ENDPT;
pp->wrgrant = (cp_grant_id_t) m_ptr->IO_GRANT;
pp->wroffset = 0;
pp->wrleft = m_ptr->COUNT;
case CANCEL:
r = EINTR;
- if (m_ptr->IO_ENDPT == pp->rdproc) {
+ if (m_ptr->USER_ENDPT == pp->rdproc) {
/* Cancel a read from a PTY. */
r = pp->rdcum > 0 ? pp->rdcum : EAGAIN;
pp->rdleft = pp->rdcum = 0;
}
- if (m_ptr->IO_ENDPT == pp->wrproc) {
+ if (m_ptr->USER_ENDPT == pp->wrproc) {
/* Cancel a write to a PTY. */
r = pp->wrcum > 0 ? pp->wrcum : EAGAIN;
pp->wrleft = pp->wrcum = 0;
default:
r = EINVAL;
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
}
/*===========================================================================*
break;
/* Copy from user space to the PTY output buffer. */
- if ((s = sys_safecopyfrom(tp->tty_outproc, tp->tty_outgrant,
+ if ((s = sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
tp->tty_outoffset, (vir_bytes) pp->ohead, count, D))!=OK) {
break;
}
if (count == 0) break;
/* Copy from the output buffer to the readers address space. */
- if((s = sys_safecopyto(pp->rdproc, pp->rdgrant,
+ if((s = sys_safecopyto(pp->rdcaller, pp->rdgrant,
pp->rdoffset, (vir_bytes) pp->otail, count, D)) != OK) {
break;
}
int s;
/* Transfer one character to 'c'. */
- if ((s = sys_safecopyfrom(pp->wrproc, pp->wrgrant, pp->wroffset,
+ if ((s = sys_safecopyfrom(pp->wrcaller, pp->wrgrant, pp->wroffset,
(vir_bytes) &c, 1, D)) != OK) {
printf("pty: safecopy failed (error %d)\n", s);
break;
pty_t *pp = tp->tty_priv;
int ops, ready_ops = 0, watch;
- ops = m->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
- watch = (m->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
+ ops = m->USER_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
+ watch = (m->USER_ENDPT & SEL_NOTIFY) ? 1 : 0;
ready_ops = select_try_pty(tp, ops);
if (try) return 1;
/* Copy from user space to the RS232 output buffer. */
- sys_safecopyfrom(tp->tty_outproc, tp->tty_outgrant,
+ sys_safecopyfrom(tp->tty_outcaller, tp->tty_outgrant,
tp->tty_outoffset, (vir_bytes) rs->ohead, count, D);
/* Perform output processing on the output buffer. */
* DEV_STATUS: FS wants to know status for SELECT or REVIVE
* CANCEL: terminate a previous incomplete system call immediately
*
- * m_type TTY_LINE IO_ENDPT COUNT TTY_SPEKS IO_GRANT
+ * m_type TTY_LINE USER_ENDPT COUNT TTY_SPEKS IO_GRANT
* -----------------------------------------------------------------
* | HARD_INT | | | | | |
* |-------------+---------+---------+---------+---------+---------|
if (tty_mess.m_source != LOG_PROC_NR)
{
tty_reply(TASK_REPLY, tty_mess.m_source,
- tty_mess.IO_ENDPT, ENXIO);
+ tty_mess.USER_ENDPT, ENXIO);
}
continue;
}
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.IO_ENDPT, EINVAL);
+ tty_mess.USER_ENDPT, EINVAL);
}
}
/* 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->IO_ENDPT;
+ tp->tty_inproc = m_ptr->USER_ENDPT;
tp->tty_ingrant = (cp_grant_id_t) m_ptr->IO_GRANT;
tp->tty_inoffset = 0;
tp->tty_inleft = m_ptr->COUNT;
r = SUSPEND; /* suspend the caller */
tp->tty_inrepcode = TTY_REVIVE;
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
if (tp->tty_select_ops)
select_retry(tp);
}
/* Copy message parameters to the tty structure. */
tp->tty_outrepcode = TASK_REPLY;
tp->tty_outcaller = m_ptr->m_source;
- tp->tty_outproc = m_ptr->IO_ENDPT;
+ tp->tty_outproc = m_ptr->USER_ENDPT;
tp->tty_outgrant = (cp_grant_id_t) m_ptr->IO_GRANT;
tp->tty_outoffset = 0;
tp->tty_outleft = m_ptr->COUNT;
r = SUSPEND; /* suspend the caller */
tp->tty_outrepcode = TTY_REVIVE;
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
}
/*===========================================================================*
switch (m_ptr->TTY_REQUEST) {
case TCGETS:
/* Get the termios attributes. */
- r = sys_safecopyto(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
+ r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
(vir_bytes) &tp->tty_termios, (vir_bytes) size, D);
break;
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->IO_ENDPT;
+ tp->tty_ioproc = m_ptr->USER_ENDPT;
tp->tty_ioreq = m_ptr->REQUEST;
tp->tty_iogrant = (cp_grant_id_t) m_ptr->IO_GRANT;
r = SUSPEND;
/*FALL THROUGH*/
case TCSETS:
/* Set the termios attributes. */
- r = sys_safecopyfrom(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT,
+ r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
0, (vir_bytes) &tp->tty_termios, (vir_bytes) size, D);
if (r != OK) break;
setattr(tp);
break;
case TCFLSH:
- r = sys_safecopyfrom(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT,
+ r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
0, (vir_bytes) ¶m.i, (vir_bytes) size, D);
if (r != OK) break;
switch (param.i) {
break;
case TCFLOW:
- r = sys_safecopyfrom(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT,
+ r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
0, (vir_bytes) ¶m.i, (vir_bytes) size, D);
if (r != OK) break;
switch (param.i) {
break;
case TIOCGWINSZ:
- r = sys_safecopyto(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
+ r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT, 0,
(vir_bytes) &tp->tty_winsize, (vir_bytes) size, D);
break;
case TIOCSWINSZ:
- r = sys_safecopyfrom(m_ptr->IO_ENDPT, (cp_grant_id_t) m_ptr->IO_GRANT,
+ r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->IO_GRANT,
0, (vir_bytes) &tp->tty_winsize, (vir_bytes) size, D);
sigchar(tp, SIGWINCH, 0);
break;
}
/* Send the reply. */
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
}
/*===========================================================================*
if (m_ptr->COUNT & R_BIT) r = EACCES;
} else {
if (!(m_ptr->COUNT & O_NOCTTY)) {
- tp->tty_pgrp = m_ptr->IO_ENDPT;
+ tp->tty_pgrp = m_ptr->USER_ENDPT;
r = 1;
}
tp->tty_openct++;
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, r);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, r);
}
/*===========================================================================*
tp->tty_winsize = winsize_defaults;
setattr(tp);
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, OK);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, OK);
}
/*===========================================================================*
int r = EINTR;
/* Check the parameters carefully, to avoid cancelling twice. */
- proc_nr = m_ptr->IO_ENDPT;
+ proc_nr = m_ptr->USER_ENDPT;
mode = m_ptr->COUNT;
if ((mode & R_BIT) && tp->tty_inleft != 0 && proc_nr == tp->tty_inproc &&
tp->tty_ingrant == (cp_grant_id_t) m_ptr->IO_GRANT) {
tp->tty_inleft--;
if (++bp == bufend(buf)) {
/* Temp buffer full, copy to user space. */
- sys_safecopyto(tp->tty_inproc,
+ sys_safecopyto(tp->tty_incaller,
tp->tty_ingrant, tp->tty_inoffset,
(vir_bytes) buf,
(vir_bytes) buflen(buf), D);
if (bp > buf) {
/* Leftover characters in the buffer. */
count = bp - buf;
- sys_safecopyto(tp->tty_inproc,
+ sys_safecopyto(tp->tty_incaller,
tp->tty_ingrant, tp->tty_inoffset,
(vir_bytes) buf, (vir_bytes) count, D);
tp->tty_inoffset += count;
if (tp->tty_ioreq != TCDRAIN) {
if (tp->tty_ioreq == TCSETSF) tty_icancel(tp);
- result = sys_safecopyfrom(tp->tty_ioproc, tp->tty_iogrant, 0,
+ result = sys_safecopyfrom(tp->tty_iocaller, tp->tty_iogrant, 0,
(vir_bytes) &tp->tty_termios,
(vir_bytes) sizeof(tp->tty_termios), D);
if (result == OK) setattr(tp);
{
int ops, ready_ops = 0, watch;
- ops = m_ptr->IO_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
- watch = (m_ptr->IO_ENDPT & SEL_NOTIFY) ? 1 : 0;
+ ops = m_ptr->USER_ENDPT & (SEL_RD|SEL_WR|SEL_ERR);
+ watch = (m_ptr->USER_ENDPT & SEL_NOTIFY) ? 1 : 0;
ready_ops = select_try(tp, ops);
tp->tty_select_proc = m_ptr->m_source;
}
- tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->IO_ENDPT, ready_ops);
+ tty_reply(TASK_REPLY, m_ptr->m_source, m_ptr->USER_ENDPT, ready_ops);
return;
}
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) */
- int tty_pgrp; /* slot number of controlling process */
+ endpoint_t tty_pgrp; /* endpoint of controlling process */
char tty_openct; /* count of number of opens of this tty */
/* Information about incomplete I/O requests is stored here. */
int tty_inrepcode; /* reply code, TASK_REPLY or REVIVE */
char tty_inrevived; /* set to 1 if revive callback is pending */
- int tty_incaller; /* process that made the call (usually FS) */
- int tty_inproc; /* process that wants to read from tty */
+ endpoint_t tty_incaller; /* process that made the call (usually VFS) */
+ endpoint_t tty_inproc; /* process that wants to read from tty */
cp_grant_id_t tty_ingrant; /* grant where data is to go */
vir_bytes tty_inoffset; /* offset into grant */
int tty_inleft; /* how many chars are still needed */
int tty_incum; /* # chars input so far */
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 */
+ endpoint_t tty_outcaller; /* process that made the call (usually VFS) */
+ endpoint_t tty_outproc; /* process that wants to write to tty */
cp_grant_id_t tty_outgrant; /* grant where data comes from */
vir_bytes tty_outoffset; /* offset into grant */
int tty_outleft; /* # chars yet to be output */
int tty_outcum; /* # chars output so far */
- int tty_iocaller; /* process that made the call (usually FS) */
+ endpoint_t tty_iocaller; /* process that made the call (usually VFS) */
int tty_iorevived; /* set to 1 if revive callback is pending */
- int tty_ioproc; /* process that wants to do an ioctl */
+ endpoint_t tty_ioproc; /* process that wants to do an ioctl */
int tty_iostatus; /* result */
int tty_ioreq; /* ioctl request code */
cp_grant_id_t tty_iogrant; /* virtual address of ioctl buffer or grant */
/* select() data */
int tty_select_ops; /* which operations are interesting */
- int tty_select_proc; /* which process wants notification */
+ endpoint_t tty_select_proc; /* which process wants notification */
/* Miscellaneous. */
devfun_t tty_ioctl; /* set line speed, etc. at the device level */
* m_type: SYS_IOPENABLE
*
* The parameters for this system call are:
- * m2_i2: IO_ENDPT (process to give I/O Protection Level bits)
+ * m2_i2: IOP_ENDPT (process to give I/O Protection Level bits)
*
* Author:
* Jorrit N. Herder <jnherder@cs.vu.nl>
int proc_nr;
#if 1 /* ENABLE_USERPRIV && ENABLE_USERIOPL */
- if (m_ptr->IO_ENDPT == SELF) {
+ if (m_ptr->IOP_ENDPT == SELF) {
proc_nr = _ENDPOINT_P(caller->p_endpoint);
- } else if(!isokendpt(m_ptr->IO_ENDPT, &proc_nr))
+ } else if(!isokendpt(m_ptr->IOP_ENDPT, &proc_nr))
return(EINVAL);
enable_iop(proc_addr(proc_nr));
return(OK);
*
* The driver supports the following operations:
*
- * m_type DEVICE IO_ENDPT COUNT POSITION ADRRESS
+ * m_type DEVICE USER_ENDPT COUNT POSITION ADRRESS
* -----------------------------------------------------------------
* | DEV_OPEN | device | proc nr | | | |
* |-------------+---------+---------+---------+---------+---------|
/* open the special file ( = parameter) */
r = msg_open(mess.DEVICE);
repl_mess.m_type = DEV_REVIVE;
- repl_mess.REP_ENDPT = mess.IO_ENDPT;
+ repl_mess.REP_ENDPT = mess.USER_ENDPT;
repl_mess.REP_STATUS = r;
send(caller, &repl_mess);
/* close the special file ( = parameter) */
r = msg_close(mess.DEVICE);
repl_mess.m_type = DEV_CLOSE_REPL;
- repl_mess.REP_ENDPT = mess.IO_ENDPT;
+ repl_mess.REP_ENDPT = mess.USER_ENDPT;
repl_mess.REP_STATUS = r;
send(caller, &repl_mess);
if (r != SUSPEND)
{
repl_mess.m_type = DEV_REVIVE;
- repl_mess.REP_ENDPT = mess.IO_ENDPT;
+ repl_mess.REP_ENDPT = mess.USER_ENDPT;
repl_mess.REP_IO_GRANT =
(unsigned)mess.IO_GRANT;
repl_mess.REP_STATUS = r;
/* reopen the special file ( = parameter) */
r = msg_open(mess.DEVICE);
repl_mess.m_type = DEV_REOPEN_REPL;
- repl_mess.REP_ENDPT = mess.IO_ENDPT;
+ repl_mess.REP_ENDPT = mess.USER_ENDPT;
repl_mess.REP_STATUS = r;
send(caller, &repl_mess);
continue;
if (m_ptr->REQUEST & _IOC_IN) { /* if there is data for us, copy it */
len = io_ctl_length(m_ptr->REQUEST);
- if(sys_safecopyfrom(m_ptr->IO_ENDPT,
+ if(sys_safecopyfrom(m_ptr->m_source,
(vir_bytes)m_ptr->ADDRESS, 0,
(vir_bytes)io_ctl_buf, len, D) != OK) {
printf("%s:%d: safecopyfrom failed\n", __FILE__, __LINE__);
if (status == OK && m_ptr->REQUEST & _IOC_OUT) {
/* copy result back to user */
- if(sys_safecopyto(m_ptr->IO_ENDPT, (vir_bytes)m_ptr->ADDRESS, 0,
+ if(sys_safecopyto(m_ptr->m_source, (vir_bytes)m_ptr->ADDRESS, 0,
(vir_bytes)io_ctl_buf, len, D) != OK) {
printf("%s:%d: safecopyto failed\n", __FILE__, __LINE__);
}
if (chan == NO_CHANNEL) {
error("%s: No write channel specified!\n", drv.DriverName);
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EIO);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EIO);
return;
}
/* get pointer to sub device data */
}
if(m_ptr->COUNT != sub_dev_ptr->FragSize) {
error("Fragment size does not match user's buffer length\n");
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EINVAL);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EINVAL);
return;
}
/* if we are busy with something else than writing, return EBUSY */
if(sub_dev_ptr->DmaBusy && sub_dev_ptr->DmaMode != DEV_WRITE_S) {
error("Already busy with something else then writing\n");
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EBUSY);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EBUSY);
return;
}
sub_dev_ptr->RevivePending = TRUE;
- sub_dev_ptr->ReviveProcNr = m_ptr->IO_ENDPT;
+ sub_dev_ptr->ReviveProcNr = m_ptr->USER_ENDPT;
sub_dev_ptr->ReviveGrant = (cp_grant_id_t) m_ptr->ADDRESS;
- sub_dev_ptr->NotifyProcNr = m_ptr->m_source;
+ sub_dev_ptr->SourceProcNr = m_ptr->m_source;
data_from_user(sub_dev_ptr);
if (chan == NO_CHANNEL) {
error("%s: No read channel specified!\n", drv.DriverName);
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EIO);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EIO);
return;
}
/* get pointer to sub device data */
if (!sub_dev_ptr->DmaBusy) { /* get fragment size on first read */
if (drv_get_frag_size(&(sub_dev_ptr->FragSize), sub_dev_ptr->Nr) != OK){
error("%s: Could not retrieve fragment size!\n", drv.DriverName);
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EIO);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT,
+ EIO);
return;
}
}
if(m_ptr->COUNT != sub_dev_ptr->FragSize) {
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EINVAL);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EINVAL);
error("fragment size does not match message size\n");
return;
}
/* if we are busy with something else than reading, reply EBUSY */
if(sub_dev_ptr->DmaBusy && sub_dev_ptr->DmaMode != DEV_READ_S) {
- reply(DEV_REVIVE, m_ptr->m_source, m_ptr->IO_ENDPT, EBUSY);
+ reply(DEV_REVIVE, m_ptr->m_source, m_ptr->USER_ENDPT, EBUSY);
return;
}
sub_dev_ptr->RevivePending = TRUE;
- sub_dev_ptr->ReviveProcNr = m_ptr->IO_ENDPT;
+ sub_dev_ptr->ReviveProcNr = m_ptr->USER_ENDPT;
sub_dev_ptr->ReviveGrant = (cp_grant_id_t) m_ptr->ADDRESS;
- sub_dev_ptr->NotifyProcNr = m_ptr->m_source;
+ sub_dev_ptr->SourceProcNr = m_ptr->m_source;
if(!sub_dev_ptr->DmaBusy) { /* Dma tranfer not yet started */
get_started(sub_dev_ptr);
if (subdev->DmaLength < subdev->NrOfDmaFragments) { /* room in dma buf */
- sys_safecopyfrom(subdev->ReviveProcNr,
+ sys_safecopyfrom(subdev->SourceProcNr,
(vir_bytes)subdev->ReviveGrant, 0,
(vir_bytes)subdev->DmaPtr +
subdev->DmaFillNext * subdev->FragSize,
} else { /* room in extra buf */
- sys_safecopyfrom(subdev->ReviveProcNr,
+ sys_safecopyfrom(subdev->SourceProcNr,
(vir_bytes)subdev->ReviveGrant, 0,
(vir_bytes)subdev->ExtraBuf +
subdev->BufFillNext * subdev->FragSize,
m.REP_ENDPT = subdev->ReviveProcNr;
m.REP_IO_GRANT = subdev->ReviveGrant;
m.REP_STATUS = subdev->ReviveStatus;
- r= send(subdev->NotifyProcNr, &m); /* send the message */
+ r= send(subdev->SourceProcNr, &m); /* send the message */
if (r != OK)
{
printf("audio_fw: send to %d failed: %d\n",
- subdev->NotifyProcNr, r);
+ subdev->SourceProcNr, r);
}
/* reset variables */
if(sub_dev_ptr->BufLength != 0) { /* data in extra buffer available */
- sys_safecopyto(sub_dev_ptr->ReviveProcNr,
+ sys_safecopyto(sub_dev_ptr->SourceProcNr,
(vir_bytes)sub_dev_ptr->ReviveGrant,
0, (vir_bytes)sub_dev_ptr->ExtraBuf +
sub_dev_ptr->BufReadNext * sub_dev_ptr->FragSize,
} else { /* extra buf empty, but data in dma buf*/
sys_safecopyto(
- sub_dev_ptr->ReviveProcNr,
+ sub_dev_ptr->SourceProcNr,
(vir_bytes)sub_dev_ptr->ReviveGrant, 0,
(vir_bytes)sub_dev_ptr->DmaPtr +
sub_dev_ptr->DmaReadNext * sub_dev_ptr->FragSize,
m.REP_ENDPT = sub_dev_ptr->ReviveProcNr;
m.REP_IO_GRANT = sub_dev_ptr->ReviveGrant;
m.REP_STATUS = sub_dev_ptr->ReviveStatus;
- r= send(sub_dev_ptr->NotifyProcNr, &m); /* send the message */
+ r= send(sub_dev_ptr->SourceProcNr, &m); /* send the message */
if (r != OK)
{
printf("audio_fw: send to %d failed: %d\n",
- sub_dev_ptr->NotifyProcNr, r);
+ sub_dev_ptr->SourceProcNr, r);
}
/* reset variables */
*
* The drivers support the following operations (using message format m2):
*
- * m_type DEVICE IO_ENDPT COUNT POSITION HIGHPOS IO_GRANT
+ * m_type DEVICE USER_ENDPT COUNT POSITION HIGHPOS IO_GRANT
* ----------------------------------------------------------------------------
* | DEV_OPEN | device | proc nr | | | | |
* |---------------+--------+---------+---------+--------+--------+-----------|
FORWARD _PROTOTYPE( int is_open_dev, (int device) );
FORWARD _PROTOTYPE( void set_open_dev, (int device) );
-FORWARD _PROTOTYPE( void asyn_reply, (message *mess, int proc_nr, int r) );
+FORWARD _PROTOTYPE( void asyn_reply, (message *mess, int r) );
FORWARD _PROTOTYPE( int driver_reply, (endpoint_t caller_e, int caller_status,
message *m_ptr) );
FORWARD _PROTOTYPE( int driver_spurious_reply, (endpoint_t caller_e,
FORWARD _PROTOTYPE( int do_rdwt, (struct driver *dr, message *mp) );
FORWARD _PROTOTYPE( int do_vrdwt, (struct driver *dr, message *mp) );
-int device_caller;
+PRIVATE endpoint_t device_caller;
+PUBLIC endpoint_t device_endpt; /* used externally by log driver */
PRIVATE mq_t *queue_head = NULL;
PRIVATE int open_devs[MAX_NR_OPEN_DEVICES];
PRIVATE int next_open_devs_slot = 0;
/*===========================================================================*
* asyn_reply *
*===========================================================================*/
-PRIVATE void asyn_reply(mess, proc_nr, r)
+PRIVATE void asyn_reply(mess, r)
message *mess;
-int proc_nr;
int r;
{
/* Send a reply using the new asynchronous character device protocol.
switch (mess->m_type) {
case DEV_OPEN:
reply_mess.m_type = DEV_REVIVE;
- reply_mess.REP_ENDPT = proc_nr;
+ reply_mess.REP_ENDPT = device_endpt;
reply_mess.REP_STATUS = r;
break;
case DEV_CLOSE:
reply_mess.m_type = DEV_CLOSE_REPL;
- reply_mess.REP_ENDPT = proc_nr;
+ reply_mess.REP_ENDPT = device_endpt;
reply_mess.REP_STATUS = r;
break;
case DEV_WRITE_S:
case DEV_IOCTL_S:
if (r == SUSPEND)
- printf("driver_task: reviving %d with SUSPEND\n", proc_nr);
+ printf("driver_task: reviving %d (%d) with SUSPEND\n",
+ device_caller, device_endpt);
reply_mess.m_type = DEV_REVIVE;
- reply_mess.REP_ENDPT = proc_nr;
+ reply_mess.REP_ENDPT = device_endpt;
reply_mess.REP_IO_GRANT = (cp_grant_id_t) mess->IO_GRANT;
reply_mess.REP_STATUS = r;
break;
default:
reply_mess.m_type = TASK_REPLY;
- reply_mess.REP_ENDPT = proc_nr;
+ reply_mess.REP_ENDPT = device_endpt;
/* Status is # of bytes transferred or error code. */
reply_mess.REP_STATUS = r;
break;
int r;
m_ptr->m_type = TASK_REPLY;
- m_ptr->REP_ENDPT = m_ptr->IO_ENDPT;
+ m_ptr->REP_ENDPT = m_ptr->USER_ENDPT;
m_ptr->REP_STATUS = ERESTART;
r = driver_reply(caller_e, caller_status, m_ptr);
{
/* Main program of any device driver task. */
- int r, proc_nr, ipc_status;
+ int r, ipc_status;
message mess;
driver_running = TRUE;
message *m_ptr; /* Pointer to message to handle */
int ipc_status;
{
- int r, proc_nr;
+ int r;
device_caller = m_ptr->m_source;
- proc_nr = m_ptr->IO_ENDPT;
+ device_endpt = m_ptr->USER_ENDPT;
if (is_ipc_notify(ipc_status)) {
switch (_ENDPOINT_P(m_ptr->m_source)) {
case HARDWARE:
switch (type) {
case DRIVER_STD:
m_ptr->m_type = TASK_REPLY;
- m_ptr->REP_ENDPT = proc_nr;
+ m_ptr->REP_ENDPT = device_endpt;
/* Status is # of bytes transferred or error code. */
m_ptr->REP_STATUS = r;
break;
case DRIVER_ASYN:
- asyn_reply(m_ptr, proc_nr, r);
+ asyn_reply(m_ptr, r);
break;
/* Transfer bytes from/to the device. */
position= make64(mp->POSITION, mp->HIGHPOS);
- r = (*dp->dr_transfer)(mp->IO_ENDPT, opcode, position, &iovec1, 1);
+ r = (*dp->dr_transfer)(mp->m_source, opcode, position, &iovec1, 1);
/* Return the number of bytes transferred or an error code. */
return(r == OK ? (mp->COUNT - iovec1.iov_size) : r);
/* Transfer bytes from/to the device. */
opcode = mp->m_type;
position= make64(mp->POSITION, mp->HIGHPOS);
- r = (*dp->dr_transfer)(mp->IO_ENDPT, opcode, position, iovec, nr_req);
+ r = (*dp->dr_transfer)(mp->m_source, opcode, position, iovec, nr_req);
/* Copy the I/O vector back to the caller. */
if (OK != sys_safecopyto(mp->m_source, (vir_bytes) mp->IO_GRANT,
if (mp->REQUEST == DIOCSETP) {
/* Copy just this one partition table entry. */
- s=sys_safecopyfrom(mp->IO_ENDPT, (vir_bytes) mp->IO_GRANT,
+ s=sys_safecopyfrom(mp->m_source, (vir_bytes) mp->IO_GRANT,
0, (vir_bytes) &entry, sizeof(entry), D);
if(s != OK)
return s;
entry.base = dv->dv_base;
entry.size = dv->dv_size;
(*dp->dr_geometry)(&entry);
- s=sys_safecopyto(mp->IO_ENDPT, (vir_bytes) mp->IO_GRANT,
+ s=sys_safecopyto(mp->m_source, (vir_bytes) mp->IO_GRANT,
0, (vir_bytes) &entry, sizeof(entry), D);
if (OK != s)
return s;
endpoint_t proc_ep; /* number of process to allow I/O */
{
message m_iop;
- m_iop.IO_ENDPT = proc_ep;
+ m_iop.IOP_ENDPT = proc_ep;
return _kernel_call(SYS_IOPENABLE, &m_iop);
}
}
/* By default, these are right. */
- m.IO_ENDPT = proc_e;
+ m.USER_ENDPT = proc_e;
m.ADDRESS = buffer;
buf_used = buffer;
/* Convert parameters to 'safe mode'. */
op_used = op;
- safe = safe_io_conversion(driver_e, &gid, &op_used, gids, &m.IO_ENDPT,
+ safe = safe_io_conversion(driver_e, &gid, &op_used, gids, &m.USER_ENDPT,
&buf_used, &vec_grants, bytes);
/* Set up rest of the message. */
dev_mess.m_type = op;
dev_mess.DEVICE = minor(dev);
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.COUNT = flags;
/* Call the task. */
int r, proc_e;
- proc_e = mess_ptr->IO_ENDPT;
+ proc_e = mess_ptr->USER_ENDPT;
r = sendrec(task_nr, mess_ptr);
if(r == OK && mess_ptr->REP_STATUS == ERESTART)
errno));
}
m.m_type= DL_WRITEV_S;
- m.DL_ENDPT= this_proc;
+ m.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
m.DL_COUNT= i;
m.DL_GRANT= eth_port->etp_osdep.etp_wr_vec_grant;
}
mess.m_type= DL_READV_S;
- mess.DL_ENDPT= this_proc;
+ mess.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
mess.DL_COUNT= i;
mess.DL_GRANT= eth_port->etp_osdep.etp_rd_vec_grant;
message mess;
mess.m_type= DL_GETSTAT_S;
- mess.DL_ENDPT= this_proc;
+ mess.DL_ENDPT_LEGACY= this_proc; /* FIXME: legacy support */
mess.DL_GRANT= eth_port->etp_osdep.etp_stat_gid;
assert(eth_port->etp_osdep.etp_state == OEPS_IDLE);
*
* Requests:
*
- * m_type DEVICE IO_ENDPT COUNT
+ * m_type DEVICE USER_ENDPT COUNT
* --------------------------------------------------
* | DEV_OPEN | minor dev | proc nr | mode |
* |-------------+-----------+-----------+----------+
* | DEV_CLOSE | minor dev | proc nr | |
* |-------------+-----------+-----------+----------+
*
- * m_type DEVICE IO_ENDPT COUNT IO_GRANT
+ * m_type DEVICE USER_ENDPT COUNT IO_GRANT
* ---------------------------------------------------------------
* | DEV_READ_S | minor dev | proc nr | count | grant ID |
* |-------------+-----------+-----------+-----------+-----------|
* | DEV_STATUS |
* |-------------|
*
- * m_type DEVICE IO_ENDPT COUNT
+ * m_type DEVICE USER_ENDPT COUNT
* --------------------------------------------------|
* | CANCEL | minor dev | proc nr | mode |
* |-------------+-----------+-----------+-----------|
{
if (m->mq_mess.m_type == CANCEL)
{
- result= sr_repl_queue(m->mq_mess.IO_ENDPT,
+ result= sr_repl_queue(m->mq_mess.USER_ENDPT,
(int)m->mq_mess.IO_GRANT, 0);
if (result)
int proc_nr, ref;
result=EINTR;
- proc_nr= m->IO_ENDPT;
+ proc_nr= m->USER_ENDPT;
ref= (int)m->IO_GRANT;
sr_fd= sr_getchannel(m->DEVICE);
assert (sr_fd);
ip_panic((
"request not found: from %d, type %d, MINOR= %d, PROC= %d, REF= %d",
m->m_source, m->m_type, m->DEVICE,
- m->IO_ENDPT, (int) m->IO_GRANT));
+ m->USER_ENDPT, (int) m->IO_GRANT));
return result;
}
sr_fd->srf_select_proc= m->m_source;
- m_ops= m->IO_ENDPT;
+ m_ops= m->USER_ENDPT;
i_ops= 0;
if (m_ops & SEL_RD) i_ops |= SR_SELECT_READ;
if (m_ops & SEL_WR) i_ops |= SR_SELECT_WRITE;
for(q_ptr_prv= NULL, q_ptr= *q_head_ptr; q_ptr;
q_ptr_prv= q_ptr, q_ptr= q_ptr->mq_next)
{
- if (q_ptr->mq_mess.IO_ENDPT != proc_nr)
+ if (q_ptr->mq_mess.USER_ENDPT != proc_nr)
continue;
if ((int)q_ptr->mq_mess.IO_GRANT != ref)
continue;
int result, proc, ref;
message reply, *mp;
- proc= mq->mq_mess.IO_ENDPT;
+ proc= mq->mq_mess.USER_ENDPT;
ref= (int)mq->mq_mess.IO_GRANT;
if (is_revive)
return NULL;
}
- result= cp_u2b ((*head_ptr)->mq_mess.IO_ENDPT,
+ result= cp_u2b ((*head_ptr)->mq_mess.m_source,
(int)(*head_ptr)->mq_mess.IO_GRANT, offset, &acc, count);
return result<0 ? NULL : acc;
return OK;
}
- return cp_b2u (data, (*head_ptr)->mq_mess.IO_ENDPT,
+ return cp_b2u (data, (*head_ptr)->mq_mess.m_source,
(int)(*head_ptr)->mq_mess.IO_GRANT, offset);
}
}
/* By default, these are right. */
- m.IO_ENDPT = proc_e;
+ m.USER_ENDPT = proc_e;
m.ADDRESS = buf;
buf_used = buf;
/* Convert parameters to 'safe mode'. */
op_used = op;
safe = safe_io_conversion(driver_e, &gid,
- &op_used, gids, NR_IOREQS, &m.IO_ENDPT, &buf_used,
+ &op_used, gids, NR_IOREQS, &m.USER_ENDPT, &buf_used,
&vec_grants, bytes);
/* Set up rest of the message. */
dev_mess.m_type = op;
dev_mess.DEVICE = (dev >> MINOR) & BYTE;
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.COUNT = flags;
/* Call the task. */
int r, proc_e;
- proc_e = mess_ptr->IO_ENDPT;
+ proc_e = mess_ptr->USER_ENDPT;
r = sendrec(task_nr, mess_ptr);
if(r == OK && mess_ptr->REP_STATUS == ERESTART) r = EDEADEPT;
nic->rx_iovec[0].iov_size = nic->rx_pbuf->len;
m.m_type = DL_READV_S;
- m.DL_ENDPT = lwip_ep;
+ m.DL_ENDPT_LEGACY = lwip_ep; /* FIXME: legacy support */
m.DL_COUNT = 1;
m.DL_GRANT = nic->rx_iogrant;
panic("Failed to set grant");
m.m_type = DL_WRITEV_S;
- m.DL_ENDPT = lwip_ep;
+ m.DL_ENDPT_LEGACY = lwip_ep; /* FIXME: legacy support */
m.DL_COUNT = 1;
m.DL_GRANT = nic->tx_iogrant;
size_t cp_len;
cp_len = (rem_len < p->len) ? rem_len : p->len;
- err = copy_to_user(m->IO_ENDPT, p->payload, cp_len,
+ err = copy_to_user(m->m_source, p->payload, cp_len,
(cp_grant_id_t) m->IO_GRANT,
written);
nwio_ipconf_t ipconf;
int err;
- err = copy_from_user(m->IO_ENDPT, &ipconf, sizeof(ipconf),
+ err = copy_from_user(m->m_source, &ipconf, sizeof(ipconf),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
send_reply(m, err);
ipconf.nwic_netmask = nic->netif.netmask.addr;
ipconf.nwic_mtu = nic->netif.mtu;
- err = copy_to_user(m->IO_ENDPT, &ipconf, sizeof(ipconf),
+ err = copy_to_user(m->m_source, &ipconf, sizeof(ipconf),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
send_reply(m, err);
nwio_route_t route;
int err;
- err = copy_from_user(m->IO_ENDPT, &route, sizeof(route),
+ err = copy_from_user(m->m_source, &route, sizeof(route),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
send_reply(m, err);
memset(ðstat, 0, sizeof(ethstat));
memcpy(ðstat.nwes_addr, nic->netif.hwaddr, 6);
- err = copy_to_user(m->IO_ENDPT, ðstat, sizeof(ethstat),
+ err = copy_to_user(m->m_source, ðstat, sizeof(ethstat),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
send_reply(m, err);
return;
}
- err = copy_from_user(m->IO_ENDPT, ðopt, sizeof(ethopt),
+ err = copy_from_user(m->m_source, ðopt, sizeof(ethopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
send_reply(m, err);
goto write_err;
}
- if ((ret = copy_from_user(m->IO_ENDPT, pbuf->payload, m->COUNT,
+ if ((ret = copy_from_user(m->m_source, pbuf->payload, m->COUNT,
(cp_grant_id_t) m->IO_GRANT, 0)) != OK) {
pbuf_free(pbuf);
goto write_err;
size_t cp_len;
cp_len = (rem_len < p->len) ? rem_len : p->len;
- err = copy_to_user(m->IO_ENDPT, p->payload, cp_len,
+ err = copy_to_user(m->m_source, p->payload, cp_len,
(cp_grant_id_t) m->IO_GRANT,
hdr_sz + written);
goto write_err;
}
- if ((ret = copy_from_user(m->IO_ENDPT, pbuf->payload, m->COUNT,
+ if ((ret = copy_from_user(m->m_source, pbuf->payload, m->COUNT,
(cp_grant_id_t) m->IO_GRANT, 0)) != OK) {
pbuf_free(pbuf);
goto write_err;
nwio_ipopt_t ipopt;
struct raw_pcb * pcb;
- err = copy_from_user(m->IO_ENDPT, &ipopt, sizeof(ipopt),
+ err = copy_from_user(m->m_source, &ipopt, sizeof(ipopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
return;
}
- err = copy_to_user(m->IO_ENDPT, &ipopt, sizeof(ipopt),
+ err = copy_to_user(m->m_source, &ipopt, sizeof(ipopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
for (mq = mq_tail; mq; mq = mq->prev) {
if (m->DEVICE == mq->m.DEVICE &&
- m->IO_ENDPT == mq->m.IO_ENDPT &&
+ m->USER_ENDPT == mq->m.USER_ENDPT &&
m->IO_GRANT == mq->m.IO_GRANT) {
debug_sock_print("socket %d\n", mq->m.DEVICE);
break;
{
int proc, ref;
- proc= m->IO_ENDPT;
+ proc= m->USER_ENDPT;
ref= (int)m->IO_GRANT;
m->REP_ENDPT= proc;
{
int retsel = 0, sel;
- debug_print("socket num %ld 0x%x", get_sock_num(sock), m->IO_ENDPT);
+ debug_print("socket num %ld 0x%x", get_sock_num(sock), m->USER_ENDPT);
- sel = m->IO_ENDPT;
+ sel = m->USER_ENDPT;
/* in this case any operation would block, no error */
if (sock->flags & SOCK_FLG_OP_PENDING) {
#if 0
print_tcp_payload(p->payload, p->len);
#endif
- err = copy_to_user(m->IO_ENDPT, p->payload, p->len,
+ err = copy_to_user(m->m_source, p->payload, p->len,
(cp_grant_id_t) m->IO_GRANT, written);
if (err != OK)
goto cp_error;
#if 0
print_tcp_payload(p->payload, rem_buf);
#endif
- err = copy_to_user(m->IO_ENDPT, p->payload, rem_buf,
+ err = copy_to_user(m->m_source, p->payload, rem_buf,
(cp_grant_id_t) m->IO_GRANT, written);
if (err != OK)
goto cp_error;
} else {
if (sock->flags & SOCK_FLG_CLOSED) {
printf("socket %ld already closed!!! call from %d\n",
- get_sock_num(sock), m->IO_ENDPT);
+ get_sock_num(sock), m->USER_ENDPT);
do_tcp_debug = 1;
sock_reply(sock, 0);
return;
sock_reply(sock, ENOMEM);
}
- if ((ret = copy_from_user(m->IO_ENDPT, wbuf->data, usr_buf_len,
+ if ((ret = copy_from_user(m->m_source, wbuf->data, usr_buf_len,
(cp_grant_id_t) m->IO_GRANT, 0)) != OK) {
sock_reply(sock, ret);
return;
assert(pcb);
- err = copy_from_user(m->IO_ENDPT, &tconf, sizeof(tconf),
+ err = copy_from_user(m->m_source, &tconf, sizeof(tconf),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
return;
}
- err = copy_to_user(m->IO_ENDPT, &tconf, sizeof(tconf),
+ err = copy_to_user(m->m_source, &tconf, sizeof(tconf),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
debug_tcp_print("socket num %ld", get_sock_num(listen_sock));
- if ((ret = copy_from_user(m->IO_ENDPT, &sock_num, sizeof(sock_num),
+ if ((ret = copy_from_user(m->m_source, &sock_num, sizeof(sock_num),
(cp_grant_id_t) m->IO_GRANT, 0)) != OK)
return EFAULT;
if (!is_valid_sock_num(sock_num))
debug_tcp_print("socket num %ld", get_sock_num(sock));
- err = copy_from_user(m->IO_ENDPT, &backlog, sizeof(backlog),
+ err = copy_from_user(m->m_source, &backlog, sizeof(backlog),
(cp_grant_id_t) m->IO_GRANT, 0);
new_pcb = tcp_listen_with_backlog((struct tcp_pcb *) sock->pcb,
sock_num = get_sock_num(sock);
memcpy(&cookie, &sock_num, sizeof(sock_num));
- if (copy_to_user(m->IO_ENDPT, &cookie, sizeof(sock),
+ if (copy_to_user(m->m_source, &cookie, sizeof(sock),
(cp_grant_id_t) m->IO_GRANT, 0) == OK)
sock_reply(sock, OK);
else
/* FIXME : not used by the userspace library */
tcpopt.nwto_flags = 0;
- err = copy_to_user(m->IO_ENDPT, &tcpopt, sizeof(tcpopt),
+ err = copy_to_user(m->m_source, &tcpopt, sizeof(tcpopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
assert(pcb);
- err = copy_from_user(m->IO_ENDPT, &tcpopt, sizeof(tcpopt),
+ err = copy_from_user(m->m_source, &tcpopt, sizeof(tcpopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
{
int retsel = 0, sel;
- sel = m->IO_ENDPT;
+ sel = m->USER_ENDPT;
debug_tcp_print("socket num %ld 0x%x", get_sock_num(sock), sel);
/* in this case any operation would block, no error */
hdr.uih_data_len = 0;
hdr.uih_ip_opt_len = 0;
- err = copy_to_user(m->IO_ENDPT,
+ err = copy_to_user(m->m_source,
&hdr, sizeof(hdr),
(cp_grant_id_t) m->IO_GRANT,
0);
size_t cp_len;
cp_len = (rem_len < p->len) ? rem_len : p->len;
- err = copy_to_user(m->IO_ENDPT, p->payload, cp_len,
+ err = copy_to_user(m->m_source, p->payload, cp_len,
(cp_grant_id_t) m->IO_GRANT,
hdr_sz + written);
goto write_err;
}
- if ((ret = copy_from_user(m->IO_ENDPT, pbuf->payload, m->COUNT,
+ if ((ret = copy_from_user(m->m_source, pbuf->payload, m->COUNT,
(cp_grant_id_t) m->IO_GRANT, 0)) != OK) {
pbuf_free(pbuf);
goto write_err;
assert(pcb);
- err = copy_from_user(m->IO_ENDPT, &udpopt, sizeof(udpopt),
+ err = copy_from_user(m->m_source, &udpopt, sizeof(udpopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
return;
}
- err = copy_to_user(m->IO_ENDPT, &udpopt, sizeof(udpopt),
+ err = copy_to_user(m->m_source, &udpopt, sizeof(udpopt),
(cp_grant_id_t) m->IO_GRANT, 0);
if (err != OK)
}
/* By default, these are right. */
- m.IO_ENDPT = proc_e;
+ m.USER_ENDPT = proc_e;
m.ADDRESS = buffer;
buf_used = buffer;
/* Convert parameters to 'safe mode'. */
op_used = op;
- safe = safe_io_conversion(driver_e, &gid, &op_used, gids, &m.IO_ENDPT,
+ safe = safe_io_conversion(driver_e, &gid, &op_used, gids, &m.USER_ENDPT,
&buf_used, &vec_grants, bytes);
/* Set up rest of the message. */
dev_mess.m_type = op;
dev_mess.DEVICE = minor(dev);
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.COUNT = flags;
/* Call the task. */
int r, proc_e;
- proc_e = mess_ptr->IO_ENDPT;
+ proc_e = mess_ptr->USER_ENDPT;
r = sendrec(task_nr, mess_ptr);
if(r == OK && mess_ptr->REP_STATUS == ERESTART)
static int call_count = 0;
printf("(uds) [%d] uds_open() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x\n", dev_m_in->IO_ENDPT);
+ printf("Endpoint: 0x%x\n", dev_m_in->USER_ENDPT);
#endif
/*
if (minor == -1) {
/* descriptor table full */
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, ENFILE);
return ENFILE;
}
uds_fd_table[minor].syscall_done = 0;
/* set the socket owner */
- uds_fd_table[minor].owner = dev_m_in->IO_ENDPT;
- uds_fd_table[minor].endpoint = dev_m_in->IO_ENDPT;
+ uds_fd_table[minor].owner = dev_m_in->USER_ENDPT;
+ uds_fd_table[minor].endpoint = dev_m_in->USER_ENDPT;
/* setup select(2) framework */
uds_fd_table[minor].selecting = 0;
memset(&(uds_fd_table[minor]), '\0', sizeof(uds_fd_t));
/* likely error: invalid endpoint / proc doesn't exist */
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, errno);
return errno;
}
memset(&(uds_fd_table[minor]), '\0', sizeof(uds_fd_t));
/* likely error: get_block() failed */
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, rc);
return rc;
}
/* prepare the reply */
uds_fd_table[minor].syscall_done = 1;
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, minor);
return minor;
}
static int call_count = 0;
printf("(uds) [%d] uds_close() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x\n", dev_m_in->IO_ENDPT);
+ printf("Endpoint: 0x%x\n", dev_m_in->USER_ENDPT);
#endif
minor = uds_minor(dev_m_in);
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
}
return rc;
}
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, OK);
return OK;
}
static int call_count = 0;
printf("(uds) [%d] uds_select() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x\n", dev_m_in->IO_ENDPT);
+ printf("Endpoint: 0x%x\n", dev_m_in->USER_ENDPT);
#endif
minor = uds_minor(dev_m_in);
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
/* Can't update the process endpoint here, no info. */
- uds_fd_table[minor].sel_ops_in = dev_m_in->IO_ENDPT;
+ uds_fd_table[minor].sel_ops_in = dev_m_in->USER_ENDPT;
uds_fd_table[minor].sel_ops_out = 0;
/* check if there is data available to read */
uds_fd_table[minor].syscall_done = 1;
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT,
uds_fd_table[minor].sel_ops_out);
static int call_count = 0;
printf("(uds) [%d] uds_read() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->IO_ENDPT,
+ printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->USER_ENDPT,
dev_m_in->POSITION);
#endif
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
uds_fd_table[minor].syscall_done = 0;
/* Update the process endpoint. */
- uds_fd_table[minor].endpoint = dev_m_in->IO_ENDPT;
+ uds_fd_table[minor].endpoint = dev_m_in->USER_ENDPT;
/* setup select(2) framework */
uds_fd_table[minor].selecting = 0;
static int call_count = 0;
printf("(uds) [%d] uds_write() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->IO_ENDPT,
+ printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->USER_ENDPT,
dev_m_in->POSITION);
#endif
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
uds_fd_table[minor].syscall_done = 0;
/* Update the process endpoint. */
- uds_fd_table[minor].endpoint = dev_m_in->IO_ENDPT;
+ uds_fd_table[minor].endpoint = dev_m_in->USER_ENDPT;
/* setup select(2) framework */
uds_fd_table[minor].selecting = 0;
static int call_count = 0;
printf("(uds) [%d] uds_ioctl() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->IO_ENDPT,
+ printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->USER_ENDPT,
dev_m_in->POSITION);
#endif
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
if (rc != SUSPEND)
uds_fd_table[minor].syscall_done = 1;
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, rc);
return rc;
static int call_count = 0;
printf("(uds) [%d] uds_status() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->IO_ENDPT, dev_m_in->POSITION);
+ printf("Endpoint: 0x%x | Position 0x%x\n", dev_m_in->USER_ENDPT, dev_m_in->POSITION);
#endif
for (i = 0; i < NR_FDS; i++) {
static int call_count = 0;
printf("(uds) [%d] uds_cancel() call_count=%d\n", uds_minor(dev_m_in),
++call_count);
- printf("Endpoint: 0x%x\n", dev_m_in->IO_ENDPT);
+ printf("Endpoint: 0x%x\n", dev_m_in->USER_ENDPT);
#endif
minor = uds_minor(dev_m_in);
/* attempted to close a socket that hasn't been opened --
* something is very wrong :(
*/
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINVAL);
return EINVAL;
}
/* Update the process endpoint. */
- uds_fd_table[minor].endpoint = dev_m_in->IO_ENDPT;
+ uds_fd_table[minor].endpoint = dev_m_in->USER_ENDPT;
/* setup select(2) framework */
uds_fd_table[minor].selecting = 0;
}
- uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->IO_ENDPT,
+ uds_set_reply(dev_m_out, TASK_REPLY, dev_m_in->USER_ENDPT,
(cp_grant_id_t) dev_m_in->IO_GRANT, EINTR);
return EINTR;
memset(&vfs_m, '\0', sizeof(message));
vfs_m.m_type = PFS_REQ_CHECK_PERMS;
- vfs_m.IO_ENDPT = uds_fd_table[minor].owner;
+ vfs_m.USER_ENDPT = uds_fd_table[minor].owner;
vfs_m.IO_GRANT = (char *) grant_id;
vfs_m.COUNT = UNIX_PATH_MAX;
memset(&vfs_m, '\0', sizeof(message));
vfs_m.m_type = PFS_REQ_VERIFY_FD;
- vfs_m.IO_ENDPT = ep;
+ vfs_m.USER_ENDPT = ep;
vfs_m.COUNT = fd;
rc = sendrec(VFS_PROC_NR, &vfs_m);
memset(&vfs_m, '\0', sizeof(message));
vfs_m.m_type = PFS_REQ_COPY_FILP;
- vfs_m.IO_ENDPT = to_ep;
+ vfs_m.USER_ENDPT = to_ep;
vfs_m.ADDRESS = cfilp;
rc = sendrec(VFS_PROC_NR, &vfs_m);
memset(&vfs_m, '\0', sizeof(message));
vfs_m.m_type = PFS_REQ_CANCEL_FD;
- vfs_m.IO_ENDPT = ep;
+ vfs_m.USER_ENDPT = ep;
vfs_m.COUNT = fd;
rc = sendrec(VFS_PROC_NR, &vfs_m);
}
/* By default, these are right. */
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.ADDRESS = buf;
/* Convert DEV_* to DEV_*_S variants. */
buf_used = buf;
safe = safe_io_conversion(dp->dmap_driver, &gid, &op, gids, NR_IOREQS,
- (endpoint_t*) &dev_mess.IO_ENDPT, &buf_used,
+ (endpoint_t*) &dev_mess.USER_ENDPT, &buf_used,
&vec_grants, bytes, &pos_lo);
if(buf != buf_used)
dev_mess.HIGHPOS = pos_high;
/* This will be used if the i/o is suspended. */
- ioproc = dev_mess.IO_ENDPT;
+ ioproc = dev_mess.USER_ENDPT;
/* Call the task. */
(*dp->dmap_io)(dp->dmap_driver, &dev_mess);
if ((flags & O_NONBLOCK) && !(dp->dmap_style == STYLE_DEVA)) {
/* Not supposed to block. */
dev_mess.m_type = CANCEL;
- dev_mess.IO_ENDPT = ioproc;
+ dev_mess.USER_ENDPT = ioproc;
dev_mess.IO_GRANT = (char *) gid;
/* This R_BIT/W_BIT check taken from suspend()/unpause()
if (flags & O_NONBLOCK) {
/* Not supposed to block, send cancel message */
dev_mess.m_type = CANCEL;
- dev_mess.IO_ENDPT = ioproc;
+ dev_mess.USER_ENDPT = ioproc;
dev_mess.IO_GRANT = (char *) gid;
/* This R_BIT/W_BIT check taken from suspend()/unpause()
dev_mess.m_type = op;
dev_mess.DEVICE = (dev >> MINOR) & BYTE;
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.COUNT = flags;
if (dp->dmap_driver == NONE) {
printf("VFS: sending %d to SYSTEM\n", mess_ptr->m_type);
}
- proc_e = mess_ptr->IO_ENDPT;
+ proc_e = mess_ptr->USER_ENDPT;
for (;;) {
dev_mess.m_type = op;
dev_mess.DEVICE = minor;
- dev_mess.IO_ENDPT = proc_e;
+ dev_mess.USER_ENDPT = proc_e;
dev_mess.COUNT = flags;
*===========================================================================*/
PUBLIC int do_verify_fd(void)
{
- m_out.ADDRESS = (void *) verify_fd(m_in.IO_ENDPT, m_in.COUNT);
+ m_out.ADDRESS = (void *) verify_fd(m_in.USER_ENDPT, m_in.COUNT);
return (m_out.ADDRESS != NULL) ? OK : EINVAL;
}
*===========================================================================*/
PUBLIC int do_copy_filp(void)
{
- return copy_filp(m_in.IO_ENDPT, (filp_id_t) m_in.ADDRESS);
+ return copy_filp(m_in.USER_ENDPT, (filp_id_t) m_in.ADDRESS);
}
/*===========================================================================*
*===========================================================================*/
PUBLIC int do_cancel_fd(void)
{
- return cancel_fd(m_in.IO_ENDPT, m_in.COUNT);
+ return cancel_fd(m_in.USER_ENDPT, m_in.COUNT);
}
/*===========================================================================*
*===========================================================================*/
PUBLIC int do_check_perms(void)
{
- return check_perms(m_in.IO_ENDPT, (cp_grant_id_t) m_in.IO_GRANT, m_in.COUNT);
+ return check_perms(m_in.USER_ENDPT, (cp_grant_id_t) m_in.IO_GRANT,
+ m_in.COUNT);
}
f = rfp->fp_filp[fild];
dev = (dev_t) f->filp_vno->v_sdev; /* device hung on */
mess.TTY_LINE = (dev >> MINOR) & BYTE;
- mess.IO_ENDPT = rfp->fp_ioproc;
+ mess.USER_ENDPT = rfp->fp_ioproc;
mess.IO_GRANT = (char *) rfp->fp_grant;
/* Tell kernel R or W. Mode is from current call, not open. */