diff options
Diffstat (limited to 'usr/src/uts')
55 files changed, 784 insertions, 689 deletions
diff --git a/usr/src/uts/common/fs/zfs/zvol.c b/usr/src/uts/common/fs/zfs/zvol.c index 3ed5977c20..2e684a5ff0 100644 --- a/usr/src/uts/common/fs/zfs/zvol.c +++ b/usr/src/uts/common/fs/zfs/zvol.c @@ -24,7 +24,7 @@ * Portions Copyright 2010 Robert Milkowski * * Copyright 2017 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2017 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2019 Joyent, Inc. */ @@ -1499,7 +1499,7 @@ zvol_write(dev_t dev, uio_t *uio, cred_t *cr) bytes = volsize - off; tot_bytes += bytes; - dmu_tx_hold_write(tx, ZVOL_OBJ, off, bytes); + dmu_tx_hold_write_by_dnode(tx, zv->zv_dn, off, bytes); error = dmu_tx_assign(tx, TXG_WAIT); if (error) { dmu_tx_abort(tx); diff --git a/usr/src/uts/common/inet/cc/cc_cubic.c b/usr/src/uts/common/inet/cc/cc_cubic.c index 11c238afd8..bb26a2358d 100644 --- a/usr/src/uts/common/inet/cc/cc_cubic.c +++ b/usr/src/uts/common/inet/cc/cc_cubic.c @@ -4,6 +4,7 @@ * All rights reserved. * Copyright (c) 2017 by Delphix. All rights reserved. * Copyright 2019 Joyent, Inc. + * Copyright 2020 RackTop Systems, Inc. * * This software was developed by Lawrence Stewart while studying at the Centre * for Advanced Internet Architectures, Swinburne University of Technology, made @@ -85,6 +86,7 @@ static void cubic_conn_init(struct cc_var *ccv); static void cubic_post_recovery(struct cc_var *ccv); static void cubic_record_rtt(struct cc_var *ccv); static void cubic_ssthresh_update(struct cc_var *ccv); +static void cubic_after_idle(struct cc_var *ccv); struct cubic { /* Cubic K in fixed point form with CUBIC_SHIFT worth of precision. */ @@ -115,6 +117,7 @@ struct cc_algo cubic_cc_algo = { .cong_signal = cubic_cong_signal, .conn_init = cubic_conn_init, .post_recovery = cubic_post_recovery, + .after_idle = cubic_after_idle, }; int @@ -129,7 +132,7 @@ _init(void) if ((err = mod_install(&cc_cubic_modlinkage)) != 0) (void) cc_deregister_algo(&cubic_cc_algo); } - cubic_cc_algo.after_idle = newreno_cc_algo->after_idle; + return (err); } @@ -195,19 +198,22 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * TCP-friendly region, follow tf * cwnd growth. */ - CCV(ccv, tcp_cwnd) = w_tf; + if (CCV(ccv, tcp_cwnd) < w_tf) + CCV(ccv, tcp_cwnd) = w_tf; } else if (CCV(ccv, tcp_cwnd) < w_cubic_next) { /* * Concave or convex region, follow CUBIC * cwnd growth. */ if (CC_ABC(ccv)) - CCV(ccv, tcp_cwnd) = w_cubic_next; + CCV(ccv, tcp_cwnd) = MIN(w_cubic_next, + INT_MAX); else - CCV(ccv, tcp_cwnd) += ((w_cubic_next - + CCV(ccv, tcp_cwnd) += MAX(1, + ((MIN(w_cubic_next, INT_MAX) - CCV(ccv, tcp_cwnd)) * CCV(ccv, tcp_mss)) / - CCV(ccv, tcp_cwnd); + CCV(ccv, tcp_cwnd)); } /* @@ -218,12 +224,34 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * max_cwnd. */ if (cubic_data->num_cong_events == 0 && - cubic_data->max_cwnd < CCV(ccv, tcp_cwnd)) + cubic_data->max_cwnd < CCV(ccv, tcp_cwnd)) { cubic_data->max_cwnd = CCV(ccv, tcp_cwnd); + cubic_data->K = cubic_k(cubic_data->max_cwnd / + CCV(ccv, tcp_mss)); + } } } } +/* + * This is a Cubic specific implementation of after_idle. + * - Reset cwnd by calling New Reno implementation of after_idle. + * - Reset t_last_cong. + */ +static void +cubic_after_idle(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + cubic_data->max_cwnd = max(cubic_data->max_cwnd, CCV(ccv, tcp_cwnd)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, tcp_mss)); + + newreno_cc_algo->after_idle(ccv); + cubic_data->t_last_cong = gethrtime(); +} + static void cubic_cb_destroy(struct cc_var *ccv) { @@ -237,7 +265,7 @@ cubic_cb_init(struct cc_var *ccv) { struct cubic *cubic_data; - cubic_data = kmem_alloc(sizeof (struct cubic), KM_NOSLEEP); + cubic_data = kmem_zalloc(sizeof (struct cubic), KM_NOSLEEP); if (cubic_data == NULL) return (ENOMEM); @@ -330,6 +358,7 @@ static void cubic_post_recovery(struct cc_var *ccv) { struct cubic *cubic_data; + uint32_t mss, pipe; cubic_data = ccv->cc_data; @@ -339,11 +368,39 @@ cubic_post_recovery(struct cc_var *ccv) >> CUBIC_SHIFT; } + /* + * There is a risk that if the cwnd becomes less than mss, and + * we do not get enough acks to drive it back up beyond mss, + * we will stop transmitting data altogether. + * + * The Cubic RFC defines values in terms of units of mss. Therefore + * we must make sure we have at least 1 mss to make progress + * since the algorthm is written that way. + */ + mss = CCV(ccv, tcp_mss); + if (IN_FASTRECOVERY(ccv->flags)) { - /* Update cwnd based on beta and adjusted max_cwnd. */ - CCV(ccv, tcp_cwnd) = max(1, ((CUBIC_BETA * - cubic_data->max_cwnd) >> CUBIC_SHIFT)); + /* + * If inflight data is less than ssthresh, set cwnd + * conservatively to avoid a burst of data, as suggested in + * the NewReno RFC. Otherwise, use the CUBIC method. + */ + pipe = CCV(ccv, tcp_snxt) - CCV(ccv, tcp_suna); + if (pipe < CCV(ccv, tcp_cwnd_ssthresh)) { + /* + * Ensure that cwnd does not collapse to 1 MSS under + * adverse conditions. Implements RFC6582 + */ + CCV(ccv, tcp_cwnd) = MAX(pipe, mss) + mss; + } else { + /* Update cwnd based on beta and adjusted max_cwnd. */ + CCV(ccv, tcp_cwnd) = max(mss, ((CUBIC_BETA * + cubic_data->max_cwnd) >> CUBIC_SHIFT)); + } + } else { + CCV(ccv, tcp_cwnd) = max(mss, CCV(ccv, tcp_cwnd)); } + cubic_data->t_last_cong = gethrtime(); /* Calculate the average RTT between congestion epochs. */ @@ -355,7 +412,7 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->epoch_ack_count = 0; cubic_data->sum_rtt_nsecs = 0; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, tcp_mss)); + cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); } /* diff --git a/usr/src/uts/common/inet/cc/cc_cubic.h b/usr/src/uts/common/inet/cc/cc_cubic.h index c87751d257..cc6e6e459a 100644 --- a/usr/src/uts/common/inet/cc/cc_cubic.h +++ b/usr/src/uts/common/inet/cc/cc_cubic.h @@ -4,6 +4,7 @@ * All rights reserved. * Copyright (c) 2017 by Delphix. All rights reserved. * Copyright 2019 Joyent, Inc. + * Copyright 2020 RackTop Systems, Inc. * * This software was developed by Lawrence Stewart while studying at the Centre * for Advanced Internet Architectures, Swinburne University of Technology, made @@ -70,6 +71,12 @@ /* Don't trust s_rtt until this many rtt samples have been taken. */ #define CUBIC_MIN_RTT_SAMPLES 8 +/* + * (2^21)^3 is long max. Dividing (2^63) by Cubic_C_factor + * and taking cube-root yields 448845 as the effective useful limit + */ +#define CUBED_ROOT_MAX_ULONG 448845 + /* Userland only bits. */ #ifndef _KERNEL @@ -188,6 +195,11 @@ cubic_cwnd(hrtime_t nsecs_since_cong, uint32_t wmax, uint32_t smss, int64_t K) */ cwnd = (t - K * MILLISEC) / MILLISEC; + if (cwnd > CUBED_ROOT_MAX_ULONG) + return (INT_MAX); + if (cwnd < -CUBED_ROOT_MAX_ULONG) + return (0); + /* cwnd = (t - K)^3, with CUBIC_SHIFT^3 worth of precision. */ cwnd *= (cwnd * cwnd); @@ -199,7 +211,10 @@ cubic_cwnd(hrtime_t nsecs_since_cong, uint32_t wmax, uint32_t smss, int64_t K) */ cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; - return ((uint32_t)cwnd); + /* + * for negative cwnd, limiting to zero as lower bound + */ + return (max(0, cwnd)); } /* diff --git a/usr/src/uts/common/inet/cc/cc_newreno.c b/usr/src/uts/common/inet/cc/cc_newreno.c index ceb76d8643..5cb1c32534 100644 --- a/usr/src/uts/common/inet/cc/cc_newreno.c +++ b/usr/src/uts/common/inet/cc/cc_newreno.c @@ -7,6 +7,7 @@ * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * Copyright (c) 2017 by Delphix. All rights reserved. + * Copyright 2020 RackTop Systems, Inc. * * This software was developed at the Centre for Advanced Internet * Architectures, Swinburne University of Technology, by Lawrence Stewart, James @@ -256,12 +257,25 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) static void newreno_post_recovery(struct cc_var *ccv) { + uint32_t pipe; + if (IN_FASTRECOVERY(ccv->flags)) { /* * Fast recovery will conclude after returning from this - * function. + * function. Window inflation should have left us with + * approximately cwnd_ssthresh outstanding data. But in case we + * would be inclined to send a burst, better to do it via the + * slow start mechanism. */ - if (CCV(ccv, tcp_cwnd) > CCV(ccv, tcp_cwnd_ssthresh)) { + pipe = CCV(ccv, tcp_snxt) - CCV(ccv, tcp_suna); + if (pipe < CCV(ccv, tcp_cwnd_ssthresh)) { + /* + * Ensure that cwnd does not collapse to 1 MSS under + * adverse conditions. Implements RFC6582 + */ + CCV(ccv, tcp_cwnd) = MAX(pipe, CCV(ccv, tcp_mss)) + + CCV(ccv, tcp_mss); + } else if (CCV(ccv, tcp_cwnd) > CCV(ccv, tcp_cwnd_ssthresh)) { CCV(ccv, tcp_cwnd) = CCV(ccv, tcp_cwnd_ssthresh); } } diff --git a/usr/src/uts/common/io/audio/impl/audio_grc3.h b/usr/src/uts/common/io/audio/impl/audio_grc3.h index 0003dc1574..4472307edf 100644 --- a/usr/src/uts/common/io/audio/impl/audio_grc3.h +++ b/usr/src/uts/common/io/audio/impl/audio_grc3.h @@ -53,7 +53,7 @@ typedef struct grc3state { int32_t *historyptr; int32_t dummy_pad1; - int32_t history[GRC3_MAXHISTORY * 2]; + int32_t history[GRC3_MAXHISTORY * 2 + 1]; uint32_t outsz; } grc3state_t; diff --git a/usr/src/uts/common/io/bge/bge_chip2.c b/usr/src/uts/common/io/bge/bge_chip2.c index 14797ac90f..48d7ed0e0a 100644 --- a/usr/src/uts/common/io/bge/bge_chip2.c +++ b/usr/src/uts/common/io/bge/bge_chip2.c @@ -1005,8 +1005,8 @@ bge_nic_get64(bge_t *bgep, bge_regno_t addr) #elif defined(__sparc) if (DEVICE_5723_SERIES_CHIPSETS(bgep) || DEVICE_5717_SERIES_CHIPSETS(bgep) || - DEVICE_5725_SERIES_CHIPSETS(bgep || - DEVICE_57765_SERIES_CHIPSETS(bgep))) { + DEVICE_5725_SERIES_CHIPSETS(bgep) || + DEVICE_57765_SERIES_CHIPSETS(bgep)) { data = ddi_get32(bgep->io_handle, PIO_ADDR(bgep, addr)); data <<= 32; data |= ddi_get32(bgep->io_handle, diff --git a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c index 1b66e80a22..60587bcdf6 100644 --- a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c +++ b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c @@ -56,9 +56,9 @@ extern sbd_status_t sbd_pgr_meta_init(sbd_lu_t *sl); extern sbd_status_t sbd_pgr_meta_load(sbd_lu_t *sl); extern void sbd_pgr_reset(sbd_lu_t *sl); -extern int HardwareAcceleratedLocking; -extern int HardwareAcceleratedInit; -extern int HardwareAcceleratedMove; +extern uint8_t HardwareAcceleratedLocking; +extern uint8_t HardwareAcceleratedInit; +extern uint8_t HardwareAcceleratedMove; extern uint8_t sbd_unmap_enable; static int sbd_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, diff --git a/usr/src/uts/common/io/mlxcx/mlxcx.c b/usr/src/uts/common/io/mlxcx/mlxcx.c index c90fa0969b..9fae7c5f77 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx.c @@ -273,11 +273,16 @@ * before making a WQE for it. * * After a completion event occurs, the packet is either discarded (and the - * buffer_t returned to the free list), or it is readied for loaning to MAC. + * buffer_t returned to the free list), or it is readied for loaning to MAC + * and placed on the "loaned" list in the mlxcx_buffer_shard_t. * * Once MAC and the rest of the system have finished with the packet, they call - * freemsg() on its mblk, which will call mlxcx_buf_mp_return and return the - * buffer_t to the free list. + * freemsg() on its mblk, which will call mlxcx_buf_mp_return. At this point + * the fate of the buffer_t is determined by the state of the + * mlxcx_buffer_shard_t. When the shard is in its normal state the buffer_t + * will be returned to the free list, potentially to be recycled and used + * again. But if the shard is draining (E.g. after a ring stop) there will be + * no recycling and the buffer_t is immediately destroyed. * * At detach/teardown time, buffers are only every destroyed from the free list. * @@ -289,18 +294,18 @@ * v * +----+----+ * | created | - * +----+----+ - * | - * | - * | mlxcx_buf_return - * | - * v - * mlxcx_buf_destroy +----+----+ - * +---------| free |<---------------+ - * | +----+----+ | + * +----+----+ +------+ + * | | dead | + * | +------+ + * | mlxcx_buf_return ^ + * | | + * v | mlxcx_buf_destroy + * mlxcx_buf_destroy +----+----+ +-----------+ | + * +---------| free |<------no-| draining? |-yes-+ + * | +----+----+ +-----------+ + * | | ^ * | | | - * | | | mlxcx_buf_return - * v | mlxcx_buf_take | + * v | mlxcx_buf_take | mlxcx_buf_return * +---+--+ v | * | dead | +---+---+ | * +------+ | on WQ |- - - - - - - - >O @@ -759,13 +764,19 @@ mlxcx_mlbs_teardown(mlxcx_t *mlxp, mlxcx_buf_shard_t *s) mlxcx_buffer_t *buf; mutex_enter(&s->mlbs_mtx); + while (!list_is_empty(&s->mlbs_busy)) cv_wait(&s->mlbs_free_nonempty, &s->mlbs_mtx); - while ((buf = list_head(&s->mlbs_free)) != NULL) { + + while (!list_is_empty(&s->mlbs_loaned)) + cv_wait(&s->mlbs_free_nonempty, &s->mlbs_mtx); + + while ((buf = list_head(&s->mlbs_free)) != NULL) mlxcx_buf_destroy(mlxp, buf); - } + list_destroy(&s->mlbs_free); list_destroy(&s->mlbs_busy); + list_destroy(&s->mlbs_loaned); mutex_exit(&s->mlbs_mtx); cv_destroy(&s->mlbs_free_nonempty); @@ -1336,6 +1347,8 @@ mlxcx_mlbs_create(mlxcx_t *mlxp) offsetof(mlxcx_buffer_t, mlb_entry)); list_create(&s->mlbs_free, sizeof (mlxcx_buffer_t), offsetof(mlxcx_buffer_t, mlb_entry)); + list_create(&s->mlbs_loaned, sizeof (mlxcx_buffer_t), + offsetof(mlxcx_buffer_t, mlb_entry)); cv_init(&s->mlbs_free_nonempty, NULL, CV_DRIVER, NULL); list_insert_tail(&mlxp->mlx_buf_shards, s); diff --git a/usr/src/uts/common/io/mlxcx/mlxcx.h b/usr/src/uts/common/io/mlxcx/mlxcx.h index bf07691095..52240df3a3 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx.h +++ b/usr/src/uts/common/io/mlxcx/mlxcx.h @@ -424,11 +424,18 @@ typedef enum { MLXCX_BUFFER_ON_CHAIN, } mlxcx_buffer_state_t; +typedef enum { + MLXCX_SHARD_READY, + MLXCX_SHARD_DRAINING, +} mlxcx_shard_state_t; + typedef struct mlxcx_buf_shard { + mlxcx_shard_state_t mlbs_state; list_node_t mlbs_entry; kmutex_t mlbs_mtx; list_t mlbs_busy; list_t mlbs_free; + list_t mlbs_loaned; kcondvar_t mlbs_free_nonempty; } mlxcx_buf_shard_t; @@ -1171,9 +1178,11 @@ extern boolean_t mlxcx_buf_loan(mlxcx_t *, mlxcx_buffer_t *); extern void mlxcx_buf_return(mlxcx_t *, mlxcx_buffer_t *); extern void mlxcx_buf_return_chain(mlxcx_t *, mlxcx_buffer_t *, boolean_t); extern void mlxcx_buf_destroy(mlxcx_t *, mlxcx_buffer_t *); +extern void mlxcx_shard_ready(mlxcx_buf_shard_t *); +extern void mlxcx_shard_draining(mlxcx_buf_shard_t *); -extern mlxcx_buffer_t *mlxcx_buf_bind_or_copy(mlxcx_t *, mlxcx_work_queue_t *, - mblk_t *, size_t); +extern uint_t mlxcx_buf_bind_or_copy(mlxcx_t *, mlxcx_work_queue_t *, + mblk_t *, size_t, mlxcx_buffer_t **); extern boolean_t mlxcx_rx_group_setup(mlxcx_t *, mlxcx_ring_group_t *); extern boolean_t mlxcx_tx_group_setup(mlxcx_t *, mlxcx_ring_group_t *); diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c index a1d50659c1..5d15ec1fbb 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c @@ -395,6 +395,7 @@ mlxcx_mac_ring_tx(void *arg, mblk_t *mp) uint32_t chkflags = 0; boolean_t ok; size_t take = 0; + uint_t bcount; VERIFY(mp->b_next == NULL); @@ -430,8 +431,8 @@ mlxcx_mac_ring_tx(void *arg, mblk_t *mp) } } - b = mlxcx_buf_bind_or_copy(mlxp, sq, kmp, take); - if (b == NULL) { + bcount = mlxcx_buf_bind_or_copy(mlxp, sq, kmp, take, &b); + if (bcount == 0) { atomic_or_uint(&sq->mlwq_state, MLXCX_WQ_BLOCKED_MAC); return (mp); } @@ -450,17 +451,20 @@ mlxcx_mac_ring_tx(void *arg, mblk_t *mp) return (NULL); } - if (sq->mlwq_state & MLXCX_WQ_TEARDOWN) { + if ((sq->mlwq_state & (MLXCX_WQ_TEARDOWN | MLXCX_WQ_STARTED)) != + MLXCX_WQ_STARTED) { mutex_exit(&sq->mlwq_mtx); mlxcx_buf_return_chain(mlxp, b, B_FALSE); return (NULL); } /* - * Similar logic here: bufcnt is only manipulated atomically, and - * bufhwm is set at startup. + * If the completion queue buffer count is already at or above + * the high water mark, or the addition of this new chain will + * exceed the CQ ring size, then indicate we are blocked. */ - if (cq->mlcq_bufcnt >= cq->mlcq_bufhwm) { + if (cq->mlcq_bufcnt >= cq->mlcq_bufhwm || + (cq->mlcq_bufcnt + bcount) > cq->mlcq_nents) { atomic_or_uint(&cq->mlcq_state, MLXCX_CQ_BLOCKED_MAC); goto blocked; } @@ -722,8 +726,28 @@ mlxcx_mac_ring_stop(mac_ring_driver_t rh) mlxcx_buf_shard_t *s; mlxcx_buffer_t *buf; + /* + * To prevent deadlocks and sleeping whilst holding either the + * CQ mutex or WQ mutex, we split the stop processing into two + * parts. + * + * With the CQ amd WQ mutexes held the appropriate WQ is stopped. + * The Q in the HCA is set to Reset state and flagged as no + * longer started. Atomic with changing this WQ state, the buffer + * shards are flagged as draining. + * + * Now, any requests for buffers and attempts to submit messages + * will fail and once we're in this state it is safe to relinquish + * the CQ and WQ mutexes. Allowing us to complete the ring stop + * by waiting for the buffer lists, with the exception of + * the loaned list, to drain. Buffers on the loaned list are + * not under our control, we will get them back when the mblk tied + * to the buffer is freed. + */ + mutex_enter(&cq->mlcq_mtx); mutex_enter(&wq->mlwq_mtx); + if (wq->mlwq_state & MLXCX_WQ_STARTED) { if (wq->mlwq_type == MLXCX_WQ_TYPE_RECVQ && !mlxcx_cmd_stop_rq(mlxp, wq)) { @@ -740,7 +764,15 @@ mlxcx_mac_ring_stop(mac_ring_driver_t rh) } ASSERT0(wq->mlwq_state & MLXCX_WQ_STARTED); + mlxcx_shard_draining(wq->mlwq_bufs); + if (wq->mlwq_foreign_bufs != NULL) + mlxcx_shard_draining(wq->mlwq_foreign_bufs); + + if (wq->mlwq_state & MLXCX_WQ_BUFFERS) { + mutex_exit(&wq->mlwq_mtx); + mutex_exit(&cq->mlcq_mtx); + /* Return any outstanding buffers to the free pool. */ while ((buf = list_remove_head(&cq->mlcq_buffers)) != NULL) { mlxcx_buf_return_chain(mlxp, buf, B_FALSE); @@ -772,12 +804,13 @@ mlxcx_mac_ring_stop(mac_ring_driver_t rh) mutex_exit(&s->mlbs_mtx); } + mutex_enter(&wq->mlwq_mtx); wq->mlwq_state &= ~MLXCX_WQ_BUFFERS; + mutex_exit(&wq->mlwq_mtx); + } else { + mutex_exit(&wq->mlwq_mtx); + mutex_exit(&cq->mlcq_mtx); } - ASSERT0(wq->mlwq_state & MLXCX_WQ_BUFFERS); - - mutex_exit(&wq->mlwq_mtx); - mutex_exit(&cq->mlcq_mtx); } static int @@ -1134,7 +1167,8 @@ mlxcx_mac_setprop(void *arg, const char *pr_name, mac_prop_id_t pr_num, for (; sh != NULL; sh = list_next(&mlxp->mlx_buf_shards, sh)) { mutex_enter(&sh->mlbs_mtx); if (!list_is_empty(&sh->mlbs_free) || - !list_is_empty(&sh->mlbs_busy)) { + !list_is_empty(&sh->mlbs_busy) || + !list_is_empty(&sh->mlbs_loaned)) { allocd = B_TRUE; mutex_exit(&sh->mlbs_mtx); break; diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_reg.h b/usr/src/uts/common/io/mlxcx/mlxcx_reg.h index f65280d41d..6d09abea5c 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_reg.h +++ b/usr/src/uts/common/io/mlxcx/mlxcx_reg.h @@ -390,8 +390,16 @@ typedef enum { MLXCX_WQE_OP_RDMA_R = 0x10, } mlxcx_wqe_opcode_t; +#define MLXCX_WQE_OCTOWORD 16 #define MLXCX_SQE_MAX_DS ((1 << 6) - 1) -#define MLXCX_SQE_MAX_PTRS 61 +/* + * Calculate the max number of address pointers in a single ethernet + * send message. This is the remainder from MLXCX_SQE_MAX_DS + * after accounting for the Control and Ethernet segements. + */ +#define MLXCX_SQE_MAX_PTRS (MLXCX_SQE_MAX_DS - \ + (sizeof (mlxcx_wqe_eth_seg_t) + sizeof (mlxcx_wqe_control_seg_t)) / \ + MLXCX_WQE_OCTOWORD) typedef enum { MLXCX_SQE_FENCE_NONE = 0x0, @@ -2497,6 +2505,8 @@ typedef struct { #pragma pack() +CTASSERT(MLXCX_SQE_MAX_PTRS > 0); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_ring.c b/usr/src/uts/common/io/mlxcx/mlxcx_ring.c index 2305f943a7..da98a5cf40 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_ring.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_ring.c @@ -25,6 +25,7 @@ #include <sys/sysmacros.h> #include <sys/atomic.h> #include <sys/cpuvar.h> +#include <sys/sdt.h> #include <sys/pattr.h> #include <sys/dlpi.h> @@ -1212,6 +1213,8 @@ mlxcx_rx_ring_start(mlxcx_t *mlxp, mlxcx_ring_group_t *g, ASSERT0(rq->mlwq_state & MLXCX_WQ_BUFFERS); rq->mlwq_state |= MLXCX_WQ_BUFFERS; + mlxcx_shard_ready(rq->mlwq_bufs); + for (j = 0; j < rq->mlwq_nents; ++j) { if (!mlxcx_buf_create(mlxp, rq->mlwq_bufs, &b)) break; @@ -1408,6 +1411,9 @@ mlxcx_tx_ring_start(mlxcx_t *mlxp, mlxcx_ring_group_t *g, } sq->mlwq_state |= MLXCX_WQ_BUFFERS; + mlxcx_shard_ready(sq->mlwq_bufs); + mlxcx_shard_ready(sq->mlwq_foreign_bufs); + if (!mlxcx_cmd_start_sq(mlxp, sq)) { mutex_exit(&sq->mlwq_mtx); mutex_exit(&cq->mlcq_mtx); @@ -1567,8 +1573,8 @@ mlxcx_sq_add_buffer(mlxcx_t *mlxp, mlxcx_work_queue_t *mlwq, inlinelen); } - ent0->mlsqe_control.mlcs_ds = - offsetof(mlxcx_sendq_ent_t, mlsqe_data) / 16; + ent0->mlsqe_control.mlcs_ds = offsetof(mlxcx_sendq_ent_t, mlsqe_data) / + MLXCX_WQE_OCTOWORD; if (chkflags & HCK_IPV4_HDRCKSUM) { ASSERT(mlxp->mlx_caps->mlc_checksum); @@ -1653,7 +1659,20 @@ mlxcx_sq_add_buffer(mlxcx_t *mlxp, mlxcx_work_queue_t *mlwq, /* * Make sure the workqueue entry is flushed out before updating * the doorbell. + * If the ring has wrapped, we need to flush the front and back. */ + if ((first + ents) > mlwq->mlwq_nents) { + uint_t sync_cnt = mlwq->mlwq_nents - first; + + VERIFY0(ddi_dma_sync(mlwq->mlwq_dma.mxdb_dma_handle, + (uintptr_t)ent0 - (uintptr_t)mlwq->mlwq_send_ent, + sync_cnt * sizeof (mlxcx_sendq_ent_t), + DDI_DMA_SYNC_FORDEV)); + + ent0 = &mlwq->mlwq_send_ent[0]; + ents -= sync_cnt; + } + VERIFY0(ddi_dma_sync(mlwq->mlwq_dma.mxdb_dma_handle, (uintptr_t)ent0 - (uintptr_t)mlwq->mlwq_send_ent, ents * sizeof (mlxcx_sendq_ent_t), DDI_DMA_SYNC_FORDEV)); @@ -1785,22 +1804,29 @@ mlxcx_rq_refill_task(void *arg) mlxcx_completion_queue_t *cq = wq->mlwq_cq; mlxcx_t *mlxp = wq->mlwq_mlx; mlxcx_buf_shard_t *s = wq->mlwq_bufs; - boolean_t refill; + boolean_t refill, draining; do { /* - * Wait until there are some free buffers. + * Wait here until one of 3 conditions: + * 1. The shard is draining, or + * 2. There are buffers on the free list, or + * 3. The WQ is being shut down. */ mutex_enter(&s->mlbs_mtx); - while (list_is_empty(&s->mlbs_free) && - (cq->mlcq_state & MLXCX_CQ_TEARDOWN) == 0) + while (s->mlbs_state != MLXCX_SHARD_DRAINING && + list_is_empty(&s->mlbs_free) && + (cq->mlcq_state & MLXCX_CQ_TEARDOWN) == 0) { cv_wait(&s->mlbs_free_nonempty, &s->mlbs_mtx); + } + + draining = (s->mlbs_state == MLXCX_SHARD_DRAINING); mutex_exit(&s->mlbs_mtx); mutex_enter(&cq->mlcq_mtx); mutex_enter(&wq->mlwq_mtx); - if ((cq->mlcq_state & MLXCX_CQ_TEARDOWN) != 0) { + if (draining || (cq->mlcq_state & MLXCX_CQ_TEARDOWN) != 0) { refill = B_FALSE; wq->mlwq_state &= ~MLXCX_WQ_REFILLING; } else { @@ -1837,7 +1863,10 @@ mlxcx_rq_refill(mlxcx_t *mlxp, mlxcx_work_queue_t *mlwq) target = mlwq->mlwq_nents - MLXCX_RQ_REFILL_STEP; cq = mlwq->mlwq_cq; - if (cq->mlcq_state & MLXCX_CQ_TEARDOWN) + if ((mlwq->mlwq_state & MLXCX_WQ_STARTED) == 0) + return; + + if ((cq->mlcq_state & MLXCX_CQ_TEARDOWN) != 0) return; current = cq->mlcq_bufcnt; @@ -1869,7 +1898,7 @@ mlxcx_rq_refill(mlxcx_t *mlxp, mlxcx_work_queue_t *mlwq) return; } - if (mlwq->mlwq_state & MLXCX_WQ_TEARDOWN) { + if ((mlwq->mlwq_state & MLXCX_WQ_TEARDOWN) != 0) { for (i = 0; i < n; ++i) mlxcx_buf_return(mlxp, b[i]); return; @@ -2044,7 +2073,6 @@ mlxcx_rx_completion(mlxcx_t *mlxp, mlxcx_completion_queue_t *mlcq, wqe_index = buf->mlb_wqe_index; if (!mlxcx_buf_loan(mlxp, buf)) { - mlxcx_warn(mlxp, "!loan failed, dropping packet"); mlxcx_buf_return(mlxp, buf); return (NULL); } @@ -2087,16 +2115,11 @@ mlxcx_buf_mp_return(caddr_t arg) mlxcx_buffer_t *b = (mlxcx_buffer_t *)arg; mlxcx_t *mlxp = b->mlb_mlx; - if (b->mlb_state != MLXCX_BUFFER_ON_LOAN) { - b->mlb_mp = NULL; - return; - } - /* - * The mblk for this buffer_t (in its mlb_mp field) has been used now, - * so NULL it out. - */ + /* The mblk has been used now, so NULL it out. */ b->mlb_mp = NULL; - mlxcx_buf_return(mlxp, b); + + if (b->mlb_state == MLXCX_BUFFER_ON_LOAN) + mlxcx_buf_return(mlxp, b); } boolean_t @@ -2163,6 +2186,11 @@ mlxcx_buf_take_foreign(mlxcx_t *mlxp, mlxcx_work_queue_t *wq) mlxcx_buf_shard_t *s = wq->mlwq_foreign_bufs; mutex_enter(&s->mlbs_mtx); + if (s->mlbs_state != MLXCX_SHARD_READY) { + mutex_exit(&s->mlbs_mtx); + return (NULL); + } + if ((b = list_remove_head(&s->mlbs_free)) != NULL) { ASSERT3U(b->mlb_state, ==, MLXCX_BUFFER_FREE); ASSERT(b->mlb_foreign); @@ -2205,58 +2233,64 @@ copyb: return (b); } -mlxcx_buffer_t * -mlxcx_buf_bind_or_copy(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, - mblk_t *mpb, size_t off) +static mlxcx_buffer_t * +mlxcx_bind_or_copy_mblk(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, + mblk_t *mp, size_t off) { - mlxcx_buffer_t *b, *b0 = NULL; - boolean_t first = B_TRUE; - mblk_t *mp; + mlxcx_buffer_t *b; uint8_t *rptr; size_t sz; - size_t ncookies = 0; boolean_t ret; - for (mp = mpb; mp != NULL; mp = mp->b_cont) { - rptr = mp->b_rptr; - sz = MBLKL(mp); + rptr = mp->b_rptr; + sz = MBLKL(mp); - if (off > 0) - ASSERT3U(off, <, sz); - rptr += off; - sz -= off; +#ifdef DEBUG + if (off > 0) { + ASSERT3U(off, <, sz); + } +#endif - if (sz < mlxp->mlx_props.mldp_tx_bind_threshold) { - b = mlxcx_copy_data(mlxp, wq, rptr, sz); - if (b == NULL) - goto failed; - } else { - b = mlxcx_buf_take_foreign(mlxp, wq); - if (b == NULL) - goto failed; + rptr += off; + sz -= off; + + if (sz < mlxp->mlx_props.mldp_tx_bind_threshold) { + b = mlxcx_copy_data(mlxp, wq, rptr, sz); + } else { + b = mlxcx_buf_take_foreign(mlxp, wq); + if (b == NULL) + return (NULL); - ret = mlxcx_dma_bind_mblk(mlxp, &b->mlb_dma, mp, off, - B_FALSE); + ret = mlxcx_dma_bind_mblk(mlxp, &b->mlb_dma, mp, off, + B_FALSE); - if (!ret) { - mlxcx_buf_return(mlxp, b); + if (!ret) { + mlxcx_buf_return(mlxp, b); - b = mlxcx_copy_data(mlxp, wq, rptr, sz); - if (b == NULL) - goto failed; - } + b = mlxcx_copy_data(mlxp, wq, rptr, sz); } + } + + return (b); +} + +uint_t +mlxcx_buf_bind_or_copy(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, + mblk_t *mpb, size_t off, mlxcx_buffer_t **bp) +{ + mlxcx_buffer_t *b, *b0 = NULL; + boolean_t first = B_TRUE; + mblk_t *mp; + size_t offset = off; + size_t ncookies = 0; + uint_t count = 0; + + for (mp = mpb; mp != NULL && ncookies <= MLXCX_SQE_MAX_PTRS; + mp = mp->b_cont) { + b = mlxcx_bind_or_copy_mblk(mlxp, wq, mp, offset); + if (b == NULL) + goto failed; - /* - * We might overestimate here when we've copied data, since - * the buffer might be longer than what we copied into it. This - * is safe since it's always wrong in the conservative - * direction (and we will blow up later when we actually - * generate the WQE anyway). - * - * If the assert below ever blows, we'll have to come and fix - * this up so we can transmit these packets. - */ ncookies += b->mlb_dma.mxdb_ncookies; if (first) @@ -2267,23 +2301,55 @@ mlxcx_buf_bind_or_copy(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, b->mlb_tx_mp = mp; b->mlb_tx_head = b0; - b->mlb_used = sz; + b->mlb_used = MBLKL(mp) - offset; if (!first) list_insert_tail(&b0->mlb_tx_chain, b); first = B_FALSE; - off = 0; + offset = 0; + + count++; + } + + /* + * The chain of mblks has resulted in too many cookies for + * a single message. This is unusual, so take the hit to tidy + * up, do a pullup to a single mblk and allocate the requisite + * buf. + */ + if (ncookies > MLXCX_SQE_MAX_PTRS) { + DTRACE_PROBE4(pullup, mlxcx_t *, mlxp, mlxcx_work_queue_t *, wq, + mblk_t *, mpb, size_t, ncookies); + + if (b0 != NULL) + mlxcx_buf_return_chain(mlxp, b0, B_TRUE); + + if ((mp = msgpullup(mpb, -1)) == NULL) + return (0); + + b0 = mlxcx_bind_or_copy_mblk(mlxp, wq, mp, off); + if (b0 == NULL) { + freemsg(mp); + return (0); + } + freemsg(mpb); + + b0->mlb_tx_mp = mp; + b0->mlb_tx_head = b0; + b0->mlb_used = MBLKL(mp) - off; + + count = 1; } - ASSERT3U(ncookies, <=, MLXCX_SQE_MAX_PTRS); + *bp = b0; - return (b0); + return (count); failed: if (b0 != NULL) mlxcx_buf_return_chain(mlxp, b0, B_TRUE); - return (NULL); + return (0); } mlxcx_buffer_t * @@ -2293,6 +2359,11 @@ mlxcx_buf_take(mlxcx_t *mlxp, mlxcx_work_queue_t *wq) mlxcx_buf_shard_t *s = wq->mlwq_bufs; mutex_enter(&s->mlbs_mtx); + if (s->mlbs_state != MLXCX_SHARD_READY) { + mutex_exit(&s->mlbs_mtx); + return (NULL); + } + if ((b = list_remove_head(&s->mlbs_free)) != NULL) { ASSERT3U(b->mlb_state, ==, MLXCX_BUFFER_FREE); b->mlb_state = MLXCX_BUFFER_ON_WQ; @@ -2314,6 +2385,11 @@ mlxcx_buf_take_n(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, s = wq->mlwq_bufs; mutex_enter(&s->mlbs_mtx); + if (s->mlbs_state != MLXCX_SHARD_READY) { + mutex_exit(&s->mlbs_mtx); + return (0); + } + while (done < nbufs && (b = list_remove_head(&s->mlbs_free)) != NULL) { ASSERT3U(b->mlb_state, ==, MLXCX_BUFFER_FREE); b->mlb_state = MLXCX_BUFFER_ON_WQ; @@ -2327,6 +2403,8 @@ mlxcx_buf_take_n(mlxcx_t *mlxp, mlxcx_work_queue_t *wq, boolean_t mlxcx_buf_loan(mlxcx_t *mlxp, mlxcx_buffer_t *b) { + mlxcx_buf_shard_t *s = b->mlb_shard; + VERIFY3U(b->mlb_state, ==, MLXCX_BUFFER_ON_WQ); ASSERT3P(b->mlb_mlx, ==, mlxp); @@ -2339,6 +2417,12 @@ mlxcx_buf_loan(mlxcx_t *mlxp, mlxcx_buffer_t *b) b->mlb_state = MLXCX_BUFFER_ON_LOAN; b->mlb_wqe_index = 0; + + mutex_enter(&s->mlbs_mtx); + list_remove(&s->mlbs_busy, b); + list_insert_tail(&s->mlbs_loaned, b); + mutex_exit(&s->mlbs_mtx); + return (B_TRUE); } @@ -2401,7 +2485,23 @@ mlxcx_buf_return(mlxcx_t *mlxp, mlxcx_buffer_t *b) break; case MLXCX_BUFFER_ON_LOAN: ASSERT(!b->mlb_foreign); - list_remove(&s->mlbs_busy, b); + list_remove(&s->mlbs_loaned, b); + if (s->mlbs_state == MLXCX_SHARD_DRAINING) { + /* + * When we're draining, Eg during mac_stop(), + * we destroy the buffer immediately rather than + * recycling it. Otherwise we risk leaving it + * on the free list and leaking it. + */ + list_insert_tail(&s->mlbs_free, b); + mlxcx_buf_destroy(mlxp, b); + /* + * Teardown might be waiting for loaned list to empty. + */ + cv_broadcast(&s->mlbs_free_nonempty); + mutex_exit(&s->mlbs_mtx); + return; + } break; case MLXCX_BUFFER_FREE: VERIFY(0); @@ -2414,7 +2514,7 @@ mlxcx_buf_return(mlxcx_t *mlxp, mlxcx_buffer_t *b) } list_insert_tail(&s->mlbs_free, b); - cv_signal(&s->mlbs_free_nonempty); + cv_broadcast(&s->mlbs_free_nonempty); mutex_exit(&s->mlbs_mtx); @@ -2432,9 +2532,11 @@ void mlxcx_buf_destroy(mlxcx_t *mlxp, mlxcx_buffer_t *b) { mlxcx_buf_shard_t *s = b->mlb_shard; + VERIFY(b->mlb_state == MLXCX_BUFFER_FREE || b->mlb_state == MLXCX_BUFFER_INIT); ASSERT(mutex_owned(&s->mlbs_mtx)); + if (b->mlb_state == MLXCX_BUFFER_FREE) list_remove(&s->mlbs_free, b); @@ -2454,3 +2556,20 @@ mlxcx_buf_destroy(mlxcx_t *mlxp, mlxcx_buffer_t *b) kmem_cache_free(mlxp->mlx_bufs_cache, b); } + +void +mlxcx_shard_ready(mlxcx_buf_shard_t *s) +{ + mutex_enter(&s->mlbs_mtx); + s->mlbs_state = MLXCX_SHARD_READY; + mutex_exit(&s->mlbs_mtx); +} + +void +mlxcx_shard_draining(mlxcx_buf_shard_t *s) +{ + mutex_enter(&s->mlbs_mtx); + s->mlbs_state = MLXCX_SHARD_DRAINING; + cv_broadcast(&s->mlbs_free_nonempty); + mutex_exit(&s->mlbs_mtx); +} diff --git a/usr/src/uts/i86pc/vm/seg_vmm.c b/usr/src/uts/i86pc/vm/seg_vmm.c index beb5e81d53..faebf9ac36 100644 --- a/usr/src/uts/i86pc/vm/seg_vmm.c +++ b/usr/src/uts/i86pc/vm/seg_vmm.c @@ -14,15 +14,12 @@ */ /* - * segvmm - Virtual-Machine-Memory segment + * VM - Virtual-Machine-Memory segment * * The vmm segment driver was designed for mapping regions of kernel memory * allocated to an HVM instance into userspace for manipulation there. It * draws direct lineage from the umap segment driver, but meant for larger * mappings with fewer restrictions. - * - * seg*k*vmm, in contrast, has mappings for every VMM into kas. We use its - * mappings here only to find the relevant PFNs in segvmm_fault_in(). */ @@ -96,7 +93,7 @@ static struct seg_ops segvmm_ops = { /* - * Create a kernel/user-mapped segment. ->kaddr is the segkvmm mapping. + * Create a kernel/user-mapped segment. */ int segvmm_create(struct seg **segpp, void *argsp) diff --git a/usr/src/uts/intel/audio/Makefile b/usr/src/uts/intel/audio/Makefile index 3a7a1d6c21..04b193ee64 100644 --- a/usr/src/uts/intel/audio/Makefile +++ b/usr/src/uts/intel/audio/Makefile @@ -36,7 +36,6 @@ UTSBASE = ../.. # MODULE = audio OBJECTS = $(AUDIO_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(AUDIO_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/common/io/audio/impl @@ -47,14 +46,10 @@ include $(UTSBASE)/intel/Makefile.intel CERRWARN += $(CNOWARN_UNINIT) -# needs work -$(OBJS_DIR)/audio_grc3.o := SMOFF += index_overflow - # # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # @@ -70,12 +65,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/intel/os/driver_aliases b/usr/src/uts/intel/os/driver_aliases index 7e8c801f03..73c693018d 100644 --- a/usr/src/uts/intel/os/driver_aliases +++ b/usr/src/uts/intel/os/driver_aliases @@ -140,18 +140,18 @@ bfe "pci14e4,4402" bge "SUNW,bge" bge "pci108e,1647" bge "pci108e,1648" +bge "pci14e4,1682" +bge "pci14e4,1686" bge "pci108e,16a7" bge "pci108e,16a8" -bge "pci14e4,0x1682" -bge "pci14e4,0x1686" -bge "pci14e4,0x16b0" -bge "pci14e4,0x16b1" -bge "pci14e4,0x16b2" -bge "pci14e4,0x16b3" -bge "pci14e4,0x16b4" -bge "pci14e4,0x16b5" -bge "pci14e4,0x16b6" -bge "pci14e4,0x16b7" +bge "pci14e4,16b0" +bge "pci14e4,16b1" +bge "pci14e4,16b2" +bge "pci14e4,16b3" +bge "pci14e4,16b4" +bge "pci14e4,16b5" +bge "pci14e4,16b6" +bge "pci14e4,16b7" bge "pci14e4,1600" bge "pci14e4,1601" bge "pci14e4,1643" @@ -186,16 +186,6 @@ bge "pci14e4,16a7" bge "pci14e4,16a8" bge "pci14e4,16c7" bge "pci14e4,16f3" -bge "pciex14e4,0x1682" -bge "pciex14e4,0x1686" -bge "pciex14e4,0x16b0" -bge "pciex14e4,0x16b1" -bge "pciex14e4,0x16b2" -bge "pciex14e4,0x16b3" -bge "pciex14e4,0x16b4" -bge "pciex14e4,0x16b5" -bge "pciex14e4,0x16b6" -bge "pciex14e4,0x16b7" bge "pciex14e4,1643" bge "pciex14e4,1655" bge "pciex14e4,1656" @@ -212,7 +202,9 @@ bge "pciex14e4,167a" bge "pciex14e4,167b" bge "pciex14e4,1680" bge "pciex14e4,1681" +bge "pciex14e4,1682" bge "pciex14e4,1684" +bge "pciex14e4,1686" bge "pciex14e4,1688" bge "pciex14e4,1689" bge "pciex14e4,1690" @@ -221,6 +213,14 @@ bge "pciex14e4,1692" bge "pciex14e4,1694" bge "pciex14e4,1698" bge "pciex14e4,169d" +bge "pciex14e4,16b0" +bge "pciex14e4,16b1" +bge "pciex14e4,16b2" +bge "pciex14e4,16b3" +bge "pciex14e4,16b4" +bge "pciex14e4,16b5" +bge "pciex14e4,16b6" +bge "pciex14e4,16b7" bge "pciex14e4,16fd" bge "pciex14e4,16f3" bge "pciex14e4,1713" diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.c b/usr/src/uts/sfmmu/vm/hat_sfmmu.c index a9f8877c64..3a290b1fd7 100644 --- a/usr/src/uts/sfmmu/vm/hat_sfmmu.c +++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.c @@ -1943,7 +1943,7 @@ hat_free_end(struct hat *sfmmup) ASSERT(sfmmup->sfmmu_ttecnt[TTE256M] == 0); if (sfmmup->sfmmu_rmstat) { - hat_freestat(sfmmup->sfmmu_as, NULL); + hat_freestat(sfmmup->sfmmu_as, 0); } while (sfmmup->sfmmu_tsb != NULL) { @@ -10090,7 +10090,7 @@ sfmmu_check_page_sizes(sfmmu_t *sfmmup, int growing) * Kernel threads, processes with small address spaces not using * large pages, and dummy ISM HATs need not apply. */ - if (sfmmup == ksfmmup || sfmmup->sfmmu_ismhat != NULL) + if (sfmmup == ksfmmup || sfmmup->sfmmu_ismhat != 0) return; if (!SFMMU_LGPGS_INUSE(sfmmup) && @@ -12082,7 +12082,7 @@ sfmmu_ismtlbcache_demap(caddr_t addr, sfmmu_t *ism_sfmmup, */ ASSERT(ism_sfmmup->sfmmu_ismhat); ASSERT(MUTEX_HELD(&ism_mlist_lock)); - addr = addr - ISMID_STARTADDR; + addr = (caddr_t)((uintptr_t)addr - (uintptr_t)ISMID_STARTADDR); for (ment = ism_sfmmup->sfmmu_iment; ment; ment = ment->iment_next) { diff --git a/usr/src/uts/sparc/audio/Makefile b/usr/src/uts/sparc/audio/Makefile index a77b4bd8c1..8721dc9800 100644 --- a/usr/src/uts/sparc/audio/Makefile +++ b/usr/src/uts/sparc/audio/Makefile @@ -37,7 +37,6 @@ UTSBASE = ../.. # MODULE = audio OBJECTS = $(AUDIO_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(AUDIO_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/common/io/audio/impl @@ -52,7 +51,6 @@ CERRWARN += $(CNOWARN_UNINIT) # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # @@ -68,12 +66,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sparc/dtrace/dtrace_isa.c b/usr/src/uts/sparc/dtrace/dtrace_isa.c index a90b28efbb..302224260e 100644 --- a/usr/src/uts/sparc/dtrace/dtrace_isa.c +++ b/usr/src/uts/sparc/dtrace/dtrace_isa.c @@ -300,7 +300,7 @@ leaf: ASSERT(depth == 0); while (depth < pcstack_limit) - pcstack[depth++] = NULL; + pcstack[depth++] = 0; return; } @@ -343,7 +343,7 @@ leaf: } while (depth < pcstack_limit) - pcstack[depth++] = NULL; + pcstack[depth++] = 0; return; } @@ -505,7 +505,7 @@ dtrace_getupcstack(uint64_t *pcstack, int pcstack_limit) zero: while (pcstack_limit-- > 0) - *pcstack++ = NULL; + *pcstack++ = 0; } int @@ -534,7 +534,7 @@ dtrace_getustackdepth(void) * beyond that NULL return address. */ if (DTRACE_CPUFLAG_ISSET(CPU_DTRACE_ENTRY) && - (rp->r_o7 != NULL || n != 1)) + (rp->r_o7 != 0 || n != 1)) n++; return (n); @@ -637,7 +637,7 @@ dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) zero: while (pcstack_limit-- > 0) - *pcstack++ = NULL; + *pcstack++ = 0; } uint64_t diff --git a/usr/src/uts/sparc/dtrace/fbt.c b/usr/src/uts/sparc/dtrace/fbt.c index 58169bac81..aed1c05b3e 100644 --- a/usr/src/uts/sparc/dtrace/fbt.c +++ b/usr/src/uts/sparc/dtrace/fbt.c @@ -379,7 +379,7 @@ fbt_trampoline_unmap() vmem_free(heap_arena, fbt_trampoline_window, fbt_trampoline_size); fbt_trampoline_window = NULL; - fbt_trampoline = NULL; + fbt_trampoline = 0; fbt_trampoline_size = 0; } @@ -532,7 +532,7 @@ fbt_patch_entry(uint32_t *instr, uint32_t id, fbt_trampoline_t *tramp, * Likewise, rs1 and rs2 in the jmpl of case (b) may be outputs and/or globals. * If the jmpl uses outputs or globals, we restructure it to be: * - * jmpl ls2 + (ls3 | offset), (%g0 | %o7) + * jmpl ls2 + (ls3 | offset), (%g0 | %o7) * */ /*ARGSUSED*/ @@ -1040,7 +1040,7 @@ fbt_provide_module(void *arg, struct modctl *ctl) if (strcmp(modname, "kmdbmod") == 0) return; - if (str == NULL || symhdr == NULL || symhdr->sh_addr == NULL) { + if (str == NULL || symhdr == NULL || symhdr->sh_addr == 0) { /* * If this module doesn't (yet) have its string or symbol * table allocated, clear out. @@ -1730,7 +1730,7 @@ fbt_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, "fbt", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE || + DDI_PSEUDO, 0) == DDI_FAILURE || dtrace_register("fbt", &fbt_attr, DTRACE_PRIV_KERNEL, NULL, &fbt_pops, NULL, &fbt_id) != 0) { ddi_remove_minor_node(devi, NULL); diff --git a/usr/src/uts/sparc/dtrace/sdt.c b/usr/src/uts/sparc/dtrace/sdt.c index 8fbdf24fee..0bfe2ce216 100644 --- a/usr/src/uts/sparc/dtrace/sdt.c +++ b/usr/src/uts/sparc/dtrace/sdt.c @@ -367,7 +367,7 @@ sdt_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, "sdt", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(devi, NULL); return (DDI_FAILURE); } diff --git a/usr/src/uts/sparc/fs/proc/prmachdep.c b/usr/src/uts/sparc/fs/proc/prmachdep.c index 734f36610f..dc2119f7ba 100644 --- a/usr/src/uts/sparc/fs/proc/prmachdep.c +++ b/usr/src/uts/sparc/fs/proc/prmachdep.c @@ -25,7 +25,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ #include <sys/types.h> #include <sys/t_lock.h> @@ -422,7 +422,7 @@ prgetprfpregs(klwp_t *lwp, prfpregset_t *pfp) * This is supposed to be a pointer to the floating point queue. * We can't provide such a thing through the /proc interface. */ - pfp->pr_filler = NULL; + pfp->pr_filler = 0; /* * XXX: to be done: fetch the FP queue if it is non-empty. */ @@ -443,7 +443,7 @@ prgetprfpregs32(klwp_t *lwp, prfpregset32_t *pfp) * This is supposed to be a pointer to the floating point queue. * We can't provide such a thing through the /proc interface. */ - pfp->pr_filler = NULL; + pfp->pr_filler = 0; /* * XXX: to be done: fetch the FP queue if it is non-empty. */ diff --git a/usr/src/uts/sparc/syscall/getcontext.c b/usr/src/uts/sparc/syscall/getcontext.c index 3c8dbf9190..3cf07718ad 100644 --- a/usr/src/uts/sparc/syscall/getcontext.c +++ b/usr/src/uts/sparc/syscall/getcontext.c @@ -28,7 +28,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ #include <sys/param.h> #include <sys/types.h> @@ -90,7 +90,7 @@ savecontext(ucontext_t *ucp, const k_sigset_t *mask) * been disabled for this LWP. If stack bounds checking is disabled * or the copyin() fails, we fall back to the legacy behavior. */ - if (lwp->lwp_ustack == NULL || + if (lwp->lwp_ustack == (uintptr_t)NULL || copyin((void *)lwp->lwp_ustack, &ucp->uc_stack, sizeof (ucp->uc_stack)) != 0 || ucp->uc_stack.ss_size == 0) { @@ -392,7 +392,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq) * been disabled for this LWP. If stack bounds checking is disabled * or the copyin() fails, we fall back to the legacy behavior. */ - if (lwp->lwp_ustack == NULL || + if (lwp->lwp_ustack == (uintptr_t)NULL || copyin((void *)lwp->lwp_ustack, &ucp->uc_stack, sizeof (ucp->uc_stack)) != 0 || ucp->uc_stack.ss_size == 0) { @@ -418,7 +418,7 @@ savecontext32(ucontext32_t *ucp, const k_sigset_t *mask, struct fq32 *dfq) if (ucp->uc_mcontext.fpregs.fpu_en == 0) ucp->uc_flags &= ~UC_FPU; - ucp->uc_mcontext.gwins = (caddr32_t)NULL; + ucp->uc_mcontext.gwins = (caddr32_t)(uintptr_t)NULL; if (mask != NULL) { /* @@ -477,7 +477,7 @@ getsetcontext32(int flag, void *arg) * a later setcontext(2). */ uc.uc_mcontext.fpregs.fpu_qcnt = 0; - uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)NULL; + uc.uc_mcontext.fpregs.fpu_q = (caddr32_t)(uintptr_t)NULL; if (copyout(&uc, arg, sizeof (ucontext32_t))) return (set_errno(EFAULT)); diff --git a/usr/src/uts/sparc/v9/os/v9dep.c b/usr/src/uts/sparc/v9/os/v9dep.c index 654aee9167..38a905995f 100644 --- a/usr/src/uts/sparc/v9/os/v9dep.c +++ b/usr/src/uts/sparc/v9/os/v9dep.c @@ -20,7 +20,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. @@ -121,7 +121,7 @@ setfpregs(klwp_t *lwp, fpregset_t *fp) /* * Load up a user's floating point context. */ - if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */ + if (fp->fpu_qcnt > MAXFPQ) /* plug security holes */ fp->fpu_qcnt = MAXFPQ; fp->fpu_q_entrysize = sizeof (struct _fq); @@ -819,7 +819,7 @@ setregs(uarg_t *args) rp->r_y = 0; curthread->t_post_sys = 1; lwp->lwp_eosys = JUSTRETURN; - lwp->lwp_pcb.pcb_trap0addr = NULL; /* no trap 0 handler */ + lwp->lwp_pcb.pcb_trap0addr = 0; /* no trap 0 handler */ /* * Clear the fixalignment flag */ @@ -1425,7 +1425,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)()) gwp = NULL; sp += gwin_size; } else { - suword32_noerr(&fp->uc.uc_mcontext.gwins, (uint32_t)NULL); + suword32_noerr(&fp->uc.uc_mcontext.gwins, 0); } if (fpq_size != 0) { @@ -1455,8 +1455,7 @@ sendsig32(int sig, k_siginfo_t *sip, void (*hdlr)()) mpcb->mpcb_flags |= FP_TRAPPED; } else { - suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q, - (uint32_t)NULL); + suword32_noerr(&fp->uc.uc_mcontext.fpregs.fpu_q, 0); suword8_noerr(&fp->uc.uc_mcontext.fpregs.fpu_qcnt, 0); } @@ -1724,7 +1723,7 @@ fpuregset_nto32(const fpregset_t *src, fpregset32_t *dest, struct fq32 *dfq) bzero(dest, sizeof (*dest)); for (i = 0; i < 32; i++) dest->fpu_fr.fpu_regs[i] = src->fpu_fr.fpu_regs[i]; - dest->fpu_q = NULL; + dest->fpu_q = 0; dest->fpu_fsr = (uint32_t)src->fpu_fsr; dest->fpu_qcnt = src->fpu_qcnt; dest->fpu_q_entrysize = sizeof (struct fpq32); diff --git a/usr/src/uts/sun/io/fd.c b/usr/src/uts/sun/io/fd.c index 7a760aa8af..e8dcaca3c1 100644 --- a/usr/src/uts/sun/io/fd.c +++ b/usr/src/uts/sun/io/fd.c @@ -6553,7 +6553,7 @@ release_sb_dma(struct fdctlr *fdc) dma_reg = (struct sb_dma_reg *)fdc->c_dma_regs; /* Unmask all the channels to release the DMA controller */ ddi_put8(fdc->c_handlep_dma, - &dma_reg->sb_dma_regs[DMAC1_ALLMASK], NULL); + &dma_reg->sb_dma_regs[DMAC1_ALLMASK], 0); fdc->sb_dma_lock = 0; } diff --git a/usr/src/uts/sun/io/socal.c b/usr/src/uts/sun/io/socal.c index 084c59f0d5..ad94e101b7 100644 --- a/usr/src/uts/sun/io/socal.c +++ b/usr/src/uts/sun/io/socal.c @@ -86,7 +86,7 @@ #define SOCAL_DEBUG 0 #endif static uchar_t socal_xrambuf[0x40000]; -static int socal_core = SOCAL_TAKE_CORE; +static int socal_core = SOCAL_TAKE_CORE; #if SOCAL_DEBUG > 0 && !defined(lint) static int soc_debug = SOCAL_DEBUG; static int socal_read_stale_data = 0; @@ -224,7 +224,7 @@ static struct ddi_dma_attr socal_dma_attr = { (unsigned long long)0xffffffff, /* addr_hi */ (unsigned long long)0xffffffff, /* count max */ (unsigned long long)4, /* align */ - DEFAULT_BURSTSIZE | BURST32 | BURST64, /* burst size */ + DEFAULT_BURSTSIZE | BURST32 | BURST64, /* burst size */ 1, /* minxfer */ (unsigned long long)0xffffffff, /* maxxfer */ (unsigned long long)0xffffffff, /* seg */ @@ -1111,7 +1111,7 @@ socal_dodetach(dev_info_t *dip) int socal_bus_ctl(dev_info_t *dip, dev_info_t *rip, ddi_ctl_enum_t op, - void *a, void *v) + void *a, void *v) { int port; @@ -1252,12 +1252,12 @@ socal_bus_ctl(dev_info_t *dip, dev_info_t *rip, ddi_ctl_enum_t op, /* * int * socal_getinfo() - Given the device number, return the devinfo - * pointer or the instance number. Note: this routine must be - * successful on DDI_INFO_DEVT2INSTANCE even before attach. + * pointer or the instance number. Note: this routine must be + * successful on DDI_INFO_DEVT2INSTANCE even before attach. */ int socal_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, - void **result) + void **result) { int instance; socal_state_t *socalp; @@ -1288,7 +1288,7 @@ socal_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, int socal_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) { - int instance = getminor(*devp)/2; + int instance = getminor(*devp) / 2; socal_state_t *socalp = ddi_get_soft_state(socal_soft_state_p, instance); socal_port_t *port_statep; @@ -1312,7 +1312,7 @@ socal_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) int socal_close(dev_t dev, int flag, int otyp, cred_t *cred_p) { - int instance = getminor(dev)/2; + int instance = getminor(dev) / 2; socal_state_t *socalp = ddi_get_soft_state(socal_soft_state_p, instance); socal_port_t *port_statep; @@ -1334,15 +1334,15 @@ int socal_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, int *rval_p) { - int instance = getminor(dev)/2; + int instance = getminor(dev) / 2; socal_state_t *socalp = ddi_get_soft_state(socal_soft_state_p, instance); int port; socal_port_t *port_statep; - int i; + int i; uint_t r; int offset; - int retval = FCAL_SUCCESS; + int retval = FCAL_SUCCESS; la_els_adisc_t *adisc_pl; la_els_rls_reply_t *rls_pl; dev_info_t *dip; @@ -2612,11 +2612,11 @@ socal_transport(fcal_packet_t *fcalpkt, fcal_sleep_t sleep, int req_q_no) /*ARGSUSED*/ static int socal_cq_enque(socal_state_t *socalp, socal_port_t *port_statep, cqe_t *cqe, - int rqix, fcal_sleep_t sleep, fcal_packet_t *to_queue, - int mtxheld) + int rqix, fcal_sleep_t sleep, fcal_packet_t *to_queue, + int mtxheld) { #if defined(DEBUG) && !defined(lint) - int instance = ddi_get_instance(socalp->dip); + int instance = ddi_get_instance(socalp->dip); #endif socal_kcq_t *kcq; cqe_t *sp; @@ -2644,7 +2644,7 @@ socal_cq_enque(socal_state_t *socalp, socal_port_t *port_statep, cqe_t *cqe, if (to_queue) { if ((to_queue->fcal_socal_request.sr_soc_hdr.sh_request_token = SOCAL_ID_GET(to_queue, mtxheld ? FCAL_NOSLEEP : - sleep)) == NULL) { + sleep)) == 0) { return (FCAL_TRANSPORT_QFULL); } } @@ -3034,8 +3034,8 @@ socal_abort_cmd(void *ssp, uint_t port, fcal_packet_t *fcalpkt, uint_t polled) /*ARGSUSED*/ static uint_t socal_els(void *ssp, uint_t port, uint_t elscode, uint_t dest, - void (*callback)(), void *arg, caddr_t reqpl, caddr_t *rsppl, - uint_t sleep) + void (*callback)(), void *arg, caddr_t reqpl, caddr_t *rsppl, + uint_t sleep) { return (FCAL_TRANSPORT_FAILURE); } @@ -3068,7 +3068,7 @@ socal_bypass_dev(void *ssp, uint_t port, uint_t dest) static void socal_force_reset(void *ssp, uint_t port, uint_t restart) { - socal_state_t *socalp = (socal_state_t *)ssp; + socal_state_t *socalp = (socal_state_t *)ssp; mutex_enter(&socalp->k_imr_mtx); if (socalp->socal_shutdown) { @@ -3090,8 +3090,8 @@ socal_force_reset(void *ssp, uint_t port, uint_t restart) static void socal_add_ulp(void *ssp, uint_t port, uchar_t type, - void (*ulp_statec_callback)(), void (*ulp_els_callback)(), - void (*ulp_data_callback)(), void *arg) + void (*ulp_statec_callback)(), void (*ulp_els_callback)(), + void (*ulp_data_callback)(), void *arg) { socal_state_t *socalp = (socal_state_t *)ssp; socal_port_t *port_statep = &socalp->port_state[port]; @@ -4265,13 +4265,13 @@ socal_force_offline(void *ssp, uint_t port, uint_t polled) static int socal_issue_adisc(socal_state_t *socalp, uint32_t port, uint32_t dest, - la_els_adisc_t *payload, uint32_t polled) + la_els_adisc_t *payload, uint32_t polled) { int retval; la_els_adisc_t *buf; fcal_packet_t *fcalpkt; socal_port_t *port_statep; - socal_priv_cmd_t *privp; + socal_priv_cmd_t *privp; port_statep = &socalp->port_state[port]; @@ -4314,7 +4314,7 @@ socal_issue_lbf(socal_state_t *socalp, uint32_t port, int retval; fcal_packet_t *fcalpkt; socal_port_t *port_statep; - socal_priv_cmd_t *privp; + socal_priv_cmd_t *privp; port_statep = &socalp->port_state[port]; @@ -4341,13 +4341,13 @@ socal_issue_lbf(socal_state_t *socalp, uint32_t port, static int socal_issue_rls(socal_state_t *socalp, uint32_t port, uint32_t dest, - la_els_rls_reply_t *payload, uint32_t polled) + la_els_rls_reply_t *payload, uint32_t polled) { int retval; la_els_rls_t *buf; fcal_packet_t *fcalpkt; socal_port_t *port_statep; - socal_priv_cmd_t *privp; + socal_priv_cmd_t *privp; uint32_t arg; port_statep = &socalp->port_state[port]; @@ -4406,7 +4406,7 @@ socal_issue_rls(socal_state_t *socalp, uint32_t port, uint32_t dest, fcal_packet_t * socal_els_alloc(socal_state_t *socalp, uint32_t port, uint32_t dest, - uint32_t cmd_size, uint32_t rsp_size, caddr_t *rprivp, uint32_t polled) + uint32_t cmd_size, uint32_t rsp_size, caddr_t *rprivp, uint32_t polled) { struct fcal_packet *fcalpkt; ddi_dma_cookie_t ccookie; @@ -4555,8 +4555,8 @@ fail: fcal_packet_t * socal_lbf_alloc(socal_state_t *socalp, uint32_t port, - uint32_t cmd_size, uint32_t rsp_size, caddr_t *rprivp, - uint32_t polled) + uint32_t cmd_size, uint32_t rsp_size, caddr_t *rprivp, + uint32_t polled) { struct fcal_packet *fcalpkt; ddi_dma_cookie_t ccookie; @@ -4755,7 +4755,7 @@ socal_lbf_free(socal_priv_cmd_t *privp) static int socal_getmap(socal_state_t *socalp, uint32_t port, caddr_t arg, - uint32_t polled, int flags) + uint32_t polled, int flags) { ddi_dma_cookie_t dcookie; ddi_dma_handle_t dhandle = NULL; @@ -4848,7 +4848,9 @@ static void socal_wcopy(uint_t *h_src, uint_t *h_dest, int len) { int i; - for (i = 0; i < len/4; i++) { + + len /= 4; + for (i = 0; i < len; i++) { *h_dest++ = *h_src++; } } @@ -4981,7 +4983,7 @@ socal_fix_harda(socal_state_t *socalp, int port) fcal_transport_t * socal_sftm_attach(dev_t dev, int loop_id) { - int instance = getminor(dev) / 2; + int instance = getminor(dev) / 2; int port = getminor(dev) % 2; int hard_alpa; char *name; diff --git a/usr/src/uts/sun/io/zs_hdlc.c b/usr/src/uts/sun/io/zs_hdlc.c index 5b9b1d45e2..dc9a0bde3d 100644 --- a/usr/src/uts/sun/io/zs_hdlc.c +++ b/usr/src/uts/sun/io/zs_hdlc.c @@ -117,7 +117,7 @@ int zsh_h_log_n[2]; } #define zsh_h_log_clear \ - { register char *p; \ + { char *p; \ for (p = &zsh_h_log[zs->zs_unit][ZSH_H_LOG_MAX]; \ p >= &zsh_h_log[zs->zs_unit][0]; p--) \ *p = '\0'; \ @@ -169,8 +169,8 @@ static struct module_info hdlc_minfo = { "zsh", /* module name */ 0, /* minimum packet size accepted */ INFPSZ, /* maximum packet size accepted */ - 12*1024, /* queue high water mark (bytes) */ - 4*1024 /* queue low water mark (bytes) */ + 12 * 1024, /* queue high water mark (bytes) */ + 4 * 1024 /* queue low water mark (bytes) */ }; static struct qinit hdlc_rinit = { @@ -292,9 +292,9 @@ static int zsh_setmode(struct zscom *zs, struct syncline *zss, */ #define ZSH_GETBLOCK(zs, allocbcount) \ { \ - register int n = ZSH_MAX_RSTANDBY; \ + int n = ZSH_MAX_RSTANDBY; \ while (--n >= 0) { \ - if (!zss->sl_rstandby[n]) { \ + if (zss->sl_rstandby[n] == NULL) { \ if ((zss->sl_rstandby[n] = \ allocb(zss->sl_mru, BPRI_MED)) == NULL) { \ if (zss->sl_bufcid == 0) { \ @@ -318,7 +318,7 @@ static int zsh_setmode(struct zscom *zs, struct syncline *zss, */ #define ZSH_ALLOCB(mp) \ { \ - register int n = ZSH_MAX_RSTANDBY; \ + int n = ZSH_MAX_RSTANDBY; \ mp = NULL; \ while (--n >= 0) { \ if ((mp = zss->sl_rstandby[n]) != NULL) { \ @@ -330,7 +330,7 @@ static int zsh_setmode(struct zscom *zs, struct syncline *zss, #define ZSH_PUTQ(mp) \ { \ - register int wptr, rptr; \ + int wptr, rptr; \ wptr = zss->sl_rdone_wptr; \ rptr = zss->sl_rdone_rptr; \ zss->sl_rdone[wptr] = mp; \ @@ -366,10 +366,10 @@ static int zsh_setmode(struct zscom *zs, struct syncline *zss, #define ZSH_FLUSHQ \ { \ - register mblk_t *tmp; \ + mblk_t *tmp; \ for (;;) { \ ZSH_GETQ(tmp); \ - if (!(tmp)) \ + if (tmp == NULL) \ break; \ freemsg(tmp); \ } \ @@ -386,9 +386,8 @@ zsh_probe(dev_info_t *dev) static int zsh_attach(dev_info_t *dev, ddi_attach_cmd_t cmd) { - register int unit; - char name[3] = { - '\0', '\0', '\0' }; + int unit; + char name[3] = { '\0', '\0', '\0' }; /* * Since zsh is a child of the "pseudo" nexus, we can expect the @@ -406,25 +405,25 @@ zsh_attach(dev_info_t *dev, ddi_attach_cmd_t cmd) return (DDI_FAILURE); /* only use cpu ports */ if (ddi_create_minor_node(dev, "zsh", S_IFCHR, - NULL, DDI_PSEUDO, CLONE_DEV) == DDI_FAILURE) { + 0, DDI_PSEUDO, CLONE_DEV) == DDI_FAILURE) { ddi_remove_minor_node(dev, NULL); cmn_err(CE_WARN, "zsh clone device creation failed."); return (DDI_FAILURE); } - for (; unit < maxzsh/2; unit++) { + for (; unit < maxzsh / 2; unit++) { zscom[unit].zs_hdlc_dip = dev; (void) sprintf(name, "%d", unit); if (ddi_create_minor_node(dev, name, S_IFCHR, - 2*unit, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 2 * unit, DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(dev, NULL); return (DDI_FAILURE); } unit++; (void) sprintf(name, "%d", unit); if (ddi_create_minor_node(dev, name, S_IFCHR, - 2*(unit-1)+1, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 2 * (unit - 1) + 1, DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(dev, NULL); return (DDI_FAILURE); } @@ -436,11 +435,11 @@ zsh_attach(dev_info_t *dev, ddi_attach_cmd_t cmd) /* ARGSUSED */ int zsh_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, -void **result) + void **result) { - register dev_t dev = (dev_t)arg; - register int unit, error; - register struct zscom *zs; + dev_t dev = (dev_t)arg; + int unit, error; + struct zscom *zs; if ((unit = UNIT(dev)) >= nzs) return (DDI_FAILURE); @@ -479,7 +478,7 @@ zsh_detach(dev_info_t *dev, ddi_detach_cmd_t cmd) static void zsh_init_port(struct zscom *zs, struct syncline *zss) { - register uchar_t s0; + uchar_t s0; SCC_WRITE(3, (ZSWR3_RX_ENABLE | ZSWR3_RXCRC_ENABLE | ZSWR3_RX_8)); SCC_WRITE(5, (ZSWR5_TX_8 | ZSWR5_DTR | ZSWR5_TXCRC_ENABLE)); @@ -500,7 +499,7 @@ zsh_init_port(struct zscom *zs, struct syncline *zss) zss->sl_txstate = TX_RTS; zss->sl_rr0 &= ~ZSRR0_CTS; zss->sl_wd_count = zsh_timer_count; - if (!zss->sl_wd_id) + if (zss->sl_wd_id == NULL) zss->sl_wd_id = timeout(zsh_watchdog, zs, SIO_WATCHDOG_TICK); } @@ -520,11 +519,11 @@ zsh_init_port(struct zscom *zs, struct syncline *zss) static int zsh_open(queue_t *rq, dev_t *dev, int flag, int sflag, cred_t *cr) { - register struct zscom *zs; - register struct syncline *zss; - register struct ser_str *stp; - register int unit; - register int tmp; + struct zscom *zs; + struct syncline *zss; + struct ser_str *stp; + int unit; + int tmp; if (sflag != CLONEOPEN) { if (rq->q_ptr) @@ -559,7 +558,7 @@ zsh_open(queue_t *rq, dev_t *dev, int flag, int sflag, cred_t *cr) zss = (struct syncline *)&zscom[unit].zs_priv_str; stp = &zss->sl_stream; - stp->str_state = NULL; + stp->str_state = 0; stp->str_com = (caddr_t)zs; zss->sl_xhead = NULL; @@ -600,7 +599,7 @@ zsh_open(queue_t *rq, dev_t *dev, int flag, int sflag, cred_t *cr) } else { /* CLONEOPEN */ mutex_enter(&zs_curr_lock); for (unit = maxzsh; unit < MAXZSHCLONES; unit++) - if (!zsh_usedminor[unit]) { + if (zsh_usedminor[unit] == '\0') { zsh_usedminor[unit] = (unsigned char)unit; break; } @@ -804,7 +803,7 @@ out: static int zsh_hdp_ok_or_rts_state(struct zscom *zs, struct syncline *zss) { - register uchar_t s0; + uchar_t s0; SCC_BIS(15, ZSR15_CTS); SCC_BIS(5, ZSWR5_RTS); @@ -827,14 +826,14 @@ zsh_hdp_ok_or_rts_state(struct zscom *zs, struct syncline *zss) static void zsh_wput(queue_t *wq, mblk_t *mp) { - register struct ser_str *stp = (struct ser_str *)wq->q_ptr; - register struct zscom *zs; - register struct syncline *zss = NULL; - register ulong_t prim, error = 0; - register union DL_primitives *dlp; - register int ppa; - register mblk_t *tmp; - register struct copyresp *resp; + struct ser_str *stp = (struct ser_str *)wq->q_ptr; + struct zscom *zs; + struct syncline *zss = NULL; + ulong_t prim, error = 0; + union DL_primitives *dlp; + int ppa; + mblk_t *tmp; + struct copyresp *resp; /* * stp->str_com supplied by open or DLPI attach. @@ -907,7 +906,7 @@ zsh_wput(queue_t *wq, mblk_t *mp) (void) zsh_softint(zs); } while (mp->b_wptr == mp->b_rptr) { - register mblk_t *mp1; + mblk_t *mp1; mp1 = unlinkb(mp); freemsg(mp); mp = mp1; @@ -929,7 +928,7 @@ zsh_wput(queue_t *wq, mblk_t *mp) } tmp = NULL; again: - if (!zss->sl_xstandby) { + if (zss->sl_xstandby == NULL) { if (tmp) zss->sl_xstandby = tmp; else { @@ -955,7 +954,7 @@ again: return; } - if (!zss->sl_wd_id) { + if (zss->sl_wd_id == NULL) { zss->sl_wd_count = zsh_timer_count; zss->sl_txstate = TX_IDLE; mutex_exit(zs->zs_excl_hi); @@ -1060,7 +1059,7 @@ end_proto: error = zsh_setmode(zs, zss, (struct scc_mode *)mp->b_cont->b_rptr); if (error) { - register struct iocblk *iocp = + struct iocblk *iocp = (struct iocblk *)mp->b_rptr; mp->b_datap->db_type = M_IOCNAK; iocp->ioc_error = error; @@ -1133,10 +1132,10 @@ end_proto: static int zsh_start(struct zscom *zs, struct syncline *zss) { - register mblk_t *mp; - register uchar_t *wptr; - register uchar_t *rptr; - register uchar_t sl_flags = zss->sl_flags; + mblk_t *mp; + uchar_t *wptr; + uchar_t *rptr; + uchar_t sl_flags = zss->sl_flags; /* * Attempt to grab the next M_DATA message off the queue (that's @@ -1176,7 +1175,7 @@ zsh_start(struct zscom *zs, struct syncline *zss) if (!(sl_flags & SF_FDXPTP)) { sl_flags |= SF_PHONY; ZSH_ALLOCB(mp); - if (!mp) + if (mp == NULL) return (0); mp->b_datap->db_type = M_RSE; mp->b_wptr = mp->b_rptr + 1; @@ -1232,15 +1231,15 @@ transmit: static void zsh_ioctl(queue_t *wq, mblk_t *mp) { - register struct ser_str *stp = (struct ser_str *)wq->q_ptr; - register struct zscom *zs = (struct zscom *)stp->str_com; - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register struct iocblk *iocp = (struct iocblk *)mp->b_rptr; - register struct scc_mode *sm; - register struct sl_stats *st; - register uchar_t *msignals; - register mblk_t *tmp; - register int error = 0; + struct ser_str *stp = (struct ser_str *)wq->q_ptr; + struct zscom *zs = (struct zscom *)stp->str_com; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + struct iocblk *iocp = (struct iocblk *)mp->b_rptr; + struct scc_mode *sm; + struct sl_stats *st; + uchar_t *msignals; + mblk_t *tmp; + int error = 0; mutex_enter(zs->zs_excl); if ((zs->zs_ops != &zsops_null) && @@ -1389,8 +1388,8 @@ end_zsh_ioctl: int zsh_setmode(struct zscom *zs, struct syncline *zss, struct scc_mode *sm) { - register int error = 0; - register mblk_t *mp; + int error = 0; + mblk_t *mp; mutex_enter(zs->zs_excl_hi); if (sm->sm_rxclock == RXC_IS_PLL) { @@ -1450,10 +1449,10 @@ zsh_setmode(struct zscom *zs, struct syncline *zss, struct scc_mode *sm) static void zsh_txint(struct zscom *zs) { - register struct syncline *zss; - register mblk_t *mp; - register int tmp; - register uchar_t *wr_cur; + struct syncline *zss; + mblk_t *mp; + int tmp; + uchar_t *wr_cur; TRACE_1(TR_ZSH, TR_ZSH_TXINT, "zsh_txint: zs = %p", zs); @@ -1480,7 +1479,7 @@ again_txint: if (mp) { zss->sl_xactb = mp; zss->sl_ocnt += tmp = mp->b_wptr - mp->b_rptr; - if (!tmp) + if (tmp == 0) goto again_txint; zs->zs_wr_cur = mp->b_rptr; zs->zs_wr_lim = mp->b_wptr; @@ -1563,8 +1562,8 @@ again_txint: static void zsh_xsint(struct zscom *zs) { - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register uchar_t s0, x0; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + uchar_t s0, x0; TRACE_1(TR_ZSH, TR_ZSH_XSINT, "zsh_xsint: zs = %p", zs); @@ -1676,8 +1675,8 @@ zsh_xsint(struct zscom *zs) static void zsh_rxint(struct zscom *zs) { - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register mblk_t *bp = zss->sl_ractb; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + mblk_t *bp = zss->sl_ractb; unsigned char *rd_cur; TRACE_1(TR_ZSH, TR_ZSH_RXINT, "zsh_rxint: zs = %p", zs); @@ -1688,8 +1687,8 @@ zsh_rxint(struct zscom *zs) return; } - if (!rd_cur) { /* Beginning of frame */ - if (!bp) { + if (rd_cur == NULL) { /* Beginning of frame */ + if (bp == NULL) { ZSH_ALLOCB(bp); zss->sl_ractb = bp; } @@ -1699,7 +1698,7 @@ zsh_rxint(struct zscom *zs) ZSH_ALLOCB(bp->b_cont); bp = zss->sl_ractb = bp->b_cont; } - if (!bp) { + if (bp == NULL) { zss->sl_st.nobuffers++; zsh_rxbad(zs, zss); return; @@ -1716,9 +1715,9 @@ zsh_rxint(struct zscom *zs) static void zsh_srint(struct zscom *zs) { - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register uchar_t s1; - register uchar_t *rd_cur; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + uchar_t s1; + uchar_t *rd_cur; TRACE_1(TR_ZSH, TR_ZSH_SRINT, "zsh_srint: zs = %p", zs); @@ -1768,18 +1767,18 @@ zsh_srint(struct zscom *zs) static int zsh_softint(struct zscom *zs) { - register struct syncline *zss; - register queue_t *q; - register mblk_t *mp, *tmp; - register mblk_t *head = NULL, *tail = NULL; - register int allocbcount = 0; + struct syncline *zss; + queue_t *q; + mblk_t *mp, *tmp; + mblk_t *head = NULL, *tail = NULL; + int allocbcount = 0; int m_error; TRACE_1(TR_ZSH, TR_ZSH_SOFT_START, "zsh_soft start: zs = %p", zs); mutex_enter(zs->zs_excl); zss = (struct syncline *)zs->zs_priv; - if (!zss || (q = zss->sl_stream.str_rq) == NULL) { + if (zss == NULL || (q = zss->sl_stream.str_rq) == NULL) { mutex_exit(zs->zs_excl); return (0); } @@ -1788,7 +1787,7 @@ zsh_softint(struct zscom *zs) zss->sl_m_error = 0; - if (!zss->sl_mstat) + if (zss->sl_mstat == NULL) zss->sl_mstat = allocb(sizeof (struct sl_status), BPRI_MED); mutex_enter(zs->zs_excl_hi); @@ -1796,7 +1795,7 @@ zsh_softint(struct zscom *zs) if (!(zss->sl_flags & SF_FDXPTP)) { zss->sl_flags &= ~SF_FLUSH_WQ; } else { - register uchar_t s0; + uchar_t s0; s0 = SCC_READ0(); if (s0 & ZSRR0_CTS) { @@ -1817,7 +1816,7 @@ zsh_softint(struct zscom *zs) next: for (;;) { ZSH_GETQ(mp); - if (!mp) + if (mp == NULL) break; if (mp->b_rptr == mp->b_wptr) { @@ -1842,12 +1841,12 @@ next: continue; } } - if (!head) { + if (head == NULL) { allocbcount++; zss->sl_soft_active = 1; head = mp; } else { - if (!tail) + if (tail == NULL) tail = head; tail->b_next = mp; tail = mp; @@ -1859,7 +1858,7 @@ next: tmp = NULL; again: mutex_enter(zs->zs_excl_hi); - if (!zss->sl_xstandby) { + if (zss->sl_xstandby == NULL) { if (tmp) { zss->sl_xstandby = tmp; mutex_exit(zs->zs_excl_hi); @@ -1877,7 +1876,7 @@ again: mutex_exit(zs->zs_excl); while (head) { - if (!tail) { + if (tail == NULL) { putnext(q, head); break; } @@ -1905,14 +1904,14 @@ again: static int zsh_program(struct zscom *zs, struct scc_mode *sm) { - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register struct zs_prog *zspp; - register ushort_t tconst = 0; - register int wr11 = 0; - register int baud = 0; - register int pll = 0; - register int speed = 0; - register int flags = ZSP_SYNC; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + struct zs_prog *zspp; + ushort_t tconst = 0; + int wr11 = 0; + int baud = 0; + int pll = 0; + int speed = 0; + int flags = ZSP_SYNC; int err = 0; ZSSETSOFT(zs); /* get our house in order */ @@ -2060,9 +2059,9 @@ out: static void zsh_setmstat(struct zscom *zs, int event) { - register struct syncline *zss = (struct syncline *)&zs->zs_priv_str; - register struct sl_status *mstat; - register mblk_t *mp; + struct syncline *zss = (struct syncline *)&zs->zs_priv_str; + struct sl_status *mstat; + mblk_t *mp; if (((mp = zss->sl_mstat) != NULL) && (zss->sl_mode.sm_config & (CONN_SIGNAL))) { diff --git a/usr/src/uts/sun4/io/ivintr.c b/usr/src/uts/sun4/io/ivintr.c index 1a6cd93eaf..0a80e9da55 100644 --- a/usr/src/uts/sun4/io/ivintr.c +++ b/usr/src/uts/sun4/io/ivintr.c @@ -268,7 +268,7 @@ add_softintr(uint_t pil, softintrfunc intr_handler, caddr_t intr_arg1, intr_vec_t *iv_p; if (pil > PIL_MAX) - return (NULL); + return ((uint64_t)NULL); iv_p = iv_alloc(type); diff --git a/usr/src/uts/sun4/io/pcicfg.c b/usr/src/uts/sun4/io/pcicfg.c index b1bb75ab1c..e2f2e42d59 100644 --- a/usr/src/uts/sun4/io/pcicfg.c +++ b/usr/src/uts/sun4/io/pcicfg.c @@ -577,24 +577,24 @@ pcicfg_get_nslots(dev_info_t *dip, ddi_acc_handle_t handle) &cap_ptr)) == DDI_SUCCESS) { uint32_t config; - PCI_CAP_PUT8(handle, NULL, cap_ptr, PCI_HP_DWORD_SELECT_OFF, + PCI_CAP_PUT8(handle, 0, cap_ptr, PCI_HP_DWORD_SELECT_OFF, PCI_HP_SLOT_CONFIGURATION_REG); - config = PCI_CAP_GET32(handle, NULL, cap_ptr, + config = PCI_CAP_GET32(handle, 0, cap_ptr, PCI_HP_DWORD_DATA_OFF); num_slots = config & 0x1F; } else if ((PCI_CAP_LOCATE(handle, PCI_CAP_ID_SLOT_ID, &cap_ptr)) == DDI_SUCCESS) { - uint8_t esr_reg = PCI_CAP_GET8(handle, NULL, + uint8_t esr_reg = PCI_CAP_GET8(handle, 0, cap_ptr, PCI_CAP_ID_REGS_OFF); num_slots = PCI_CAPSLOT_NSLOTS(esr_reg); } else if ((PCI_CAP_LOCATE(handle, PCI_CAP_ID_PCI_E, &cap_ptr)) == DDI_SUCCESS) { - int port_type = PCI_CAP_GET16(handle, NULL, cap_ptr, + int port_type = PCI_CAP_GET16(handle, 0, cap_ptr, PCIE_PCIECAP) & PCIE_PCIECAP_DEV_TYPE_MASK; if ((port_type == PCIE_PCIECAP_DEV_TYPE_DOWN) && - (PCI_CAP_GET16(handle, NULL, cap_ptr, PCIE_PCIECAP) + (PCI_CAP_GET16(handle, 0, cap_ptr, PCIE_PCIECAP) & PCIE_PCIECAP_SLOT_IMPL)) num_slots = 1; } @@ -614,7 +614,7 @@ pcicfg_is_chassis(dev_info_t *dip, ddi_acc_handle_t handle) if ((PCI_CAP_LOCATE(handle, PCI_CAP_ID_SLOT_ID, &cap_ptr)) != DDI_FAILURE) { - uint8_t esr_reg = PCI_CAP_GET8(handle, NULL, cap_ptr, 2); + uint8_t esr_reg = PCI_CAP_GET8(handle, 0, cap_ptr, 2); if (PCI_CAPSLOT_FIC(esr_reg)) return (B_TRUE); } @@ -665,7 +665,7 @@ pcicfg_pcie_port_type(dev_info_t *dip, ddi_acc_handle_t handle) if ((PCI_CAP_LOCATE(handle, PCI_CAP_ID_PCI_E, &cap_ptr)) != DDI_FAILURE) - port_type = PCI_CAP_GET16(handle, NULL, + port_type = PCI_CAP_GET16(handle, 0, cap_ptr, PCIE_PCIECAP) & PCIE_PCIECAP_DEV_TYPE_MASK; return (port_type); @@ -3535,11 +3535,11 @@ pcicfg_set_standard_props(dev_info_t *dip, ddi_acc_handle_t config_handle, ret = PCI_CAP_LOCATE(config_handle, PCI_CAP_ID_PCI_E, &cap_ptr); if (pcie_dev && (ret == DDI_SUCCESS)) { - val = PCI_CAP_GET16(config_handle, NULL, cap_ptr, + val = PCI_CAP_GET16(config_handle, 0, cap_ptr, PCIE_PCIECAP) & PCIE_PCIECAP_SLOT_IMPL; /* if slot implemented, get physical slot number */ if (val) { - wordval = (PCI_CAP_GET32(config_handle, NULL, + wordval = (PCI_CAP_GET32(config_handle, 0, cap_ptr, PCIE_SLOTCAP) >> PCIE_SLOTCAP_PHY_SLOT_NUM_SHIFT) & PCIE_SLOTCAP_PHY_SLOT_NUM_MASK; @@ -3977,13 +3977,13 @@ pcicfg_disable_bridge_probe_err(dev_info_t *dip, ddi_acc_handle_t h, return; regs->pcie_cap_off = cap_ptr; - regs->devctl = devctl = PCI_CAP_GET16(h, NULL, cap_ptr, + regs->devctl = devctl = PCI_CAP_GET16(h, 0, cap_ptr, PCIE_DEVCTL); devctl &= ~(PCIE_DEVCTL_UR_REPORTING_EN | PCIE_DEVCTL_CE_REPORTING_EN | PCIE_DEVCTL_NFE_REPORTING_EN | PCIE_DEVCTL_FE_REPORTING_EN); - PCI_CAP_PUT16(h, NULL, cap_ptr, PCIE_DEVCTL, devctl); + PCI_CAP_PUT16(h, 0, cap_ptr, PCIE_DEVCTL, devctl); } } @@ -4635,7 +4635,7 @@ pcicfg_fcode_probe(dev_info_t *parent, uint_t bus, uint_t device, * the status property if it exists. */ if (ddi_prop_lookup_string(DDI_DEV_T_ANY, - new_child, NULL, "status", &status_prop) == + new_child, 0, "status", &status_prop) == DDI_PROP_SUCCESS) { if ((strncmp("disabled", status_prop, 8) == 0) || (strncmp("fail", status_prop, 4) == diff --git a/usr/src/uts/sun4/os/machdep.c b/usr/src/uts/sun4/os/machdep.c index 970d5a4125..ca06f151c9 100644 --- a/usr/src/uts/sun4/os/machdep.c +++ b/usr/src/uts/sun4/os/machdep.c @@ -452,7 +452,7 @@ cpu_create_intrstat(cpu_t *cp) zoneid = ALL_ZONES; intr_ksp = kstat_create_zone("cpu", cp->cpu_id, "intrstat", "misc", - KSTAT_TYPE_NAMED, PIL_MAX * 2, NULL, zoneid); + KSTAT_TYPE_NAMED, PIL_MAX * 2, 0, zoneid); /* * Initialize each PIL's named kstat @@ -901,11 +901,6 @@ lbolt_softint_post(void) } void -thread_splitstack_run(caddr_t addr, void (*func)(void *), void *) +do_hotinlines(struct module *mp __unused) { - panic("thread_splitstack() not supported on SPARC"); } - -void -thread_splitstack_cleanup(void) -{} diff --git a/usr/src/uts/sun4/os/mlsetup.c b/usr/src/uts/sun4/os/mlsetup.c index b9ade98a26..a4c4d4059a 100644 --- a/usr/src/uts/sun4/os/mlsetup.c +++ b/usr/src/uts/sun4/os/mlsetup.c @@ -408,7 +408,7 @@ kobj_start(void *cif) prom_panic("no ELF image"); ehdr = (Ehdr *)(uintptr_t)eadr; for (i = 0; i < BA_NUM; i++) - bootaux[i].ba_val = NULL; + bootaux[i].ba_val = 0; bootaux[BA_PHNUM].ba_val = ehdr->e_phnum; bootaux[BA_PHENT].ba_val = ehdr->e_phentsize; bootaux[BA_LDNAME].ba_ptr = NULL; diff --git a/usr/src/uts/sun4/os/mp_states.c b/usr/src/uts/sun4/os/mp_states.c index d5f55006b4..d615011f9a 100644 --- a/usr/src/uts/sun4/os/mp_states.c +++ b/usr/src/uts/sun4/os/mp_states.c @@ -102,7 +102,7 @@ idle_other_cpus(void) return; xt_some(cpu_idle_set, (xcfunc_t *)idle_stop_xcall, - (uint64_t)cpu_idle_self, NULL); + (uint64_t)cpu_idle_self, 0); for (i = 0; i < NCPU; i++) { if (!CPU_IN_SET(cpu_idle_set, i)) @@ -215,7 +215,7 @@ mp_cpu_quiesce(cpu_t *cp0) volatile cpu_t *cp = (volatile cpu_t *) cp0; int i, sanity_limit = cpu_quiesce_microsecond_sanity_limit; int cpuid = cp->cpu_id; - int found_intr = 1; + int found_intr = 1; static fn_t f = "mp_cpu_quiesce"; ASSERT(CPU->cpu_id != cpuid); diff --git a/usr/src/uts/sun4/os/x_call.c b/usr/src/uts/sun4/os/x_call.c index 521f740c82..4583ca32cb 100644 --- a/usr/src/uts/sun4/os/x_call.c +++ b/usr/src/uts/sun4/os/x_call.c @@ -90,7 +90,8 @@ void send_mondo_set(cpuset_t set); * values. */ static int -xc_func_timeout_adj(cpu_setup_t what, int cpuid) { +xc_func_timeout_adj(cpu_setup_t what, int cpuid) +{ uint64_t freq = cpunodes[cpuid].clock_freq; switch (what) { @@ -756,7 +757,7 @@ xc_attention(cpuset_t cpuset) CPUSET_DEL(xc_cpuset, lcx); XC_STAT_INC(x_dstat[lcx][XC_ATTENTION]); - XC_TRACE(XC_ATTENTION, &xc_cpuset, NULL, NULL, NULL); + XC_TRACE(XC_ATTENTION, &xc_cpuset, NULL, 0, 0); if (CPUSET_ISNULL(xc_cpuset)) return; @@ -843,7 +844,7 @@ xc_dismissed(cpuset_t cpuset) * exclude itself */ CPUSET_DEL(xc_cpuset, lcx); - XC_TRACE(XC_DISMISSED, &xc_cpuset, NULL, NULL, NULL); + XC_TRACE(XC_DISMISSED, &xc_cpuset, NULL, 0, 0); if (CPUSET_ISNULL(xc_cpuset)) { xc_holder = -1; mutex_exit(&xc_sys_mutex); @@ -963,9 +964,9 @@ xc_loop(void) * * The owner of xc_sys_mutex (or xc_holder) can expect * its xc/xt requests are handled as follows: - * xc requests use xc_mbox's handshaking for their services - * xt requests at TL>0 will be handled immediately - * xt requests at TL=0: + * xc requests use xc_mbox's handshaking for their services + * xt requests at TL>0 will be handled immediately + * xt requests at TL=0: * if their handlers'pils are <= XCALL_PIL, then * they will be handled after xc_loop exits * (so, they probably should not be used) @@ -976,7 +977,7 @@ xc_loop(void) * the requests will be handled as follows: * xc requests will be handled after they grab xc_sys_mutex * xt requests at TL>0 will be handled immediately - * xt requests at TL=0: + * xt requests at TL=0: * if their handlers'pils are <= XCALL_PIL, then * they will be handled after xc_loop exits * else they will be handled immediately @@ -988,7 +989,7 @@ xc_loop(void) CPUSET_ADD(tset, lcx); membar_stld(); XC_STAT_INC(x_rstat[lcx][XC_LOOP]); - XC_TRACE(XC_LOOP_ENTER, &tset, NULL, NULL, NULL); + XC_TRACE(XC_LOOP_ENTER, &tset, NULL, 0, 0); while (xmp->xc_state != XC_EXIT) { if (xmp->xc_state == XC_DOIT) { func = xmp->xc_func; @@ -1026,7 +1027,7 @@ xc_loop(void) } ASSERT(xmp->xc_state == XC_EXIT); ASSERT(xc_holder != -1); - XC_TRACE(XC_LOOP_EXIT, &tset, NULL, NULL, NULL); + XC_TRACE(XC_LOOP_EXIT, &tset, NULL, 0, 0); xmp->xc_state = XC_IDLE; membar_stld(); return (1); diff --git a/usr/src/uts/sun4u/adm1031/Makefile b/usr/src/uts/sun4u/adm1031/Makefile index 119e16ed93..f403a139ab 100644 --- a/usr/src/uts/sun4u/adm1031/Makefile +++ b/usr/src/uts/sun4u/adm1031/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the adm1031 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -35,7 +33,6 @@ UTSBASE = ../.. # MODULE = adm1031 OBJECTS = $(ADM1031_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ADM1031_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -43,25 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - -# # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -74,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/cpu/spitfire.c b/usr/src/uts/sun4u/cpu/spitfire.c index b4c35566ce..705d871557 100644 --- a/usr/src/uts/sun4u/cpu/spitfire.c +++ b/usr/src/uts/sun4u/cpu/spitfire.c @@ -376,7 +376,7 @@ ecc_psynd_score(ushort_t p_synd) #define CPU_SPACE 0x0002 /* print flt_status (data or instr) */ #define CPU_ERRID 0x0004 /* print flt_id */ #define CPU_TL 0x0008 /* print flt_tl */ -#define CPU_ERRID_FIRST 0x0010 /* print flt_id first in message */ +#define CPU_ERRID_FIRST 0x0010 /* print flt_id first in message */ #define CPU_AFSR 0x0020 /* print flt_stat as decoded %afsr */ #define CPU_AFAR 0x0040 /* print flt_addr as %afar */ #define CPU_AF_PSYND 0x0080 /* print flt_stat %afsr.PSYND */ @@ -808,7 +808,7 @@ cpu_aflt_size(void) /*ARGSUSED*/ void cpu_ce_error(struct regs *rp, ulong_t p_afar, ulong_t p_afsr, - uint_t p_afsr_high, uint_t p_afar_high) + uint_t p_afsr_high, uint_t p_afar_high) { ushort_t sdbh, sdbl; ushort_t e_syndh, e_syndl; @@ -1241,7 +1241,7 @@ cpu_ue_log_err(struct async_flt *aflt) /*ARGSUSED*/ void cpu_async_error(struct regs *rp, ulong_t p_afar, ulong_t p_afsr, - uint_t p_afsr_high, uint_t p_afar_high) + uint_t p_afsr_high, uint_t p_afar_high) { ushort_t sdbh, sdbl, ttype, tl; spitf_async_flt spf_flt; @@ -1937,7 +1937,7 @@ cpu_get_mem_unum_aflt(int synd_status, struct async_flt *aflt, */ int cpu_get_mem_name(uint64_t synd, uint64_t *afsr, uint64_t afar, - char *buf, int buflen, int *lenp) + char *buf, int buflen, int *lenp) { int synd_status, flt_in_memory, ret; char unum[UNUM_NAMLEN]; @@ -2777,7 +2777,7 @@ static uint64_t hb_eclk[HB_LOWEST_DIV + 1] = { uint64_t count, new_count; \ clock_t delay; \ data = lddphysio(HB_MEM_CNTRL0); \ - count = (data & HB_REFRESH_COUNT_MASK) >> \ + count = (data & HB_REFRESH_COUNT_MASK) >> \ HB_REFRESH_COUNT_SHIFT; \ new_count = (HB_REFRESH_INTERVAL * \ cpunodes[CPU->cpu_id].clock_freq) / \ @@ -2785,7 +2785,7 @@ static uint64_t hb_eclk[HB_LOWEST_DIV + 1] = { data = (data & ~HB_REFRESH_COUNT_MASK) | \ (new_count << HB_REFRESH_COUNT_SHIFT); \ stdphysio(HB_MEM_CNTRL0, data); \ - data = lddphysio(HB_MEM_CNTRL0); \ + data = lddphysio(HB_MEM_CNTRL0); \ /* \ * If we are slowing down the cpu and Memory \ * Self Refresh is not enabled, it is required \ @@ -2951,7 +2951,7 @@ clear_errors(spitf_async_flt *spf_flt, uint64_t *acc_afsr) */ static void scan_ecache(uint64_t *t_afar, ec_data_t *ecache_data, - uint64_t *ecache_tag, int *linecnt, uint64_t *t_afsr) + uint64_t *ecache_tag, int *linecnt, uint64_t *t_afsr) { ec_data_t t_ecdata[8]; uint64_t t_etag, oafsr; @@ -3176,7 +3176,7 @@ cpu_log_ecmem_info(spitf_async_flt *spf_flt) /*PRINTFLIKE6*/ static void cpu_aflt_log(int ce_code, int tagnum, spitf_async_flt *spflt, uint_t logflags, - const char *endstr, const char *fmt, ...) + const char *endstr, const char *fmt, ...) { struct async_flt *aflt = (struct async_flt *)spflt; char buf[400], *p, *q; /* see comments about buf[] size above */ @@ -3255,7 +3255,7 @@ cpu_aflt_log(int ce_code, int tagnum, spitf_async_flt *spflt, uint_t logflags, if (logflags & CPU_AFSR) { (void) snprintf(p, (size_t)(q - p), - "\n AFSR 0x%08b.%08b", + "\n AFSR 0x%8b.%8b", (uint32_t)(aflt->flt_stat >> 32), AFSR_FMTSTR0, (uint32_t)aflt->flt_stat, AFSR_FMTSTR1); p += strlen(p); @@ -3292,7 +3292,7 @@ cpu_aflt_log(int ce_code, int tagnum, spitf_async_flt *spflt, uint_t logflags, if (logflags & CPU_UDBH) { (void) snprintf(p, (size_t)(q - p), - "\n UDBH 0x%04b UDBH.ESYND 0x%02x", + "\n UDBH 0x%4b UDBH.ESYND 0x%02x", spflt->flt_sdbh, UDB_FMTSTR, spflt->flt_sdbh & 0xFF); p += strlen(p); @@ -3300,7 +3300,7 @@ cpu_aflt_log(int ce_code, int tagnum, spitf_async_flt *spflt, uint_t logflags, if (logflags & CPU_UDBL) { (void) snprintf(p, (size_t)(q - p), - " UDBL 0x%04b UDBL.ESYND 0x%02x", + " UDBL 0x%4b UDBL.ESYND 0x%02x", spflt->flt_sdbl, UDB_FMTSTR, spflt->flt_sdbl & 0xFF); p += strlen(p); @@ -3348,8 +3348,8 @@ cpu_aflt_log(int ce_code, int tagnum, spitf_async_flt *spflt, uint_t logflags, * modify parity busy idle * ---------------------------- * clean good X - * clean bad X X - * dirty good X + * clean bad X X + * dirty good X * dirty bad * * Bad or good refers to whether a line has an E$ parity error or not. @@ -3885,7 +3885,7 @@ ecache_kstat_init(struct cpu *cp) */ static void ecache_scrub_log(ec_data_t *ec_data, uint64_t ec_tag, uint64_t paddr, int mpb, - uint64_t afsr) + uint64_t afsr) { spitf_async_flt spf_flt; struct async_flt *aflt; diff --git a/usr/src/uts/sun4u/io/i2c/clients/adm1031.c b/usr/src/uts/sun4u/io/i2c/clients/adm1031.c index 4f96fb123c..cdd3be260d 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/adm1031.c +++ b/usr/src/uts/sun4u/io/i2c/clients/adm1031.c @@ -46,10 +46,10 @@ /* * ADM1031 is an Intelligent Temperature Monitor and Dual PWM Fan Controller. * The functions supported by the driver are: - * Reading sensed temperatures. - * Setting temperature limits which control fan speeds. - * Reading fan speeds. - * Setting fan outputs. + * Reading sensed temperatures. + * Setting temperature limits which control fan speeds. + * Reading fan speeds. + * Setting fan outputs. * Reading internal registers. * Setting internal registers. */ @@ -210,9 +210,9 @@ _info(struct modinfo *modinfop) static int adm1031_resume(dev_info_t *dip) { - int instance = ddi_get_instance(dip); + int instance = ddi_get_instance(dip); adm1031_unit_t *admp; - int err = DDI_SUCCESS; + int err = DDI_SUCCESS; admp = (adm1031_unit_t *) ddi_get_soft_state(adm1031_soft_statep, instance); @@ -272,8 +272,8 @@ done: static void adm1031_detach(dev_info_t *dip) { - adm1031_unit_t *admp; - int instance = ddi_get_instance(dip); + adm1031_unit_t *admp; + int instance = ddi_get_instance(dip); admp = ddi_get_soft_state(adm1031_soft_statep, instance); @@ -317,10 +317,10 @@ adm1031_intr(caddr_t arg) static int adm1031_attach(dev_info_t *dip) { - adm1031_unit_t *admp; - int instance = ddi_get_instance(dip); - minor_t minor; - int i; + adm1031_unit_t *admp; + int instance = ddi_get_instance(dip); + minor_t minor; + int i; char *minor_name; int err = 0; @@ -351,7 +351,7 @@ adm1031_attach(dev_info_t *dip) ADM1031_FCNINST_TO_MINOR(i); if (ddi_create_minor_node(dip, minor_name, S_IFCHR, minor, - ADM1031_NODE_TYPE, NULL) == DDI_FAILURE) { + ADM1031_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", admp->adm1031_name, instance); adm1031_detach(dip); @@ -370,7 +370,7 @@ adm1031_attach(dev_info_t *dip) ADM1031_FCNINST_TO_MINOR(i); if (ddi_create_minor_node(dip, minor_name, S_IFCHR, minor, - ADM1031_NODE_TYPE, NULL) == DDI_FAILURE) { + ADM1031_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", admp->adm1031_name, instance); adm1031_detach(dip); @@ -386,7 +386,7 @@ adm1031_attach(dev_info_t *dip) ADM1031_FCNINST_TO_MINOR(0); if (ddi_create_minor_node(dip, "control", S_IFCHR, minor, - ADM1031_NODE_TYPE, NULL) == DDI_FAILURE) { + ADM1031_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", admp->adm1031_name, instance); adm1031_detach(dip); @@ -459,8 +459,8 @@ adm1031_s_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) static int adm1031_suspend(dev_info_t *dip) { - adm1031_unit_t *admp; - int instance = ddi_get_instance(dip); + adm1031_unit_t *admp; + int instance = ddi_get_instance(dip); int err = DDI_SUCCESS; admp = ddi_get_soft_state(adm1031_soft_statep, instance); @@ -586,7 +586,7 @@ static int adm1031_close(dev_t dev, int flags, int otyp, cred_t *credp) { int instance; - adm1031_unit_t *admp; + adm1031_unit_t *admp; _NOTE(ARGUNUSED(flags, otyp, credp)) @@ -874,7 +874,7 @@ done: * Step 3): * User reads the contents of the array (which actually contains the values * of the devices' status registers) to determine the exact nature of the - * event. + * event. */ static int adm1031_i_ioctl(dev_t dev, int cmd, intptr_t arg, int mode) @@ -1060,12 +1060,11 @@ err: static int adm1031_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) if (cmd == ADM1031_INTERRUPT_WAIT) { - return (adm1031_i_ioctl(dev, cmd, arg, mode)); } else { return (adm1031_s_ioctl(dev, cmd, arg, mode)); diff --git a/usr/src/uts/sun4u/io/i2c/clients/lm75.c b/usr/src/uts/sun4u/io/i2c/clients/lm75.c index c5f94eac09..dcc8372e42 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/lm75.c +++ b/usr/src/uts/sun4u/io/i2c/clients/lm75.c @@ -217,18 +217,18 @@ lm75_close(dev_t dev, int flags, int otyp, cred_t *credp) } static int -lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { +lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) +{ i2c_transfer_t *i2c_tran_pointer; int err = DDI_SUCCESS; int16_t temp16; int8_t holder; (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer, - 1, 2, I2C_SLEEP); + 1, 2, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in I2C_GET_TEMPERATURE " - "i2c_tran_pointer not allocated\n", - unitp->lm75_name)); + "i2c_tran_pointer not allocated\n", unitp->lm75_name)); return (ENOMEM); } @@ -238,15 +238,14 @@ lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { err = i2c_transfer(unitp->lm75_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in I2C_GET_TEMPERATURE " - "i2c_transfer routine\n", - unitp->lm75_name)); + "i2c_transfer routine\n", unitp->lm75_name)); i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer); return (err); } D1CMN_ERR((CE_NOTE, "%s: rbuf[0] = %x rbuf[1] = %x\n", - unitp->lm75_name, i2c_tran_pointer->i2c_rbuf[0], - i2c_tran_pointer->i2c_rbuf[0])); + unitp->lm75_name, i2c_tran_pointer->i2c_rbuf[0], + i2c_tran_pointer->i2c_rbuf[0])); temp16 = i2c_tran_pointer->i2c_rbuf[0]; temp16 = (temp16 << 1); temp16 = (temp16 | ((i2c_tran_pointer->i2c_rbuf[1] & 0x80) >> 7)); @@ -261,10 +260,9 @@ lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { temp16 = temp16 / 2; } if (ddi_copyout((caddr_t)&temp16, (caddr_t)arg, - sizeof (int16_t), mode) != DDI_SUCCESS) { + sizeof (int16_t), mode) != DDI_SUCCESS) { D2CMN_ERR((CE_WARN, "%s: Failed in I2C_GET_TEMPERATURE " - "ddi_copyout routine\n", - unitp->lm75_name)); + "ddi_copyout routine\n", unitp->lm75_name)); err = EFAULT; } i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer); @@ -272,25 +270,24 @@ lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { } static int -lm75_set16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { +lm75_set16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) +{ i2c_transfer_t *i2c_tran_pointer; int err = DDI_SUCCESS; int16_t temp16; if (ddi_copyin((caddr_t)arg, (caddr_t)&temp16, - sizeof (int16_t), mode) != DDI_SUCCESS) { + sizeof (int16_t), mode) != DDI_SUCCESS) { D2CMN_ERR((CE_WARN, "%s: Failed in LM74_SET_HYST " - "ddi_copyin routine\n", - unitp->lm75_name)); + "ddi_copyin routine\n", unitp->lm75_name)); return (EFAULT); } (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer, - 3, 0, I2C_SLEEP); + 3, 0, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in LM75_SET_HYST " - "i2c_tran_pointer not allocated\n", - unitp->lm75_name)); + "i2c_tran_pointer not allocated\n", unitp->lm75_name)); return (ENOMEM); } @@ -316,7 +313,7 @@ lm75_set16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) { static int lm75_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -326,7 +323,7 @@ lm75_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, i2c_transfer_t *i2c_tran_pointer; uchar_t passin_byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "LM75: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -484,7 +481,7 @@ lm75_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "lm75", S_IFCHR, instance, - "ddi_i2c:temperature_sensor", NULL) == DDI_FAILURE) { + "ddi_i2c:temperature_sensor", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->lm75_name, "lm75"); ddi_soft_state_free(lm75soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/i2c/clients/pcf8574.c b/usr/src/uts/sun4u/io/i2c/clients/pcf8574.c index 98f01fb3dd..dfb0cc9f66 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/pcf8574.c +++ b/usr/src/uts/sun4u/io/i2c/clients/pcf8574.c @@ -218,18 +218,19 @@ pcf8574_close(dev_t dev, int flags, int otyp, cred_t *credp) } static int -pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { +pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; D1CMN_ERR((CE_WARN, "Entered the pcf8574_get routine\n")); (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 0, 1, I2C_SLEEP); + 0, 1, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_get " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", + unitp->pcf8574_name)); return (ENOMEM); } @@ -237,13 +238,13 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the i2c_transfer routine\n", - unitp->pcf8574_name)); + unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } D1CMN_ERR((CE_WARN, "Back from a transfer value is %x\n", - i2c_tran_pointer->i2c_rbuf[0])); + i2c_tran_pointer->i2c_rbuf[0])); *byte = i2c_tran_pointer->i2c_rbuf[0]; i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); @@ -251,29 +252,30 @@ pcf8574_get(struct pcf8574_unit *unitp, uchar_t *byte) { } static int -pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { +pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) +{ i2c_transfer_t *i2c_tran_pointer; int err = I2C_SUCCESS; (void) i2c_transfer_alloc(unitp->pcf8574_hdl, &i2c_tran_pointer, - 1, 0, I2C_SLEEP); + 1, 0, I2C_SLEEP); if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "%s: Failed in pcf8574_set " - "i2c_tran_pointer not allocated\n", - unitp->pcf8574_name)); + "i2c_tran_pointer not allocated\n", + unitp->pcf8574_name)); return (ENOMEM); } i2c_tran_pointer->i2c_flags = I2C_WR; i2c_tran_pointer->i2c_wbuf[0] = byte; D1CMN_ERR((CE_NOTE, "%s: contains %x\n", unitp->pcf8574_name, - i2c_tran_pointer->i2c_wbuf[0])); + i2c_tran_pointer->i2c_wbuf[0])); err = i2c_transfer(unitp->pcf8574_hdl, i2c_tran_pointer); if (err) { D2CMN_ERR((CE_WARN, "%s: Failed in the pcf8574_set" - " i2c_transfer routine\n", - unitp->pcf8574_name)); + " i2c_transfer routine\n", + unitp->pcf8574_name)); i2c_transfer_free(unitp->pcf8574_hdl, i2c_tran_pointer); return (err); } @@ -283,7 +285,7 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { static int pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -294,7 +296,7 @@ pcf8574_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_port_t ioctl_port; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PCF8574: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -509,7 +511,7 @@ pcf8574_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "pcf8574", S_IFCHR, instance, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pcf8574_name, "pcf8574"); ddi_soft_state_free(pcf8574soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/mach_rootnex.c b/usr/src/uts/sun4u/io/mach_rootnex.c index b2a7ca8f1d..1e3155bba9 100644 --- a/usr/src/uts/sun4u/io/mach_rootnex.c +++ b/usr/src/uts/sun4u/io/mach_rootnex.c @@ -105,7 +105,7 @@ rootnex_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, * Hack to support the UPA slave devices before the 1275 * support for imap was introduced. */ - if (ddi_getproplen(DDI_DEV_T_ANY, dip, NULL, "interrupt-map", + if (ddi_getproplen(DDI_DEV_T_ANY, dip, 0, "interrupt-map", &len) != DDI_PROP_SUCCESS && ddi_getprop(DDI_DEV_T_ANY, rdip, DDI_PROP_DONTPASS, "upa-interrupt-slave", 0) != 0 && ddi_get_parent(rdip) == dip) { @@ -176,7 +176,7 @@ rootnex_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip, * Hack to support the UPA slave devices before the 1275 * support for imap was introduced. */ - if (ddi_getproplen(DDI_DEV_T_ANY, dip, NULL, "interrupt-map", + if (ddi_getproplen(DDI_DEV_T_ANY, dip, 0, "interrupt-map", &len) != DDI_PROP_SUCCESS && ddi_getprop(DDI_DEV_T_ANY, rdip, DDI_PROP_DONTPASS, "upa-interrupt-slave", 0) != 0) { int32_t r_upaid = -1; diff --git a/usr/src/uts/sun4u/io/pci/pci_pci.c b/usr/src/uts/sun4u/io/pci/pci_pci.c index 0196c3d2b4..5fa6e0f742 100644 --- a/usr/src/uts/sun4u/io/pci/pci_pci.c +++ b/usr/src/uts/sun4u/io/pci/pci_pci.c @@ -126,15 +126,15 @@ struct bus_ops ppb_bus_ops = { ndi_busop_remove_eventcall, /* (*bus_remove_eventcall)(); */ ndi_post_event, /* (*bus_post_event)(); */ 0, /* (*bus_intr_ctl)(); */ - 0, /* (*bus_config)(); */ - 0, /* (*bus_unconfig)(); */ - ppb_fm_init_child, /* (*bus_fm_init)(); */ - NULL, /* (*bus_fm_fini)(); */ + 0, /* (*bus_config)(); */ + 0, /* (*bus_unconfig)(); */ + ppb_fm_init_child, /* (*bus_fm_init)(); */ + NULL, /* (*bus_fm_fini)(); */ ppb_bus_enter, /* (*bus_enter)() */ ppb_bus_exit, /* (*bus_exit)() */ ppb_bus_power, /* (*bus_power)() */ - ppb_intr_ops, /* (*bus_intr_op)(); */ - pcie_hp_common_ops /* (*bus_hp_op)(); */ + ppb_intr_ops, /* (*bus_intr_op)(); */ + pcie_hp_common_ops /* (*bus_hp_op)(); */ }; static int ppb_open(dev_t *devp, int flags, int otyp, cred_t *credp); @@ -543,7 +543,7 @@ ppb_detach(dev_info_t *devi, ddi_detach_cmd_t cmd) /*ARGSUSED*/ static int ppb_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t offset, off_t len, caddr_t *vaddrp) + off_t offset, off_t len, caddr_t *vaddrp) { register dev_info_t *pdip; @@ -555,7 +555,7 @@ ppb_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, /*ARGSUSED*/ static int ppb_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t ctlop, void *arg, void *result) + ddi_ctl_enum_t ctlop, void *arg, void *result) { pci_regspec_t *drv_regp; int reglen; @@ -1076,10 +1076,10 @@ ppb_pwr_setup(ppb_devstate_t *ppb, dev_info_t *pdip) kmem_zalloc(sizeof (pci_pwr_t), KM_SLEEP); ppb->ppb_pwr_p->pwr_fp = 0; - pmcsr_bse = PCI_CAP_GET8(conf_hdl, NULL, ppb->ppb_pm_cap_ptr, + pmcsr_bse = PCI_CAP_GET8(conf_hdl, 0, ppb->ppb_pm_cap_ptr, PCI_PMCSR_BSE); - pmcap = PCI_CAP_GET16(conf_hdl, NULL, ppb->ppb_pm_cap_ptr, + pmcap = PCI_CAP_GET16(conf_hdl, 0, ppb->ppb_pm_cap_ptr, PCI_PMCAP); if (pmcap == PCI_CAP_EINVAL16 || pmcsr_bse == PCI_CAP_EINVAL8) { @@ -1165,7 +1165,7 @@ ppb_pwr_setup(ppb_devstate_t *ppb, dev_info_t *pdip) } if (ddi_prop_create(DDI_DEV_T_NONE, pdip, DDI_PROP_CANSLEEP, - "pm-want-child-notification?", NULL, NULL) != DDI_PROP_SUCCESS) { + "pm-want-child-notification?", NULL, 0) != DDI_PROP_SUCCESS) { cmn_err(CE_WARN, "%s%d fail to create pm-want-child-notification? prop", ddi_driver_name(pdip), ddi_get_instance(pdip)); @@ -1239,7 +1239,7 @@ pci_pwr_current_lvl(pci_pwr_t *pwr_p) ppb = (ppb_devstate_t *)ddi_get_soft_state(ppb_state, ddi_get_instance(pwr_p->pwr_dip)); - if ((pmcsr = PCI_CAP_GET16(ppb->ppb_conf_hdl, NULL, + if ((pmcsr = PCI_CAP_GET16(ppb->ppb_conf_hdl, 0, ppb->ppb_pm_cap_ptr, PCI_PMCSR)) == PCI_CAP_EINVAL16) return (DDI_FAILURE); @@ -1316,7 +1316,7 @@ ppb_pwr(dev_info_t *dip, int component, int lvl) pci_pwr_component_idle(ppb->ppb_pwr_p); } - if ((pmcsr = PCI_CAP_GET16(ppb->ppb_conf_hdl, NULL, + if ((pmcsr = PCI_CAP_GET16(ppb->ppb_conf_hdl, 0, ppb->ppb_pm_cap_ptr, PCI_PMCSR)) == PCI_CAP_EINVAL16) return (DDI_FAILURE); @@ -1403,7 +1403,7 @@ ppb_pwr(dev_info_t *dip, int component, int lvl) } } - PCI_CAP_PUT16(ppb->ppb_conf_hdl, NULL, ppb->ppb_pm_cap_ptr, PCI_PMCSR, + PCI_CAP_PUT16(ppb->ppb_conf_hdl, 0, ppb->ppb_pm_cap_ptr, PCI_PMCSR, pmcsr); /* @@ -1475,7 +1475,7 @@ ppb_init_hotplug(ppb_devstate_t *ppb) static void ppb_create_ranges_prop(dev_info_t *dip, - ddi_acc_handle_t config_handle) + ddi_acc_handle_t config_handle) { uint32_t base, limit; ppb_ranges_t ranges[PPB_RANGE_LEN]; @@ -1642,7 +1642,7 @@ ppb_close(dev_t dev, int flags, int otyp, cred_t *credp) /* ARGSUSED */ static int ppb_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = PCI_MINOR_NUM_TO_INSTANCE(getminor(dev)); ppb_devstate_t *ppb_p = ddi_get_soft_state(ppb_state, instance); @@ -1785,7 +1785,7 @@ ppb_fm_fini(ppb_devstate_t *ppb_p) /*ARGSUSED*/ static int ppb_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc) + ddi_iblock_cookie_t *ibc) { ppb_devstate_t *ppb_p = (ppb_devstate_t *)ddi_get_soft_state(ppb_state, ddi_get_instance(dip)); diff --git a/usr/src/uts/sun4u/io/pci/pcipsy.c b/usr/src/uts/sun4u/io/pci/pcipsy.c index 06a4a71e06..c081d46f3b 100644 --- a/usr/src/uts/sun4u/io/pci/pcipsy.c +++ b/usr/src/uts/sun4u/io/pci/pcipsy.c @@ -141,7 +141,7 @@ done: mutex_exit(&pci_global_mutex); if (ret != DDI_SUCCESS) cmn_err(CE_NOTE, "Interrupt register failure, returning 0x%x\n", - ret); + ret); return (ret); } @@ -244,10 +244,10 @@ pci_intr_setup(pci_t *pci_p) * Get the interrupts property. */ if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, - "interrupts", (caddr_t)&pci_p->pci_inos, - &pci_p->pci_inos_len) != DDI_SUCCESS) + "interrupts", (caddr_t)&pci_p->pci_inos, + &pci_p->pci_inos_len) != DDI_SUCCESS) cmn_err(CE_PANIC, "%s%d: no interrupts property\n", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); /* * figure out number of interrupts in the "interrupts" property @@ -322,7 +322,7 @@ map_pci_registers(pci_t *pci_p, dev_info_t *dip) if (ddi_regs_map_setup(dip, 0, &pci_p->pci_address[0], 0, 0, &attr, &pci_p->pci_ac[0]) != DDI_SUCCESS) { cmn_err(CE_WARN, "%s%d: unable to map reg entry 0\n", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); return (DDI_FAILURE); } /* @@ -333,7 +333,7 @@ map_pci_registers(pci_t *pci_p, dev_info_t *dip) ddi_regs_map_setup(dip, 2, &pci_p->pci_address[2], 0, 0, &attr, &pci_p->pci_ac[2]) != DDI_SUCCESS) { cmn_err(CE_WARN, "%s%d: unable to map reg entry 2\n", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); ddi_regs_map_free(&pci_p->pci_ac[0]); return (DDI_FAILURE); } @@ -348,7 +348,7 @@ map_pci_registers(pci_t *pci_p, dev_info_t *dip) PCI_CONF_HDR_SIZE, &attr, &pci_p->pci_ac[1]) != DDI_SUCCESS) { cmn_err(CE_WARN, "%s%d: unable to map reg entry 1\n", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); ddi_regs_map_free(&pci_p->pci_ac[0]); if (pci_stream_buf_exists) ddi_regs_map_free(&pci_p->pci_ac[2]); @@ -484,7 +484,7 @@ pci_ib_setup(ib_t *ib_p) ib_p->ib_slot_intr_map_regs = a + PSYCHO_IB_SLOT_INTR_MAP_REG_OFFSET; ib_p->ib_obio_intr_map_regs = a + PSYCHO_IB_OBIO_INTR_MAP_REG_OFFSET; ib_p->ib_obio_clear_intr_regs = - a + PSYCHO_IB_OBIO_CLEAR_INTR_REG_OFFSET; + a + PSYCHO_IB_OBIO_CLEAR_INTR_REG_OFFSET; return (a); } @@ -498,7 +498,7 @@ pci_xlate_intr(dev_info_t *dip, dev_info_t *rdip, ib_t *ib_p, uint32_t intr) if ((intr > PCI_INTD) || (intr < PCI_INTA)) goto done; - if (ddi_prop_exists(DDI_DEV_T_ANY, rdip, NULL, "interrupt-map")) + if (ddi_prop_exists(DDI_DEV_T_ANY, rdip, 0, "interrupt-map")) goto done; /* * Hack for pre 1275 imap machines e.g. quark & tazmo @@ -507,7 +507,7 @@ pci_xlate_intr(dev_info_t *dip, dev_info_t *rdip, ib_t *ib_p, uint32_t intr) */ cdip = get_my_childs_dip(dip, rdip); if (ddi_getlongprop(DDI_DEV_T_ANY, cdip, DDI_PROP_DONTPASS, "reg", - (caddr_t)&pci_rp, &len) != DDI_SUCCESS) + (caddr_t)&pci_rp, &len) != DDI_SUCCESS) return (0); phys_hi = pci_rp->pci_phys_hi; kmem_free(pci_rp, len); @@ -525,7 +525,7 @@ pci_xlate_intr(dev_info_t *dip, dev_info_t *rdip, ib_t *ib_p, uint32_t intr) * if pci bus number > 0x80, then devices are located on the A side(66) */ DEBUG3(DBG_IB, dip, "pci_xlate_intr: bus=%x, dev=%x, intr=%x\n", - bus, dev, intr); + bus, dev, intr); intr--; intr |= (bus & 0x80) ? ((dev - 1) << 2) : (0x10 | ((dev - 2) << 2)); @@ -748,7 +748,7 @@ cb_ino_to_clr_pa(cb_t *cb_p, ib_ino_t ino) */ int cb_remove_xintr(pci_t *pci_p, dev_info_t *dip, dev_info_t *rdip, - ib_ino_t ino, ib_mondo_t mondo) + ib_ino_t ino, ib_mondo_t mondo) { if (ino != pci_p->pci_inos[CBNINTR_THERMAL]) return (DDI_FAILURE); @@ -879,19 +879,19 @@ pbm_configure(pbm_t *pbm_p) * Clear any PBM errors. */ l = (PSYCHO_PCI_AFSR_E_MASK << PSYCHO_PCI_AFSR_PE_SHIFT) | - (PSYCHO_PCI_AFSR_E_MASK << PSYCHO_PCI_AFSR_SE_SHIFT); + (PSYCHO_PCI_AFSR_E_MASK << PSYCHO_PCI_AFSR_SE_SHIFT); *pbm_p->pbm_async_flt_status_reg = l; /* * Clear error bits in configuration status register. */ s = PCI_STAT_PERROR | PCI_STAT_S_PERROR | - PCI_STAT_R_MAST_AB | PCI_STAT_R_TARG_AB | - PCI_STAT_S_TARG_AB | PCI_STAT_S_PERROR; + PCI_STAT_R_MAST_AB | PCI_STAT_R_TARG_AB | + PCI_STAT_S_TARG_AB | PCI_STAT_S_PERROR; DEBUG1(DBG_ATTACH, dip, "pbm_configure: conf status reg=%x\n", s); pbm_p->pbm_config_header->ch_status_reg = s; DEBUG1(DBG_ATTACH, dip, "pbm_configure: conf status reg==%x\n", - pbm_p->pbm_config_header->ch_status_reg); + pbm_p->pbm_config_header->ch_status_reg); l = *pbm_p->pbm_ctrl_reg; /* save control register state */ DEBUG1(DBG_ATTACH, dip, "pbm_configure: ctrl reg==%llx\n", l); @@ -990,7 +990,7 @@ pbm_configure(pbm_t *pbm_p) DEBUG1(DBG_ATTACH, dip, "pbm_configure: conf command reg=%x\n", s); pbm_p->pbm_config_header->ch_command_reg = s; DEBUG1(DBG_ATTACH, dip, "pbm_configure: conf command reg==%x\n", - pbm_p->pbm_config_header->ch_command_reg); + pbm_p->pbm_config_header->ch_command_reg); /* * The current versions of the obp are suppose to set the latency @@ -1002,13 +1002,13 @@ pbm_configure(pbm_t *pbm_p) if (pci_set_latency_timer_register) { DEBUG1(DBG_ATTACH, dip, "pbm_configure: set psycho latency timer to %x\n", - pci_latency_timer); + pci_latency_timer); pbm_p->pbm_config_header->ch_latency_timer_reg = - pci_latency_timer; + pci_latency_timer; } (void) ndi_prop_update_int(DDI_DEV_T_ANY, dip, "latency-timer", - (int)pbm_p->pbm_config_header->ch_latency_timer_reg); + (int)pbm_p->pbm_config_header->ch_latency_timer_reg); } uint_t @@ -1022,7 +1022,7 @@ pbm_disable_pci_errors(pbm_t *pbm_p) * PBM control register. */ *pbm_p->pbm_ctrl_reg &= - ~(PSYCHO_PCI_CTRL_ERR_INT_EN | PSYCHO_PCI_CTRL_SBH_INT_EN); + ~(PSYCHO_PCI_CTRL_ERR_INT_EN | PSYCHO_PCI_CTRL_SBH_INT_EN); /* * Disable error interrupts via the interrupt mapping register. @@ -1066,7 +1066,7 @@ void pci_iommu_config(iommu_t *iommu_p, uint64_t iommu_ctl, uint64_t cfgpa) { volatile uint64_t *pbm_csr_p = (volatile uint64_t *) - get_pbm_reg_base(iommu_p->iommu_pci_p); + get_pbm_reg_base(iommu_p->iommu_pci_p); volatile uint64_t pbm_ctl = *pbm_csr_p; volatile uint64_t *iommu_ctl_p = iommu_p->iommu_ctrl_reg; @@ -1074,13 +1074,13 @@ pci_iommu_config(iommu_t *iommu_p, uint64_t iommu_ctl, uint64_t cfgpa) volatile uint64_t *tsb_bar_p = iommu_p->iommu_tsb_base_addr_reg; DEBUG2(DBG_ATTACH, iommu_p->iommu_pci_p->pci_dip, - "\npci_iommu_config: pbm_csr_p=%016llx pbm_ctl=%016llx", - pbm_csr_p, pbm_ctl); + "\npci_iommu_config: pbm_csr_p=%016llx pbm_ctl=%016llx", + pbm_csr_p, pbm_ctl); DEBUG2(DBG_ATTACH|DBG_CONT, iommu_p->iommu_pci_p->pci_dip, - "\n\tiommu_ctl_p=%016llx iommu_ctl=%016llx", - iommu_ctl_p, iommu_ctl); + "\n\tiommu_ctl_p=%016llx iommu_ctl=%016llx", + iommu_ctl_p, iommu_ctl); DEBUG2(DBG_ATTACH|DBG_CONT, iommu_p->iommu_pci_p->pci_dip, - "\n\tcfgpa=%016llx tsb_bar_val=%016llx", cfgpa, tsb_bar_val); + "\n\tcfgpa=%016llx tsb_bar_val=%016llx", cfgpa, tsb_bar_val); if (!cfgpa) goto reprog; @@ -1167,17 +1167,17 @@ pci_iommu_setup(iommu_t *iommu_p) uint_t tsb_size_prop; if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, - "virtual-dma", (caddr_t)&dvma_prop, &dvma_prop_len) != - DDI_PROP_SUCCESS) + "virtual-dma", (caddr_t)&dvma_prop, &dvma_prop_len) != + DDI_PROP_SUCCESS) goto tsb_done; if (dvma_prop_len != sizeof (pci_dvma_range_prop_t)) { cmn_err(CE_WARN, "%s%d: invalid virtual-dma property", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); goto tsb_end; } iommu_p->iommu_dvma_end = dvma_prop->dvma_base + - (dvma_prop->dvma_len - 1); + (dvma_prop->dvma_len - 1); tsb_size_prop = IOMMU_BTOP(dvma_prop->dvma_len) * sizeof (uint64_t); tsb_size = MIN(tsb_size_prop, tsb_size); tsb_end: @@ -1214,7 +1214,7 @@ uintptr_t get_pbm_reg_base(pci_t *pci_p) { return ((uintptr_t)(pci_p->pci_address[0] + - (pci_stream_buf_exists ? 0 : PSYCHO_PCI_PBM_REG_BASE))); + (pci_stream_buf_exists ? 0 : PSYCHO_PCI_PBM_REG_BASE))); } void @@ -1237,7 +1237,7 @@ pci_pbm_setup(pbm_t *pbm_p) * This should be mapped little-endian. */ pbm_p->pbm_config_header = - (config_header_t *)get_config_reg_base(pci_p); + (config_header_t *)get_config_reg_base(pci_p); /* * Get the virtual addresses for control, error and diag @@ -1246,13 +1246,13 @@ pci_pbm_setup(pbm_t *pbm_p) pbm_p->pbm_ctrl_reg = (uint64_t *)(a + PSYCHO_PCI_CTRL_REG_OFFSET); pbm_p->pbm_diag_reg = (uint64_t *)(a + PSYCHO_PCI_DIAG_REG_OFFSET); pbm_p->pbm_async_flt_status_reg = - (uint64_t *)(a + PSYCHO_PCI_ASYNC_FLT_STATUS_REG_OFFSET); + (uint64_t *)(a + PSYCHO_PCI_ASYNC_FLT_STATUS_REG_OFFSET); pbm_p->pbm_async_flt_addr_reg = - (uint64_t *)(a + PSYCHO_PCI_ASYNC_FLT_ADDR_REG_OFFSET); + (uint64_t *)(a + PSYCHO_PCI_ASYNC_FLT_ADDR_REG_OFFSET); if (CHIP_TYPE(pci_p) >= PCI_CHIP_SABRE) pbm_p->pbm_sync_reg_pa = - pci_p->pci_cb_p->cb_base_pa + DMA_WRITE_SYNC_REG; + pci_p->pci_cb_p->cb_base_pa + DMA_WRITE_SYNC_REG; } /*ARGSUSED*/ @@ -1282,18 +1282,18 @@ pci_sc_setup(sc_t *sc_p) a = get_reg_base(pci_p); if (pci_p->pci_bus_range.lo != 0) { sc_p->sc_data_diag_acc = (uint64_t *) - (a + PSYCHO_SC_A_DATA_DIAG_OFFSET); + (a + PSYCHO_SC_A_DATA_DIAG_OFFSET); sc_p->sc_tag_diag_acc = (uint64_t *) - (a + PSYCHO_SC_A_TAG_DIAG_OFFSET); + (a + PSYCHO_SC_A_TAG_DIAG_OFFSET); sc_p->sc_ltag_diag_acc = (uint64_t *) - (a + PSYCHO_SC_A_LTAG_DIAG_OFFSET); + (a + PSYCHO_SC_A_LTAG_DIAG_OFFSET); } else { sc_p->sc_data_diag_acc = (uint64_t *) - (a + PSYCHO_SC_B_DATA_DIAG_OFFSET); + (a + PSYCHO_SC_B_DATA_DIAG_OFFSET); sc_p->sc_tag_diag_acc = (uint64_t *) - (a + PSYCHO_SC_B_TAG_DIAG_OFFSET); + (a + PSYCHO_SC_B_TAG_DIAG_OFFSET); sc_p->sc_ltag_diag_acc = (uint64_t *) - (a + PSYCHO_SC_B_LTAG_DIAG_OFFSET); + (a + PSYCHO_SC_B_LTAG_DIAG_OFFSET); } } @@ -1301,7 +1301,7 @@ int pci_get_numproxy(dev_info_t *dip) { return (ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, - "#upa-interrupt-proxies", 1)); + "#upa-interrupt-proxies", 1)); } int @@ -1334,7 +1334,7 @@ pbm_has_pass_1_cheerio(pci_t *pci_p) if (strcmp(s, "ebus") == 0 || strcmp(s, "pci108e,1000") == 0) { rev = ddi_getprop(DDI_DEV_T_ANY, cdip, DDI_PROP_DONTPASS, - "revision-id", 0); + "revision-id", 0); if (rev == 0) found = 1; } @@ -1371,17 +1371,17 @@ void pci_kstat_init() { pci_name_kstat = (pci_ksinfo_t *)kmem_alloc(sizeof (pci_ksinfo_t), - KM_NOSLEEP); + KM_NOSLEEP); if (pci_name_kstat == NULL) { cmn_err(CE_WARN, "pcipsy : no space for kstat\n"); } else { pci_name_kstat->pic_no_evs = - sizeof (psycho_pci_events) / sizeof (pci_kev_mask_t); + sizeof (psycho_pci_events) / sizeof (pci_kev_mask_t); pci_name_kstat->pic_shift[0] = PSYCHO_SHIFT_PIC0; pci_name_kstat->pic_shift[1] = PSYCHO_SHIFT_PIC1; pci_create_name_kstat("pcip", - pci_name_kstat, psycho_pci_events); + pci_name_kstat, psycho_pci_events); } } @@ -1416,14 +1416,14 @@ pci_rem_pci_kstat(pci_t *pci_p) void pci_add_upstream_kstat(pci_t *pci_p) { - pci_common_t *cmn_p = pci_p->pci_common_p; + pci_common_t *cmn_p = pci_p->pci_common_p; pci_cntr_pa_t *cntr_pa_p = &cmn_p->pci_cmn_uks_pa; uint64_t regbase = va_to_pa((void *)get_reg_base(pci_p)); cntr_pa_p->pcr_pa = regbase + PSYCHO_PERF_PCR_OFFSET; cntr_pa_p->pic_pa = regbase + PSYCHO_PERF_PIC_OFFSET; cmn_p->pci_common_uksp = pci_create_cntr_kstat(pci_p, "pcip", - NUM_OF_PICS, pci_cntr_kstat_pa_update, cntr_pa_p); + NUM_OF_PICS, pci_cntr_kstat_pa_update, cntr_pa_p); } /* @@ -1445,7 +1445,7 @@ pci_identity_init(pci_t *pci_p) if (strcmp(name, "pci108e,a001") == 0) return (CHIP_ID(PCI_CHIP_HUMMINGBIRD, 0x00, 0x00)); cmn_err(CE_CONT, "?%s%d:using default chip identity\n", - ddi_driver_name(dip), ddi_get_instance(dip)); + ddi_driver_name(dip), ddi_get_instance(dip)); return (CHIP_ID(PCI_CHIP_PSYCHO, 0x00, 0x00)); } @@ -1566,13 +1566,13 @@ pci_ecc_classify(uint64_t err, ecc_errstate_t *ecc_err_p) * Get the parent bus id that caused the error. */ ecc_err_p->ecc_dev_id = (ecc_err_p->ecc_afsr & PSYCHO_ECC_UE_AFSR_ID) - >> PSYCHO_ECC_UE_AFSR_ID_SHIFT; + >> PSYCHO_ECC_UE_AFSR_ID_SHIFT; /* * Determine the doubleword offset of the error. */ ecc_err_p->ecc_dw_offset = (ecc_err_p->ecc_afsr & - PSYCHO_ECC_UE_AFSR_DW_OFFSET) - >> PSYCHO_ECC_UE_AFSR_DW_OFFSET_SHIFT; + PSYCHO_ECC_UE_AFSR_DW_OFFSET) + >> PSYCHO_ECC_UE_AFSR_DW_OFFSET_SHIFT; /* * Determine the primary error type. */ @@ -1586,7 +1586,7 @@ pci_ecc_classify(uint64_t err, ecc_errstate_t *ecc_err_p) ecc->flt_panic = ecc_ue_is_fatal(&ecc_err_p->ecc_aflt); } else { ecc->flt_erpt_class = ecc_err_p->ecc_pri ? - PCI_ECC_PIO_CE : PCI_ECC_SEC_PIO_CE; + PCI_ECC_PIO_CE : PCI_ECC_SEC_PIO_CE; return; } } else if (err & COMMON_ECC_AFSR_E_DRD) { @@ -1599,7 +1599,7 @@ pci_ecc_classify(uint64_t err, ecc_errstate_t *ecc_err_p) ecc->flt_panic = ecc_ue_is_fatal(&ecc_err_p->ecc_aflt); } else { ecc->flt_erpt_class = ecc_err_p->ecc_pri ? - PCI_ECC_DRD_CE : PCI_ECC_SEC_DRD_CE; + PCI_ECC_DRD_CE : PCI_ECC_SEC_DRD_CE; return; } } else if (err & COMMON_ECC_AFSR_E_DWR) { @@ -1612,7 +1612,7 @@ pci_ecc_classify(uint64_t err, ecc_errstate_t *ecc_err_p) ecc->flt_panic = ecc_ue_is_fatal(&ecc_err_p->ecc_aflt); } else { ecc->flt_erpt_class = ecc_err_p->ecc_pri ? - PCI_ECC_DWR_CE : PCI_ECC_SEC_DWR_CE; + PCI_ECC_DWR_CE : PCI_ECC_SEC_DWR_CE; return; } } @@ -1622,7 +1622,7 @@ ushort_t pci_ecc_get_synd(uint64_t afsr) { return ((ushort_t)((afsr & PSYCHO_ECC_CE_AFSR_SYND) - >> PSYCHO_ECC_CE_AFSR_SYND_SHIFT)); + >> PSYCHO_ECC_CE_AFSR_SYND_SHIFT)); } /* @@ -1681,13 +1681,13 @@ pci_clear_error(pci_t *pci_p, pbm_errstate_t *pbm_err_p) *pbm_p->pbm_ctrl_reg = pbm_err_p->pbm_ctl_stat; *pbm_p->pbm_async_flt_status_reg = pbm_err_p->pbm_afsr; pbm_p->pbm_config_header->ch_status_reg = - pbm_err_p->pbm_pci.pci_cfg_stat; + pbm_err_p->pbm_pci.pci_cfg_stat; } /*ARGSUSED*/ int pci_pbm_err_handler(dev_info_t *dip, ddi_fm_error_t *derr, - const void *impl_data, int caller) + const void *impl_data, int caller) { int fatal = 0; int nonfatal = 0; @@ -1850,11 +1850,11 @@ pci_check_error(pci_t *pci_p) pbm_afsr = *pbm_p->pbm_async_flt_status_reg; if ((pci_cfg_stat & (PCI_STAT_S_PERROR | PCI_STAT_S_TARG_AB | - PCI_STAT_R_TARG_AB | PCI_STAT_R_MAST_AB | - PCI_STAT_S_SYSERR | PCI_STAT_PERROR)) || - (pbm_ctl_stat & (COMMON_PCI_CTRL_SBH_ERR | - COMMON_PCI_CTRL_SERR)) || - (PBM_AFSR_TO_PRIERR(pbm_afsr))) + PCI_STAT_R_TARG_AB | PCI_STAT_R_MAST_AB | + PCI_STAT_S_SYSERR | PCI_STAT_PERROR)) || + (pbm_ctl_stat & (COMMON_PCI_CTRL_SBH_ERR | + COMMON_PCI_CTRL_SERR)) || + (PBM_AFSR_TO_PRIERR(pbm_afsr))) return (1); return (0); @@ -1879,10 +1879,10 @@ pci_pbm_errstate_get(pci_t *pci_p, pbm_errstate_t *pbm_err_p) */ pbm_err_p->pbm_bridge_type = PCI_BRIDGE_TYPE(pci_p->pci_common_p); pbm_err_p->pbm_pci.pci_cfg_stat = - pbm_p->pbm_config_header->ch_status_reg; + pbm_p->pbm_config_header->ch_status_reg; pbm_err_p->pbm_ctl_stat = *pbm_p->pbm_ctrl_reg; pbm_err_p->pbm_pci.pci_cfg_comm = - pbm_p->pbm_config_header->ch_command_reg; + pbm_p->pbm_config_header->ch_command_reg; pbm_err_p->pbm_afsr = *pbm_p->pbm_async_flt_status_reg; pbm_err_p->pbm_afar = *pbm_p->pbm_async_flt_addr_reg; pbm_err_p->pbm_pci.pci_pa = *pbm_p->pbm_async_flt_addr_reg; @@ -1959,7 +1959,7 @@ pci_thermal_rem_intr(dev_info_t *rdip, uint_t inum) pci_t *pci_p; dev_info_t *pdip; uint32_t dev_mondo, pci_mondo; - int instance; + int instance; for (pdip = ddi_get_parent(rdip); pdip; pdip = ddi_get_parent(pdip)) { if (strcmp(ddi_driver_name(pdip), "pcipsy") == 0) diff --git a/usr/src/uts/sun4u/io/pci/pcix.c b/usr/src/uts/sun4u/io/pci/pcix.c index 8264ac83d6..8e8c8d198e 100644 --- a/usr/src/uts/sun4u/io/pci/pcix.c +++ b/usr/src/uts/sun4u/io/pci/pcix.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kmem.h> #include <sys/async.h> @@ -52,33 +50,33 @@ pcix_set_cmd_reg(dev_info_t *child, uint16_t value) * Only modify the Command Register of non-bridge functions. */ if ((pci_config_get8(handle, PCI_CONF_HEADER) & PCI_HEADER_TYPE_M) - == PCI_HEADER_PPB) + == PCI_HEADER_PPB) goto teardown; if (PCI_CAP_LOCATE(handle, PCI_CAP_ID_PCIX, &pcix_cap_ptr) == - DDI_FAILURE) + DDI_FAILURE) goto teardown; DEBUG1(DBG_INIT_CLD, child, "pcix_set_cmd_reg: pcix_cap_ptr = %x\n", - pcix_cap_ptr); + pcix_cap_ptr); /* * Read the PCI-X Command Register. */ - if ((pcix_cmd = PCI_CAP_GET16(handle, NULL, pcix_cap_ptr, 2)) - == PCI_CAP_EINVAL16) + if ((pcix_cmd = PCI_CAP_GET16(handle, 0, pcix_cap_ptr, 2)) + == PCI_CAP_EINVAL16) goto teardown; DEBUG1(DBG_INIT_CLD, child, "pcix_set_cmd_reg: PCI-X CMD Register " - "(Before) %x\n", pcix_cmd); + "(Before) %x\n", pcix_cmd); pcix_cmd &= ~(0x1f << 2); /* clear bits 6-2 */ pcix_cmd |= value; DEBUG1(DBG_INIT_CLD, child, "pcix_set_cmd_reg: PCI-X CMD Register " - "(After) %x\n", pcix_cmd); + "(After) %x\n", pcix_cmd); - PCI_CAP_PUT16(handle, NULL, pcix_cap_ptr, 2, pcix_cmd); + PCI_CAP_PUT16(handle, 0, pcix_cap_ptr, 2, pcix_cmd); teardown: pci_config_teardown(&handle); diff --git a/usr/src/uts/sun4u/lm75/Makefile b/usr/src/uts/sun4u/lm75/Makefile index 6f73077389..deabaede8c 100644 --- a/usr/src/uts/sun4u/lm75/Makefile +++ b/usr/src/uts/sun4u/lm75/Makefile @@ -22,10 +22,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the lm75 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = lm75 OBJECTS = $(LM75_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(LM75_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -45,18 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -69,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/os/fillsysinfo.c b/usr/src/uts/sun4u/os/fillsysinfo.c index f90a3a2c72..62bac4dd53 100644 --- a/usr/src/uts/sun4u/os/fillsysinfo.c +++ b/usr/src/uts/sun4u/os/fillsysinfo.c @@ -1153,7 +1153,7 @@ have_eeprom(pnode_t node) /* * If we have a chosen eeprom and it is not this node, keep looking. */ - if (chosen_eeprom != NULL && chosen_eeprom != node) { + if (chosen_eeprom != 0 && chosen_eeprom != node) { v_timecheck_addr = (caddr_t)(uintptr_t)eaddr; return; } diff --git a/usr/src/uts/sun4u/os/mach_cpu_states.c b/usr/src/uts/sun4u/os/mach_cpu_states.c index 4481efa2fe..bb18efa79d 100644 --- a/usr/src/uts/sun4u/os/mach_cpu_states.c +++ b/usr/src/uts/sun4u/os/mach_cpu_states.c @@ -100,7 +100,7 @@ mdboot(int cmd, int fcn, char *bootstr, boolean_t invoke_cb) devtree_freeze(); if (invoke_cb) - (void) callb_execute_class(CB_CL_MDBOOT, NULL); + (void) callb_execute_class(CB_CL_MDBOOT, 0); /* * Clear any unresolved UEs from memory. @@ -252,7 +252,7 @@ panic_stopcpus(cpu_t *cp, kthread_t *t, int spl) (void) splzs(); CPUSET_ALL_BUT(cps, cp->cpu_id); - xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, NULL); + xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, 0); for (i = 0; i < NCPU; i++) { if (i != cp->cpu_id && CPU_XCALL_READY(i)) { diff --git a/usr/src/uts/sun4u/pcf8574/Makefile b/usr/src/uts/sun4u/pcf8574/Makefile index c5ac0684be..6913ee45dd 100644 --- a/usr/src/uts/sun4u/pcf8574/Makefile +++ b/usr/src/uts/sun4u/pcf8574/Makefile @@ -22,10 +22,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the pcf8574 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = pcf8574 OBJECTS = $(PCF8574_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PCF8574_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -45,18 +40,12 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - LDFLAGS += -dy -N misc/i2c_svc # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: @@ -69,12 +58,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/pcipsy/Makefile b/usr/src/uts/sun4u/pcipsy/Makefile index 1857d38f95..5e9f64bd07 100644 --- a/usr/src/uts/sun4u/pcipsy/Makefile +++ b/usr/src/uts/sun4u/pcipsy/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = pcipsy OBJECTS = $(PSYCHO_PCI_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PSYCHO_PCI_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -52,30 +51,13 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW - CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-function @@ -93,12 +75,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/rootnex/Makefile b/usr/src/uts/sun4u/rootnex/Makefile index e1f3d0657b..6f9a01fa67 100644 --- a/usr/src/uts/sun4u/rootnex/Makefile +++ b/usr/src/uts/sun4u/rootnex/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = rootnex OBJECTS = $(ROOTNEX_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ROOTNEX_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -60,23 +59,8 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses @@ -95,12 +79,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4u/zsh/Makefile b/usr/src/uts/sun4u/zsh/Makefile index dfefb38063..22dac14bcb 100644 --- a/usr/src/uts/sun4u/zsh/Makefile +++ b/usr/src/uts/sun4u/zsh/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = zsh OBJECTS = $(ZSH_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ZSH_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun/io @@ -52,28 +51,13 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Defined dependency on zs # LDFLAGS += -dy -N drv/zs -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW - CERRWARN += -_gcc=-Wno-parentheses # @@ -89,12 +73,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/os/intrq.c b/usr/src/uts/sun4v/os/intrq.c index 329956b7dc..f104643e9c 100644 --- a/usr/src/uts/sun4v/os/intrq.c +++ b/usr/src/uts/sun4v/os/intrq.c @@ -195,7 +195,7 @@ cpu_intrq_cleanup(struct cpu *cpu) if (mcpup->mondo_data) { contig_mem_free(mcpup->mondo_data, INTR_REPORT_SIZE); mcpup->mondo_data = NULL; - mcpup->mondo_data_ra = NULL; + mcpup->mondo_data_ra = 0; } /* @@ -216,7 +216,7 @@ cpu_intrq_cleanup(struct cpu *cpu) if (mcpup->cpu_list) { contig_mem_free(mcpup->cpu_list, cpu_list_size); mcpup->cpu_list = NULL; - mcpup->cpu_list_ra = NULL; + mcpup->cpu_list_ra = 0; } /* @@ -226,7 +226,7 @@ cpu_intrq_cleanup(struct cpu *cpu) cpu_q_size = cpu_q_entries * INTR_REPORT_SIZE; contig_mem_free(mcpup->cpu_q_va, cpu_q_size); mcpup->cpu_q_va = NULL; - mcpup->cpu_q_base_pa = NULL; + mcpup->cpu_q_base_pa = 0; mcpup->cpu_q_size = 0; } @@ -234,7 +234,7 @@ cpu_intrq_cleanup(struct cpu *cpu) dev_q_size = dev_q_entries * INTR_REPORT_SIZE; contig_mem_free(mcpup->dev_q_va, dev_q_size); mcpup->dev_q_va = NULL; - mcpup->dev_q_base_pa = NULL; + mcpup->dev_q_base_pa = 0; mcpup->dev_q_size = 0; } @@ -242,7 +242,7 @@ cpu_intrq_cleanup(struct cpu *cpu) cpu_rq_size = cpu_rq_entries * Q_ENTRY_SIZE; contig_mem_free(mcpup->cpu_rq_va, 2 * cpu_rq_size); mcpup->cpu_rq_va = NULL; - mcpup->cpu_rq_base_pa = NULL; + mcpup->cpu_rq_base_pa = 0; mcpup->cpu_rq_size = 0; } @@ -250,7 +250,7 @@ cpu_intrq_cleanup(struct cpu *cpu) cpu_nrq_size = cpu_nrq_entries * Q_ENTRY_SIZE; contig_mem_free(mcpup->cpu_nrq_va, 2 * cpu_nrq_size); mcpup->cpu_nrq_va = NULL; - mcpup->cpu_nrq_base_pa = NULL; + mcpup->cpu_nrq_base_pa = 0; mcpup->cpu_nrq_size = 0; } } diff --git a/usr/src/uts/sun4v/os/mach_cpu_states.c b/usr/src/uts/sun4v/os/mach_cpu_states.c index f26f840967..9b72de9330 100644 --- a/usr/src/uts/sun4v/os/mach_cpu_states.c +++ b/usr/src/uts/sun4v/os/mach_cpu_states.c @@ -279,7 +279,7 @@ mdboot(int cmd, int fcn, char *bootstr, boolean_t invoke_cb) devtree_freeze(); if (invoke_cb) - (void) callb_execute_class(CB_CL_MDBOOT, NULL); + (void) callb_execute_class(CB_CL_MDBOOT, 0); /* * Clear any unresolved UEs from memory. @@ -380,7 +380,7 @@ panic_stopcpus(cpu_t *cp, kthread_t *t, int spl) (void) splzs(); CPUSET_ALL_BUT(cps, cp->cpu_id); - xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, NULL); + xt_some(cps, (xcfunc_t *)idle_stop_xcall, (uint64_t)&panic_idle, 0); for (i = 0; i < NCPU; i++) { if (i != cp->cpu_id && CPU_XCALL_READY(i)) { @@ -589,8 +589,8 @@ ptl1_panic_handler(ptl1_state_t *pstate) "CPU ECC error loop", /* PTL1_BAD_ECC */ "unexpected error from hypervisor call", /* PTL1_BAD_HCALL */ "unexpected global level(%gl)", /* PTL1_BAD_GL */ - "Watchdog Reset", /* PTL1_BAD_WATCHDOG */ - "unexpected RED mode trap", /* PTL1_BAD_RED */ + "Watchdog Reset", /* PTL1_BAD_WATCHDOG */ + "unexpected RED mode trap", /* PTL1_BAD_RED */ "return value EINVAL from hcall: "\ "UNMAP_PERM_ADDR", /* PTL1_BAD_HCALL_UNMAP_PERM_EINVAL */ "return value ENOMAP from hcall: "\ diff --git a/usr/src/uts/sun4v/os/mach_startup.c b/usr/src/uts/sun4v/os/mach_startup.c index 5962239aef..983cdfbd5d 100644 --- a/usr/src/uts/sun4v/os/mach_startup.c +++ b/usr/src/uts/sun4v/os/mach_startup.c @@ -362,7 +362,7 @@ mach_htraptrace_setup(int cpuid) contig_mem_alloc_align(HTRAP_TSIZE, HTRAP_TSIZE); if (ctlp->d.hvaddr_base == NULL) { ctlp->d.hlimit = 0; - ctlp->d.hpaddr_base = NULL; + ctlp->d.hpaddr_base = 0; cmn_err(CE_WARN, "!cpu%d: failed to allocate HV " "traptrace buffer", cpuid); } else { @@ -425,7 +425,7 @@ mach_htraptrace_configure(int cpuid) if (ret != H_EOK) { ctlp->d.hvaddr_base = NULL; ctlp->d.hlimit = 0; - ctlp->d.hpaddr_base = NULL; + ctlp->d.hpaddr_base = 0; } } } else { @@ -438,7 +438,7 @@ mach_htraptrace_configure(int cpuid) htrap_tr0_inuse = 0; ctlp->d.hvaddr_base = NULL; ctlp->d.hlimit = 0; - ctlp->d.hpaddr_base = NULL; + ctlp->d.hpaddr_base = 0; } else cmn_err(CE_WARN, "!cpu%d: HV traptracing is not disabled, " @@ -468,7 +468,7 @@ mach_htraptrace_cleanup(int cpuid) } ctlp->d.hvaddr_base = NULL; ctlp->d.hlimit = 0; - ctlp->d.hpaddr_base = NULL; + ctlp->d.hpaddr_base = 0; } } diff --git a/usr/src/uts/sun4v/os/mpo.c b/usr/src/uts/sun4v/os/mpo.c index ad0cf0e78a..12b572db72 100644 --- a/usr/src/uts/sun4v/os/mpo.c +++ b/usr/src/uts/sun4v/os/mpo.c @@ -148,8 +148,8 @@ static int szc_mask0 = 0; /* Save mblocks from the MD */ #define SMALL_MBLOCKS_COUNT 8 -static struct mblock_md *mpo_mblock; -static struct mblock_md small_mpo_mblocks[SMALL_MBLOCKS_COUNT]; +static struct mblock_md *mpo_mblock; +static struct mblock_md small_mpo_mblocks[SMALL_MBLOCKS_COUNT]; static int n_mblocks = 0; /* Save mem_node stripes calculate from mblocks and lgroups. */ @@ -191,7 +191,7 @@ static void mnode_update(mpo_config_t *, pfn_t, pfn_t, update_t); /* Debug support */ #if defined(DEBUG) && !defined(lint) -#define VALIDATE_SLICE(base, end) { \ +#define VALIDATE_SLICE(base, end) { \ ASSERT(IS_P2ALIGNED(ptob(base), TTEBYTES(TTE256M))); \ ASSERT(IS_P2ALIGNED(ptob(end - base + 1), TTEBYTES(TTE256M))); \ } @@ -307,7 +307,7 @@ cpuid_to_cpunode(md_t *md, int cpuid) { mde_cookie_t rootnode, foundnode, *cpunodes; uint64_t cpuid_prop; - int n_cpunodes, i; + int n_cpunodes, i; if (md == NULL) return (MDE_INVAL_ELEM_COOKIE); @@ -1333,7 +1333,7 @@ valid_pages(md_t *md, mde_cookie_t cpu0) * to get a sane mask. */ - if (cpu0 == NULL) + if (cpu0 == 0) szc_mask = szc_mask0; else { if (md_get_prop_val(md, cpu0, "mmu-page-size-list", &szc_mask)) diff --git a/usr/src/uts/sun4v/os/suspend.c b/usr/src/uts/sun4v/os/suspend.c index e81eb001a9..2d91c6da49 100644 --- a/usr/src/uts/sun4v/os/suspend.c +++ b/usr/src/uts/sun4v/os/suspend.c @@ -669,7 +669,7 @@ suspend_start(char *error_reason, size_t max_reason_len) /* Set the {%tick,%stick}.NPT bits on all CPUs */ if (enable_user_tick_stick_emulation) { - xc_all((xcfunc_t *)enable_tick_stick_npt, NULL, NULL); + xc_all((xcfunc_t *)enable_tick_stick_npt, 0, 0); xt_sync(cpu_ready_set); ASSERT(gettick_npt() != 0); ASSERT(getstick_npt() != 0); diff --git a/usr/src/uts/sun4v/rootnex/Makefile b/usr/src/uts/sun4v/rootnex/Makefile index 004b5140c2..fc8e37b5f9 100644 --- a/usr/src/uts/sun4v/rootnex/Makefile +++ b/usr/src/uts/sun4v/rootnex/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = rootnex OBJECTS = $(ROOTNEX_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ROOTNEX_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -60,29 +59,14 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) # -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_STATIC_UNUSED - -# # Default build targets. # .KEEP_STATE: @@ -95,12 +79,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # diff --git a/usr/src/uts/sun4v/vm/mach_sfmmu.c b/usr/src/uts/sun4v/vm/mach_sfmmu.c index 398d0a069b..fcef120c0b 100644 --- a/usr/src/uts/sun4v/vm/mach_sfmmu.c +++ b/usr/src/uts/sun4v/vm/mach_sfmmu.c @@ -316,7 +316,7 @@ kdi_tlb_page_unlock(caddr_t va, int do_dtlb) void sfmmu_clear_utsbinfo() { - (void) hv_set_ctxnon0(0, NULL); + (void) hv_set_ctxnon0(0, 0); } /* |