summaryrefslogtreecommitdiff
path: root/usr/src/uts
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2019-09-04 12:19:44 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2019-09-04 12:19:44 +0000
commitf03504a3d8ff76e9b29505fc561f7ac625712180 (patch)
tree8f2df3e2f797a1c61173c20ce2ae7e1f33de961f /usr/src/uts
parent1ed9823d08fd2b08c4d4f0d9a57075899d36b295 (diff)
parenta8ea0c9dd566453d9b69eab5f863930da9d0c4ae (diff)
downloadillumos-joyent-f03504a3d8ff76e9b29505fc561f7ac625712180.tar.gz
[illumos-gate merge]
commit a8ea0c9dd566453d9b69eab5f863930da9d0c4ae 11584 ::xcall would be useful commit cd4bec9bcc617ecbc586bb4c2feb7096df189b13 11645 tst.utf8probefunc.ksh needs to specify -m32 consistently commit bf10ed2ef23d4a6289a032ea1be97e21e6258009 11594 ldterm: cast between incompatible function types commit 2575b44147c38559884d4c042492bb21783cb486 11595 ufs: cast between incompatible function types commit 571982554c7574488834ef19f61c63ee15df365c 11596 bufmod: cast between incompatible function types commit e8e33323835377cff0a2d52f0c1c7b1847215110 11597 pckt: cast between incompatible function types commit d9c462b2dd4afc98da9074ea6ace57ecd8035001 11598 pfmod: cast between incompatible function types commit fd121eb4d1d06ebe9153101f4c80d19c65452dd2 11599 ptem: cast between incompatible function types commit b6ed8f224ac74c5a605c334c1cf1e093427251f4 11642 getresponse.c: memory leak in init_yes(), add fini_yes(). commit 51c48e9829e8ff3cb6bfb9b8ad96b995abedf063 11638 zfs mmp test bugs commit 4942e22259992130a6f34737c52dfbd4f4d5b151 11644 kmf_openssl: NULL pointer issues commit dbdc225a81ccef01e9d416169099b09ddbc06ea1 11530 badseg test creates cores commit 89cb8ffb5df88f95defaae8f0f4f0c67ccd9d17e 11643 panic when detaching vioif commit 9e59ac1c9bffd2ba0d7192da3c5f7d1c3444991a 11538 i86pc: unix should always build dboot as 32-bit
Diffstat (limited to 'usr/src/uts')
-rw-r--r--usr/src/uts/common/fs/ufs/ufs_vnops.c25
-rw-r--r--usr/src/uts/common/io/bufmod.c27
-rw-r--r--usr/src/uts/common/io/ldterm.c62
-rw-r--r--usr/src/uts/common/io/pckt.c44
-rw-r--r--usr/src/uts/common/io/pfmod.c23
-rw-r--r--usr/src/uts/common/io/ptem.c35
-rw-r--r--usr/src/uts/common/io/vioif/vioif.c9
-rw-r--r--usr/src/uts/common/io/vioif/vioif.h1
-rw-r--r--usr/src/uts/common/io/virtio/virtio_main.c4
-rw-r--r--usr/src/uts/i86pc/Makefile.rules3
10 files changed, 124 insertions, 109 deletions
diff --git a/usr/src/uts/common/fs/ufs/ufs_vnops.c b/usr/src/uts/common/fs/ufs/ufs_vnops.c
index 370c982f08..8aa961e340 100644
--- a/usr/src/uts/common/fs/ufs/ufs_vnops.c
+++ b/usr/src/uts/common/fs/ufs/ufs_vnops.c
@@ -26,7 +26,7 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
@@ -102,7 +102,7 @@
static struct instats ins;
-static int ufs_getpage_ra(struct vnode *, u_offset_t, struct seg *, caddr_t);
+static int ufs_getpage_ra(struct vnode *, u_offset_t, struct seg *, caddr_t);
static int ufs_getpage_miss(struct vnode *, u_offset_t, size_t, struct seg *,
caddr_t, struct page **, size_t, enum seg_rw, int);
static int ufs_open(struct vnode **, int, struct cred *, caller_context_t *);
@@ -245,7 +245,7 @@ struct dump {
struct inode *ip; /* the file we contain */
daddr_t fsbs; /* number of blocks stored */
struct timeval32 time; /* time stamp for the struct */
- daddr32_t dblk[1]; /* place holder for block info */
+ daddr32_t dblk[1]; /* place holder for block info */
};
static struct dump *dump_info = NULL;
@@ -1233,7 +1233,7 @@ out:
* --------------------------
* always@ IATTCHG|IBDWRITE
*
- * @ - If we are doing synchronous write the only time we should
+ * @ - If we are doing synchronous write the only time we should
* not be sync'ing the ip here is if we have the stickyhack
* activated, the file is marked with the sticky bit and
* no exec bit, the file length has not been changed and
@@ -4409,14 +4409,14 @@ ufs_getpage(struct vnode *vp, offset_t off, size_t len, uint_t *protp,
u_offset_t uoff = (u_offset_t)off; /* type conversion */
u_offset_t pgoff;
u_offset_t eoff;
- struct inode *ip = VTOI(vp);
+ struct inode *ip = VTOI(vp);
struct ufsvfs *ufsvfsp = ip->i_ufsvfs;
- struct fs *fs;
+ struct fs *fs;
struct ulockfs *ulp;
page_t **pl;
caddr_t pgaddr;
krw_t rwtype;
- int err;
+ int err;
int has_holes;
int beyond_eof;
int seqmode;
@@ -5206,7 +5206,7 @@ ufs_putpages(struct vnode *vp, offset_t off, size_t len, int flags,
return (err);
}
-static void
+static int
ufs_iodone(buf_t *bp)
{
struct inode *ip;
@@ -5228,6 +5228,7 @@ ufs_iodone(buf_t *bp)
mutex_exit(&ip->i_tlock);
iodone(bp);
+ return (0);
}
/*
@@ -5419,7 +5420,7 @@ ufs_putapage(struct vnode *vp, page_t *pp, u_offset_t *offp, size_t *lenp,
/* write throttle */
ASSERT(bp->b_iodone == NULL);
- bp->b_iodone = (int (*)())ufs_iodone;
+ bp->b_iodone = ufs_iodone;
mutex_enter(&ip->i_tlock);
ip->i_writes += bp->b_bcount;
mutex_exit(&ip->i_tlock);
@@ -5617,7 +5618,7 @@ ufs_delmap(struct vnode *vp, offset_t off, struct as *as, caddr_t addr,
}
mutex_enter(&ip->i_tlock);
- ip->i_mapcnt -= btopr(len); /* Count released mappings */
+ ip->i_mapcnt -= btopr(len); /* Count released mappings */
ASSERT(ip->i_mapcnt >= 0);
mutex_exit(&ip->i_tlock);
return (0);
@@ -5690,9 +5691,9 @@ ufs_l_pathconf(struct vnode *vp, int cmd, ulong_t *valp, struct cred *cr,
{
struct ufsvfs *ufsvfsp = VTOI(vp)->i_ufsvfs;
struct ulockfs *ulp = NULL;
- struct inode *sip = NULL;
+ struct inode *sip = NULL;
int error;
- struct inode *ip = VTOI(vp);
+ struct inode *ip = VTOI(vp);
int issync;
error = ufs_lockfs_begin(ufsvfsp, &ulp, ULOCKFS_PATHCONF_MASK);
diff --git a/usr/src/uts/common/io/bufmod.c b/usr/src/uts/common/io/bufmod.c
index c1dd697a78..41fbe83e6a 100644
--- a/usr/src/uts/common/io/bufmod.c
+++ b/usr/src/uts/common/io/bufmod.c
@@ -107,9 +107,9 @@ struct sb {
*/
static int sbopen(queue_t *, dev_t *, int, int, cred_t *);
static int sbclose(queue_t *, int, cred_t *);
-static void sbwput(queue_t *, mblk_t *);
-static void sbrput(queue_t *, mblk_t *);
-static void sbrsrv(queue_t *);
+static int sbwput(queue_t *, mblk_t *);
+static int sbrput(queue_t *, mblk_t *);
+static int sbrsrv(queue_t *);
static void sbioctl(queue_t *, mblk_t *);
static void sbaddmsg(queue_t *, mblk_t *);
static void sbtick(void *);
@@ -126,8 +126,8 @@ static struct module_info sb_minfo = {
};
static struct qinit sb_rinit = {
- (int (*)())sbrput, /* qi_putp */
- (int (*)())sbrsrv, /* qi_srvp */
+ sbrput, /* qi_putp */
+ sbrsrv, /* qi_srvp */
sbopen, /* qi_qopen */
sbclose, /* qi_qclose */
NULL, /* qi_qadmin */
@@ -136,7 +136,7 @@ static struct qinit sb_rinit = {
};
static struct qinit sb_winit = {
- (int (*)())sbwput, /* qi_putp */
+ sbwput, /* qi_putp */
NULL, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
@@ -402,7 +402,7 @@ sbioc(queue_t *wq, mblk_t *mp)
* for manipulating the buffering state and hand them to sbioctl.
* Other message types are passed on through.
*/
-static void
+static int
sbwput(queue_t *wq, mblk_t *mp)
{
struct sb *sbp = (struct sb *)wq->q_ptr;
@@ -447,6 +447,7 @@ sbwput(queue_t *wq, mblk_t *mp)
putnext(wq, mp);
break;
}
+ return (0);
}
/*
@@ -454,7 +455,7 @@ sbwput(queue_t *wq, mblk_t *mp)
* messages and grouping them into aggregates according to the current
* buffering parameters.
*/
-static void
+static int
sbrput(queue_t *rq, mblk_t *mp)
{
struct sb *sbp = (struct sb *)rq->q_ptr;
@@ -535,13 +536,14 @@ sbrput(queue_t *rq, mblk_t *mp)
}
break;
}
+ return (0);
}
/*
* read service procedure.
*/
/* ARGSUSED */
-static void
+static int
sbrsrv(queue_t *rq)
{
mblk_t *mp;
@@ -554,10 +556,11 @@ sbrsrv(queue_t *rq)
if (!canputnext(rq) && (mp->b_datap->db_type <= QPCTL)) {
/* should only get here if SB_NO_SROPS */
(void) putbq(rq, mp);
- return;
+ return (0);
}
putnext(rq, mp);
}
+ return (0);
}
/*
@@ -969,7 +972,7 @@ sbaddmsg(queue_t *rq, mblk_t *mp)
* Truncate the message.
*/
if ((sbp->sb_snap > 0) && (origlen > sbp->sb_snap) &&
- (adjmsg(mp, -(origlen - sbp->sb_snap)) == 1))
+ (adjmsg(mp, -(origlen - sbp->sb_snap)) == 1))
hp.sbh_totlen = hp.sbh_msglen = sbp->sb_snap;
else
hp.sbh_totlen = hp.sbh_msglen = origlen;
@@ -1097,7 +1100,7 @@ sbaddmsg(queue_t *rq, mblk_t *mp)
;
if ((wrapperlen <= MBLKTAIL(last)) &&
- (last->b_datap->db_ref == 1)) {
+ (last->b_datap->db_ref == 1)) {
if (pad > 0) {
/*
* Pad with zeroes to the next pointer boundary
diff --git a/usr/src/uts/common/io/ldterm.c b/usr/src/uts/common/io/ldterm.c
index 498d2d9bee..97a9c1a478 100644
--- a/usr/src/uts/common/io/ldterm.c
+++ b/usr/src/uts/common/io/ldterm.c
@@ -416,11 +416,11 @@ _info(struct modinfo *modinfop)
static int ldtermopen(queue_t *, dev_t *, int, int, cred_t *);
static int ldtermclose(queue_t *, int, cred_t *);
-static void ldtermrput(queue_t *, mblk_t *);
-static void ldtermrsrv(queue_t *);
+static int ldtermrput(queue_t *, mblk_t *);
+static int ldtermrsrv(queue_t *);
static int ldtermrmsg(queue_t *, mblk_t *);
-static void ldtermwput(queue_t *, mblk_t *);
-static void ldtermwsrv(queue_t *);
+static int ldtermwput(queue_t *, mblk_t *);
+static int ldtermwsrv(queue_t *);
static int ldtermwmsg(queue_t *, mblk_t *);
static mblk_t *ldterm_docanon(unsigned char, mblk_t *, size_t, queue_t *,
ldtermstd_state_t *, int *);
@@ -574,8 +574,8 @@ static struct module_info ldtermmiinfo = {
static struct qinit ldtermrinit = {
- (int (*)())ldtermrput,
- (int (*)())ldtermrsrv,
+ ldtermrput,
+ ldtermrsrv,
ldtermopen,
ldtermclose,
NULL,
@@ -594,8 +594,8 @@ static struct module_info ldtermmoinfo = {
static struct qinit ldtermwinit = {
- (int (*)())ldtermwput,
- (int (*)())ldtermwsrv,
+ ldtermwput,
+ ldtermwsrv,
ldtermopen,
ldtermclose,
NULL,
@@ -945,7 +945,7 @@ ldtermclose(queue_t *q, int cflag, cred_t *crp)
/*
* Put procedure for input from driver end of stream (read queue).
*/
-static void
+static int
ldtermrput(queue_t *q, mblk_t *mp)
{
ldtermstd_state_t *tp;
@@ -972,7 +972,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
if (iocp->ioc_id == tp->t_iocid) {
tp->t_state &= ~TS_IOCWAIT;
freemsg(mp);
- return;
+ return (0);
}
}
@@ -980,7 +980,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
default:
(void) putq(q, mp);
- return;
+ return (0);
/*
* Send these up unmolested
@@ -991,12 +991,12 @@ ldtermrput(queue_t *q, mblk_t *mp)
case M_IOCNAK:
putnext(q, mp);
- return;
+ return (0);
case M_IOCACK:
ldterm_ioctl_reply(q, mp);
- return;
+ return (0);
case M_BREAK:
@@ -1021,7 +1021,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
if ((mp = allocb(3, BPRI_HI)) == NULL) {
cmn_err(CE_WARN,
"ldtermrput: no blocks");
- return;
+ return (0);
}
mp->b_datap->db_type = M_DATA;
*mp->b_wptr++ = (uchar_t)'\377';
@@ -1036,7 +1036,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
} else {
freemsg(mp);
}
- return;
+ return (0);
}
/*
* We look at the apparent modes here instead of the
@@ -1060,7 +1060,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
if ((mp = allocb(3, BPRI_HI)) == NULL) {
cmn_err(CE_WARN,
"ldtermrput: no blocks");
- return;
+ return (0);
}
mp->b_datap->db_type = M_DATA;
*mp->b_wptr++ = (uchar_t)'\377';
@@ -1075,7 +1075,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
if ((mp = allocb(1, BPRI_HI)) == NULL) {
cmn_err(CE_WARN,
"ldtermrput: no blocks");
- return;
+ return (0);
}
mp->b_datap->db_type = M_DATA;
*mp->b_wptr++ = '\0';
@@ -1084,7 +1084,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
} else {
freemsg(mp);
}
- return;
+ return (0);
case M_CTL:
DEBUG3(("ldtermrput: M_CTL received\n"));
@@ -1098,7 +1098,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
"Non standard M_CTL received by ldterm module\n"));
/* May be for someone else; pass it on */
putnext(q, mp);
- return;
+ return (0);
}
qryp = (struct iocblk *)mp->b_rptr;
@@ -1165,7 +1165,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
break;
}
putnext(q, mp); /* In case anyone else has to see it */
- return;
+ return (0);
case M_FLUSH:
/*
@@ -1202,7 +1202,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
(void) putnextctl(wrq, M_STARTI);
DEBUG1(("M_STARTI down\n"));
}
- return;
+ return (0);
case M_DATA:
break;
@@ -1226,7 +1226,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
*/
if (tp->t_state & TS_NOCANON) {
(void) putq(q, mp);
- return;
+ return (0);
}
bp = mp;
@@ -1471,6 +1471,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
(void) putnextctl(wrq, M_STOPI);
DEBUG1(("M_STOPI down\n"));
}
+ return (0);
}
@@ -1479,7 +1480,7 @@ ldtermrput(queue_t *q, mblk_t *mp)
* ('\') processing, gathering into messages, upper/lower case input
* mapping.
*/
-static void
+static int
ldtermrsrv(queue_t *q)
{
ldtermstd_state_t *tp;
@@ -1526,6 +1527,7 @@ ldtermrsrv(queue_t *q)
tp->t_state &= ~TS_TBLOCK;
(void) putctl(WR(q), M_STARTI);
}
+ return (0);
}
/*
@@ -3050,7 +3052,7 @@ ldterm_wenable(void *addr)
* if there's already something pending or if its downstream neighbor
* is clogged.
*/
-static void
+static int
ldtermwput(queue_t *q, mblk_t *mp)
{
ldtermstd_state_t *tp;
@@ -3074,7 +3076,7 @@ ldtermwput(queue_t *q, mblk_t *mp)
(*mp->b_rptr == FLUSHW)) {
tp->t_state &= ~TS_FLUSHWAIT;
freemsg(mp);
- return;
+ return (0);
}
/*
* This is coming from above, so we only
@@ -3210,7 +3212,7 @@ ldtermwput(queue_t *q, mblk_t *mp)
putnext(q, mp);
break;
}
- return;
+ return (0);
}
/*
* If our queue is nonempty or there's a traffic jam
@@ -3243,24 +3245,25 @@ ldtermwput(queue_t *q, mblk_t *mp)
*/
default:
(void) ldtermwmsg(q, mp);
- return;
+ return (0);
}
}
(void) putq(q, mp);
- return;
+ return (0);
}
/*
* We can take the fast path through, by simply calling
* ldtermwmsg to dispose of mp.
*/
(void) ldtermwmsg(q, mp);
+ return (0);
}
/*
* Line discipline output queue service procedure.
*/
-static void
+static int
ldtermwsrv(queue_t *q)
{
mblk_t *mp;
@@ -3288,6 +3291,7 @@ ldtermwsrv(queue_t *q)
break;
}
}
+ return (0);
}
diff --git a/usr/src/uts/common/io/pckt.c b/usr/src/uts/common/io/pckt.c
index 3dcb518228..410bd31e3b 100644
--- a/usr/src/uts/common/io/pckt.c
+++ b/usr/src/uts/common/io/pckt.c
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
@@ -97,9 +97,9 @@ _info(struct modinfo *modinfop)
static int pcktopen(queue_t *, dev_t *, int, int, cred_t *);
static int pcktclose(queue_t *, int, cred_t *);
-static void pcktrput(queue_t *, mblk_t *);
-static void pcktrsrv(queue_t *);
-static void pcktwput(queue_t *, mblk_t *);
+static int pcktrput(queue_t *, mblk_t *);
+static int pcktrsrv(queue_t *);
+static int pcktwput(queue_t *, mblk_t *);
static mblk_t *add_ctl_info(queue_t *, mblk_t *);
static void add_ctl_wkup(void *);
@@ -142,8 +142,8 @@ static struct module_info pcktoinfo = {
};
static struct qinit pcktrinit = {
- (int (*)())pcktrput,
- (int (*)())pcktrsrv,
+ pcktrput,
+ pcktrsrv,
pcktopen,
pcktclose,
NULL,
@@ -152,7 +152,7 @@ static struct qinit pcktrinit = {
};
static struct qinit pcktwinit = {
- (int (*)())pcktwput,
+ pcktwput,
NULL,
NULL,
NULL,
@@ -311,7 +311,7 @@ pcktclose(
* This is called from the module or
* driver downstream.
*/
-static void
+static int
pcktrput(
queue_t *q, /* Pointer to the read queue */
mblk_t *mp) /* Pointer to the current message block */
@@ -406,6 +406,7 @@ prefix_head:
putnext(q, mp);
break;
}
+ return (0);
}
/*
@@ -416,7 +417,7 @@ prefix_head:
* The function will attempt to get the messages off the queue and
* process them.
*/
-static void
+static int
pcktrsrv(queue_t *q)
{
mblk_t *mp;
@@ -435,7 +436,7 @@ pcktrsrv(queue_t *q)
if (!datamsg(mp->b_datap->db_type))
noenable(q);
(void) putbq(q, mp);
- return;
+ return (0);
}
/*
@@ -460,7 +461,7 @@ pcktrsrv(queue_t *q)
/*
* Running into memory or flow ctl problems.
*/
- return;
+ return (0);
}
/* FALL THROUGH */
@@ -469,6 +470,7 @@ pcktrsrv(queue_t *q)
break;
}
}
+ return (0);
}
/*
@@ -476,12 +478,13 @@ pcktrsrv(queue_t *q)
* All messages are send downstream unchanged
*/
-static void
+static int
pcktwput(
queue_t *q, /* Pointer to the read queue */
mblk_t *mp) /* Pointer to current message block */
{
putnext(q, mp);
+ return (0);
}
#ifdef _MULTI_DATAMODEL
@@ -497,8 +500,7 @@ pcktwput(
static mblk_t *
pckt_reallocb(
queue_t *q, /* Pointer to the read queue */
- mblk_t *mp /* Pointer to the message block to be changed */
-)
+ mblk_t *mp) /* Pointer to the message block to be changed */
{
mblk_t *nmp;
@@ -539,7 +541,7 @@ pckt_reallocb(
/*
* add_ctl_info: add message control information to in coming
- * message.
+ * message.
*/
static mblk_t *
add_ctl_info(
@@ -613,15 +615,15 @@ add_ctl_info(
* from <sys/stream.h>.
*/
struct iocblk32 {
- int32_t ioc_cmd;
+ int32_t ioc_cmd;
caddr32_t ioc_cr;
uint32_t ioc_id;
- int32_t ioc_count;
- int32_t ioc_error;
- int32_t ioc_rval;
- int32_t ioc_fill1;
+ int32_t ioc_count;
+ int32_t ioc_error;
+ int32_t ioc_rval;
+ int32_t ioc_fill1;
uint32_t ioc_flag;
- int32_t ioc_filler[2];
+ int32_t ioc_filler[2];
} niocblk_32;
struct iocblk *iocblk_64;
diff --git a/usr/src/uts/common/io/pfmod.c b/usr/src/uts/common/io/pfmod.c
index c9c452e6ef..e6c241eafa 100644
--- a/usr/src/uts/common/io/pfmod.c
+++ b/usr/src/uts/common/io/pfmod.c
@@ -35,7 +35,7 @@
*
* Based on SunOS 4.x version. This version has minor changes:
* - general SVR4 porting stuff
- * - change name and prefixes from "nit" buffer to streams buffer
+ * - change name and prefixes from "nit" buffer to streams buffer
* - multithreading assumes configured as D_MTQPAIR
*/
@@ -87,12 +87,8 @@ static int pfopen(queue_t *, dev_t *, int, int, cred_t *);
static int pfclose(queue_t *, int, cred_t *);
static void pfioctl(queue_t *wq, mblk_t *mp);
static int FilterPacket(struct packdesc *, struct epacketfilt *);
-/*
- * To save instructions, since STREAMS ignores the return value
- * from these functions, they are defined as void here. Kind of icky, but...
- */
-static void pfwput(queue_t *, mblk_t *);
-static void pfrput(queue_t *, mblk_t *);
+static int pfwput(queue_t *, mblk_t *);
+static int pfrput(queue_t *, mblk_t *);
static struct module_info pf_minfo = {
22, /* mi_idnum */
@@ -104,7 +100,7 @@ static struct module_info pf_minfo = {
};
static struct qinit pf_rinit = {
- (int (*)())pfrput, /* qi_putp */
+ pfrput, /* qi_putp */
NULL,
pfopen, /* qi_qopen */
pfclose, /* qi_qclose */
@@ -114,7 +110,7 @@ static struct qinit pf_rinit = {
};
static struct qinit pf_winit = {
- (int (*)())pfwput, /* qi_putp */
+ pfwput, /* qi_putp */
NULL, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
@@ -207,7 +203,7 @@ pfclose(queue_t *rq, int flags __unused, cred_t *credp __unused)
* Write-side put procedure. Its main task is to detect ioctls.
* Other message types are passed on through.
*/
-static void
+static int
pfwput(queue_t *wq, mblk_t *mp)
{
switch (mp->b_datap->db_type) {
@@ -219,6 +215,7 @@ pfwput(queue_t *wq, mblk_t *mp)
putnext(wq, mp);
break;
}
+ return (0);
}
/*
@@ -230,7 +227,7 @@ pfwput(queue_t *wq, mblk_t *mp)
* which are skipped over before executing the packet filter
* on any remaining M_DATA mblks.
*/
-static void
+static int
pfrput(queue_t *rq, mblk_t *mp)
{
struct epacketfilt *pfp = (struct epacketfilt *)rq->q_ptr;
@@ -308,7 +305,7 @@ pfrput(queue_t *rq, mblk_t *mp)
if (mbp) {
pd.pd_body = (ushort_t *)mbp->b_rptr;
pd.pd_bodylen = (mbp->b_wptr - mbp->b_rptr) /
- sizeof (ushort_t);
+ sizeof (ushort_t);
} else {
pd.pd_body = NULL;
pd.pd_bodylen = 0;
@@ -328,7 +325,7 @@ pfrput(queue_t *rq, mblk_t *mp)
putnext(rq, mp);
break;
}
-
+ return (0);
}
/*
diff --git a/usr/src/uts/common/io/ptem.c b/usr/src/uts/common/io/ptem.c
index e4dc15a3ac..6497465b61 100644
--- a/usr/src/uts/common/io/ptem.c
+++ b/usr/src/uts/common/io/ptem.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
@@ -97,9 +97,9 @@ _info(struct modinfo *modinfop)
*/
static int ptemopen(queue_t *, dev_t *, int, int, cred_t *);
static int ptemclose(queue_t *, int, cred_t *);
-static void ptemrput(queue_t *, mblk_t *);
-static void ptemwput(queue_t *, mblk_t *);
-static void ptemwsrv(queue_t *);
+static int ptemrput(queue_t *, mblk_t *);
+static int ptemwput(queue_t *, mblk_t *);
+static int ptemwsrv(queue_t *);
static struct module_info ptem_info = {
0xabcd,
@@ -111,7 +111,7 @@ static struct module_info ptem_info = {
};
static struct qinit ptemrinit = {
- (int (*)()) ptemrput,
+ ptemrput,
NULL,
ptemopen,
ptemclose,
@@ -121,8 +121,8 @@ static struct qinit ptemrinit = {
};
static struct qinit ptemwinit = {
- (int (*)()) ptemwput,
- (int (*)()) ptemwsrv,
+ ptemwput,
+ ptemwsrv,
ptemopen,
ptemclose,
nulldev,
@@ -267,7 +267,7 @@ ptemclose(queue_t *q, int flag, cred_t *credp)
*
* This is called from the module or driver downstream.
*/
-static void
+static int
ptemrput(queue_t *q, mblk_t *mp)
{
struct iocblk *iocp; /* M_IOCTL data */
@@ -425,6 +425,7 @@ ptemrput(queue_t *q, mblk_t *mp)
putnext(q, mp);
break;
}
+ return (0);
}
@@ -437,7 +438,7 @@ ptemrput(queue_t *q, mblk_t *mp)
* basically just giving up and reporting failure. It really ought to
* set up bufcalls and only fail when it's absolutely necessary.
*/
-static void
+static int
ptemwput(queue_t *q, mblk_t *mp)
{
struct ptem *ntp = (struct ptem *)q->q_ptr;
@@ -514,7 +515,7 @@ ptemwput(queue_t *q, mblk_t *mp)
putnext(q, mp);
break;
}
- return;
+ return (0);
}
/*
* If our queue is nonempty or flow control persists
@@ -546,13 +547,13 @@ ptemwput(queue_t *q, mblk_t *mp)
*/
default:
(void) ptemwmsg(q, mp);
- return;
+ return (0);
}
break;
case M_DELAY: /* tty delays not supported */
freemsg(mp);
- return;
+ return (0);
case M_DATA:
if ((mp->b_wptr - mp->b_rptr) < 0) {
@@ -560,28 +561,29 @@ ptemwput(queue_t *q, mblk_t *mp)
* Free all bad length messages.
*/
freemsg(mp);
- return;
+ return (0);
} else if ((mp->b_wptr - mp->b_rptr) == 0) {
if (!(ntp->state & IS_PTSTTY)) {
freemsg(mp);
- return;
+ return (0);
}
}
}
(void) putq(q, mp);
- return;
+ return (0);
}
/*
* fast path into ptemwmsg to dispose of mp.
*/
if (!ptemwmsg(q, mp))
(void) putq(q, mp);
+ return (0);
}
/*
* ptem write queue service procedure.
*/
-static void
+static int
ptemwsrv(queue_t *q)
{
mblk_t *mp;
@@ -592,6 +594,7 @@ ptemwsrv(queue_t *q)
break;
}
}
+ return (0);
}
diff --git a/usr/src/uts/common/io/vioif/vioif.c b/usr/src/uts/common/io/vioif/vioif.c
index 201e84e11b..a97dd9deca 100644
--- a/usr/src/uts/common/io/vioif/vioif.c
+++ b/usr/src/uts/common/io/vioif/vioif.c
@@ -1725,7 +1725,6 @@ vioif_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
dev_err(dip, CE_WARN, "!MAC unregister failed (%d)", r);
return (DDI_FAILURE);
}
- mac_free(vif->vif_macp);
/*
* Shut down the device so that we can recover any previously
@@ -1743,9 +1742,13 @@ vioif_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
vioif_rxbuf_free(vif, rb);
}
- (void) virtio_fini(vif->vif_virtio, B_FALSE);
-
+ /*
+ * vioif_free_bufs() must be called before virtio_fini()
+ * as it uses virtio_chain_free() which itself depends on some
+ * virtio data structures still being around.
+ */
vioif_free_bufs(vif);
+ (void) virtio_fini(vif->vif_virtio, B_FALSE);
mutex_exit(&vif->vif_mutex);
mutex_destroy(&vif->vif_mutex);
diff --git a/usr/src/uts/common/io/vioif/vioif.h b/usr/src/uts/common/io/vioif/vioif.h
index 51dbc1acd4..19d8965bd4 100644
--- a/usr/src/uts/common/io/vioif/vioif.h
+++ b/usr/src/uts/common/io/vioif/vioif.h
@@ -342,7 +342,6 @@ struct vioif {
vioif_runstate_t vif_runstate;
mac_handle_t vif_mac_handle;
- mac_register_t *vif_macp;
virtio_queue_t *vif_rx_vq;
virtio_queue_t *vif_tx_vq;
diff --git a/usr/src/uts/common/io/virtio/virtio_main.c b/usr/src/uts/common/io/virtio/virtio_main.c
index be92dacfba..cb81142a53 100644
--- a/usr/src/uts/common/io/virtio/virtio_main.c
+++ b/usr/src/uts/common/io/virtio/virtio_main.c
@@ -81,6 +81,7 @@ static int virtio_interrupts_setup(virtio_t *, int);
static void virtio_interrupts_teardown(virtio_t *);
static void virtio_interrupts_disable_locked(virtio_t *);
static void virtio_queue_free(virtio_queue_t *);
+static void virtio_device_reset_locked(virtio_t *);
/*
* We use the same device access attributes for BAR mapping and access to the
@@ -194,7 +195,7 @@ virtio_fini(virtio_t *vio, boolean_t failed)
*/
virtio_set_status(vio, VIRTIO_STATUS_FAILED);
} else {
- virtio_device_reset(vio);
+ virtio_device_reset_locked(vio);
}
/*
@@ -215,6 +216,7 @@ virtio_fini(virtio_t *vio, boolean_t failed)
/*
* Ensure we have torn down everything we set up.
*/
+ vio->vio_initlevel &= ~VIRTIO_INITLEVEL_SHUTDOWN;
VERIFY0(vio->vio_initlevel);
mutex_exit(&vio->vio_mutex);
diff --git a/usr/src/uts/i86pc/Makefile.rules b/usr/src/uts/i86pc/Makefile.rules
index 1863226fd0..3d3c8131c1 100644
--- a/usr/src/uts/i86pc/Makefile.rules
+++ b/usr/src/uts/i86pc/Makefile.rules
@@ -262,7 +262,8 @@ DBOOT_MACH_32 = -D_BOOT_TARGET_i386
DBOOT_MACH_64 = -D_BOOT_TARGET_amd64
DBOOT_DEFS = -D_BOOT $(DBOOT_MACH_$(CLASS))
DBOOT_DEFS += -D_MACHDEP -U_KERNEL -D_I32LPx
-DBOOT_FLAGS = $(CCVERBOSE) $(CSTD) $(CERRWARN) $(CCNOAUTOINLINE)
+DBOOT_FLAGS = $(CFLAGS_XARCH_32) $(CCVERBOSE) $(CSTD) $(CERRWARN)
+DBOOT_FLAGS += $(CCNOAUTOINLINE)
DBOOT_CC_INCL = -I$(SRC)/common -I$(SRC)/common/util $(INCLUDE_PATH)
DBOOT_AS_INCL = $(AS_INC_PATH)