Skip to content

Commit

Permalink
14069 inetboot: multiply-defined symbols
Browse files Browse the repository at this point in the history
Reviewed by: Klaus Ziegler <klausz@haus-gisela.de>
Approved by: Robert Mustacchi <rm@fingolfin.org>
  • Loading branch information
tsoome committed Oct 19, 2021
1 parent f8871fb commit a2cd9e1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 62 deletions.
2 changes: 1 addition & 1 deletion usr/src/psm/stand/boot/common/readfile.c
Expand Up @@ -64,7 +64,7 @@ int npagesize = 0;
uint_t icache_flush = 0;
char *cpulist = NULL;
char *mmulist = NULL;
char *module_path; /* path for kernel modules */
extern char *module_path; /* path for kernel modules */

/*
* This file gets compiled in LP64 (for sun4u) and ILP32 models.
Expand Down
4 changes: 2 additions & 2 deletions usr/src/psm/stand/boot/sparc/common/bootprop.c
Expand Up @@ -35,11 +35,11 @@ char *v2path, *kernname, *systype;
char *my_own_name = "boot";
char v2args_buf[V2ARGS_BUF_SZ];
char *v2args = v2args_buf;
char *mfg_name;
extern char *mfg_name;
char *impl_arch_name;
char *bootp_response;
char *module_path;
int cache_state;
extern int cache_state;
uint64_t memlistextent; /* replacement for old member of bootops */

/* These are the various memory lists */
Expand Down
6 changes: 2 additions & 4 deletions usr/src/psm/stand/boot/sparc/common/sun4x_standalloc.c
Expand Up @@ -23,8 +23,6 @@
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <sys/types.h>
#include <sys/saio.h>
#include <sys/sysmacros.h>
Expand All @@ -45,10 +43,10 @@ extern struct memlist *vfreelistp, *pfreelistp;
extern void reset_alloc(void);
extern void alloc_segment(caddr_t);

caddr_t memlistpage;
extern caddr_t memlistpage;
caddr_t le_page;
caddr_t ie_page;
caddr_t scratchmemp;
caddr_t scratchmemp;
extern int pagesize;

#define N_FREELIST 20 /* keep the largest 20 free regions */
Expand Down
75 changes: 25 additions & 50 deletions usr/src/stand/lib/fs/nfs/clnt_budp.c
Expand Up @@ -66,7 +66,7 @@ extern int errno;
* If we create another clnt type this should be
* moved to a common file
*/
struct rpc_createerr rpc_createerr;
extern struct rpc_createerr rpc_createerr;

static struct clnt_ops *clntbudp_ops();

Expand Down Expand Up @@ -106,14 +106,9 @@ struct cu_data {
* sent and received.
*/
CLIENT *
clntbudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
struct sockaddr_in *raddr;
rpcprog_t program;
rpcvers_t version;
struct timeval wait;
int *sockp;
uint_t sendsz;
uint_t recvsz;
clntbudp_bufcreate(struct sockaddr_in *raddr, rpcprog_t program,
rpcvers_t version, struct timeval wait, int *sockp, uint_t sendsz,
uint_t recvsz)
{
CLIENT *cl;
struct cu_data *cu;
Expand All @@ -140,7 +135,7 @@ clntbudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
if (raddr->sin_port == 0) {
ushort_t port;
if ((port = bpmap_getport(program, version,
&(rpc_createerr.cf_stat), raddr, NULL)) == 0) {
&(rpc_createerr.cf_stat), raddr, NULL)) == 0) {
goto fooy;
}
raddr->sin_port = htons(port);
Expand Down Expand Up @@ -179,7 +174,7 @@ clntbudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)

if (dontroute) {
(void) setsockopt(*sockp, SOL_SOCKET, SO_DONTROUTE,
(const void *)&dontroute, sizeof (dontroute));
(const void *)&dontroute, sizeof (dontroute));
}

/* attempt to bind to priv port */
Expand Down Expand Up @@ -209,27 +204,17 @@ clntbudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
}

CLIENT *
clntbudp_create(raddr, program, version, wait, sockp)
struct sockaddr_in *raddr;
rpcprog_t program;
rpcvers_t version;
struct timeval wait;
int *sockp;
clntbudp_create(struct sockaddr_in *raddr, rpcprog_t program,
rpcvers_t version, struct timeval wait, int *sockp)
{

return (clntbudp_bufcreate(raddr, program, version, wait, sockp,
UDPMSGSIZE, UDPMSGSIZE));
}

static enum clnt_stat
clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
CLIENT *cl; /* client handle */
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 */
struct timeval utimeout; /* seconds to wait before giving up */
clntbudp_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xargs, caddr_t argsp,
xdrproc_t xresults, caddr_t resultsp, struct timeval utimeout)
{
struct cu_data *cu;
XDR *xdrs;
Expand Down Expand Up @@ -258,7 +243,7 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
*/
xdelay = cu->cu_wait.tv_sec + 1000 + cu->cu_wait.tv_usec / 1000;
(void) setsockopt(cu->cu_sock, SOL_SOCKET, SO_RCVTIMEO,
(void *)&xdelay, sizeof (xdelay));
(void *)&xdelay, sizeof (xdelay));

wait_time = (timeout.tv_sec * 1000) + (timeout.tv_usec / 1000);
if (wait_time == 0)
Expand Down Expand Up @@ -331,8 +316,8 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
fromlen = sizeof (struct sockaddr);

inlen = recvfrom(cu->cu_sock, cu->cu_inbuf,
(int)cu->cu_recvsz, MSG_DONTWAIT,
(struct sockaddr *)&from, &fromlen);
(int)cu->cu_recvsz, MSG_DONTWAIT,
(struct sockaddr *)&from, &fromlen);

if (inlen < 0) {
if (errno == EWOULDBLOCK) {
Expand All @@ -358,10 +343,10 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)

/* see if reply transaction id matches sent id */
if (*((uint32_t *)(cu->cu_inbuf)) !=
*((uint32_t *)(cu->cu_outbuf))) {
*((uint32_t *)(cu->cu_outbuf))) {
dprintf("clntbudp_call: xid: 0x%x != 0x%x\n",
*(uint32_t *)(cu->cu_inbuf),
*(uint32_t *)(cu->cu_outbuf));
*(uint32_t *)(cu->cu_inbuf),
*(uint32_t *)(cu->cu_outbuf));
continue;
}
/* we now assume we have the proper reply */
Expand All @@ -382,7 +367,7 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
_seterr_reply(&reply_msg, &(cu->cu_error));
if (cu->cu_error.re_status == RPC_SUCCESS) {
if (! AUTH_VALIDATE(cl->cl_auth,
&reply_msg.acpted_rply.ar_verf)) {
&reply_msg.acpted_rply.ar_verf)) {
cu->cu_error.re_status = RPC_AUTHERROR;
cu->cu_error.re_why = AUTH_INVALIDRESP;
errors++;
Expand All @@ -399,7 +384,7 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
if (cu->cu_error.re_status == RPC_AUTHERROR) {
/* maybe our credentials need to be refreshed ... */
if (nrefreshes > 0 &&
AUTH_REFRESH(cl->cl_auth, NULL, NULL)) {
AUTH_REFRESH(cl->cl_auth, NULL, NULL)) {
nrefreshes--;
}
errors++;
Expand All @@ -409,15 +394,13 @@ clntbudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
/* Just keep trying till there's no data... */
errors++;
dprintf("clntbudp_call: from: %s, error: ",
inet_ntoa(from.sin_addr));
inet_ntoa(from.sin_addr));
rpc_disperr(&cu->cu_error);
goto recv_again;
}

static void
clntbudp_geterr(cl, errp)
CLIENT *cl;
struct rpc_err *errp;
clntbudp_geterr(CLIENT *cl, struct rpc_err *errp)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;

Expand All @@ -426,10 +409,7 @@ clntbudp_geterr(cl, errp)


static bool_t
clntbudp_freeres(cl, xdr_res, res_ptr)
CLIENT *cl;
xdrproc_t xdr_res;
caddr_t res_ptr;
clntbudp_freeres(CLIENT *cl, xdrproc_t xdr_res, caddr_t res_ptr)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;
XDR *xdrs = &(cu->cu_outxdrs);
Expand All @@ -439,25 +419,20 @@ clntbudp_freeres(cl, xdr_res, res_ptr)
}

static void
clntbudp_abort()
/* CLIENT *h; */
clntbudp_abort(void)
{
}

/* ARGSUSED */
static bool_t
clntbudp_control(cl, request, info)
CLIENT *cl;
int request;
char *info;
clntbudp_control(CLIENT *cl, int request, char *info)
{
/* CLNT_CONTROL is not used in boot */
return (FALSE);
}

static void
clntbudp_destroy(cl)
CLIENT *cl;
clntbudp_destroy(CLIENT *cl)
{
struct cu_data *cu = (struct cu_data *)cl->cl_private;

Expand All @@ -470,7 +445,7 @@ clntbudp_destroy(cl)
}

static struct clnt_ops *
clntbudp_ops()
clntbudp_ops(void)
{
static struct clnt_ops ops;

Expand Down
4 changes: 2 additions & 2 deletions usr/src/stand/lib/sa/memlist.c
Expand Up @@ -31,7 +31,7 @@
#include <sys/bootconf.h>
#include <sys/salib.h>

extern caddr_t memlistpage;
caddr_t memlistpage;

/* Always pts to the next free link in the headtable */
/* i.e. it is always memlistpage+tableoffset */
Expand All @@ -41,7 +41,7 @@ static int table_freespace;
/*
* Function prototypes
*/
extern void reset_alloc(void);
extern void reset_alloc(void);

void
print_memlist(struct memlist *av)
Expand Down
3 changes: 0 additions & 3 deletions usr/src/stand/lib/sa/standalloc.c
Expand Up @@ -24,8 +24,6 @@
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <sys/types.h>
#include <sys/saio.h>
#include <sys/sysmacros.h>
Expand All @@ -45,7 +43,6 @@ extern caddr_t resalloc(enum RESOURCES type,
extern void resfree(enum RESOURCES type,
caddr_t virtaddr, size_t bytes);

caddr_t memlistpage;
extern int pagesize;

/*
Expand Down

0 comments on commit a2cd9e1

Please sign in to comment.