extensively.
Fix casts that cast the grand id field of some messages to the wrong
type.
return EINVAL;
if (m->REQUEST == DIOCTIMEOUT) {
- r= sys_safecopyfrom(m->IO_ENDPT, (vir_bytes) m->IO_GRANT,
+ r= sys_safecopyfrom(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&timeout, sizeof(timeout), D);
if(r != OK)
timeout_ticks = timeout;
}
- r= sys_safecopyto(m->IO_ENDPT, (vir_bytes) m->IO_GRANT,
+ r= sys_safecopyto(m->IO_ENDPT,
+ (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&prev, sizeof(prev), D);
if(r != OK)
int count;
if (w_prepare(m->DEVICE) == NIL_DEV) return ENXIO;
count = w_wn->open_ct;
- r= sys_safecopyto(m->IO_ENDPT, (vir_bytes) m->IO_GRANT,
+ r= sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t) m->IO_GRANT,
0, (vir_bytes)&count, sizeof(count), D);
if(r != OK)
int count;
if (w_prepare(m->DEVICE) == NIL_DEV) return ENXIO;
count = w_wn->open_ct;
- r=sys_safecopyto(m->IO_ENDPT, (vir_bytes)m->IO_GRANT,
+ r=sys_safecopyto(m->IO_ENDPT, (cp_grant_id_t)m->IO_GRANT,
0, (vir_bytes)&count, sizeof(count), D);
if(r != OK)
client layer
*/
dep->de_read_iovec.iod_proc_nr = mp->DL_PROC;
- de_get_userdata_s(mp->DL_PROC, (vir_bytes) mp->DL_GRANT, 0,
+ de_get_userdata_s(mp->DL_PROC, (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 = (vir_bytes) mp->DL_GRANT;
+ dep->de_read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
dep->de_read_iovec.iod_iovec_offset = 0;
size = de_calc_iov_size(&dep->de_read_iovec);
if (size < ETH_MAX_PACK_SIZE)
de_get_userdata_s(mp->DL_PROC, mp->DL_GRANT, 0,
mp->DL_COUNT, iovp->iod_iovec);
iovp->iod_iovec_s = mp->DL_COUNT;
- iovp->iod_grant = (vir_bytes) mp->DL_GRANT;
+ iovp->iod_grant = (cp_grant_id_t) mp->DL_GRANT;
iovp->iod_iovec_offset = 0;
totalsize = size = de_calc_iov_size(iovp);
if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE)
get_userdata_s(mp->DL_PROC, 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 = (vir_bytes) mp->DL_GRANT;
+ dep->de_write_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
dep->de_write_iovec.iod_iovec_offset = 0;
size = calc_iovec_size(&dep->de_write_iovec);
if (size < ETH_MIN_PACK_SIZE || size > ETH_MAX_PACK_SIZE)
panic(dep->de_name, "read already in progress", NO_NUM);
dep->de_read_iovec.iod_proc_nr = mp->DL_PROC;
- get_userdata_s(mp->DL_PROC, (vir_bytes) mp->DL_GRANT, 0,
+ get_userdata_s(mp->DL_PROC, (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 = (vir_bytes) mp->DL_GRANT;
+ dep->de_read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
dep->de_read_iovec.iod_iovec_offset = 0;
size = calc_iovec_size(&dep->de_read_iovec);
if (size < ETH_MAX_PACK_SIZE) panic(dep->de_name, SizeErrMsg, size);
"do_vread_s: sys_safecopyfrom failed: %d\n", r);
ec->read_iovec.iod_iovec_s = count;
ec->read_iovec.iod_proc_nr = mp->DL_PROC;
- ec->read_iovec.iod_grant = (vir_bytes) mp->DL_GRANT;
+ ec->read_iovec.iod_grant = (cp_grant_id_t) mp->DL_GRANT;
ec->read_iovec.iod_iovec_offset = 0;
ec->tmp_iovec = ec->read_iovec;
#include <minix/types.h>
#include <stdint.h>
-typedef int32_t cp_grant_id_t;
-
typedef struct {
int cp_flags; /* CPF_* below */
union {
#include <minix/types.h>
#endif
+#include <stdint.h>
+
/* Type definitions. */
typedef unsigned int vir_clicks; /* virtual addr/length in clicks */
typedef unsigned long phys_bytes; /* physical addr/length in bytes */
typedef unsigned int phys_clicks; /* physical addr/length in clicks */
typedef int endpoint_t; /* process identifier */
+typedef int32_t cp_grant_id_t; /* A grant ID. */
+
#if (_MINIX_CHIP == _CHIP_INTEL)
typedef long unsigned int vir_bytes; /* virtual addresses/lengths in bytes */
#endif
/* Structure for virtual copying by means of a vector with requests. */
struct vir_addr {
- int proc_nr_e;
+ endpoint_t proc_nr_e;
int segment;
vir_bytes offset;
};
} iovec_t;
typedef struct {
- int iov_grant; /* grant ID of an I/O buffer */
+ cp_grant_id_t iov_grant; /* grant ID of an I/O buffer */
vir_bytes iov_size; /* sizeof an I/O buffer */
} iovec_s_t;