mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
*** empty log message ***
This commit is contained in:
@@ -45,6 +45,7 @@ static char sccsid[] = "@(#)readdir.c 5.7 (Berkeley) 6/1/90";
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
int getdents(
|
int getdents(
|
||||||
int dd_fd,
|
int dd_fd,
|
||||||
@@ -77,7 +78,7 @@ register DIR *dirp; {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
|
dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
|
||||||
if ((int)dp & 03) /* bogus pointer check */
|
if ((intptr_t)dp & 03) /* bogus pointer check */
|
||||||
return NULL;
|
return NULL;
|
||||||
if (dp->d_reclen <= 0 ||
|
if (dp->d_reclen <= 0 ||
|
||||||
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)
|
dp->d_reclen > dirp->dd_len + 1 - dirp->dd_loc)
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ struct ifreq {
|
|||||||
struct sockaddr ifru_broadaddr;
|
struct sockaddr ifru_broadaddr;
|
||||||
short ifru_flags[2];
|
short ifru_flags[2];
|
||||||
int32_t ifru_metric;
|
int32_t ifru_metric;
|
||||||
int ifru_mtu;
|
int32_t ifru_mtu;
|
||||||
int ifru_phys;
|
int ifru_phys;
|
||||||
int ifru_media;
|
int ifru_media;
|
||||||
caddr_t ifru_data;
|
caddr_t ifru_data;
|
||||||
|
|||||||
@@ -426,10 +426,10 @@ vj_uncompress_tcp(bufp, len, type, comp)
|
|||||||
* header (we assume the packet we were handed has enough space to
|
* header (we assume the packet we were handed has enough space to
|
||||||
* prepend 128 bytes of header).
|
* prepend 128 bytes of header).
|
||||||
*/
|
*/
|
||||||
if ((int)cp & 3) {
|
if ((intptr_t)cp & 3) {
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
(void) ovbcopy(cp, (caddr_t)((int)cp &~ 3), len);
|
(void) ovbcopy(cp, (caddr_t)((intptr_t)cp &~ 3), len);
|
||||||
cp = (u_char *)((int)cp &~ 3);
|
cp = (u_char *)((intptr_t)cp &~ 3);
|
||||||
}
|
}
|
||||||
cp -= hlen;
|
cp -= hlen;
|
||||||
len += hlen;
|
len += hlen;
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ raw_usrreq(so, req, m, nam, control)
|
|||||||
error = EACCES;
|
error = EACCES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
error = raw_attach(so, (int)nam);
|
error = raw_attach(so, (intptr_t)nam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ in_cksum(m, len)
|
|||||||
/*
|
/*
|
||||||
* Force to even boundary.
|
* Force to even boundary.
|
||||||
*/
|
*/
|
||||||
if ((1 & (int) w) && (mlen > 0)) {
|
if ((1 & (intptr_t) w) && (mlen > 0)) {
|
||||||
REDUCE;
|
REDUCE;
|
||||||
sum <<= 8;
|
sum <<= 8;
|
||||||
s_util.c[0] = *(u_char *)w;
|
s_util.c[0] = *(u_char *)w;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ struct ip {
|
|||||||
CTASSERT(sizeof (struct ip) == 20);
|
CTASSERT(sizeof (struct ip) == 20);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IP_MAXPACKET 65535 /* maximum packet size */
|
#define IP_MAXPACKET 65535L /* maximum packet size */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions for IP type of service (ip_tos)
|
* Definitions for IP type of service (ip_tos)
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ div_usrreq(so, req, m, nam, control)
|
|||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
inp = (struct inpcb *)so->so_pcb;
|
inp = (struct inpcb *)so->so_pcb;
|
||||||
inp->inp_ip_p = (int)nam; /* XXX */
|
inp->inp_ip_p = (intptr_t)nam; /* XXX */
|
||||||
inp->inp_flags |= INP_HDRINCL;
|
inp->inp_flags |= INP_HDRINCL;
|
||||||
/* The socket is always "connected" because
|
/* The socket is always "connected" because
|
||||||
we always know "where" to send the packet */
|
we always know "where" to send the packet */
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ struct m_hdr {
|
|||||||
*/
|
*/
|
||||||
struct pkthdr {
|
struct pkthdr {
|
||||||
struct ifnet *rcvif; /* rcv interface */
|
struct ifnet *rcvif; /* rcv interface */
|
||||||
int len; /* total packet length */
|
int32_t len; /* total packet length */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ static struct xdr_ops xdrrec_ops = {
|
|||||||
* meet the needs of xdr and rpc based on tcp.
|
* meet the needs of xdr and rpc based on tcp.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LAST_FRAG ((u_int32_t)(1 << 31))
|
#define LAST_FRAG ((u_int32_t)(1L << 31))
|
||||||
|
|
||||||
typedef struct rec_strm {
|
typedef struct rec_strm {
|
||||||
caddr_t tcp_handle;
|
caddr_t tcp_handle;
|
||||||
@@ -165,7 +165,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (rstrm->out_base = rstrm->the_buffer;
|
for (rstrm->out_base = rstrm->the_buffer;
|
||||||
(u_long)rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
|
(uintptr_t)rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
|
||||||
rstrm->out_base++);
|
rstrm->out_base++);
|
||||||
rstrm->in_base = rstrm->out_base + sendsize;
|
rstrm->in_base = rstrm->out_base + sendsize;
|
||||||
/*
|
/*
|
||||||
@@ -205,7 +205,7 @@ xdrrec_getlong(xdrs, lp)
|
|||||||
|
|
||||||
/* first try the inline, fast case */
|
/* first try the inline, fast case */
|
||||||
if ((rstrm->fbtbc >= sizeof(int32_t)) &&
|
if ((rstrm->fbtbc >= sizeof(int32_t)) &&
|
||||||
(((long)rstrm->in_boundry - (long)buflp) >= sizeof(int32_t))) {
|
(((intptr_t)rstrm->in_boundry - (intptr_t)buflp) >= sizeof(int32_t))) {
|
||||||
*lp = (long)ntohl((u_int32_t)(*buflp));
|
*lp = (long)ntohl((u_int32_t)(*buflp));
|
||||||
rstrm->fbtbc -= sizeof(int32_t);
|
rstrm->fbtbc -= sizeof(int32_t);
|
||||||
rstrm->in_finger += sizeof(int32_t);
|
rstrm->in_finger += sizeof(int32_t);
|
||||||
@@ -279,8 +279,8 @@ xdrrec_putbytes(xdrs, addr, len)
|
|||||||
register long current;
|
register long current;
|
||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
current = (u_long)rstrm->out_boundry -
|
current = (intptr_t)rstrm->out_boundry -
|
||||||
(u_long)rstrm->out_finger;
|
(intptr_t)rstrm->out_finger;
|
||||||
current = (len < current) ? len : current;
|
current = (len < current) ? len : current;
|
||||||
memcpy(rstrm->out_finger, addr, current);
|
memcpy(rstrm->out_finger, addr, current);
|
||||||
rstrm->out_finger += current;
|
rstrm->out_finger += current;
|
||||||
@@ -302,7 +302,7 @@ xdrrec_getpos(xdrs)
|
|||||||
register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
|
register RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private;
|
||||||
register long pos;
|
register long pos;
|
||||||
|
|
||||||
pos = lseek((int)(long)rstrm->tcp_handle, (off_t) 0, 1);
|
pos = lseek((intptr_t)rstrm->tcp_handle, (off_t) 0, 1);
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
switch (xdrs->x_op) {
|
switch (xdrs->x_op) {
|
||||||
|
|
||||||
@@ -465,14 +465,14 @@ xdrrec_endofrecord(xdrs, sendnow)
|
|||||||
register u_long len; /* fragment length */
|
register u_long len; /* fragment length */
|
||||||
|
|
||||||
if (sendnow || rstrm->frag_sent ||
|
if (sendnow || rstrm->frag_sent ||
|
||||||
((u_long)rstrm->out_finger + sizeof(u_int32_t) >=
|
((uintptr_t)rstrm->out_finger + sizeof(u_int32_t) >=
|
||||||
(u_long)rstrm->out_boundry)) {
|
(uintptr_t)rstrm->out_boundry)) {
|
||||||
rstrm->frag_sent = FALSE;
|
rstrm->frag_sent = FALSE;
|
||||||
return (flush_out(rstrm, TRUE));
|
return (flush_out(rstrm, TRUE));
|
||||||
}
|
}
|
||||||
len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) -
|
len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->frag_header) -
|
||||||
sizeof(u_int32_t);
|
sizeof(u_int32_t);
|
||||||
*(rstrm->frag_header) = htonl((u_long)len | LAST_FRAG);
|
*(rstrm->frag_header) = htonl((u_int32_t)len | LAST_FRAG);
|
||||||
rstrm->frag_header = (u_int32_t *)rstrm->out_finger;
|
rstrm->frag_header = (u_int32_t *)rstrm->out_finger;
|
||||||
rstrm->out_finger += sizeof(u_int32_t);
|
rstrm->out_finger += sizeof(u_int32_t);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@@ -487,12 +487,12 @@ flush_out(rstrm, eor)
|
|||||||
register RECSTREAM *rstrm;
|
register RECSTREAM *rstrm;
|
||||||
bool_t eor;
|
bool_t eor;
|
||||||
{
|
{
|
||||||
register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
|
register u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0;
|
||||||
register u_int32_t len = (u_long)(rstrm->out_finger) -
|
register u_int32_t len = (uintptr_t)(rstrm->out_finger) -
|
||||||
(u_long)(rstrm->frag_header) - sizeof(u_int32_t);
|
(uintptr_t)(rstrm->frag_header) - sizeof(u_int32_t);
|
||||||
|
|
||||||
*(rstrm->frag_header) = htonl(len | eormask);
|
*(rstrm->frag_header) = htonl(len | eormask);
|
||||||
len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->out_base);
|
len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->out_base);
|
||||||
if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len)
|
if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len)
|
||||||
!= (int)len)
|
!= (int)len)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@@ -510,7 +510,7 @@ fill_input_buf(rstrm)
|
|||||||
register long len;
|
register long len;
|
||||||
|
|
||||||
where = rstrm->in_base;
|
where = rstrm->in_base;
|
||||||
i = (u_long)rstrm->in_boundry % BYTES_PER_XDR_UNIT;
|
i = (uintptr_t)rstrm->in_boundry % BYTES_PER_XDR_UNIT;
|
||||||
where += i;
|
where += i;
|
||||||
len = rstrm->in_size - i;
|
len = rstrm->in_size - i;
|
||||||
if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
|
if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
|
||||||
@@ -530,7 +530,7 @@ get_input_bytes(rstrm, addr, len)
|
|||||||
register long current;
|
register long current;
|
||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
current = (long)rstrm->in_boundry - (long)rstrm->in_finger;
|
current = (intptr_t)rstrm->in_boundry - (intptr_t)rstrm->in_finger;
|
||||||
if (current == 0) {
|
if (current == 0) {
|
||||||
if (! fill_input_buf(rstrm))
|
if (! fill_input_buf(rstrm))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
@@ -577,7 +577,7 @@ skip_input_bytes(rstrm, cnt)
|
|||||||
register long current;
|
register long current;
|
||||||
|
|
||||||
while (cnt > 0) {
|
while (cnt > 0) {
|
||||||
current = (long)rstrm->in_boundry - (long)rstrm->in_finger;
|
current = (intptr_t)rstrm->in_boundry - (intptr_t)rstrm->in_finger;
|
||||||
if (current == 0) {
|
if (current == 0) {
|
||||||
if (! fill_input_buf(rstrm))
|
if (! fill_input_buf(rstrm))
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ x_inline(xdrs, len)
|
|||||||
if (xdrs->x_op != XDR_ENCODE) {
|
if (xdrs->x_op != XDR_ENCODE) {
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
if (len < (long) xdrs->x_base) {
|
if (len < (intptr_t) xdrs->x_base) {
|
||||||
/* x_private was already allocated */
|
/* x_private was already allocated */
|
||||||
xdrs->x_handy += len;
|
xdrs->x_handy += len;
|
||||||
return ((int32_t *) xdrs->x_private);
|
return ((int32_t *) xdrs->x_private);
|
||||||
@@ -101,7 +101,7 @@ x_inline(xdrs, len)
|
|||||||
xdrs->x_base = 0;
|
xdrs->x_base = 0;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
xdrs->x_base = (caddr_t) len;
|
xdrs->x_base = (caddr_t)((intptr_t) len);
|
||||||
xdrs->x_handy += len;
|
xdrs->x_handy += len;
|
||||||
return ((int32_t *) xdrs->x_private);
|
return ((int32_t *) xdrs->x_private);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ void _TOD_Tickle(
|
|||||||
*
|
*
|
||||||
* @note This must be a macro so it can be used in "static" tables.
|
* @note This must be a macro so it can be used in "static" tables.
|
||||||
*/
|
*/
|
||||||
#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((_ms) * 1000)
|
#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000L)
|
||||||
|
|
||||||
/** @brief TOD_MICROSECONDS_TO_TICKS
|
/** @brief TOD_MICROSECONDS_TO_TICKS
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user