Merge ^/head r288100 through r288125.
This commit is contained in:
parent
4ddf2ffb86
commit
b905d18716
@ -248,7 +248,13 @@ translate(Dwarf_Debug dbg, const char* addrstr)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dwarf_srclines(die, &lbuf, &lcount, &de) != DW_DLV_OK) {
|
||||
switch (dwarf_srclines(die, &lbuf, &lcount, &de)) {
|
||||
case DW_DLV_OK:
|
||||
break;
|
||||
case DW_DLV_NO_ENTRY:
|
||||
/* If one CU lacks debug info, just skip it. */
|
||||
continue;
|
||||
default:
|
||||
warnx("dwarf_srclines: %s", dwarf_errmsg(de));
|
||||
goto out;
|
||||
}
|
||||
|
@ -367,11 +367,8 @@ p_cdname(const u_char *cp, const u_char *msg, FILE *file) {
|
||||
length supplied). */
|
||||
|
||||
const u_char *
|
||||
p_fqnname(cp, msg, msglen, name, namelen)
|
||||
const u_char *cp, *msg;
|
||||
int msglen;
|
||||
char *name;
|
||||
int namelen;
|
||||
p_fqnname(const u_char *cp, const u_char *msg, int msglen, char *name,
|
||||
int namelen)
|
||||
{
|
||||
int n, newlen;
|
||||
|
||||
@ -758,8 +755,7 @@ static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
|
||||
|
||||
/*% takes an XeY precision/size value, returns a string representation. */
|
||||
static const char *
|
||||
precsize_ntoa(prec)
|
||||
u_int8_t prec;
|
||||
precsize_ntoa(u_int8_t prec)
|
||||
{
|
||||
char *retbuf = precsize_ntoa_retbuf;
|
||||
unsigned long val;
|
||||
@ -912,9 +908,7 @@ latlon2ul(const char **latlonstrptr, int *which) {
|
||||
* converts a zone file representation in a string to an RDATA on-the-wire
|
||||
* representation. */
|
||||
int
|
||||
loc_aton(ascii, binary)
|
||||
const char *ascii;
|
||||
u_char *binary;
|
||||
loc_aton(const char *ascii, u_char *binary)
|
||||
{
|
||||
const char *cp, *maxcp;
|
||||
u_char *bcp;
|
||||
@ -1023,9 +1017,7 @@ loc_aton(ascii, binary)
|
||||
|
||||
/*% takes an on-the-wire LOC RR and formats it in a human readable format. */
|
||||
const char *
|
||||
loc_ntoa(binary, ascii)
|
||||
const u_char *binary;
|
||||
char *ascii;
|
||||
loc_ntoa(const u_char *binary, char *ascii)
|
||||
{
|
||||
static const char *error = "?";
|
||||
static char tmpbuf[sizeof
|
||||
|
@ -718,8 +718,7 @@ res_setoptions(res_state statp, const char *options, const char *source)
|
||||
#ifdef RESOLVSORT
|
||||
/* XXX - should really support CIDR which means explicit masks always. */
|
||||
static u_int32_t
|
||||
net_mask(in) /*!< XXX - should really use system's version of this */
|
||||
struct in_addr in;
|
||||
net_mask(struct in_addr in) /*!< XXX - should really use system's version of this */
|
||||
{
|
||||
u_int32_t i = ntohl(in.s_addr);
|
||||
|
||||
|
@ -973,7 +973,7 @@ struct valuelist {
|
||||
static struct valuelist *servicelist, *protolist;
|
||||
|
||||
static void
|
||||
res_buildservicelist() {
|
||||
res_buildservicelist(void) {
|
||||
struct servent *sp;
|
||||
struct valuelist *slp;
|
||||
|
||||
|
@ -574,8 +574,7 @@ res_nsend(res_state statp,
|
||||
/* Private */
|
||||
|
||||
static int
|
||||
get_salen(sa)
|
||||
const struct sockaddr *sa;
|
||||
get_salen(const struct sockaddr *sa)
|
||||
{
|
||||
|
||||
#ifdef HAVE_SA_LEN
|
||||
@ -596,9 +595,7 @@ get_salen(sa)
|
||||
* pick appropriate nsaddr_list for use. see res_init() for initialization.
|
||||
*/
|
||||
static struct sockaddr *
|
||||
get_nsaddr(statp, n)
|
||||
res_state statp;
|
||||
size_t n;
|
||||
get_nsaddr(res_state statp, size_t n)
|
||||
{
|
||||
|
||||
if (!statp->nsaddr_list[n].sin_family && EXT(statp).ext) {
|
||||
|
@ -91,12 +91,7 @@ struct audata {
|
||||
* Returns an auth handle with the given stuff in it.
|
||||
*/
|
||||
AUTH *
|
||||
authunix_create(machname, uid, gid, len, aup_gids)
|
||||
char *machname;
|
||||
u_int uid;
|
||||
u_int gid;
|
||||
int len;
|
||||
u_int *aup_gids;
|
||||
authunix_create(char *machname, u_int uid, u_int gid, int len, u_int *aup_gids)
|
||||
{
|
||||
struct authunix_parms aup;
|
||||
char mymem[MAX_AUTH_BYTES];
|
||||
@ -182,7 +177,7 @@ authunix_create(machname, uid, gid, len, aup_gids)
|
||||
* syscalls.
|
||||
*/
|
||||
AUTH *
|
||||
authunix_create_default()
|
||||
authunix_create_default(void)
|
||||
{
|
||||
AUTH *auth;
|
||||
int ngids;
|
||||
@ -218,16 +213,13 @@ authunix_create_default()
|
||||
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
authunix_nextverf(auth)
|
||||
AUTH *auth;
|
||||
authunix_nextverf(AUTH *auth)
|
||||
{
|
||||
/* no action necessary */
|
||||
}
|
||||
|
||||
static bool_t
|
||||
authunix_marshal(auth, xdrs)
|
||||
AUTH *auth;
|
||||
XDR *xdrs;
|
||||
authunix_marshal(AUTH *auth, XDR *xdrs)
|
||||
{
|
||||
struct audata *au;
|
||||
|
||||
@ -239,9 +231,7 @@ authunix_marshal(auth, xdrs)
|
||||
}
|
||||
|
||||
static bool_t
|
||||
authunix_validate(auth, verf)
|
||||
AUTH *auth;
|
||||
struct opaque_auth *verf;
|
||||
authunix_validate(AUTH *auth, struct opaque_auth *verf)
|
||||
{
|
||||
struct audata *au;
|
||||
XDR xdrs;
|
||||
@ -317,8 +307,7 @@ authunix_refresh(AUTH *auth, void *dummy)
|
||||
}
|
||||
|
||||
static void
|
||||
authunix_destroy(auth)
|
||||
AUTH *auth;
|
||||
authunix_destroy(AUTH *auth)
|
||||
{
|
||||
struct audata *au;
|
||||
|
||||
@ -343,8 +332,7 @@ authunix_destroy(auth)
|
||||
* sets private data, au_marshed and au_mpos
|
||||
*/
|
||||
static void
|
||||
marshal_new_auth(auth)
|
||||
AUTH *auth;
|
||||
marshal_new_auth(AUTH *auth)
|
||||
{
|
||||
XDR xdr_stream;
|
||||
XDR *xdrs = &xdr_stream;
|
||||
@ -363,7 +351,7 @@ marshal_new_auth(auth)
|
||||
}
|
||||
|
||||
static struct auth_ops *
|
||||
authunix_ops()
|
||||
authunix_ops(void)
|
||||
{
|
||||
static struct auth_ops ops;
|
||||
|
||||
|
@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
|
||||
|
||||
bool_t
|
||||
xdr_authdes_cred(xdrs, cred)
|
||||
XDR *xdrs;
|
||||
struct authdes_cred *cred;
|
||||
xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred)
|
||||
{
|
||||
enum authdes_namekind *padc_namekind = &cred->adc_namekind;
|
||||
/*
|
||||
@ -78,9 +76,7 @@ xdr_authdes_cred(xdrs, cred)
|
||||
|
||||
|
||||
bool_t
|
||||
xdr_authdes_verf(xdrs, verf)
|
||||
XDR *xdrs;
|
||||
struct authdes_verf *verf;
|
||||
xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf)
|
||||
{
|
||||
/*
|
||||
* Unrolled xdr
|
||||
|
@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$");
|
||||
* XDR for unix authentication parameters.
|
||||
*/
|
||||
bool_t
|
||||
xdr_authunix_parms(xdrs, p)
|
||||
XDR *xdrs;
|
||||
struct authunix_parms *p;
|
||||
xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p)
|
||||
{
|
||||
u_int **paup_gids;
|
||||
|
||||
|
@ -61,9 +61,7 @@ __FBSDID("$FreeBSD$");
|
||||
* Bind a socket to a privileged IP port
|
||||
*/
|
||||
int
|
||||
bindresvport(sd, sin)
|
||||
int sd;
|
||||
struct sockaddr_in *sin;
|
||||
bindresvport(int sd, struct sockaddr_in *sin)
|
||||
{
|
||||
return bindresvport_sa(sd, (struct sockaddr *)sin);
|
||||
}
|
||||
@ -72,9 +70,7 @@ bindresvport(sd, sin)
|
||||
* Bind a socket to a privileged IP port
|
||||
*/
|
||||
int
|
||||
bindresvport_sa(sd, sa)
|
||||
int sd;
|
||||
struct sockaddr *sa;
|
||||
bindresvport_sa(int sd, struct sockaddr *sa)
|
||||
{
|
||||
int old, error, af;
|
||||
struct sockaddr_storage myaddr;
|
||||
|
@ -225,21 +225,26 @@ __rpc_broadenable(int af, int s, struct broadif *bip)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rpc_broadcast_exp()
|
||||
*
|
||||
* prog - program number
|
||||
* vers - version number
|
||||
* proc - procedure number
|
||||
* xargs - xdr routine for args
|
||||
* argsp - pointer to args
|
||||
* xresults - xdr routine for results
|
||||
* resultsp - pointer to results
|
||||
* eachresult - call with each result obtained
|
||||
* inittime - how long to wait initially
|
||||
* waittime - maximum time to wait
|
||||
* nettype - transport type
|
||||
*/
|
||||
enum clnt_stat
|
||||
rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
eachresult, inittime, waittime, nettype)
|
||||
rpcprog_t prog; /* program number */
|
||||
rpcvers_t vers; /* version number */
|
||||
rpcproc_t proc; /* procedure number */
|
||||
xdrproc_t xargs; /* xdr routine for args */
|
||||
caddr_t argsp; /* pointer to args */
|
||||
xdrproc_t xresults; /* xdr routine for results */
|
||||
caddr_t resultsp; /* pointer to results */
|
||||
resultproc_t eachresult; /* call with each result obtained */
|
||||
int inittime; /* how long to wait initially */
|
||||
int waittime; /* maximum time to wait */
|
||||
const char *nettype; /* transport type */
|
||||
rpc_broadcast_exp(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
|
||||
xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults, caddr_t resultsp,
|
||||
resultproc_t eachresult, int inittime, int waittime,
|
||||
const char *nettype)
|
||||
{
|
||||
enum clnt_stat stat = RPC_SUCCESS; /* Return status */
|
||||
XDR xdr_stream; /* XDR stream */
|
||||
@ -649,19 +654,23 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
return (stat);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rpc_broadcast()
|
||||
*
|
||||
* prog - program number
|
||||
* vers - version number
|
||||
* proc - procedure number
|
||||
* xargs - xdr routine for args
|
||||
* argsp - pointer to args
|
||||
* xresults - xdr routine for results
|
||||
* resultsp - pointer to results
|
||||
* eachresult - call with each result obtained
|
||||
* nettype - transport type
|
||||
*/
|
||||
enum clnt_stat
|
||||
rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
||||
eachresult, nettype)
|
||||
rpcprog_t prog; /* program number */
|
||||
rpcvers_t vers; /* version number */
|
||||
rpcproc_t proc; /* procedure number */
|
||||
xdrproc_t xargs; /* xdr routine for args */
|
||||
caddr_t argsp; /* pointer to args */
|
||||
xdrproc_t xresults; /* xdr routine for results */
|
||||
caddr_t resultsp; /* pointer to results */
|
||||
resultproc_t eachresult; /* call with each result obtained */
|
||||
const char *nettype; /* transport type */
|
||||
rpc_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc, xdrproc_t xargs,
|
||||
caddr_t argsp, xdrproc_t xresults, caddr_t resultsp,
|
||||
resultproc_t eachresult, const char *nettype)
|
||||
{
|
||||
enum clnt_stat dummy;
|
||||
|
||||
|
@ -61,7 +61,7 @@ static char *auth_errmsg(enum auth_stat);
|
||||
#define CLNT_PERROR_BUFLEN 256
|
||||
|
||||
static char *
|
||||
_buf()
|
||||
_buf(void)
|
||||
{
|
||||
|
||||
if (buf == 0)
|
||||
@ -73,9 +73,7 @@ _buf()
|
||||
* Print reply error info
|
||||
*/
|
||||
char *
|
||||
clnt_sperror(rpch, s)
|
||||
CLIENT *rpch;
|
||||
const char *s;
|
||||
clnt_sperror(CLIENT *rpch, const char *s)
|
||||
{
|
||||
struct rpc_err e;
|
||||
char *err;
|
||||
@ -180,9 +178,7 @@ clnt_sperror(rpch, s)
|
||||
}
|
||||
|
||||
void
|
||||
clnt_perror(rpch, s)
|
||||
CLIENT *rpch;
|
||||
const char *s;
|
||||
clnt_perror(CLIENT *rpch, const char *s)
|
||||
{
|
||||
|
||||
assert(rpch != NULL);
|
||||
@ -217,8 +213,7 @@ static const char *const rpc_errlist[] = {
|
||||
* This interface for use by clntrpc
|
||||
*/
|
||||
char *
|
||||
clnt_sperrno(stat)
|
||||
enum clnt_stat stat;
|
||||
clnt_sperrno(enum clnt_stat stat)
|
||||
{
|
||||
unsigned int errnum = stat;
|
||||
|
||||
@ -230,16 +225,14 @@ clnt_sperrno(stat)
|
||||
}
|
||||
|
||||
void
|
||||
clnt_perrno(num)
|
||||
enum clnt_stat num;
|
||||
clnt_perrno(enum clnt_stat num)
|
||||
{
|
||||
(void) fprintf(stderr, "%s\n", clnt_sperrno(num));
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
clnt_spcreateerror(s)
|
||||
const char *s;
|
||||
clnt_spcreateerror(const char *s)
|
||||
{
|
||||
char *str;
|
||||
size_t len, i;
|
||||
@ -291,8 +284,7 @@ clnt_spcreateerror(s)
|
||||
}
|
||||
|
||||
void
|
||||
clnt_pcreateerror(s)
|
||||
const char *s;
|
||||
clnt_pcreateerror(const char *s)
|
||||
{
|
||||
|
||||
assert(s != NULL);
|
||||
@ -319,8 +311,7 @@ static const char *const auth_errlist[] = {
|
||||
};
|
||||
|
||||
static char *
|
||||
auth_errmsg(stat)
|
||||
enum auth_stat stat;
|
||||
auth_errmsg(enum auth_stat stat)
|
||||
{
|
||||
unsigned int errnum = stat;
|
||||
|
||||
|
@ -87,9 +87,7 @@ static struct clnt_ops *clnt_raw_ops(void);
|
||||
* Create a client handle for memory based rpc.
|
||||
*/
|
||||
CLIENT *
|
||||
clnt_raw_create(prog, vers)
|
||||
rpcprog_t prog;
|
||||
rpcvers_t vers;
|
||||
clnt_raw_create(rpcprog_t prog, rpcvers_t vers)
|
||||
{
|
||||
struct clntraw_private *clp;
|
||||
struct rpc_msg call_msg;
|
||||
@ -142,14 +140,8 @@ clnt_raw_create(prog, vers)
|
||||
|
||||
/* ARGSUSED */
|
||||
static enum clnt_stat
|
||||
clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
|
||||
CLIENT *h;
|
||||
rpcproc_t proc;
|
||||
xdrproc_t xargs;
|
||||
void *argsp;
|
||||
xdrproc_t xresults;
|
||||
void *resultsp;
|
||||
struct timeval timeout;
|
||||
clnt_raw_call(CLIENT *h, rpcproc_t proc, xdrproc_t xargs, void *argsp,
|
||||
xdrproc_t xresults, void *resultsp, struct timeval timeout)
|
||||
{
|
||||
struct clntraw_private *clp = clntraw_private;
|
||||
XDR *xdrs = &clp->xdr_stream;
|
||||
@ -240,19 +232,14 @@ clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clnt_raw_geterr(cl, err)
|
||||
CLIENT *cl;
|
||||
struct rpc_err *err;
|
||||
clnt_raw_geterr(CLIENT *cl, struct rpc_err *err)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
static bool_t
|
||||
clnt_raw_freeres(cl, xdr_res, res_ptr)
|
||||
CLIENT *cl;
|
||||
xdrproc_t xdr_res;
|
||||
void *res_ptr;
|
||||
clnt_raw_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr)
|
||||
{
|
||||
struct clntraw_private *clp = clntraw_private;
|
||||
XDR *xdrs = &clp->xdr_stream;
|
||||
@ -271,30 +258,25 @@ clnt_raw_freeres(cl, xdr_res, res_ptr)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clnt_raw_abort(cl)
|
||||
CLIENT *cl;
|
||||
clnt_raw_abort(CLIENT *cl)
|
||||
{
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
clnt_raw_control(cl, ui, str)
|
||||
CLIENT *cl;
|
||||
u_int ui;
|
||||
void *str;
|
||||
clnt_raw_control(CLIENT *cl, u_int ui, void *str)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clnt_raw_destroy(cl)
|
||||
CLIENT *cl;
|
||||
clnt_raw_destroy(CLIENT *cl)
|
||||
{
|
||||
}
|
||||
|
||||
static struct clnt_ops *
|
||||
clnt_raw_ops()
|
||||
clnt_raw_ops(void)
|
||||
{
|
||||
static struct clnt_ops ops;
|
||||
|
||||
|
@ -107,17 +107,19 @@ rpc_call_key_init(void)
|
||||
* the future calls to same prog, vers, host and nettype combination.
|
||||
*
|
||||
* The total time available is 25 seconds.
|
||||
*
|
||||
* host - host name
|
||||
* prognum - program number
|
||||
* versnum - version number
|
||||
* procnum - procedure number
|
||||
* inproc, outproc - in/out XDR procedures
|
||||
* in, out - recv/send data
|
||||
* nettype - nettype
|
||||
*/
|
||||
enum clnt_stat
|
||||
rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype)
|
||||
const char *host; /* host name */
|
||||
rpcprog_t prognum; /* program number */
|
||||
rpcvers_t versnum; /* version number */
|
||||
rpcproc_t procnum; /* procedure number */
|
||||
xdrproc_t inproc, outproc; /* in/out XDR procedures */
|
||||
const char *in;
|
||||
char *out; /* recv/send data */
|
||||
const char *nettype; /* nettype */
|
||||
rpc_call(const char *host, const rpcprog_t prognum, const rpcvers_t versnum,
|
||||
const rpcproc_t procnum, const xdrproc_t inproc, const char *in,
|
||||
const xdrproc_t outproc, char *out, const char *nettype)
|
||||
{
|
||||
struct rpc_call_private *rcp = (struct rpc_call_private *) 0;
|
||||
enum clnt_stat clnt_stat;
|
||||
|
@ -153,15 +153,17 @@ static const char __no_mem_str[] = "out of memory";
|
||||
* set this something more useful.
|
||||
*
|
||||
* fd should be an open socket
|
||||
*
|
||||
* fd - open file descriptor
|
||||
* raddr - servers address
|
||||
* prog - program number
|
||||
* vers - version number
|
||||
* sendsz - buffer send size
|
||||
* recvsz - buffer recv size
|
||||
*/
|
||||
CLIENT *
|
||||
clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
|
||||
int fd; /* open file descriptor */
|
||||
const struct netbuf *raddr; /* servers address */
|
||||
const rpcprog_t prog; /* program number */
|
||||
const rpcvers_t vers; /* version number */
|
||||
u_int sendsz; /* buffer recv size */
|
||||
u_int recvsz; /* buffer send size */
|
||||
clnt_vc_create(int fd, const struct netbuf *raddr, const rpcprog_t prog,
|
||||
const rpcvers_t vers, u_int sendsz, u_int recvsz)
|
||||
{
|
||||
CLIENT *cl; /* client handle */
|
||||
struct ct_data *ct = NULL; /* client handle */
|
||||
@ -311,14 +313,8 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
|
||||
}
|
||||
|
||||
static enum clnt_stat
|
||||
clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
|
||||
CLIENT *cl;
|
||||
rpcproc_t proc;
|
||||
xdrproc_t xdr_args;
|
||||
void *args_ptr;
|
||||
xdrproc_t xdr_results;
|
||||
void *results_ptr;
|
||||
struct timeval timeout;
|
||||
clnt_vc_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xdr_args, void *args_ptr,
|
||||
xdrproc_t xdr_results, void *results_ptr, struct timeval timeout)
|
||||
{
|
||||
struct ct_data *ct = (struct ct_data *) cl->cl_private;
|
||||
XDR *xdrs = &(ct->ct_xdrs);
|
||||
@ -461,9 +457,7 @@ clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout)
|
||||
}
|
||||
|
||||
static void
|
||||
clnt_vc_geterr(cl, errp)
|
||||
CLIENT *cl;
|
||||
struct rpc_err *errp;
|
||||
clnt_vc_geterr(CLIENT *cl, struct rpc_err *errp)
|
||||
{
|
||||
struct ct_data *ct;
|
||||
|
||||
@ -475,10 +469,7 @@ clnt_vc_geterr(cl, errp)
|
||||
}
|
||||
|
||||
static bool_t
|
||||
clnt_vc_freeres(cl, xdr_res, res_ptr)
|
||||
CLIENT *cl;
|
||||
xdrproc_t xdr_res;
|
||||
void *res_ptr;
|
||||
clnt_vc_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr)
|
||||
{
|
||||
struct ct_data *ct;
|
||||
XDR *xdrs;
|
||||
@ -507,16 +498,12 @@ clnt_vc_freeres(cl, xdr_res, res_ptr)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
clnt_vc_abort(cl)
|
||||
CLIENT *cl;
|
||||
clnt_vc_abort(CLIENT *cl)
|
||||
{
|
||||
}
|
||||
|
||||
static bool_t
|
||||
clnt_vc_control(cl, request, info)
|
||||
CLIENT *cl;
|
||||
u_int request;
|
||||
void *info;
|
||||
clnt_vc_control(CLIENT *cl, u_int request, void *info)
|
||||
{
|
||||
struct ct_data *ct;
|
||||
void *infop = info;
|
||||
@ -644,8 +631,7 @@ clnt_vc_control(cl, request, info)
|
||||
|
||||
|
||||
static void
|
||||
clnt_vc_destroy(cl)
|
||||
CLIENT *cl;
|
||||
clnt_vc_destroy(CLIENT *cl)
|
||||
{
|
||||
struct ct_data *ct = (struct ct_data *) cl->cl_private;
|
||||
int ct_fd = ct->ct_fd;
|
||||
@ -684,10 +670,7 @@ clnt_vc_destroy(cl)
|
||||
* around for the rpc level.
|
||||
*/
|
||||
static int
|
||||
read_vc(ctp, buf, len)
|
||||
void *ctp;
|
||||
void *buf;
|
||||
int len;
|
||||
read_vc(void *ctp, void *buf, int len)
|
||||
{
|
||||
struct sockaddr sa;
|
||||
socklen_t sal;
|
||||
@ -741,10 +724,7 @@ read_vc(ctp, buf, len)
|
||||
}
|
||||
|
||||
static int
|
||||
write_vc(ctp, buf, len)
|
||||
void *ctp;
|
||||
void *buf;
|
||||
int len;
|
||||
write_vc(void *ctp, void *buf, int len)
|
||||
{
|
||||
struct sockaddr sa;
|
||||
socklen_t sal;
|
||||
@ -775,7 +755,7 @@ write_vc(ctp, buf, len)
|
||||
}
|
||||
|
||||
static struct clnt_ops *
|
||||
clnt_vc_ops()
|
||||
clnt_vc_ops(void)
|
||||
{
|
||||
static struct clnt_ops ops;
|
||||
sigset_t mask, newmask;
|
||||
@ -803,18 +783,14 @@ clnt_vc_ops()
|
||||
* Note this is different from time_not_ok in clnt_dg.c
|
||||
*/
|
||||
static bool_t
|
||||
time_not_ok(t)
|
||||
struct timeval *t;
|
||||
time_not_ok(struct timeval *t)
|
||||
{
|
||||
return (t->tv_sec <= -1 || t->tv_sec > 100000000 ||
|
||||
t->tv_usec <= -1 || t->tv_usec > 1000000);
|
||||
}
|
||||
|
||||
static int
|
||||
__msgread(sock, buf, cnt)
|
||||
int sock;
|
||||
void *buf;
|
||||
size_t cnt;
|
||||
__msgread(int sock, void *buf, size_t cnt)
|
||||
{
|
||||
struct iovec iov[1];
|
||||
struct msghdr msg;
|
||||
@ -839,10 +815,7 @@ __msgread(sock, buf, cnt)
|
||||
}
|
||||
|
||||
static int
|
||||
__msgwrite(sock, buf, cnt)
|
||||
int sock;
|
||||
void *buf;
|
||||
size_t cnt;
|
||||
__msgwrite(int sock, void *buf, size_t cnt)
|
||||
{
|
||||
struct iovec iov[1];
|
||||
struct msghdr msg;
|
||||
|
@ -41,7 +41,7 @@ static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
|
||||
int (*__des_crypt_LOCAL)() = 0;
|
||||
int (*__des_crypt_LOCAL)(char *, unsigned, struct desparams *) = 0;
|
||||
extern int _des_crypt_call(char *, int, struct desparams *);
|
||||
/*
|
||||
* Copy 8 bytes
|
||||
|
@ -147,7 +147,7 @@ nc_key_init(void)
|
||||
#define MAXNETCONFIGLINE 1000
|
||||
|
||||
static int *
|
||||
__nc_error()
|
||||
__nc_error(void)
|
||||
{
|
||||
static int nc_error = 0;
|
||||
int *nc_addr;
|
||||
@ -194,7 +194,7 @@ __nc_error()
|
||||
* the netconfig database is not present).
|
||||
*/
|
||||
void *
|
||||
setnetconfig()
|
||||
setnetconfig(void)
|
||||
{
|
||||
struct netconfig_vars *nc_vars;
|
||||
|
||||
@ -240,8 +240,7 @@ setnetconfig()
|
||||
*/
|
||||
|
||||
struct netconfig *
|
||||
getnetconfig(handlep)
|
||||
void *handlep;
|
||||
getnetconfig(void *handlep)
|
||||
{
|
||||
struct netconfig_vars *ncp = (struct netconfig_vars *)handlep;
|
||||
char *stringp; /* tmp string pointer */
|
||||
@ -378,8 +377,7 @@ void *handlep;
|
||||
* previously).
|
||||
*/
|
||||
int
|
||||
endnetconfig(handlep)
|
||||
void *handlep;
|
||||
endnetconfig(void *handlep)
|
||||
{
|
||||
struct netconfig_vars *nc_handlep = (struct netconfig_vars *)handlep;
|
||||
|
||||
@ -444,8 +442,7 @@ void *handlep;
|
||||
*/
|
||||
|
||||
struct netconfig *
|
||||
getnetconfigent(netid)
|
||||
const char *netid;
|
||||
getnetconfigent(const char *netid)
|
||||
{
|
||||
FILE *file; /* NETCONFIG db's file pointer */
|
||||
char *linep; /* holds current netconfig line */
|
||||
@ -536,8 +533,7 @@ getnetconfigent(netid)
|
||||
*/
|
||||
|
||||
void
|
||||
freenetconfigent(netconfigp)
|
||||
struct netconfig *netconfigp;
|
||||
freenetconfigent(struct netconfig *netconfigp)
|
||||
{
|
||||
if (netconfigp != NULL) {
|
||||
free(netconfigp->nc_netid); /* holds all netconfigp's strings */
|
||||
@ -558,12 +554,13 @@ freenetconfigent(netconfigp)
|
||||
* Note that we modify stringp (putting NULLs after tokens) and
|
||||
* we set the ncp's string field pointers to point to these tokens within
|
||||
* stringp.
|
||||
*
|
||||
* stringp - string to parse
|
||||
* ncp - where to put results
|
||||
*/
|
||||
|
||||
static int
|
||||
parse_ncp(stringp, ncp)
|
||||
char *stringp; /* string to parse */
|
||||
struct netconfig *ncp; /* where to put results */
|
||||
parse_ncp(char *stringp, struct netconfig *ncp)
|
||||
{
|
||||
char *tokenp; /* for processing tokens */
|
||||
char *lasts;
|
||||
@ -655,7 +652,7 @@ struct netconfig *ncp; /* where to put results */
|
||||
* Returns a string describing the reason for failure.
|
||||
*/
|
||||
char *
|
||||
nc_sperror()
|
||||
nc_sperror(void)
|
||||
{
|
||||
const char *message;
|
||||
|
||||
@ -686,8 +683,7 @@ nc_sperror()
|
||||
* Prints a message onto standard error describing the reason for failure.
|
||||
*/
|
||||
void
|
||||
nc_perror(s)
|
||||
const char *s;
|
||||
nc_perror(const char *s)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", s, nc_sperror());
|
||||
}
|
||||
@ -696,8 +692,7 @@ nc_perror(s)
|
||||
* Duplicates the matched netconfig buffer.
|
||||
*/
|
||||
static struct netconfig *
|
||||
dup_ncp(ncp)
|
||||
struct netconfig *ncp;
|
||||
dup_ncp(struct netconfig *ncp)
|
||||
{
|
||||
struct netconfig *p;
|
||||
char *tmp;
|
||||
|
@ -82,7 +82,7 @@ char *_get_next_token(char *, int);
|
||||
*/
|
||||
|
||||
void *
|
||||
setnetpath()
|
||||
setnetpath(void)
|
||||
{
|
||||
|
||||
struct netpath_vars *np_sessionp; /* this session's variables */
|
||||
@ -141,8 +141,7 @@ setnetpath()
|
||||
*/
|
||||
|
||||
struct netconfig *
|
||||
getnetpath(handlep)
|
||||
void *handlep;
|
||||
getnetpath(void *handlep)
|
||||
{
|
||||
struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep;
|
||||
struct netconfig *ncp = NULL; /* temp. holds a netconfig session */
|
||||
@ -197,8 +196,7 @@ getnetpath(handlep)
|
||||
* (e.g. if setnetpath() was not called previously.
|
||||
*/
|
||||
int
|
||||
endnetpath(handlep)
|
||||
void *handlep;
|
||||
endnetpath(void *handlep)
|
||||
{
|
||||
struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep;
|
||||
struct netpath_chain *chainp, *lastp;
|
||||
@ -231,12 +229,12 @@ endnetpath(handlep)
|
||||
* Returns pointer to the rest-of-the-string after the current token.
|
||||
* The token itself starts at arg, and we null terminate it. We return NULL
|
||||
* if either the arg is empty, or if this is the last token.
|
||||
*
|
||||
* npp - string
|
||||
* token - char to parse string for
|
||||
*/
|
||||
|
||||
char *
|
||||
_get_next_token(npp, token)
|
||||
char *npp; /* string */
|
||||
int token; /* char to parse string for */
|
||||
_get_next_token(char *npp, int token)
|
||||
{
|
||||
char *cp; /* char pointer */
|
||||
char *np; /* netpath pointer */
|
||||
|
@ -989,7 +989,7 @@ getrpcbynumber(int number)
|
||||
}
|
||||
|
||||
struct rpcent *
|
||||
getrpcent()
|
||||
getrpcent(void)
|
||||
{
|
||||
union key key;
|
||||
|
||||
@ -1023,7 +1023,7 @@ setrpcent(int stayopen)
|
||||
}
|
||||
|
||||
void
|
||||
endrpcent()
|
||||
endrpcent(void)
|
||||
{
|
||||
#ifdef NS_CACHING
|
||||
static const nss_cache_info cache_info = NS_MP_CACHE_INFO_INITIALIZER(
|
||||
|
@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "un-namespace.h"
|
||||
|
||||
int
|
||||
getrpcport(host, prognum, versnum, proto)
|
||||
char *host;
|
||||
int prognum, versnum, proto;
|
||||
getrpcport(char *host, int prognum, int versnum, int proto)
|
||||
{
|
||||
struct sockaddr_in addr;
|
||||
struct hostent *hp;
|
||||
|
@ -93,7 +93,7 @@ rce_key_init(void)
|
||||
}
|
||||
|
||||
struct rpc_createerr *
|
||||
__rpc_createerr()
|
||||
__rpc_createerr(void)
|
||||
{
|
||||
struct rpc_createerr *rce_addr = 0;
|
||||
|
||||
|
@ -79,8 +79,7 @@ static char *OPSYS = "unix";
|
||||
* Figure out my fully qualified network name
|
||||
*/
|
||||
int
|
||||
getnetname(name)
|
||||
char name[MAXNETNAMELEN+1];
|
||||
getnetname(char name[MAXNETNAMELEN+1])
|
||||
{
|
||||
uid_t uid;
|
||||
|
||||
@ -97,10 +96,7 @@ getnetname(name)
|
||||
* Convert unix cred to network-name
|
||||
*/
|
||||
int
|
||||
user2netname(netname, uid, domain)
|
||||
char netname[MAXNETNAMELEN + 1];
|
||||
const uid_t uid;
|
||||
const char *domain;
|
||||
user2netname(char netname[MAXNETNAMELEN + 1], const uid_t uid, const char *domain)
|
||||
{
|
||||
char *dfltdom;
|
||||
|
||||
@ -122,10 +118,7 @@ user2netname(netname, uid, domain)
|
||||
* Convert host to network-name
|
||||
*/
|
||||
int
|
||||
host2netname(netname, host, domain)
|
||||
char netname[MAXNETNAMELEN + 1];
|
||||
const char *host;
|
||||
const char *domain;
|
||||
host2netname(char netname[MAXNETNAMELEN + 1], const char *host, const char *domain)
|
||||
{
|
||||
char *dfltdom;
|
||||
char hostname[MAXHOSTNAMELEN+1];
|
||||
|
@ -68,12 +68,8 @@ static int _getgroups( char *, gid_t * );
|
||||
* Convert network-name into unix credential
|
||||
*/
|
||||
int
|
||||
netname2user(netname, uidp, gidp, gidlenp, gidlist)
|
||||
char netname[MAXNETNAMELEN + 1];
|
||||
uid_t *uidp;
|
||||
gid_t *gidp;
|
||||
int *gidlenp;
|
||||
gid_t *gidlist;
|
||||
netname2user(char netname[MAXNETNAMELEN + 1], uid_t *uidp, gid_t *gidp,
|
||||
int *gidlenp, gid_t *gidlist)
|
||||
{
|
||||
char *p;
|
||||
int gidlen;
|
||||
@ -149,9 +145,7 @@ netname2user(netname, uidp, gidp, gidlenp, gidlist)
|
||||
*/
|
||||
|
||||
static int
|
||||
_getgroups(uname, groups)
|
||||
char *uname;
|
||||
gid_t groups[NGRPS];
|
||||
_getgroups(char *uname, gid_t groups[NGRPS])
|
||||
{
|
||||
gid_t ngroups = 0;
|
||||
struct group *grp;
|
||||
@ -190,10 +184,7 @@ _getgroups(uname, groups)
|
||||
* Convert network-name to hostname
|
||||
*/
|
||||
int
|
||||
netname2host(netname, hostname, hostlen)
|
||||
char netname[MAXNETNAMELEN + 1];
|
||||
char *hostname;
|
||||
int hostlen;
|
||||
netname2host(char netname[MAXNETNAMELEN + 1], char *hostname, int hostlen)
|
||||
{
|
||||
int err;
|
||||
char valbuf[1024];
|
||||
@ -239,8 +230,7 @@ netname2host(netname, hostname, hostlen)
|
||||
* network information service.
|
||||
*/
|
||||
int
|
||||
getnetid(key, ret)
|
||||
char *key, *ret;
|
||||
getnetid(char *key, char *ret)
|
||||
{
|
||||
char buf[1024]; /* big enough */
|
||||
char *res;
|
||||
|
@ -70,8 +70,7 @@ __FBSDID("$FreeBSD$");
|
||||
* Calls the pmap service remotely to do get the maps.
|
||||
*/
|
||||
struct pmaplist *
|
||||
pmap_getmaps(address)
|
||||
struct sockaddr_in *address;
|
||||
pmap_getmaps(struct sockaddr_in *address)
|
||||
{
|
||||
struct pmaplist *head = NULL;
|
||||
int sock = -1;
|
||||
|
@ -66,11 +66,8 @@ static const struct timeval tottimeout = { 60, 0 };
|
||||
* Returns 0 if no map exists.
|
||||
*/
|
||||
u_short
|
||||
pmap_getport(address, program, version, protocol)
|
||||
struct sockaddr_in *address;
|
||||
u_long program;
|
||||
u_long version;
|
||||
u_int protocol;
|
||||
pmap_getport(struct sockaddr_in *address, u_long program, u_long version,
|
||||
u_int protocol)
|
||||
{
|
||||
u_short port = 0;
|
||||
int sock = -1;
|
||||
|
@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
|
||||
bool_t
|
||||
xdr_pmap(xdrs, regs)
|
||||
XDR *xdrs;
|
||||
struct pmap *regs;
|
||||
xdr_pmap(XDR *xdrs, struct pmap *regs)
|
||||
{
|
||||
|
||||
assert(xdrs != NULL);
|
||||
|
@ -90,9 +90,7 @@ __FBSDID("$FreeBSD$");
|
||||
* this sounds like a job for xdr_reference!
|
||||
*/
|
||||
bool_t
|
||||
xdr_pmaplist(xdrs, rp)
|
||||
XDR *xdrs;
|
||||
struct pmaplist **rp;
|
||||
xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
|
||||
{
|
||||
/*
|
||||
* more_elements is pre-computed in case the direction is
|
||||
@ -134,9 +132,7 @@ xdr_pmaplist(xdrs, rp)
|
||||
* functionality to xdr_pmaplist().
|
||||
*/
|
||||
bool_t
|
||||
xdr_pmaplist_ptr(xdrs, rp)
|
||||
XDR *xdrs;
|
||||
struct pmaplist *rp;
|
||||
xdr_pmaplist_ptr(XDR *xdrs, struct pmaplist *rp)
|
||||
{
|
||||
return xdr_pmaplist(xdrs, (struct pmaplist **)(void *)rp);
|
||||
}
|
||||
|
@ -76,14 +76,9 @@ static const struct timeval timeout = { 3, 0 };
|
||||
* programs to do a lookup and call in one step.
|
||||
*/
|
||||
enum clnt_stat
|
||||
pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
|
||||
port_ptr)
|
||||
struct sockaddr_in *addr;
|
||||
u_long prog, vers, proc;
|
||||
xdrproc_t xdrargs, xdrres;
|
||||
caddr_t argsp, resp;
|
||||
struct timeval tout;
|
||||
u_long *port_ptr;
|
||||
pmap_rmtcall(struct sockaddr_in *addr, u_long prog, u_long vers, u_long proc,
|
||||
xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
|
||||
struct timeval tout, u_long *port_ptr)
|
||||
{
|
||||
int sock = -1;
|
||||
CLIENT *client;
|
||||
@ -122,9 +117,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout,
|
||||
* written for XDR_ENCODE direction only
|
||||
*/
|
||||
bool_t
|
||||
xdr_rmtcall_args(xdrs, cap)
|
||||
XDR *xdrs;
|
||||
struct rmtcallargs *cap;
|
||||
xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
|
||||
{
|
||||
u_int lenposition, argposition, position;
|
||||
|
||||
@ -156,9 +149,7 @@ xdr_rmtcall_args(xdrs, cap)
|
||||
* written for XDR_DECODE direction only
|
||||
*/
|
||||
bool_t
|
||||
xdr_rmtcallres(xdrs, crp)
|
||||
XDR *xdrs;
|
||||
struct rmtcallres *crp;
|
||||
xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp)
|
||||
{
|
||||
caddr_t port_ptr;
|
||||
|
||||
|
@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$");
|
||||
* XDR a call message
|
||||
*/
|
||||
bool_t
|
||||
xdr_callmsg(xdrs, cmsg)
|
||||
XDR *xdrs;
|
||||
struct rpc_msg *cmsg;
|
||||
xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg)
|
||||
{
|
||||
enum msg_type *prm_direction;
|
||||
int32_t *buf;
|
||||
|
@ -111,7 +111,7 @@ static int getnettype(const char *);
|
||||
* expensive call every time.
|
||||
*/
|
||||
int
|
||||
__rpc_dtbsize()
|
||||
__rpc_dtbsize(void)
|
||||
{
|
||||
static int tbsize;
|
||||
struct rlimit rl;
|
||||
@ -132,12 +132,12 @@ __rpc_dtbsize()
|
||||
|
||||
/*
|
||||
* Find the appropriate buffer size
|
||||
*
|
||||
* size - Size requested
|
||||
*/
|
||||
u_int
|
||||
/*ARGSUSED*/
|
||||
__rpc_get_t_size(af, proto, size)
|
||||
int af, proto;
|
||||
int size; /* Size requested */
|
||||
__rpc_get_t_size(int af, int proto, int size)
|
||||
{
|
||||
int maxsize, defsize;
|
||||
|
||||
@ -164,8 +164,7 @@ __rpc_get_t_size(af, proto, size)
|
||||
* Find the appropriate address buffer size
|
||||
*/
|
||||
u_int
|
||||
__rpc_get_a_size(af)
|
||||
int af;
|
||||
__rpc_get_a_size(int af)
|
||||
{
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
@ -184,8 +183,7 @@ __rpc_get_a_size(af)
|
||||
|
||||
#if 0
|
||||
static char *
|
||||
strlocase(p)
|
||||
char *p;
|
||||
strlocase(char *p)
|
||||
{
|
||||
char *t = p;
|
||||
|
||||
@ -201,8 +199,7 @@ strlocase(p)
|
||||
* If nettype is NULL, it defaults to NETPATH.
|
||||
*/
|
||||
static int
|
||||
getnettype(nettype)
|
||||
const char *nettype;
|
||||
getnettype(const char *nettype)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -237,8 +234,7 @@ keys_init(void)
|
||||
* This should be freed by calling freenetconfigent()
|
||||
*/
|
||||
struct netconfig *
|
||||
__rpc_getconfip(nettype)
|
||||
const char *nettype;
|
||||
__rpc_getconfip(const char *nettype)
|
||||
{
|
||||
char *netid;
|
||||
char *netid_tcp = (char *) NULL;
|
||||
@ -309,8 +305,7 @@ __rpc_getconfip(nettype)
|
||||
* __rpc_getconf().
|
||||
*/
|
||||
void *
|
||||
__rpc_setconf(nettype)
|
||||
const char *nettype;
|
||||
__rpc_setconf(const char *nettype)
|
||||
{
|
||||
struct handle *handle;
|
||||
|
||||
@ -353,8 +348,7 @@ __rpc_setconf(nettype)
|
||||
* __rpc_setconf() should have been called previously.
|
||||
*/
|
||||
struct netconfig *
|
||||
__rpc_getconf(vhandle)
|
||||
void *vhandle;
|
||||
__rpc_getconf(void *vhandle)
|
||||
{
|
||||
struct handle *handle;
|
||||
struct netconfig *nconf;
|
||||
@ -430,8 +424,7 @@ __rpc_getconf(vhandle)
|
||||
}
|
||||
|
||||
void
|
||||
__rpc_endconf(vhandle)
|
||||
void * vhandle;
|
||||
__rpc_endconf(void *vhandle)
|
||||
{
|
||||
struct handle *handle;
|
||||
|
||||
@ -452,8 +445,7 @@ __rpc_endconf(vhandle)
|
||||
* Returns NULL if fails, else a non-NULL pointer.
|
||||
*/
|
||||
void *
|
||||
rpc_nullproc(clnt)
|
||||
CLIENT *clnt;
|
||||
rpc_nullproc(CLIENT *clnt)
|
||||
{
|
||||
struct timeval TIMEOUT = {25, 0};
|
||||
|
||||
@ -469,8 +461,7 @@ rpc_nullproc(clnt)
|
||||
* one succeeds in finding the netconf for the given fd.
|
||||
*/
|
||||
struct netconfig *
|
||||
__rpcgettp(fd)
|
||||
int fd;
|
||||
__rpcgettp(int fd)
|
||||
{
|
||||
const char *netid;
|
||||
struct __rpc_sockinfo si;
|
||||
|
@ -265,9 +265,7 @@ accepted(enum accept_stat acpt_stat, struct rpc_err *error)
|
||||
}
|
||||
|
||||
static void
|
||||
rejected(rjct_stat, error)
|
||||
enum reject_stat rjct_stat;
|
||||
struct rpc_err *error;
|
||||
rejected(enum reject_stat rjct_stat, struct rpc_err *error)
|
||||
{
|
||||
|
||||
assert(error != NULL);
|
||||
@ -292,9 +290,7 @@ rejected(rjct_stat, error)
|
||||
* given a reply message, fills in the error
|
||||
*/
|
||||
void
|
||||
_seterr_reply(msg, error)
|
||||
struct rpc_msg *msg;
|
||||
struct rpc_err *error;
|
||||
_seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
|
||||
{
|
||||
|
||||
assert(msg != NULL);
|
||||
|
@ -270,7 +270,7 @@ svcudp_create(int fd)
|
||||
}
|
||||
|
||||
SVCXPRT *
|
||||
svcraw_create()
|
||||
svcraw_create(void)
|
||||
{
|
||||
|
||||
return svc_raw_create();
|
||||
|
@ -194,10 +194,8 @@ delete_cache(struct netbuf *addr)
|
||||
}
|
||||
|
||||
static void
|
||||
add_cache(host, netid, taddr, uaddr)
|
||||
const char *host, *netid;
|
||||
char *uaddr;
|
||||
struct netbuf *taddr;
|
||||
add_cache(const char *host, const char *netid, struct netbuf *taddr,
|
||||
char *uaddr)
|
||||
{
|
||||
struct address_cache *ad_cache, *cptr, *prevptr;
|
||||
|
||||
@ -428,7 +426,7 @@ getclnthandle(const char *host, const struct netconfig *nconf, char **targaddr)
|
||||
* rpcbind. Returns NULL on error and free's everything.
|
||||
*/
|
||||
static CLIENT *
|
||||
local_rpcb()
|
||||
local_rpcb(void)
|
||||
{
|
||||
CLIENT *client;
|
||||
static struct netconfig *loopnconf;
|
||||
@ -1101,19 +1099,20 @@ rpcb_getmaps(const struct netconfig *nconf, const char *host)
|
||||
* which will look up a service program in the address maps, and then
|
||||
* remotely call that routine with the given parameters. This allows
|
||||
* programs to do a lookup and call in one step.
|
||||
*/
|
||||
*
|
||||
* nconf -Netconfig structure
|
||||
* host - Remote host name
|
||||
* proc - Remote proc identifiers
|
||||
* xdrargs, xdrres; XDR routines
|
||||
* argsp, resp - Argument and Result
|
||||
* tout - Timeout value for this call
|
||||
* addr_ptr - Preallocated netbuf address
|
||||
*/
|
||||
enum clnt_stat
|
||||
rpcb_rmtcall(nconf, host, prog, vers, proc, xdrargs, argsp,
|
||||
xdrres, resp, tout, addr_ptr)
|
||||
const struct netconfig *nconf; /* Netconfig structure */
|
||||
const char *host; /* Remote host name */
|
||||
rpcprog_t prog;
|
||||
rpcvers_t vers;
|
||||
rpcproc_t proc; /* Remote proc identifiers */
|
||||
xdrproc_t xdrargs, xdrres; /* XDR routines */
|
||||
caddr_t argsp, resp; /* Argument and Result */
|
||||
struct timeval tout; /* Timeout value for this call */
|
||||
const struct netbuf *addr_ptr; /* Preallocated netbuf address */
|
||||
rpcb_rmtcall(const struct netconfig *nconf, const char *host, rpcprog_t prog,
|
||||
rpcvers_t vers, rpcproc_t proc, xdrproc_t xdrargs, caddr_t argsp,
|
||||
xdrproc_t xdrres, caddr_t resp, struct timeval tout,
|
||||
const struct netbuf *addr_ptr)
|
||||
{
|
||||
CLIENT *client;
|
||||
enum clnt_stat stat;
|
||||
|
@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "un-namespace.h"
|
||||
|
||||
bool_t
|
||||
xdr_rpcb(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
RPCB *objp;
|
||||
xdr_rpcb(XDR *xdrs, RPCB *objp)
|
||||
{
|
||||
if (!xdr_u_int32_t(xdrs, &objp->r_prog)) {
|
||||
return (FALSE);
|
||||
@ -100,9 +98,7 @@ xdr_rpcb(xdrs, objp)
|
||||
*/
|
||||
|
||||
bool_t
|
||||
xdr_rpcblist_ptr(xdrs, rp)
|
||||
XDR *xdrs;
|
||||
rpcblist_ptr *rp;
|
||||
xdr_rpcblist_ptr(XDR *xdrs, rpcblist_ptr *rp)
|
||||
{
|
||||
/*
|
||||
* more_elements is pre-computed in case the direction is
|
||||
@ -154,9 +150,7 @@ xdr_rpcblist_ptr(xdrs, rp)
|
||||
* functionality to xdr_rpcblist_ptr().
|
||||
*/
|
||||
bool_t
|
||||
xdr_rpcblist(xdrs, rp)
|
||||
XDR *xdrs;
|
||||
RPCBLIST **rp;
|
||||
xdr_rpcblist(XDR *xdrs, RPCBLIST **rp)
|
||||
{
|
||||
bool_t dummy;
|
||||
|
||||
@ -166,9 +160,7 @@ xdr_rpcblist(xdrs, rp)
|
||||
|
||||
|
||||
bool_t
|
||||
xdr_rpcb_entry(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcb_entry *objp;
|
||||
xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp)
|
||||
{
|
||||
if (!xdr_string(xdrs, &objp->r_maddr, (u_int)~0)) {
|
||||
return (FALSE);
|
||||
@ -189,9 +181,7 @@ xdr_rpcb_entry(xdrs, objp)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_rpcb_entry_list_ptr(xdrs, rp)
|
||||
XDR *xdrs;
|
||||
rpcb_entry_list_ptr *rp;
|
||||
xdr_rpcb_entry_list_ptr(XDR *xdrs, rpcb_entry_list_ptr *rp)
|
||||
{
|
||||
/*
|
||||
* more_elements is pre-computed in case the direction is
|
||||
@ -244,9 +234,7 @@ xdr_rpcb_entry_list_ptr(xdrs, rp)
|
||||
* written for XDR_ENCODE direction only
|
||||
*/
|
||||
bool_t
|
||||
xdr_rpcb_rmtcallargs(xdrs, p)
|
||||
XDR *xdrs;
|
||||
struct rpcb_rmtcallargs *p;
|
||||
xdr_rpcb_rmtcallargs(XDR *xdrs, struct rpcb_rmtcallargs *p)
|
||||
{
|
||||
struct r_rpcb_rmtcallargs *objp =
|
||||
(struct r_rpcb_rmtcallargs *)(void *)p;
|
||||
@ -296,9 +284,7 @@ xdr_rpcb_rmtcallargs(xdrs, p)
|
||||
* written for XDR_DECODE direction only
|
||||
*/
|
||||
bool_t
|
||||
xdr_rpcb_rmtcallres(xdrs, p)
|
||||
XDR *xdrs;
|
||||
struct rpcb_rmtcallres *p;
|
||||
xdr_rpcb_rmtcallres(XDR *xdrs, struct rpcb_rmtcallres *p)
|
||||
{
|
||||
bool_t dummy;
|
||||
struct r_rpcb_rmtcallres *objp = (struct r_rpcb_rmtcallres *)(void *)p;
|
||||
@ -314,9 +300,7 @@ xdr_rpcb_rmtcallres(xdrs, p)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_netbuf(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
struct netbuf *objp;
|
||||
xdr_netbuf(XDR *xdrs, struct netbuf *objp)
|
||||
{
|
||||
bool_t dummy;
|
||||
void **pp;
|
||||
|
@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
/* Link list of all the stats about getport and getaddr */
|
||||
|
||||
bool_t
|
||||
xdr_rpcbs_addrlist(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcbs_addrlist *objp;
|
||||
xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
|
||||
{
|
||||
struct rpcbs_addrlist **pnext;
|
||||
|
||||
@ -83,9 +81,7 @@ xdr_rpcbs_addrlist(xdrs, objp)
|
||||
/* Link list of all the stats about rmtcall */
|
||||
|
||||
bool_t
|
||||
xdr_rpcbs_rmtcalllist(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcbs_rmtcalllist *objp;
|
||||
xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp)
|
||||
{
|
||||
int32_t *buf;
|
||||
struct rpcbs_rmtcalllist **pnext;
|
||||
@ -198,9 +194,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_rpcbs_proc(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcbs_proc objp;
|
||||
xdr_rpcbs_proc(XDR *xdrs, rpcbs_proc objp)
|
||||
{
|
||||
if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
|
||||
sizeof (int), (xdrproc_t)xdr_int)) {
|
||||
@ -210,9 +204,7 @@ xdr_rpcbs_proc(xdrs, objp)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_rpcbs_addrlist_ptr(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcbs_addrlist_ptr *objp;
|
||||
xdr_rpcbs_addrlist_ptr(XDR *xdrs, rpcbs_addrlist_ptr *objp)
|
||||
{
|
||||
if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
|
||||
(xdrproc_t)xdr_rpcbs_addrlist)) {
|
||||
@ -222,9 +214,7 @@ xdr_rpcbs_addrlist_ptr(xdrs, objp)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcbs_rmtcalllist_ptr *objp;
|
||||
xdr_rpcbs_rmtcalllist_ptr(XDR *xdrs, rpcbs_rmtcalllist_ptr *objp)
|
||||
{
|
||||
if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
|
||||
(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
|
||||
@ -234,9 +224,7 @@ xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
|
||||
}
|
||||
|
||||
bool_t
|
||||
xdr_rpcb_stat(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcb_stat *objp;
|
||||
xdr_rpcb_stat(XDR *xdrs, rpcb_stat *objp)
|
||||
{
|
||||
|
||||
if (!xdr_rpcbs_proc(xdrs, objp->info)) {
|
||||
@ -262,9 +250,7 @@ xdr_rpcb_stat(xdrs, objp)
|
||||
* being monitored.
|
||||
*/
|
||||
bool_t
|
||||
xdr_rpcb_stat_byvers(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
rpcb_stat_byvers objp;
|
||||
xdr_rpcb_stat_byvers(XDR *xdrs, rpcb_stat_byvers objp)
|
||||
{
|
||||
if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
|
||||
sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {
|
||||
|
@ -95,9 +95,7 @@ struct svc_auth_ops svc_auth_null_ops;
|
||||
* invalid.
|
||||
*/
|
||||
enum auth_stat
|
||||
_authenticate(rqst, msg)
|
||||
struct svc_req *rqst;
|
||||
struct rpc_msg *msg;
|
||||
_authenticate(struct svc_req *rqst, struct rpc_msg *msg)
|
||||
{
|
||||
int cred_flavor;
|
||||
struct authsvc *asp;
|
||||
|
@ -56,9 +56,7 @@ __FBSDID("$FreeBSD$");
|
||||
* Unix longhand authenticator
|
||||
*/
|
||||
enum auth_stat
|
||||
_svcauth_unix(rqst, msg)
|
||||
struct svc_req *rqst;
|
||||
struct rpc_msg *msg;
|
||||
_svcauth_unix(struct svc_req *rqst, struct rpc_msg *msg)
|
||||
{
|
||||
enum auth_stat stat;
|
||||
XDR xdrs;
|
||||
@ -147,9 +145,7 @@ _svcauth_unix(rqst, msg)
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
enum auth_stat
|
||||
_svcauth_short(rqst, msg)
|
||||
struct svc_req *rqst;
|
||||
struct rpc_msg *msg;
|
||||
_svcauth_short(struct svc_req *rqst, struct rpc_msg *msg)
|
||||
{
|
||||
return (AUTH_REJECTEDCRED);
|
||||
}
|
||||
|
@ -72,13 +72,14 @@ extern int __svc_vc_setflag(SVCXPRT *, int);
|
||||
* It creates a link list of all the handles it could create.
|
||||
* If svc_create() is called multiple times, it uses the handle
|
||||
* created earlier instead of creating a new handle every time.
|
||||
*
|
||||
* prognum - Program number
|
||||
* versnum - Version number
|
||||
* nettype - Networktype token
|
||||
*/
|
||||
int
|
||||
svc_create(dispatch, prognum, versnum, nettype)
|
||||
void (*dispatch)(struct svc_req *, SVCXPRT *);
|
||||
rpcprog_t prognum; /* Program number */
|
||||
rpcvers_t versnum; /* Version number */
|
||||
const char *nettype; /* Networktype token */
|
||||
svc_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
|
||||
rpcprog_t prognum, rpcvers_t versnum, const char *nettype)
|
||||
{
|
||||
struct xlist {
|
||||
SVCXPRT *xprt; /* Server handle */
|
||||
@ -143,13 +144,14 @@ svc_create(dispatch, prognum, versnum, nettype)
|
||||
* The high level interface to svc_tli_create().
|
||||
* It tries to create a server for "nconf" and registers the service
|
||||
* with the rpcbind. It calls svc_tli_create();
|
||||
*
|
||||
* prognum - Program number
|
||||
* versnum - Version number
|
||||
* ncofn - Netconfig structure for the network
|
||||
*/
|
||||
SVCXPRT *
|
||||
svc_tp_create(dispatch, prognum, versnum, nconf)
|
||||
void (*dispatch)(struct svc_req *, SVCXPRT *);
|
||||
rpcprog_t prognum; /* Program number */
|
||||
rpcvers_t versnum; /* Version number */
|
||||
const struct netconfig *nconf; /* Netconfig structure for the network */
|
||||
svc_tp_create(void (*dispatch)(struct svc_req *, SVCXPRT *),
|
||||
rpcprog_t prognum, rpcvers_t versnum, const struct netconfig *nconf)
|
||||
{
|
||||
SVCXPRT *xprt;
|
||||
|
||||
@ -184,14 +186,16 @@ svc_tp_create(dispatch, prognum, versnum, nconf)
|
||||
* is set to 8.
|
||||
*
|
||||
* If sendsz or recvsz are zero, their default values are chosen.
|
||||
*
|
||||
* fd - Connection end point
|
||||
* nconf - Netconfig struct for nettoken
|
||||
* bindaddr - Local bind address
|
||||
* sendsz - Max sendsize
|
||||
* recvxz - Max recvsize
|
||||
*/
|
||||
SVCXPRT *
|
||||
svc_tli_create(fd, nconf, bindaddr, sendsz, recvsz)
|
||||
int fd; /* Connection end point */
|
||||
const struct netconfig *nconf; /* Netconfig struct for nettoken */
|
||||
const struct t_bind *bindaddr; /* Local bind address */
|
||||
u_int sendsz; /* Max sendsize */
|
||||
u_int recvsz; /* Max recvsize */
|
||||
svc_tli_create(int fd, const struct netconfig *nconf,
|
||||
const struct t_bind *bindaddr, u_int sendsz, u_int recvsz)
|
||||
{
|
||||
SVCXPRT *xprt = NULL; /* service handle */
|
||||
bool_t madefd = FALSE; /* whether fd opened here */
|
||||
|
@ -82,7 +82,7 @@ static bool_t svc_raw_control(SVCXPRT *, const u_int, void *);
|
||||
char *__rpc_rawcombuf = NULL;
|
||||
|
||||
SVCXPRT *
|
||||
svc_raw_create()
|
||||
svc_raw_create(void)
|
||||
{
|
||||
struct svc_raw_private *srp;
|
||||
/* VARIABLES PROTECTED BY svcraw_lock: svc_raw_private, srp */
|
||||
@ -125,17 +125,14 @@ svc_raw_create()
|
||||
|
||||
/*ARGSUSED*/
|
||||
static enum xprt_stat
|
||||
svc_raw_stat(xprt)
|
||||
SVCXPRT *xprt; /* args needed to satisfy ANSI-C typechecking */
|
||||
svc_raw_stat(SVCXPRT *xprt)
|
||||
{
|
||||
return (XPRT_IDLE);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
svc_raw_recv(xprt, msg)
|
||||
SVCXPRT *xprt;
|
||||
struct rpc_msg *msg;
|
||||
svc_raw_recv(SVCXPRT *xprt, struct rpc_msg *msg)
|
||||
{
|
||||
struct svc_raw_private *srp;
|
||||
XDR *xdrs;
|
||||
@ -159,9 +156,7 @@ svc_raw_recv(xprt, msg)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
svc_raw_reply(xprt, msg)
|
||||
SVCXPRT *xprt;
|
||||
struct rpc_msg *msg;
|
||||
svc_raw_reply(SVCXPRT *xprt, struct rpc_msg *msg)
|
||||
{
|
||||
struct svc_raw_private *srp;
|
||||
XDR *xdrs;
|
||||
@ -201,10 +196,7 @@ svc_raw_reply(xprt, msg)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
svc_raw_getargs(xprt, xdr_args, args_ptr)
|
||||
SVCXPRT *xprt;
|
||||
xdrproc_t xdr_args;
|
||||
void *args_ptr;
|
||||
svc_raw_getargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr)
|
||||
{
|
||||
struct svc_raw_private *srp;
|
||||
|
||||
@ -222,10 +214,7 @@ svc_raw_getargs(xprt, xdr_args, args_ptr)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
svc_raw_freeargs(xprt, xdr_args, args_ptr)
|
||||
SVCXPRT *xprt;
|
||||
xdrproc_t xdr_args;
|
||||
void *args_ptr;
|
||||
svc_raw_freeargs(SVCXPRT *xprt, xdrproc_t xdr_args, void *args_ptr)
|
||||
{
|
||||
struct svc_raw_private *srp;
|
||||
XDR *xdrs;
|
||||
@ -245,24 +234,19 @@ svc_raw_freeargs(xprt, xdr_args, args_ptr)
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
svc_raw_destroy(xprt)
|
||||
SVCXPRT *xprt;
|
||||
svc_raw_destroy(SVCXPRT *xprt)
|
||||
{
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static bool_t
|
||||
svc_raw_control(xprt, rq, in)
|
||||
SVCXPRT *xprt;
|
||||
const u_int rq;
|
||||
void *in;
|
||||
svc_raw_control(SVCXPRT *xprt, const u_int rq, void *in)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
svc_raw_ops(xprt)
|
||||
SVCXPRT *xprt;
|
||||
svc_raw_ops(SVCXPRT *xprt)
|
||||
{
|
||||
static struct xp_ops ops;
|
||||
static struct xp_ops2 ops2;
|
||||
|
@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include "mt_misc.h"
|
||||
|
||||
void
|
||||
svc_run()
|
||||
svc_run(void)
|
||||
{
|
||||
fd_set readfds, cleanfds;
|
||||
struct timeval timeout;
|
||||
@ -89,7 +89,7 @@ svc_run()
|
||||
* more work to do.
|
||||
*/
|
||||
void
|
||||
svc_exit()
|
||||
svc_exit(void)
|
||||
{
|
||||
rwlock_wrlock(&svc_fd_lock);
|
||||
FD_ZERO(&svc_fdset);
|
||||
|
@ -92,16 +92,18 @@ static const char __no_mem_str[] = "out of memory";
|
||||
* is also limited by the recvsize for that transport, even if it is
|
||||
* a COTS transport. This may be wrong, but for cases like these, they
|
||||
* should not use the simplified interfaces like this.
|
||||
*
|
||||
* prognum - program number
|
||||
* versnum - version number
|
||||
* procnum - procedure number
|
||||
* progname - Server routine
|
||||
* inproc, outproc - in/out XDR procedures
|
||||
* nettype - nettype
|
||||
*/
|
||||
|
||||
int
|
||||
rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
|
||||
rpcprog_t prognum; /* program number */
|
||||
rpcvers_t versnum; /* version number */
|
||||
rpcproc_t procnum; /* procedure number */
|
||||
char *(*progname)(char *); /* Server routine */
|
||||
xdrproc_t inproc, outproc; /* in/out XDR procedures */
|
||||
char *nettype; /* nettype */
|
||||
rpc_reg(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
|
||||
char *(*progname)(char *), xdrproc_t inproc, xdrproc_t outproc,
|
||||
char *nettype)
|
||||
{
|
||||
struct netconfig *nconf;
|
||||
int done = FALSE;
|
||||
@ -242,9 +244,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
|
||||
*/
|
||||
|
||||
static void
|
||||
universal(rqstp, transp)
|
||||
struct svc_req *rqstp;
|
||||
SVCXPRT *transp;
|
||||
universal(struct svc_req *rqstp, SVCXPRT *transp)
|
||||
{
|
||||
rpcprog_t prog;
|
||||
rpcvers_t vers;
|
||||
|
@ -270,11 +270,11 @@ __atomic_compare_exchange_##N(uintN_t *mem, uintN_t *pexpected, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define EMIT_FETCH_OP_N(N, uintN_t, ldr, str, name, op) \
|
||||
#define EMIT_FETCH_OP_N(N, uintN_t, ldr, str, name, op, ret) \
|
||||
uintN_t \
|
||||
__atomic_##name##_##N(uintN_t *mem, uintN_t val, int model __unused) \
|
||||
{ \
|
||||
uint32_t old, temp, ras_start; \
|
||||
uint32_t old, new, ras_start; \
|
||||
\
|
||||
ras_start = ARM_RAS_START; \
|
||||
__asm volatile ( \
|
||||
@ -295,9 +295,9 @@ __atomic_##name##_##N(uintN_t *mem, uintN_t val, int model __unused) \
|
||||
"\tstr %2, [%5]\n" \
|
||||
"\tmov %2, #0xffffffff\n" \
|
||||
"\tstr %2, [%5, #4]\n" \
|
||||
: "=&r" (old), "=m" (*mem), "=&r" (temp) \
|
||||
: "=&r" (old), "=m" (*mem), "=&r" (new) \
|
||||
: "r" (val), "m" (*mem), "r" (ras_start)); \
|
||||
return (old); \
|
||||
return (ret); \
|
||||
}
|
||||
|
||||
#define EMIT_ALL_OPS_N(N, uintN_t, ldr, str, streq) \
|
||||
@ -305,11 +305,16 @@ EMIT_LOAD_N(N, uintN_t) \
|
||||
EMIT_STORE_N(N, uintN_t) \
|
||||
EMIT_EXCHANGE_N(N, uintN_t, ldr, str) \
|
||||
EMIT_COMPARE_EXCHANGE_N(N, uintN_t, ldr, streq) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_add, "add") \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_and, "and") \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_or, "orr") \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_sub, "sub") \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_xor, "eor")
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_add, "add", old) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_and, "and", old) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_or, "orr", old) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_sub, "sub", old) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, fetch_xor, "eor", old) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, add_fetch, "add", new) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, and_fetch, "and", new) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, or_fetch, "orr", new) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, sub_fetch, "sub", new) \
|
||||
EMIT_FETCH_OP_N(N, uintN_t, ldr, str, xor_fetch, "eor", new)
|
||||
|
||||
EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq")
|
||||
EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq")
|
||||
|
@ -63,8 +63,13 @@ __FBSDID("$FreeBSD$");
|
||||
.endm
|
||||
|
||||
.macro restore_registers el
|
||||
msr daifset, #2 /* Disable interrupts, x18 may change
|
||||
* in the interrupt exception handler */
|
||||
.if \el == 1
|
||||
msr daifset, #2
|
||||
/*
|
||||
* Disable interrupts, x18 may change in the interrupt exception
|
||||
* handler. For EL0 exceptions, do_ast already did this.
|
||||
*/
|
||||
.endif
|
||||
ldp x18, lr, [sp], #16
|
||||
ldp x10, x11, [sp], #16
|
||||
.if \el == 0
|
||||
@ -100,10 +105,11 @@ __FBSDID("$FreeBSD$");
|
||||
.macro do_ast
|
||||
/* Disable interrupts */
|
||||
mrs x19, daif
|
||||
1:
|
||||
msr daifset, #2
|
||||
|
||||
/* Read the current thread flags */
|
||||
1: ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */
|
||||
ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */
|
||||
ldr x2, [x1, #TD_FLAGS]
|
||||
|
||||
/* Check if we have either bits set */
|
||||
@ -120,13 +126,9 @@ __FBSDID("$FreeBSD$");
|
||||
mov x0, sp
|
||||
bl _C_LABEL(ast)
|
||||
|
||||
/* Disable interrupts */
|
||||
mrs x19, daif
|
||||
msr daifset, #2
|
||||
|
||||
/* Re-check for new ast scheduled */
|
||||
b 1b
|
||||
2:
|
||||
/* Restore interrupts */
|
||||
msr daif, x19
|
||||
.endm
|
||||
|
||||
handle_el1h_sync:
|
||||
@ -158,6 +160,7 @@ handle_el0_irq:
|
||||
save_registers 0
|
||||
mov x0, sp
|
||||
bl arm_cpu_intr
|
||||
do_ast
|
||||
restore_registers 0
|
||||
eret
|
||||
|
||||
|
@ -183,8 +183,16 @@ static int
|
||||
thunder_pem_maxslots(device_t dev)
|
||||
{
|
||||
|
||||
#if 0
|
||||
/* max slots per bus acc. to standard */
|
||||
return (PCI_SLOTMAX);
|
||||
#else
|
||||
/*
|
||||
* ARM64TODO Workaround - otherwise an em(4) interface appears to be
|
||||
* present on every PCI function on the bus to which it is connected
|
||||
*/
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -261,6 +261,26 @@ const static struct scsi_control_page control_page_changeable = {
|
||||
/*extended_selftest_completion_time*/{0, 0}
|
||||
};
|
||||
|
||||
#define CTL_CEM_LEN (sizeof(struct scsi_control_ext_page) - 4)
|
||||
|
||||
const static struct scsi_control_ext_page control_ext_page_default = {
|
||||
/*page_code*/SMS_CONTROL_MODE_PAGE | SMPH_SPF,
|
||||
/*subpage_code*/0x01,
|
||||
/*page_length*/{CTL_CEM_LEN >> 8, CTL_CEM_LEN},
|
||||
/*flags*/0,
|
||||
/*prio*/0,
|
||||
/*max_sense*/0
|
||||
};
|
||||
|
||||
const static struct scsi_control_ext_page control_ext_page_changeable = {
|
||||
/*page_code*/SMS_CONTROL_MODE_PAGE | SMPH_SPF,
|
||||
/*subpage_code*/0x01,
|
||||
/*page_length*/{CTL_CEM_LEN >> 8, CTL_CEM_LEN},
|
||||
/*flags*/0,
|
||||
/*prio*/0,
|
||||
/*max_sense*/0
|
||||
};
|
||||
|
||||
const static struct scsi_info_exceptions_page ie_page_default = {
|
||||
/*page_code*/SMS_INFO_EXCEPTIONS_PAGE,
|
||||
/*page_length*/sizeof(struct scsi_info_exceptions_page) - 2,
|
||||
@ -3956,35 +3976,65 @@ ctl_init_page_index(struct ctl_lun *lun)
|
||||
break;
|
||||
}
|
||||
case SMS_CONTROL_MODE_PAGE: {
|
||||
struct scsi_control_page *control_page;
|
||||
switch (page_index->subpage) {
|
||||
case SMS_SUBPAGE_PAGE_0: {
|
||||
struct scsi_control_page *control_page;
|
||||
|
||||
if (page_index->subpage != SMS_SUBPAGE_PAGE_0)
|
||||
panic("invalid subpage value %d",
|
||||
page_index->subpage);
|
||||
|
||||
memcpy(&lun->mode_pages.control_page[CTL_PAGE_DEFAULT],
|
||||
&control_page_default,
|
||||
sizeof(control_page_default));
|
||||
memcpy(&lun->mode_pages.control_page[
|
||||
CTL_PAGE_CHANGEABLE], &control_page_changeable,
|
||||
sizeof(control_page_changeable));
|
||||
memcpy(&lun->mode_pages.control_page[CTL_PAGE_SAVED],
|
||||
&control_page_default,
|
||||
sizeof(control_page_default));
|
||||
control_page = &lun->mode_pages.control_page[
|
||||
CTL_PAGE_SAVED];
|
||||
value = ctl_get_opt(&lun->be_lun->options, "reordering");
|
||||
if (value != NULL && strcmp(value, "unrestricted") == 0) {
|
||||
control_page->queue_flags &= ~SCP_QUEUE_ALG_MASK;
|
||||
control_page->queue_flags |= SCP_QUEUE_ALG_UNRESTRICTED;
|
||||
memcpy(&lun->mode_pages.control_page[
|
||||
CTL_PAGE_DEFAULT],
|
||||
&control_page_default,
|
||||
sizeof(control_page_default));
|
||||
memcpy(&lun->mode_pages.control_page[
|
||||
CTL_PAGE_CHANGEABLE],
|
||||
&control_page_changeable,
|
||||
sizeof(control_page_changeable));
|
||||
memcpy(&lun->mode_pages.control_page[
|
||||
CTL_PAGE_SAVED],
|
||||
&control_page_default,
|
||||
sizeof(control_page_default));
|
||||
control_page = &lun->mode_pages.control_page[
|
||||
CTL_PAGE_SAVED];
|
||||
value = ctl_get_opt(&lun->be_lun->options,
|
||||
"reordering");
|
||||
if (value != NULL &&
|
||||
strcmp(value, "unrestricted") == 0) {
|
||||
control_page->queue_flags &=
|
||||
~SCP_QUEUE_ALG_MASK;
|
||||
control_page->queue_flags |=
|
||||
SCP_QUEUE_ALG_UNRESTRICTED;
|
||||
}
|
||||
memcpy(&lun->mode_pages.control_page[
|
||||
CTL_PAGE_CURRENT],
|
||||
&lun->mode_pages.control_page[
|
||||
CTL_PAGE_SAVED],
|
||||
sizeof(control_page_default));
|
||||
page_index->page_data =
|
||||
(uint8_t *)lun->mode_pages.control_page;
|
||||
break;
|
||||
}
|
||||
case 0x01:
|
||||
memcpy(&lun->mode_pages.control_ext_page[
|
||||
CTL_PAGE_DEFAULT],
|
||||
&control_ext_page_default,
|
||||
sizeof(control_ext_page_default));
|
||||
memcpy(&lun->mode_pages.control_ext_page[
|
||||
CTL_PAGE_CHANGEABLE],
|
||||
&control_ext_page_changeable,
|
||||
sizeof(control_ext_page_changeable));
|
||||
memcpy(&lun->mode_pages.control_ext_page[
|
||||
CTL_PAGE_SAVED],
|
||||
&control_ext_page_default,
|
||||
sizeof(control_ext_page_default));
|
||||
memcpy(&lun->mode_pages.control_ext_page[
|
||||
CTL_PAGE_CURRENT],
|
||||
&lun->mode_pages.control_ext_page[
|
||||
CTL_PAGE_SAVED],
|
||||
sizeof(control_ext_page_default));
|
||||
page_index->page_data =
|
||||
(uint8_t *)lun->mode_pages.control_ext_page;
|
||||
break;
|
||||
}
|
||||
memcpy(&lun->mode_pages.control_page[CTL_PAGE_CURRENT],
|
||||
&lun->mode_pages.control_page[CTL_PAGE_SAVED],
|
||||
sizeof(control_page_default));
|
||||
page_index->page_data =
|
||||
(uint8_t *)lun->mode_pages.control_page;
|
||||
break;
|
||||
|
||||
}
|
||||
case SMS_INFO_EXCEPTIONS_PAGE: {
|
||||
switch (page_index->subpage) {
|
||||
|
@ -263,10 +263,6 @@ static int ctl_be_block_create(struct ctl_be_block_softc *softc,
|
||||
struct ctl_lun_req *req);
|
||||
static int ctl_be_block_rm(struct ctl_be_block_softc *softc,
|
||||
struct ctl_lun_req *req);
|
||||
static int ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun,
|
||||
struct ctl_lun_req *req);
|
||||
static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun,
|
||||
struct ctl_lun_req *req);
|
||||
static int ctl_be_block_modify(struct ctl_be_block_softc *softc,
|
||||
struct ctl_lun_req *req);
|
||||
static void ctl_be_block_lun_shutdown(void *be_lun);
|
||||
@ -2592,85 +2588,6 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, struct ctl_lun_req *req)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctl_be_block_modify_file(struct ctl_be_block_lun *be_lun,
|
||||
struct ctl_lun_req *req)
|
||||
{
|
||||
struct ctl_be_lun *cbe_lun = &be_lun->cbe_lun;
|
||||
struct vattr vattr;
|
||||
int error;
|
||||
struct ctl_lun_create_params *params = &be_lun->params;
|
||||
|
||||
if (params->lun_size_bytes != 0) {
|
||||
be_lun->size_bytes = params->lun_size_bytes;
|
||||
} else {
|
||||
vn_lock(be_lun->vn, LK_SHARED | LK_RETRY);
|
||||
error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred);
|
||||
VOP_UNLOCK(be_lun->vn, 0);
|
||||
if (error != 0) {
|
||||
snprintf(req->error_str, sizeof(req->error_str),
|
||||
"error calling VOP_GETATTR() for file %s",
|
||||
be_lun->dev_path);
|
||||
return (error);
|
||||
}
|
||||
be_lun->size_bytes = vattr.va_size;
|
||||
}
|
||||
be_lun->size_blocks = be_lun->size_bytes / cbe_lun->blocksize;
|
||||
cbe_lun->maxlba = (be_lun->size_blocks == 0) ?
|
||||
0 : (be_lun->size_blocks - 1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun,
|
||||
struct ctl_lun_req *req)
|
||||
{
|
||||
struct ctl_be_lun *cbe_lun = &be_lun->cbe_lun;
|
||||
struct ctl_lun_create_params *params = &be_lun->params;
|
||||
struct cdevsw *csw;
|
||||
struct cdev *dev;
|
||||
uint64_t size_bytes;
|
||||
int error, ref;
|
||||
|
||||
csw = devvn_refthread(be_lun->vn, &dev, &ref);
|
||||
if (csw == NULL)
|
||||
return (ENXIO);
|
||||
if (csw->d_ioctl == NULL) {
|
||||
dev_relthread(dev, ref);
|
||||
snprintf(req->error_str, sizeof(req->error_str),
|
||||
"no d_ioctl for device %s!", be_lun->dev_path);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
error = csw->d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)&size_bytes, FREAD,
|
||||
curthread);
|
||||
dev_relthread(dev, ref);
|
||||
if (error) {
|
||||
snprintf(req->error_str, sizeof(req->error_str),
|
||||
"error %d returned for DIOCGMEDIASIZE ioctl "
|
||||
"on %s!", error, be_lun->dev_path);
|
||||
return (error);
|
||||
}
|
||||
|
||||
if (params->lun_size_bytes != 0) {
|
||||
if (params->lun_size_bytes > size_bytes) {
|
||||
snprintf(req->error_str, sizeof(req->error_str),
|
||||
"requested LUN size %ju > backing device "
|
||||
"size %ju",
|
||||
(uintmax_t)params->lun_size_bytes,
|
||||
(uintmax_t)size_bytes);
|
||||
return (EINVAL);
|
||||
}
|
||||
be_lun->size_bytes = params->lun_size_bytes;
|
||||
} else {
|
||||
be_lun->size_bytes = size_bytes;
|
||||
}
|
||||
be_lun->size_blocks = be_lun->size_bytes / cbe_lun->blocksize;
|
||||
cbe_lun->maxlba = (be_lun->size_blocks == 0) ?
|
||||
0 : (be_lun->size_blocks - 1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req)
|
||||
{
|
||||
@ -2726,9 +2643,9 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req)
|
||||
if (be_lun->vn == NULL)
|
||||
error = ctl_be_block_open(softc, be_lun, req);
|
||||
else if (vn_isdisk(be_lun->vn, &error))
|
||||
error = ctl_be_block_modify_dev(be_lun, req);
|
||||
error = ctl_be_block_open_dev(be_lun, req);
|
||||
else if (be_lun->vn->v_type == VREG)
|
||||
error = ctl_be_block_modify_file(be_lun, req);
|
||||
error = ctl_be_block_open_file(be_lun, req);
|
||||
else
|
||||
error = EINVAL;
|
||||
if ((cbe_lun->flags & CTL_LUN_FLAG_OFFLINE) &&
|
||||
|
@ -283,6 +283,9 @@ static const struct ctl_page_index page_index_template[] = {
|
||||
CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler},
|
||||
{SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL,
|
||||
CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler},
|
||||
{SMS_CONTROL_MODE_PAGE | SMPH_SPF, 0x01,
|
||||
sizeof(struct scsi_control_ext_page), NULL,
|
||||
CTL_PAGE_FLAG_NONE, NULL, NULL},
|
||||
{SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL,
|
||||
CTL_PAGE_FLAG_NONE, NULL, NULL},
|
||||
{SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02,
|
||||
@ -302,6 +305,7 @@ struct ctl_mode_pages {
|
||||
struct scsi_rigid_disk_page rigid_disk_page[4];
|
||||
struct scsi_caching_page caching_page[4];
|
||||
struct scsi_control_page control_page[4];
|
||||
struct scsi_control_ext_page control_ext_page[4];
|
||||
struct scsi_info_exceptions_page ie_page[4];
|
||||
struct ctl_logical_block_provisioning_page lbp_page[4];
|
||||
struct copan_debugconf_subpage debugconf_subpage[4];
|
||||
|
@ -700,6 +700,19 @@ struct scsi_control_page {
|
||||
u_int8_t extended_selftest_completion_time[2];
|
||||
};
|
||||
|
||||
struct scsi_control_ext_page {
|
||||
uint8_t page_code;
|
||||
uint8_t subpage_code;
|
||||
uint8_t page_length[2];
|
||||
uint8_t flags;
|
||||
#define SCEP_TCMOS 0x04 /* Timestamp Changeable by */
|
||||
#define SCEP_SCSIP 0x02 /* SCSI Precedence (clock) */
|
||||
#define SCEP_IALUAE 0x01 /* Implicit ALUA Enabled */
|
||||
uint8_t prio;
|
||||
uint8_t max_sense;
|
||||
uint8_t reserve[25];
|
||||
};
|
||||
|
||||
struct scsi_cache_page {
|
||||
u_int8_t page_code;
|
||||
#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */
|
||||
|
@ -327,6 +327,9 @@ ahci_probe(device_t dev)
|
||||
pci_get_subclass(dev) == PCIS_STORAGE_SATA &&
|
||||
pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0)
|
||||
valid = 1;
|
||||
else if (pci_get_class(dev) == PCIC_STORAGE &&
|
||||
pci_get_subclass(dev) == PCIS_STORAGE_RAID)
|
||||
valid = 2;
|
||||
/* Is this a known AHCI chip? */
|
||||
for (i = 0; ahci_ids[i].id != 0; i++) {
|
||||
if (ahci_ids[i].id == devid &&
|
||||
@ -343,7 +346,7 @@ ahci_probe(device_t dev)
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
}
|
||||
if (!valid)
|
||||
if (valid != 1)
|
||||
return (ENXIO);
|
||||
device_set_desc_copy(dev, "AHCI SATA controller");
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
|
@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <dev/drm2/drmP.h>
|
||||
|
||||
#if defined(__linux__)
|
||||
static int drm_notifier(void *priv);
|
||||
#endif
|
||||
|
||||
static int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context);
|
||||
|
||||
@ -284,6 +286,7 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
/**
|
||||
* If we get here, it means that the process has called DRM_IOCTL_LOCK
|
||||
* without calling DRM_IOCTL_UNLOCK.
|
||||
@ -314,6 +317,7 @@ static int drm_notifier(void *priv)
|
||||
} while (prev != old);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function returns immediately and takes the hw lock
|
||||
|
@ -2076,6 +2076,7 @@ vfs_vmio_release(struct buf *bp)
|
||||
vm_object_t obj;
|
||||
vm_page_t m;
|
||||
int i;
|
||||
bool freed;
|
||||
|
||||
if (buf_mapped(bp)) {
|
||||
BUF_CHECK_MAPPED(bp);
|
||||
@ -2088,23 +2089,28 @@ vfs_vmio_release(struct buf *bp)
|
||||
for (i = 0; i < bp->b_npages; i++) {
|
||||
m = bp->b_pages[i];
|
||||
bp->b_pages[i] = NULL;
|
||||
/*
|
||||
* In order to keep page LRU ordering consistent, put
|
||||
* everything on the inactive queue.
|
||||
*/
|
||||
vm_page_lock(m);
|
||||
vm_page_unwire(m, PQ_INACTIVE);
|
||||
|
||||
/*
|
||||
* Might as well free the page if we can and it has
|
||||
* no valid data. We also free the page if the
|
||||
* buffer was used for direct I/O
|
||||
*/
|
||||
if ((bp->b_flags & B_ASYNC) == 0 && !m->valid) {
|
||||
if (m->wire_count == 0 && !vm_page_busied(m))
|
||||
vm_page_free(m);
|
||||
} else if (bp->b_flags & B_DIRECT)
|
||||
vm_page_try_to_free(m);
|
||||
if (vm_page_unwire(m, PQ_NONE)) {
|
||||
/*
|
||||
* Determine if the page should be freed before adding
|
||||
* it to the inactive queue.
|
||||
*/
|
||||
if ((bp->b_flags & B_ASYNC) == 0 && m->valid == 0) {
|
||||
freed = !vm_page_busied(m);
|
||||
if (freed)
|
||||
vm_page_free(m);
|
||||
} else if ((bp->b_flags & B_DIRECT) != 0)
|
||||
freed = vm_page_try_to_free(m);
|
||||
else
|
||||
freed = false;
|
||||
if (!freed) {
|
||||
/*
|
||||
* In order to maintain LRU page ordering, put
|
||||
* the page at the tail of the inactive queue.
|
||||
*/
|
||||
vm_page_deactivate(m);
|
||||
}
|
||||
}
|
||||
vm_page_unlock(m);
|
||||
}
|
||||
if (obj != NULL)
|
||||
|
@ -448,77 +448,6 @@ toe_route_redirect_event(void *arg __unused, struct rtentry *rt0,
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef INET6
|
||||
/*
|
||||
* XXX: no checks to verify that sa is really a neighbor because we assume it is
|
||||
* the result of a route lookup and is on-link on the given ifp.
|
||||
*/
|
||||
static int
|
||||
toe_nd6_resolve(struct ifnet *ifp, struct sockaddr *sa, uint8_t *lladdr)
|
||||
{
|
||||
struct llentry *lle, *lle_tmp;
|
||||
struct sockaddr_in6 *sin6 = (void *)sa;
|
||||
int rc, flags = 0;
|
||||
|
||||
restart:
|
||||
IF_AFDATA_RLOCK(ifp);
|
||||
lle = lla_lookup(LLTABLE6(ifp), flags, sa);
|
||||
IF_AFDATA_RUNLOCK(ifp);
|
||||
if (lle == NULL) {
|
||||
lle = nd6_alloc(&sin6->sin6_addr, 0, ifp);
|
||||
if (lle == NULL)
|
||||
return (ENOMEM); /* Couldn't create entry in cache. */
|
||||
IF_AFDATA_WLOCK(ifp);
|
||||
LLE_WLOCK(lle);
|
||||
lle_tmp = nd6_lookup(&sin6->sin6_addr, ND6_EXCLUSIVE, ifp);
|
||||
/* Prefer any existing lle over newly-created one */
|
||||
if (lle_tmp == NULL)
|
||||
lltable_link_entry(LLTABLE6(ifp), lle);
|
||||
IF_AFDATA_WUNLOCK(ifp);
|
||||
if (lle_tmp == NULL) {
|
||||
/* Arm timer for newly-created entry and send NS */
|
||||
nd6_llinfo_setstate(lle, ND6_LLINFO_INCOMPLETE);
|
||||
LLE_WUNLOCK(lle);
|
||||
|
||||
nd6_ns_output(ifp, NULL, NULL, &sin6->sin6_addr, 0);
|
||||
|
||||
return (EWOULDBLOCK);
|
||||
} else {
|
||||
/* Drop newly-created lle and switch to existing one */
|
||||
lltable_free_entry(LLTABLE6(ifp), lle);
|
||||
lle = lle_tmp;
|
||||
lle_tmp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (lle->ln_state == ND6_LLINFO_STALE) {
|
||||
if ((flags & LLE_EXCLUSIVE) == 0) {
|
||||
LLE_RUNLOCK(lle);
|
||||
flags |= LLE_EXCLUSIVE;
|
||||
goto restart;
|
||||
}
|
||||
|
||||
LLE_WLOCK_ASSERT(lle);
|
||||
|
||||
lle->la_asked = 0;
|
||||
nd6_llinfo_setstate(lle, ND6_LLINFO_DELAY);
|
||||
}
|
||||
|
||||
if (lle->la_flags & LLE_VALID) {
|
||||
memcpy(lladdr, &lle->ll_addr, ifp->if_addrlen);
|
||||
rc = 0;
|
||||
} else
|
||||
rc = EWOULDBLOCK;
|
||||
|
||||
if (flags & LLE_EXCLUSIVE)
|
||||
LLE_WUNLOCK(lle);
|
||||
else
|
||||
LLE_RUNLOCK(lle);
|
||||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns 0 or EWOULDBLOCK on success (any other value is an error). 0 means
|
||||
* lladdr and vtag are valid on return, EWOULDBLOCK means the TOE driver's
|
||||
@ -538,7 +467,7 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa,
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
rc = toe_nd6_resolve(ifp, sa, lladdr);
|
||||
rc = nd6_resolve(ifp, 0, NULL, sa, lladdr, NULL);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -2476,42 +2476,46 @@ vm_page_wire(vm_page_t m)
|
||||
/*
|
||||
* vm_page_unwire:
|
||||
*
|
||||
* Release one wiring of the specified page, potentially enabling it to be
|
||||
* paged again. If paging is enabled, then the value of the parameter
|
||||
* "queue" determines the queue to which the page is added.
|
||||
* Release one wiring of the specified page, potentially allowing it to be
|
||||
* paged out. Returns TRUE if the number of wirings transitions to zero and
|
||||
* FALSE otherwise.
|
||||
*
|
||||
* However, unless the page belongs to an object, it is not enqueued because
|
||||
* it cannot be paged out.
|
||||
* Only managed pages belonging to an object can be paged out. If the number
|
||||
* of wirings transitions to zero and the page is eligible for page out, then
|
||||
* the page is added to the specified paging queue (unless PQ_NONE is
|
||||
* specified).
|
||||
*
|
||||
* If a page is fictitious, then its wire count must always be one.
|
||||
*
|
||||
* A managed page must be locked.
|
||||
*/
|
||||
void
|
||||
boolean_t
|
||||
vm_page_unwire(vm_page_t m, uint8_t queue)
|
||||
{
|
||||
|
||||
KASSERT(queue < PQ_COUNT,
|
||||
KASSERT(queue < PQ_COUNT || queue == PQ_NONE,
|
||||
("vm_page_unwire: invalid queue %u request for page %p",
|
||||
queue, m));
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0)
|
||||
vm_page_lock_assert(m, MA_OWNED);
|
||||
vm_page_assert_locked(m);
|
||||
if ((m->flags & PG_FICTITIOUS) != 0) {
|
||||
KASSERT(m->wire_count == 1,
|
||||
("vm_page_unwire: fictitious page %p's wire count isn't one", m));
|
||||
return;
|
||||
return (FALSE);
|
||||
}
|
||||
if (m->wire_count > 0) {
|
||||
m->wire_count--;
|
||||
if (m->wire_count == 0) {
|
||||
atomic_subtract_int(&vm_cnt.v_wire_count, 1);
|
||||
if ((m->oflags & VPO_UNMANAGED) != 0 ||
|
||||
m->object == NULL)
|
||||
return;
|
||||
if (queue == PQ_INACTIVE)
|
||||
m->flags &= ~PG_WINATCFLS;
|
||||
vm_page_enqueue(queue, m);
|
||||
}
|
||||
if ((m->oflags & VPO_UNMANAGED) == 0 &&
|
||||
m->object != NULL && queue != PQ_NONE) {
|
||||
if (queue == PQ_INACTIVE)
|
||||
m->flags &= ~PG_WINATCFLS;
|
||||
vm_page_enqueue(queue, m);
|
||||
}
|
||||
return (TRUE);
|
||||
} else
|
||||
return (FALSE);
|
||||
} else
|
||||
panic("vm_page_unwire: page %p's wire count is zero", m);
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ vm_offset_t vm_page_startup(vm_offset_t vaddr);
|
||||
void vm_page_sunbusy(vm_page_t m);
|
||||
int vm_page_trysbusy(vm_page_t m);
|
||||
void vm_page_unhold_pages(vm_page_t *ma, int count);
|
||||
void vm_page_unwire (vm_page_t m, uint8_t queue);
|
||||
boolean_t vm_page_unwire(vm_page_t m, uint8_t queue);
|
||||
void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr);
|
||||
void vm_page_wire (vm_page_t);
|
||||
void vm_page_xunbusy_hard(vm_page_t m);
|
||||
|
@ -74,7 +74,6 @@ static void dmar_domain_unload_task(void *arg, int pending);
|
||||
static void dmar_unref_domain_locked(struct dmar_unit *dmar,
|
||||
struct dmar_domain *domain);
|
||||
static void dmar_domain_destroy(struct dmar_domain *domain);
|
||||
static void dmar_ctx_dtr(struct dmar_ctx *ctx);
|
||||
|
||||
static void
|
||||
dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus)
|
||||
|
@ -27,7 +27,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 10, 2014
|
||||
.Dd September 22, 2015
|
||||
.Dt ACPICONF 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -62,11 +62,9 @@ Recognized types are
|
||||
(not implemented on most systems but similar to S1),
|
||||
.Cm 3
|
||||
(the CPU context is lost and memory context is preserved),
|
||||
.Cm 4
|
||||
(the CPU context is lost and memory context is stored to disk)
|
||||
and
|
||||
.Cm 5
|
||||
(soft off).
|
||||
.Cm 4
|
||||
(the CPU context is lost and memory context is stored to disk).
|
||||
Sleep states may also be given as S1, S2, etc.
|
||||
The supported states depend on BIOS implementation, including ACPI
|
||||
byte code (AML).
|
||||
|
@ -887,6 +887,12 @@ regkey_add (const char *r)
|
||||
void
|
||||
push_word (const char *w)
|
||||
{
|
||||
|
||||
if (idx == W_MAX) {
|
||||
fprintf(stderr, "too many words; try bumping W_MAX in inf.h\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (w && strlen(w))
|
||||
words[idx++] = w;
|
||||
else
|
||||
|
@ -4,7 +4,7 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define W_MAX 16
|
||||
#define W_MAX 32
|
||||
|
||||
struct section {
|
||||
const char * name;
|
||||
|
Loading…
Reference in New Issue
Block a user