diff options
Diffstat (limited to 'usr/src/uts')
213 files changed, 2274 insertions, 2301 deletions
diff --git a/usr/src/uts/Makefile.targ b/usr/src/uts/Makefile.targ index 478fa86190..4a64d3a4c2 100644 --- a/usr/src/uts/Makefile.targ +++ b/usr/src/uts/Makefile.targ @@ -24,6 +24,7 @@ # Copyright 2014 Garrett D'Amore <garrett@damore.org> # Copyright 2016 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> # Copyright (c) 2017 by Delphix. All rights reserved. +# Copyright 2019 Joyent, Inc. # # This Makefiles contains the common targets and definitions for # all kernels. It is to be included in the Makefiles for specific diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index ce7b7a3e6a..720701371d 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -110,6 +110,7 @@ GENUNIX_OBJS += \ bio.o \ bitmap.o \ blabel.o \ + bootbanner.o \ brandsys.o \ bz2blocksort.o \ bz2compress.o \ diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index 8a906a2e25..bb80ca63c4 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -26,6 +26,7 @@ # Copyright 2020 Joyent, Inc. # Copyright 2018 Nexenta Systems, Inc. # Copyright (c) 2017 by Delphix. All rights reserved. +# Copyright 2020 Oxide Computer Company # # @@ -1563,6 +1564,10 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/krtld/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) +$(OBJS_DIR)/%.o: $(COMMONBASE)/bootbanner/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + $(OBJS_DIR)/%.o: $(COMMONBASE)/list/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) @@ -1591,6 +1596,13 @@ $(OBJS_DIR)/%.o: $(COMMONBASE)/refhash/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) +$(OBJS_DIR)/bootbanner.o := CPPFLAGS += \ + -DBOOTBANNER1='"$(BOOTBANNER1)"' \ + -DBOOTBANNER2='"$(BOOTBANNER2)"' \ + -DBOOTBANNER3='"$(BOOTBANNER3)"' \ + -DBOOTBANNER4='"$(BOOTBANNER4)"' \ + -DBOOTBANNER5='"$(BOOTBANNER5)"' + $(OBJS_DIR)/%.o: $(UTSBASE)/common/os/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/uts/common/brand/lx/os/lx_brand.c b/usr/src/uts/common/brand/lx/os/lx_brand.c index fed6be37cf..c7e5351778 100644 --- a/usr/src/uts/common/brand/lx/os/lx_brand.c +++ b/usr/src/uts/common/brand/lx/os/lx_brand.c @@ -25,7 +25,7 @@ */ /* - * Copyright 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. */ /* @@ -1402,8 +1402,15 @@ lx_brandsys(int cmd, int64_t *rval, uintptr_t arg1, uintptr_t arg2, if (p->p_brand == NULL) return (ENOSYS); - VERIFY(p->p_brand == &lx_brand); - VERIFY(p->p_brand_data != NULL); + /* + * Certain native applications may wish to start the lx_lockd process. + * Every other process that's not branded should be denied. + */ + if (p->p_brand != &lx_brand && cmd != B_START_NFS_LOCKD) + return (ENOSYS); + + if (cmd != B_START_NFS_LOCKD) + VERIFY(p->p_brand_data != NULL); switch (cmd) { case B_REGISTER: diff --git a/usr/src/uts/common/brand/lx/os/lx_lockd.c b/usr/src/uts/common/brand/lx/os/lx_lockd.c index d6d965398a..37b744b0e8 100644 --- a/usr/src/uts/common/brand/lx/os/lx_lockd.c +++ b/usr/src/uts/common/brand/lx/os/lx_lockd.c @@ -297,6 +297,18 @@ lx_upcall_statd(int op, struct nlm_globals *g, struct nlm_host *host) * as we pass to monitor, so that is also handled here by this same * brand hook. */ + + /* + * If the NLM was set up to be "v4 only" (i.e. no RPC call handlers + * to localhost at configure time), the semaphore is uninitialized, + * and will indefinitely hang. FURTHERMORE if just the semaphore + * was initialized, we'd still panic with a NULL nsm->ns_handle. + */ + if (g->nlm_v4_only) { + stat = RPC_SYSTEMERROR; + goto bail; + } + nlm_netbuf_to_netobj(&host->nh_addr, &family, &obj); nsm = &g->nlm_nsm; @@ -327,6 +339,7 @@ lx_upcall_statd(int op, struct nlm_globals *g, struct nlm_host *host) } sema_v(&nsm->ns_sem); +bail: if (stat != RPC_SUCCESS) { NLM_WARN("Failed to contact local statd, stat=%d", stat); if (op == SM_MON) { diff --git a/usr/src/uts/common/brand/lx/sys/lx_brand.h b/usr/src/uts/common/brand/lx/sys/lx_brand.h index 90d87d78a8..85aa5e34bd 100644 --- a/usr/src/uts/common/brand/lx/sys/lx_brand.h +++ b/usr/src/uts/common/brand/lx/sys/lx_brand.h @@ -94,6 +94,7 @@ extern "C" { #define B_LPID_TO_SPAIR 128 #define B_GET_CURRENT_CONTEXT 129 #define B_EMULATION_DONE 130 +/* Some native programs use B_START_NFS_LOCKD, so don't change this. */ #define B_START_NFS_LOCKD 131 #define B_BLOCK_ALL_SIGS 132 #define B_UNBLOCK_ALL_SIGS 133 diff --git a/usr/src/uts/common/fs/zfs/dsl_scan.c b/usr/src/uts/common/fs/zfs/dsl_scan.c index b619719ba9..fa7b9fb2fc 100644 --- a/usr/src/uts/common/fs/zfs/dsl_scan.c +++ b/usr/src/uts/common/fs/zfs/dsl_scan.c @@ -24,7 +24,7 @@ * Copyright 2016 Gary Mills * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright 2019 Joyent, Inc. - * Copyright (c) 2017 Datto Inc. + * Copyright (c) 2017, 2019, Datto Inc. All rights reserved. */ #include <sys/dsl_scan.h> @@ -549,6 +549,22 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg) zfs_dbgmsg("new-style scrub was modified " "by old software; restarting in txg %llu", (longlong_t)scn->scn_restart_txg); + } else if (dsl_scan_resilvering(dp)) { + /* + * If a resilver is in progress and there are already + * errors, restart it instead of finishing this scan and + * then restarting it. If there haven't been any errors + * then remember that the incore DTL is valid. + */ + if (scn->scn_phys.scn_errors > 0) { + scn->scn_restart_txg = txg; + zfs_dbgmsg("resilver can't excise DTL_MISSING " + "when finished; restarting in txg %llu", + (u_longlong_t)scn->scn_restart_txg); + } else { + /* it's safe to excise DTL when finished */ + spa->spa_scrub_started = B_TRUE; + } } } @@ -599,6 +615,13 @@ dsl_scan_restarting(dsl_scan_t *scn, dmu_tx_t *tx) } boolean_t +dsl_scan_resilver_scheduled(dsl_pool_t *dp) +{ + return ((dp->dp_scan && dp->dp_scan->scn_restart_txg != 0) || + (spa_async_tasks(dp->dp_spa) & SPA_ASYNC_RESILVER)); +} + +boolean_t dsl_scan_scrubbing(const dsl_pool_t *dp) { dsl_scan_phys_t *scn_phys = &dp->dp_scan->scn_phys; @@ -794,7 +817,7 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func) (void) spa_vdev_state_exit(spa, NULL, 0); if (func == POOL_SCAN_RESILVER) { - dsl_resilver_restart(spa->spa_dsl_pool, 0); + dsl_scan_restart_resilver(spa->spa_dsl_pool, 0); return (0); } @@ -813,41 +836,6 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func) dsl_scan_setup_sync, &func, 0, ZFS_SPACE_CHECK_EXTRA_RESERVED)); } -/* - * Sets the resilver defer flag to B_FALSE on all leaf devs under vd. Returns - * B_TRUE if we have devices that need to be resilvered and are available to - * accept resilver I/Os. - */ -static boolean_t -dsl_scan_clear_deferred(vdev_t *vd, dmu_tx_t *tx) -{ - boolean_t resilver_needed = B_FALSE; - spa_t *spa = vd->vdev_spa; - - for (int c = 0; c < vd->vdev_children; c++) { - resilver_needed |= - dsl_scan_clear_deferred(vd->vdev_child[c], tx); - } - - if (vd == spa->spa_root_vdev && - spa_feature_is_active(spa, SPA_FEATURE_RESILVER_DEFER)) { - spa_feature_decr(spa, SPA_FEATURE_RESILVER_DEFER, tx); - vdev_config_dirty(vd); - spa->spa_resilver_deferred = B_FALSE; - return (resilver_needed); - } - - if (!vdev_is_concrete(vd) || vd->vdev_aux || - !vd->vdev_ops->vdev_op_leaf) - return (resilver_needed); - - if (vd->vdev_resilver_deferred) - vd->vdev_resilver_deferred = B_FALSE; - - return (!vdev_is_dead(vd) && !vd->vdev_offline && - vdev_resilver_needed(vd, NULL, NULL)); -} - /* ARGSUSED */ static void dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) @@ -915,7 +903,6 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) "errors=%llu", spa_get_errlog_size(spa)); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { - spa->spa_scrub_started = B_FALSE; spa->spa_scrub_active = B_FALSE; /* @@ -943,30 +930,33 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx) spa_errlog_rotate(spa); /* + * Don't clear flag until after vdev_dtl_reassess to ensure that + * DTL_MISSING will get updated when possible. + */ + spa->spa_scrub_started = B_FALSE; + + /* * We may have finished replacing a device. * Let the async thread assess this and handle the detach. */ spa_async_request(spa, SPA_ASYNC_RESILVER_DONE); /* - * Clear any deferred_resilver flags in the config. + * Clear any resilver_deferred flags in the config. * If there are drives that need resilvering, kick * off an asynchronous request to start resilver. - * dsl_scan_clear_deferred() may update the config + * vdev_clear_resilver_deferred() may update the config * before the resilver can restart. In the event of * a crash during this period, the spa loading code * will find the drives that need to be resilvered - * when the machine reboots and start the resilver then. + * and start the resilver then. */ - if (spa_feature_is_enabled(spa, SPA_FEATURE_RESILVER_DEFER)) { - boolean_t resilver_needed = - dsl_scan_clear_deferred(spa->spa_root_vdev, tx); - if (resilver_needed) { - spa_history_log_internal(spa, - "starting deferred resilver", tx, - "errors=%llu", spa_get_errlog_size(spa)); - spa_async_request(spa, SPA_ASYNC_RESILVER); - } + if (spa_feature_is_enabled(spa, SPA_FEATURE_RESILVER_DEFER) && + vdev_clear_resilver_deferred(spa->spa_root_vdev, tx)) { + spa_history_log_internal(spa, + "starting deferred resilver", tx, "errors=%llu", + (u_longlong_t)spa_get_errlog_size(spa)); + spa_async_request(spa, SPA_ASYNC_RESILVER); } } @@ -1073,7 +1063,7 @@ dsl_scrub_set_pause_resume(const dsl_pool_t *dp, pool_scrub_cmd_t cmd) /* start a new scan, or restart an existing one. */ void -dsl_resilver_restart(dsl_pool_t *dp, uint64_t txg) +dsl_scan_restart_resilver(dsl_pool_t *dp, uint64_t txg) { if (txg == 0) { dmu_tx_t *tx; @@ -1221,10 +1211,13 @@ scan_ds_queue_sync(dsl_scan_t *scn, dmu_tx_t *tx) static boolean_t dsl_scan_should_clear(dsl_scan_t *scn) { + spa_t *spa = scn->scn_dp->dp_spa; vdev_t *rvd = scn->scn_dp->dp_spa->spa_root_vdev; - uint64_t mlim_hard, mlim_soft, mused; - uint64_t alloc = metaslab_class_get_alloc(spa_normal_class( - scn->scn_dp->dp_spa)); + uint64_t alloc, mlim_hard, mlim_soft, mused; + + alloc = metaslab_class_get_alloc(spa_normal_class(spa)); + alloc += metaslab_class_get_alloc(spa_special_class(spa)); + alloc += metaslab_class_get_alloc(spa_dedup_class(spa)); mlim_hard = MAX((physmem / zfs_scan_mem_lim_fact) * PAGESIZE, zfs_scan_mem_lim_min); @@ -4208,3 +4201,33 @@ dsl_scan_freed(spa_t *spa, const blkptr_t *bp) for (int i = 0; i < BP_GET_NDVAS(bp); i++) dsl_scan_freed_dva(spa, bp, i); } + +/* + * Check if a vdev needs resilvering (non-empty DTL), if so, and resilver has + * not started, start it. Otherwise, only restart if max txg in DTL range is + * greater than the max txg in the current scan. If the DTL max is less than + * the scan max, then the vdev has not missed any new data since the resilver + * started, so a restart is not needed. + */ +void +dsl_scan_assess_vdev(dsl_pool_t *dp, vdev_t *vd) +{ + uint64_t min, max; + + if (!vdev_resilver_needed(vd, &min, &max)) + return; + + if (!dsl_scan_resilvering(dp)) { + spa_async_request(dp->dp_spa, SPA_ASYNC_RESILVER); + return; + } + + if (max <= dp->dp_scan->scn_phys.scn_max_txg) + return; + + /* restart is needed, check if it can be deferred */ + if (spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_RESILVER_DEFER)) + vdev_defer_resilver(vd); + else + spa_async_request(dp->dp_spa, SPA_ASYNC_RESILVER); +} diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c index 547fa1e2bb..fc08eebbc0 100644 --- a/usr/src/uts/common/fs/zfs/spa.c +++ b/usr/src/uts/common/fs/zfs/spa.c @@ -27,9 +27,9 @@ * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2016 Toomas Soome <tsoome@me.com> + * Copyright (c) 2017, 2019, Datto Inc. All rights reserved. * Copyright 2019 Joyent, Inc. * Copyright (c) 2017, Intel Corporation. - * Copyright (c) 2017 Datto Inc. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. * Copyright 2020 Joshua M. Clulow <josh@sysmgr.org> */ @@ -6397,9 +6397,9 @@ spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing) */ if (dsl_scan_resilvering(spa_get_dsl(spa)) && spa_feature_is_enabled(spa, SPA_FEATURE_RESILVER_DEFER)) - vdev_set_deferred_resilver(spa, newvd); + vdev_defer_resilver(newvd); else - dsl_resilver_restart(spa->spa_dsl_pool, dtl_max_txg); + dsl_scan_restart_resilver(spa->spa_dsl_pool, dtl_max_txg); if (spa->spa_bootfs) spa_event_notify(spa, newvd, NULL, ESC_ZFS_BOOTFS_VDEV_ATTACH); @@ -7637,7 +7637,7 @@ spa_async_thread(void *arg) if (tasks & SPA_ASYNC_RESILVER && (!dsl_scan_resilvering(dp) || !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_RESILVER_DEFER))) - dsl_resilver_restart(dp, 0); + dsl_scan_restart_resilver(dp, 0); if (tasks & SPA_ASYNC_INITIALIZE_RESTART) { mutex_enter(&spa_namespace_lock); @@ -7753,6 +7753,12 @@ spa_async_request(spa_t *spa, int task) mutex_exit(&spa->spa_async_lock); } +int +spa_async_tasks(spa_t *spa) +{ + return (spa->spa_async_tasks); +} + /* * ========================================================================== * SPA syncing routines diff --git a/usr/src/uts/common/fs/zfs/sys/dsl_scan.h b/usr/src/uts/common/fs/zfs/sys/dsl_scan.h index 1b600405ae..4693293290 100644 --- a/usr/src/uts/common/fs/zfs/sys/dsl_scan.h +++ b/usr/src/uts/common/fs/zfs/sys/dsl_scan.h @@ -21,7 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017 by Delphix. All rights reserved. - * Copyright (c) 2017 Datto Inc. + * Copyright (c) 2017, 2019, Datto Inc. All rights reserved. */ #ifndef _SYS_DSL_SCAN_H @@ -164,10 +164,12 @@ void dsl_scan_fini(struct dsl_pool *dp); void dsl_scan_sync(struct dsl_pool *, dmu_tx_t *); int dsl_scan_cancel(struct dsl_pool *); int dsl_scan(struct dsl_pool *, pool_scan_func_t); +void dsl_scan_assess_vdev(struct dsl_pool *dp, vdev_t *vd); boolean_t dsl_scan_scrubbing(const struct dsl_pool *dp); int dsl_scrub_set_pause_resume(const struct dsl_pool *dp, pool_scrub_cmd_t cmd); -void dsl_resilver_restart(struct dsl_pool *, uint64_t txg); +void dsl_scan_restart_resilver(struct dsl_pool *, uint64_t txg); boolean_t dsl_scan_resilvering(struct dsl_pool *dp); +boolean_t dsl_scan_resilver_scheduled(struct dsl_pool *dp); boolean_t dsl_dataset_unstable(struct dsl_dataset *ds); void dsl_scan_ddt_entry(dsl_scan_t *scn, enum zio_checksum checksum, ddt_entry_t *dde, dmu_tx_t *tx); diff --git a/usr/src/uts/common/fs/zfs/sys/spa.h b/usr/src/uts/common/fs/zfs/sys/spa.h index 31faac4f77..33cdfbeb4b 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa.h +++ b/usr/src/uts/common/fs/zfs/sys/spa.h @@ -26,7 +26,7 @@ * Copyright 2013 Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2019 Joyent, Inc. - * Copyright (c) 2017 Datto Inc. + * Copyright (c) 2017, 2019, Datto Inc. All rights reserved. * Copyright (c) 2017, Intel Corporation. * Copyright 2020 Joshua M. Clulow <josh@sysmgr.org> */ @@ -775,6 +775,7 @@ extern void spa_async_request(spa_t *spa, int flag); extern void spa_async_unrequest(spa_t *spa, int flag); extern void spa_async_suspend(spa_t *spa); extern void spa_async_resume(spa_t *spa); +extern int spa_async_tasks(spa_t *spa); extern spa_t *spa_inject_addref(char *pool); extern void spa_inject_delref(spa_t *spa); extern void spa_scan_stat_init(spa_t *spa); diff --git a/usr/src/uts/common/fs/zfs/sys/vdev.h b/usr/src/uts/common/fs/zfs/sys/vdev.h index a6de7e6f2c..b8c2ee5c9e 100644 --- a/usr/src/uts/common/fs/zfs/sys/vdev.h +++ b/usr/src/uts/common/fs/zfs/sys/vdev.h @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2019, Datto Inc. All rights reserved. */ #ifndef _SYS_VDEV_H @@ -153,6 +154,8 @@ extern void vdev_state_dirty(vdev_t *vd); extern void vdev_state_clean(vdev_t *vd); extern void vdev_set_deferred_resilver(spa_t *spa, vdev_t *vd); +extern void vdev_defer_resilver(vdev_t *vd); +extern boolean_t vdev_clear_resilver_deferred(vdev_t *vd, dmu_tx_t *tx); typedef enum vdev_config_flag { VDEV_CONFIG_SPARE = 1 << 0, diff --git a/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h b/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h index 9947bedf54..60d4d6805f 100644 --- a/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h +++ b/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h @@ -24,6 +24,7 @@ * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright 2016 RackTop Systems. * Copyright (c) 2014 Integros [integros.com] + * Copyright (c) 2017, Intel Corporation. */ #ifndef _SYS_ZFS_IOCTL_H @@ -389,6 +390,10 @@ typedef struct zinject_record { #define ZI_NO_DVA (-1) +/* scaled frequency ranges */ +#define ZI_PERCENTAGE_MIN 4294UL +#define ZI_PERCENTAGE_MAX UINT32_MAX + typedef enum zinject_type { ZINJECT_UNINITIALIZED, ZINJECT_DATA_FAULT, diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index 01e892f4c4..9773ec7960 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -27,6 +27,7 @@ * Copyright 2016 Toomas Soome <tsoome@me.com> * Copyright 2019 Joyent, Inc. * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2019, Datto Inc. All rights reserved. */ #include <sys/zfs_context.h> @@ -98,6 +99,12 @@ boolean_t vdev_validate_skip = B_FALSE; int zfs_vdev_dtl_sm_blksz = (1 << 12); /* + * Ignore errors during scrub/resilver. Allows to work around resilver + * upon import when there are pool errors. + */ +int zfs_scan_ignore_errors = 0; + +/* * vdev-wide space maps that have lots of entries written to them at * the end of each transaction can benefit from a higher I/O bandwidth * (e.g. vdev_obsolete_sm), thus we default their block size to 128K. @@ -772,7 +779,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent, uint_t id, &vd->vdev_resilver_txg); if (nvlist_exists(nv, ZPOOL_CONFIG_RESILVER_DEFER)) - vdev_set_deferred_resilver(spa, vd); + vdev_defer_resilver(vd); /* * When importing a pool, we want to ignore the persistent fault @@ -1764,18 +1771,12 @@ vdev_open(vdev_t *vd) } /* - * If a leaf vdev has a DTL, and seems healthy, then kick off a - * resilver. But don't do this if we are doing a reopen for a scrub, - * since this would just restart the scrub we are already doing. + * If this is a leaf vdev, assess whether a resilver is needed. + * But don't do this if we are doing a reopen for a scrub, since + * this would just restart the scrub we are already doing. */ - if (vd->vdev_ops->vdev_op_leaf && !spa->spa_scrub_reopen && - vdev_resilver_needed(vd, NULL, NULL)) { - if (dsl_scan_resilvering(spa->spa_dsl_pool) && - spa_feature_is_enabled(spa, SPA_FEATURE_RESILVER_DEFER)) - vdev_set_deferred_resilver(spa, vd); - else - spa_async_request(spa, SPA_ASYNC_RESILVER); - } + if (vd->vdev_ops->vdev_op_leaf && !spa->spa_scrub_reopen) + dsl_scan_assess_vdev(spa->spa_dsl_pool, vd); return (0); } @@ -2470,7 +2471,6 @@ vdev_dtl_should_excise(vdev_t *vd) spa_t *spa = vd->vdev_spa; dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; - ASSERT0(scn->scn_phys.scn_errors); ASSERT0(vd->vdev_children); if (vd->vdev_state < VDEV_STATE_DEGRADED) @@ -2520,10 +2520,29 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done) if (vd->vdev_ops->vdev_op_leaf) { dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; + boolean_t wasempty = B_TRUE; mutex_enter(&vd->vdev_dtl_lock); /* + * If requested, pretend the scan completed cleanly. + */ + if (zfs_scan_ignore_errors && scn) + scn->scn_phys.scn_errors = 0; + + if (scrub_txg != 0 && + !range_tree_is_empty(vd->vdev_dtl[DTL_MISSING])) { + wasempty = B_FALSE; + zfs_dbgmsg("guid:%llu txg:%llu scrub:%llu started:%d " + "dtl:%llu/%llu errors:%llu", + (u_longlong_t)vd->vdev_guid, (u_longlong_t)txg, + (u_longlong_t)scrub_txg, spa->spa_scrub_started, + (u_longlong_t)vdev_dtl_min(vd), + (u_longlong_t)vdev_dtl_max(vd), + (u_longlong_t)(scn ? scn->scn_phys.scn_errors : 0)); + } + + /* * If we've completed a scan cleanly then determine * if this vdev should remove any DTLs. We only want to * excise regions on vdevs that were available during @@ -2559,6 +2578,14 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done) space_reftree_generate_map(&reftree, vd->vdev_dtl[DTL_MISSING], 1); space_reftree_destroy(&reftree); + + if (!range_tree_is_empty(vd->vdev_dtl[DTL_MISSING])) { + zfs_dbgmsg("update DTL_MISSING:%llu/%llu", + (u_longlong_t)vdev_dtl_min(vd), + (u_longlong_t)vdev_dtl_max(vd)); + } else if (!wasempty) { + zfs_dbgmsg("DTL_MISSING is now empty"); + } } range_tree_vacate(vd->vdev_dtl[DTL_PARTIAL], NULL, NULL); range_tree_walk(vd->vdev_dtl[DTL_MISSING], @@ -3543,14 +3570,11 @@ vdev_clear(spa_t *spa, vdev_t *vd) if (vd != rvd && vdev_writeable(vd->vdev_top)) vdev_state_dirty(vd->vdev_top); - if (vd->vdev_aux == NULL && !vdev_is_dead(vd)) { - if (dsl_scan_resilvering(spa->spa_dsl_pool) && - spa_feature_is_enabled(spa, - SPA_FEATURE_RESILVER_DEFER)) - vdev_set_deferred_resilver(spa, vd); - else - spa_async_request(spa, SPA_ASYNC_RESILVER); - } + /* If a resilver isn't required, check if vdevs can be culled */ + if (vd->vdev_aux == NULL && !vdev_is_dead(vd) && + !dsl_scan_resilvering(spa->spa_dsl_pool) && + !dsl_scan_resilver_scheduled(spa->spa_dsl_pool)) + spa_async_request(spa, SPA_ASYNC_RESILVER_DONE); spa_event_notify(spa, vd, NULL, ESC_ZFS_VDEV_CLEAR); } @@ -4559,18 +4583,46 @@ vdev_deadman(vdev_t *vd) } void -vdev_set_deferred_resilver(spa_t *spa, vdev_t *vd) +vdev_defer_resilver(vdev_t *vd) { - for (uint64_t i = 0; i < vd->vdev_children; i++) - vdev_set_deferred_resilver(spa, vd->vdev_child[i]); + ASSERT(vd->vdev_ops->vdev_op_leaf); - if (!vd->vdev_ops->vdev_op_leaf || !vdev_writeable(vd) || - range_tree_is_empty(vd->vdev_dtl[DTL_MISSING])) { - return; + vd->vdev_resilver_deferred = B_TRUE; + vd->vdev_spa->spa_resilver_deferred = B_TRUE; +} + +/* + * Clears the resilver deferred flag on all leaf devs under vd. Returns + * B_TRUE if we have devices that need to be resilvered and are available to + * accept resilver I/Os. + */ +boolean_t +vdev_clear_resilver_deferred(vdev_t *vd, dmu_tx_t *tx) +{ + boolean_t resilver_needed = B_FALSE; + spa_t *spa = vd->vdev_spa; + + for (int c = 0; c < vd->vdev_children; c++) { + vdev_t *cvd = vd->vdev_child[c]; + resilver_needed |= vdev_clear_resilver_deferred(cvd, tx); } - vd->vdev_resilver_deferred = B_TRUE; - spa->spa_resilver_deferred = B_TRUE; + if (vd == spa->spa_root_vdev && + spa_feature_is_active(spa, SPA_FEATURE_RESILVER_DEFER)) { + spa_feature_decr(spa, SPA_FEATURE_RESILVER_DEFER, tx); + vdev_config_dirty(vd); + spa->spa_resilver_deferred = B_FALSE; + return (resilver_needed); + } + + if (!vdev_is_concrete(vd) || vd->vdev_aux || + !vd->vdev_ops->vdev_op_leaf) + return (resilver_needed); + + vd->vdev_resilver_deferred = B_FALSE; + + return (!vdev_is_dead(vd) && !vd->vdev_offline && + vdev_resilver_needed(vd, NULL, NULL)); } /* diff --git a/usr/src/uts/common/fs/zfs/zio_inject.c b/usr/src/uts/common/fs/zfs/zio_inject.c index a65721d175..e332da9672 100644 --- a/usr/src/uts/common/fs/zfs/zio_inject.c +++ b/usr/src/uts/common/fs/zfs/zio_inject.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2017, Intel Corporation. */ /* @@ -100,6 +101,26 @@ static kmutex_t inject_delay_mtx; static int inject_next_id = 1; /* + * Test if the requested frequency was triggered + */ +static boolean_t +freq_triggered(uint32_t frequency) +{ + /* + * zero implies always (100%) + */ + if (frequency == 0) + return (B_TRUE); + + /* + * Note: we still handle legacy (unscaled) frequecy values + */ + uint32_t maximum = (frequency <= 100) ? 100 : ZI_PERCENTAGE_MAX; + + return (spa_get_random(maximum) < frequency); +} + +/* * Returns true if the given record matches the I/O in progress. */ static boolean_t @@ -114,8 +135,7 @@ zio_match_handler(zbookmark_phys_t *zb, uint64_t type, int dva, record->zi_object == DMU_META_DNODE_OBJECT) { if (record->zi_type == DMU_OT_NONE || type == record->zi_type) - return (record->zi_freq == 0 || - spa_get_random(100) < record->zi_freq); + return (freq_triggered(record->zi_freq)); else return (B_FALSE); } @@ -130,8 +150,7 @@ zio_match_handler(zbookmark_phys_t *zb, uint64_t type, int dva, zb->zb_blkid <= record->zi_end && (record->zi_dvas == 0 || (record->zi_dvas & (1ULL << dva))) && error == record->zi_error) { - return (record->zi_freq == 0 || - spa_get_random(100) < record->zi_freq); + return (freq_triggered(record->zi_freq)); } return (B_FALSE); @@ -360,6 +379,12 @@ zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error) if (handler->zi_record.zi_error == error) { /* + * limit error injection if requested + */ + if (!freq_triggered(handler->zi_record.zi_freq)) + continue; + + /* * For a failed open, pretend like the device * has gone away. */ @@ -527,6 +552,9 @@ zio_handle_io_delay(zio_t *zio) if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO) continue; + if (!freq_triggered(handler->zi_record.zi_freq)) + continue; + if (vd->vdev_guid != handler->zi_record.zi_guid) continue; diff --git a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c index 9aeba33d30..b16fc9bf5f 100644 --- a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c +++ b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c @@ -731,6 +731,7 @@ ipf_hook_protocol_notify(hook_notify_cmd_t command, void *arg, hook_hint_t hint; boolean_t out; int ret = 0; + const boolean_t gz = ifs->ifs_gz_controlled; /* We currently only care about viona hooks notifications */ @@ -2438,42 +2439,6 @@ int ipf_hook6_loop_out(hook_event_token_t token, hook_data_t info, void *arg) return ipf_hook6(info, 1, FI_NOCKSUM, arg); } -/* ------------------------------------------------------------------------ */ -/* Function: ipf_hookvndl3_in */ -/* Returns: int - 0 == packet ok, else problem, free packet if not done */ -/* Parameters: event(I) - pointer to event */ -/* info(I) - pointer to hook information for firewalling */ -/* */ -/* The vnd hooks are private hooks to ON. They represents a layer 2 */ -/* datapath generally used to implement virtual machines. The driver sends */ -/* along L3 packets of either type IP or IPv6. The ethertype to distinguish */ -/* them is in the upper 16 bits while the remaining bits are the */ -/* traditional packet hook flags. */ -/* */ -/* They end up calling the appropriate traditional ip hooks. */ -/* ------------------------------------------------------------------------ */ -/*ARGSUSED*/ -int ipf_hookvndl3v4_in(hook_event_token_t token, hook_data_t info, void *arg) -{ - return ipf_hook4_in(token, info, arg); -} - -int ipf_hookvndl3v6_in(hook_event_token_t token, hook_data_t info, void *arg) -{ - return ipf_hook6_in(token, info, arg); -} - -/*ARGSUSED*/ -int ipf_hookvndl3v4_out(hook_event_token_t token, hook_data_t info, void *arg) -{ - return ipf_hook4_out(token, info, arg); -} - -int ipf_hookvndl3v6_out(hook_event_token_t token, hook_data_t info, void *arg) -{ - return ipf_hook6_out(token, info, arg); -} - /* Static constants used by ipf_hook_ether */ static uint8_t ipf_eth_bcast_addr[ETHERADDRL] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF @@ -2569,6 +2534,42 @@ int ipf_hook_ether(hook_event_token_t token, hook_data_t info, void *arg, } /* ------------------------------------------------------------------------ */ +/* Function: ipf_hookvndl3_in */ +/* Returns: int - 0 == packet ok, else problem, free packet if not done */ +/* Parameters: event(I) - pointer to event */ +/* info(I) - pointer to hook information for firewalling */ +/* */ +/* The vnd hooks are private hooks to ON. They represents a layer 2 */ +/* datapath generally used to implement virtual machines. The driver sends */ +/* along L3 packets of either type IP or IPv6. The ethertype to distinguish */ +/* them is in the upper 16 bits while the remaining bits are the */ +/* traditional packet hook flags. */ +/* */ +/* They end up calling the appropriate traditional ip hooks. */ +/* ------------------------------------------------------------------------ */ +/*ARGSUSED*/ +int ipf_hookvndl3v4_in(hook_event_token_t token, hook_data_t info, void *arg) +{ + return ipf_hook4_in(token, info, arg); +} + +int ipf_hookvndl3v6_in(hook_event_token_t token, hook_data_t info, void *arg) +{ + return ipf_hook6_in(token, info, arg); +} + +/*ARGSUSED*/ +int ipf_hookvndl3v4_out(hook_event_token_t token, hook_data_t info, void *arg) +{ + return ipf_hook4_out(token, info, arg); +} + +int ipf_hookvndl3v6_out(hook_event_token_t token, hook_data_t info, void *arg) +{ + return ipf_hook6_out(token, info, arg); +} + +/* ------------------------------------------------------------------------ */ /* Function: ipf_hookviona_{in,out} */ /* Returns: int - 0 == packet ok, else problem, free packet if not done */ /* Parameters: event(I) - pointer to event */ 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_main2.c b/usr/src/uts/common/io/bge/bge_main2.c index ab511c068d..81b6528c7c 100644 --- a/usr/src/uts/common/io/bge/bge_main2.c +++ b/usr/src/uts/common/io/bge/bge_main2.c @@ -1437,8 +1437,49 @@ bge_unicst_find(bge_t *bgep, const uint8_t *mac_addr) } /* - * Programs the classifier to start steering packets matching 'mac_addr' to the - * specified ring 'arg'. + * The job of bge_addmac() is to set up everything in hardware for the mac + * address indicated to map to the specified group. + * + * For this to make sense, we need to first understand how most of the bge chips + * work. A given packet reaches a ring in two distinct logical steps: + * + * 1) The device must accept the packet. + * 2) The device must steer an accepted packet to a specific ring. + * + * For step 1, the device has four global MAC address filtering registers. We + * must either add the address here or put the device in promiscuous mode. + * Because there are only four of these and up to four groups, each group is + * only allowed to program a single entry. Note, this is not explicitly done in + * the driver. Rather, it is implicitly done by how we implement step 2. These + * registers start at 0x410 and are referred to as the 'EMAC MAC Addresses' in + * the manuals. + * + * For step 2, the device has eight sets of rule registers that are used to + * control how a packet in step 1 is mapped to a specific ring. Each set is + * comprised of a control register and a mask register. These start at 0x480 and + * are referred to as the 'Receive Rules Control Registers' and 'Receive Rules + * Value/Mask Registers'. These can be used to check for a 16-bit or 32-bit + * value at an offset in the packet. In addition, two sets can be combined to + * create a single conditional rule. + * + * For our purposes, we need to use this mechanism to steer a mac address to a + * specific ring. This requires that we use two of the sets of registers per MAC + * address that comes in here. The data about this is stored in 'mac_addr_rule' + * member of the 'recv_ring_t'. + * + * A reasonable question to ask is why are we storing this on the ring, when it + * relates to the group. The answer is that the current implementation of the + * driver assumes that each group is comprised of a single ring. While some + * parts may support additional rings, the driver doesn't take advantage of + * that. + * + * A result of all this is that the driver will support up to 4 groups today. + * Each group has a single ring. We want to make sure that each group can have a + * single MAC address programmed into it. This results in the check for a rule + * being assigned in the 'mac_addr_rule' member of the recv_ring_t below. If a + * future part were to support more global MAC address filters in part 1 and + * more rule registers needed for part 2, then we could relax this constraint + * and allow a group to have more than one MAC address assigned to it. */ static int bge_addmac(void *arg, const uint8_t * mac_addr) @@ -1461,7 +1502,10 @@ bge_addmac(void *arg, const uint8_t * mac_addr) } /* - * First add the unicast address to a available slot. + * The driver only supports a MAC address being programmed to be + * received by one ring in step 2. We check the global table of MAC + * addresses to see if this address has already been claimed by another + * group as a way to determine that. */ slot = bge_unicst_find(bgep, mac_addr); if (slot != -1) { @@ -1469,6 +1513,17 @@ bge_addmac(void *arg, const uint8_t * mac_addr) return (EEXIST); } + /* + * Check to see if this group has already used its hardware resources + * for step 2. If so, we have to return ENOSPC to MAC to indicate that + * this group cannot handle an additional MAC address and that MAC will + * need to use software classification on the default group. + */ + if (rrp->mac_addr_rule != NULL) { + mutex_exit(bgep->genlock); + return (ENOSPC); + } + for (slot = 0; slot < bgep->unicst_addr_total; slot++) { if (!bgep->curr_addr[slot].set) { bgep->curr_addr[slot].set = B_TRUE; @@ -1483,12 +1538,6 @@ bge_addmac(void *arg, const uint8_t * mac_addr) if ((err = bge_unicst_set(bgep, mac_addr, slot)) != 0) goto fail; - /* A rule is already here. Deny this. */ - if (rrp->mac_addr_rule != NULL) { - err = ether_cmp(mac_addr, rrp->mac_addr_val) ? EEXIST : EBUSY; - goto fail; - } - /* * Allocate a bge_rule_info_t to keep track of which rule slots * are being used. diff --git a/usr/src/uts/common/io/bnx/bnx.h b/usr/src/uts/common/io/bnx/bnx.h index e1d53fa9d7..9ef282678e 100644 --- a/usr/src/uts/common/io/bnx/bnx.h +++ b/usr/src/uts/common/io/bnx/bnx.h @@ -55,12 +55,6 @@ extern "C" { -/* - */ -#pragma weak hcksum_retrieve -#pragma weak hcksum_assoc - - #include "listq.h" #include "lm5706.h" #include "54xx_reg.h" diff --git a/usr/src/uts/common/io/bnx/bnxsnd.c b/usr/src/uts/common/io/bnx/bnxsnd.c index 16f1b03c10..f6e154c056 100644 --- a/usr/src/uts/common/io/bnx/bnxsnd.c +++ b/usr/src/uts/common/io/bnx/bnxsnd.c @@ -611,7 +611,7 @@ bnx_xmit_ring_xmit_mblk(um_device_t * const umdevice, umpacket->frag_list.cnt = 0; umpacket->mp = mp; - hcksum_retrieve(mp, NULL, NULL, NULL, NULL, NULL, NULL, &pflags); + mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &pflags); bnx_xmit_pkt_cpy(umdevice, umpacket); diff --git a/usr/src/uts/common/io/chxge/pe.c b/usr/src/uts/common/io/chxge/pe.c index 652edba984..48a796470a 100644 --- a/usr/src/uts/common/io/chxge/pe.c +++ b/usr/src/uts/common/io/chxge/pe.c @@ -414,12 +414,12 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) lseg = ch_bind_dvma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], mseg - nseg); - if (lseg == NULL) { + if (lseg == 0) { sa->sge->intr_cnt.tx_no_dvma1++; if ((lseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], - mseg - nseg)) == NULL) { + mseg - nseg)) == 0) { sa->sge->intr_cnt.tx_no_dma1++; /* @@ -444,7 +444,7 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) lseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[nseg], mseg - nseg); - if (lseg == NULL) { + if (lseg == 0) { sa->sge->intr_cnt.tx_no_dma1++; /* @@ -512,12 +512,12 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) nseg = ch_bind_dvma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dvma2++; nseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dma2++; /* @@ -530,7 +530,7 @@ pe_start(ch_t *sa, mblk_t *mp, uint32_t flg) } else { nseg = ch_bind_dma_handle(sa, len, (void *)mp->b_rptr, &hmp[0], 16); - if (nseg == NULL) { + if (nseg == 0) { sa->sge->intr_cnt.tx_no_dma2++; /* diff --git a/usr/src/uts/common/io/cmlb.c b/usr/src/uts/common/io/cmlb.c index 6275948465..f4ae9f3ed5 100644 --- a/usr/src/uts/common/io/cmlb.c +++ b/usr/src/uts/common/io/cmlb.c @@ -1514,7 +1514,7 @@ cmlb_create_minor_nodes(struct cmlb_lun *cl) if (cl->cl_alter_behavior & CMLB_CREATE_P0_MINOR_NODE) { if (cmlb_create_minor(CMLB_DEVINFO(cl), "q", S_IFBLK, (instance << CMLBUNIT_FORCE_P0_SHIFT) | P0_RAW_DISK, - cl->cl_node_type, NULL, internal) == DDI_FAILURE) { + cl->cl_node_type, 0, internal) == DDI_FAILURE) { ddi_remove_minor_node(CMLB_DEVINFO(cl), NULL); return (ENXIO); } @@ -1522,7 +1522,7 @@ cmlb_create_minor_nodes(struct cmlb_lun *cl) if (cmlb_create_minor(CMLB_DEVINFO(cl), "q,raw", S_IFCHR, (instance << CMLBUNIT_FORCE_P0_SHIFT) | P0_RAW_DISK, - cl->cl_node_type, NULL, internal) == DDI_FAILURE) { + cl->cl_node_type, 0, internal) == DDI_FAILURE) { ddi_remove_minor_node(CMLB_DEVINFO(cl), NULL); return (ENXIO); } diff --git a/usr/src/uts/common/io/cxgbe/common/common.h b/usr/src/uts/common/io/cxgbe/common/common.h index c7de2c4ebf..b8d77ebda3 100644 --- a/usr/src/uts/common/io/cxgbe/common/common.h +++ b/usr/src/uts/common/io/cxgbe/common/common.h @@ -20,6 +20,10 @@ * release for licensing terms and conditions. */ +/* + * Copyright 2020 RackTop Systems, Inc. + */ + #ifndef __CHELSIO_COMMON_H #define __CHELSIO_COMMON_H @@ -103,9 +107,16 @@ enum { typedef unsigned char cc_pause_t; enum { - FEC_AUTO = 1 << 0, /* IEEE 802.3 "automatic" */ - FEC_RS = 1 << 1, /* Reed-Solomon */ - FEC_BASER_RS = 1 << 2, /* BaseR/Reed-Solomon */ + FEC_RS = 1 << 0, /* Reed-Solomon */ + FEC_BASER_RS = 1 << 1, /* Base-R, aka Firecode */ + FEC_NONE = 1 << 2, /* no FEC */ + + /* + * Pseudo FECs that translate to real FECs. The firmware knows nothing + * about these and they start at M_FW_PORT_CAP32_FEC + 1. AUTO should + * be set all by itself. + */ + FEC_AUTO = 1 << 5, }; typedef unsigned char cc_fec_t; diff --git a/usr/src/uts/common/io/cxgbe/common/t4_hw.c b/usr/src/uts/common/io/cxgbe/common/t4_hw.c index ae88f36f15..4bb48f1b3a 100644 --- a/usr/src/uts/common/io/cxgbe/common/t4_hw.c +++ b/usr/src/uts/common/io/cxgbe/common/t4_hw.c @@ -20,6 +20,10 @@ * release for licensing terms and conditions. */ +/* + * Copyright 2020 RackTop Systems, Inc. + */ + #include "common.h" #include "t4_regs.h" #include "t4_regs_values.h" @@ -4645,20 +4649,57 @@ static inline cc_fec_t fwcap_to_cc_fec(fw_port_cap32_t fw_fec) if (fw_fec & FW_PORT_CAP32_FEC_BASER_RS) cc_fec |= FEC_BASER_RS; - return cc_fec; + if (cc_fec == 0) + cc_fec = FEC_NONE; + + return (cc_fec); } /* Translate Common Code Forward Error Correction specification to Firmware */ -static inline fw_port_cap32_t cc_to_fwcap_fec(cc_fec_t cc_fec) +static inline boolean_t +cc_to_fwcap_fec(fw_port_cap32_t *fw_fecp, cc_fec_t cc_fec, + struct link_config *lc) { fw_port_cap32_t fw_fec = 0; - if (cc_fec & FEC_RS) + if ((cc_fec & FEC_AUTO) != 0) { + if ((lc->pcaps & FW_PORT_CAP32_SPEED_100G) == 0) + fw_fec |= FW_PORT_CAP32_FEC_BASER_RS; + + if ((lc->pcaps & FW_PORT_CAP32_FORCE_FEC) != 0) + fw_fec |= FW_PORT_CAP32_FEC_NO_FEC; + + fw_fec |= FW_PORT_CAP32_FEC_RS; + + *fw_fecp = fw_fec; + return (B_TRUE); + } + + if ((cc_fec & FEC_RS) != 0) fw_fec |= FW_PORT_CAP32_FEC_RS; - if (cc_fec & FEC_BASER_RS) + + if ((cc_fec & FEC_BASER_RS) != 0 && + (lc->pcaps & FW_PORT_CAP32_SPEED_100G) == 0) fw_fec |= FW_PORT_CAP32_FEC_BASER_RS; - return fw_fec; + if ((cc_fec & FEC_NONE) != 0) { + if ((lc->pcaps & FW_PORT_CAP32_FORCE_FEC) != 0) { + fw_fec |= FW_PORT_CAP32_FORCE_FEC; + fw_fec |= FW_PORT_CAP32_FEC_NO_FEC; + } + + *fw_fecp = fw_fec; + return (B_TRUE); + } + + if (fw_fec == 0) + return (B_FALSE); + + if ((lc->pcaps & FW_PORT_CAP32_FORCE_FEC) != 0) + fw_fec |= FW_PORT_CAP32_FORCE_FEC; + + *fw_fecp = fw_fec; + return (B_TRUE); } /** @@ -4692,11 +4733,18 @@ fw_port_cap32_t t4_link_acaps(struct adapter *adapter, unsigned int port, * the Transceiver Module EPROM FEC parameters. Otherwise we * use whatever is in the current Requested FEC settings. */ - if (lc->requested_fec & FEC_AUTO) - cc_fec = fwcap_to_cc_fec(lc->def_acaps); - else - cc_fec = lc->requested_fec; - fw_fec = cc_to_fwcap_fec(cc_fec); + if (fec_supported(lc->pcaps)) { + if (lc->requested_fec & FEC_AUTO) + cc_fec = fwcap_to_cc_fec(lc->def_acaps); + else + cc_fec = lc->requested_fec; + + if (!cc_to_fwcap_fec(&fw_fec, cc_fec, lc)) + return (0); + } else { + fw_fec = 0; + cc_fec = FEC_NONE; + } /* Figure out what our Requested Port Capabilities are going to be. * Note parallel structure in t4_handle_get_port_info() and @@ -9641,12 +9689,17 @@ static void init_link_config(struct link_config *lc, fw_port_cap32_t pcaps, lc->speed = 0; lc->requested_fc = lc->fc = PAUSE_RX | PAUSE_TX; - /* - * For Forward Error Control, we default to whatever the Firmware - * tells us the Link is currently advertising. - */ - lc->requested_fec = FEC_AUTO; - lc->fec = fwcap_to_cc_fec(lc->def_acaps); + if (fec_supported(pcaps)) { + /* + * For Forward Error Control, we default to whatever the Firmware + * tells us the Link is currently advertising. + */ + lc->requested_fec = FEC_AUTO; + lc->fec = fwcap_to_cc_fec(lc->def_acaps); + } else { + lc->requested_fec = FEC_NONE; + lc->fec = FEC_NONE; + } /* If the Port is capable of Auto-Negtotiation, initialize it as * "enabled" and copy over all of the Physical Port Capabilities diff --git a/usr/src/uts/common/io/cxgbe/firmware/t4fw_interface.h b/usr/src/uts/common/io/cxgbe/firmware/t4fw_interface.h index d705c73891..b998e85bae 100644 --- a/usr/src/uts/common/io/cxgbe/firmware/t4fw_interface.h +++ b/usr/src/uts/common/io/cxgbe/firmware/t4fw_interface.h @@ -11,6 +11,10 @@ * release for licensing terms and conditions. */ +/* + * Copyright 2020 RackTop Systems, Inc. + */ + #ifndef _T4FW_INTERFACE_H_ #define _T4FW_INTERFACE_H_ @@ -7204,11 +7208,12 @@ enum fw_port_mdi { #define FW_PORT_CAP32_MDISTRAIGHT 0x00400000UL #define FW_PORT_CAP32_FEC_RS 0x00800000UL #define FW_PORT_CAP32_FEC_BASER_RS 0x01000000UL -#define FW_PORT_CAP32_FEC_RESERVED1 0x02000000UL +#define FW_PORT_CAP32_FEC_NO_FEC 0x02000000UL #define FW_PORT_CAP32_FEC_RESERVED2 0x04000000UL #define FW_PORT_CAP32_FEC_RESERVED3 0x08000000UL #define FW_PORT_CAP32_FORCE_PAUSE 0x10000000UL -#define FW_PORT_CAP32_RESERVED2 0xe0000000UL +#define FW_PORT_CAP32_FORCE_FEC 0x20000000UL +#define FW_PORT_CAP32_RESERVED2 0xc0000000UL #define S_FW_PORT_CAP32_SPEED 0 #define M_FW_PORT_CAP32_SPEED 0xfff @@ -7254,7 +7259,7 @@ enum fw_port_mdi32 { (((x) >> S_FW_PORT_CAP32_MDI) & M_FW_PORT_CAP32_MDI) #define S_FW_PORT_CAP32_FEC 23 -#define M_FW_PORT_CAP32_FEC 0x1f +#define M_FW_PORT_CAP32_FEC 0x5f #define V_FW_PORT_CAP32_FEC(x) ((x) << S_FW_PORT_CAP32_FEC) #define G_FW_PORT_CAP32_FEC(x) \ (((x) >> S_FW_PORT_CAP32_FEC) & M_FW_PORT_CAP32_FEC) @@ -7269,6 +7274,15 @@ enum fw_port_mdi32 { #define CAP32_FC(__cap32) \ (V_FW_PORT_CAP32_FC(M_FW_PORT_CAP32_FC) & __cap32) +#ifdef _KERNEL +static inline boolean_t +fec_supported(uint32_t caps) +{ + return ((caps & (FW_PORT_CAP32_SPEED_25G | FW_PORT_CAP32_SPEED_50G | + FW_PORT_CAP32_SPEED_100G)) != 0); +} +#endif + enum fw_port_action { FW_PORT_ACTION_L1_CFG = 0x0001, FW_PORT_ACTION_L2_CFG = 0x0002, diff --git a/usr/src/uts/common/io/cxgbe/shared/shared.c b/usr/src/uts/common/io/cxgbe/shared/shared.c index 07dd78f189..e86272134a 100644 --- a/usr/src/uts/common/io/cxgbe/shared/shared.c +++ b/usr/src/uts/common/io/cxgbe/shared/shared.c @@ -32,17 +32,19 @@ static int rxbuf_ctor(void *, void *, int); static void rxbuf_dtor(void *, void *); -void +int cxgb_printf(dev_info_t *dip, int level, char *f, ...) { va_list list; char fmt[128]; + int rv; - (void) snprintf(fmt, sizeof (fmt), "%s%d: %s", ddi_driver_name(dip), + rv = snprintf(fmt, sizeof (fmt), "%s%d: %s", ddi_driver_name(dip), ddi_get_instance(dip), f); va_start(list, f); vcmn_err(level, fmt, list); va_end(list); + return (rv); } kmem_cache_t * diff --git a/usr/src/uts/common/io/cxgbe/shared/shared.h b/usr/src/uts/common/io/cxgbe/shared/shared.h index 5838416838..d3171c224b 100644 --- a/usr/src/uts/common/io/cxgbe/shared/shared.h +++ b/usr/src/uts/common/io/cxgbe/shared/shared.h @@ -66,7 +66,7 @@ struct rxbuf_cache_params { size_t buf_size; }; -void cxgb_printf(dev_info_t *dip, int level, char *f, ...); +int cxgb_printf(dev_info_t *dip, int level, char *f, ...); kmem_cache_t *rxbuf_cache_create(struct rxbuf_cache_params *p); void rxbuf_cache_destroy(kmem_cache_t *cache); struct rxbuf *rxbuf_alloc(kmem_cache_t *cache, int kmflags, uint_t ref_cnt); diff --git a/usr/src/uts/common/io/cxgbe/t4nex/cudbg.h b/usr/src/uts/common/io/cxgbe/t4nex/cudbg.h index cb21451e5c..e86de21085 100644 --- a/usr/src/uts/common/io/cxgbe/t4nex/cudbg.h +++ b/usr/src/uts/common/io/cxgbe/t4nex/cudbg.h @@ -318,7 +318,7 @@ static struct el ATTRIBUTE_UNUSED entity_list[] = { }; #ifdef _KERNEL -typedef int (*cudbg_print_cb) (dev_info_t *dip, ...); +typedef int (*cudbg_print_cb) (dev_info_t *dip, int, char *, ...); #else typedef int (*cudbg_print_cb) (char *, ...); #endif diff --git a/usr/src/uts/common/io/cxgbe/t4nex/t4_ioctl.c b/usr/src/uts/common/io/cxgbe/t4nex/t4_ioctl.c index ee28c8a2ba..85d79e6201 100644 --- a/usr/src/uts/common/io/cxgbe/t4nex/t4_ioctl.c +++ b/usr/src/uts/common/io/cxgbe/t4nex/t4_ioctl.c @@ -1706,7 +1706,7 @@ get_cudbg(struct adapter *sc, void *data, int flags) cudbg = cudbg_get_init(handle); cudbg->adap = sc; - cudbg->print = (cudbg_print_cb)(uintptr_t)cxgb_printf; + cudbg->print = cxgb_printf; memcpy(cudbg->dbg_bitmap, dump.bitmap, sizeof(cudbg->dbg_bitmap)); diff --git a/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c b/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c index 59c0ddde8d..9b4ffd8325 100644 --- a/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c +++ b/usr/src/uts/common/io/cxgbe/t4nex/t4_mac.c @@ -20,6 +20,10 @@ * release for licensing terms and conditions. */ +/* + * Copyright 2020 RackTop Systems, Inc. + */ + #include <sys/ddi.h> #include <sys/sunddi.h> #include <sys/dlpi.h> @@ -930,6 +934,62 @@ t4_mc_getcapab(void *arg, mac_capab_t cap, void *data) return (status); } +static link_fec_t +fec_to_link_fec(cc_fec_t cc_fec) +{ + link_fec_t link_fec = 0; + + if ((cc_fec & (FEC_RS | FEC_BASER_RS)) == (FEC_RS | FEC_BASER_RS)) + return (LINK_FEC_AUTO); + + if ((cc_fec & FEC_NONE) != 0) + link_fec |= LINK_FEC_NONE; + + if ((cc_fec & FEC_AUTO) != 0) + link_fec |= LINK_FEC_AUTO; + + if ((cc_fec & FEC_RS) != 0) + link_fec |= LINK_FEC_RS; + + if ((cc_fec & FEC_BASER_RS) != 0) + link_fec |= LINK_FEC_BASE_R; + + return (link_fec); +} + +static int +link_fec_to_fec(int v) +{ + int fec = 0; + + if ((v & LINK_FEC_AUTO) != 0) { + fec = FEC_AUTO; + v &= ~LINK_FEC_AUTO; + } else { + if ((v & LINK_FEC_NONE) != 0) { + fec = FEC_NONE; + v &= ~LINK_FEC_NONE; + } + + if ((v & LINK_FEC_RS) != 0) { + fec |= FEC_RS; + v &= ~LINK_FEC_RS; + } + + if ((v & LINK_FEC_BASE_R) != 0) { + fec |= FEC_BASER_RS; + v &= ~LINK_FEC_BASE_R; + } + } + + if (v != 0) + return (-1); + + ASSERT3S(fec, !=, 0); + + return (fec); +} + /* ARGSUSED */ static int t4_mc_setprop(void *arg, const char *name, mac_prop_id_t id, uint_t size, @@ -941,7 +1001,9 @@ t4_mc_setprop(void *arg, const char *name, mac_prop_id_t id, uint_t size, uint8_t v8 = *(uint8_t *)val; uint32_t v32 = *(uint32_t *)val; int old, new = 0, relink = 0, rx_mode = 0, rc = 0; + boolean_t down_link = B_TRUE; link_flowctrl_t fc; + link_fec_t fec; /* * Save a copy of link_config. This can be used to restore link_config @@ -1009,6 +1071,30 @@ t4_mc_setprop(void *arg, const char *name, mac_prop_id_t id, uint_t size, } break; + case MAC_PROP_EN_FEC_CAP: + if (!fec_supported(lc->pcaps)) { + rc = ENOTSUP; + break; + } + + fec = *(link_fec_t *)val; + new = link_fec_to_fec(fec); + if (new < 0) { + rc = EINVAL; + } else if (new != lc->requested_fec) { + lc->requested_fec = new; + relink = 1; + /* + * For fec, do not preemptively force the link + * down. If changing fec causes the link state + * to transition, then appropriate asynchronous + * events are generated which correctly reflect + * the link state. + */ + down_link = B_FALSE; + } + break; + case MAC_PROP_EN_10GFDX_CAP: if (lc->pcaps & FW_PORT_CAP32_ANEG && is_10G_port(pi)) { old = lc->acaps & FW_PORT_CAP32_SPEED_10G; @@ -1062,7 +1148,8 @@ t4_mc_setprop(void *arg, const char *name, mac_prop_id_t id, uint_t size, if (isset(&sc->open_device_map, pi->port_id) != 0) { if (relink != 0) { - t4_os_link_changed(pi->adapter, pi->port_id, 0); + if (down_link) + t4_os_link_changed(pi->adapter, pi->port_id, 0); rc = begin_synchronized_op(pi, 1, 1); if (rc != 0) return (rc); @@ -1143,6 +1230,20 @@ t4_mc_getprop(void *arg, const char *name, mac_prop_id_t id, uint_t size, *(link_flowctrl_t *)val = LINK_FLOWCTRL_NONE; break; + case MAC_PROP_ADV_FEC_CAP: + if (!fec_supported(lc->pcaps)) + return (ENOTSUP); + + *(link_fec_t *)val = fec_to_link_fec(lc->fec); + break; + + case MAC_PROP_EN_FEC_CAP: + if (!fec_supported(lc->pcaps)) + return (ENOTSUP); + + *(link_fec_t *)val = fec_to_link_fec(lc->requested_fec); + break; + case MAC_PROP_ADV_100GFDX_CAP: case MAC_PROP_EN_100GFDX_CAP: *u = !!(lc->acaps & FW_PORT_CAP32_SPEED_100G); @@ -1212,6 +1313,15 @@ t4_mc_propinfo(void *arg, const char *name, mac_prop_id_t id, mac_prop_info_set_default_link_flowctrl(ph, LINK_FLOWCTRL_BI); break; + case MAC_PROP_EN_FEC_CAP: + mac_prop_info_set_default_fec(ph, LINK_FEC_AUTO); + break; + + case MAC_PROP_ADV_FEC_CAP: + mac_prop_info_set_perm(ph, MAC_PROP_PERM_READ); + mac_prop_info_set_default_fec(ph, LINK_FEC_AUTO); + break; + case MAC_PROP_EN_10GFDX_CAP: if (lc->pcaps & FW_PORT_CAP32_ANEG && lc->pcaps & FW_PORT_CAP32_SPEED_10G) diff --git a/usr/src/uts/common/io/e1000g/e1000g_alloc.c b/usr/src/uts/common/io/e1000g/e1000g_alloc.c index c7496cd164..8a460fd45a 100644 --- a/usr/src/uts/common/io/e1000g/e1000g_alloc.c +++ b/usr/src/uts/common/io/e1000g/e1000g_alloc.c @@ -830,7 +830,7 @@ e1000g_free_dvma_buffer(dma_buffer_t *buf) return; } - buf->dma_address = NULL; + buf->dma_address = 0; if (buf->address != NULL) { kmem_free(buf->address, buf->size); diff --git a/usr/src/uts/common/io/mac/mac.c b/usr/src/uts/common/io/mac/mac.c index d698862d81..4ce359f87b 100644 --- a/usr/src/uts/common/io/mac/mac.c +++ b/usr/src/uts/common/io/mac/mac.c @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2020 Joyent, Inc. * Copyright 2015 Garrett D'Amore <garrett@damore.org> + * Copyright 2020 RackTop Systems, Inc. */ /* @@ -3341,6 +3342,10 @@ mac_prop_check_size(mac_prop_id_t id, uint_t valsize, boolean_t is_range) case MAC_PROP_FLOWCTRL: minsize = sizeof (link_flowctrl_t); break; + case MAC_PROP_ADV_FEC_CAP: + case MAC_PROP_EN_FEC_CAP: + minsize = sizeof (link_fec_t); + break; case MAC_PROP_ADV_5000FDX_CAP: case MAC_PROP_EN_5000FDX_CAP: case MAC_PROP_ADV_2500FDX_CAP: @@ -3529,6 +3534,28 @@ mac_set_prop(mac_handle_t mh, mac_prop_id_t id, char *name, void *val, break; } + case MAC_PROP_ADV_FEC_CAP: + case MAC_PROP_EN_FEC_CAP: { + link_fec_t fec; + + ASSERT(valsize >= sizeof (link_fec_t)); + + /* + * fec cannot be zero, and auto must be set exclusively. + */ + bcopy(val, &fec, sizeof (link_fec_t)); + if (fec == 0) + return (EINVAL); + if ((fec & LINK_FEC_AUTO) != 0 && (fec & ~LINK_FEC_AUTO) != 0) + return (EINVAL); + + if (mip->mi_callbacks->mc_callbacks & MC_SETPROP) { + err = mip->mi_callbacks->mc_setprop(mip->mi_driver, + name, id, valsize, val); + } + break; + } + default: /* For other driver properties, call driver's callback */ if (mip->mi_callbacks->mc_callbacks & MC_SETPROP) { @@ -4741,7 +4768,7 @@ mac_bridge_tx(mac_impl_t *mip, mac_ring_handle_t rh, mblk_t *mp) * The bridge may place this mblk on a provider's Tx * path, a mac's Rx path, or both. Since we don't have * enough information at this point, we can't be sure - * that the desination(s) are capable of handling the + * that the destination(s) are capable of handling the * hardware offloads requested by the mblk. We emulate * them here as it is the safest choice. In the * future, if bridge performance becomes a priority, diff --git a/usr/src/uts/common/io/mac/mac_client.c b/usr/src/uts/common/io/mac/mac_client.c index dcfb4803d6..b166e7987a 100644 --- a/usr/src/uts/common/io/mac/mac_client.c +++ b/usr/src/uts/common/io/mac/mac_client.c @@ -4243,7 +4243,7 @@ mac_promisc_dispatch(mac_impl_t *mip, mblk_t *mp_chain, mpip->mpi_type == MAC_CLIENT_PROMISC_ALL || is_mcast) { mac_promisc_dispatch_one(mpip, mp, is_sender, - local); + local); } } } @@ -4274,7 +4274,7 @@ mac_promisc_client_dispatch(mac_client_impl_t *mcip, mblk_t *mp_chain) if (mpip->mpi_type == MAC_CLIENT_PROMISC_FILTERED && !is_mcast) { mac_promisc_dispatch_one(mpip, mp, B_FALSE, - B_FALSE); + B_FALSE); } } } @@ -4352,12 +4352,27 @@ i_mac_capab_get(mac_handle_t mh, mac_capab_t cap, void *cap_data) { mac_impl_t *mip = (mac_impl_t *)mh; - if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY) + if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY) { return (B_TRUE); - else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB) - return (mip->mi_getcapab(mip->mi_driver, cap, cap_data)); - else + } else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB) { + boolean_t res; + + res = mip->mi_getcapab(mip->mi_driver, cap, cap_data); + /* + * Until we have suppport for TSOv6 emulation in the MAC + * loopback path, do not allow the TSOv6 capability to be + * advertised to consumers. + */ + if (res && cap == MAC_CAPAB_LSO) { + mac_capab_lso_t *cap_lso = cap_data; + + cap_lso->lso_flags &= ~LSO_TX_BASIC_TCP_IPV6; + cap_lso->lso_basic_tcp_ipv6.lso_max = 0; + } + return (res); + } else { return (B_FALSE); + } } /* diff --git a/usr/src/uts/common/io/mac/mac_provider.c b/usr/src/uts/common/io/mac/mac_provider.c index 7f193f68eb..bcca602589 100644 --- a/usr/src/uts/common/io/mac/mac_provider.c +++ b/usr/src/uts/common/io/mac/mac_provider.c @@ -23,6 +23,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2019 Joyent, Inc. * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved. + * Copyright 2020 RackTop Systems, Inc. */ #include <sys/types.h> @@ -1530,6 +1531,22 @@ mac_prop_info_set_default_link_flowctrl(mac_prop_info_handle_t ph, } void +mac_prop_info_set_default_fec(mac_prop_info_handle_t ph, link_fec_t val) +{ + mac_prop_info_state_t *pr = (mac_prop_info_state_t *)ph; + + /* nothing to do if the caller doesn't want the default value */ + if (pr->pr_default == NULL) + return; + + ASSERT(pr->pr_default_size >= sizeof (link_fec_t)); + + bcopy(&val, pr->pr_default, sizeof (val)); + + pr->pr_flags |= MAC_PROP_INFO_DEFAULT; +} + +void mac_prop_info_set_range_uint32(mac_prop_info_handle_t ph, uint32_t min, uint32_t max) { diff --git a/usr/src/uts/common/io/mac/mac_sched.c b/usr/src/uts/common/io/mac/mac_sched.c index 94ec8add16..8f983e50e4 100644 --- a/usr/src/uts/common/io/mac/mac_sched.c +++ b/usr/src/uts/common/io/mac/mac_sched.c @@ -4443,9 +4443,9 @@ mac_tx_send(mac_client_handle_t mch, mac_ring_handle_t ring, mblk_t *mp_chain, mac_hw_emul(&mp, NULL, NULL, MAC_ALL_EMULS); if (mp != NULL) { (dst_flow_ent->fe_cb_fn)( - dst_flow_ent->fe_cb_arg1, - dst_flow_ent->fe_cb_arg2, - mp, do_switch); + dst_flow_ent->fe_cb_arg1, + dst_flow_ent->fe_cb_arg2, + mp, do_switch); } } diff --git a/usr/src/uts/common/io/mac/mac_util.c b/usr/src/uts/common/io/mac/mac_util.c index 6e33fb7f56..03da3a3504 100644 --- a/usr/src/uts/common/io/mac/mac_util.c +++ b/usr/src/uts/common/io/mac/mac_util.c @@ -258,7 +258,7 @@ bail: static boolean_t mac_sw_cksum_ipv6(mblk_t *mp, uint32_t ip_hdr_offset, const char **err) { - ip6_t* ip6h = (ip6_t *)(mp->b_rptr + ip_hdr_offset); + ip6_t *ip6h = (ip6_t *)(mp->b_rptr + ip_hdr_offset); const uint8_t proto = ip6h->ip6_nxt; const uint16_t *iphs = (uint16_t *)ip6h; /* ULP offset from start of L2. */ diff --git a/usr/src/uts/common/io/mlxcx/mlxcx.c b/usr/src/uts/common/io/mlxcx/mlxcx.c index c90fa0969b..2aefac33db 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); @@ -1743,6 +1756,11 @@ mlxcx_setup_ports(mlxcx_t *mlxp) mutex_exit(&p->mlp_mtx); goto err; } + if (!mlxcx_cmd_query_port_fec(mlxp, p)) { + mutex_exit(&p->mlp_mtx); + goto err; + } + p->mlp_fec_requested = LINK_FEC_AUTO; mutex_exit(&p->mlp_mtx); } diff --git a/usr/src/uts/common/io/mlxcx/mlxcx.h b/usr/src/uts/common/io/mlxcx/mlxcx.h index da048b4ac3..06277d033c 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx.h +++ b/usr/src/uts/common/io/mlxcx/mlxcx.h @@ -346,6 +346,8 @@ typedef struct mlxcx_port { mlxcx_eth_proto_t mlp_max_proto; mlxcx_eth_proto_t mlp_admin_proto; mlxcx_eth_proto_t mlp_oper_proto; + mlxcx_pplm_fec_active_t mlp_fec_active; + link_fec_t mlp_fec_requested; mlxcx_eth_inline_mode_t mlp_wqe_min_inline; @@ -424,11 +426,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,6 +1180,8 @@ 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 uint_t mlxcx_buf_bind_or_copy(mlxcx_t *, mlxcx_work_queue_t *, mblk_t *, size_t, mlxcx_buffer_t **); @@ -1311,7 +1322,12 @@ extern boolean_t mlxcx_cmd_access_register(mlxcx_t *, mlxcx_cmd_reg_opmod_t, mlxcx_register_id_t, mlxcx_register_data_t *); extern boolean_t mlxcx_cmd_query_port_mtu(mlxcx_t *, mlxcx_port_t *); extern boolean_t mlxcx_cmd_query_port_status(mlxcx_t *, mlxcx_port_t *); +extern boolean_t mlxcx_cmd_modify_port_status(mlxcx_t *, mlxcx_port_t *, + mlxcx_port_status_t); extern boolean_t mlxcx_cmd_query_port_speed(mlxcx_t *, mlxcx_port_t *); +extern boolean_t mlxcx_cmd_query_port_fec(mlxcx_t *, mlxcx_port_t *); +extern boolean_t mlxcx_cmd_modify_port_fec(mlxcx_t *, mlxcx_port_t *, + mlxcx_pplm_fec_caps_t); extern boolean_t mlxcx_cmd_set_port_mtu(mlxcx_t *, mlxcx_port_t *); diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_cmd.c b/usr/src/uts/common/io/mlxcx/mlxcx_cmd.c index 30fb7ca8ef..f059b856a6 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_cmd.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_cmd.c @@ -12,6 +12,7 @@ /* * Copyright 2020, The University of Queensland * Copyright (c) 2018, Joyent, Inc. + * Copyright 2020 RackTop Systems, Inc. */ /* @@ -1594,6 +1595,8 @@ mlxcx_reg_name(mlxcx_register_id_t rid) return ("MCIA"); case MLXCX_REG_PPCNT: return ("PPCNT"); + case MLXCX_REG_PPLM: + return ("PPLM"); default: return ("???"); } @@ -1640,6 +1643,9 @@ mlxcx_cmd_access_register(mlxcx_t *mlxp, mlxcx_cmd_reg_opmod_t opmod, case MLXCX_REG_PPCNT: dsize = sizeof (mlxcx_reg_ppcnt_t); break; + case MLXCX_REG_PPLM: + dsize = sizeof (mlxcx_reg_pplm_t); + break; default: dsize = 0; VERIFY(0); @@ -1776,6 +1782,25 @@ mlxcx_cmd_query_port_status(mlxcx_t *mlxp, mlxcx_port_t *mlp) } boolean_t +mlxcx_cmd_modify_port_status(mlxcx_t *mlxp, mlxcx_port_t *mlp, + mlxcx_port_status_t status) +{ + mlxcx_register_data_t data; + boolean_t ret; + + ASSERT(mutex_owned(&mlp->mlp_mtx)); + bzero(&data, sizeof (data)); + data.mlrd_paos.mlrd_paos_local_port = mlp->mlp_num + 1; + data.mlrd_paos.mlrd_paos_admin_status = status; + set_bit32(&data.mlrd_paos.mlrd_paos_flags, MLXCX_PAOS_ADMIN_ST_EN); + + ret = mlxcx_cmd_access_register(mlxp, MLXCX_CMD_ACCESS_REGISTER_WRITE, + MLXCX_REG_PAOS, &data); + + return (ret); +} + +boolean_t mlxcx_cmd_query_port_speed(mlxcx_t *mlxp, mlxcx_port_t *mlp) { mlxcx_register_data_t data; @@ -1809,6 +1834,82 @@ mlxcx_cmd_query_port_speed(mlxcx_t *mlxp, mlxcx_port_t *mlp) } boolean_t +mlxcx_cmd_query_port_fec(mlxcx_t *mlxp, mlxcx_port_t *mlp) +{ + mlxcx_register_data_t data; + boolean_t ret; + + ASSERT(mutex_owned(&mlp->mlp_mtx)); + bzero(&data, sizeof (data)); + data.mlrd_pplm.mlrd_pplm_local_port = mlp->mlp_num + 1; + + ret = mlxcx_cmd_access_register(mlxp, MLXCX_CMD_ACCESS_REGISTER_READ, + MLXCX_REG_PPLM, &data); + + if (ret) { + mlp->mlp_fec_active = + from_be24(data.mlrd_pplm.mlrd_pplm_fec_mode_active); + } + + return (ret); +} + +boolean_t +mlxcx_cmd_modify_port_fec(mlxcx_t *mlxp, mlxcx_port_t *mlp, + mlxcx_pplm_fec_caps_t fec) +{ + mlxcx_register_data_t data_in, data_out; + mlxcx_pplm_fec_caps_t caps; + mlxcx_reg_pplm_t *pplm_in, *pplm_out; + boolean_t ret; + + ASSERT(mutex_owned(&mlp->mlp_mtx)); + bzero(&data_in, sizeof (data_in)); + pplm_in = &data_in.mlrd_pplm; + pplm_in->mlrd_pplm_local_port = mlp->mlp_num + 1; + + ret = mlxcx_cmd_access_register(mlxp, MLXCX_CMD_ACCESS_REGISTER_READ, + MLXCX_REG_PPLM, &data_in); + + if (!ret) + return (B_FALSE); + + bzero(&data_out, sizeof (data_out)); + pplm_out = &data_out.mlrd_pplm; + pplm_out->mlrd_pplm_local_port = mlp->mlp_num + 1; + + caps = get_bits32(pplm_in->mlrd_pplm_fec_override_cap, + MLXCX_PPLM_CAP_56G); + set_bits32(&pplm_out->mlrd_pplm_fec_override_admin, + MLXCX_PPLM_CAP_56G, fec & caps); + + caps = get_bits32(pplm_in->mlrd_pplm_fec_override_cap, + MLXCX_PPLM_CAP_100G); + set_bits32(&pplm_out->mlrd_pplm_fec_override_admin, + MLXCX_PPLM_CAP_100G, fec & caps); + + caps = get_bits32(pplm_in->mlrd_pplm_fec_override_cap, + MLXCX_PPLM_CAP_50G); + set_bits32(&pplm_out->mlrd_pplm_fec_override_admin, + MLXCX_PPLM_CAP_50G, fec & caps); + + caps = get_bits32(pplm_in->mlrd_pplm_fec_override_cap, + MLXCX_PPLM_CAP_25G); + set_bits32(&pplm_out->mlrd_pplm_fec_override_admin, + MLXCX_PPLM_CAP_25G, fec & caps); + + caps = get_bits32(pplm_in->mlrd_pplm_fec_override_cap, + MLXCX_PPLM_CAP_10_40G); + set_bits32(&pplm_out->mlrd_pplm_fec_override_admin, + MLXCX_PPLM_CAP_10_40G, fec & caps); + + ret = mlxcx_cmd_access_register(mlxp, MLXCX_CMD_ACCESS_REGISTER_WRITE, + MLXCX_REG_PPLM, &data_out); + + return (ret); +} + +boolean_t mlxcx_cmd_modify_nic_vport_ctx(mlxcx_t *mlxp, mlxcx_port_t *mlp, mlxcx_modify_nic_vport_ctx_fields_t fields) { diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c index a08cec3980..2521641a00 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c @@ -80,6 +80,53 @@ mlxcx_speed_to_bits(mlxcx_eth_proto_t v) } } +static link_fec_t +mlxcx_fec_to_link_fec(mlxcx_pplm_fec_active_t mlxcx_fec) +{ + if ((mlxcx_fec & MLXCX_PPLM_FEC_ACTIVE_NONE) != 0) + return (LINK_FEC_NONE); + + if ((mlxcx_fec & MLXCX_PPLM_FEC_ACTIVE_FIRECODE) != 0) + return (LINK_FEC_BASE_R); + + if ((mlxcx_fec & (MLXCX_PPLM_FEC_ACTIVE_RS528 | + MLXCX_PPLM_FEC_ACTIVE_RS271 | MLXCX_PPLM_FEC_ACTIVE_RS544 | + MLXCX_PPLM_FEC_ACTIVE_RS272)) != 0) + return (LINK_FEC_RS); + + return (LINK_FEC_NONE); +} + +static boolean_t +mlxcx_link_fec_cap(link_fec_t fec, mlxcx_pplm_fec_caps_t *pfecp) +{ + mlxcx_pplm_fec_caps_t pplm_fec = 0; + + if ((fec & LINK_FEC_AUTO) != 0) { + pplm_fec = MLXCX_PPLM_FEC_CAP_AUTO; + fec &= ~LINK_FEC_AUTO; + } else if ((fec & LINK_FEC_NONE) != 0) { + pplm_fec = MLXCX_PPLM_FEC_CAP_NONE; + fec &= ~LINK_FEC_NONE; + } else if ((fec & LINK_FEC_RS) != 0) { + pplm_fec |= MLXCX_PPLM_FEC_CAP_RS; + fec &= ~LINK_FEC_RS; + } else if ((fec & LINK_FEC_BASE_R) != 0) { + pplm_fec |= MLXCX_PPLM_FEC_CAP_FIRECODE; + fec &= ~LINK_FEC_BASE_R; + } + + /* + * Only one fec option is allowed. + */ + if (fec != 0) + return (B_FALSE); + + *pfecp = pplm_fec; + + return (B_TRUE); +} + static int mlxcx_mac_stat_rfc_2863(mlxcx_t *mlxp, mlxcx_port_t *port, uint_t stat, uint64_t *val) @@ -451,7 +498,8 @@ 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); @@ -725,8 +773,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)) { @@ -743,7 +811,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); @@ -775,12 +851,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 @@ -1061,6 +1138,14 @@ mlxcx_mac_propinfo(void *arg, const char *pr_name, mac_prop_id_t pr_num, mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ); mac_prop_info_set_default_uint8(prh, 1); break; + case MAC_PROP_ADV_FEC_CAP: + mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ); + mac_prop_info_set_default_fec(prh, LINK_FEC_AUTO); + break; + case MAC_PROP_EN_FEC_CAP: + mac_prop_info_set_perm(prh, MAC_PROP_PERM_RW); + mac_prop_info_set_default_fec(prh, LINK_FEC_AUTO); + break; case MAC_PROP_ADV_100GFDX_CAP: case MAC_PROP_EN_100GFDX_CAP: mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ); @@ -1120,6 +1205,9 @@ mlxcx_mac_setprop(void *arg, const char *pr_name, mac_prop_id_t pr_num, uint32_t new_mtu, new_hw_mtu, old_mtu; mlxcx_buf_shard_t *sh; boolean_t allocd = B_FALSE; + boolean_t relink = B_FALSE; + link_fec_t fec; + mlxcx_pplm_fec_caps_t cap_fec; mutex_enter(&port->mlp_mtx); @@ -1137,7 +1225,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; @@ -1167,11 +1256,57 @@ mlxcx_mac_setprop(void *arg, const char *pr_name, mac_prop_id_t pr_num, break; } break; + + case MAC_PROP_EN_FEC_CAP: + bcopy(pr_val, &fec, sizeof (fec)); + if (!mlxcx_link_fec_cap(fec, &cap_fec)) { + ret = EINVAL; + break; + } + + /* + * Don't change the FEC if it is already at the requested + * setting AND the port is up. + * When the port is down, always set the FEC and attempt + * to retrain the link. + */ + if (fec == port->mlp_fec_requested && + fec == mlxcx_fec_to_link_fec(port->mlp_fec_active) && + port->mlp_oper_status != MLXCX_PORT_STATUS_DOWN) + break; + + /* + * The most like cause of this failing is an invalid + * or unsupported fec option. + */ + if (!mlxcx_cmd_modify_port_fec(mlxp, port, cap_fec)) { + ret = EINVAL; + break; + } + + port->mlp_fec_requested = fec; + + /* + * For FEC to become effective, the link needs to go back + * to training and negotiation state. This happens when + * the link transitions from down to up, force a relink. + */ + relink = B_TRUE; + break; + default: ret = ENOTSUP; break; } + if (relink) { + if (!mlxcx_cmd_modify_port_status(mlxp, port, + MLXCX_PORT_STATUS_DOWN) || + !mlxcx_cmd_modify_port_status(mlxp, port, + MLXCX_PORT_STATUS_UP)) { + ret = EIO; + } + } mutex_exit(&port->mlp_mtx); return (ret); @@ -1229,6 +1364,21 @@ mlxcx_mac_getprop(void *arg, const char *pr_name, mac_prop_id_t pr_num, } *(uint8_t *)pr_val = port->mlp_autoneg; break; + case MAC_PROP_ADV_FEC_CAP: + if (pr_valsize < sizeof (link_fec_t)) { + ret = EOVERFLOW; + break; + } + *(link_fec_t *)pr_val = + mlxcx_fec_to_link_fec(port->mlp_fec_active); + break; + case MAC_PROP_EN_FEC_CAP: + if (pr_valsize < sizeof (link_fec_t)) { + ret = EOVERFLOW; + break; + } + *(link_fec_t *)pr_val = port->mlp_fec_requested; + break; case MAC_PROP_MTU: if (pr_valsize < sizeof (uint32_t)) { ret = EOVERFLOW; diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_intr.c b/usr/src/uts/common/io/mlxcx/mlxcx_intr.c index 4dc4291b08..aed691897b 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_intr.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_intr.c @@ -355,6 +355,7 @@ mlxcx_update_link_state(mlxcx_t *mlxp, mlxcx_port_t *port) mutex_enter(&port->mlp_mtx); (void) mlxcx_cmd_query_port_status(mlxp, port); (void) mlxcx_cmd_query_port_speed(mlxp, port); + (void) mlxcx_cmd_query_port_fec(mlxp, port); switch (port->mlp_oper_status) { case MLXCX_PORT_STATUS_UP: diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_reg.h b/usr/src/uts/common/io/mlxcx/mlxcx_reg.h index 6d09abea5c..abd717842d 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_reg.h +++ b/usr/src/uts/common/io/mlxcx/mlxcx_reg.h @@ -2464,6 +2464,59 @@ typedef struct { } mlxcx_reg_ppcnt_t; typedef enum { + MLXCX_PPLM_FEC_CAP_AUTO = 0, + MLXCX_PPLM_FEC_CAP_NONE = (1 << 0), + MLXCX_PPLM_FEC_CAP_FIRECODE = (1 << 1), + MLXCX_PPLM_FEC_CAP_RS = (1 << 2), +} mlxcx_pplm_fec_caps_t; + +typedef enum { + MLXCX_PPLM_FEC_ACTIVE_NONE = (1 << 0), + MLXCX_PPLM_FEC_ACTIVE_FIRECODE = (1 << 1), + MLXCX_PPLM_FEC_ACTIVE_RS528 = (1 << 2), + MLXCX_PPLM_FEC_ACTIVE_RS271 = (1 << 3), + MLXCX_PPLM_FEC_ACTIVE_RS544 = (1 << 7), + MLXCX_PPLM_FEC_ACTIVE_RS272 = (1 << 9), +} mlxcx_pplm_fec_active_t; + +/* CSTYLED */ +#define MLXCX_PPLM_CAP_56G (bitdef_t){ 16, 0x000f0000 } +/* CSTYLED */ +#define MLXCX_PPLM_CAP_100G (bitdef_t){ 12, 0x0000f000 } +/* CSTYLED */ +#define MLXCX_PPLM_CAP_50G (bitdef_t){ 8, 0x00000f00 } +/* CSTYLED */ +#define MLXCX_PPLM_CAP_25G (bitdef_t){ 4, 0x000000f0 } +/* CSTYLED */ +#define MLXCX_PPLM_CAP_10_40G (bitdef_t){ 0, 0x0000000f } + +typedef struct { + uint8_t mlrd_pplm_rsvd; + uint8_t mlrd_pplm_local_port; + uint8_t mlrd_pplm_rsvd1[11]; + uint24be_t mlrd_pplm_fec_mode_active; + bits32_t mlrd_pplm_fec_override_cap; + bits32_t mlrd_pplm_fec_override_admin; + uint16be_t mlrd_pplm_fec_override_cap_400g_8x; + uint16be_t mlrd_pplm_fec_override_cap_200g_4x; + uint16be_t mlrd_pplm_fec_override_cap_100g_2x; + uint16be_t mlrd_pplm_fec_override_cap_50g_1x; + uint16be_t mlrd_pplm_fec_override_admin_400g_8x; + uint16be_t mlrd_pplm_fec_override_admin_200g_4x; + uint16be_t mlrd_pplm_fec_override_admin_100g_2x; + uint16be_t mlrd_pplm_fec_override_admin_50g_1x; + uint8_t mlrd_pplm_rsvd2[8]; + uint16be_t mlrd_pplm_fec_override_cap_hdr; + uint16be_t mlrd_pplm_fec_override_cap_edr; + uint16be_t mlrd_pplm_fec_override_cap_fdr; + uint16be_t mlrd_pplm_fec_override_cap_fdr10; + uint16be_t mlrd_pplm_fec_override_admin_hdr; + uint16be_t mlrd_pplm_fec_override_admin_edr; + uint16be_t mlrd_pplm_fec_override_admin_fdr; + uint16be_t mlrd_pplm_fec_override_admin_fdr10; +} mlxcx_reg_pplm_t; + +typedef enum { MLXCX_REG_PMTU = 0x5003, MLXCX_REG_PTYS = 0x5004, MLXCX_REG_PAOS = 0x5006, @@ -2472,6 +2525,7 @@ typedef enum { MLXCX_REG_MLCR = 0x902B, MLXCX_REG_MCIA = 0x9014, MLXCX_REG_PPCNT = 0x5008, + MLXCX_REG_PPLM = 0x5023, } mlxcx_register_id_t; typedef union { @@ -2482,6 +2536,7 @@ typedef union { mlxcx_reg_pmaos_t mlrd_pmaos; mlxcx_reg_mcia_t mlrd_mcia; mlxcx_reg_ppcnt_t mlrd_ppcnt; + mlxcx_reg_pplm_t mlrd_pplm; } mlxcx_register_data_t; typedef enum { diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_ring.c b/usr/src/uts/common/io/mlxcx/mlxcx_ring.c index 492f8fd8a5..da98a5cf40 100644 --- a/usr/src/uts/common/io/mlxcx/mlxcx_ring.c +++ b/usr/src/uts/common/io/mlxcx/mlxcx_ring.c @@ -1213,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; @@ -1409,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); @@ -1799,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 { @@ -1851,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; @@ -1883,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; @@ -2058,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); } @@ -2101,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 @@ -2177,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); @@ -2345,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; @@ -2366,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; @@ -2379,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); @@ -2391,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); } @@ -2453,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); @@ -2466,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); @@ -2484,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); @@ -2506,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/common/io/stream.c b/usr/src/uts/common/io/stream.c index 55fd87db45..288f77ae47 100644 --- a/usr/src/uts/common/io/stream.c +++ b/usr/src/uts/common/io/stream.c @@ -839,7 +839,7 @@ frnop_func(void *arg) */ static mblk_t * gesballoc(unsigned char *base, size_t size, uint32_t db_rtfu, frtn_t *frp, - void (*lastfree)(mblk_t *, dblk_t *), int kmflags) + void (*lastfree)(mblk_t *, dblk_t *), int kmflags) { dblk_t *dbp; mblk_t *mp; diff --git a/usr/src/uts/common/klm/nlm_impl.h b/usr/src/uts/common/klm/nlm_impl.h index 68604309a2..9caae1a8c7 100644 --- a/usr/src/uts/common/klm/nlm_impl.h +++ b/usr/src/uts/common/klm/nlm_impl.h @@ -28,7 +28,7 @@ */ /* - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2016 Joyent, Inc. */ @@ -112,7 +112,7 @@ struct _kthread; * We pass three callback functions to nlm_do_lock: * nlm_reply_cb: send a normal RPC reply * nlm_res_cb: do a _res (message style) RPC (call) - * nlm_testargs_cb: do a "granted" RPC call (after blocking) + * nlm_granted_cb: do a "granted" RPC call (after blocking) * Only one of the 1st or 2nd is used. * The 3rd is used only for blocking * @@ -123,7 +123,7 @@ struct _kthread; */ typedef bool_t (*nlm_reply_cb)(SVCXPRT *, nlm4_res *); typedef enum clnt_stat (*nlm_res_cb)(nlm4_res *, void *, CLIENT *); -typedef enum clnt_stat (*nlm_testargs_cb)(nlm4_testargs *, void *, CLIENT *); +typedef enum clnt_stat (*nlm_granted_cb)(nlm4_testargs *, nlm4_res *, CLIENT *); typedef enum clnt_stat (*nlm_testres_cb)(nlm4_testres *, void *, CLIENT *); /* @@ -624,7 +624,7 @@ void nlm_do_notify2(nlm_sm_status *, void *, struct svc_req *); void nlm_do_test(nlm4_testargs *, nlm4_testres *, struct svc_req *, nlm_testres_cb); void nlm_do_lock(nlm4_lockargs *, nlm4_res *, struct svc_req *, - nlm_reply_cb, nlm_res_cb, nlm_testargs_cb); + nlm_reply_cb, nlm_res_cb, nlm_granted_cb); void nlm_do_cancel(nlm4_cancargs *, nlm4_res *, struct svc_req *, nlm_res_cb); void nlm_do_unlock(nlm4_unlockargs *, nlm4_res *, diff --git a/usr/src/uts/common/klm/nlm_rpc_handle.c b/usr/src/uts/common/klm/nlm_rpc_handle.c index 9ddf56856c..b022acc380 100644 --- a/usr/src/uts/common/klm/nlm_rpc_handle.c +++ b/usr/src/uts/common/klm/nlm_rpc_handle.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -130,6 +130,7 @@ update_host_rpcbinding(struct nlm_host *hostp, int vers) static int refresh_nlm_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) { + uint32_t zero = 0; int ret; if (rpcp->nr_handle == NULL) { @@ -175,6 +176,12 @@ refresh_nlm_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) if (NLM_STALE_CLNT(stat)) { ret = ESTALE; } + /* + * Need to reset the XID after the null call above, + * otherwise we'll reuse the XID from that call. + */ + (void) CLNT_CONTROL(rpcp->nr_handle, CLSET_XID, + (char *)&zero); } } @@ -209,7 +216,8 @@ again: rc = cv_wait_sig(&hostp->nh_rpcb_cv, &hostp->nh_lock); if (rc == 0) { mutex_exit(&hostp->nh_lock); - return (EINTR); + rc = EINTR; + goto errout; } } @@ -229,7 +237,8 @@ again: */ if (hostp->nh_rpcb_ustat != RPC_SUCCESS) { mutex_exit(&hostp->nh_lock); - return (ENOENT); + rc = ENOENT; + goto errout; } } @@ -263,7 +272,7 @@ again: } destroy_rpch(rpcp); - return (rc); + goto errout; } DTRACE_PROBE2(end, struct nlm_host *, hostp, @@ -271,6 +280,10 @@ again: *rpcpp = rpcp; return (0); + +errout: + NLM_ERR("Can't get RPC client handle for: %s", hostp->nh_name); + return (rc); } void diff --git a/usr/src/uts/common/klm/nlm_rpc_svc.c b/usr/src/uts/common/klm/nlm_rpc_svc.c index 2911b31877..1f04e3f036 100644 --- a/usr/src/uts/common/klm/nlm_rpc_svc.c +++ b/usr/src/uts/common/klm/nlm_rpc_svc.c @@ -26,7 +26,7 @@ */ /* - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -63,7 +63,7 @@ * 32-bit lock ranges. */ static void -nlm_convert_to_nlm_lock(struct nlm_lock *dst, struct nlm4_lock *src) +nlm_convert_to_nlm_lock(struct nlm_lock *dst, const struct nlm4_lock *src) { dst->caller_name = src->caller_name; dst->fh = src->fh; @@ -76,12 +76,22 @@ nlm_convert_to_nlm_lock(struct nlm_lock *dst, struct nlm4_lock *src) } /* + * Up-convert for v1 granted response + */ +static void +nlm_convert_to_nlm4_res(struct nlm4_res *dst, const struct nlm_res *src) +{ + dst->cookie = src->cookie; + dst->stat.stat = (nlm4_stats) src->stat.stat; +} + +/* * Up-convert for v1 svc functions with a 32-bit lock range arg. * Note that lock range checks (like overflow) are done later, * in nlm_init_flock(). */ static void -nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, struct nlm_lock *src) +nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, const struct nlm_lock *src) { dst->caller_name = src->caller_name; @@ -93,7 +103,7 @@ nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, struct nlm_lock *src) } static void -nlm_convert_to_nlm4_share(struct nlm4_share *dst, struct nlm_share *src) +nlm_convert_to_nlm4_share(struct nlm4_share *dst, const struct nlm_share *src) { dst->caller_name = src->caller_name; @@ -113,7 +123,7 @@ nlm_convert_to_nlm4_share(struct nlm4_share *dst, struct nlm_share *src) * valid 32-bit lock range. */ static void -nlm_convert_to_nlm_holder(struct nlm_holder *dst, struct nlm4_holder *src) +nlm_convert_to_nlm_holder(struct nlm_holder *dst, const struct nlm4_holder *src) { dst->exclusive = src->exclusive; dst->svid = src->svid; @@ -133,7 +143,7 @@ nlm_convert_to_nlm_stats(enum nlm4_stats src) } static void -nlm_convert_to_nlm_res(struct nlm_res *dst, struct nlm4_res *src) +nlm_convert_to_nlm_res(struct nlm_res *dst, const struct nlm4_res *src) { dst->cookie = src->cookie; dst->stat.stat = nlm_convert_to_nlm_stats(src->stat.stat); @@ -175,7 +185,7 @@ nlm_test_1_svc(struct nlm_testargs *argp, nlm_testres *resp, * Callback functions for nlm_lock_1_svc */ static bool_t nlm_lock_1_reply(SVCXPRT *, nlm4_res *); -static enum clnt_stat nlm_granted_1_cb(nlm4_testargs *, void *, CLIENT *); +static enum clnt_stat nlm_granted_1_cb(nlm4_testargs *, nlm4_res *, CLIENT *); bool_t nlm_lock_1_svc(nlm_lockargs *argp, nlm_res *resp, @@ -215,7 +225,7 @@ nlm_lock_1_reply(SVCXPRT *transp, nlm4_res *resp) } static enum clnt_stat -nlm_granted_1_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) +nlm_granted_1_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) { nlm_testargs args1; nlm_res res1; @@ -229,9 +239,7 @@ nlm_granted_1_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) rv = nlm_granted_1(&args1, &res1, clnt); - /* NB: We have a result our caller will not free. */ - xdr_free((xdrproc_t)xdr_nlm_res, (void *)&res1); - (void) resp; + nlm_convert_to_nlm4_res(resp, &res1); return (rv); } @@ -355,7 +363,8 @@ nlm_test_res_1_cb(nlm4_testres *res4, void *null, CLIENT *clnt) * Callback functions for nlm_lock_msg_1_svc */ static enum clnt_stat nlm_lock_res_1_cb(nlm4_res *, void *, CLIENT *); -static enum clnt_stat nlm_granted_msg_1_cb(nlm4_testargs *, void *, CLIENT *); +static enum clnt_stat nlm_granted_msg_1_cb(nlm4_testargs *, nlm4_res *, + CLIENT *); bool_t nlm_lock_msg_1_svc(nlm_lockargs *argp, void *resp, @@ -396,16 +405,22 @@ nlm_lock_res_1_cb(nlm4_res *resp, void *null, CLIENT *clnt) } static enum clnt_stat -nlm_granted_msg_1_cb(nlm4_testargs *argp, void *null, CLIENT *clnt) +nlm_granted_msg_1_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) { nlm_testargs args1; + int rv; args1.cookie = argp->cookie; args1.exclusive = argp->exclusive; nlm_convert_to_nlm_lock(&args1.alock, &argp->alock); - return (nlm_granted_msg_1(&args1, null, clnt)); + rv = nlm_granted_msg_1(&args1, NULL, clnt); + + /* MSG call doesn't fill in *resp, so do it here. */ + if (rv != RPC_SUCCESS) + resp->stat.stat = nlm4_failed; + return (rv); } @@ -693,7 +708,6 @@ nlm4_test_4_svc(nlm4_testargs *argp, nlm4_testres *resp, struct svc_req *sr) * Callback functions for nlm4_lock_4_svc */ static bool_t nlm4_lock_4_reply(SVCXPRT *, nlm4_res *); -static enum clnt_stat nlm4_granted_4_cb(nlm4_testargs *, void *, CLIENT *); bool_t nlm4_lock_4_svc(nlm4_lockargs *argp, nlm4_res *resp, @@ -703,7 +717,7 @@ nlm4_lock_4_svc(nlm4_lockargs *argp, nlm4_res *resp, /* NLM4_LOCK */ nlm_do_lock(argp, resp, sr, nlm4_lock_4_reply, NULL, - nlm4_granted_4_cb); + nlm4_granted_4); /* above does its own reply */ return (FALSE); @@ -715,22 +729,6 @@ nlm4_lock_4_reply(SVCXPRT *transp, nlm4_res *resp) return (svc_sendreply(transp, xdr_nlm4_res, (char *)resp)); } -static enum clnt_stat -nlm4_granted_4_cb(nlm4_testargs *argp, void *resp, CLIENT *clnt) -{ - nlm4_res res4; - int rv; - - bzero(&res4, sizeof (res4)); - rv = nlm4_granted_4(argp, &res4, clnt); - - /* NB: We have a result our caller will not free. */ - xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res4); - (void) resp; - - return (rv); -} - bool_t nlm4_cancel_4_svc(nlm4_cancargs *argp, nlm4_res *resp, struct svc_req *sr) { @@ -773,6 +771,8 @@ nlm4_test_msg_4_svc(nlm4_testargs *argp, void *resp, struct svc_req *sr) * Callback functions for nlm4_lock_msg_4_svc * (using the RPC client stubs directly) */ +static enum clnt_stat nlm4_granted_msg_4_cb(nlm4_testargs *, nlm4_res *, + CLIENT *); bool_t nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, @@ -784,7 +784,7 @@ nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, bzero(&res4, sizeof (res4)); nlm_do_lock(argp, &res4, sr, NULL, nlm4_lock_res_4, - nlm4_granted_msg_4); + nlm4_granted_msg_4_cb); /* NB: We have a result our caller will not free. */ xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res4); @@ -794,6 +794,20 @@ nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *resp, return (FALSE); } +static enum clnt_stat +nlm4_granted_msg_4_cb(nlm4_testargs *argp, nlm4_res *resp, CLIENT *clnt) +{ + int rv; + + rv = nlm4_granted_msg_4(argp, NULL, clnt); + + /* MSG call doesn't fill in *resp, so do it here. */ + if (rv != RPC_SUCCESS) + resp->stat.stat = nlm4_failed; + + return (rv); +} + bool_t nlm4_cancel_msg_4_svc(nlm4_cancargs *argp, void *resp, struct svc_req *sr) { diff --git a/usr/src/uts/common/klm/nlm_service.c b/usr/src/uts/common/klm/nlm_service.c index dceabaf53f..f4f733443e 100644 --- a/usr/src/uts/common/klm/nlm_service.c +++ b/usr/src/uts/common/klm/nlm_service.c @@ -27,7 +27,7 @@ /* * Copyright (c) 2012, 2016 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Nexenta by DDN, Inc. All rights reserved. * Copyright 2014 Joyent, Inc. All rights reserved. */ @@ -81,6 +81,7 @@ struct nlm_block_cb_data { struct nlm_host *hostp; struct nlm_vhold *nvp; struct flock64 *flp; + bool_t registered; }; /* @@ -107,9 +108,9 @@ static void nlm_block( nlm4_lockargs *lockargs, struct nlm_host *host, struct nlm_vhold *nvp, - nlm_rpc_t *rpcp, struct flock64 *fl, - nlm_testargs_cb grant_cb); + nlm_granted_cb grant_cb, + rpcvers_t); static vnode_t *nlm_fh_to_vp(struct netobj *); static struct nlm_vhold *nlm_fh_to_vhold(struct nlm_host *, struct netobj *); @@ -314,6 +315,11 @@ nlm_do_notify2(nlm_sm_status *argp, void *res, struct svc_req *sr) * NLM_TEST, NLM_TEST_MSG, * NLM4_TEST, NLM4_TEST_MSG, * Client inquiry about locks, non-blocking. + * + * Arg cb is NULL for NLM_TEST, NLM4_TEST, and + * non-NULL for NLM_TEST_MSG, NLM4_TEST_MSG + * The MSG forms use the cb to send the reply, + * and don't return a reply for this call. */ void nlm_do_test(nlm4_testargs *argp, nlm4_testres *resp, @@ -455,10 +461,19 @@ out: * We also have to keep a list of locks (pending + granted) * both to handle retransmitted requests, and to keep the * vnodes for those locks active. + * + * Callback arguments: + * reply_cb Used to send a normal RPC reply just as if + * we had filled in a response for our caller. + * Needed because we do work after the reply. + * res_cb Used for the MSG calls, where there's no + * regular RPC response. + * grant_cb Used to CALL the client informing them of a + * granted lock after a "blocked" reply. */ void nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, - nlm_reply_cb reply_cb, nlm_res_cb res_cb, nlm_testargs_cb grant_cb) + nlm_reply_cb reply_cb, nlm_res_cb res_cb, nlm_granted_cb grant_cb) { struct nlm_globals *g; struct flock64 fl; @@ -492,20 +507,18 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, struct nlm_host *, host, nlm4_lockargs *, argp); /* - * If we may need to do _msg_ call needing an RPC - * callback, get the RPC client handle now, - * so we know if we can bind to the NLM service on - * this client. - * - * Note: host object carries transport type. - * One client using multiple transports gets - * separate sysids for each of its transports. + * If this is a MSG call (NLM_LOCK_MSG, NLM4_LOCK_MSG) + * we'll have res_cb != NULL, and we know we'll need an + * RPC client handle _now_ so we can send the response. + * If we can't get an rpc handle (rpcp) then we have + * no way to respond, and the client will time out. */ - if (res_cb != NULL || (grant_cb != NULL && argp->block == TRUE)) { + if (res_cb != NULL) { error = nlm_host_get_rpc(host, sr->rq_vers, &rpcp); if (error != 0) { + ASSERT(rpcp == NULL); status = nlm4_denied_nolocks; - goto doreply; + goto out; } } @@ -584,6 +597,8 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_res *resp, struct svc_req *sr, /* * OK, can detach this thread, so this call * will block below (after we reply). + * The "blocked" reply tells the client to + * expect a "granted" call-back later. */ status = nlm4_blocked; do_blocking = TRUE; @@ -655,11 +670,12 @@ doreply: * "detach" it from the RPC SVC pool, allowing it * to block indefinitely if needed. */ - ASSERT(rpcp != NULL); + ASSERT(grant_cb != NULL); (void) svc_detach_thread(sr->rq_xprt); - nlm_block(argp, host, nvp, rpcp, &fl, grant_cb); + nlm_block(argp, host, nvp, &fl, grant_cb, sr->rq_vers); } +out: DTRACE_PROBE3(lock__end, struct nlm_globals *, g, struct nlm_host *, host, nlm4_res *, resp); @@ -679,25 +695,26 @@ static void nlm_block(nlm4_lockargs *lockargs, struct nlm_host *host, struct nlm_vhold *nvp, - nlm_rpc_t *rpcp, struct flock64 *flp, - nlm_testargs_cb grant_cb) + nlm_granted_cb grant_cb, + rpcvers_t vers) { nlm4_testargs args; + nlm4_res res; int error; flk_callback_t flk_cb; struct nlm_block_cb_data cb_data; + nlm_rpc_t *rpcp = NULL; + enum clnt_stat status; /* * Keep a list of blocked locks on nh_pending, and use it * to cancel these threads in nlm_destroy_client_pending. * - * Check to see if this lock is already in the list - * and if not, add an entry for it. Allocate first, - * then if we don't insert, free the new one. - * Caller already has vp held. + * Check to see if this lock is already in the list. If so, + * some earlier call is already blocked getting this lock, + * so there's nothing more this call needs to do. */ - error = nlm_slreq_register(host, nvp, flp); if (error != 0) { /* @@ -710,9 +727,22 @@ nlm_block(nlm4_lockargs *lockargs, return; } + /* + * Make sure we can get an RPC client handle we can use to + * deliver the "granted" callback if/when we get the lock. + * If we can't, there's no point blocking to get the lock + * for them because they'll never find out about it. + */ + error = nlm_host_get_rpc(host, vers, &rpcp); + if (error != 0) { + (void) nlm_slreq_unregister(host, nvp, flp); + return; + } + cb_data.hostp = host; cb_data.nvp = nvp; cb_data.flp = flp; + cb_data.registered = TRUE; flk_init_callback(&flk_cb, nlm_block_callback, &cb_data); /* BSD: VOP_ADVLOCK(vp, NULL, F_SETLK, fl, F_REMOTE); */ @@ -720,23 +750,60 @@ nlm_block(nlm4_lockargs *lockargs, F_REMOTELOCK | FREAD | FWRITE, (u_offset_t)0, &flk_cb, CRED(), NULL); + /* + * If the nlm_block_callback didn't already do it... + */ + if (cb_data.registered) + (void) nlm_slreq_unregister(host, nvp, flp); + if (error != 0) { /* * We failed getting the lock, but have no way to * tell the client about that. Let 'em time out. */ - (void) nlm_slreq_unregister(host, nvp, flp); return; } - /* + * ... else we got the lock on behalf of this client. + * + * We MUST either tell the client about this lock + * (via the "granted" callback RPC) or unlock. + * * Do the "granted" call-back to the client. */ + bzero(&args, sizeof (args)); args.cookie = lockargs->cookie; args.exclusive = lockargs->exclusive; args.alock = lockargs->alock; + bzero(&res, sizeof (res)); + + /* + * Not using the NLM_INVOKE_CALLBACK() macro because + * we need to take actions on errors. + */ + status = (*grant_cb)(&args, &res, (rpcp)->nr_handle); + if (status != RPC_SUCCESS) { + struct rpc_err err; + + CLNT_GETERR((rpcp)->nr_handle, &err); + NLM_ERR("NLM: %s callback failed: " + "stat %d, err %d\n", "grant", status, + err.re_errno); + res.stat.stat = nlm4_failed; + } + if (res.stat.stat != nlm4_granted) { + /* + * Failed to deliver the granted callback, so + * the client doesn't know about this lock. + * Unlock the lock. The client will time out. + */ + (void) nlm_vop_frlock(nvp->nv_vp, F_UNLCK, flp, + F_REMOTELOCK | FREAD | FWRITE, + (u_offset_t)0, NULL, CRED(), NULL); + } + xdr_free((xdrproc_t)xdr_nlm4_res, (void *)&res); - NLM_INVOKE_CALLBACK("grant", rpcp, &args, grant_cb); + nlm_host_rele_rpc(host, rpcp); } /* @@ -756,6 +823,7 @@ nlm_block_callback(flk_cb_when_t when, void *data) if (when == FLK_AFTER_SLEEP) { (void) nlm_slreq_unregister(cb_data->hostp, cb_data->nvp, cb_data->flp); + cb_data->registered = FALSE; } return (0); diff --git a/usr/src/uts/common/os/logsubr.c b/usr/src/uts/common/os/logsubr.c index 9e58a7bb56..2543bdf17e 100644 --- a/usr/src/uts/common/os/logsubr.c +++ b/usr/src/uts/common/os/logsubr.c @@ -20,6 +20,7 @@ */ /* + * Copyright 2020 Oxide Computer Company * Copyright (c) 2013 Gary Mills * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2020 Joyent, Inc. @@ -43,6 +44,7 @@ #include <sys/utsname.h> #include <sys/id_space.h> #include <sys/zone.h> +#include <sys/bootbanner.h> log_zone_t log_global; queue_t *log_consq; @@ -182,6 +184,14 @@ log_zonefree(zoneid_t zoneid, void *arg) kmem_free(lzp, sizeof (log_zone_t)); } +static void +log_bootbanner_print(const char *line, uint_t num) +{ + const char *pfx = (num == 0) ? "\r" : ""; + + printf("%s%s\n", pfx, line); +} + void log_init(void) { @@ -246,11 +256,15 @@ log_init(void) log_update(&log_backlog, log_backlogq, SL_CONSOLE, log_console); /* - * Now that logging is enabled, emit the SunOS banner. + * Now that logging is enabled, emit the boot banner. */ +#ifdef LEGACY_BANNER printf("\rSunOS Release %s Version %s %u-bit\n", utsname.release, utsname.version, NBBY * (uint_t)sizeof (void *)); printf("Copyright 2010-2020 Joyent, Inc.\n"); +#else + bootbanner_print(log_bootbanner_print, KM_SLEEP); +#endif #ifdef DEBUG printf("DEBUG enabled\n"); #endif diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c index ac1ee2d1ce..1e18a0ce9e 100644 --- a/usr/src/uts/common/os/strsubr.c +++ b/usr/src/uts/common/os/strsubr.c @@ -28,6 +28,7 @@ * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright 2018 Joyent, Inc. * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2018 Joyent, Inc. */ #include <sys/types.h> diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 3664f0096b..24fdd94c11 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -96,6 +96,7 @@ CHKHDRS= \ bofi.h \ bofi_impl.h \ bpp_io.h \ + bootbanner.h \ bootstat.h \ brand.h \ buf.h \ diff --git a/usr/src/uts/common/sys/bootbanner.h b/usr/src/uts/common/sys/bootbanner.h new file mode 100644 index 0000000000..93ba1b9e79 --- /dev/null +++ b/usr/src/uts/common/sys/bootbanner.h @@ -0,0 +1,33 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Oxide Computer Company + */ + +#ifndef _SYS_BOOTBANNER_H +#define _SYS_BOOTBANNER_H + +/* + * Rendering of the boot banner, used on the system and zone consoles. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void bootbanner_print(void (*)(const char *, uint_t), int kmflag); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_BOOTBANNER_H */ diff --git a/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_hw.h b/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_hw.h index ab4b4b4e6b..406c90303b 100644 --- a/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_hw.h +++ b/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_hw.h @@ -2140,7 +2140,7 @@ typedef struct #define SLI_FW_TYPE_101 SLI_FW_TYPE_SHIFT(0xb) /* LP101 */ -enum emlxs_prog_type +typedef enum emlxs_prog_type { TEST_PROGRAM, /* 0 */ UTIL_PROGRAM, /* 1 */ diff --git a/usr/src/uts/common/sys/fs/sdev_impl.h b/usr/src/uts/common/sys/fs/sdev_impl.h index d1c5f674f1..676193fcfa 100644 --- a/usr/src/uts/common/sys/fs/sdev_impl.h +++ b/usr/src/uts/common/sys/fs/sdev_impl.h @@ -39,6 +39,7 @@ extern "C" { #include <sys/nvpair.h> #include <sys/fs/sdev_plugin.h> #include <sys/sunddi.h> +#include <sys/fs/sdev_plugin.h> /* * sdev_nodes are the file-system specific part of the diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h index 1d7ddf9648..a5974f6d7d 100644 --- a/usr/src/uts/common/sys/mac.h +++ b/usr/src/uts/common/sys/mac.h @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2018 Joyent, Inc. * Copyright (c) 2015 Garrett D'Amore <garrett@damore.org> + * Copyright 2020 RackTop Systems, Inc. */ #ifndef _SYS_MAC_H @@ -88,6 +89,13 @@ typedef enum { } link_flowctrl_t; typedef enum { + LINK_FEC_NONE = 1 << 0, + LINK_FEC_AUTO = 1 << 1, + LINK_FEC_RS = 1 << 2, + LINK_FEC_BASE_R = 1 << 3 +} link_fec_t; + +typedef enum { LINK_TAGMODE_VLANONLY = 0, LINK_TAGMODE_NORMAL } link_tagmode_t; @@ -239,6 +247,8 @@ typedef enum { MAC_PROP_EN_25GFDX_CAP, MAC_PROP_ADV_50GFDX_CAP, MAC_PROP_EN_50GFDX_CAP, + MAC_PROP_EN_FEC_CAP, + MAC_PROP_ADV_FEC_CAP, MAC_PROP_PRIVATE = -1 } mac_prop_id_t; diff --git a/usr/src/uts/common/sys/mac_impl.h b/usr/src/uts/common/sys/mac_impl.h index 3c103c073a..21f2c10a8e 100644 --- a/usr/src/uts/common/sys/mac_impl.h +++ b/usr/src/uts/common/sys/mac_impl.h @@ -290,54 +290,6 @@ struct mac_group_s { #define GROUP_INTR_ENABLE_FUNC(g) (g)->mrg_info.mgi_intr.mi_enable #define GROUP_INTR_DISABLE_FUNC(g) (g)->mrg_info.mgi_intr.mi_disable -#define MAC_RING_TX(mhp, rh, mp, rest) { \ - mac_ring_handle_t mrh = rh; \ - mac_impl_t *mimpl = (mac_impl_t *)mhp; \ - /* \ - * Send packets through a selected tx ring, or through the \ - * default handler if there is no selected ring. \ - */ \ - if (mrh == NULL) \ - mrh = mimpl->mi_default_tx_ring; \ - if (mrh == NULL) { \ - rest = mimpl->mi_tx(mimpl->mi_driver, mp); \ - } else { \ - rest = mac_hwring_tx(mrh, mp); \ - } \ -} - -/* - * This is the final stop before reaching the underlying driver - * or aggregation, so this is where the bridging hook is implemented. - * Packets that are bridged will return through mac_bridge_tx(), with - * rh nulled out if the bridge chooses to send output on a different - * link due to forwarding. - */ -#define MAC_TX(mip, rh, mp, src_mcip) { \ - mac_ring_handle_t rhandle = (rh); \ - /* \ - * If there is a bound Hybrid I/O share, send packets through \ - * the default tx ring. (When there's a bound Hybrid I/O share, \ - * the tx rings of this client are mapped in the guest domain \ - * and not accessible from here.) \ - */ \ - _NOTE(CONSTANTCONDITION) \ - if ((src_mcip)->mci_state_flags & MCIS_SHARE_BOUND) \ - rhandle = (mip)->mi_default_tx_ring; \ - if (mip->mi_promisc_list != NULL) \ - mac_promisc_dispatch(mip, mp, src_mcip); \ - /* \ - * Grab the proper transmit pointer and handle. Special \ - * optimization: we can test mi_bridge_link itself atomically, \ - * and if that indicates no bridge send packets through tx ring.\ - */ \ - if (mip->mi_bridge_link == NULL) { \ - MAC_RING_TX(mip, rhandle, mp, mp); \ - } else { \ - mp = mac_bridge_tx(mip, rhandle, mp); \ - } \ -} - /* mci_tx_flag */ #define MCI_TX_QUIESCE 0x1 diff --git a/usr/src/uts/common/sys/mac_provider.h b/usr/src/uts/common/sys/mac_provider.h index 04c20d6aac..fc0866f2d1 100644 --- a/usr/src/uts/common/sys/mac_provider.h +++ b/usr/src/uts/common/sys/mac_provider.h @@ -22,6 +22,7 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Joyent, Inc. + * Copyright 2020 RackTop Systems, Inc. */ #ifndef _SYS_MAC_PROVIDER_H @@ -631,6 +632,8 @@ extern void mac_prop_info_set_default_uint32( mac_prop_info_handle_t, uint32_t); extern void mac_prop_info_set_default_link_flowctrl( mac_prop_info_handle_t, link_flowctrl_t); +extern void mac_prop_info_set_default_fec( + mac_prop_info_handle_t, link_fec_t); extern void mac_prop_info_set_range_uint32( mac_prop_info_handle_t, uint32_t, uint32_t); diff --git a/usr/src/uts/common/sys/smbios.h b/usr/src/uts/common/sys/smbios.h index 34281898e0..55048d549d 100644 --- a/usr/src/uts/common/sys/smbios.h +++ b/usr/src/uts/common/sys/smbios.h @@ -1315,11 +1315,12 @@ typedef struct smbios_memdevice { #define SMB_MTECH_NVDIMM_P 0x06 /* NVDIMM-P */ #define SMB_MTECH_INTCPM 0x07 /* Intel Optane DC Persistent Memory */ -#define SMB_MOMC_OTHER 0x01 /* other */ -#define SMB_MOMC_UNKNOWN 0x02 /* unknown */ -#define SMB_MOMC_VOLATILE 0x04 /* Volatile memory */ -#define SMB_MOMC_BYTE_PM 0x08 /* Byte-accessible persistent memory */ -#define SMB_MOMC_BLOCK_PM 0x10 /* Block-accessible persistent memory */ +#define SMB_MOMC_RESERVED 0x01 /* reserved */ +#define SMB_MOMC_OTHER 0x02 /* other */ +#define SMB_MOMC_UNKNOWN 0x04 /* unknown */ +#define SMB_MOMC_VOLATILE 0x08 /* Volatile memory */ +#define SMB_MOMC_BYTE_PM 0x10 /* Byte-accessible persistent memory */ +#define SMB_MOMC_BLOCK_PM 0x20 /* Block-accessible persistent memory */ /* * SMBIOS Memory Array Mapped Address. See DSP0134 Section 7.20 for more diff --git a/usr/src/uts/common/sys/sysconfig.h b/usr/src/uts/common/sys/sysconfig.h index d5b65ef78c..7e87d7a983 100644 --- a/usr/src/uts/common/sys/sysconfig.h +++ b/usr/src/uts/common/sys/sysconfig.h @@ -101,8 +101,9 @@ extern int mach_sysconfig(int); #define _CONFIG_SYMLOOP_MAX 46 /* maximum # of symlinks in pathname */ #define _CONFIG_EPHID_MAX 47 /* maximum ephemeral uid */ +#define _CONFIG_UADDR_MAX 48 /* maximum user address */ -#define _CONFIG_NPROC_NCPU 48 /* NCPU (sometimes > NPROC_MAX) */ +#define _CONFIG_NPROC_NCPU 49 /* NCPU (sometimes > NPROC_MAX) */ #ifdef __cplusplus } diff --git a/usr/src/uts/common/sys/systeminfo.h b/usr/src/uts/common/sys/systeminfo.h index a664a19b9e..951d799a70 100644 --- a/usr/src/uts/common/sys/systeminfo.h +++ b/usr/src/uts/common/sys/systeminfo.h @@ -21,6 +21,7 @@ /* * Copyright 2014 Garrett D'Amore <garrett@damore.org> * Copyright 2017 RackTop Systems. + * Copyright 2020 Oxide Computer Company * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. @@ -56,8 +57,8 @@ extern char platform[]; * 257 - 512 Unix International assigned numbers for `set' style commands * where the value is selected to be the value for the * corresponding `get' command plus 256. - * 513 - 768 Solaris specific `get' style commands. - * 769 - 1024 Solaris specific `set' style commands where the value is + * 513 - 768 illumos-defined `get' style commands. + * 769 - 1024 illumos-defined `set' style commands where the value is * selected to be the value for the corresponding `get' command * plus 256. * @@ -69,7 +70,7 @@ extern char platform[]; /* UI defined `get' commands (1-256) */ #define SI_SYSNAME 1 /* return name of operating system */ #define SI_HOSTNAME 2 /* return name of node */ -#define SI_RELEASE 3 /* return release of operating system */ +#define SI_RELEASE 3 /* return release of operating system */ #define SI_VERSION 4 /* return version field of utsname */ #define SI_MACHINE 5 /* return kind of machine */ #define SI_ARCHITECTURE 6 /* return instruction set arch */ @@ -81,7 +82,7 @@ extern char platform[]; #define SI_SET_HOSTNAME 258 /* set name of node */ #define SI_SET_SRPC_DOMAIN 265 /* set secure RPC domain */ -/* Solaris defined `get' commands (513-768) */ +/* illumos-defined `get' commands (513-768) */ #define SI_PLATFORM 513 /* return platform identifier */ #define SI_ISALIST 514 /* return supported isa list */ #define SI_DHCP_CACHE 515 /* return kernel-cached DHCPACK */ @@ -89,8 +90,9 @@ extern char platform[]; #define SI_ARCHITECTURE_64 517 /* basic 64-bit SI_ARCHITECTURE */ #define SI_ARCHITECTURE_K 518 /* kernel SI_ARCHITECTURE equivalent */ #define SI_ARCHITECTURE_NATIVE 519 /* SI_ARCHITECTURE of the caller */ +#define SI_ADDRESS_WIDTH 520 /* number of bits in native address */ -/* Solaris defined `set' commands (769-1024) (none currently assigned) */ +/* illumos-defined `set' commands (769-1024) (none currently assigned) */ #define HW_INVALID_HOSTID 0xFFFFFFFF /* an invalid hostid */ diff --git a/usr/src/uts/common/sys/unistd.h b/usr/src/uts/common/sys/unistd.h index f366e99f6a..591a3426f5 100644 --- a/usr/src/uts/common/sys/unistd.h +++ b/usr/src/uts/common/sys/unistd.h @@ -106,9 +106,9 @@ extern "C" { #define _SC_ARG_MAX 1 #define _SC_CHILD_MAX 2 #define _SC_CLK_TCK 3 -#define _SC_NGROUPS_MAX 4 +#define _SC_NGROUPS_MAX 4 #define _SC_OPEN_MAX 5 -#define _SC_JOB_CONTROL 6 +#define _SC_JOB_CONTROL 6 #define _SC_SAVED_IDS 7 #define _SC_VERSION 8 /* SVR4 names */ @@ -151,21 +151,21 @@ extern "C" { #define _SC_TIMER_MAX 44 /* XPG4 names */ #define _SC_2_C_BIND 45 -#define _SC_2_C_DEV 46 +#define _SC_2_C_DEV 46 #define _SC_2_C_VERSION 47 -#define _SC_2_FORT_DEV 48 -#define _SC_2_FORT_RUN 49 +#define _SC_2_FORT_DEV 48 +#define _SC_2_FORT_RUN 49 #define _SC_2_LOCALEDEF 50 -#define _SC_2_SW_DEV 51 +#define _SC_2_SW_DEV 51 #define _SC_2_UPE 52 #define _SC_2_VERSION 53 #define _SC_BC_BASE_MAX 54 -#define _SC_BC_DIM_MAX 55 +#define _SC_BC_DIM_MAX 55 #define _SC_BC_SCALE_MAX 56 #define _SC_BC_STRING_MAX 57 #define _SC_COLL_WEIGHTS_MAX 58 #define _SC_EXPR_NEST_MAX 59 -#define _SC_LINE_MAX 60 +#define _SC_LINE_MAX 60 #define _SC_RE_DUP_MAX 61 #define _SC_XOPEN_CRYPT 62 #define _SC_XOPEN_ENH_I18N 63 @@ -210,6 +210,7 @@ extern "C" { #define _SC_NPROCESSORS_MAX 516 /* maximum # of processors */ #define _SC_CPUID_MAX 517 /* maximum CPU id */ #define _SC_EPHID_MAX 518 /* maximum ephemeral id */ +#define _SC_UADDR_MAX 519 /* maximum user address */ /* * POSIX.1c (pthreads) names. These values are defined above @@ -351,7 +352,7 @@ extern "C" { #ifdef _XPG6 #define _POSIX_VERSION 200112L /* Supports IEEE Std 1003.1-2001 */ #else -#define _POSIX_VERSION 199506L /* Supports POSIX-1c DIS */ +#define _POSIX_VERSION 199506L /* Supports POSIX-1c DIS */ #endif #endif /* _POSIX_VERSION */ @@ -359,7 +360,7 @@ extern "C" { #ifdef _XPG6 #define _POSIX2_VERSION 200112L /* Supports IEEE Std 1003.1-2001 */ #else -#define _POSIX2_VERSION 199209L /* Supports ISO POSIX-2 DIS */ +#define _POSIX2_VERSION 199209L /* Supports ISO POSIX-2 DIS */ #endif #endif /* _POSIX2_VERSION */ @@ -395,14 +396,14 @@ extern "C" { #define _POSIX2_FORT_RUN 200112L /* Supports FORTRAN runtime */ #define _POSIX2_LOCALEDEF 200112L /* Supports creation of locales */ #define _POSIX2_SW_DEV 200112L /* Supports S/W Development Utility */ -#define _POSIX2_UPE 200112L /* Supports User Portability Utility */ +#define _POSIX2_UPE 200112L /* Supports User Portability Utility */ #else #define _POSIX2_C_BIND 1 /* Supports C Language Bindings */ #define _POSIX2_C_DEV 1 /* Supports C language dev utility */ #define _POSIX2_FORT_RUN 1 /* Supports FORTRAN runtime */ #define _POSIX2_LOCALEDEF 1 /* Supports creation of locales */ #define _POSIX2_SW_DEV 1 /* Supports S/W Development Utility */ -#define _POSIX2_UPE 1 /* Supports User Portability Utility */ +#define _POSIX2_UPE 1 /* Supports User Portability Utility */ #endif /* _XPG6 */ /* UNIX 03 names */ diff --git a/usr/src/uts/common/syscall/sysconfig.c b/usr/src/uts/common/syscall/sysconfig.c index e09f4e85a2..96535fdd08 100644 --- a/usr/src/uts/common/syscall/sysconfig.c +++ b/usr/src/uts/common/syscall/sysconfig.c @@ -47,6 +47,7 @@ #include <sys/timer.h> #include <sys/zone.h> #include <sys/vm_usage.h> +#include <vm/as.h> extern rctl_hndl_t rc_process_sigqueue; @@ -208,6 +209,9 @@ sysconfig(int which) case _CONFIG_EPHID_MAX: return (MAXEPHUID); + case _CONFIG_UADDR_MAX: + return ((long)(uintptr_t)curproc->p_as->a_userlimit); + case _CONFIG_SYMLOOP_MAX: return (MAXSYMLINKS); } diff --git a/usr/src/uts/common/syscall/systeminfo.c b/usr/src/uts/common/syscall/systeminfo.c index 21b5ac08ba..00d11e5aba 100644 --- a/usr/src/uts/common/syscall/systeminfo.c +++ b/usr/src/uts/common/syscall/systeminfo.c @@ -19,6 +19,7 @@ * CDDL HEADER END */ /* + * Copyright 2020 Oxide Computer Company * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -26,6 +27,7 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All rights reserved. */ + #include <sys/param.h> #include <sys/types.h> #include <sys/sysmacros.h> @@ -81,6 +83,9 @@ systeminfo(int command, char *buf, long count) kstr = utsname.machine; break; #ifdef _LP64 + case SI_ADDRESS_WIDTH: + kstr = "64"; + break; case SI_ARCHITECTURE_64: case SI_ARCHITECTURE_K: kstr = architecture; @@ -94,6 +99,9 @@ systeminfo(int command, char *buf, long count) architecture : architecture_32; break; #else + case SI_ADDRESS_WIDTH: + kstr = "32"; + break; case SI_ARCHITECTURE_K: case SI_ARCHITECTURE_32: case SI_ARCHITECTURE: diff --git a/usr/src/uts/common/vm/seg_spt.c b/usr/src/uts/common/vm/seg_spt.c index 1a9ef5223f..1308935159 100644 --- a/usr/src/uts/common/vm/seg_spt.c +++ b/usr/src/uts/common/vm/seg_spt.c @@ -63,7 +63,7 @@ size_t spt_used; * See spt_setminfree(). */ pgcnt_t segspt_minfree = 0; -size_t segspt_minfree_clamp = (1UL << 30); /* 1Gb in bytes */ +size_t segspt_minfree_clamp = (1UL << 30); /* 1GB in bytes */ static int segspt_create(struct seg **segpp, void *argsp); static int segspt_unmap(struct seg *seg, caddr_t raddr, size_t ssize); @@ -317,7 +317,7 @@ static int spt_anon_getpages(struct seg *seg, caddr_t addr, size_t len, * * The traditional default value of 5% of total memory is used, except on * systems where that quickly gets ridiculous: in that case we clamp at a rather - * arbitrary value of 1Gb. + * arbitrary value of 1GB. * * Note that since this is called lazily on the first sptcreate(), in theory, * this could represent a very small value if the system is heavily loaded diff --git a/usr/src/uts/i86pc/Makefile.files b/usr/src/uts/i86pc/Makefile.files index d9d6605a63..50b429dfe6 100644 --- a/usr/src/uts/i86pc/Makefile.files +++ b/usr/src/uts/i86pc/Makefile.files @@ -25,6 +25,7 @@ # Copyright (c) 2010, Intel Corporation. # Copyright 2019 Joyent, Inc. # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. +# Copyright 2019 Joyent, Inc. # # This Makefile defines file modules in the directory uts/i86pc # and its children. These are the source files which are i86pc diff --git a/usr/src/uts/i86pc/io/gfx_private/gfxp_bitmap.c b/usr/src/uts/i86pc/io/gfx_private/gfxp_bitmap.c index 2fed9f162c..1a11d7ff0f 100644 --- a/usr/src/uts/i86pc/io/gfx_private/gfxp_bitmap.c +++ b/usr/src/uts/i86pc/io/gfx_private/gfxp_bitmap.c @@ -450,10 +450,10 @@ bitmap_cons_clear(struct gfxp_fb_softc *softc, struct vis_consclear *ca) for (i = 0; i < console->fb.screen.y; i++) { if (softc->mode == KD_TEXT) { fb = console->fb.fb + i * pitch; - (void) memset(fb, ca->bg_color, pitch); + (void) memset(fb, data, pitch); } fb = console->fb.shadow_fb + i * pitch; - (void) memset(fb, ca->bg_color, pitch); + (void) memset(fb, data, pitch); } break; case 15: diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm.c b/usr/src/uts/i86pc/io/vmm/amd/svm.c index 292f2d071d..dabe94b7ea 100644 --- a/usr/src/uts/i86pc/io/vmm/amd/svm.c +++ b/usr/src/uts/i86pc/io/vmm/amd/svm.c @@ -28,6 +28,7 @@ /* * Copyright 2018 Joyent, Inc. + * Copyright 2020 Oxide Computer Company */ #include <sys/cdefs.h> @@ -1517,11 +1518,8 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit) #if __GNUC__ > 7 #pragma GCC diagnostic ignored "-Waddress-of-packed-member" #endif - handled = x86_emulate_cpuid(svm_sc->vm, vcpu, - (uint32_t *)&state->rax, - (uint32_t *)&ctx->sctx_rbx, - (uint32_t *)&ctx->sctx_rcx, - (uint32_t *)&ctx->sctx_rdx); + handled = x86_emulate_cpuid(svm_sc->vm, vcpu, &state->rax, + &ctx->sctx_rbx, &ctx->sctx_rcx, &ctx->sctx_rdx); #pragma GCC diagnostic pop break; case VMCB_EXIT_HLT: diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm_support.s b/usr/src/uts/i86pc/io/vmm/amd/svm_support.s index fad994b09c..27ef1a04af 100644 --- a/usr/src/uts/i86pc/io/vmm/amd/svm_support.s +++ b/usr/src/uts/i86pc/io/vmm/amd/svm_support.s @@ -36,18 +36,6 @@ /* Porting note: This is named 'svm_support.S' upstream. */ -#if defined(lint) - -struct svm_regctx; -struct cpu; - -/*ARGSUSED*/ -void -svm_launch(uint64_t pa, struct svm_regctx *gctx, struct cpu *cpu) -{} - -#else /* lint */ - #define VMLOAD .byte 0x0f, 0x01, 0xda #define VMRUN .byte 0x0f, 0x01, 0xd8 #define VMSAVE .byte 0x0f, 0x01, 0xdb @@ -160,5 +148,3 @@ ENTRY_NP(svm_launch) popq %rbp ret SET_SIZE(svm_launch) - -#endif /* lint */ diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmx.c b/usr/src/uts/i86pc/io/vmm/intel/vmx.c index 83e137973e..754795c2e9 100644 --- a/usr/src/uts/i86pc/io/vmm/intel/vmx.c +++ b/usr/src/uts/i86pc/io/vmm/intel/vmx.c @@ -40,6 +40,7 @@ * * Copyright 2015 Pluribus Networks Inc. * Copyright 2018 Joyent, Inc. + * Copyright 2020 Oxide Computer Company */ #include <sys/cdefs.h> @@ -1242,11 +1243,9 @@ vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx) int handled; #endif - handled = x86_emulate_cpuid(vm, vcpu, - (uint32_t*)(&vmxctx->guest_rax), - (uint32_t*)(&vmxctx->guest_rbx), - (uint32_t*)(&vmxctx->guest_rcx), - (uint32_t*)(&vmxctx->guest_rdx)); + handled = x86_emulate_cpuid(vm, vcpu, (uint64_t *)&vmxctx->guest_rax, + (uint64_t *)&vmxctx->guest_rbx, (uint64_t *)&vmxctx->guest_rcx, + (uint64_t *)&vmxctx->guest_rdx); return (handled); } diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s b/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s index 0130f88dd6..f719e31e30 100644 --- a/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s +++ b/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s @@ -45,31 +45,6 @@ /* Porting note: This is named 'vmx_support.S' upstream. */ - - -#if defined(lint) - -struct vmxctx; -struct vmx; - -/*ARGSUSED*/ -void -vmx_launch(struct vmxctx *ctx) -{} - -void -vmx_exit_guest() -{} - -/*ARGSUSED*/ -int -vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched) -{ - return (0); -} - -#else /* lint */ - #include "vmx_assym.h" #include "vmcs.h" @@ -155,7 +130,7 @@ vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched) #define VMXSTKSIZE VMXSTK_FP /* - * vmx_enter_guest(struct vmxctx *vmxctx, int launched) + * vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched) * Interrupts must be disabled on entry. */ ENTRY_NP(vmx_enter_guest) @@ -380,5 +355,3 @@ ENTRY_NP(vmx_call_isr) popq %rbp ret SET_SIZE(vmx_call_isr) - -#endif /* lint */ diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h b/usr/src/uts/i86pc/io/vmm/vm/vm_page.h index 65f3319c97..deb25a6cc0 100644 --- a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h +++ b/usr/src/uts/i86pc/io/vmm/vm/vm_page.h @@ -21,7 +21,7 @@ #define PQ_ACTIVE 1 -void vm_page_unwire(vm_page_t , uint8_t); +void vm_page_unwire(vm_page_t, uint8_t); #define VM_PAGE_TO_PHYS(page) (mmu_ptob((uintptr_t)((page)->vmp_pfn))) diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c index c8d5aa24e9..2401774ab7 100644 --- a/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c +++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c @@ -37,6 +37,7 @@ * * Copyright 2014 Pluribus Networks Inc. * Copyright 2019 Joyent, Inc. + * Copyright 2020 Oxide Computer Company */ #include <sys/types.h> @@ -320,8 +321,13 @@ vmm_glue_callout_handler(void *arg) { struct callout *c = arg; - c->c_flags &= ~CALLOUT_PENDING; - if (c->c_flags & CALLOUT_ACTIVE) { + if (callout_active(c)) { + /* + * Record the handler fire time so that callout_pending() is + * able to detect if the callout becomes rescheduled during the + * course of the handler. + */ + c->c_fired = gethrtime(); (c->c_func)(c->c_arg); } } @@ -337,17 +343,9 @@ vmm_glue_callout_init(struct callout *c, int mpsafe) hdlr.cyh_arg = c; when.cyt_when = CY_INFINITY; when.cyt_interval = CY_INFINITY; + bzero(c, sizeof (*c)); mutex_enter(&cpu_lock); -#if 0 - /* - * XXXJOY: according to the freebsd sources, callouts do not begin - * their life in the ACTIVE state. - */ - c->c_flags |= CALLOUT_ACTIVE; -#else - bzero(c, sizeof (*c)); -#endif c->c_cyc_id = cyclic_add(&hdlr, &when); mutex_exit(&cpu_lock); } @@ -367,15 +365,14 @@ vmm_glue_callout_reset_sbt(struct callout *c, sbintime_t sbt, sbintime_t pr, ASSERT(c->c_cyc_id != CYCLIC_NONE); + if ((flags & C_ABSOLUTE) == 0) { + target += gethrtime(); + } + c->c_func = func; c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - - if (flags & C_ABSOLUTE) { - cyclic_reprogram(c->c_cyc_id, target); - } else { - cyclic_reprogram(c->c_cyc_id, target + gethrtime()); - } + c->c_target = target; + cyclic_reprogram(c->c_cyc_id, target); return (0); } @@ -384,8 +381,9 @@ int vmm_glue_callout_stop(struct callout *c) { ASSERT(c->c_cyc_id != CYCLIC_NONE); + + c->c_target = 0; cyclic_reprogram(c->c_cyc_id, CY_INFINITY); - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); return (0); } @@ -394,10 +392,11 @@ int vmm_glue_callout_drain(struct callout *c) { ASSERT(c->c_cyc_id != CYCLIC_NONE); + + c->c_target = 0; mutex_enter(&cpu_lock); cyclic_remove(c->c_cyc_id); c->c_cyc_id = CYCLIC_NONE; - c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); mutex_exit(&cpu_lock); return (0); diff --git a/usr/src/uts/i86pc/io/vmm/x86.c b/usr/src/uts/i86pc/io/vmm/x86.c index d74f866013..6213173587 100644 --- a/usr/src/uts/i86pc/io/vmm/x86.c +++ b/usr/src/uts/i86pc/io/vmm/x86.c @@ -39,6 +39,7 @@ * * Copyright 2014 Pluribus Networks Inc. * Copyright 2018 Joyent, Inc. + * Copyright 2020 Oxide Computer Company */ #include <sys/cdefs.h> @@ -90,34 +91,39 @@ log2(u_int x) } int -x86_emulate_cpuid(struct vm *vm, int vcpu_id, - uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) +x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx, + uint64_t *rcx, uint64_t *rdx) { const struct xsave_limits *limits; uint64_t cr4; int error, enable_invpcid, level, width = 0, x2apic_id = 0; - unsigned int func, regs[4], logical_cpus = 0; + unsigned int func, regs[4], logical_cpus = 0, param; enum x2apic_state x2apic_state; uint16_t cores, maxcpus, sockets, threads; - VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx); + /* + * The function of CPUID is controlled through the provided value of + * %eax (and secondarily %ecx, for certain leaf data). + */ + func = (uint32_t)*rax; + param = (uint32_t)*rcx; + + VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", func, param); /* * Requests for invalid CPUID levels should map to the highest * available level instead. */ - if (cpu_exthigh != 0 && *eax >= 0x80000000) { - if (*eax > cpu_exthigh) - *eax = cpu_exthigh; - } else if (*eax >= 0x40000000) { - if (*eax > CPUID_VM_HIGH) - *eax = CPUID_VM_HIGH; - } else if (*eax > cpu_high) { - *eax = cpu_high; + if (cpu_exthigh != 0 && func >= 0x80000000) { + if (func > cpu_exthigh) + func = cpu_exthigh; + } else if (func >= 0x40000000) { + if (func > CPUID_VM_HIGH) + func = CPUID_VM_HIGH; + } else if (func > cpu_high) { + func = cpu_high; } - func = *eax; - /* * In general the approach used for CPU topology is to * advertise a flat topology where all CPUs are packages with @@ -135,10 +141,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, case CPUID_8000_0003: case CPUID_8000_0004: case CPUID_8000_0006: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); break; case CPUID_8000_0008: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); if (vmm_is_amd()) { /* * As on Intel (0000_0007:0, EDX), mask out @@ -169,7 +175,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; case CPUID_8000_0001: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); /* * Hide SVM from guest. @@ -263,7 +269,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, */ vm_get_topology(vm, &sockets, &cores, &threads, &maxcpus); - switch (*ecx) { + switch (param) { case 0: logical_cpus = threads; level = 1; @@ -408,7 +414,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; case CPUID_0000_0004: - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); if (regs[0] || regs[1] || regs[2] || regs[3]) { vm_get_topology(vm, &sockets, &cores, &threads, @@ -437,8 +443,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, regs[3] = 0; /* leaf 0 */ - if (*ecx == 0) { - cpuid_count(*eax, *ecx, regs); + if (param == 0) { + cpuid_count(func, param, regs); /* Only leaf 0 is supported */ regs[0] = 0; @@ -491,21 +497,21 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, if (vmm_is_intel()) { vm_get_topology(vm, &sockets, &cores, &threads, &maxcpus); - if (*ecx == 0) { + if (param == 0) { logical_cpus = threads; width = log2(logical_cpus); level = CPUID_TYPE_SMT; x2apic_id = vcpu_id; } - if (*ecx == 1) { + if (param == 1) { logical_cpus = threads * cores; width = log2(logical_cpus); level = CPUID_TYPE_CORE; x2apic_id = vcpu_id; } - if (!cpuid_leaf_b || *ecx >= 2) { + if (!cpuid_leaf_b || param >= 2) { width = 0; logical_cpus = 0; level = 0; @@ -514,7 +520,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, regs[0] = width & 0x1f; regs[1] = logical_cpus & 0xffff; - regs[2] = (level << 8) | (*ecx & 0xff); + regs[2] = (level << 8) | (param & 0xff); regs[3] = x2apic_id; } else { regs[0] = 0; @@ -534,8 +540,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, break; } - cpuid_count(*eax, *ecx, regs); - switch (*ecx) { + cpuid_count(func, param, regs); + switch (param) { case 0: /* * Only permit the guest to use bits @@ -565,7 +571,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, * pass through as-is, otherwise return * all zeroes. */ - if (!(limits->xcr0_allowed & (1ul << *ecx))) { + if (!(limits->xcr0_allowed & (1ul << param))) { regs[0] = 0; regs[1] = 0; regs[2] = 0; @@ -590,14 +596,17 @@ default_leaf: * how many unhandled leaf values have been seen. */ atomic_add_long(&bhyve_xcpuids, 1); - cpuid_count(*eax, *ecx, regs); + cpuid_count(func, param, regs); break; } - *eax = regs[0]; - *ebx = regs[1]; - *ecx = regs[2]; - *edx = regs[3]; + /* + * CPUID clears the upper 32-bits of the long-mode registers. + */ + *rax = regs[0]; + *rbx = regs[1]; + *rcx = regs[2]; + *rdx = regs[3]; return (1); } diff --git a/usr/src/uts/i86pc/io/vmm/x86.h b/usr/src/uts/i86pc/io/vmm/x86.h index 0d70c04fd8..cb8e12fcd2 100644 --- a/usr/src/uts/i86pc/io/vmm/x86.h +++ b/usr/src/uts/i86pc/io/vmm/x86.h @@ -63,8 +63,8 @@ */ #define CPUID_0000_0001_FEAT0_VMX (1<<5) -int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx, - uint32_t *ecx, uint32_t *edx); +int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx, + uint64_t *rcx, uint64_t *rdx); enum vm_cpuid_capability { VCC_NONE, diff --git a/usr/src/uts/i86pc/ppt/Makefile b/usr/src/uts/i86pc/ppt/Makefile index f231dfddf6..7c41368efd 100644 --- a/usr/src/uts/i86pc/ppt/Makefile +++ b/usr/src/uts/i86pc/ppt/Makefile @@ -24,7 +24,6 @@ UTSBASE = ../.. # MODULE = ppt OBJECTS = $(PPT_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PPT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/i86pc/io/vmm/io MAPFILE = $(UTSBASE)/i86pc/io/vmm/io/ppt.mapfile @@ -38,7 +37,6 @@ include $(UTSBASE)/i86pc/Makefile.i86pc # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # @@ -72,12 +70,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/i86pc/viona/Makefile b/usr/src/uts/i86pc/viona/Makefile index dac59c9a45..b7f0fd6f53 100644 --- a/usr/src/uts/i86pc/viona/Makefile +++ b/usr/src/uts/i86pc/viona/Makefile @@ -24,7 +24,6 @@ UTSBASE = ../.. # MODULE = viona OBJECTS = $(VIONA_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VIONA_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/i86pc/io/viona MAPFILE = $(UTSBASE)/i86pc/io/viona/viona.mapfile @@ -38,17 +37,11 @@ include $(UTSBASE)/i86pc/Makefile.i86pc # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # Overrides # -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_FUNC_ARG_UNUSED -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2 -LINTTAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 # needs work SMOFF += all_func_returns @@ -74,12 +67,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/i86pc/vm/seg_vmm.c b/usr/src/uts/i86pc/vm/seg_vmm.c index faebf9ac36..beb5e81d53 100644 --- a/usr/src/uts/i86pc/vm/seg_vmm.c +++ b/usr/src/uts/i86pc/vm/seg_vmm.c @@ -14,12 +14,15 @@ */ /* - * VM - Virtual-Machine-Memory segment + * segvmm - 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(). */ @@ -93,7 +96,7 @@ static struct seg_ops segvmm_ops = { /* - * Create a kernel/user-mapped segment. + * Create a kernel/user-mapped segment. ->kaddr is the segkvmm mapping. */ int segvmm_create(struct seg **segpp, void *argsp) diff --git a/usr/src/uts/i86pc/vmm/Makefile b/usr/src/uts/i86pc/vmm/Makefile index 018a05ab92..c55abf6090 100644 --- a/usr/src/uts/i86pc/vmm/Makefile +++ b/usr/src/uts/i86pc/vmm/Makefile @@ -24,7 +24,6 @@ UTSBASE = ../.. # MODULE = vmm OBJECTS = $(VMM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VMM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/i86pc/io/vmm MAPFILE = $(UTSBASE)/i86pc/io/vmm/vmm.mapfile @@ -38,42 +37,11 @@ include $(UTSBASE)/i86pc/Makefile.i86pc # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # Overrides and additions # -LINTTAGS += -erroff=E_EMPTY_DECLARATION -LINTTAGS += -erroff=E_OPERANDS_INCOMPATIBLE_TYPES -LINTTAGS += -erroff=E_VOID_CANT_RETURN_VALUE -LINTTAGS += -erroff=E_YACC_ERROR -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2 -LINTTAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 -LINTTAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 -LINTTAGS += -erroff=E_FUNC_ARG_UNUSED -LINTTAGS += -erroff=E_FUNC_SET_NOT_USED -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_CONSTANT_CONDITION -LINTTAGS += -erroff=E_PTR_TO_VOID_IN_ARITHMETIC -LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN -LINTTAGS += -erroff=E_NOP_ELSE_STMT -LINTTAGS += -erroff=E_FUNC_NO_RET_VAL -LINTTAGS += -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE -LINTTAGS += -erroff=E_VAR_USED_BEFORE_SET -LINTTAGS += -erroff=E_INTEGER_OVERFLOW_DETECTED -LINTTAGS += -erroff=E_STMT_NOT_REACHED -LINTTAGS += -erroff=E_FUNC_NO_RET_VAL -LINTTAGS += -erroff=E_USELESS_DECLARATION -LINTTAGS += -erroff=E_EXPR_NULL_EFFECT -LINTTAGS += -erroff=E_CASE_FALLTHRU -LINTTAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -LINTTAGS += -erroff=E_ASM_IMPOSSIBLE_CONSTRAINT -LINTTAGS += -erroff=E_ASM_UNUSED_PARAM -LINTTAGS += -erroff=E_NOP_IF_STMT -LINTTAGS += -erroff=E_ZERO_OR_NEGATIVE_SUBSCRIPT CERRWARN += -_gcc=-Wno-empty-body @@ -86,11 +54,6 @@ $(OBJS_DIR)/vmm_sol_dev.o := SMOFF += signed_integer_overflow_check # a can't happen: vmx_setcap() warn: variable dereferenced before check 'pptr' $(OBJS_DIR)/vmx.o := SMOFF += deref_check -# These sources only compile with gcc. Workaround a confluence of cruft -# regarding dmake and shadow compilation by neutering the sun compiler. -#amd64_CC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc -#CFLAGS += -_cc=-xdryrun - ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) PRE_INC_PATH = -I$(COMPAT)/freebsd -I$(COMPAT)/freebsd/amd64 \ @@ -109,8 +72,8 @@ $(OBJS_DIR)/svm.o := CERRWARN += -_gcc=-Wno-pointer-sign -_gcc=-Wno-type-limits $(OBJS_DIR)/vmx.o := CERRWARN += -_gcc=-Wno-unused-variable $(OBJS_DIR)/iommu.o := CERRWARN += -_gcc=-Wno-unused-variable -LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev -z type=kmod -LDFLAGS += -M $(MAPFILE) +LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev +LDFLAGS += -z type=kmod -M $(MAPFILE) OFFSETS_VMX = $(CONF_SRCDIR)/intel/offsets.in OFFSETS_SVM = $(CONF_SRCDIR)/amd/offsets.in @@ -133,12 +96,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/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/dev/Makefile b/usr/src/uts/intel/dev/Makefile index 6cc3fda6cd..cc100922a0 100644 --- a/usr/src/uts/intel/dev/Makefile +++ b/usr/src/uts/intel/dev/Makefile @@ -71,6 +71,7 @@ LINTTAGS += -erroff=E_STATIC_UNUSED CERRWARN += -_gcc=-Wno-parentheses CERRWARN += -_gcc=-Wno-unused-label CERRWARN += $(CNOWARN_UNINIT) +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/intel/gld/Makefile b/usr/src/uts/intel/gld/Makefile index 3b88451670..7a5d77368e 100644 --- a/usr/src/uts/intel/gld/Makefile +++ b/usr/src/uts/intel/gld/Makefile @@ -26,7 +26,7 @@ # # -# This makefile drives the production of the gld driver +# This makefile drives the production of the gld driver # kernel module. # # intel architecture dependent @@ -57,6 +57,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +LDFLAGS += -dy -Nmisc/mac + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/intel/ia32/ml/modstubs.s b/usr/src/uts/intel/ia32/ml/modstubs.s index 59598c47e0..03fe983372 100644 --- a/usr/src/uts/intel/ia32/ml/modstubs.s +++ b/usr/src/uts/intel/ia32/ml/modstubs.s @@ -1311,8 +1311,9 @@ fcnname/**/_info: \ END_MODULE(ppt); #endif -/ this is just a marker for the area of text that contains stubs - +/* + * this is just a marker for the area of text that contains stubs + */ ENTRY_NP(stubs_end) nop diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.c b/usr/src/uts/sfmmu/vm/hat_sfmmu.c index 3a290b1fd7..1f0ef11096 100644 --- a/usr/src/uts/sfmmu/vm/hat_sfmmu.c +++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.c @@ -4411,10 +4411,11 @@ rehash: if (flags & HAC_PAGELOCK) { if (!page_trylock(pp, SE_SHARED)) { /* - * Somebody is holding SE_EXCL lock. Might - * even be hat_page_relocate(). Drop all - * our locks, lookup the page in &kvp, and - * retry. If it doesn't exist in &kvp and &zvp, + * Somebody is holding SE_EXCL lock. Might even be + * hat_page_relocate(). + * Drop all our locks, lookup the page in &kvp, and + * retry. + * If it doesn't exist in &kvp and &kvps[KV_ZVP], * then we must be dealing with a kernel mapped * page which doesn't actually belong to * segkmem so we punt. @@ -4423,10 +4424,10 @@ rehash: SFMMU_HASH_UNLOCK(hmebp); pp = page_lookup(&kvp, (u_offset_t)saddr, SE_SHARED); - /* check zvp before giving up */ + /* check &kvps[KV_ZVP] before giving up */ if (pp == NULL) - pp = page_lookup(&zvp, (u_offset_t)saddr, - SE_SHARED); + pp = page_lookup(&kvps[KV_ZVP], + (u_offset_t)saddr, SE_SHARED); /* Okay, we didn't find it, give up */ if (pp == NULL) { @@ -4590,10 +4591,11 @@ rehash: if (flags & HAC_PAGELOCK) { if (!page_trylock(pp, SE_SHARED)) { /* - * Somebody is holding SE_EXCL lock. Might - * even be hat_page_relocate(). Drop all - * our locks, lookup the page in &kvp, and - * retry. If it doesn't exist in &kvp and &zvp, + * Somebody is holding SE_EXCL lock. Might even be + * hat_page_relocate(). + * Drop all our locks, lookup the page in &kvp, and + * retry. + * If it doesn't exist in &kvp and &kvps[KV_ZVP], * then we must be dealing with a kernel mapped * page which doesn't actually belong to * segkmem so we punt. @@ -4601,10 +4603,11 @@ rehash: sfmmu_mlist_exit(pml); SFMMU_HASH_UNLOCK(hmebp); pp = page_lookup(&kvp, (u_offset_t)saddr, SE_SHARED); - /* check zvp before giving up */ + + /* check &kvps[KV_ZVP] before giving up */ if (pp == NULL) - pp = page_lookup(&zvp, (u_offset_t)saddr, - SE_SHARED); + pp = page_lookup(&kvps[KV_ZVP], + (u_offset_t)saddr, SE_SHARED); if (pp == NULL) { ASSERT(cookie == NULL); 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/gld/Makefile b/usr/src/uts/sparc/gld/Makefile index d56548e81b..ad3519c146 100644 --- a/usr/src/uts/sparc/gld/Makefile +++ b/usr/src/uts/sparc/gld/Makefile @@ -25,7 +25,7 @@ # Use is subject to license terms. # # -# This makefile drives the production of the gld driver +# This makefile drives the production of the gld driver # kernel module. # # sparc architecture dependent @@ -56,6 +56,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +LDFLAGS += -dy -Nmisc/mac + # # Overrides. # diff --git a/usr/src/uts/sparc/io/pciex/pcie_sparc.c b/usr/src/uts/sparc/io/pciex/pcie_sparc.c index de5def9f4a..1634078cbc 100644 --- a/usr/src/uts/sparc/io/pciex/pcie_sparc.c +++ b/usr/src/uts/sparc/io/pciex/pcie_sparc.c @@ -67,7 +67,7 @@ int pcie_plat_pwr_setup(dev_info_t *dip) { if (ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP, - "pm-want-child-notification?", NULL, NULL) != DDI_PROP_SUCCESS) { + "pm-want-child-notification?", NULL, 0) != DDI_PROP_SUCCESS) { PCIE_DBG("%s(%d): can't create pm-want-child-notification \n", ddi_driver_name(dip), ddi_get_instance(dip)); return (DDI_FAILURE); diff --git a/usr/src/uts/sparc/os/cpr_sparc.c b/usr/src/uts/sparc/os/cpr_sparc.c index 3dd44bb9e6..2b409b952a 100644 --- a/usr/src/uts/sparc/os/cpr_sparc.c +++ b/usr/src/uts/sparc/os/cpr_sparc.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * cpr functions for supported sparc platforms */ @@ -363,8 +361,8 @@ cpr_abbreviate_devpath(char *in_path, char *out_path) *out_path = '\0'; while ((cmpt = cpr_next_component(&position)) != NULL) { - pnode_t long_match = NULL; - pnode_t short_match = NULL; + pnode_t long_match = 0; + pnode_t short_match = 0; int short_hits = 0; char *name; char *prefix = cpr_get_prefix(cmpt); diff --git a/usr/src/uts/sun/io/dada/targets/dad.c b/usr/src/uts/sun/io/dada/targets/dad.c index b3be5f3ea5..c9e8b393b6 100644 --- a/usr/src/uts/sun/io/dada/targets/dad.c +++ b/usr/src/uts/sun/io/dada/targets/dad.c @@ -315,7 +315,7 @@ static struct cb_ops dcd_cb_ops = { 0, /* streamtab */ D_64BIT | D_MP | D_NEW, /* Driver compatibility flag */ CB_REV, /* cb_rev */ - dcdaread, /* async I/O read entry point */ + dcdaread, /* async I/O read entry point */ dcdawrite /* async I/O write entry point */ }; @@ -2255,7 +2255,7 @@ make_dcd_cmd(struct dcd_disk *un, struct buf *bp, int (*func)()) &p_lblksrt, NULL, NULL, - 0) != NULL) { + 0) != 0) { lblocks = 0; p_lblksrt = 0; } @@ -3041,7 +3041,7 @@ dcddump(dev_t dev, caddr_t addr, daddr_t blkno, int nblk) /* ARGSUSED3 */ static int dcdioctl(dev_t dev, int cmd, intptr_t arg, int flag, - cred_t *cred_p, int *rval_p) + cred_t *cred_p, int *rval_p) { auto int32_t data[512 / (sizeof (int32_t))]; struct dk_cinfo *info; @@ -3882,7 +3882,7 @@ static int dcd_write_deviceid(struct dcd_disk *un) { - int status; + int status; diskaddr_t blk; struct udcd_cmd ucmd; struct dcd_cmd cdb; @@ -4177,7 +4177,7 @@ dcd_validate_model_serial(char *str, int *retlen, int totallen) #ifndef lint void clean_print(dev_info_t *dev, char *label, uint_t level, - char *title, char *data, int len) + char *title, char *data, int len) { int i; char buf[256]; diff --git a/usr/src/uts/sun/io/sbusmem.c b/usr/src/uts/sun/io/sbusmem.c index c747c93dfc..1f0934707c 100644 --- a/usr/src/uts/sun/io/sbusmem.c +++ b/usr/src/uts/sun/io/sbusmem.c @@ -111,10 +111,6 @@ static struct modlinkage modlinkage = { static int sbmem_rw(dev_t, struct uio *, enum uio_rw, cred_t *); -#if !defined(lint) -static char sbusmem_initmsg[] = "sbusmem _init: sbusmem.c\t1.28\t08/19/2008\n"; -#endif - int _init(void) { @@ -206,7 +202,7 @@ sbmem_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, ident, S_IFCHR, instance, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { kmem_free(ident, ilen); ddi_remove_minor_node(devi, NULL); ddi_soft_state_free(sbusmem_state_head, instance); @@ -279,15 +275,12 @@ sbmem_close(dev_t dev, int flag, int otyp, struct cred *cred) } static int -sbmem_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) +sbmem_info(dev_info_t *dip __unused, ddi_info_cmd_t infocmd, void *arg, + void **result) { int instance, error = DDI_FAILURE; struct sbusmem_unit *un; -#if defined(lint) || defined(__lint) - dip = dip; -#endif /* lint || __lint */ - switch (infocmd) { case DDI_INFO_DEVT2DEVINFO: instance = getminor((dev_t)arg); @@ -328,7 +321,7 @@ sbmem_write(dev_t dev, struct uio *uio, cred_t *cred) } static int -sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) +sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred __unused) { uint_t c; struct iovec *iov; @@ -338,10 +331,6 @@ sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) dev_info_t *dip; caddr_t reg; -#if defined(lint) || defined(__lint) - cred = cred; -#endif /* lint || __lint */ - instance = getminor(dev); if ((un = ddi_get_soft_state(sbusmem_state_head, instance)) == NULL) { return (ENXIO); @@ -383,15 +372,11 @@ sbmem_rw(dev_t dev, struct uio *uio, enum uio_rw rw, cred_t *cred) static int sbmem_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, - size_t *maplen, uint_t model) + size_t *maplen, uint_t model __unused) { struct sbusmem_unit *un; int instance, error; -#if defined(lint) || defined(__lint) - model = model; -#endif /* lint || __lint */ - instance = getminor(dev); if ((un = ddi_get_soft_state(sbusmem_state_head, instance)) == NULL) { return (ENXIO); diff --git a/usr/src/uts/sun4/io/efcode/fcode.c b/usr/src/uts/sun4/io/efcode/fcode.c index 8610697835..eebe57bf7f 100644 --- a/usr/src/uts/sun4/io/efcode/fcode.c +++ b/usr/src/uts/sun4/io/efcode/fcode.c @@ -206,7 +206,7 @@ fc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) fc_max_opens * sizeof (struct fc_state), KM_SLEEP); if (ddi_create_minor_node(dip, "fcode", S_IFCHR, - 0, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 0, DDI_PSEUDO, 0) == DDI_FAILURE) { kmem_free(fc_states, fc_max_opens * sizeof (struct fc_state)); error = DDI_FAILURE; diff --git a/usr/src/uts/sun4/io/fpc/fpc-kstats.c b/usr/src/uts/sun4/io/fpc/fpc-kstats.c index 38a390031b..89949e9927 100644 --- a/usr/src/uts/sun4/io/fpc/fpc-kstats.c +++ b/usr/src/uts/sun4/io/fpc/fpc-kstats.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/sunddi.h> #include <sys/sunndi.h> @@ -281,7 +279,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) (void) strncpy(dev_name, "tlu", sizeof (dev_name)); num_events = sizeof (fire_tlu_events) / sizeof (fi_kev_mask_t); num_events2 = sizeof (fire_tlu2_events) / - sizeof (fi_kev_mask_t); + sizeof (fi_kev_mask_t); fire_events = fire_tlu_events; fire_events2 = fire_tlu2_events; num_cntrs = NUM_TLU_COUNTERS; @@ -297,8 +295,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) } for (i = 0; i < num_inst; i++) { - ksinfop = (fi_ksinfo_t *)kmem_zalloc(sizeof (fi_ksinfo_t), - KM_SLEEP); + ksinfop = kmem_zalloc(sizeof (fi_ksinfo_t), KM_SLEEP); ksinfop->pic_num_events = num_events; ksinfop->pic_reg_group = reg_group; @@ -361,7 +358,7 @@ fpc_dev_kstat(fire_perfcnt_t reg_group, uint8_t num_inst) /* create counter kstats */ ksinfop->cntr_ksp = fpc_create_cntr_kstat(dev_name, i, - fpc_cntr_kstat_update, ksinfop, num_cntrs); + fpc_cntr_kstat_update, ksinfop, num_cntrs); if (ksinfop->cntr_ksp == NULL) goto err; @@ -384,7 +381,7 @@ fpc_create_name_kstat(char *name, fi_ksinfo_t *pp, fi_kev_mask_t *ev, for (i = base; i < (base + num_cntrs); i++) { pp->pic_name_ksp[i] = fpc_create_picN_kstat(name, i, - pp->pic_sel_shift[i], pp->pic_num_events, ev); + pp->pic_sel_shift[i], pp->pic_num_events, ev); if (pp->pic_name_ksp[i] == NULL) return (FAILURE); @@ -408,7 +405,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, (void) snprintf(pic_name, sizeof (pic_name), "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); return (NULL); @@ -423,7 +420,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, */ for (event = 0; event < num_ev - 1; event++) { pic_named_data[event].value.ui64 = - (ev_array[event].pcr_mask << pic_sel_shift); + (ev_array[event].pcr_mask << pic_sel_shift); kstat_named_init(&pic_named_data[event], ev_array[event].event_name, KSTAT_DATA_UINT64); @@ -433,7 +430,7 @@ fpc_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, int num_ev, * add the clear_pic entry */ pic_named_data[event].value.ui64 = - (uint64_t)~(ev_array[event].pcr_mask << pic_sel_shift); + (uint64_t)~(ev_array[event].pcr_mask << pic_sel_shift); kstat_named_init(&pic_named_data[event], ev_array[event].event_name, KSTAT_DATA_UINT64); @@ -471,7 +468,7 @@ fpc_create_cntr_kstat(char *name, int instance, int (*update)(kstat_t *, int), if ((counters_ksp = kstat_create(name, instance, "counters", "bus", KSTAT_TYPE_NAMED, num_pics + 1, KSTAT_FLAG_WRITABLE)) == NULL) { cmn_err(CE_WARN, "kstat_create for %s%d failed", - name, instance); + name, instance); return (NULL); } diff --git a/usr/src/uts/sun4/io/trapstat.c b/usr/src/uts/sun4/io/trapstat.c index 4f99221bc0..75e5dab413 100644 --- a/usr/src/uts/sun4/io/trapstat.c +++ b/usr/src/uts/sun4/io/trapstat.c @@ -151,14 +151,14 @@ * Globals. (The complete mapping can be found in the UltraSPARC I&II User's * Manual.) * - * Note that the sets of globals are per trap _type_, not per trap _level_. + * Note that the sets of globals are per trap _type_, not per trap _level_. * Thus, when executing a TL>0 trap handler, one may not have registers * available (for example, both trap-instruction traps and spill traps execute * on the alternate globals; if a trap-instruction trap induces a window spill, * the window spill handler has no available globals). For trapstat, this is * problematic: a register is required to transfer control from one arbitrary * location (in the interposing trap table) to another (in the actual trap - * table). + * table). * * We solve this problem by exploiting the trap table's location at the bottom * of valid kernel memory (i.e. at KERNELBASE). We locate the interposing trap @@ -173,7 +173,7 @@ * Actual trap table: * * +--------------------------------+- 2ff - * | | . + * | | . * | Non-trap instruction, TL>0 | . <-----------------------+ * | | . <-----------------------|-+ * |- - - - - - - - - - - - - - - - +- 200 <-----------------------|-|-+ @@ -323,11 +323,11 @@ * * To accurately determine the amount of time spent executing the TLB miss * handler, one must get a timestamp on trap entry and trap exit, subtract the - * latter from the former, and add the result to an accumulating count. + * latter from the former, and add the result to an accumulating count. * Consider flow of control during normal TLB miss processing (where "ldx * [%g2], %g2" is an arbitrary TLB-missing instruction): - * - * + - - - - - - - -+ + * + * + - - - - - - - -+ * : : * : ldx [%g2], %g2 :<-------------------------------------------------------+ * : : Return from trap: | @@ -357,10 +357,10 @@ * As the above diagram indicates, interposing on the trap table allows one * only to determine a timestamp on trap _entry_: when the TLB miss handler * has completed filling the TLB, a "retry" will be issued, and control will - * transfer immediately back to the missing %pc. + * transfer immediately back to the missing %pc. * * To obtain a timestamp on trap exit, we must then somehow interpose between - * the "retry" and the subsequent control transfer to the TLB-missing + * the "retry" and the subsequent control transfer to the TLB-missing * instruction. To do this, we _push_ a trap level. The basic idea is to * spoof a TLB miss by raising TL, setting the %tpc to be within text * controlled by trapstat (the "TLB return entry") and branching to the @@ -371,7 +371,7 @@ * Here is the above TLB miss flow control diagram modified to reflect * trapstat's operation: * - * + - - - - - - - -+ + * + - - - - - - - -+ * : : * : ldx [%g2], %g2 :<-------------------------------------------------------+ * : : Return from trap: | @@ -928,8 +928,8 @@ trapstat_enable() cpu_t *cp = CPU; cp->cpu_m.cpu_tstat_flags |= TSTAT_TLB_STATS; - (void) hv_set_ctx0(NULL, NULL); - (void) hv_set_ctxnon0(NULL, NULL); + (void) hv_set_ctx0(0, 0); + (void) hv_set_ctxnon0(0, 0); } } #endif @@ -1114,7 +1114,7 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, static const uint32_t retent[TSTAT_TLBRET_NINSTR] = { #ifndef sun4v 0x87410000, /* rd %tick, %g3 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82106000, /* or %g1, %lo(stat), %g1 */ 0x89297001, /* sllx %g5, 1, %g4 */ 0x8931303e, /* srlx %g4, 62, %g4 */ @@ -1129,19 +1129,19 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, 0xc4586000, /* ldx [%g1 + tmiss_count], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_count] */ - 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ - 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ + 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ + 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ 0x8620c002, /* sub %g3, %g2, %g3 */ 0xc4586000, /* ldx [%g1 + tmiss_time], %g2 */ 0x84008003, /* add %g2, %g3, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_time] */ 0x83f00000 /* retry */ #else /* sun4v */ - 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ + 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ 0xced84400, /* ldxa [%g1]ASI_SCRATCHPAD, %g7 */ 0x8f29f000, /* sllx %g7, TSTAT_DATA_SHIFT, %g7 */ 0x87410000, /* rd %tick, %g3 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82004007, /* add %g1, %g7, %g1 */ 0x82106000, /* or %g1, %lo(stat), %g1 */ 0x8929703d, /* sllx %g5, 61, %g4 */ @@ -1151,9 +1151,9 @@ trapstat_tlbretent(tstat_percpu_t *tcpu, tstat_tlbretent_t *ret, 0xc4586000, /* ldx [%g1 + tmiss_count], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + tmiss_count] */ - 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ + 0x0d000000, /* sethi %hi(tdata_tmptick), %g6 */ 0x8c018007, /* add %g6, %g7, %g6 */ - 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ + 0xc459a000, /* ldx [%g6 + %lo(tdata_tmptick)], %g2 */ 0x8620c002, /* sub %g3, %g2, %g3 */ 0xc4586000, /* ldx [%g1 + tmiss_time], %g2 */ 0x84008003, /* add %g2, %g3, %g2 */ @@ -1291,7 +1291,7 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) */ static const uint32_t tlbent[] = { #ifndef sun4v - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(stat)] */ @@ -1309,14 +1309,14 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0xc2d80000, /* ldxa [%g0]ASI_MMU, %g1 */ 0x83307030, /* srlx %g1, CTXSHIFT, %g1 */ 0x02c04004, /* brz,pn %g1, .+0x10 */ - 0x03000000, /* sethi %hi(new_tpc), %g1 */ + 0x03000000, /* sethi %hi(new_tpc), %g1 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x30800002, /* ba,a .+0x8 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x81904000, /* wrpr %g1, %g0, %tpc */ 0x82006004, /* add %g1, 4, %g1 */ 0x83904000, /* wrpr %g1, %g0, %tnpc */ - 0x03000000, /* sethi %hi(tmptick), %g1 */ + 0x03000000, /* sethi %hi(tmptick), %g1 */ 0x85410000, /* rd %tick, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(tmptick)] */ 0x30800000, /* ba,a addr */ @@ -1325,7 +1325,7 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0x82102008, /* mov SCRATCHPAD_CPUID, %g1 */ 0xc8d84400, /* ldxa [%g1]ASI_SCRATCHPAD, %g4 */ 0x89293000, /* sllx %g4, TSTAT_DATA_SHIFT, %g4 */ - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82004004, /* add %g1, %g4, %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ @@ -1347,14 +1347,14 @@ trapstat_tlbent(tstat_percpu_t *tcpu, int entno) 0xc2d80400, /* ldxa [%g0]ASI_SCRATCHPAD, %g1 */ 0xc2586000, /* ldx [%g1 + MMFSA_?_CTX], %g1 */ 0x02c04004, /* brz,pn %g1, .+0x10 */ - 0x03000000, /* sethi %hi(new_tpc), %g1 */ + 0x03000000, /* sethi %hi(new_tpc), %g1 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x30800002, /* ba,a .+0x8 */ 0x82106000, /* or %g1, %lo(new_tpc), %g1 */ 0x81904000, /* wrpr %g1, %g0, %tpc */ 0x82006004, /* add %g1, 4, %g1 */ 0x83904000, /* wrpr %g1, %g0, %tnpc */ - 0x03000000, /* sethi %hi(tmptick), %g1 */ + 0x03000000, /* sethi %hi(tmptick), %g1 */ 0x82004004, /* add %g1, %g4, %g1 */ 0x85410000, /* rd %tick, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(tmptick)] */ @@ -1505,7 +1505,7 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) * back before branching to the actual trap table entry. */ static const uint32_t enabled[TSTAT_ENT_NINSTR] = { - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0xc4586000, /* ldx [%g1 + %lo(stat)], %g2 */ 0x8400a001, /* add %g2, 1, %g2 */ 0xc4706000, /* stx %g2, [%g1 + %lo(stat)] */ @@ -1617,9 +1617,9 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) * the interposing trap table. */ static const uint32_t enabled[TSTAT_ENT_NINSTR] = { - 0x03000000, /* sethi %hi(stat), %g1 */ + 0x03000000, /* sethi %hi(stat), %g1 */ 0x82106000, /* or %g1, %lo[stat), %g1 */ - 0x05000000, /* sethi %hi(addr), %g2 */ + 0x05000000, /* sethi %hi(addr), %g2 */ 0x8410a000, /* or %g2, %lo(addr), %g2 */ 0x86102008, /* mov ASI_SCRATCHPAD_CPUID, %g3 */ 0xc6d8c400, /* ldxa [%g3]ASI_SCRATCHPAD, %g3 */ @@ -1628,7 +1628,7 @@ trapstat_make_traptab(tstat_percpu_t *tcpu) }; static const uint32_t enabled_cont[TSTAT_ENT_NINSTR] = { - 0xc8584003, /* ldx [%g1 + %g3], %g4 */ + 0xc8584003, /* ldx [%g1 + %g3], %g4 */ 0x88012001, /* add %g4, 1, %g4 */ 0x81c08000, /* jmp %g2 */ 0xc8704003, /* stx %g4, [%g1 + %g3] */ diff --git a/usr/src/uts/sun4/os/machdep.c b/usr/src/uts/sun4/os/machdep.c index 4409f2ad8f..ca06f151c9 100644 --- a/usr/src/uts/sun4/os/machdep.c +++ b/usr/src/uts/sun4/os/machdep.c @@ -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/sun4u/adm1026/Makefile b/usr/src/uts/sun4u/adm1026/Makefile index f3d51c0215..abe50e2bda 100755 --- a/usr/src/uts/sun4u/adm1026/Makefile +++ b/usr/src/uts/sun4u/adm1026/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the adm1026 driver kernel module # # sun4u implementation architecture dependent @@ -37,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = adm1026 +MODULE = adm1026 OBJECTS = $(ADM1026_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(ADM1026_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -47,25 +44,16 @@ ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # include $(UTSBASE)/sun4u/Makefile.sun4u -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N misc/i2c_svc -# compile time debug flag - - # # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) .KEEP_STATE: - all: $(ALL_DEPS) def: $(DEF_DEPS) @@ -74,12 +62,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # Include common targets. diff --git a/usr/src/uts/sun4u/boston/Makefile b/usr/src/uts/sun4u/boston/Makefile index 77a8dbdc0a..417eb3a663 100644 --- a/usr/src/uts/sun4u/boston/Makefile +++ b/usr/src/uts/sun4u/boston/Makefile @@ -46,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -59,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(BOSTON_KMODS) - -modlintlib: $(BOSTON_KMODS) +def all clean clobber modlist: $(BOSTON_KMODS) install: $(ROOT_BOSTON_DIR) \ $(USR_BOSTON_DIR) \ @@ -74,24 +68,6 @@ install: $(ROOT_BOSTON_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the boston platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/boston.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(BOSTON_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nBoston Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(BOSTON_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/boston/os/boston.c b/usr/src/uts/sun4u/boston/os/boston.c index 119e5d2f7b..2862266b10 100644 --- a/usr/src/uts/sun4u/boston/os/boston.c +++ b/usr/src/uts/sun4u/boston/os/boston.c @@ -51,7 +51,7 @@ int (*rmc_req_now)(rmc_comm_msg_t *, uint8_t) = NULL; void startup_platform(void) { - mutex_init(&mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/cheetah/Makefile b/usr/src/uts/sun4u/cheetah/Makefile index d9a17fd409..cd92def8df 100644 --- a/usr/src/uts/sun4u/cheetah/Makefile +++ b/usr/src/uts/sun4u/cheetah/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-III OBJECTS = $(CHEETAH_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(CHEETAH_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) ROOTSOFTLINKS = $(SOFTLINKS:%=$(ROOT_PSM_CPU_DIR)/%) @@ -62,15 +61,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) $(ROOTSOFTLINKS) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # cpu-module-specific flags # CPPFLAGS += -DCPU_MODULE -DCHEETAH @@ -89,12 +82,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) @@ -112,17 +99,6 @@ $(ROOTSOFTLINKS): $(ROOTMODULE) # include $(UTSBASE)/sun4u/Makefile.targ -# -# 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_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/uts/sun4u/cherrystone/Makefile b/usr/src/uts/sun4u/cherrystone/Makefile index 415c9b4021..1fdf3597a7 100644 --- a/usr/src/uts/sun4u/cherrystone/Makefile +++ b/usr/src/uts/sun4u/cherrystone/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Cherrystone system # dependent modules for the sun4u architecture. # @@ -45,12 +43,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,15 +52,13 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(CHERRYSTONE_KMODS) - -modlintlib: $(CHERRYSTONE_KMODS) +def all clean clobber modlist: $(CHERRYSTONE_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-480R LINKED_PLATFORMS = SUNW,Sun-Fire-V490 -install: $(ROOT_CHERRYSTONE_DIR) $(USR_CHERRYSTONE_DIR) \ +install: $(ROOT_CHERRYSTONE_DIR) $(USR_CHERRYSTONE_DIR) \ $(USR_CHERRYSTONE_INC_DIR) \ $(USR_CHERRYSTONE_SBIN_DIR) \ $(USR_CHERRYSTONE_LIB_DIR) \ @@ -85,18 +77,6 @@ $(CHERRYSTONE_CRYPTO_LINKS): $(ROOT_CHERRYSTONE_CRYPTO_DIR_64) $(SYMLINK) $(ROOT_US3_CRYPTO_LINK)/$@ \ $(ROOT_CHERRYSTONE_CRYPTO_DIR_64)/$@ -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(CHERRYSTONE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nCherrystone Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(CHERRYSTONE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/cherrystone/os/cherrystone.c b/usr/src/uts/sun4u/cherrystone/os/cherrystone.c index 5b24d1a3da..1baeda6b35 100644 --- a/usr/src/uts/sun4u/cherrystone/os/cherrystone.c +++ b/usr/src/uts/sun4u/cherrystone/os/cherrystone.c @@ -101,7 +101,7 @@ startup_platform(void) extern int disable_watchdog_on_exit; disable_watchdog_on_exit = 1; - mutex_init(&cherry_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&cherry_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } #pragma weak mmu_init_large_pages @@ -295,14 +295,15 @@ plat_discover_slice(pfn_t pfn, pfn_t *first, pfn_t *last) /*ARGSUSED*/ void plat_freelist_process(int mnode) -{} +{ +} /* * Called for each board/cpu/PA range detected in plat_fill_mc(). */ static void update_mem_bounds(int boardid, int cpuid, int bankid, - uint64_t base, uint64_t size) + uint64_t base, uint64_t size) { uint64_t end; int mnode; diff --git a/usr/src/uts/sun4u/chicago/Makefile b/usr/src/uts/sun4u/chicago/Makefile index 683b077445..8795f4f948 100644 --- a/usr/src/uts/sun4u/chicago/Makefile +++ b/usr/src/uts/sun4u/chicago/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # uts/sun4u/chicago/Makefile # # This makefile drives the production of the sun4u chicago platform @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(CHICAGO_KMODS) - -modlintlib: $(CHICAGO_KMODS) +def all clean clobber modlist: $(CHICAGO_KMODS) install: $(ROOT_CHICAGO_DIR) \ $(USR_CHICAGO_DIR) \ @@ -75,24 +67,6 @@ install: $(ROOT_CHICAGO_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the chicago platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/chicago.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(CHICAGO_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nChicago Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(CHICAGO_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c b/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c index 850501397a..aa96f19079 100644 --- a/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c +++ b/usr/src/uts/sun4u/chicago/io/fpc/fpc-impl-4u.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/file.h> #include <sys/sunndi.h> #include <sys/sunddi.h> @@ -189,8 +187,7 @@ bad_regs_length: if (regs_p) kmem_free(regs_p, regs_length); bad_regs_p: - if (platform_specific_data) - kmem_free(platform_specific_data, sizeof (fire4u_specific_t)); + kmem_free(platform_specific_data, sizeof (fire4u_specific_t)); if (nodename) kmem_free(nodename, nodename_size); diff --git a/usr/src/uts/sun4u/chicago/os/chicago.c b/usr/src/uts/sun4u/chicago/os/chicago.c index f1cfc84bfe..205e940eba 100644 --- a/usr/src/uts/sun4u/chicago/os/chicago.c +++ b/usr/src/uts/sun4u/chicago/os/chicago.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sysmacros.h> @@ -53,7 +51,7 @@ static void get_ebus_rtc_vaddr(void); void startup_platform(void) { - mutex_init(&chicago_mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&chicago_mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/cpr/Makefile b/usr/src/uts/sun4u/cpr/Makefile index af9b3a9635..69438cd16a 100644 --- a/usr/src/uts/sun4u/cpr/Makefile +++ b/usr/src/uts/sun4u/cpr/Makefile @@ -47,10 +47,6 @@ OBJECTS = $(CPR_FIRST_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_IMPL_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_OBJS:%=$(OBJS_DIR)/%) \ $(CPR_SPARC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(CPR_FIRST_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_IMPL_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(CPR_SPARC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -66,29 +62,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) - -# # Depends on bootdev # LDFLAGS += -dy -N misc/bootdev -# -# 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_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-unused-label CERRWARN += $(CNOWARN_UNINIT) @@ -108,12 +88,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/us3_common.c b/usr/src/uts/sun4u/cpu/us3_common.c index 22477e2a4c..38a06c2731 100644 --- a/usr/src/uts/sun4u/cpu/us3_common.c +++ b/usr/src/uts/sun4u/cpu/us3_common.c @@ -1418,7 +1418,8 @@ cpu_log_fast_ecc_error(caddr_t tpc, int priv, int tl, uint64_t ceen, */ if ((t_afsr_errs & (C_AFSR_UCU | C_AFSR_L3_UCU)) && aflt->flt_panic == 0 && aflt->flt_priv != 0 && - curthread->t_ontrap == NULL && curthread->t_lofault == NULL) { + curthread->t_ontrap == NULL && + curthread->t_lofault == (uintptr_t)NULL) { get_cpu_error_state(&cpu_error_regs); if (IS_PANTHER(cpunodes[CPU->cpu_id].implementation)) { aflt->flt_panic |= @@ -4549,7 +4550,7 @@ cpu_error_to_resource_type(struct async_flt *aflt) */ static void cpu_payload_add_aflt(struct async_flt *aflt, nvlist_t *payload, - nvlist_t *resource, int *afar_status, int *synd_status) + nvlist_t *resource, int *afar_status, int *synd_status) { ch_async_flt_t *ch_flt = (ch_async_flt_t *)aflt; *synd_status = AFLT_STAT_INVALID; @@ -5351,7 +5352,7 @@ afsr_to_synd_status(uint_t cpuid, uint64_t afsr, uint64_t afsr_bit) void sticksync_slave(void) { - int i; + int i; int tries = 0; int64_t tskew; int64_t av_tskew; @@ -5494,7 +5495,7 @@ cpu_uninit_private(struct cpu *cp) ASSERT(chprp); cpu_uninit_ecache_scrub_dr(cp); CPU_PRIVATE(cp) = NULL; - ch_err_tl1_paddrs[cp->cpu_id] = NULL; + ch_err_tl1_paddrs[cp->cpu_id] = 0; kmem_cache_free(ch_private_cache, chprp); cmp_delete_cpu(cp->cpu_id); @@ -6175,8 +6176,8 @@ cpu_check_ce_errors(void *arg) * * flag == SCRUBBER_CEEN_CHECK * called from memscrubber, just check/scrub, no reset - * paddr physical addr. for start of scrub pages - * vaddr virtual addr. for scrub area + * paddr physical addr. for start of scrub pages + * vaddr virtual addr. for scrub area * psz page size of area to be scrubbed * * flag == TIMEOUT_CEEN_CHECK @@ -6316,9 +6317,9 @@ cpu_ce_delayed_ec_logout(uint64_t afar) void cpu_ce_detected(ch_cpu_errors_t *cpu_error_regs, int flag) { - ch_async_flt_t ch_flt; + ch_async_flt_t ch_flt; struct async_flt *aflt; - char pr_reason[MAX_REASON_STRING]; + char pr_reason[MAX_REASON_STRING]; bzero(&ch_flt, sizeof (ch_async_flt_t)); ch_flt.flt_trapped_ce = flag; @@ -6356,8 +6357,8 @@ cpu_log_and_clear_ce(ch_async_flt_t *ch_flt) struct async_flt *aflt; uint64_t afsr, afsr_errs; ch_cpu_logout_t *clop; - char pr_reason[MAX_REASON_STRING]; - on_trap_data_t *otp = curthread->t_ontrap; + char pr_reason[MAX_REASON_STRING]; + on_trap_data_t *otp = curthread->t_ontrap; aflt = (struct async_flt *)ch_flt; afsr = aflt->flt_stat; @@ -7017,7 +7018,7 @@ fpras_failure(int op, int how) * ie, don't panic for copyin, copyout, kcopy and bcopy called * under on_fault and do panic for unprotected bcopy and hwblkpagecopy. */ - aflt->flt_panic = (curthread->t_lofault == NULL); + aflt->flt_panic = (curthread->t_lofault == (uintptr_t)NULL); /* * XOR the source instruction block with the copied instruction diff --git a/usr/src/uts/sun4u/daktari/Makefile b/usr/src/uts/sun4u/daktari/Makefile index 2e5a318a1f..9a2a3f02c0 100644 --- a/usr/src/uts/sun4u/daktari/Makefile +++ b/usr/src/uts/sun4u/daktari/Makefile @@ -23,9 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Daktari system # dependent modules for the sun4u architecture. # @@ -47,12 +44,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -60,15 +53,13 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(DAKTARI_KMODS) - -modlintlib: $(DAKTARI_KMODS) +def all clean clobber modlist: $(DAKTARI_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-880 LINKED_PLATFORMS = SUNW,Sun-Fire-V890 -install: $(ROOT_DAKTARI_DIR) $(USR_DAKTARI_DIR) \ +install: $(ROOT_DAKTARI_DIR) $(USR_DAKTARI_DIR) \ $(USR_DAKTARI_INC_DIR) \ $(USR_DAKTARI_SBIN_DIR) \ $(USR_DAKTARI_LIB_DIR) \ @@ -86,25 +77,6 @@ $(DAKTARI_CRYPTO_LINKS): $(ROOT_DAKTARI_CRYPTO_DIR_64) install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) - -lint: modlintlib - -# -# The 'lint.platmod' target lints the daktari platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/daktari.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(DAKTARI_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nDaktari Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(DAKTARI_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c b/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c index a0247ea880..47e9b8ac2b 100644 --- a/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c +++ b/usr/src/uts/sun4u/daktari/io/hpc3130_dak.c @@ -336,7 +336,7 @@ hpc3130_get(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) i2c_transfer_t *i2c_tran_pointer; int err = DDI_SUCCESS; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); return (EINVAL); @@ -380,7 +380,7 @@ hpc3130_set(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) int err = DDI_SUCCESS; uint8_t passin_byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); return (EINVAL); @@ -413,11 +413,11 @@ hpc3130_set(intptr_t arg, int reg, hpc3130_unit_t *unitp, int mode) static int hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) hpc3130_unit_t *unitp; - int err = DDI_SUCCESS; + int err = DDI_SUCCESS; i2c_transfer_t *i2c_tran_pointer; i2c_reg_t ioctl_reg; int port = MINOR_TO_PORT(getminor(dev)); @@ -522,7 +522,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, break; case I2C_GET_REG: - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); err = EINVAL; @@ -566,7 +566,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, break; case I2C_SET_REG: - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "ioctl: arg passed in to " "ioctl = NULL")); err = EINVAL; @@ -581,7 +581,7 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, } (void) i2c_transfer_alloc(unitp->hpc3130_hdl, &i2c_tran_pointer, 2, 0, I2C_SLEEP); - if (i2c_tran_pointer == NULL) { + if (i2c_tran_pointer == NULL) { D2CMN_ERR((CE_WARN, "Failed in I2C_GET_REG " "i2c_tran_pointer not allocated")); err = ENOMEM; @@ -685,11 +685,11 @@ hpc3130_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, } static int -hpc3130_poll(dev_t dev, short events, int anyyet, short - *reventsp, struct pollhead **phpp) +hpc3130_poll(dev_t dev, short events, int anyyet, short *reventsp, + struct pollhead **phpp) { _NOTE(ARGUNUSED(events)) - hpc3130_unit_t *unitp; + hpc3130_unit_t *unitp; int port = MINOR_TO_PORT(getminor(dev)); int instance = MINOR_TO_INST(getminor(dev)); @@ -983,7 +983,7 @@ hpc3130_do_attach(dev_info_t *dip) minor_number = INST_TO_MINOR(instance) | PORT_TO_MINOR(I2C_PORT(i)); if (ddi_create_minor_node(dip, name, S_IFCHR, minor_number, - "ddi_i2c:controller", NULL) == DDI_FAILURE) { + "ddi_i2c:controller", 0) == DDI_FAILURE) { D1CMN_ERR((CE_WARN, "ddi_create_minor_node failed " "for %s", name)); ddi_remove_intr(dip, 0u, @@ -1112,7 +1112,7 @@ hpc3130_set_led(hpc3130_unit_t *unitp, int slot, int led, uint8_t value) int hpc3130_get_led(i2c_client_hdl_t handle, int slot, - int led, uint8_t *value) + int led, uint8_t *value) { uint8_t temp; @@ -1126,7 +1126,7 @@ hpc3130_get_led(i2c_client_hdl_t handle, int slot, static int hpc3130_write(i2c_client_hdl_t handle, uint8_t offset, - uint8_t port, uint8_t data) + uint8_t port, uint8_t data) { ASSERT(port < HPC3130_MAX_SLOT); ASSERT(handle); @@ -1137,7 +1137,7 @@ hpc3130_write(i2c_client_hdl_t handle, uint8_t offset, static int hpc3130_read(i2c_client_hdl_t handle, uint8_t offset, - uint8_t port, uint8_t *data) + uint8_t port, uint8_t *data) { ASSERT(port < HPC3130_MAX_SLOT); ASSERT(handle); @@ -1148,7 +1148,7 @@ hpc3130_read(i2c_client_hdl_t handle, uint8_t offset, static int hpc3130_rw(i2c_client_hdl_t handle, uint8_t reg, - boolean_t write, uint8_t *data) + boolean_t write, uint8_t *data) { i2c_transfer_t *i2c_tran_pointer; int err; @@ -1201,7 +1201,7 @@ hpc3130_rw(i2c_client_hdl_t handle, uint8_t reg, */ static int hpc3130_init(dev_info_t *dip, - struct tuple *init_sequence) + struct tuple *init_sequence) { int slot; @@ -1445,7 +1445,7 @@ out: static int hpc3130_debounce_status(i2c_client_hdl_t handle, - int slot, uint8_t *status) + int slot, uint8_t *status) { int count, limit; uint8_t old; @@ -1484,7 +1484,7 @@ hpc3130_debounce_status(i2c_client_hdl_t handle, static int hpc3130_slot_connect(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(slot_hdl, data, flags)) uint8_t control; @@ -1673,7 +1673,7 @@ out: static int hpc3130_slot_disconnect(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(slot_hdl, data, flags)) uint8_t control; @@ -1800,7 +1800,7 @@ out: static int hpc3130_verify_slot_power(hpc3130_unit_t *hpc3130_p, i2c_client_hdl_t handle, - uint8_t offset, char *phys_slot, boolean_t slot_target_state) + uint8_t offset, char *phys_slot, boolean_t slot_target_state) { uint8_t tries = 0; uint8_t status; @@ -1870,7 +1870,7 @@ hpc3130_verify_slot_power(hpc3130_unit_t *hpc3130_p, i2c_client_hdl_t handle, static int hpc3130_slot_insert(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(ops_arg, slot_hdl, data, flags)) return (HPC_ERR_NOTSUPPORTED); @@ -1878,7 +1878,7 @@ hpc3130_slot_insert(caddr_t ops_arg, hpc_slot_t slot_hdl, static int hpc3130_slot_remove(caddr_t ops_arg, hpc_slot_t slot_hdl, - void *data, uint_t flags) + void *data, uint_t flags) { _NOTE(ARGUNUSED(ops_arg, slot_hdl, data, flags)) return (HPC_ERR_NOTSUPPORTED); @@ -1886,7 +1886,7 @@ hpc3130_slot_remove(caddr_t ops_arg, hpc_slot_t slot_hdl, static int hpc3130_slot_control(caddr_t ops_arg, hpc_slot_t slot_hdl, - int request, caddr_t arg) + int request, caddr_t arg) { _NOTE(ARGUNUSED(slot_hdl)) i2c_client_hdl_t handle; @@ -2049,9 +2049,9 @@ hpc3130_lookup_slot(char *nexus, int pcidev) { int i = 0; - while ((slot_translate[i].pcidev != pcidev || - strcmp(nexus, slot_translate[i].nexus) != 0) && - i < HPC3130_LOOKUP_SLOTS) + while (i < HPC3130_LOOKUP_SLOTS && + (slot_translate[i].pcidev != pcidev || + strcmp(nexus, slot_translate[i].nexus) != 0)) i++; ASSERT(i != HPC3130_LOOKUP_SLOTS); return (i); diff --git a/usr/src/uts/sun4u/db21554/Makefile b/usr/src/uts/sun4u/db21554/Makefile index ef3d37f0f3..79b523ba96 100644 --- a/usr/src/uts/sun4u/db21554/Makefile +++ b/usr/src/uts/sun4u/db21554/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = db21554 OBJECTS = $(DB21554_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DB21554_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -53,18 +52,12 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Turn this on once compiler understands v9 in it's backend #INLINES += $(UTSBASE)/sun4u/io/pci.il # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Turn on doubleword alignment for 64 bit registers # CFLAGS += -dalign @@ -79,13 +72,6 @@ CFLAGS += -DPCI_HOTPLUG # LDFLAGS += -dy -Nmisc/pcihp -# -# 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 - CERRWARN += -_gcc=-Wno-parentheses CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-type-limits @@ -102,12 +88,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/excalibur/Makefile b/usr/src/uts/sun4u/excalibur/Makefile index 9c110d7809..ea5b6dc325 100644 --- a/usr/src/uts/sun4u/excalibur/Makefile +++ b/usr/src/uts/sun4u/excalibur/Makefile @@ -24,8 +24,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sun4u excalibur platform # module. # @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(EXCALIBUR_KMODS) - -modlintlib: $(EXCALIBUR_KMODS) +def all clean clobber modlist: $(EXCALIBUR_KMODS) install: $(ROOT_EXCALIBUR_DIR) \ $(USR_EXCALIBUR_DIR) \ @@ -75,24 +67,6 @@ install: $(ROOT_EXCALIBUR_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the excalibur platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/excalibur.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(EXCALIBUR_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nExcalibur Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(EXCALIBUR_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/excalibur/io/xcalwd.c b/usr/src/uts/sun4u/excalibur/io/xcalwd.c index a712ae5102..62cb0aaa70 100644 --- a/usr/src/uts/sun4u/excalibur/io/xcalwd.c +++ b/usr/src/uts/sun4u/excalibur/io/xcalwd.c @@ -196,7 +196,7 @@ _info(struct modinfo *modinfop) /*ARGSUSED*/ static int xcalwd_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, - void *arg, void **resultp) + void *arg, void **resultp) { int retval; dev_t dev = (dev_t)arg; @@ -255,7 +255,7 @@ xcalwd_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(dip, MINOR_DEVICE_NAME, - S_IFCHR, instance, DDI_PSEUDO, NULL) == DDI_FAILURE) { + S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "create minor node failed\n"); return (DDI_FAILURE); } @@ -396,7 +396,7 @@ xcalwd_close(dev_t dev, int flag, int otyp, cred_t *credp) /*ARGSUSED*/ static int xcalwd_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, - cred_t *cred_p, int *rvalp) + cred_t *cred_p, int *rvalp) { int instance; xcalwd_state_t *tsp; diff --git a/usr/src/uts/sun4u/excalibur/os/excalibur.c b/usr/src/uts/sun4u/excalibur/os/excalibur.c index 2727e25ac3..9dd7b33a13 100644 --- a/usr/src/uts/sun4u/excalibur/os/excalibur.c +++ b/usr/src/uts/sun4u/excalibur/os/excalibur.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sysmacros.h> @@ -66,7 +64,7 @@ static xcalfan_info_t xcalfans[] = { void startup_platform(void) { - mutex_init(&excal_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&excal_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int @@ -185,7 +183,7 @@ plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), - buf, buflen, lenp)); + buf, buflen, lenp)); else return (ENOTSUP); } diff --git a/usr/src/uts/sun4u/gpio_87317/Makefile b/usr/src/uts/sun4u/gpio_87317/Makefile index 86374e2b13..a0962484f3 100644 --- a/usr/src/uts/sun4u/gpio_87317/Makefile +++ b/usr/src/uts/sun4u/gpio_87317/Makefile @@ -39,9 +39,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = gpio_87317 +MODULE = gpio_87317 OBJECTS = $(GPIO_87317_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GPIO_87317_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -52,14 +51,9 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # # Define targets # -ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint +ALL_TARGET = $(BINARY) INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -75,16 +69,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/grover/io/grfans.c b/usr/src/uts/sun4u/grover/io/grfans.c index 73219668da..0f8e397b4a 100644 --- a/usr/src/uts/sun4u/grover/io/grfans.c +++ b/usr/src/uts/sun4u/grover/io/grfans.c @@ -215,7 +215,7 @@ grfans_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "cpu_fan", S_IFCHR, DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(CPU_FAN_CHANNEL), - FANS_NODE_TYPE, NULL) == DDI_FAILURE) { + FANS_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed" " for cpu fan", name); ddi_regs_map_free(&unitp->cpufan_rhandle); @@ -228,7 +228,7 @@ grfans_do_attach(dev_info_t *dip) if (ddi_create_minor_node(dip, "sys_fan", S_IFCHR, DEVINST_TO_MINOR(instance) | CHANNEL_TO_MINOR(SYSTEM_FAN_CHANNEL), - FANS_NODE_TYPE, NULL) == DDI_FAILURE) { + FANS_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed" " for system fan", name); ddi_regs_map_free(&unitp->cpufan_rhandle); diff --git a/usr/src/uts/sun4u/grover/os/grover.c b/usr/src/uts/sun4u/grover/os/grover.c index 6a84c726e1..3cb4cc58c3 100644 --- a/usr/src/uts/sun4u/grover/os/grover.c +++ b/usr/src/uts/sun4u/grover/os/grover.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> @@ -57,12 +55,12 @@ set_platform_defaults(void) * of Southbridge. */ #define GROVER_ISA_PATHNAME "/pci@1f,0/isa@7" -ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */ +ddi_acc_handle_t grover_isa_handle; /* handle for isa pci space */ void load_platform_drivers(void) { - dev_info_t *dip; /* dip of the isa driver */ + dev_info_t *dip; /* dip of the isa driver */ if (i_ddi_attach_hw_nodes("power") != DDI_SUCCESS) @@ -88,12 +86,10 @@ load_platform_drivers(void) dip = e_ddi_hold_devi_by_path(GROVER_ISA_PATHNAME, 0); if (dip == NULL) { cmn_err(CE_PANIC, "Could not install the isa driver\n"); - return; } if (pci_config_setup(dip, &grover_isa_handle) != DDI_SUCCESS) { cmn_err(CE_PANIC, "Could not get the config space of isa\n"); - return; } } diff --git a/usr/src/uts/sun4u/grover/platmod/Makefile b/usr/src/uts/sun4u/grover/platmod/Makefile index c217de09a7..7962801ce2 100644 --- a/usr/src/uts/sun4u/grover/platmod/Makefile +++ b/usr/src/uts/sun4u/grover/platmod/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../../.. # MODULE = platmod OBJECTS = $(GROVER_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GROVER_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_GROVER_MISC_DIR)/$(MODULE) PLAT_DIR = . @@ -60,7 +59,6 @@ CLEANFILES += $(PLATLIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,18 +79,10 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) check: -LINT_LIB_DIR = $(GROVER_LINT_LIB_DIR) - $(PLATLIB): $(OBJECTS) $(BUILD.SO) $(OBJECTS) diff --git a/usr/src/uts/sun4u/io/gpio_87317.c b/usr/src/uts/sun4u/io/gpio_87317.c index 450425e407..3c218b58b5 100644 --- a/usr/src/uts/sun4u/io/gpio_87317.c +++ b/usr/src/uts/sun4u/io/gpio_87317.c @@ -213,7 +213,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) instance = ddi_get_instance(dip); DBG(dip, "attach: instance is %d", instance, 0, 0, 0, 0); if (ddi_soft_state_zalloc(statep, instance) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; softc = getsoftc(instance); softc->gp_dip = dip; softc->gp_state = 0; @@ -226,7 +226,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC; if (ddi_regs_map_setup(dip, 0, (caddr_t *)&softc->gp_regs, 0, 0, &dev_attr, &softc->gp_handle) != DDI_SUCCESS) - goto attach_failed; + goto attach_failed; DBG(dip, "attach: regs=0x%p", (uintptr_t)softc->gp_regs, 0, 0, 0, 0); DBG(dip, "attach: port 1 data is %x", @@ -254,10 +254,10 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (uintptr_t)ddi_get8(softc->gp_handle, &softc->gp_regs[7]), 0, 0, 0, 0); - /* Create device minor nodes. */ + /* Create device minor nodes. */ if (ddi_create_minor_node(dip, "gpio", S_IFCHR, - instance, NULL, NULL) == DDI_FAILURE) { + instance, NULL, 0) == DDI_FAILURE) { ddi_regs_map_free(&softc->gp_handle); goto attach_failed; } @@ -267,7 +267,7 @@ gpio_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) case DDI_RESUME: - /* Nothing to do for a resume. */ + /* Nothing to do for a resume. */ return (DDI_SUCCESS); @@ -340,7 +340,7 @@ gpio_close(dev_t dev, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = getminor(dev); struct gpio_softc *softc = getsoftc(instance); @@ -423,7 +423,7 @@ gpio_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, #ifdef DEBUG void gpio_debug(dev_info_t *dip, char *format, uint_t arg1, uint_t arg2, uint_t arg3, - uint_t arg4, uint_t arg5) + uint_t arg4, uint_t arg5) { if (gpio_debug_flag == 0) { return; diff --git a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c index 7ab697104c..4e8340d642 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/adm1026.c +++ b/usr/src/uts/sun4u/io/i2c/clients/adm1026.c @@ -312,7 +312,7 @@ adm1026_do_attach(dev_info_t *dip) D2CMN_ERR((CE_WARN, "adm1026_do_attach: ddi_create_minor_node")); if (ddi_create_minor_node(dip, "adm1026", S_IFCHR, instance, - "ddi_i2c:led_control", NULL) == DDI_FAILURE) { + "ddi_i2c:led_control", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "adm1026_do_attach: ddi_create_minor_node failed"); ddi_soft_state_free(adm1026soft_statep, instance); @@ -438,7 +438,7 @@ adm1026_put8(adm1026_unit_t *unitp, uint8_t reg, uint8_t val) */ static int adm1026_send8(adm1026_unit_t *unitp, uint8_t reg, uint8_t reg_val, - uint8_t reg_mask) + uint8_t reg_mask) { uint8_t val = 0; int err; @@ -593,7 +593,7 @@ adm1026_get_config(adm1026_unit_t *unitp, int cmd, uint32_t mask, uint32_t *val) static int adm1026_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) diff --git a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c index 0f093c72d5..71cfcde9b3 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c +++ b/usr/src/uts/sun4u/io/i2c/clients/pic16f819.c @@ -275,17 +275,17 @@ pic16f819_close(dev_t dev, int flags, int otyp, cred_t *credp) static int pic16f819_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)) - struct pic16f819_unit *unitp; - int instance; - int err = 0; + struct pic16f819_unit *unitp; + int instance; + int err = 0; i2c_reg_t ioctl_reg; - uchar_t val8; + uchar_t val8; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "PIC16F819: ioctl: arg passed in to ioctl " "= NULL\n")); err = EINVAL; @@ -389,7 +389,7 @@ pic16f819_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "fan_1", S_IFCHR, instance, - "ddi_i2c:pic", NULL) == DDI_FAILURE) { + "ddi_i2c:pic", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s ddi_create_minor_node failed for " "%s\n", unitp->pic16f819_name, "pic16f819"); ddi_soft_state_free(pic16f819soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c index 1cf46a0574..1a79a14f4f 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc050.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc050.c @@ -306,7 +306,7 @@ ssc050_set(struct ssc050_unit *unitp, int reg, uchar_t byte) static int ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { _NOTE(ARGUNUSED(credp, rvalp)) @@ -317,14 +317,14 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, i2c_reg_t ioctl_reg; int port = MINOR_TO_PORT(getminor(dev)); int instance = MINOR_TO_INST(getminor(dev)); - uchar_t reg, val8; - uchar_t control; + uchar_t reg, val8; + uchar_t control; uchar_t fan_count; int divisor; int32_t fan_speed; uint8_t inverted_mask; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC050: ioctl: arg passed in to ioctl " "= NULL")); return (EINVAL); @@ -498,10 +498,10 @@ ssc050_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, val8)); err = ssc050_set(unitp, reg, val8 | SSC050_DATADIRECTION_BIT); - if (err != I2C_SUCCESS) { - break; - } - delay(10); + if (err != I2C_SUCCESS) { + break; + } + delay(10); } } @@ -647,7 +647,7 @@ ssc050_do_attach(dev_info_t *dip) PORT_TO_MINOR(I2C_PORT(i)); if (ddi_create_minor_node(dip, name, S_IFCHR, minor_number, - "ddi_i2c:ioexp", NULL) == DDI_FAILURE) { + "ddi_i2c:ioexp", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s: failed to create node for %s", unitp->name, name); ddi_soft_state_free(ssc050soft_statep, instance); @@ -684,7 +684,7 @@ ssc050_do_detach(dev_info_t *dip) int ssc050_get_port_bit(dev_info_t *dip, int port, int bit, uchar_t *rval, - int flags) + int flags) { struct ssc050_unit *unitp; int instance; diff --git a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c index 9ebc3eabc8..0c92f7b977 100644 --- a/usr/src/uts/sun4u/io/i2c/clients/ssc100.c +++ b/usr/src/uts/sun4u/io/i2c/clients/ssc100.c @@ -294,7 +294,7 @@ ssc100_set(struct ssc100_unit *unitp, uchar_t byte) static int ssc100_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)) @@ -306,7 +306,7 @@ ssc100_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, i2c_reg_t ioctl_reg; uchar_t byte; - if (arg == NULL) { + if (arg == (intptr_t)NULL) { D2CMN_ERR((CE_WARN, "SSC100: ioctl: arg passed in to ioctl " "= NULL")); err = EINVAL; @@ -529,7 +529,7 @@ ssc100_do_attach(dev_info_t *dip) "%s%d", ddi_node_name(dip), instance); if (ddi_create_minor_node(dip, "ssc100", 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", unitp->ssc100_name, "ssc100"); ddi_soft_state_free(ssc100soft_statep, instance); diff --git a/usr/src/uts/sun4u/io/pci/db21554.c b/usr/src/uts/sun4u/io/pci/db21554.c index f51ad8c0e6..fc1e83fd19 100644 --- a/usr/src/uts/sun4u/io/pci/db21554.c +++ b/usr/src/uts/sun4u/io/pci/db21554.c @@ -321,7 +321,7 @@ static void db_pci_get_conf_regs(ddi_acc_handle_t config_handle, #ifdef DEBUG static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5); #endif static int db_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, @@ -348,34 +348,34 @@ static struct cb_ops db_cb_ops = { nodev /* int (*cb_awrite)() */ }; -static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); +static uint8_t db_ddi_get8(ddi_acc_impl_t *handle, uint8_t *addr); static uint16_t db_ddi_get16(ddi_acc_impl_t *handle, uint16_t *addr); static uint32_t db_ddi_get32(ddi_acc_impl_t *handle, uint32_t *addr); static uint64_t db_ddi_get64(ddi_acc_impl_t *handle, uint64_t *addr); -static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, - uint8_t data); -static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, - uint16_t data); -static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, - uint32_t data); -static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, - uint64_t data); -static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags); -static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_put8(ddi_acc_impl_t *handle, uint8_t *addr, + uint8_t data); +static void db_ddi_put16(ddi_acc_impl_t *handle, uint16_t *addr, + uint16_t data); +static void db_ddi_put32(ddi_acc_impl_t *handle, uint32_t *addr, + uint32_t data); +static void db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, + uint64_t data); +static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, + uint8_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, + uint16_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, + uint32_t *dev_addr, size_t repcount, uint_t flags); +static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, + uint64_t *dev_addr, size_t repcount, uint_t flags); static struct dev_ops db_dev_ops = { DEVO_REV, /* devo_rev */ @@ -410,16 +410,16 @@ static struct modlinkage modlinkage = { }; /* soft state pointer and structure template. */ -static void *db_state; +static void *db_state; /* * forward function declarations: */ static void db_uninitchild(dev_info_t *); -static int db_initchild(dev_info_t *child); -static int db_create_pci_prop(dev_info_t *child); -static int db_save_config_regs(db_ctrl_t *dbp); -static int db_restore_config_regs(db_ctrl_t *dbp); +static int db_initchild(dev_info_t *child); +static int db_create_pci_prop(dev_info_t *child); +static int db_save_config_regs(db_ctrl_t *dbp); +static int db_restore_config_regs(db_ctrl_t *dbp); /* * FMA error callback @@ -675,7 +675,7 @@ db_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) if (ddi_create_minor_node(dip, name, S_IFCHR, PCIHP_AP_MINOR_NUM(instance, PCIHP_DEBUG_MINOR), - NULL, NULL) == DDI_FAILURE) { + NULL, 0) == DDI_FAILURE) { cmn_err(CE_NOTE, "%s#%d: node creation failure", ddi_driver_name(dbp->dip), instance); } @@ -1443,7 +1443,7 @@ db_close(dev_t dev, int flag, int otyp, cred_t *cred_p) /*ARGSUSED*/ static int db_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, - int *rval_p) + int *rval_p) { int rc = DDI_SUCCESS; #ifdef DB_DEBUG @@ -1698,15 +1698,15 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) /* * Function: db_pci_map * - * Note: Only memory accesses are direct. IO could be direct - * or indirect. Config accesses are always indirect. - * The question here is, does the "assigned-addresses" - * property entry represents the addresses in the - * local domain or the host domain itself. - * Strictly speaking, the assumption should be that - * it is in the local domain, as the transactions - * upstream or downstream are automatically - * translated by the bridge chip anyway. + * Note: Only memory accesses are direct. IO could be direct + * or indirect. Config accesses are always indirect. + * The question here is, does the "assigned-addresses" + * property entry represents the addresses in the + * local domain or the host domain itself. + * Strictly speaking, the assumption should be that + * it is in the local domain, as the transactions + * upstream or downstream are automatically + * translated by the bridge chip anyway. * * Return values: * DDI_SUCCESS: map call by child device success @@ -1715,7 +1715,7 @@ db_pci_get_conf_regs(ddi_acc_handle_t config_handle, db_conf_regs_t *cr) static int db_pci_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t offset, off_t len, caddr_t *addrp) + off_t offset, off_t len, caddr_t *addrp) { register dev_info_t *pdip; int reg_proplen, num_regs, rnumber; @@ -2088,7 +2088,7 @@ char *db_ctlop_name[] = { static int db_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) { if ((ctlop >= DDI_CTLOPS_DMAPMAPC) && @@ -2865,7 +2865,7 @@ db_ddi_put64(ddi_acc_impl_t *handle, uint64_t *addr, uint64_t data) */ static void db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2881,7 +2881,7 @@ db_ddi_rep_get8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2897,7 +2897,7 @@ db_ddi_rep_get16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2913,7 +2913,7 @@ db_ddi_rep_get32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2929,7 +2929,7 @@ db_ddi_rep_get64(ddi_acc_impl_t *handle, uint64_t *host_addr, */ static void db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, - uint8_t *dev_addr, size_t repcount, uint_t flags) + uint8_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2945,7 +2945,7 @@ db_ddi_rep_put8(ddi_acc_impl_t *handle, uint8_t *host_addr, */ static void db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, - uint16_t *dev_addr, size_t repcount, uint_t flags) + uint16_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2961,7 +2961,7 @@ db_ddi_rep_put16(ddi_acc_impl_t *handle, uint16_t *host_addr, */ static void db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, - uint32_t *dev_addr, size_t repcount, uint_t flags) + uint32_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2977,7 +2977,7 @@ db_ddi_rep_put32(ddi_acc_impl_t *handle, uint32_t *host_addr, */ static void db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, - uint64_t *dev_addr, size_t repcount, uint_t flags) + uint64_t *dev_addr, size_t repcount, uint_t flags) { if (flags == DDI_DEV_AUTOINCR) for (; repcount; repcount--) @@ -2991,7 +2991,7 @@ db_ddi_rep_put64(ddi_acc_impl_t *handle, uint64_t *host_addr, static void db_debug(uint64_t func_id, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) { char *s = NULL; uint_t dip_no_disp = 0; @@ -3097,7 +3097,7 @@ db_fm_fini(db_ctrl_t *db_p) /*ARGSUSED*/ static int db_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc) + ddi_iblock_cookie_t *ibc) { db_ctrl_t *db_p = (db_ctrl_t *)ddi_get_soft_state(db_state, ddi_get_instance(dip)); diff --git a/usr/src/uts/sun4u/io/pic16f747.c b/usr/src/uts/sun4u/io/pic16f747.c index 011a8974d0..0a8a4d398c 100644 --- a/usr/src/uts/sun4u/io/pic16f747.c +++ b/usr/src/uts/sun4u/io/pic16f747.c @@ -220,7 +220,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "env-monitor%d", inst); minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(0); if (ddi_create_minor_node(dip, name, S_IFCHR, minor, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ddi_create_minor_node() failed for inst %d\n", inst); @@ -261,7 +261,7 @@ pic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) minor_name = pic_nodes[i].minor_name; minor = PIC_INST_TO_MINOR(inst) | PIC_UNIT_TO_MINOR(i); if (ddi_create_minor_node(dip, minor_name, S_IFCHR, - minor, PICDEV_NODE_TYPE, NULL) == DDI_FAILURE) { + minor, PICDEV_NODE_TYPE, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "%s:%d ddi_create_minor_node failed", ddi_driver_name(dip), inst); diff --git a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c index 6c173379e0..58fd2db8eb 100644 --- a/usr/src/uts/sun4u/io/rmc_comm_drvintf.c +++ b/usr/src/uts/sun4u/io/rmc_comm_drvintf.c @@ -360,13 +360,13 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, if (response != NULL) { exp_resp->msg_type = response->msg_type; exp_resp->msg_buf = (uint8_t *)response->msg_buf; - exp_resp->msg_msglen = (uint16_t)response->msg_bytes; - exp_resp->msg_bufsiz = (uint16_t)response->msg_len; + exp_resp->msg_msglen = response->msg_bytes; + exp_resp->msg_bufsiz = response->msg_len; } else { exp_resp->msg_type = DP_NULL_MSG; - exp_resp->msg_buf = (uint8_t)NULL; - exp_resp->msg_bufsiz = (uint16_t)0; - exp_resp->msg_msglen = (uint16_t)0; + exp_resp->msg_buf = NULL; + exp_resp->msg_bufsiz = 0; + exp_resp->msg_msglen = 0; } /* @@ -374,7 +374,7 @@ rmc_comm_send_req_resp(struct rmc_comm_state *rcs, rmc_comm_msg_t *request, */ req.msg_type = request->msg_type; req.msg_buf = (uint8_t *)request->msg_buf; - req.msg_msglen = (uint16_t)request->msg_len; + req.msg_msglen = request->msg_len; /* * send the message and wait for the reply or ACKnowledgment @@ -636,7 +636,7 @@ int rmc_comm_reg_intr(uint8_t msg_type, rmc_comm_intrfunc_t intr_handler, rmc_comm_msg_t *msgbuf, uint_t *state, kmutex_t *lock) { - struct rmc_comm_state *rcs; + struct rmc_comm_state *rcs; dp_msg_intr_t *msgintr; int err = RCNOERR; diff --git a/usr/src/uts/sun4u/io/rmcadm.c b/usr/src/uts/sun4u/io/rmcadm.c index 2ad9a87c23..ed4da3a286 100644 --- a/usr/src/uts/sun4u/io/rmcadm.c +++ b/usr/src/uts/sun4u/io/rmcadm.c @@ -233,7 +233,7 @@ rmcadm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "rmcadm", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); diff --git a/usr/src/uts/sun4u/io/rmclomv.c b/usr/src/uts/sun4u/io/rmclomv.c index 13c10e3a01..9d00fdd6fb 100644 --- a/usr/src/uts/sun4u/io/rmclomv.c +++ b/usr/src/uts/sun4u/io/rmclomv.c @@ -399,7 +399,7 @@ rmclomv_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "rmclomv", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); @@ -1621,7 +1621,7 @@ refresh_name_cache(int force_fail) if (retval == 0) { retval = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); } if (retval == 0) { fru_cmd.handle = DP_NULL_HANDLE; @@ -2896,7 +2896,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, case ENVMONIOCCHASSISSERIALNUM: retval = rmclomv_do_cmd(DP_GET_SDP_VERSION, DP_GET_SDP_VERSION_R, sizeof (rmc_sdpver_r), - NULL, (intptr_t)&rmc_sdpver_r); + (intptr_t)NULL, (intptr_t)&rmc_sdpver_r); if (retval != 0) { cmn_err(CE_WARN, "DP_GET_SDP_VERSION failed, ret=%d\n", @@ -2908,7 +2908,7 @@ rmclomv_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred_p, } retval = rmclomv_do_cmd(DP_GET_CHASSIS_SERIALNUM, DP_GET_CHASSIS_SERIALNUM_R, sizeof (rmc_serialnum_r), - NULL, (intptr_t)&rmc_serialnum_r); + (intptr_t)NULL, (intptr_t)&rmc_serialnum_r); if (retval != 0) { break; @@ -2940,7 +2940,7 @@ rmclomv_checkrmc(caddr_t arg) int err; int retries; int state; - dp_get_sysinfo_r_t sysinfo; + dp_get_sysinfo_r_t sysinfo; CALLB_CPR_INIT(&cprinfo, &rmclomv_checkrmc_lock, callb_generic_cpr, "rmclomv_checkrmc"); @@ -3005,7 +3005,7 @@ rmclomv_checkrmc(caddr_t arg) mutex_exit(&rmclomv_checkrmc_lock); err = rmclomv_do_cmd(DP_GET_SYSINFO, DP_GET_SYSINFO_R, - sizeof (sysinfo), NULL, (intptr_t)&sysinfo); + sizeof (sysinfo), (intptr_t)NULL, (intptr_t)&sysinfo); if (err == 0) { mutex_enter(&rmclomv_state_lock); state = rmclomv_rmc_state; @@ -3393,7 +3393,7 @@ plat_timesync(void *arg) if (arg != NULL) { /* Request the time from the RMC clock. */ retval = rmclomv_do_cmd(DP_GET_DATE_TIME, DP_GET_DATE_TIME_R, - DATE_TIME_MSG_SIZE, NULL, (intptr_t)&buffer); + DATE_TIME_MSG_SIZE, (intptr_t)NULL, (intptr_t)&buffer); /* * If we were able to get the time lets set the local clock. diff --git a/usr/src/uts/sun4u/io/sbbc.c b/usr/src/uts/sun4u/io/sbbc.c index 615ea8549e..10117ae4dd 100644 --- a/usr/src/uts/sun4u/io/sbbc.c +++ b/usr/src/uts/sun4u/io/sbbc.c @@ -172,15 +172,15 @@ static struct bus_ops sbbc_bus_ops = { 0, 0, 0, - NULL, /* (*bus_map_fault)() */ + NULL, /* (*bus_map_fault)() */ ddi_no_dma_map, ddi_no_dma_allochdl, - ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */ - ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */ - ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */ - ddi_no_dma_flush, /* (*bus_dma_flush)() */ - ddi_no_dma_win, /* (*bus_dma_win)() */ - ddi_no_dma_mctl, /* (*bus_dma_ctl)() */ + ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */ + ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */ + ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */ + ddi_no_dma_flush, /* (*bus_dma_flush)() */ + ddi_no_dma_win, /* (*bus_dma_win)() */ + ddi_no_dma_mctl, /* (*bus_dma_ctl)() */ sbbc_ctlops, ddi_bus_prop_op, 0, /* (*bus_get_eventcookie)(); */ @@ -425,7 +425,7 @@ sbbc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "sbbc%d", instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, NULL, - NULL) == DDI_FAILURE) { + 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); goto failed; } @@ -510,7 +510,7 @@ sbbc_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) */ static int sbbc_busmap(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp, - off_t off, off_t len, caddr_t *addrp) + off_t off, off_t len, caddr_t *addrp) { struct sbbcsoft *sbbcsoftp; sbbc_child_regspec_t *child_rp, *child_regs; @@ -690,7 +690,7 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, childintr->status = SBBC_INTR_STATE_DISABLE; for (i = 0; i < MAX_SBBC_DEVICES; i++) { - if (sbbcsoftp->child_intr[i] == 0) { + if (sbbcsoftp->child_intr[i] == NULL) { sbbcsoftp->child_intr[i] = childintr; break; } @@ -705,7 +705,8 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, cmn_err(CE_WARN, "sbbc%d: failed to add intr for %s", instance, ddi_get_name(rdip)); kmem_free(childintr, sizeof (struct sbbc_child_intr)); - sbbcsoftp->child_intr[i] = NULL; + if (i < MAX_SBBC_DEVICES) + sbbcsoftp->child_intr[i] = NULL; } /* @@ -817,7 +818,7 @@ sbbc_update_intr_state(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, */ static int sbbc_ctlops(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, - void *arg, void *result) + void *arg, void *result) { sbbc_child_regspec_t *child_rp; int i, n; @@ -1121,7 +1122,7 @@ sbbc_close(dev_t dev, int flag, int otype, cred_t *credp) /*ARGSUSED2*/ static int sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { struct sbbcsoft *sbbcsoftp; @@ -1144,7 +1145,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, return (EINVAL); } - if (arg == NULL) { + if (arg == (intptr_t)NULL) { return (ENXIO); } @@ -1184,7 +1185,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, return (EINVAL); } - if (arg == NULL) { + if (arg == (intptr_t)NULL) { return (ENXIO); } @@ -1372,7 +1373,8 @@ sbbc_intr_wrapper(caddr_t arg) * used to crash the system. */ static int -sbbc_offset_valid(uint32_t offset) { +sbbc_offset_valid(uint32_t offset) +{ /* * Check for proper alignment first. */ @@ -1415,7 +1417,7 @@ sbbc_offset_valid(uint32_t offset) { #ifdef DEBUG void sbbc_dbg(uint32_t flag, dev_info_t *dip, char *fmt, - uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) + uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5) { char *s = NULL; diff --git a/usr/src/uts/sun4u/io/todds1287.c b/usr/src/uts/sun4u/io/todds1287.c index 35dc7ad8fc..bf9cb8bd42 100644 --- a/usr/src/uts/sun4u/io/todds1287.c +++ b/usr/src/uts/sun4u/io/todds1287.c @@ -176,7 +176,7 @@ static ddi_softintr_t ds1287_softintr_id; static kmutex_t ds1287_reg_mutex; /* Protects ds1287 Registers */ static struct modldrv modldrv = { - &mod_driverops, /* Type of module. This one is a driver */ + &mod_driverops, /* Type of module. This one is a driver */ "ds1287 clock driver", /* Name of the module. */ &ds1287_ops, /* driver ops */ }; @@ -354,7 +354,7 @@ ds1287_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * creating the minor node. */ if (ddi_create_minor_node(dip, "power_button", S_IFCHR, - (instance << 8) + 0, "ddi_power_button", NULL) == DDI_FAILURE) { + (instance << 8) + 0, "ddi_power_button", 0) == DDI_FAILURE) { cmn_err(CE_WARN, "ds1287_attach: Failed to create minor node"); goto error3; } @@ -453,7 +453,7 @@ ds1287_close(dev_t dev, int flags, int otyp, cred_t *credp) /*ARGSUSED4*/ static int ds1287_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { struct ds1287 *softsp; int clone; diff --git a/usr/src/uts/sun4u/io/todds1337.c b/usr/src/uts/sun4u/io/todds1337.c index 319928bde7..4688467769 100644 --- a/usr/src/uts/sun4u/io/todds1337.c +++ b/usr/src/uts/sun4u/io/todds1337.c @@ -67,8 +67,8 @@ static uint_t todds1337_set_watchdog_timer(uint_t); static uint_t todds1337_clear_watchdog_timer(void); static void todds1337_set_power_alarm(timestruc_t); static void todds1337_clear_power_alarm(void); -static int todds1337_setup_prom(); -static void todds1337_rele_prom(); +static int todds1337_setup_prom(void); +static void todds1337_rele_prom(void); static int todds1337_prom_getdate(struct rtc_t *rtc); static int todds1337_prom_setdate(struct rtc_t *rtc); @@ -90,7 +90,7 @@ static ihandle_t todds1337_ihandle = 0; #define I2C_CYCLIC_TIMEOUT 1000000000 uint_t i2c_cyclic_timeout = I2C_CYCLIC_TIMEOUT; static int sync_clock_once = 1; -static struct rtc_t soft_rtc; +static struct rtc_t soft_rtc; /* * cp_ops structure @@ -898,7 +898,7 @@ todds1337_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, * execute the get-time method */ static int -todds1337_setup_prom() +todds1337_setup_prom(void) { pnode_t todnode; char tod1337_devpath[MAXNAMELEN]; @@ -920,7 +920,7 @@ todds1337_setup_prom() /* * Now open the node and store it's ihandle */ - if ((todds1337_ihandle = prom_open(tod1337_devpath)) == NULL) { + if ((todds1337_ihandle = prom_open(tod1337_devpath)) == 0) { cmn_err(CE_WARN, "prom_open failed"); return (DDI_FAILURE); } @@ -932,7 +932,7 @@ todds1337_setup_prom() * Closes the prom interface */ static void -todds1337_rele_prom() +todds1337_rele_prom(void) { (void) prom_close(todds1337_ihandle); } @@ -958,7 +958,7 @@ todds1337_prom_getdate(struct rtc_t *rtc) (void) p1275_cif_handler(&ci); promif_postprom(); - year = p1275_cell2int(ci[6]); + year = p1275_cell2int(ci[6]); rtc->rtc_mon = p1275_cell2int(ci[7]); rtc->rtc_dom = p1275_cell2int(ci[8]); rtc->rtc_dow = 0; diff --git a/usr/src/uts/sun4u/littleneck/Makefile b/usr/src/uts/sun4u/littleneck/Makefile index 134c28b1d8..c6c7ba37e0 100644 --- a/usr/src/uts/sun4u/littleneck/Makefile +++ b/usr/src/uts/sun4u/littleneck/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of all Littleneck system # dependent modules for the sun4u architecture. # @@ -45,12 +43,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,11 +52,9 @@ check := TARGET= check # .KEEP_STATE: -def all clean.lint clean clobber modlist: $(LITTLENECK_KMODS) - -modlintlib: $(LITTLENECK_KMODS) +def all clean clobber modlist: $(LITTLENECK_KMODS) -install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ +install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ $(USR_LITTLENECK_INC_DIR) \ $(USR_LITTLENECK_SBIN_DIR) \ $(USR_LITTLENECK_LIB_DIR) \ @@ -71,18 +63,6 @@ install: $(ROOT_LITTLENECK_DIR) $(USR_LITTLENECK_DIR) \ install_h check: -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(LITTLENECK_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nLittleneck Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(LITTLENECK_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c index 8b0bcd007e..767d2a4f24 100644 --- a/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c +++ b/usr/src/uts/sun4u/littleneck/io/pcf8574_lneck.c @@ -229,18 +229,18 @@ 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); } @@ -249,13 +249,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); @@ -263,16 +263,17 @@ 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); } @@ -280,13 +281,12 @@ pcf8574_set(struct pcf8574_unit *unitp, uchar_t byte) { 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); } @@ -296,7 +296,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)) struct pcf8574_unit *unitp; @@ -306,7 +306,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; @@ -523,7 +523,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/littleneck/os/littleneck.c b/usr/src/uts/sun4u/littleneck/os/littleneck.c index cb299c8117..9a048efc20 100644 --- a/usr/src/uts/sun4u/littleneck/os/littleneck.c +++ b/usr/src/uts/sun4u/littleneck/os/littleneck.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> @@ -51,7 +49,7 @@ int (*p2get_mem_unum)(int, uint64_t, char *, int, int *); void startup_platform(void) { - mutex_init(&lneck_pcf8584_mutex, NULL, NULL, NULL); + mutex_init(&lneck_pcf8584_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int @@ -149,7 +147,7 @@ plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), - buf, buflen, lenp)); + buf, buflen, lenp)); else return (ENOTSUP); } diff --git a/usr/src/uts/sun4u/lw8/io/lw8.c b/usr/src/uts/sun4u/lw8/io/lw8.c index 37703042cb..7daf8a2df3 100644 --- a/usr/src/uts/sun4u/lw8/io/lw8.c +++ b/usr/src/uts/sun4u/lw8/io/lw8.c @@ -163,7 +163,7 @@ static struct modlinkage modlinkage = { struct led_info { char id[MAX_ID_LEN]; int position; - int status; + int status; char color[MAX_COLOR_LEN]; }; @@ -367,7 +367,7 @@ lw8_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) return (DDI_FAILURE); err = ddi_create_minor_node(dip, "lw8", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) return (DDI_FAILURE); diff --git a/usr/src/uts/sun4u/lw8/io/ntwdt.c b/usr/src/uts/sun4u/lw8/io/ntwdt.c index d399486f8d..c2ae0575c9 100644 --- a/usr/src/uts/sun4u/lw8/io/ntwdt.c +++ b/usr/src/uts/sun4u/lw8/io/ntwdt.c @@ -484,7 +484,7 @@ static struct dev_ops ntwdt_ops = { }; static struct modldrv modldrv = { - &mod_driverops, /* This one is a driver */ + &mod_driverops, /* This one is a driver */ "ntwdt-Netra-T12", /* Name of the module. */ &ntwdt_ops, /* Driver ops */ }; @@ -675,7 +675,7 @@ ntwdt_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * is initialized. */ if (ddi_create_minor_node(dip, NTWDT_MINOR_NODE, S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "failed to create Minor Node: %s", NTWDT_MINOR_NODE); goto err4; @@ -1791,8 +1791,8 @@ ntwdt_set_awdt_state(ntwdt_wdog_t *rstatep) static int ntwdt_set_cfgvar(int var, int val) { - int rv; - int mbox_val; + int rv; + int mbox_val; lw8_set_wdt_t set_wdt; switch (var) { diff --git a/usr/src/uts/sun4u/lw8/io/sgenv.c b/usr/src/uts/sun4u/lw8/io/sgenv.c index 7b5971bf57..a9e1de2e43 100644 --- a/usr/src/uts/sun4u/lw8/io/sgenv.c +++ b/usr/src/uts/sun4u/lw8/io/sgenv.c @@ -257,8 +257,8 @@ static boolean_t env_cache_update_needed = B_TRUE; * board_cache won't change between the kstat_update and the kstat_snapshot * which will cause problems as the update sets the ks_data_size. */ -static sg_board_info_t board_cache[SG_MAX_BDS] = {NULL}; -static sg_board_info_t board_cache_snapshot[SG_MAX_BDS] = {NULL}; +static sg_board_info_t board_cache[SG_MAX_BDS] = { 0 }; +static sg_board_info_t board_cache_snapshot[SG_MAX_BDS] = { 0 }; static int board_cache_updated = FALSE; /* @@ -546,7 +546,7 @@ sgenv_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) } err = ddi_create_minor_node(dip, SGENV_DRV_NAME, S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) { sgenv_remove_kstats(softsp); (void) sgenv_remove_cache_update_threads(); @@ -644,7 +644,7 @@ sgenv_add_kstats(sgenv_soft_state_t *softsp) * Create the 'keyswitch position' named kstat. */ ksp = kstat_create(SGENV_DRV_NAME, inst, SG_KEYSWITCH_KSTAT_NAME, - "misc", KSTAT_TYPE_NAMED, 1, NULL); + "misc", KSTAT_TYPE_NAMED, 1, 0); if (ksp != NULL) { /* initialize the named kstat */ @@ -1451,7 +1451,7 @@ sgenv_board_info_kstat_snapshot(kstat_t *ksp, void *buf, int rw) * This function coordinates reading the env data from the SC. * * ERROR: - * If an error occurs while making a call to the mailbox and we have data + * If an error occurs while making a call to the mailbox and we have data * in the cache from a previous call to the SC, we return an error of 0. * That way the kstat framework will return the old data instead of * returning an error and an empty kstat. @@ -2106,7 +2106,7 @@ sgenv_get_env_data(envresp_key_t key, int key_posn, uint16_t flag, int *status) */ static int sgenv_handle_env_data_error(int err, int status, int key_posn, - envresp_key_t key, char *str) + envresp_key_t key, char *str) { int rv = DDI_SUCCESS; diff --git a/usr/src/uts/sun4u/lw8/io/sgfru.c b/usr/src/uts/sun4u/lw8/io/sgfru.c index 431d9bfda7..c3b4a8ad28 100644 --- a/usr/src/uts/sun4u/lw8/io/sgfru.c +++ b/usr/src/uts/sun4u/lw8/io/sgfru.c @@ -186,7 +186,7 @@ sgfru_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) softsp->instance = instance; error = ddi_create_minor_node(dip, SGFRU_DRV_NAME, S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (error == DDI_FAILURE) { ddi_soft_state_free(sgfru_statep, instance); return (DDI_FAILURE); @@ -1525,7 +1525,7 @@ sgfru_copyin_append(const sgfru_init_arg_t *argp, append_info_t *app) */ static int sgfru_copyin_buffer(const sgfru_init_arg_t *argp, const caddr_t data, - const int cnt, char *buffer) + const int cnt, char *buffer) { static fn_t f = "sgfru_copyin_buffer"; diff --git a/usr/src/uts/sun4u/mpxu/Makefile b/usr/src/uts/sun4u/mpxu/Makefile index e7170e8e2d..6014c8761e 100644 --- a/usr/src/uts/sun4u/mpxu/Makefile +++ b/usr/src/uts/sun4u/mpxu/Makefile @@ -45,12 +45,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -58,11 +54,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) - -lintlib: unix - -modlintlib: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) +def all clean clobber modlist: $(MPXU_KMODS) $(CLOSED_MPXU_KMODS) IMPLEMENTED_PLATFORM = SUNW,Sun-Fire-V240 @@ -95,19 +87,6 @@ $(MPXU_CRYPTO_LINKS): $(ROOT_MPXU_CRYPTO_DIR_64) install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) - -lint: modlintlib - -LINT_LIBS = $(LINT_LIB) \ - -L$(MPXU_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nMPXU Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - # # # Include common targets. diff --git a/usr/src/uts/sun4u/mpxu/io/tsalarm.c b/usr/src/uts/sun4u/mpxu/io/tsalarm.c index 7c56f1d63f..819c44a0a6 100644 --- a/usr/src/uts/sun4u/mpxu/io/tsalarm.c +++ b/usr/src/uts/sun4u/mpxu/io/tsalarm.c @@ -211,7 +211,7 @@ tsalarm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * the device's softc, is used to direct peculiar behavior. */ if (ddi_create_minor_node(dip, "lom", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) + DDI_PSEUDO, 0) == DDI_FAILURE) goto attach_failed; ddi_report_dev(dip); @@ -288,7 +288,7 @@ tsalarm_close(dev_t dev, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int tsalarm_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp) + cred_t *credp, int *rvalp) { int inst = getminor(dev); struct tsalarm_softc *softc; diff --git a/usr/src/uts/sun4u/ngdr/io/dr.c b/usr/src/uts/sun4u/ngdr/io/dr.c index e89ea0b05e..73b1528c7e 100644 --- a/usr/src/uts/sun4u/ngdr/io/dr.c +++ b/usr/src/uts/sun4u/ngdr/io/dr.c @@ -556,7 +556,7 @@ int dr_enable = 1; /*ARGSUSED3*/ static int dr_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *cred_p, int *rval_p) + cred_t *cred_p, int *rval_p) { int rv = 0; int instance; @@ -706,7 +706,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) { int rv, rv2; int bd; - int instance; + int instance; sbd_error_t *err; dr_softstate_t *softsp; @@ -768,7 +768,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) minor_num = DR_MAKE_MINOR(instance, bd); rv = ddi_create_minor_node(dip, name, S_IFCHR, - minor_num, DDI_NT_SBD_ATTACHMENT_POINT, NULL); + minor_num, DDI_NT_SBD_ATTACHMENT_POINT, 0); if (rv != DDI_SUCCESS) rv = DDI_FAILURE; } @@ -806,7 +806,7 @@ dr_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) static int dr_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { - int instance; + int instance; dr_softstate_t *softsp; switch (cmd) { @@ -1293,7 +1293,8 @@ dr_test_board(dr_handle_t *hp) * devlists for the board have been initialized. */ static void -dr_make_comp_nodes(dr_board_t *bp) { +dr_make_comp_nodes(dr_board_t *bp) +{ int i; @@ -1580,7 +1581,7 @@ dr_dev_is_target(dr_dev_unit_t *dp, int present_only, uint_t uset) static void dr_dev_make_list(dr_handle_t *hp, sbd_comp_type_t type, int present_only, - dr_common_unit_t ***devlist, int *devnum) + dr_common_unit_t ***devlist, int *devnum) { dr_board_t *bp = hp->h_bd; int unum; @@ -1702,10 +1703,10 @@ dr_dev_clean_up(dr_handle_t *hp, dr_common_unit_t **list, int devnum) static int dr_dev_walk(dr_handle_t *hp, sbd_comp_type_t type, int present_only, - int (*pre_op)(dr_handle_t *, dr_common_unit_t **, int), - void (*op)(dr_handle_t *, dr_common_unit_t *), - int (*post_op)(dr_handle_t *, dr_common_unit_t **, int), - void (*board_op)(dr_handle_t *, dr_common_unit_t **, int)) + int (*pre_op)(dr_handle_t *, dr_common_unit_t **, int), + void (*op)(dr_handle_t *, dr_common_unit_t *), + int (*post_op)(dr_handle_t *, dr_common_unit_t **, int), + void (*board_op)(dr_handle_t *, dr_common_unit_t **, int)) { int devnum, rv; dr_common_unit_t **devlist; @@ -1740,7 +1741,7 @@ dr_dev_noop(dr_handle_t *hp, dr_common_unit_t **devlist, int devnum) static void dr_attach_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { dr_board_t *bp = hp->h_bd; int i; @@ -1841,7 +1842,7 @@ dr_dev_configure(dr_handle_t *hp) static void dr_release_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { _NOTE(ARGUNUSED(devlist)) _NOTE(ARGUNUSED(devnum)) @@ -1965,7 +1966,7 @@ dr_dev_release(dr_handle_t *hp) static void dr_detach_update_state(dr_handle_t *hp, - dr_common_unit_t **devlist, int devnum) + dr_common_unit_t **devlist, int devnum) { dr_board_t *bp = hp->h_bd; int i; @@ -2686,7 +2687,7 @@ dr_nt_to_dev_type(int nt) */ static int dr_check_transition(dr_board_t *bp, dr_devset_t *devsetp, - struct dr_state_trans *transp, int cmd) + struct dr_state_trans *transp, int cmd) { int s, ut; int state_err = 0; diff --git a/usr/src/uts/sun4u/opl/io/dm2s.c b/usr/src/uts/sun4u/opl/io/dm2s.c index 92735d9981..1e6a1f9fc0 100644 --- a/usr/src/uts/sun4u/opl/io/dm2s.c +++ b/usr/src/uts/sun4u/opl/io/dm2s.c @@ -177,8 +177,8 @@ struct streamtab dm2s_streamtab = { NULL }; -DDI_DEFINE_STREAM_OPS(dm2s_ops, nulldev, nulldev, dm2s_attach, \ - dm2s_detach, nodev, dm2s_info, D_NEW | D_MP | D_MTPERMOD, \ +DDI_DEFINE_STREAM_OPS(dm2s_ops, nulldev, nulldev, dm2s_attach, + dm2s_detach, nodev, dm2s_info, D_NEW | D_MP | D_MTPERMOD, &dm2s_streamtab, ddi_quiesce_not_supported); @@ -296,7 +296,7 @@ dm2s_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "%s%d", DM2S_MODNAME, instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); cmn_err(CE_WARN, "Device node creation failed."); goto error; diff --git a/usr/src/uts/sun4u/opl/io/drmach.c b/usr/src/uts/sun4u/opl/io/drmach.c index 0999f18e15..651b60d8ba 100644 --- a/usr/src/uts/sun4u/opl/io/drmach.c +++ b/usr/src/uts/sun4u/opl/io/drmach.c @@ -218,14 +218,14 @@ static int drmach_node_ddi_get_prop(drmach_node_t *np, static int drmach_node_ddi_get_proplen(drmach_node_t *np, char *name, int *len); -static int drmach_get_portid(drmach_node_t *); +static int drmach_get_portid(drmach_node_t *); static sbd_error_t *drmach_i_status(drmachid_t, drmach_status_t *); static int opl_check_dr_status(); static void drmach_io_dispose(drmachid_t); static sbd_error_t *drmach_io_release(drmachid_t); static sbd_error_t *drmach_io_status(drmachid_t, drmach_status_t *); -static int drmach_init(void); -static void drmach_fini(void); +static int drmach_init(void); +static void drmach_fini(void); static void drmach_swap_pa(drmach_mem_t *, drmach_mem_t *); static drmach_board_t *drmach_get_board_by_bnum(int); @@ -457,7 +457,7 @@ struct drmach_hotcpu { drmach_board_t *bp; int bnum; int core_id; - int rv; + int rv; int option; }; @@ -652,7 +652,7 @@ drmach_setup_core_info(drmach_board_t *obj) typedef struct { drmach_node_walk_args_t *nwargs; - int (*cb)(drmach_node_walk_args_t *args); + int (*cb)(drmach_node_walk_args_t *args); int err; } drmach_node_ddi_walk_args_t; @@ -686,7 +686,7 @@ drmach_node_ddi_walk_cb(dev_info_t *dip, void *arg) static int drmach_node_ddi_walk(drmach_node_t *np, void *data, - int (*cb)(drmach_node_walk_args_t *args)) + int (*cb)(drmach_node_walk_args_t *args)) { drmach_node_walk_args_t args; drmach_node_ddi_walk_args_t nargs; @@ -735,7 +735,7 @@ drmach_node_ddi_get_parent(drmach_node_t *np, drmach_node_t *pp) static pnode_t drmach_node_ddi_get_dnode(drmach_node_t *np) { - return ((pnode_t)NULL); + return (0); } static drmach_node_t * @@ -769,7 +769,7 @@ drmach_node_ddi_get_dip(drmach_node_t *np) static int drmach_node_walk(drmach_node_t *np, void *param, - int (*cb)(drmach_node_walk_args_t *args)) + int (*cb)(drmach_node_walk_args_t *args)) { return (np->walk(np, param, cb)); } @@ -977,7 +977,7 @@ drmach_configure(drmachid_t id, int flags) static sbd_error_t * drmach_device_new(drmach_node_t *node, - drmach_board_t *bp, int portid, drmachid_t *idp) + drmach_board_t *bp, int portid, drmachid_t *idp) { int i; int rv; @@ -1541,7 +1541,7 @@ drmach_get_portid(drmach_node_t *np) static int drmach_name2type_idx(char *name) { - int index, ntypes; + int index, ntypes; if (name == NULL) return (-1); @@ -1656,7 +1656,7 @@ drmach_board_find_devices_cb(drmach_node_walk_args_t *args) sbd_error_t * drmach_board_find_devices(drmachid_t id, void *a, - sbd_error_t *(*found)(void *a, const char *, int, drmachid_t)) + sbd_error_t *(*found)(void *a, const char *, int, drmachid_t)) { drmach_board_t *bp = (drmach_board_t *)id; sbd_error_t *err; @@ -2782,7 +2782,7 @@ drmach_cpu_poweron(struct cpu *cp) int drmach_cpu_poweroff(struct cpu *cp) { - int rv = 0; + int rv = 0; processorid_t cpuid = cp->cpu_id; DRMACH_PR("drmach_cpu_poweroff: stopping cpuid %d\n", cp->cpu_id); @@ -2957,7 +2957,7 @@ opl_check_dr_status() static struct memlist * drmach_memlist_add_span(drmach_copy_rename_program_t *p, - struct memlist *mlist, uint64_t base, uint64_t len) + struct memlist *mlist, uint64_t base, uint64_t len) { struct memlist *ml, *tl, *nl; @@ -3072,7 +3072,7 @@ static int fmem_timeout = 17; /* * The empirical data on some OPL system shows that * we can copy 250 MB per second. We set it to - * 80 MB to be conservative. In normal case, + * 80 MB to be conservative. In normal case, * this timeout does not affect anything. */ @@ -3113,7 +3113,7 @@ static int drmach_copy_rename_timeout = 500; static int drmach_copy_rename_prog__relocatable(drmach_copy_rename_program_t *prog, - int cpuid) + int cpuid) { struct memlist *ml; register int rtn; @@ -3412,7 +3412,7 @@ drmach_unlock_critical(caddr_t va) sbd_error_t * drmach_copy_rename_init(drmachid_t t_id, drmachid_t s_id, - struct memlist *c_ml, drmachid_t *pgm_id) + struct memlist *c_ml, drmachid_t *pgm_id) { drmach_mem_t *s_mem; drmach_mem_t *t_mem; @@ -3690,7 +3690,7 @@ drmach_copy_rename_init(drmachid_t t_id, drmachid_t s_id, /* * max_elms - max number of memlist structures that - * may be allocated for the CPU memory list. + * may be allocated for the CPU memory list. * If there are too many memory span (because * of fragmentation) than number of memlist * available, we should return error. @@ -4042,7 +4042,7 @@ drmach_copy_rename(drmachid_t id) prog->critical->scf_reg_base = (*prog->data->scf_get_base_addr)(); if (prog->critical->scf_reg_base == (uint64_t)-1 || - prog->critical->scf_reg_base == NULL) { + prog->critical->scf_reg_base == 0) { prog->data->fmem_status.error = EOPL_FMEM_SCF_ERR; drmach_unlock_critical((caddr_t)prog); return; diff --git a/usr/src/uts/sun4u/opl/io/mc-opl.c b/usr/src/uts/sun4u/opl/io/mc-opl.c index 7d267110da..2ed14e6d22 100644 --- a/usr/src/uts/sun4u/opl/io/mc-opl.c +++ b/usr/src/uts/sun4u/opl/io/mc-opl.c @@ -607,12 +607,12 @@ mc_close(dev_t devp, int flag, int otyp, cred_t *credp) /* ARGSUSED */ static int mc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { mc_flt_page_t flt_page; if (cmd == MCIOC_FAULT_PAGE) { - if (arg == NULL) + if (arg == (intptr_t)NULL) return (EINVAL); if (ddi_copyin((const void *)arg, (void *)&flt_page, @@ -1986,7 +1986,7 @@ mc_error_handler_mir(mc_opl_t *mcp, int bank, mc_rsaddr_info_t *rsaddr) } static int mc_process_error(mc_opl_t *mcp, int bank, mc_aflt_t *mc_aflt, - mc_flt_stat_t *flt_stat) + mc_flt_stat_t *flt_stat) { int ptrl_error = mc_aflt->mflt_is_ptrl; int rv = 0; @@ -2981,7 +2981,7 @@ mc_opl_get_physical_board(int sb) /* ARGSUSED */ int mc_get_mem_unum(int synd_code, uint64_t flt_addr, char *buf, int buflen, - int *lenp) + int *lenp) { int i; int j; @@ -4019,7 +4019,7 @@ mc_dump_dimm_info(board_dimm_info_t *bd_dimmp) /* ARGSUSED */ static int mc_ioctl_debug(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { caddr_t buf, kbuf; uint64_t pa; diff --git a/usr/src/uts/sun4u/opl/io/oplkmdrv.c b/usr/src/uts/sun4u/opl/io/oplkmdrv.c index be026a7c80..c2dfee332c 100644 --- a/usr/src/uts/sun4u/opl/io/oplkmdrv.c +++ b/usr/src/uts/sun4u/opl/io/oplkmdrv.c @@ -241,7 +241,7 @@ okm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) */ okmsp->km_clean |= OKM_CLEAN_NODE; if (ddi_create_minor_node(dip, OKM_NODENAME, S_IFCHR, - instance, NULL, NULL) == DDI_FAILURE) { + instance, NULL, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "Device node creation failed"); okm_cleanup(okmsp); return (DDI_FAILURE); diff --git a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c index 4037644c39..dd1ed50fdb 100644 --- a/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c +++ b/usr/src/uts/sun4u/opl/io/oplmsu/oplmsu.c @@ -660,7 +660,7 @@ oplmsu_close(queue_t *urq, int flag, cred_t *cred_p) cmn_err(CE_WARN, "oplmsu: close: node_flag = 0x%lx", node_flag); } - ctrl->minor = NULL; + ctrl->minor = 0; ctrl->queue = NULL; wbuf_id = ctrl->wbuf_id; wtout_id = ctrl->wtout_id; diff --git a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c index baa214a87e..edc92c1228 100644 --- a/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c +++ b/usr/src/uts/sun4u/opl/io/pcicmu/pcmu_counters.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/async.h> #include <sys/sunddi.h> @@ -56,7 +54,7 @@ pcmu_create_name_kstat(char *name, pcmu_ksinfo_t *pp, pcmu_kev_mask_t *ev) for (i = 0; i < NUM_OF_PICS; i++) { pp->pic_name_ksp[i] = pcmu_create_picN_kstat(name, - i, pp->pic_shift[i], pp->pic_no_evs, ev); + i, pp->pic_shift[i], pp->pic_no_evs, ev); if (pp->pic_name_ksp[i] == NULL) { cmn_err(CE_WARN, "pci: unable to create name kstat"); @@ -85,7 +83,7 @@ pcmu_delete_name_kstat(pcmu_ksinfo_t *pp) */ static kstat_t * pcmu_create_picN_kstat(char *mod_name, int pic, int pic_shift, - int num_ev, pcmu_kev_mask_t *ev_array) + int num_ev, pcmu_kev_mask_t *ev_array) { struct kstat_named *pic_named_data; int inst = 0; @@ -95,9 +93,9 @@ pcmu_create_picN_kstat(char *mod_name, int pic, int pic_shift, (void) sprintf(pic_name, "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, inst, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", - mod_name, pic_name); + mod_name, pic_name); /* * It is up to the calling function to delete any kstats @@ -158,7 +156,7 @@ kstat_t *pcmu_create_cntr_kstat(pcmu_t *pcmu_p, char *name, "counters", "bus", KSTAT_TYPE_NAMED, num_pics + 1, KSTAT_FLAG_WRITABLE)) == NULL) { cmn_err(CE_WARN, "%s%d counters kstat_create failed", - drv_name, drv_instance); + drv_name, drv_instance); return (NULL); } diff --git a/usr/src/uts/sun4u/os/plat_ecc_unum.c b/usr/src/uts/sun4u/os/plat_ecc_unum.c index e13e121086..b7145b5f5b 100644 --- a/usr/src/uts/sun4u/os/plat_ecc_unum.c +++ b/usr/src/uts/sun4u/os/plat_ecc_unum.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/plat_ecc_unum.h> #include <sys/utsname.h> #include <sys/cmn_err.h> @@ -76,7 +74,7 @@ uint16_t ecc_indictment2_mailbox_flags = PLAT_ECC_SEND_INDICT2_DEFAULT; */ void plat_log_fruid_error(int synd_code, struct async_flt *ecc, char *unum, - uint64_t afsr_bit) + uint64_t afsr_bit) { plat_ecc_error_data_t ecc_error_data; enum plat_ecc_type ecc_type = PLAT_ECC_UNKNOWN; @@ -191,7 +189,7 @@ plat_log_fruid_error(int synd_code, struct async_flt *ecc, char *unum, * cpu id. */ ecc_error_data.proc_num = - plat_make_fru_cpuid(board_num, 0, proc_position); + plat_make_fru_cpuid(board_num, 0, proc_position); /* * Now pull out the Memory Bank number @@ -218,7 +216,7 @@ plat_log_fruid_error(int synd_code, struct async_flt *ecc, char *unum, for (i = PLAT_ECC_JNUMBER_LENGTH; i > 0 && *unum_ptr >= '0' && *unum_ptr <= '9'; i--) *jno_ptr++ = *unum_ptr++; - *jno_ptr = NULL; + *jno_ptr = '\0'; /* * If we get here, we can assume the unum is valid @@ -304,7 +302,7 @@ plat_log_fruid_error(int synd_code, struct async_flt *ecc, char *unum, for (i = PLAT_ECC_JNUMBER_LENGTH; i > 0 && *unum_ptr >= '0' && *unum_ptr <= '9'; i--) *jno_ptr++ = *unum_ptr++; - *jno_ptr = NULL; + *jno_ptr = '\0'; /* * If we get here, we can assume the unum is valid diff --git a/usr/src/uts/sun4u/pcie/Makefile b/usr/src/uts/sun4u/pcie/Makefile index b1ad4eb65f..81f4d70472 100644 --- a/usr/src/uts/sun4u/pcie/Makefile +++ b/usr/src/uts/sun4u/pcie/Makefile @@ -42,8 +42,6 @@ UTSBASE = ../.. MODULE = pcie OBJECTS = $(PCIE_MISC_OBJS:%=$(OBJS_DIR)/%) \ $(PCI_STRING_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PCIE_MISC_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(PCI_STRING_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -55,7 +53,6 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,12 +78,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/pic16f747/Makefile b/usr/src/uts/sun4u/pic16f747/Makefile index 530a5790a8..2b3a292a69 100644 --- a/usr/src/uts/sun4u/pic16f747/Makefile +++ b/usr/src/uts/sun4u/pic16f747/Makefile @@ -35,7 +35,6 @@ UTSBASE = ../.. # MODULE = pic16f747 OBJECTS = $(PIC16F747_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PIC16F747_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -50,10 +49,6 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -69,16 +64,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/pic16f819/Makefile b/usr/src/uts/sun4u/pic16f819/Makefile index 2df7ffa19d..cb0b95b4ed 100644 --- a/usr/src/uts/sun4u/pic16f819/Makefile +++ b/usr/src/uts/sun4u/pic16f819/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 pic16f819 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = pic16f819 OBJECTS = $(PIC16F819_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PIC16F819_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/rmc_comm/Makefile b/usr/src/uts/sun4u/rmc_comm/Makefile index ac8785ac2b..4afebe2b65 100644 --- a/usr/src/uts/sun4u/rmc_comm/Makefile +++ b/usr/src/uts/sun4u/rmc_comm/Makefile @@ -23,8 +23,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 production of the rmc_comm driver kernel # module in the sun4u systems # @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = rmc_comm OBJECTS = $(RMC_COMM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(RMC_COMM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4u/io @@ -52,32 +49,14 @@ 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) - -# # 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_SUSPICIOUS_COMPARISON -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED -LINTTAGS += -erroff=E_STATIC_UNUSED -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - -# # Default build targets. # .KEEP_STATE: @@ -90,12 +69,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/rmcadm/Makefile b/usr/src/uts/sun4u/rmcadm/Makefile index baa1fb4883..4ef75a6149 100644 --- a/usr/src/uts/sun4u/rmcadm/Makefile +++ b/usr/src/uts/sun4u/rmcadm/Makefile @@ -23,8 +23,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 production of the rmcadm driver kernel # module in the sun4u systems # @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = rmcadm OBJECTS = $(RMCADM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(RMCADM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4u/io @@ -52,13 +49,8 @@ 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) LDFLAGS += -dy -Ndrv/rmc_comm -Ndrv/pmugpio # @@ -79,12 +71,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/rmclomv/Makefile b/usr/src/uts/sun4u/rmclomv/Makefile index 9d77985ad2..8243155cb6 100644 --- a/usr/src/uts/sun4u/rmclomv/Makefile +++ b/usr/src/uts/sun4u/rmclomv/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = rmclomv OBJECTS = $(RMCLOMV_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(RMCLOMV_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4u/io @@ -52,13 +51,8 @@ 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) LDFLAGS += -dy -Ndrv/rmc_comm -Ndrv/pmugpio # @@ -66,14 +60,6 @@ LDFLAGS += -dy -Ndrv/rmc_comm -Ndrv/pmugpio # 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_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - CERRWARN += -_gcc=-Wno-parentheses # @@ -89,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/sbbc/Makefile b/usr/src/uts/sun4u/sbbc/Makefile index fab5fa1d4b..69d3b24876 100644 --- a/usr/src/uts/sun4u/sbbc/Makefile +++ b/usr/src/uts/sun4u/sbbc/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = sbbc OBJECTS = $(SBBC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(SBBC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -52,30 +51,16 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Turn this on once compiler understands v9 in it's backend #INLINES += $(UTSBASE)/sun4u/io/sbbc.il # -# 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_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV - CERRWARN += -_gcc=-Wno-switch # @@ -91,12 +76,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/seattle/Makefile b/usr/src/uts/sun4u/seattle/Makefile index 5cb4516a06..e9ff071a63 100644 --- a/usr/src/uts/sun4u/seattle/Makefile +++ b/usr/src/uts/sun4u/seattle/Makefile @@ -46,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -59,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(SEATTLE_KMODS) - -modlintlib: $(SEATTLE_KMODS) +def all clean clobber modlist: $(SEATTLE_KMODS) LINKED_PLATFORMS = SUNW,Sun-Fire-V245 @@ -78,24 +72,6 @@ install: $(ROOT_SEATTLE_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the seattle platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/seattle.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(SEATTLE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nSeattle Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(SEATTLE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/seattle/os/seattle.c b/usr/src/uts/sun4u/seattle/os/seattle.c index 50eeb7ca09..80faf2faa3 100644 --- a/usr/src/uts/sun4u/seattle/os/seattle.c +++ b/usr/src/uts/sun4u/seattle/os/seattle.c @@ -52,7 +52,7 @@ int (*rmc_req_now)(rmc_comm_msg_t *, uint8_t) = NULL; void startup_platform(void) { - mutex_init(&mi2cv_mutex, NULL, NULL, NULL); + mutex_init(&mi2cv_mutex, NULL, MUTEX_ADAPTIVE, NULL); } int diff --git a/usr/src/uts/sun4u/serengeti/io/ssm.c b/usr/src/uts/sun4u/serengeti/io/ssm.c index ccd68ed9b5..4e5e74285c 100644 --- a/usr/src/uts/sun4u/serengeti/io/ssm.c +++ b/usr/src/uts/sun4u/serengeti/io/ssm.c @@ -111,7 +111,7 @@ ssm_err_callback(dev_info_t *dip, ddi_fm_error_t *derr, const void *impl_data); */ static int ssm_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc); + ddi_iblock_cookie_t *ibc); /* * init/fini routines to alloc/dealloc fm structures and @@ -585,7 +585,7 @@ init_child(dev_info_t *child) * Requests handled completely: * DDI_CTLOPS_INITCHILD * DDI_CTLOPS_UNINITCHILD - * DDI_CTLOPS_REPORTDEV + * DDI_CTLOPS_REPORTDEV * All others are passed to the parent. * The name of the ssm node is ssm@nodeid,0. * ssm is the equivalent of rootnex. @@ -687,7 +687,7 @@ ssm_make_nodes(dev_info_t *dip, int instance, int ssm_nodeid) minor_num = (instance << SSM_INSTANCE_SHIFT) | bd; rv = ddi_create_minor_node(dip, filename, S_IFCHR, - minor_num, DDI_NT_SBD_ATTACHMENT_POINT, NULL); + minor_num, DDI_NT_SBD_ATTACHMENT_POINT, 0); if (rv == DDI_FAILURE) { cmn_err(CE_WARN, "ssm_make_nodes:%d: failed to create " @@ -798,7 +798,7 @@ ssm_close(dev_t dev, int flags, int otyp, cred_t *credp) /* ARGSUSED */ static int ssm_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { struct ssm_soft_state *softsp; char *addr; @@ -1092,7 +1092,7 @@ ssm_fm_fini(struct ssm_soft_state *softsp) /*ARGSUSED*/ static int ssm_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap, - ddi_iblock_cookie_t *ibc) + ddi_iblock_cookie_t *ibc) { struct ssm_soft_state *softsp = ddi_get_soft_state(ssm_softstates, ddi_get_instance(dip)); diff --git a/usr/src/uts/sun4u/ssc050/Makefile b/usr/src/uts/sun4u/ssc050/Makefile index 13bfe470b6..7701b0cef3 100644 --- a/usr/src/uts/sun4u/ssc050/Makefile +++ b/usr/src/uts/sun4u/ssc050/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 ssc050 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = ssc050 OBJECTS = $(SSC050_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(SSC050_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/ssc100/Makefile b/usr/src/uts/sun4u/ssc100/Makefile index 579f19a910..f42fdb1b17 100644 --- a/usr/src/uts/sun4u/ssc100/Makefile +++ b/usr/src/uts/sun4u/ssc100/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 ssc100 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -37,7 +33,6 @@ UTSBASE = ../.. # MODULE = ssc100 OBJECTS = $(SSC100_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(SSC100_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/sunfire/Makefile b/usr/src/uts/sun4u/sunfire/Makefile index ee5e425567..d3d0cfc768 100644 --- a/usr/src/uts/sun4u/sunfire/Makefile +++ b/usr/src/uts/sun4u/sunfire/Makefile @@ -23,8 +23,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 production of the sun4u sunfire platform # module. # @@ -47,12 +45,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -60,11 +54,9 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: \ +def all clean clobber modlist: \ $(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS) -modlintlib: $(SUNFIRE_KMODS) $(CLOSED_SUNFIRE_KMODS) - IMPLEMENTED_PLATFORM = SUNW,Ultra-Enterprise install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \ @@ -76,24 +68,6 @@ install: $(ROOT_SUNFIRE_DIR) $(USR_SUNFIRE_DIR) \ install_h check: FRC @cd sys; pwd; $(MAKE) $(TARGET) -lint: modlintlib - -# -# The 'lint.platmod' target lints the sunfire platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/sunfire.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(SUNFIRE_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nSunfire Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(SUNFIRE_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/sunfire/io/ac.c b/usr/src/uts/sun4u/sunfire/io/ac.c index c19cad9264..19cf822093 100644 --- a/usr/src/uts/sun4u/sunfire/io/ac.c +++ b/usr/src/uts/sun4u/sunfire/io/ac.c @@ -905,8 +905,8 @@ ac_add_picN_kstats(dev_info_t *dip) }; struct kstat_named *ac_pic_named_data; - int event, pic; - char pic_name[30]; + int event, pic; + char pic_name[30]; int instance = ddi_get_instance(dip); int pic_shift = 0; @@ -918,7 +918,7 @@ ac_add_picN_kstats(dev_info_t *dip) (void) sprintf(pic_name, "pic%d", pic); /* pic0, pic1 ... */ if ((ac_picN_ksp[pic] = kstat_create("ac", instance, pic_name, "bus", KSTAT_TYPE_NAMED, - AC_NUM_EVENTS + 1, NULL)) == NULL) { + AC_NUM_EVENTS + 1, 0)) == NULL) { cmn_err(CE_WARN, "ac %s: kstat_create failed", pic_name); diff --git a/usr/src/uts/sun4u/sunfire/io/fhc.c b/usr/src/uts/sun4u/sunfire/io/fhc.c index d47130bddc..d89eb3dfb5 100644 --- a/usr/src/uts/sun4u/sunfire/io/fhc.c +++ b/usr/src/uts/sun4u/sunfire/io/fhc.c @@ -245,7 +245,7 @@ short clk_danger_temp = 68; /* Clock Board Danger Temperature */ short dft_warn_temp = 60; /* default warning temp value */ short dft_danger_temp = 68; /* default danger temp value */ -short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */ +short cpu_warn_temp_4x = 60; /* CPU/Memory warning temp for 400 MHZ */ short cpu_danger_temp_4x = 68; /* CPU/Memory danger temp for 400 MHZ */ /* @@ -398,7 +398,7 @@ static struct cb_ops fhc_cb_ops = { nulldev, /* dump */ nulldev, /* read */ nulldev, /* write */ - nulldev, /* ioctl */ + nulldev, /* ioctl */ nodev, /* devmap */ nodev, /* mmap */ nodev, /* segmap */ @@ -1321,7 +1321,7 @@ done: */ static void fhc_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip, - ddi_intr_handle_impl_t *hdlp) + ddi_intr_handle_impl_t *hdlp) { volatile uint_t *mondo_vec_reg; volatile uint_t tmpreg; @@ -1490,7 +1490,7 @@ fhc_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op, */ static int fhc_ctlops(dev_info_t *dip, dev_info_t *rdip, - ddi_ctl_enum_t op, void *arg, void *result) + ddi_ctl_enum_t op, void *arg, void *result) { switch (op) { @@ -1529,7 +1529,6 @@ fhc_ctlops(dev_info_t *dip, dev_info_t *rdip, /* ARGSUSED */ static void fhc_xlate_intrs(ddi_intr_handle_impl_t *hdlp, uint32_t ign) - { uint32_t mondo; @@ -2384,8 +2383,8 @@ cpu_on_board(int board) int upa_a = board << 1; int upa_b = (board << 1) + 1; - if ((cpunodes[upa_a].nodeid != NULL) || - (cpunodes[upa_b].nodeid != NULL)) { + if ((cpunodes[upa_a].nodeid != 0) || + (cpunodes[upa_b].nodeid != 0)) { return (1); } else { return (0); @@ -3385,7 +3384,7 @@ fhc_cpu_poweron(struct cpu *cp) static void os_completes_shutdown(void) { - pfn_t pfn; + pfn_t pfn; tte_t tte; volatile uint_t *src; volatile uint_t *dst; diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl.c b/usr/src/uts/sun4u/sunfire/io/sysctrl.c index 206829b2a2..16ae450198 100644 --- a/usr/src/uts/sun4u/sunfire/io/sysctrl.c +++ b/usr/src/uts/sun4u/sunfire/io/sysctrl.c @@ -806,7 +806,7 @@ sysctrl_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) * perform initialization to allow setting of powerfail-time */ if ((dip = ddi_find_devinfo("options", -1, 0)) == NULL) - softsp->options_nodeid = (pnode_t)NULL; + softsp->options_nodeid = (pnode_t)0; else softsp->options_nodeid = (pnode_t)ddi_get_nodeid(dip); @@ -1218,7 +1218,7 @@ sysc_pkt_fini(sysc_cfga_pkt_t *pkt, intptr_t arg, int flag) /* ARGSUSED */ static int sysctrl_ioctl(dev_t devt, int cmd, intptr_t arg, int flag, cred_t *cred_p, - int *rval_p) + int *rval_p) { struct sysctrl_soft_state *softsp; sysc_cfga_pkt_t sysc_pkt; diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c index b9b091f759..86f576bf22 100644 --- a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c +++ b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c @@ -576,7 +576,7 @@ sysctrl_resume(sysc_cfga_pkt_t *pkt) */ if (sysc_watchdog_suspended) { mutex_enter(&tod_lock); - tod_ops.tod_set_watchdog_timer( + (void) tod_ops.tod_set_watchdog_timer( watchdog_timeout_seconds); mutex_exit(&tod_lock); } @@ -731,7 +731,7 @@ sysctrl_suspend(sysc_cfga_pkt_t *pkt) */ if (watchdog_activated) { mutex_enter(&tod_lock); - tod_ops.tod_clear_watchdog_timer(); + (void) tod_ops.tod_clear_watchdog_timer(); mutex_exit(&tod_lock); sysc_watchdog_suspended = 1; } else { diff --git a/usr/src/uts/sun4u/tazmo/Makefile b/usr/src/uts/sun4u/tazmo/Makefile index 1f69f760e9..53480d8bb5 100644 --- a/usr/src/uts/sun4u/tazmo/Makefile +++ b/usr/src/uts/sun4u/tazmo/Makefile @@ -24,8 +24,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sun4u tazmo platform # module. # @@ -48,12 +46,8 @@ install := TARGET= install install_h := TARGET= install_h clean := TARGET= clean clobber := TARGET= clobber -lint := TARGET= lint -lintlib := TARGET= lintlib -modlintlib := TARGET= modlintlib modlist := TARGET= modlist modlist := NO_STATE= -K $$MODSTATE$$$$ -clean.lint := TARGET= clean.lint check := TARGET= check # @@ -61,9 +55,7 @@ check := TARGET= check # .KEEP_STATE: -def all clean clean.lint clobber modlist: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) - -modlintlib: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) +def all clean clobber modlist: $(TAZMO_KMODS) $(CLOSED_TAZMO_KMODS) install: $(ROOT_TAZMO_DIR) $(USR_TAZMO_DIR) \ $(USR_TAZMO_INC_DIR) \ @@ -73,24 +65,6 @@ install: $(ROOT_TAZMO_DIR) $(USR_TAZMO_DIR) \ check install_h: -lint: modlintlib - -# -# The 'lint.platmod' target lints the tazmo platform module against the sun4u -# kernel. This ends up doing all the kernel cross-checks, so it takes a couple -# of minutes. Due to the low ROI, it's not run by default, but it's a good -# idea to run this if you change os/tazmo.c. -# -LINT_LIBS = $(LINT_LIB) \ - -L$(TAZMO_LINT_LIB_DIR) \ - -L$(LINT_LIB_DIR) $(LINT_KMODS:%=-l%) \ - $(CLOSED_LINT_KMODS:%=-l%) \ - -L$(SPARC_LIB_DIR) $(SPARC_LINTS:%=-l%) - -lint.platmod: modlintlib - @-$(ECHO) "\nTazmo Platform-dependent module: global crosschecks:" - @-$(LINT) $(LINTFLAGS) $(LINT_LIBS) 2>&1 | $(LGREP.2) - $(TAZMO_KMODS): FRC @cd $@; pwd; $(MAKE) $(NO_STATE) $(TARGET) diff --git a/usr/src/uts/sun4u/tazmo/io/envctrl.c b/usr/src/uts/sun4u/tazmo/io/envctrl.c index 40e7f6532b..30c3e93feb 100644 --- a/usr/src/uts/sun4u/tazmo/io/envctrl.c +++ b/usr/src/uts/sun4u/tazmo/io/envctrl.c @@ -59,13 +59,13 @@ #include <sys/envctrl.h> /* Environment header */ /* driver entry point fn definitions */ -static int envctrl_open(queue_t *, dev_t *, int, int, cred_t *); +static int envctrl_open(queue_t *, dev_t *, int, int, cred_t *); static int envctrl_close(queue_t *, int, cred_t *); -static uint_t envctrl_bus_isr(caddr_t); -static uint_t envctrl_dev_isr(caddr_t); +static uint_t envctrl_bus_isr(caddr_t); +static uint_t envctrl_dev_isr(caddr_t); /* configuration entry point fn definitions */ -static int envctrl_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); +static int envctrl_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); static int envctrl_attach(dev_info_t *, ddi_attach_cmd_t); static int envctrl_detach(dev_info_t *, ddi_detach_cmd_t); @@ -141,7 +141,7 @@ static int controller_present[] = {-1, -1, -1}; #ifdef MULTIFAN static int envctrl_fan_debug = 0; #endif -static int eHc_debug = 0; +static int eHc_debug = 0; static int power_supply_previous_state[] = {-1, -1, -1}; extern void pci_thermal_rem_intr(dev_info_t *, uint_t); @@ -274,12 +274,12 @@ static struct modlinkage envctrlmodlinkage = { #define EHC_DEV3 0x06 #define EHC_DEV4 0x08 #define EHC_DEV5 0x0A -#define EHC_DEV6 0x0C +#define EHC_DEV6 0x0C #define EHC_DEV7 0x0E /* - * CONTROL OF CHIP + * CONTROL OF CHIP * PCF8591 Temp sensing control register definitions * * 7 6 5 4 3 2 1 0 @@ -520,7 +520,7 @@ envctrl_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) (void) sprintf(name, "envctrl%d", instance); if (ddi_create_minor_node(dip, name, S_IFCHR, instance, DDI_PSEUDO, - NULL) == DDI_FAILURE) { + 0) == DDI_FAILURE) { ddi_remove_minor_node(dip, NULL); goto remhardintr1; } @@ -1449,7 +1449,7 @@ envctrl_init_bus(struct envctrlunit *unitp) { int i; - uint8_t noval = NULL; + uint8_t noval = 0; struct envctrl_tda8444t_chip fan; int fans[] = {ENVCTRL_CPU_FANS, ENVCTRL_PS_FANS, ENVCTRL_AFB_FANS}; @@ -1890,7 +1890,7 @@ envctrl_get_lm75_temp(struct envctrlunit *unitp) } else { k = lmval /2; } - return (k); + return (k); } @@ -1975,7 +1975,7 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) int i; struct envctrl_tda8444t_chip fan; uint8_t psaddr[] = {PSTEMP3, PSTEMP2, PSTEMP1, PSTEMP0}; - uint8_t noval = NULL; + uint8_t noval = 0; uint8_t fspval; ASSERT(MUTEX_HELD(&unitp->umutex)); @@ -2050,11 +2050,11 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) unitp->current_mode == ENVCTRL_NORMAL_MODE) { unitp->shutdown = B_TRUE; } - if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { - cmn_err(CE_WARN, - "Ambient Temperature is %d C, shutdown now\n", - ambtemp); - } + if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { + cmn_err(CE_WARN, + "Ambient Temperature is %d C, shutdown now\n", + ambtemp); + } } else { if (envctrl_isother_fault_led(unitp, fspval, ENVCTRL_FSP_TEMP_ERR)) { @@ -2106,16 +2106,16 @@ envctrl_get_sys_temperatures(struct envctrlunit *unitp, uint8_t *diag_tempr) } if (temperature < 0) { - fan.val = MAX_FAN_SPEED; /* blast it is out of range */ + fan.val = MAX_FAN_SPEED; /* blast it is out of range */ } else if (temperature > MAX_AMB_TEMP) { fan.val = MAX_FAN_SPEED; fspval |= (ENVCTRL_FSP_TEMP_ERR | ENVCTRL_FSP_GEN_ERR); - if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { - cmn_err(CE_WARN, - "CPU Fans set to MAX. CPU Temp is %d C\n", - hicputemp); - } + if (unitp->current_mode == ENVCTRL_NORMAL_MODE) { + cmn_err(CE_WARN, + "CPU Fans set to MAX. CPU Temp is %d C\n", + hicputemp); + } } else if (ambtemp < MAX_AMB_TEMP) { if (!envctrl_p0_enclosure) { fan.val = acme_cpu_fanspd[temperature]; @@ -3635,7 +3635,7 @@ eHc_after_read_pcf8584(struct eHc_envcunit *ehcp, uint8_t *data) */ static int eHc_write_tda8444(struct eHc_envcunit *ehcp, int byteaddress, int instruction, - int subaddress, uint8_t *buf, int size) + int subaddress, uint8_t *buf, int size) { uint8_t control; int i, status; @@ -3687,7 +3687,7 @@ eHc_write_tda8444(struct eHc_envcunit *ehcp, int byteaddress, int instruction, */ static int eHc_read_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3742,7 +3742,7 @@ eHc_read_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3789,7 +3789,7 @@ eHc_write_pcf8574a(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3844,7 +3844,7 @@ eHc_read_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3890,7 +3890,7 @@ eHc_write_pcf8574(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_lm75(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3944,7 +3944,7 @@ eHc_read_lm75(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_write_pcf8583(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, - int size) + int size) { int i; int status; @@ -3988,7 +3988,7 @@ eHc_write_pcf8583(struct eHc_envcunit *ehcp, int byteaddress, uint8_t *buf, */ static int eHc_read_pcf8591(struct eHc_envcunit *ehcp, int byteaddress, int channel, - int autoinc, int amode, int aenable, uint8_t *buf, int size) + int autoinc, int amode, int aenable, uint8_t *buf, int size) { int i; int status; diff --git a/usr/src/uts/sun4u/todds1287/Makefile b/usr/src/uts/sun4u/todds1287/Makefile index ee0d883bc9..df904ac01e 100644 --- a/usr/src/uts/sun4u/todds1287/Makefile +++ b/usr/src/uts/sun4u/todds1287/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = todds1287 OBJECTS = $(TODDS1287_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TODDS1287_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_TOD_DIR)/$(MODULE) # @@ -52,21 +51,8 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # 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 - CERRWARN += $(CNOWARN_UNINIT) # @@ -82,16 +68,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4u/todds1337/Makefile b/usr/src/uts/sun4u/todds1337/Makefile index 4e7ebf7363..3d068d04a7 100644 --- a/usr/src/uts/sun4u/todds1337/Makefile +++ b/usr/src/uts/sun4u/todds1337/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 production of todds1337 kernel module. # # sun4u implementation architecture dependent @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = todds1337 OBJECTS = $(TODDS1337_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TODDS1337_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_TOD_DIR)/$(MODULE) # @@ -51,24 +48,11 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# 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_ASSIGN_NARROW_CONV - -# # Default build targets. # .KEEP_STATE: @@ -81,16 +65,9 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # # Include common targets. # include $(UTSBASE)/sun4u/Makefile.targ - diff --git a/usr/src/uts/sun4v/cpu/niagara_perfctr.c b/usr/src/uts/sun4v/cpu/niagara_perfctr.c index d32191727b..9e70093f7a 100644 --- a/usr/src/uts/sun4v/cpu/niagara_perfctr.c +++ b/usr/src/uts/sun4v/cpu/niagara_perfctr.c @@ -598,7 +598,7 @@ ni_delete_name_kstat(ni_ksinfo_t *pp) */ static kstat_t * ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, - int num_ev, ni_kev_mask_t *ev_array) + int num_ev, ni_kev_mask_t *ev_array) { struct kstat_named *pic_named_data; int inst = 0; @@ -608,7 +608,7 @@ ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, (void) sprintf(pic_name, "pic%d", pic); if ((picN_ksp = kstat_create(mod_name, inst, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); @@ -656,7 +656,7 @@ ni_create_picN_kstat(char *mod_name, int pic, int pic_sel_shift, */ static kstat_t * ni_create_cntr_kstat(char *name, int instance, int (*update)(kstat_t *, int), - void *ksinfop) + void *ksinfop) { struct kstat *counters_ksp; struct kstat_named *counters_named_data; diff --git a/usr/src/uts/sun4v/dr_cpu/Makefile b/usr/src/uts/sun4v/dr_cpu/Makefile index f4a96fa25a..2a2800ea37 100644 --- a/usr/src/uts/sun4v/dr_cpu/Makefile +++ b/usr/src/uts/sun4v/dr_cpu/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -36,7 +34,6 @@ UTSBASE = ../.. # MODULE = dr_cpu OBJECTS = $(DR_CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DR_CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -48,15 +45,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # 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 @@ -79,12 +70,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/dr_mem/Makefile b/usr/src/uts/sun4v/dr_mem/Makefile index f55ea3ef6b..3f8233df47 100644 --- a/usr/src/uts/sun4v/dr_mem/Makefile +++ b/usr/src/uts/sun4v/dr_mem/Makefile @@ -34,7 +34,6 @@ UTSBASE = ../.. # MODULE = dr_mem OBJECTS = $(DR_MEM_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DR_MEM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -46,13 +45,8 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-parentheses # @@ -78,12 +72,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/ds/Makefile b/usr/src/uts/sun4v/ds/Makefile index ed43f2f58e..f119b7138f 100644 --- a/usr/src/uts/sun4v/ds/Makefile +++ b/usr/src/uts/sun4v/ds/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = ds OBJECTS = $(DS_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(DS_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -52,15 +51,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # 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 @@ -70,13 +63,6 @@ CFLAGS += -dalign # LDFLAGS += -dy -Nmisc/ldc -# -# 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 - CERRWARN += $(CNOWARN_UNINIT) # @@ -92,12 +78,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/glvc/Makefile b/usr/src/uts/sun4v/glvc/Makefile index 997f92cef7..5d44984f49 100644 --- a/usr/src/uts/sun4v/glvc/Makefile +++ b/usr/src/uts/sun4v/glvc/Makefile @@ -22,9 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# This makefile drives the production of the virtual channel driver +# This makefile drives the production of the virtual channel driver # kernel module. # # sun4v implementation architecture dependent @@ -38,9 +36,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = glvc +MODULE = glvc OBJECTS = $(GLVC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(GLVC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -59,24 +56,9 @@ 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_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - -# # Default build targets. # .KEEP_STATE: @@ -89,12 +71,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/io/dr_cpu.c b/usr/src/uts/sun4v/io/dr_cpu.c index f2cfbb5873..e980cb55de 100644 --- a/usr/src/uts/sun4v/io/dr_cpu.c +++ b/usr/src/uts/sun4v/io/dr_cpu.c @@ -583,7 +583,7 @@ dr_cpu_res_array_init(dr_cpu_hdr_t *req, drctl_rsrc_t *rsrc, int nrsrc) * on the memory allocated for the message buffer * itself. */ - if (rsrc[idx].offset != NULL) { + if (rsrc[idx].offset != 0) { err_str = (char *)rsrc + rsrc[idx].offset; err_len = strlen(err_str) + 1; diff --git a/usr/src/uts/sun4v/io/dr_mem.c b/usr/src/uts/sun4v/io/dr_mem.c index c9695e7c6f..2443f4d550 100644 --- a/usr/src/uts/sun4v/io/dr_mem.c +++ b/usr/src/uts/sun4v/io/dr_mem.c @@ -611,7 +611,7 @@ dr_mem_res_array_init(dr_mem_hdr_t *req, drctl_rsrc_t *rsrc, int nrsrc) * on the memory allocated for the message buffer * itself. */ - if (rsrc[idx].offset != NULL) { + if (rsrc[idx].offset != 0) { err_str = (char *)rsrc + rsrc[idx].offset; err_len = strlen(err_str) + 1; @@ -768,7 +768,7 @@ dr_mem_list_query(dr_mem_hdr_t *req, dr_mem_hdr_t **resp, int *resp_len) /* allocate a response message, should be freed by caller */ nml = 0; rlen = sizeof (dr_mem_hdr_t); - if (req_mblks->addr == NULL && req_mblks->size == 0) { + if (req_mblks->addr == 0 && req_mblks->size == 0) { /* * Request is for domain's full view of it's memory. * place a copy in phys_copy then release the memlist lock. @@ -926,8 +926,8 @@ dr_mem_unconfigure(dr_mem_blk_t *mbp, int *status) if (!MBLK_IS_VALID(mbp)) { DR_DBG_MEM("invalid mblk 0x%lx.0x%lx\n", mbp->addr, mbp->size); - *status = DR_MEM_STAT_CONFIGURED; - rv = DR_MEM_RES_EINVAL; + *status = DR_MEM_STAT_CONFIGURED; + rv = DR_MEM_RES_EINVAL; } else if (rv = mem_del(btop(mbp->addr), btop(mbp->size))) { *status = DR_MEM_STAT_CONFIGURED; } else { diff --git a/usr/src/uts/sun4v/io/ds_common.c b/usr/src/uts/sun4v/io/ds_common.c index 54876ac3bc..fad3014d2b 100644 --- a/usr/src/uts/sun4v/io/ds_common.c +++ b/usr/src/uts/sun4v/io/ds_common.c @@ -431,7 +431,7 @@ ds_ldc_fini(ds_port_t *port) } port->ldc.id = (uint64_t)-1; - port->ldc.hdl = NULL; + port->ldc.hdl = 0; port->ldc.state = 0; return (rv); @@ -2492,7 +2492,7 @@ ds_ucap_init(ds_capability_t *cap, ds_clnt_ops_t *ops, uint32_t flags, ds_vers_check_t status; ds_svc_t *svc; int rv = 0; - ds_svc_hdl_t lb_hdl, hdl; + ds_svc_hdl_t lb_hdl, hdl; int is_loopback; int is_client; diff --git a/usr/src/uts/sun4v/io/ds_drv.c b/usr/src/uts/sun4v/io/ds_drv.c index 2b2ba29e52..b812999005 100644 --- a/usr/src/uts/sun4v/io/ds_drv.c +++ b/usr/src/uts/sun4v/io/ds_drv.c @@ -493,8 +493,6 @@ static ds_log_entry_t ds_log_entry_pool[DS_LOG_NPOOL]; static void ds_log_init(void) { - ds_log_entry_t *new; - /* initialize global lock */ mutex_init(&ds_log.lock, NULL, MUTEX_DRIVER, NULL); @@ -506,9 +504,9 @@ ds_log_init(void) ds_log.nentry = 0; /* initialize the free list */ - for (new = ds_log_entry_pool; new < DS_LOG_POOL_END; new++) { - new->next = ds_log.freelist; - ds_log.freelist = new; + for (int i = 0; i < DS_LOG_NPOOL; i++) { + ds_log_entry_pool[i].next = ds_log.freelist; + ds_log.freelist = &ds_log_entry_pool[i]; } mutex_exit(&ds_log.lock); diff --git a/usr/src/uts/sun4v/io/glvc/glvc.c b/usr/src/uts/sun4v/io/glvc/glvc.c index 8c151416aa..77dd8c60f3 100644 --- a/usr/src/uts/sun4v/io/glvc/glvc.c +++ b/usr/src/uts/sun4v/io/glvc/glvc.c @@ -254,7 +254,7 @@ glvc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) { int instance; int err; - glvc_soft_state_t *softsp; + glvc_soft_state_t *softsp; switch (cmd) { case DDI_ATTACH: @@ -338,7 +338,7 @@ glvc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) va_to_pa((caddr_t)softsp->mb_send_buf); err = ddi_create_minor_node(dip, "glvc", S_IFCHR, - instance, DDI_PSEUDO, NULL); + instance, DDI_PSEUDO, 0); if (err != DDI_SUCCESS) { kmem_free(softsp->mb_recv_buf, softsp->mtu); kmem_free(softsp->mb_send_buf, softsp->mtu); @@ -412,7 +412,7 @@ glvc_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { int instance; int err; - glvc_soft_state_t *softsp; + glvc_soft_state_t *softsp; switch (cmd) { diff --git a/usr/src/uts/sun4v/io/iospc/iospc.c b/usr/src/uts/sun4v/io/iospc/iospc.c index 47efae480c..8ca72c2539 100644 --- a/usr/src/uts/sun4v/io/iospc/iospc.c +++ b/usr/src/uts/sun4v/io/iospc/iospc.c @@ -377,7 +377,7 @@ iospc_create_picN_kstat(char *mod_name, int pic, uint64_t ev_offset, (void) snprintf(pic_name, PIC_STR_LEN, "pic%1d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { return (NULL); } @@ -467,7 +467,7 @@ iospc_create_cntr_kstat(char *name, int dev_inst, */ static int iospc_perfcnt_program(iospc_t *iospc_p, iospc_grp_t *grp_p, - iospc_ksinfo_t *ksinfo_p, uint64_t new_events) + iospc_ksinfo_t *ksinfo_p, uint64_t new_events) { uint64_t old_events; int rval = SUCCESS; diff --git a/usr/src/uts/sun4v/io/ldc.c b/usr/src/uts/sun4v/io/ldc.c index 939c260834..0b2b94d173 100644 --- a/usr/src/uts/sun4v/io/ldc.c +++ b/usr/src/uts/sun4v/io/ldc.c @@ -288,18 +288,6 @@ ldc_inject_error(ldc_chan_t *ldcp, uint64_t error) return (B_TRUE); } -#define D1 \ -if (ldcdbg & 0x01) \ - ldcdebug - -#define D2 \ -if (ldcdbg & 0x02) \ - ldcdebug - -#define DWARN \ -if (ldcdbg & 0x04) \ - ldcdebug - #define DUMP_PAYLOAD(id, addr) \ { \ char buf[65*3]; \ @@ -321,10 +309,10 @@ if (ldcdbg & 0x04) \ (msg->env & LDC_FRAG_START) ? 'B' : ' ', \ (msg->env & LDC_FRAG_STOP) ? 'E' : ' ', \ (msg->env & LDC_LEN_MASK)); \ - } else { \ + } else { \ D2((c)->id, "%s: msg%d (/%x/%x/%x/,env=%x)", (s), \ mid, msg->type, msg->stype, msg->ctrl, msg->env); \ - } \ + } \ } #define LDC_INJECT_RESET(_ldcp) ldc_inject_error(_ldcp, LDC_ERR_RESET) @@ -337,10 +325,6 @@ extern void i_ldc_mem_inject_dring_clear(ldc_chan_t *ldcp); #define DBG_ALL_LDCS -1 -#define D1 -#define D2 -#define DWARN - #define DUMP_PAYLOAD(id, addr) #define DUMP_LDC_PKT(c, s, addr) @@ -461,10 +445,10 @@ _info(struct modinfo *modinfop) int _fini(void) { - int rv, status; - ldc_chan_t *tmp_ldcp, *ldcp; - ldc_dring_t *tmp_dringp, *dringp; - ldc_mem_info_t minfo; + int rv, status; + ldc_chan_t *tmp_ldcp, *ldcp; + ldc_dring_t *tmp_dringp, *dringp; + ldc_mem_info_t minfo; /* Unlink the driver module from the system */ status = mod_remove(&ml); @@ -564,7 +548,7 @@ i_ldc_h2v_error(int h_error) case H_ENOTSUPPORTED: return (ENOTSUP); - case H_ETOOMANY: + case H_ETOOMANY: return (ENOSPC); case H_ECHANNEL: @@ -809,8 +793,8 @@ i_ldc_clear_intr(ldc_chan_t *ldcp, cnex_intrtype_t itype) static int i_ldc_set_rx_head(ldc_chan_t *ldcp, uint64_t head) { - int rv; - int retries; + int rv; + int retries; ASSERT(MUTEX_HELD(&ldcp->lock)); for (retries = 0; retries < ldc_max_retries; retries++) { @@ -840,7 +824,7 @@ i_ldc_set_rx_head(ldc_chan_t *ldcp, uint64_t head) static void i_ldc_get_tx_head(ldc_chan_t *ldcp, uint64_t *head) { - ldc_msg_t *pkt; + ldc_msg_t *pkt; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); @@ -876,8 +860,8 @@ i_ldc_get_tx_head(ldc_chan_t *ldcp, uint64_t *head) static int i_ldc_get_tx_tail(ldc_chan_t *ldcp, uint64_t *tail) { - int rv; - uint64_t current_head, new_tail; + int rv; + uint64_t current_head, new_tail; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); /* Read the head and tail ptrs from HV */ @@ -924,7 +908,7 @@ static int i_ldc_set_tx_tail(ldc_chan_t *ldcp, uint64_t tail) { int rv, retval = EWOULDBLOCK; - int retries; + int retries; ASSERT(MUTEX_HELD(&ldcp->tx_lock)); for (retries = 0; retries < ldc_max_retries; retries++) { @@ -1131,7 +1115,7 @@ i_ldc_send_pkt(ldc_chan_t *ldcp, uint8_t pkttype, uint8_t subtype, uint8_t ctrlmsg) { int rv; - ldc_msg_t *pkt; + ldc_msg_t *pkt; uint64_t tx_tail; uint32_t curr_seqid; @@ -1236,8 +1220,8 @@ i_ldc_check_seqid(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_VER(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0, idx = ldcp->next_vidx; - ldc_msg_t *pkt; + int rv = 0, idx = ldcp->next_vidx; + ldc_msg_t *pkt; uint64_t tx_tail; ldc_ver_t *rcvd_ver; @@ -1533,8 +1517,8 @@ i_ldc_process_VER(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_RTS(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; - ldc_msg_t *pkt; + int rv = 0; + ldc_msg_t *pkt; uint64_t tx_tail; boolean_t sent_NACK = B_FALSE; @@ -1660,7 +1644,7 @@ i_ldc_process_RTS(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_process_RTR(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; + int rv = 0; boolean_t sent_NACK = B_FALSE; D2(ldcp->id, "i_ldc_process_RTR: (0x%llx) received RTR\n", ldcp->id); @@ -1824,7 +1808,7 @@ static int i_ldc_process_data_ACK(ldc_chan_t *ldcp, ldc_msg_t *msg) { int rv; - uint64_t tx_head; + uint64_t tx_head; ldc_msg_t *pkt; /* Obtain Tx lock */ @@ -1892,7 +1876,7 @@ i_ldc_process_data_ACK(ldc_chan_t *ldcp, ldc_msg_t *msg) static int i_ldc_ctrlmsg(ldc_chan_t *ldcp, ldc_msg_t *msg) { - int rv = 0; + int rv = 0; D1(ldcp->id, "i_ldc_ctrlmsg: (%llx) tstate = %lx, hstate = %lx\n", ldcp->id, ldcp->tstate, ldcp->hstate); @@ -2102,9 +2086,9 @@ i_ldc_tx_hdlr(caddr_t arg1, caddr_t arg2) { _NOTE(ARGUNUSED(arg2)) - int rv; - ldc_chan_t *ldcp; - boolean_t notify_client = B_FALSE; + int rv; + ldc_chan_t *ldcp; + boolean_t notify_client = B_FALSE; uint64_t notify_event = 0, link_state; /* Get the channel for which interrupt was received */ @@ -2227,8 +2211,8 @@ i_ldc_rx_process_hvq(ldc_chan_t *ldcp, boolean_t *notify_client, uint64_t *notify_event) { int rv; - uint64_t rx_head, rx_tail; - ldc_msg_t *msg; + uint64_t rx_head, rx_tail; + ldc_msg_t *msg; uint64_t link_state, first_fragment = 0; boolean_t trace_length = B_TRUE; @@ -2580,7 +2564,7 @@ i_ldc_rx_ackpeek(ldc_chan_t *ldcp, uint64_t rx_head, uint64_t rx_tail) int ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; int rv, exit_val; uint64_t ra_base, nentries; uint64_t qlen; @@ -2728,7 +2712,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) /* Create a transmit queue */ ldcp->tx_q_va = (uint64_t) contig_mem_alloc(ldcp->tx_q_entries << LDC_PACKET_SHIFT); - if (ldcp->tx_q_va == NULL) { + if (ldcp->tx_q_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) TX queue allocation failed\n", ldcp->id); @@ -2745,7 +2729,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) /* Create a receive queue */ ldcp->rx_q_va = (uint64_t) contig_mem_alloc(ldcp->rx_q_entries << LDC_PACKET_SHIFT); - if (ldcp->rx_q_va == NULL) { + if (ldcp->rx_q_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) RX queue allocation failed\n", ldcp->id); @@ -2775,7 +2759,7 @@ ldc_init(uint64_t id, ldc_attr_t *attr, ldc_handle_t *handle) ldcp->rx_dq_va = (uint64_t) kmem_alloc(ldcp->rx_dq_entries << LDC_PACKET_SHIFT, KM_SLEEP); - if (ldcp->rx_dq_va == NULL) { + if (ldcp->rx_dq_va == 0) { cmn_err(CE_WARN, "ldc_init: (0x%lx) RX data queue " "allocation failed\n", ldcp->id); @@ -2831,8 +2815,7 @@ cleanup_on_exit: mutex_destroy(&ldcp->tx_lock); mutex_destroy(&ldcp->lock); - if (ldcp) - kmem_free(ldcp, sizeof (ldc_chan_t)); + kmem_free(ldcp, sizeof (ldc_chan_t)); return (exit_val); } @@ -2846,11 +2829,11 @@ cleanup_on_exit: int ldc_fini(ldc_handle_t handle) { - ldc_chan_t *ldcp; - ldc_chan_t *tmp_ldcp; - uint64_t id; + ldc_chan_t *ldcp; + ldc_chan_t *tmp_ldcp; + uint64_t id; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_fini: invalid channel handle\n"); return (EINVAL); } @@ -2895,7 +2878,7 @@ ldc_fini(ldc_handle_t handle) /* Free the map table for this channel */ if (ldcp->mtbl) { - (void) hv_ldc_set_map_table(ldcp->id, NULL, NULL); + (void) hv_ldc_set_map_table(ldcp->id, 0, 0); if (ldcp->mtbl->contigmem) contig_mem_free(ldcp->mtbl->table, ldcp->mtbl->size); else @@ -2951,10 +2934,10 @@ ldc_fini(ldc_handle_t handle) int ldc_open(ldc_handle_t handle) { - ldc_chan_t *ldcp; - int rv; + ldc_chan_t *ldcp; + int rv; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_open: invalid channel handle\n"); return (EINVAL); } @@ -2979,7 +2962,7 @@ ldc_open(ldc_handle_t handle) /* * Unregister/Register the tx queue with the hypervisor */ - rv = hv_ldc_tx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_tx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_open: (0x%lx) channel tx queue unconf failed\n", @@ -3003,7 +2986,7 @@ ldc_open(ldc_handle_t handle) /* * Unregister/Register the rx queue with the hypervisor */ - rv = hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_rx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_open: (0x%lx) channel rx queue unconf failed\n", @@ -3032,8 +3015,8 @@ ldc_open(ldc_handle_t handle) cmn_err(CE_WARN, "ldc_open: (0x%lx) channel register failed\n", ldcp->id); ldcp->tstate &= ~TS_QCONF_RDY; - (void) hv_ldc_tx_qconf(ldcp->id, NULL, NULL); - (void) hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + (void) hv_ldc_tx_qconf(ldcp->id, 0, 0); + (void) hv_ldc_rx_qconf(ldcp->id, 0, 0); mutex_exit(&ldcp->lock); return (EIO); } @@ -3050,8 +3033,8 @@ ldc_open(ldc_handle_t handle) ldcp->id); (void) i_ldc_unregister_channel(ldcp); ldcp->tstate &= ~TS_QCONF_RDY; - (void) hv_ldc_tx_qconf(ldcp->id, NULL, NULL); - (void) hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + (void) hv_ldc_tx_qconf(ldcp->id, 0, 0); + (void) hv_ldc_rx_qconf(ldcp->id, 0, 0); mutex_exit(&ldcp->lock); return (EIO); } @@ -3102,11 +3085,11 @@ ldc_open(ldc_handle_t handle) int ldc_close(ldc_handle_t handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; int rv = 0, retries = 0; boolean_t chk_done = B_FALSE; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_close: invalid channel handle\n"); return (EINVAL); } @@ -3230,7 +3213,7 @@ ldc_close(ldc_handle_t handle) /* * Unregister queues */ - rv = hv_ldc_tx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_tx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_close: (0x%lx) channel TX queue unconf failed\n", @@ -3239,7 +3222,7 @@ ldc_close(ldc_handle_t handle) mutex_exit(&ldcp->lock); return (EIO); } - rv = hv_ldc_rx_qconf(ldcp->id, NULL, NULL); + rv = hv_ldc_rx_qconf(ldcp->id, 0, 0); if (rv) { cmn_err(CE_WARN, "ldc_close: (0x%lx) channel RX queue unconf failed\n", @@ -3280,7 +3263,7 @@ ldc_reg_callback(ldc_handle_t handle, { ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_reg_callback: invalid channel handle\n"); return (EINVAL); @@ -3327,7 +3310,7 @@ ldc_unreg_callback(ldc_handle_t handle) { ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_unreg_callback: invalid channel handle\n"); return (EINVAL); @@ -3373,12 +3356,12 @@ ldc_unreg_callback(ldc_handle_t handle) int ldc_up(ldc_handle_t handle) { - int rv; - ldc_chan_t *ldcp; - ldc_msg_t *ldcmsg; - uint64_t tx_tail, tstate, link_state; + int rv; + ldc_chan_t *ldcp; + ldc_msg_t *ldcmsg; + uint64_t tx_tail, tstate, link_state; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_up: invalid channel handle\n"); return (EINVAL); } @@ -3515,9 +3498,9 @@ ldc_up(ldc_handle_t handle) int ldc_down(ldc_handle_t handle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_down: invalid channel handle\n"); return (EINVAL); } @@ -3539,7 +3522,7 @@ ldc_status(ldc_handle_t handle, ldc_status_t *status) { ldc_chan_t *ldcp; - if (handle == NULL || status == NULL) { + if (handle == 0 || status == NULL) { DWARN(DBG_ALL_LDCS, "ldc_status: invalid argument\n"); return (EINVAL); } @@ -3559,9 +3542,9 @@ ldc_status(ldc_handle_t handle, ldc_status_t *status) int ldc_set_cb_mode(ldc_handle_t handle, ldc_cb_mode_t cmode) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_set_intr_mode: invalid channel handle\n"); return (EINVAL); @@ -3613,11 +3596,11 @@ ldc_set_cb_mode(ldc_handle_t handle, ldc_cb_mode_t cmode) int ldc_chkq(ldc_handle_t handle, boolean_t *hasdata) { - int rv; - uint64_t rx_head, rx_tail; - ldc_chan_t *ldcp; + int rv; + uint64_t rx_head, rx_tail; + ldc_chan_t *ldcp; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_chkq: invalid channel handle\n"); return (EINVAL); } @@ -3720,11 +3703,11 @@ ldc_chkq(ldc_handle_t handle, boolean_t *hasdata) int ldc_read(ldc_handle_t handle, caddr_t bufp, size_t *sizep) { - ldc_chan_t *ldcp; - uint64_t rx_head = 0, rx_tail = 0; + ldc_chan_t *ldcp; + uint64_t rx_head = 0, rx_tail = 0; int rv = 0, exit_val; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_read: invalid channel handle\n"); return (EINVAL); } @@ -3809,11 +3792,11 @@ ldc_read(ldc_handle_t handle, caddr_t bufp, size_t *sizep) static int i_ldc_read_raw(ldc_chan_t *ldcp, caddr_t target_bufp, size_t *sizep) { - uint64_t q_size_mask; - ldc_msg_t *msgp; + uint64_t q_size_mask; + ldc_msg_t *msgp; uint8_t *msgbufp; int rv = 0, space; - uint64_t rx_head, rx_tail; + uint64_t rx_head, rx_tail; space = *sizep; @@ -3885,13 +3868,13 @@ static int i_ldc_read_packet(ldc_chan_t *ldcp, caddr_t target_bufp, size_t *sizep) { int rv = 0; - uint64_t rx_head = 0, rx_tail = 0; - uint64_t curr_head = 0; - ldc_msg_t *msg; - caddr_t target; - size_t len = 0, bytes_read = 0; - int retries = 0; - uint64_t q_va, q_size_mask; + uint64_t rx_head = 0, rx_tail = 0; + uint64_t curr_head = 0; + ldc_msg_t *msg; + caddr_t target; + size_t len = 0, bytes_read = 0; + int retries = 0; + uint64_t q_va, q_size_mask; uint64_t first_fragment = 0; target = target_bufp; @@ -4286,7 +4269,7 @@ ldc_write(ldc_handle_t handle, caddr_t buf, size_t *sizep) ldc_chan_t *ldcp; int rv = 0; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_write: invalid channel handle\n"); return (EINVAL); } @@ -4332,8 +4315,8 @@ ldc_write(ldc_handle_t handle, caddr_t buf, size_t *sizep) static int i_ldc_write_raw(ldc_chan_t *ldcp, caddr_t buf, size_t *sizep) { - ldc_msg_t *ldcmsg; - uint64_t tx_head, tx_tail, new_tail; + ldc_msg_t *ldcmsg; + uint64_t tx_head, tx_tail, new_tail; int rv = 0; size_t size; @@ -4463,11 +4446,11 @@ i_ldc_write_raw(ldc_chan_t *ldcp, caddr_t buf, size_t *sizep) static int i_ldc_write_packet(ldc_chan_t *ldcp, caddr_t buf, size_t *size) { - ldc_msg_t *ldcmsg; - uint64_t tx_head, tx_tail, new_tail, start; + ldc_msg_t *ldcmsg; + uint64_t tx_head, tx_tail, new_tail, start; uint64_t txq_size_mask, numavail; - uint8_t *msgbuf, *source = (uint8_t *)buf; - size_t len, bytes_written = 0, remaining; + uint8_t *msgbuf, *source = (uint8_t *)buf; + size_t len, bytes_written = 0, remaining; int rv; uint32_t curr_seqid; @@ -4735,7 +4718,7 @@ ldc_info(ldc_handle_t handle, ldc_info_t *info) ldc_chan_t *ldcp; uint64_t avail; - if (handle == NULL || info == NULL) { + if (handle == 0 || info == NULL) { DWARN(DBG_ALL_LDCS, "ldc_get_info: invalid args\n"); return (EINVAL); } diff --git a/usr/src/uts/sun4v/io/ldc_shm.c b/usr/src/uts/sun4v/io/ldc_shm.c index f35bcdb7f0..f8edd4f845 100644 --- a/usr/src/uts/sun4v/io/ldc_shm.c +++ b/usr/src/uts/sun4v/io/ldc_shm.c @@ -191,10 +191,10 @@ i_ldc_init_mapin(ldc_soft_state_t *ldcssp, uint64_t major, uint64_t minor) int ldc_mem_alloc_handle(ldc_handle_t handle, ldc_mem_handle_t *mhandle) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_alloc_handle: invalid channel handle\n"); return (EINVAL); @@ -250,10 +250,10 @@ ldc_mem_alloc_handle(ldc_handle_t handle, ldc_mem_handle_t *mhandle) int ldc_mem_free_handle(ldc_mem_handle_t mhandle) { - ldc_mhdl_t *mhdl, *phdl; - ldc_chan_t *ldcp; + ldc_mhdl_t *mhdl, *phdl; + ldc_chan_t *ldcp; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_free_handle: invalid memory handle\n"); return (EINVAL); @@ -346,7 +346,7 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, uint8_t mtype, uint8_t perm, ldc_mem_cookie_t *cookie, uint32_t *ccount) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mtbl_t *mtbl; ldc_memseg_t *memseg; ldc_mte_t tmp_mte; @@ -357,9 +357,9 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, uint64_t pg_shift, pg_size, pg_size_code, pg_mask; pgcnt_t npages; caddr_t v_align, addr; - int i, rv; + int i, rv; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_bind_handle: invalid memory handle\n"); return (EINVAL); @@ -400,7 +400,7 @@ i_ldc_mem_bind_handle(ldc_mem_handle_t mhandle, caddr_t vaddr, size_t len, mtbl = kmem_zalloc(sizeof (ldc_mtbl_t), KM_SLEEP); mtbl->num_entries = mtbl->num_avail = ldc_maptable_entries; mtbl->size = ldc_maptable_entries * sizeof (ldc_mte_slot_t); - mtbl->next_entry = NULL; + mtbl->next_entry = 0; mtbl->contigmem = B_TRUE; /* Allocate the table itself */ @@ -671,10 +671,10 @@ int ldc_mem_nextcookie(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_memseg_t *memseg; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_nextcookie: invalid memory handle\n"); return (EINVAL); @@ -727,14 +727,14 @@ int ldc_mem_unbind_handle(ldc_mem_handle_t mhandle) { ldc_mhdl_t *mhdl; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mtbl_t *mtbl; ldc_memseg_t *memseg; uint64_t cookie_addr; uint64_t pg_shift, pg_size_code; int i, rv, retries; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_unbind_handle: invalid memory handle\n"); return (EINVAL); @@ -827,7 +827,7 @@ ldc_mem_info(ldc_mem_handle_t mhandle, ldc_mem_info_t *minfo) { ldc_mhdl_t *mhdl; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_info: invalid memory handle\n"); return (EINVAL); } @@ -862,20 +862,20 @@ int ldc_mem_copy(ldc_handle_t handle, caddr_t vaddr, uint64_t off, size_t *size, ldc_mem_cookie_t *cookies, uint32_t ccount, uint8_t direction) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; uint64_t local_voff, local_valign; uint64_t cookie_addr, cookie_size; uint64_t pg_shift, pg_size, pg_size_code; - uint64_t export_caddr, export_poff, export_psize, export_size; + uint64_t export_caddr, export_poff, export_psize, export_size; uint64_t local_ra, local_poff, local_psize; uint64_t copy_size, copied_len = 0, total_bal = 0, idx = 0; pgcnt_t npages; size_t len = *size; - int i, rv = 0; + int i, rv = 0; uint64_t chid; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_copy: invalid channel handle\n"); return (EINVAL); } @@ -984,7 +984,7 @@ ldc_mem_copy(ldc_handle_t handle, caddr_t vaddr, uint64_t off, size_t *size, copy_size, &copied_len); if (rv != 0) { - int error = EIO; + int error = EIO; uint64_t rx_hd, rx_tl; DWARN(chid, @@ -1088,17 +1088,17 @@ int ldc_mem_rdwr_cookie(ldc_handle_t handle, caddr_t vaddr, size_t *size, caddr_t paddr, uint8_t direction) { - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; uint64_t local_voff, local_valign; uint64_t pg_shift, pg_size, pg_size_code; - uint64_t target_pa, target_poff, target_psize, target_size; + uint64_t target_pa, target_poff, target_psize, target_size; uint64_t local_ra, local_poff, local_psize; uint64_t copy_size, copied_len = 0; pgcnt_t npages; size_t len = *size; - int rv = 0; + int rv = 0; - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_rdwr_cookie: invalid channel handle\n"); return (EINVAL); @@ -1259,7 +1259,7 @@ i_ldc_mem_map(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie, { int i, j, idx, rv, retries; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; ldc_memseg_t *memseg; caddr_t tmpaddr; @@ -1269,7 +1269,7 @@ i_ldc_mem_map(ldc_mem_handle_t mhandle, ldc_mem_cookie_t *cookie, uint64_t cookie_addr, cookie_off, cookie_size; tte_t ldc_tte; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_map: invalid memory handle\n"); return (EINVAL); } @@ -1519,7 +1519,7 @@ ldc_mem_unmap(ldc_mem_handle_t mhandle) { int i, rv; ldc_mhdl_t *mhdl = (ldc_mhdl_t *)mhandle; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_memseg_t *memseg; if (mhdl == 0 || mhdl->status != LDC_MAPPED) { @@ -1586,14 +1586,14 @@ static int i_ldc_mem_acquire_release(ldc_mem_handle_t mhandle, uint8_t direction, uint64_t offset, size_t size) { - int err; + int err; ldc_mhdl_t *mhdl; ldc_chan_t *ldcp; ldc_memseg_t *memseg; caddr_t local_vaddr; size_t copy_size; - if (mhandle == NULL) { + if (mhandle == 0) { DWARN(DBG_ALL_LDCS, "i_ldc_mem_acquire_release: invalid memory handle\n"); return (EINVAL); @@ -1691,7 +1691,7 @@ ldc_mem_dring_create(uint32_t len, uint32_t dsize, ldc_dring_handle_t *dhandle) D1(DBG_ALL_LDCS, "ldc_mem_dring_create: len=0x%x, size=0x%x\n", len, dsize); - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_create: invalid dhandle\n"); return (EINVAL); } @@ -1754,7 +1754,7 @@ ldc_mem_dring_destroy(ldc_dring_handle_t dhandle) D1(DBG_ALL_LDCS, "ldc_mem_dring_destroy: entered\n"); - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_destroy: invalid desc ring handle\n"); return (EINVAL); @@ -1822,19 +1822,19 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, uint8_t mtype, uint8_t perm, ldc_mem_cookie_t *cookie, uint32_t *ccount) { int err; - ldc_chan_t *ldcp; + ldc_chan_t *ldcp; ldc_dring_t *dringp; ldc_mem_handle_t mhandle; /* check to see if channel is initalized */ - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: invalid channel handle\n"); return (EINVAL); } ldcp = (ldc_chan_t *)handle; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: invalid desc ring handle\n"); return (EINVAL); @@ -1885,7 +1885,7 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, /* create an memory handle */ err = ldc_mem_alloc_handle(handle, &mhandle); - if (err || mhandle == NULL) { + if (err || mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_bind: (0x%llx) error allocating mhandle\n", ldcp->id); @@ -1914,7 +1914,7 @@ ldc_mem_dring_bind(ldc_handle_t handle, ldc_dring_handle_t dhandle, (void) ldc_mem_free_handle(mhandle); dringp->ldcp = NULL; - dringp->mhdl = NULL; + dringp->mhdl = 0; *ccount = 0; mutex_exit(&dringp->lock); @@ -1941,10 +1941,10 @@ int ldc_mem_dring_nextcookie(ldc_dring_handle_t dhandle, ldc_mem_cookie_t *cookie) { int rv = 0; - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_nextcookie: invalid desc ring handle\n"); return (EINVAL); @@ -1982,11 +1982,11 @@ ldc_mem_dring_nextcookie(ldc_dring_handle_t dhandle, ldc_mem_cookie_t *cookie) int ldc_mem_dring_unbind(ldc_dring_handle_t dhandle) { - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_dring_t *tmp_dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_unbind: invalid desc ring handle\n"); return (EINVAL); @@ -2035,7 +2035,7 @@ ldc_mem_dring_unbind(ldc_dring_handle_t dhandle) (void) ldc_mem_free_handle((ldc_mem_handle_t)dringp->mhdl); dringp->ldcp = NULL; - dringp->mhdl = NULL; + dringp->mhdl = 0; dringp->status = LDC_UNBOUND; mutex_exit(&dringp->lock); @@ -2124,7 +2124,7 @@ ldc_mem_dring_info(ldc_dring_handle_t dhandle, ldc_mem_info_t *minfo) ldc_dring_t *dringp; int rv; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_info: invalid desc ring handle\n"); return (EINVAL); @@ -2143,7 +2143,7 @@ ldc_mem_dring_info(ldc_dring_handle_t dhandle, ldc_mem_info_t *minfo) } } else { minfo->vaddr = dringp->base; - minfo->raddr = NULL; + minfo->raddr = 0; minfo->status = dringp->status; } @@ -2164,19 +2164,19 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, ldc_dring_handle_t *dhandle) { int err; - ldc_chan_t *ldcp = (ldc_chan_t *)handle; + ldc_chan_t *ldcp = (ldc_chan_t *)handle; ldc_mem_handle_t mhandle; ldc_dring_t *dringp; size_t dring_size; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: invalid dhandle\n"); return (EINVAL); } /* check to see if channel is initalized */ - if (handle == NULL) { + if (handle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: invalid channel handle\n"); return (EINVAL); @@ -2234,7 +2234,7 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, /* create an memory handle */ err = ldc_mem_alloc_handle(handle, &mhandle); - if (err || mhandle == NULL) { + if (err || mhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_map: cannot alloc hdl err=%d\n", err); @@ -2278,11 +2278,11 @@ ldc_mem_dring_map(ldc_handle_t handle, ldc_mem_cookie_t *cookie, int ldc_mem_dring_unmap(ldc_dring_handle_t dhandle) { - ldc_dring_t *dringp; + ldc_dring_t *dringp; ldc_dring_t *tmp_dringp; ldc_chan_t *ldcp; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "ldc_mem_dring_unmap: invalid desc ring handle\n"); return (EINVAL); @@ -2356,14 +2356,14 @@ static int i_ldc_dring_acquire_release(ldc_dring_handle_t dhandle, uint8_t direction, uint64_t start, uint64_t end) { - int err; + int err; ldc_dring_t *dringp; ldc_chan_t *ldcp; ldc_mhdl_t *mhdl; uint64_t soff; size_t copy_size; - if (dhandle == NULL) { + if (dhandle == 0) { DWARN(DBG_ALL_LDCS, "i_ldc_dring_acquire_release: invalid desc ring handle\n"); return (EINVAL); diff --git a/usr/src/uts/sun4v/io/mdeg.c b/usr/src/uts/sun4v/io/mdeg.c index 18441c2e3c..687ace384b 100644 --- a/usr/src/uts/sun4v/io/mdeg.c +++ b/usr/src/uts/sun4v/io/mdeg.c @@ -67,7 +67,7 @@ typedef struct mdeg_clnt { * held when modifying any client information. */ static struct mdeg { - taskq_t *taskq; /* for internal processing */ + taskq_t *taskq; /* for internal processing */ boolean_t enabled; /* enable/disable taskq processing */ kmutex_t lock; /* synchronize MD updates */ md_t *md_prev; /* previous MD */ @@ -94,8 +94,8 @@ static void mdeg_dump_table(void); #else /* DEBUG */ #define MDEG_DBG _NOTE(CONSTCOND) if (0) printf -#define MDEG_DUMP_CLNT -#define MDEG_DUMP_TABLE() +#define MDEG_DUMP_CLNT(...) +#define MDEG_DUMP_TABLE(...) #endif /* DEBUG */ @@ -334,7 +334,7 @@ mdeg_notify_client_reg(mdeg_clnt_t *clnt) */ if (clnt->pspec == NULL) { /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, NULL); + (void) (*clnt->cb)(clnt->cb_arg, NULL); goto done; } @@ -387,7 +387,7 @@ mdeg_notify_client_reg(mdeg_clnt_t *clnt) mdeg_res->added.nelem = nnodes; /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, mdeg_res); + (void) (*clnt->cb)(clnt->cb_arg, mdeg_res); done: mutex_exit(&mdeg.lock); @@ -602,7 +602,7 @@ mdeg_notify_client(void *arg) */ if (clnt->pspec == NULL) { /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, NULL); + (void) (*clnt->cb)(clnt->cb_arg, NULL); MDEG_DBG("MDEG client callback done\n"); goto cleanup; @@ -634,7 +634,7 @@ mdeg_notify_client(void *arg) mdeg_get_diff_results(mdd, &mdeg_res); /* call the client callback */ - (*clnt->cb)(clnt->cb_arg, &mdeg_res); + (void) (*clnt->cb)(clnt->cb_arg, &mdeg_res); MDEG_DBG("MDEG client callback done\n"); @@ -658,13 +658,13 @@ mdeg_find_start_node(md_t *md, mdeg_node_spec_t *nspec) nname = md_find_name(md, nspec->namep); aname = md_find_name(md, "fwd"); - nnodes = md_scan_dag(md, NULL, nname, aname, NULL); + nnodes = md_scan_dag(md, 0, nname, aname, NULL); if (nnodes == 0) return (MDE_INVAL_ELEM_COOKIE); nodesp = kmem_alloc(sizeof (mde_cookie_t) * nnodes, KM_SLEEP); - (void) md_scan_dag(md, NULL, nname, aname, nodesp); + (void) md_scan_dag(md, 0, nname, aname, nodesp); for (idx = 0; idx < nnodes; idx++) { diff --git a/usr/src/uts/sun4v/io/n2piupc/n2piupc.h b/usr/src/uts/sun4v/io/n2piupc/n2piupc.h index b9c224618f..689d0c5ef5 100644 --- a/usr/src/uts/sun4v/io/n2piupc/n2piupc.h +++ b/usr/src/uts/sun4v/io/n2piupc/n2piupc.h @@ -31,8 +31,6 @@ * Definitions which deal with things other than registers. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -65,8 +63,8 @@ extern int n2piupc_debug; #define N2PIUPC_DBG1 if (n2piupc_debug >= 1) printf #define N2PIUPC_DBG2 if (n2piupc_debug >= 2) printf #else -#define N2PIUPC_DBG1 0 && -#define N2PIUPC_DBG2 0 && +#define N2PIUPC_DBG1(...) +#define N2PIUPC_DBG2(...) #endif /* DEBUG */ diff --git a/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c b/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c index 0b22142ea2..6881d58a20 100644 --- a/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c +++ b/usr/src/uts/sun4v/io/n2piupc/n2piupc_kstats.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kstat.h> #include "n2piupc_acc.h" @@ -68,7 +66,7 @@ n2piupc_kstat_init() /* Create basic pic event-type pair. */ grp_p->name_kstats_pp = kmem_zalloc((grp_p->num_counters * - sizeof (kstat_t)), KM_SLEEP); + sizeof (kstat_t)), KM_SLEEP); if (n2piupc_create_name_kstat(grp_p) != DDI_SUCCESS) { n2piupc_kstat_fini(); N2PIUPC_DBG1("n2piupc: init: failure exit\n"); @@ -183,7 +181,7 @@ n2piupc_create_picN_kstat(char *mod_name, int pic, uint64_t ev_offset, (void) snprintf(pic_name, PIC_STR_LEN, "pic%1d", pic); if ((picN_ksp = kstat_create(mod_name, 0, pic_name, - "bus", KSTAT_TYPE_NAMED, num_ev, NULL)) == NULL) { + "bus", KSTAT_TYPE_NAMED, num_ev, 0)) == NULL) { cmn_err(CE_WARN, "%s %s : kstat create failed", mod_name, pic_name); return (NULL); diff --git a/usr/src/uts/sun4v/io/n2rng/n2rng.c b/usr/src/uts/sun4v/io/n2rng/n2rng.c index 2b8827fd49..144d60b880 100644 --- a/usr/src/uts/sun4v/io/n2rng/n2rng.c +++ b/usr/src/uts/sun4v/io/n2rng/n2rng.c @@ -944,7 +944,7 @@ n2rng_check_ctl_access(n2rng_t *n2rng) * Attempt to read control registers with invalid ID and data * just to see if we get an access error */ - rv = hv_rng_ctl_read_v2(NULL, N2RNG_INVALID_ID, + rv = hv_rng_ctl_read_v2(0, N2RNG_INVALID_ID, &unused_64, &unused_64, &unused_64, &unused_64); } else { rv = hv_rng_get_diag_control(); diff --git a/usr/src/uts/sun4v/io/n2rng/n2rng_kcf.c b/usr/src/uts/sun4v/io/n2rng/n2rng_kcf.c index 5e101472ee..afe6cd47fe 100644 --- a/usr/src/uts/sun4v/io/n2rng/n2rng_kcf.c +++ b/usr/src/uts/sun4v/io/n2rng/n2rng_kcf.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/uio.h> #include <sys/stream.h> @@ -72,7 +70,7 @@ static crypto_random_number_ops_t n2rng_rng_ops = { static crypto_provider_management_ops_t n2rng_extinfo_op = { ext_info, /* ext_info */ NULL, /* init_token */ - NULL, /* init_pin */ + NULL, /* init_pin */ NULL, /* set_pin */ }; @@ -207,7 +205,7 @@ n2rng_register_provider(n2rng_t *n2rng) } else { cmn_err(CE_WARN, "crypto_register_provider() failed (%d)", ret); - n2rng->n_prov = NULL; + n2rng->n_prov = 0; return (DDI_FAILURE); } } @@ -236,7 +234,7 @@ n2rng_unregister_provider(n2rng_t *n2rng) return (DDI_FAILURE); } } - n2rng->n_prov = NULL; + n2rng->n_prov = 0; n2rng_clrregistered(n2rng); return (DDI_SUCCESS); } @@ -408,8 +406,8 @@ n2rng_provider_status(crypto_provider_handle_t provider, uint_t *status) /*ARGSUSED*/ static int n2rng_random_number(crypto_provider_handle_t provider, - crypto_session_id_t sess, unsigned char *buf, size_t buflen, - crypto_req_handle_t cfreq) + crypto_session_id_t sess, unsigned char *buf, size_t buflen, + crypto_req_handle_t cfreq) { n2rng_t *n2rng = (n2rng_t *)provider; int rv; diff --git a/usr/src/uts/sun4v/io/niumx/niumx.c b/usr/src/uts/sun4v/io/niumx/niumx.c index b455d287e6..76b30a3804 100644 --- a/usr/src/uts/sun4v/io/niumx/niumx.c +++ b/usr/src/uts/sun4v/io/niumx/niumx.c @@ -97,19 +97,19 @@ static struct bus_ops niumx_bus_ops = { 0, niumx_ctlops, ddi_bus_prop_op, - 0, /* (*bus_get_eventcookie)(); */ + 0, /* (*bus_get_eventcookie)(); */ 0, /* (*bus_add_eventcall)(); */ - 0, /* (*bus_remove_eventcall)(); */ + 0, /* (*bus_remove_eventcall)(); */ 0, /* (*bus_post_event)(); */ 0, /* (*bus_intr_ctl)(); */ - 0, /* (*bus_config)(); */ - 0, /* (*bus_unconfig)(); */ - niumx_fm_init_child, /* (*bus_fm_init)(); */ - 0, /* (*bus_fm_fini)(); */ + 0, /* (*bus_config)(); */ + 0, /* (*bus_unconfig)(); */ + niumx_fm_init_child, /* (*bus_fm_init)(); */ + 0, /* (*bus_fm_fini)(); */ 0, /* (*bus_enter)() */ 0, /* (*bus_exit)() */ 0, /* (*bus_power)() */ - niumx_intr_ops /* (*bus_intr_op)(); */ + niumx_intr_ops /* (*bus_intr_op)(); */ }; extern struct cb_ops niumx_cb_ops; @@ -199,7 +199,7 @@ void niumx_intr_dist(void *arg) { niumx_devstate_t *niumxds_p = (niumx_devstate_t *)arg; - kmutex_t *lock_p = &niumxds_p->niumx_mutex; + kmutex_t *lock_p = &niumxds_p->niumx_mutex; int i; niumx_ih_t *ih_p = niumxds_p->niumx_ihtable; @@ -367,13 +367,13 @@ niumx_fm_init_child(dev_info_t *dip, dev_info_t *cdip, int cap, /*ARGSUSED*/ int niumx_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) { struct regspec p_regspec; ddi_map_req_t p_mapreq; - niu_regspec_t *reg_p; - int i, rn = mp->map_obj.rnumber, reglen, rnglen, rngnum, ret; - niumx_ranges_t *rng_p; + niu_regspec_t *reg_p; + int i, rn = mp->map_obj.rnumber, reglen, rnglen, rngnum, ret; + niumx_ranges_t *rng_p; uint32_t reg_begin, rng_begin; @@ -453,7 +453,7 @@ err: */ int niumx_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) { niu_regspec_t *reg_p; int reglen, totreg; @@ -644,7 +644,7 @@ niumx_removechild(dev_info_t *dip) /*ARGSUSED*/ int niumx_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attrp, - int (*waitfp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep) + int (*waitfp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep) { ddi_dma_impl_t *mp; int sleep = (waitfp == DDI_DMA_SLEEP) ? KM_SLEEP : KM_NOSLEEP; @@ -671,7 +671,7 @@ niumx_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attrp, mp->dmai_fault_check = NULL; mp->dmai_fault_notify = NULL; - mp->dmai_attr = *attrp; /* set requestors attr info */ + mp->dmai_attr = *attrp; /* set requestors attr info */ DBG(NIUMX_DBG_DMA_ALLOCH, dip, "mp=%p\n", mp); @@ -714,16 +714,16 @@ niumx_dma_freehdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_handle_t handle) * dma handle members affected (set on exit): * mp->dmai_object - dmareq->dmar_object * mp->dmai_rflags - dmareq->dmar_flags - * mp->dmai_pfn0 - 1st page pfn (if va/size pair and not shadow) - * mp->dmai_roffset - initialized to starting page offset + * mp->dmai_pfn0 - 1st page pfn (if va/size pair and not shadow) + * mp->dmai_roffset - initialized to starting page offset * mp->dmai_size - # of total pages of entire object * mp->dmai_cookie - new cookie alloc'd */ /*ARGSUSED*/ int niumx_dma_bindhdl(dev_info_t *dip, dev_info_t *rdip, - ddi_dma_handle_t handle, ddi_dma_req_t *dmareq, - ddi_dma_cookie_t *cookiep, uint_t *ccountp) + ddi_dma_handle_t handle, ddi_dma_req_t *dmareq, + ddi_dma_cookie_t *cookiep, uint_t *ccountp) { int (*waitfp)(caddr_t) = dmareq->dmar_fp; ddi_dma_impl_t *mp = (ddi_dma_impl_t *)handle; @@ -921,7 +921,7 @@ niumx_set_intr(dev_info_t *dip, dev_info_t *rdip, int ret = DDI_SUCCESS; uint64_t hvret; niumx_devstate_t *niumxds_p; /* devstate pointer */ - int instance = ddi_get_instance(dip); + int instance = ddi_get_instance(dip); niumxds_p = (niumx_devstate_t *)ddi_get_soft_state(niumx_state, instance); @@ -1142,7 +1142,7 @@ niumx_rem_intr(dev_info_t *dip, dev_info_t *rdip, niumx_ih_t *ih_p; int ret = DDI_SUCCESS, state; hrtime_t start; - niusysino_t sysino; + niusysino_t sysino; niumx_devstate_t *niumxds_p; /* devstate pointer */ int instance = ddi_get_instance(dip); @@ -1175,7 +1175,8 @@ niumx_rem_intr(dev_info_t *dip, dev_info_t *rdip, ih_p->ih_sysino = 0; hdlp->ih_vector = (uint32_t)sysino; - if (hdlp->ih_vector != NULL) i_ddi_rem_ivintr(hdlp); + if (hdlp->ih_vector != 0) + i_ddi_rem_ivintr(hdlp); fail: return (ret); diff --git a/usr/src/uts/sun4v/io/ntwdt.c b/usr/src/uts/sun4v/io/ntwdt.c index 5dcace595a..ac11471533 100644 --- a/usr/src/uts/sun4v/io/ntwdt.c +++ b/usr/src/uts/sun4v/io/ntwdt.c @@ -314,7 +314,7 @@ ntwdt_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * is initialized. */ if (ddi_create_minor_node(dip, NTWDT_MINOR_NODE, S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { cmn_err(CE_WARN, "failed to create Minor Node: %s", NTWDT_MINOR_NODE); goto err3; @@ -466,7 +466,7 @@ ntwdt_close(dev_t dev, int flag, int otyp, cred_t *credp) /*ARGSUSED*/ static int ntwdt_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, - int *rvalp) + int *rvalp) { int instance = getminor(dev); int retval = 0; diff --git a/usr/src/uts/sun4v/io/vdc.c b/usr/src/uts/sun4v/io/vdc.c index ccea7403ea..6f55fcc6e6 100644 --- a/usr/src/uts/sun4v/io/vdc.c +++ b/usr/src/uts/sun4v/io/vdc.c @@ -173,14 +173,14 @@ static int vdc_process_data_msg(vdc_t *vdc, vio_msg_t *msg); static int vdc_handle_ver_msg(vdc_t *vdc, vio_ver_msg_t *ver_msg); static int vdc_handle_attr_msg(vdc_t *vdc, vd_attr_msg_t *attr_msg); static int vdc_handle_dring_reg_msg(vdc_t *vdc, vio_dring_reg_msg_t *msg); -static int vdc_send_request(vdc_t *vdcp, int operation, +static int vdc_send_request(vdc_t *vdcp, int operation, caddr_t addr, size_t nbytes, int slice, diskaddr_t offset, buf_t *bufp, vio_desc_direction_t dir, int flags); static int vdc_map_to_shared_dring(vdc_t *vdcp, int idx); -static int vdc_populate_descriptor(vdc_t *vdcp, int operation, +static int vdc_populate_descriptor(vdc_t *vdcp, int operation, caddr_t addr, size_t nbytes, int slice, diskaddr_t offset, buf_t *bufp, vio_desc_direction_t dir, int flags); -static int vdc_do_sync_op(vdc_t *vdcp, int operation, caddr_t addr, +static int vdc_do_sync_op(vdc_t *vdcp, int operation, caddr_t addr, size_t nbytes, int slice, diskaddr_t offset, vio_desc_direction_t dir, boolean_t); static int vdc_do_op(vdc_t *vdc, int op, caddr_t addr, size_t nbytes, @@ -224,7 +224,7 @@ static int vdc_get_efi_convert(vdc_t *vdc, void *from, void *to, static int vdc_set_efi_convert(vdc_t *vdc, void *from, void *to, int mode, int dir); -static void vdc_ownership_update(vdc_t *vdc, int ownership_flags); +static void vdc_ownership_update(vdc_t *vdc, int ownership_flags); static int vdc_access_set(vdc_t *vdc, uint64_t flags); static vdc_io_t *vdc_eio_queue(vdc_t *vdc, int index); static void vdc_eio_unqueue(vdc_t *vdc, clock_t deadline, @@ -284,7 +284,7 @@ static uint_t vdc_hattr_min = VDC_HATTR_MIN; * various operations */ static int vdc_timeout = 0; /* units: seconds */ -static int vdc_ldcup_timeout = 1; /* units: seconds */ +static int vdc_ldcup_timeout = 1; /* units: seconds */ static uint64_t vdc_hz_min_ldc_delay; static uint64_t vdc_min_timeout_ldc = 1 * MILLISEC; @@ -1074,7 +1074,7 @@ vdc_create_device_nodes_vtoc(vdc_t *vdc) * refers to a whole disk. Slices start at 'a' * * Parameters: - * vdc - soft state pointer + * vdc - soft state pointer * * Return Values * 0 - Success @@ -1192,7 +1192,7 @@ vdc_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags, * currently opened. * * Parameters: - * vdc - soft state pointer + * vdc - soft state pointer * * Return Values * B_TRUE - at least one slice is opened. @@ -2576,7 +2576,7 @@ vdc_terminate_ldc(vdc_t *vdc, vdc_server_t *srvr) if (srvr->state & VDC_LDC_INIT) { DMSG(vdc, 0, "[%d] ldc_fini()\n", instance); (void) ldc_fini(srvr->ldc_handle); - srvr->ldc_handle = NULL; + srvr->ldc_handle = 0; } srvr->state &= ~(VDC_LDC_INIT | VDC_LDC_CB | VDC_LDC_OPEN); @@ -2682,7 +2682,7 @@ vdc_init_descriptor_ring(vdc_t *vdc) status = ldc_mem_dring_create(vdc->dring_len, vdc->dring_entry_size, &vdc->dring_hdl); - if ((vdc->dring_hdl == NULL) || (status != 0)) { + if ((vdc->dring_hdl == 0) || (status != 0)) { DMSG(vdc, 0, "[%d] Descriptor ring creation failed", vdc->instance); return (status); @@ -2773,7 +2773,7 @@ static void vdc_destroy_descriptor_ring(vdc_t *vdc) { vdc_local_desc_t *ldep = NULL; /* Local Dring Entry Pointer */ - ldc_mem_handle_t mhdl = NULL; + ldc_mem_handle_t mhdl = 0; ldc_mem_info_t minfo; int status = -1; int i; /* loop */ @@ -2790,7 +2790,7 @@ vdc_destroy_descriptor_ring(vdc_t *vdc) ldep = &vdc->local_dring[i]; mhdl = ldep->desc_mhdl; - if (mhdl == NULL) + if (mhdl == 0) continue; if ((status = ldc_mem_info(mhdl, &minfo)) != 0) { @@ -2803,7 +2803,7 @@ vdc_destroy_descriptor_ring(vdc_t *vdc) * is not valid. Clear it out so that * no one tries to use it. */ - ldep->desc_mhdl = NULL; + ldep->desc_mhdl = 0; continue; } @@ -2813,7 +2813,7 @@ vdc_destroy_descriptor_ring(vdc_t *vdc) (void) ldc_mem_free_handle(mhdl); - ldep->desc_mhdl = NULL; + ldep->desc_mhdl = 0; } vdc->initialized &= ~VDC_DRING_ENTRY; } @@ -2841,7 +2841,7 @@ vdc_destroy_descriptor_ring(vdc_t *vdc) DMSG(vdc, 0, "[%d] Destroying DRing\n", vdc->instance); status = ldc_mem_dring_destroy(vdc->dring_hdl); if (status == 0) { - vdc->dring_hdl = NULL; + vdc->dring_hdl = 0; bzero(&vdc->dring_mem_info, sizeof (ldc_mem_info_t)); vdc->initialized &= ~VDC_DRING_INIT; } else { @@ -3197,7 +3197,7 @@ loop: * vdc_do_op * * Description: - * Wrapper around vdc_submit_request(). Each request is associated with a + * Wrapper around vdc_submit_request(). Each request is associated with a * buf structure. If a buf structure is provided (bufp != NULL) then the * request will be submitted with that buf, and the caller can wait for * completion of the request with biowait(). If a buf structure is not @@ -3321,7 +3321,7 @@ done: * vdc_do_sync_op * * Description: - * Wrapper around vdc_do_op that serializes requests. + * Wrapper around vdc_do_op that serializes requests. * * Arguments: * vdcp - the soft state pointer @@ -3411,9 +3411,9 @@ vdc_do_sync_op(vdc_t *vdcp, int operation, caddr_t addr, size_t nbytes, * vdc_drain_response() * * Description: - * When a guest is panicking, the completion of requests needs to be - * handled differently because interrupts are disabled and vdc - * will not get messages. We have to poll for the messages instead. + * When a guest is panicking, the completion of requests needs to be + * handled differently because interrupts are disabled and vdc + * will not get messages. We have to poll for the messages instead. * * Note: since we are panicking we don't implement the io:::done * DTrace probe or update the I/O statistics kstats. @@ -3431,9 +3431,9 @@ vdc_do_sync_op(vdc_t *vdcp, int operation, caddr_t addr, size_t nbytes, static int vdc_drain_response(vdc_t *vdc, struct buf *buf) { - int rv, idx, retries; + int rv, idx, retries; size_t msglen; - vdc_local_desc_t *ldep = NULL; /* Local Dring Entry Pointer */ + vdc_local_desc_t *ldep = NULL; /* Local Dring Entry Pointer */ vio_dring_msg_t dmsg; struct buf *mbuf; boolean_t ack; @@ -3926,7 +3926,7 @@ vdc_wait_for_response(vdc_t *vdcp, vio_msg_t *msgp) * * Description: * Resubmit each descriptor in the backed up dring to - * vDisk server. The Dring was backed up during connection + * vDisk server. The Dring was backed up during connection * reset. * * Arguments: @@ -4030,7 +4030,7 @@ void vdc_cancel_backup_dring(vdc_t *vdcp) { vdc_local_desc_t *ldep; - struct buf *bufp; + struct buf *bufp; int count; int b_idx; int dring_size; @@ -4118,7 +4118,7 @@ vdc_cancel_backup_dring(vdc_t *vdcp) void vdc_connection_timeout(void *arg) { - vdc_t *vdcp = (vdc_t *)arg; + vdc_t *vdcp = (vdc_t *)arg; mutex_enter(&vdcp->lock); @@ -4213,7 +4213,7 @@ static void vdc_switch_server(vdc_t *vdcp) { int rv; - vdc_server_t *curr_server, *new_server; + vdc_server_t *curr_server, *new_server; ASSERT(MUTEX_HELD(&vdcp->lock)); @@ -4410,9 +4410,9 @@ vdc_handshake_retry(vdc_t *vdcp, int hshake_cnt, int hattr_cnt) * Description: * * Main VDC message processing thread. Each vDisk instance - * consists of a copy of this thread. This thread triggers - * all the handshakes and data exchange with the server. It - * also handles all channel resets + * consists of a copy of this thread. This thread triggers + * all the handshakes and data exchange with the server. It + * also handles all channel resets * * Arguments: * vdc - soft state pointer for this instance of the device driver. @@ -5516,7 +5516,7 @@ typedef struct vdc_dk_arg { /* * Function: - * vdc_dkio_flush_cb() + * vdc_dkio_flush_cb() * * Description: * This routine is a callback for DKIOCFLUSHWRITECACHE which can be called @@ -5572,7 +5572,7 @@ vdc_dkio_flush_cb(void *arg) /* * Function: - * vdc_dkio_gapart() + * vdc_dkio_gapart() * * Description: * This function implements the DKIOCGAPART ioctl. @@ -5638,7 +5638,7 @@ vdc_dkio_gapart(vdc_t *vdc, caddr_t arg, int flag) /* * Function: - * vdc_dkio_partition() + * vdc_dkio_partition() * * Description: * This function implements the DKIOCPARTITION ioctl. @@ -5691,7 +5691,7 @@ vdc_dkio_partition(vdc_t *vdc, caddr_t arg, int flag) /* * Function: - * vdc_dioctl_rwcmd() + * vdc_dioctl_rwcmd() * * Description: * This function implements the DIOCTL_RWCMD ioctl. This ioctl is used @@ -5934,15 +5934,15 @@ vdc_scsi_status(vdc_t *vdc, vd_scsi_t *vd_scsi, boolean_t log_error) static int vdc_uscsi_cmd(vdc_t *vdc, caddr_t arg, int mode) { - struct uscsi_cmd uscsi; + struct uscsi_cmd uscsi; struct uscsi_cmd32 uscsi32; - vd_scsi_t *vd_scsi; - int vd_scsi_len; + vd_scsi_t *vd_scsi; + int vd_scsi_len; union scsi_cdb *cdb; struct scsi_extended_sense *sense; - char *datain, *dataout; + char *datain, *dataout; size_t cdb_len, datain_len, dataout_len, sense_len; - int rv; + int rv; if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) { if (ddi_copyin(arg, &uscsi32, sizeof (struct uscsi_cmd32), @@ -7200,7 +7200,7 @@ static vdc_dk_ioctl_t dk_ioctl[] = { vdc_get_geom_convert}, {VD_OP_GET_DISKGEOM, DKIOCG_PHYGEOM, sizeof (vd_geom_t), vdc_get_geom_convert}, - {VD_OP_GET_DISKGEOM, DKIOCG_VIRTGEOM, sizeof (vd_geom_t), + {VD_OP_GET_DISKGEOM, DKIOCG_VIRTGEOM, sizeof (vd_geom_t), vdc_get_geom_convert}, {VD_OP_SET_DISKGEOM, DKIOCSGEOM, sizeof (vd_geom_t), vdc_set_geom_convert}, @@ -7222,7 +7222,7 @@ static vdc_dk_ioctl_t dk_ioctl[] = { {0, MHIOCGRP_INKEYS, 0, vdc_null_copy_func}, {0, MHIOCGRP_INRESV, 0, vdc_null_copy_func}, {0, MHIOCGRP_REGISTER, 0, vdc_null_copy_func}, - {0, MHIOCGRP_RESERVE, 0, vdc_null_copy_func}, + {0, MHIOCGRP_RESERVE, 0, vdc_null_copy_func}, {0, MHIOCGRP_PREEMPTANDABORT, 0, vdc_null_copy_func}, {0, MHIOCGRP_REGISTERANDIGNOREKEY, 0, vdc_null_copy_func}, @@ -7578,9 +7578,10 @@ vd_process_ioctl(dev_t dev, int cmd, caddr_t arg, int mode, int *rvalp) vdc->dkio_flush_pending--; mutex_exit(&vdc->lock); kmem_free(dkarg, sizeof (vdc_dk_arg_t)); + return (ENOMEM); } - return (rv == NULL ? ENOMEM : 0); + return (0); } } diff --git a/usr/src/uts/sun4v/io/vds.c b/usr/src/uts/sun4v/io/vds.c index 15d263a1b9..1c8ca84ff2 100644 --- a/usr/src/uts/sun4v/io/vds.c +++ b/usr/src/uts/sun4v/io/vds.c @@ -168,7 +168,7 @@ typedef struct vd_driver_type { * The list can be extended by adding a "driver-type-list" entry in vds.conf * with the following syntax: * - * driver-type-list="<driver>:<type>", ... ,"<driver>:<type>"; + * driver-type-list="<driver>:<type>", ... ,"<driver>:<type>"; * * Where: * <driver> is the name of a driver (limited to 64 characters) @@ -178,7 +178,7 @@ typedef struct vd_driver_type { * * For example, the following line in vds.conf: * - * driver-type-list="foo:disk","bar:volume"; + * driver-type-list="foo:disk","bar:volume"; * * defines that "foo" is a disk driver, and driver "bar" is a volume driver. * @@ -256,7 +256,7 @@ vd_driver_type_t vds_driver_types[] = { static mdeg_prop_spec_t vds_prop_template[] = { { MDET_PROP_STR, "name", VDS_NAME }, { MDET_PROP_VAL, "cfg-handle", NULL }, - { MDET_LIST_END, NULL, NULL } + { MDET_LIST_END, NULL, NULL } }; #define VDS_SET_MDEG_PROP_INST(specp, val) (specp)[1].ps_val = (val); @@ -290,7 +290,7 @@ typedef struct vd_option { vd_option_t vd_bdev_options[] = { { "ro", VD_OPT_RDONLY }, - { "slice", VD_OPT_SLICE }, + { "slice", VD_OPT_SLICE }, { "excl", VD_OPT_EXCLUSIVE } }; @@ -407,7 +407,7 @@ typedef struct vds { mdeg_node_spec_t *ispecp; /* mdeg node specification */ mdeg_handle_t mdeg; /* handle for MDEG operations */ vd_driver_type_t *driver_types; /* extra driver types (from vds.conf) */ - int num_drivers; /* num of extra driver types */ + int num_drivers; /* num of extra driver types */ } vds_t; /* @@ -595,7 +595,7 @@ static int vd_awflush = VD_AWFLUSH_IMMEDIATE | VD_AWFLUSH_GROUP; * the service domain to panic. In both cases, the reset of the service domain * should trigger a reset SCSI buses and hopefully clear any SCSI-2 reservation. */ -static int vd_reset_access_failure = 0; +static int vd_reset_access_failure = 0; /* * Tunable for backward compatibility. When this variable is set to B_TRUE, @@ -694,8 +694,8 @@ extern int is_pseudo_device(dev_info_t *); * vd_get_readable_size * * Description: - * Convert a given size in bytes to a human readable format in - * kilobytes, megabytes, gigabytes or terabytes. + * Convert a given size in bytes to a human readable format in + * kilobytes, megabytes, gigabytes or terabytes. * * Parameters: * full_size - the size to convert in bytes. @@ -729,7 +729,7 @@ vd_get_readable_size(size_t full_size, size_t *size, char *unit) * vd_dskimg_io_params * * Description: - * Convert virtual disk I/O parameters (slice, block, length) to + * Convert virtual disk I/O parameters (slice, block, length) to * (offset, length) relative to the disk image and according to * the virtual disk partitioning. * @@ -848,7 +848,7 @@ vd_dskimg_io_params(vd_t *vd, int slice, size_t *blkp, size_t *lenp) * vd_dskimg_rw * * Description: - * Read or write to a disk image. It handles the case where the disk + * Read or write to a disk image. It handles the case where the disk * image is a file or a volume exported as a full disk or a file * exported as single-slice disk. Read or write to volumes exported as * single slice disks are done by directly using the ldi interface. @@ -891,7 +891,7 @@ vd_dskimg_rw(vd_t *vd, int slice, int operation, caddr_t data, size_t offset, ((operation == VD_OP_BREAD)? B_READ : B_WRITE); buf.b_bcount = len; buf.b_lblkno = offset; - buf.b_edev = vd->dev[0]; + buf.b_edev = vd->dev[0]; buf.b_un.b_addr = data; /* @@ -986,9 +986,9 @@ vd_build_default_label(size_t disk_size, size_t bsize, struct dk_label *label) * * Other parameters are computed from these values: * - * pcyl = disk_size / (nhead * nsect * 512) - * acyl = (pcyl > 2)? 2 : 0 - * ncyl = pcyl - acyl + * pcyl = disk_size / (nhead * nsect * 512) + * acyl = (pcyl > 2)? 2 : 0 + * ncyl = pcyl - acyl * * The maximum number of cylinder is 65535 so this allows to define a * geometry for a disk size up to 65535 * 96 * 768 * 512 = 2.24 TB @@ -1358,7 +1358,7 @@ vd_dskimg_write_devid(vd_t *vd, ddi_devid_t devid) * vd_do_scsi_rdwr * * Description: - * Read or write to a SCSI disk using an absolute disk offset. + * Read or write to a SCSI disk using an absolute disk offset. * * Parameters: * vd - disk on which the operation is performed. @@ -1482,7 +1482,7 @@ vd_do_scsi_rdwr(vd_t *vd, int operation, caddr_t data, size_t blk, size_t len) * vd_scsi_rdwr * * Description: - * Wrapper function to read or write to a SCSI disk using an absolute + * Wrapper function to read or write to a SCSI disk using an absolute * disk offset. It checks the blocksize of the underlying device and, * if necessary, adjusts the buffers accordingly before calling * vd_do_scsi_rdwr() to do the actual read or write. @@ -1562,7 +1562,7 @@ vd_scsi_rdwr(vd_t *vd, int operation, caddr_t data, size_t vblk, size_t vlen) * ^ ^ * |<--------------------->| * | plen - * pblk + * pblk */ /* END CSTYLED */ pblk = (vblk * vd->vdisk_bsize) / vd->backend_bsize; @@ -1897,7 +1897,7 @@ vd_flush_write(vd_t *vd) status = VOP_FSYNC(vd->file_vnode, FSYNC, kcred, NULL); } else { status = ldi_ioctl(vd->ldi_handle[0], DKIOCFLUSHWRITECACHE, - NULL, vd->open_flags | FKIOCTL, kcred, &rval); + (intptr_t)NULL, vd->open_flags | FKIOCTL, kcred, &rval); } return (status); @@ -1973,7 +1973,7 @@ vd_start_bio(vd_task_t *task) vd_dring_payload_t *request = task->request; struct buf *buf = &task->buf; uint8_t mtype; - int slice; + int slice; char *bufaddr = 0; size_t buflen; size_t offset, length, nbytes; @@ -2116,7 +2116,7 @@ vd_start_bio(vd_task_t *task) buf->b_bcount = length; buf->b_lblkno = offset; buf->b_bufsize = buflen; - buf->b_edev = vd->dev[slice]; + buf->b_edev = vd->dev[slice]; buf->b_un.b_addr = bufaddr; buf->b_iodone = vd_biodone; @@ -2526,7 +2526,7 @@ vd_complete_bio(vd_task_t *task) * message to the client. * * Parameters: - * arg - opaque pointer to structure containing task to be completed + * arg - opaque pointer to structure containing task to be completed * * Return Values * None @@ -2569,7 +2569,7 @@ vd_notify(vd_task_t *task) * the vDisk client * * Parameters: - * task - structure containing the request sent from client + * task - structure containing the request sent from client * * Return Values * None @@ -2624,7 +2624,7 @@ vd_complete_notify(vd_task_t *task) * message to the client that the request is completed. * * Parameters: - * arg - opaque pointer to structure containing task to be completed + * arg - opaque pointer to structure containing task to be completed * * Return Values * None @@ -3578,7 +3578,7 @@ vd_do_ioctl(vd_t *vd, vd_dring_payload_t *request, void* buf, vd_ioctl_t *ioctl) * is passed in as a field in the task pointer. * * Parameters: - * arg - opaque pointer to structure containing task to be completed + * arg - opaque pointer to structure containing task to be completed * * Return Values * None @@ -3688,7 +3688,8 @@ vd_ioctl(vd_task_t *task) break; } } - ASSERT(i < nioctls); /* because "operation" already validated */ + + VERIFY(i < nioctls); /* because "operation" already validated */ if (!(vd->open_flags & FWRITE) && ioctl[i].write) { PR0("%s fails because backend is opened read-only", @@ -3890,7 +3891,7 @@ vd_get_access(vd_task_t *task) } request->status = ldi_ioctl(vd->ldi_handle[request->slice], MHIOCSTATUS, - NULL, (vd->open_flags | FKIOCTL), kcred, &rval); + (intptr_t)NULL, (vd->open_flags | FKIOCTL), kcred, &rval); if (request->status != 0) return (0); @@ -3935,8 +3936,8 @@ vd_set_access(vd_task_t *task) if (flags == VD_ACCESS_SET_CLEAR) { PR0("Performing VD_OP_SET_ACCESS (CLEAR)"); request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCRELEASE, NULL, (vd->open_flags | FKIOCTL), kcred, - &rval); + MHIOCRELEASE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); if (request->status == 0) vd->ownership = B_FALSE; return (0); @@ -3962,7 +3963,8 @@ vd_set_access(vd_task_t *task) */ PR0("Performing VD_OP_SET_ACCESS (EXCLUSIVE|PREEMPT|PRESERVE)"); request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCTKOWN, NULL, (vd->open_flags | FKIOCTL), kcred, &rval); + MHIOCTKOWN, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); break; case VD_ACCESS_SET_PRESERVE: @@ -3977,12 +3979,13 @@ vd_set_access(vd_task_t *task) */ PR0("Performing VD_OP_SET_ACCESS (EXCLUSIVE|PRESERVE)"); request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCQRESERVE, NULL, (vd->open_flags | FKIOCTL), kcred, - &rval); + MHIOCQRESERVE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); if (request->status != 0) break; request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCTKOWN, NULL, (vd->open_flags | FKIOCTL), kcred, &rval); + MHIOCTKOWN, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); break; case VD_ACCESS_SET_PREEMPT: @@ -3994,8 +3997,8 @@ vd_set_access(vd_task_t *task) */ PR0("Performing VD_OP_SET_ACCESS (EXCLUSIVE|PREEMPT)"); request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCQRESERVE, NULL, (vd->open_flags | FKIOCTL), kcred, - &rval); + MHIOCQRESERVE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); if (request->status == 0) break; @@ -4004,16 +4007,16 @@ vd_set_access(vd_task_t *task) /* try again even if the reset has failed */ request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCQRESERVE, NULL, (vd->open_flags | FKIOCTL), kcred, - &rval); + MHIOCQRESERVE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); break; case 0: /* Flag EXCLUSIVE only. Just issue a SCSI reservation */ PR0("Performing VD_OP_SET_ACCESS (EXCLUSIVE)"); request->status = ldi_ioctl(vd->ldi_handle[request->slice], - MHIOCQRESERVE, NULL, (vd->open_flags | FKIOCTL), kcred, - &rval); + MHIOCQRESERVE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), + kcred, &rval); break; } @@ -4034,7 +4037,7 @@ vd_reset_access(vd_t *vd) return; PR0("Releasing disk ownership"); - status = ldi_ioctl(vd->ldi_handle[0], MHIOCRELEASE, NULL, + status = ldi_ioctl(vd->ldi_handle[0], MHIOCRELEASE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), kcred, &rval); /* @@ -4059,7 +4062,7 @@ vd_reset_access(vd_t *vd) PR0("Fail to reset disk, error %d", status); /* whatever the result of the reset is, we try the release again */ - status = ldi_ioctl(vd->ldi_handle[0], MHIOCRELEASE, NULL, + status = ldi_ioctl(vd->ldi_handle[0], MHIOCRELEASE, (intptr_t)NULL, (vd->open_flags | FKIOCTL), kcred, &rval); if (status == 0 || status == EACCES) { @@ -4081,7 +4084,7 @@ vd_reset_access(vd_t *vd) if (vd_reset_access_failure == A_REBOOT) { cmn_err(CE_WARN, VD_RESET_ACCESS_FAILURE_MSG ", rebooting the system", vd->device_path); - (void) uadmin(A_SHUTDOWN, AD_BOOT, NULL); + (void) uadmin(A_SHUTDOWN, AD_BOOT, (uintptr_t)NULL); } else if (vd_reset_access_failure == A_DUMP) { panic(VD_RESET_ACCESS_FAILURE_MSG, vd->device_path); } @@ -4122,7 +4125,7 @@ static const size_t vds_noperations = * Process a task specifying a client I/O request * * Parameters: - * task - structure containing the request sent from client + * task - structure containing the request sent from client * * Return Value * 0 - success @@ -4196,7 +4199,7 @@ vd_do_process_task(vd_task_t *task) * by the completion handler. * * Parameters: - * task - structure containing the request sent from client + * task - structure containing the request sent from client * * Return Value * 0 - successful synchronous request. @@ -5415,7 +5418,7 @@ vds_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) kmem_free(vds->ispecp->specp, sizeof (vds_prop_template)); kmem_free(vds->ispecp, sizeof (mdeg_node_spec_t)); vds->ispecp = NULL; - vds->mdeg = NULL; + vds->mdeg = 0; } vds_driver_types_free(vds); @@ -5884,7 +5887,7 @@ vd_setup_partition_efi(vd_t *vd) static int vd_setup_backend_vnode(vd_t *vd) { - int rval, status; + int rval, status; dev_t dev; char *file_path = vd->device_path; ldi_handle_t lhandle; @@ -6059,7 +6062,7 @@ vd_setup_disk_image(vd_t *vd) */ PR1("creating devid for %s", backend_path); - if (ddi_devid_init(vd->vds->dip, DEVID_FAB, NULL, 0, + if (ddi_devid_init(vd->vds->dip, DEVID_FAB, 0, 0, &vd->dskimg_devid) != DDI_SUCCESS) { PR0("fail to create devid for %s", backend_path); vd->dskimg_devid = NULL; @@ -6088,7 +6091,7 @@ vd_setup_disk_image(vd_t *vd) * Open a device using its device path (supplied by ldm(1m)) * * Parameters: - * vd - pointer to structure containing the vDisk info + * vd - pointer to structure containing the vDisk info * flags - open flags * * Return Value @@ -6491,7 +6494,7 @@ vd_backend_check_size(vd_t *vd) * a disk device or a volume device. * * Parameters: - * vd - pointer to structure containing the vDisk info + * vd - pointer to structure containing the vDisk info * dtype - return the driver type of the device * * Return Value @@ -6565,7 +6568,7 @@ vd_setup_vd(vd_t *vd) { int status, drv_type, pseudo; dev_info_t *dip; - vnode_t *vnp; + vnode_t *vnp; char *path = vd->device_path; char tq_name[TASKQ_NAMELEN]; @@ -7066,7 +7069,7 @@ vds_get_ldc_id(md_t *md, mde_cookie_t vd_node, uint64_t *ldc_id) * vds_get_options * * Description: - * Parse the options of a vds node. Options are defined as an array + * Parse the options of a vds node. Options are defined as an array * of strings in the vds-block-device-opts property of the vds node * in the machine description. Options are returned as a bitmask. The * mapping between the bitmask options and the options strings from the diff --git a/usr/src/uts/sun4v/io/vlds.c b/usr/src/uts/sun4v/io/vlds.c index a33978680e..e630328f0d 100644 --- a/usr/src/uts/sun4v/io/vlds.c +++ b/usr/src/uts/sun4v/io/vlds.c @@ -327,7 +327,7 @@ vlds_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } if (ddi_create_minor_node(devi, VLDS_NAME, S_IFCHR, - 0, DDI_PSEUDO, NULL) == DDI_FAILURE) { + 0, DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_remove_minor_node(devi, NULL); return (DDI_FAILURE); } diff --git a/usr/src/uts/sun4v/io/vnet.c b/usr/src/uts/sun4v/io/vnet.c index 96fb04175d..8abeaf911b 100644 --- a/usr/src/uts/sun4v/io/vnet.c +++ b/usr/src/uts/sun4v/io/vnet.c @@ -2481,7 +2481,7 @@ vnet_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val) macp = &vresp->macreg; cbp = macp->m_callbacks; - cbp->mc_getstat(macp->m_driver, stat, val); + (void) cbp->mc_getstat(macp->m_driver, stat, val); return (0); } diff --git a/usr/src/uts/sun4v/io/vnet_gen.c b/usr/src/uts/sun4v/io/vnet_gen.c index c872b641c6..ae89f44a33 100644 --- a/usr/src/uts/sun4v/io/vnet_gen.c +++ b/usr/src/uts/sun4v/io/vnet_gen.c @@ -297,7 +297,7 @@ static char vgen_linkprop_propname[] = "linkprop"; * 1.3 VLAN and HybridIO support. * 1.4 Jumbo Frame support. * 1.5 Link State Notification support with optional support - * for Physical Link information. + * for Physical Link information. * 1.6 Support for RxDringData mode. */ static vgen_ver_t vgen_versions[VGEN_NUM_VER] = { {1, 6} }; @@ -697,7 +697,7 @@ vgen_tx(void *arg, mblk_t *mp) */ static mblk_t * vgen_vlan_frame_fixtag(vgen_port_t *portp, mblk_t *mp, boolean_t is_tagged, - uint16_t vid) + uint16_t vid) { vgen_t *vgenp; boolean_t dst_tagged; @@ -781,8 +781,8 @@ vgen_portsend(vgen_port_t *portp, mblk_t *mp) vgen_ldc_t *ldcp; int status; int rv = VGEN_SUCCESS; - vgen_t *vgenp = portp->vgenp; - vnet_t *vnetp = vgenp->vnetp; + vgen_t *vgenp; + vnet_t *vnetp; boolean_t is_tagged; boolean_t dec_refcnt = B_FALSE; uint16_t vlan_id; @@ -792,6 +792,9 @@ vgen_portsend(vgen_port_t *portp, mblk_t *mp) return (VGEN_FAILURE); } + vgenp = portp->vgenp; + vnetp = vgenp->vnetp; + if (portp->use_vsw_port) { (void) atomic_inc_32(&vgenp->vsw_port_refcnt); portp = portp->vgenp->vsw_portp; @@ -1396,8 +1399,8 @@ vgen_readmd_exit: */ static void vgen_vlan_read_ids(void *arg, int type, md_t *mdp, mde_cookie_t node, - uint16_t *pvidp, uint16_t **vidspp, uint16_t *nvidsp, - uint16_t *default_idp) + uint16_t *pvidp, uint16_t **vidspp, uint16_t *nvidsp, + uint16_t *default_idp) { vgen_t *vgenp; vnet_t *vnetp; @@ -1686,7 +1689,7 @@ vgen_mtu_read(vgen_t *vgenp, md_t *mdp, mde_cookie_t node, uint32_t *mtu) static void vgen_linkprop_read(vgen_t *vgenp, md_t *mdp, mde_cookie_t node, - boolean_t *pls) + boolean_t *pls) { int rv; uint64_t val; @@ -1714,8 +1717,8 @@ vgen_mdeg_reg(vgen_t *vgenp) mdeg_node_spec_t *parentp; uint_t templatesz; int rv; - mdeg_handle_t dev_hdl = NULL; - mdeg_handle_t port_hdl = NULL; + mdeg_handle_t dev_hdl = 0; + mdeg_handle_t port_hdl = 0; templatesz = sizeof (vgen_prop_template); pspecp = kmem_zalloc(templatesz, KM_NOSLEEP); @@ -1767,7 +1770,7 @@ vgen_mdeg_reg(vgen_t *vgenp) return (DDI_SUCCESS); mdeg_reg_fail: - if (dev_hdl != NULL) { + if (dev_hdl != 0) { (void) mdeg_unregister(dev_hdl); } KMEM_FREE(parentp); @@ -1780,13 +1783,13 @@ mdeg_reg_fail: static void vgen_mdeg_unreg(vgen_t *vgenp) { - if (vgenp->mdeg_dev_hdl != NULL) { + if (vgenp->mdeg_dev_hdl != 0) { (void) mdeg_unregister(vgenp->mdeg_dev_hdl); - vgenp->mdeg_dev_hdl = NULL; + vgenp->mdeg_dev_hdl = 0; } - if (vgenp->mdeg_port_hdl != NULL) { + if (vgenp->mdeg_port_hdl != 0) { (void) mdeg_unregister(vgenp->mdeg_port_hdl); - vgenp->mdeg_port_hdl = NULL; + vgenp->mdeg_port_hdl = 0; } if (vgenp->mdeg_parentp != NULL) { @@ -1803,7 +1806,7 @@ vgen_mdeg_port_cb(void *cb_argp, mdeg_result_t *resp) { int idx; int vsw_idx = -1; - uint64_t val; + uint64_t val; vgen_t *vgenp; if ((resp == NULL) || (cb_argp == NULL)) { @@ -2108,7 +2111,7 @@ vgen_add_port(vgen_t *vgenp, md_t *mdp, mde_cookie_t mdex) /* read properties of the port from its md node */ static int vgen_port_read_props(vgen_port_t *portp, vgen_t *vgenp, md_t *mdp, - mde_cookie_t mdex) + mde_cookie_t mdex) { uint64_t port_num; uint64_t *ldc_ids; @@ -2362,7 +2365,7 @@ vgen_port_detach_mdeg(vgen_port_t *portp) static int vgen_update_port(vgen_t *vgenp, md_t *curr_mdp, mde_cookie_t curr_mdex, - md_t *prev_mdp, mde_cookie_t prev_mdex) + md_t *prev_mdp, mde_cookie_t prev_mdex) { uint64_t cport_num; uint64_t pport_num; @@ -2454,10 +2457,10 @@ vgen_port_stat(vgen_port_t *portp, uint_t stat) static int vgen_ldc_attach(vgen_port_t *portp, uint64_t ldc_id) { - vgen_t *vgenp; - vgen_ldc_t *ldcp; - ldc_attr_t attr; - int status; + vgen_t *vgenp; + vgen_ldc_t *ldcp; + ldc_attr_t attr; + int status; ldc_status_t istatus; char kname[MAXNAMELEN]; int instance; @@ -2567,7 +2570,7 @@ static void vgen_ldc_detach(vgen_ldc_t *ldcp) { vgen_port_t *portp; - vgen_t *vgenp; + vgen_t *vgenp; ASSERT(ldcp != NULL); @@ -3000,7 +3003,7 @@ vgen_ldc_cb(uint64_t event, caddr_t arg) _NOTE(ARGUNUSED(event)) vgen_ldc_t *ldcp; vgen_t *vgenp; - ldc_status_t istatus; + ldc_status_t istatus; vgen_stats_t *statsp; uint_t ret = LDC_SUCCESS; @@ -3012,7 +3015,7 @@ vgen_ldc_cb(uint64_t event, caddr_t arg) mutex_enter(&ldcp->cblock); statsp->callbacks++; - if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == NULL)) { + if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == 0)) { DWARN(vgenp, ldcp, "status(%d) is LDC_INIT\n", ldcp->ldc_status); mutex_exit(&ldcp->cblock); @@ -3111,8 +3114,8 @@ vgen_handle_evt_read(vgen_ldc_t *ldcp, vgen_caller_t caller) size_t msglen; vgen_t *vgenp = LDC_TO_VGEN(ldcp); vio_msg_tag_t *tagp; - ldc_status_t istatus; - boolean_t has_data; + ldc_status_t istatus; + boolean_t has_data; DBG1(vgenp, ldcp, "enter\n"); @@ -4227,7 +4230,7 @@ vgen_handshake_done(vgen_ldc_t *ldcp) { vgen_t *vgenp = LDC_TO_VGEN(ldcp); uint32_t hphase = ldcp->hphase; - int status = 0; + int status = 0; switch (hphase) { @@ -5724,7 +5727,7 @@ vgen_check_sid(vgen_ldc_t *ldcp, vio_msg_tag_t *tagp) */ static void vgen_init_dring_reg_msg(vgen_ldc_t *ldcp, vio_dring_reg_msg_t *msg, - uint8_t option) + uint8_t option) { vio_msg_tag_t *tagp; diff --git a/usr/src/uts/sun4v/io/vsw.c b/usr/src/uts/sun4v/io/vsw.c index 6ec8f997bd..1c4738d3e6 100644 --- a/usr/src/uts/sun4v/io/vsw.c +++ b/usr/src/uts/sun4v/io/vsw.c @@ -747,7 +747,7 @@ static int vsw_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) { vsw_t **vswpp, *vswp; - int instance; + int instance; instance = ddi_get_instance(dip); vswp = ddi_get_soft_state(vsw_state, instance); @@ -1435,8 +1435,8 @@ mdeg_reg_fail: kmem_free(pspecp, templatesz); kmem_free(inst_specp, sizeof (mdeg_node_spec_t)); - vswp->mdeg_hdl = NULL; - vswp->mdeg_port_hdl = NULL; + vswp->mdeg_hdl = 0; + vswp->mdeg_port_hdl = 0; return (1); } @@ -1446,10 +1446,10 @@ vsw_mdeg_unregister(vsw_t *vswp) { D1(vswp, "vsw_mdeg_unregister: enter"); - if (vswp->mdeg_hdl != NULL) + if (vswp->mdeg_hdl != 0) (void) mdeg_unregister(vswp->mdeg_hdl); - if (vswp->mdeg_port_hdl != NULL) + if (vswp->mdeg_port_hdl != 0) (void) mdeg_unregister(vswp->mdeg_port_hdl); if (vswp->inst_spec != NULL) { @@ -1812,8 +1812,8 @@ vsw_get_initial_md_properties(vsw_t *vswp, md_t *mdp, mde_cookie_t node) */ static void vsw_vlan_read_ids(void *arg, int type, md_t *mdp, mde_cookie_t node, - uint16_t *pvidp, vsw_vlanid_t **vidspp, uint16_t *nvidsp, - uint16_t *default_idp) + uint16_t *pvidp, vsw_vlanid_t **vidspp, uint16_t *nvidsp, + uint16_t *default_idp) { vsw_t *vswp; vsw_port_t *portp; @@ -2054,7 +2054,7 @@ vsw_mtu_update(vsw_t *vswp, uint32_t mtu) static void vsw_linkprop_read(vsw_t *vswp, md_t *mdp, mde_cookie_t node, - boolean_t *pls) + boolean_t *pls) { int rv; uint64_t val; @@ -2134,7 +2134,7 @@ vsw_update_md_prop(vsw_t *vswp, md_t *mdp, mde_cookie_t node) uint_t ddi_instance; uint8_t new_smode; int i; - uint64_t macaddr = 0; + uint64_t macaddr = 0; enum {MD_init = 0x1, MD_physname = 0x2, MD_macaddr = 0x4, @@ -2449,7 +2449,7 @@ fail_update: */ static int vsw_port_read_props(vsw_port_t *portp, vsw_t *vswp, - md_t *mdp, mde_cookie_t *node) + md_t *mdp, mde_cookie_t *node) { uint64_t ldc_id; uint8_t *addrp; @@ -2597,7 +2597,7 @@ vsw_port_add(vsw_t *vswp, md_t *mdp, mde_cookie_t *node) static int vsw_port_update(vsw_t *vswp, md_t *curr_mdp, mde_cookie_t curr_mdex, - md_t *prev_mdp, mde_cookie_t prev_mdex) + md_t *prev_mdp, mde_cookie_t prev_mdex) { uint64_t cport_num; uint64_t pport_num; diff --git a/usr/src/uts/sun4v/io/vsw_ldc.c b/usr/src/uts/sun4v/io/vsw_ldc.c index ee651e692b..099bb2b42d 100644 --- a/usr/src/uts/sun4v/io/vsw_ldc.c +++ b/usr/src/uts/sun4v/io/vsw_ldc.c @@ -279,7 +279,7 @@ extern uint32_t vsw_nrbufs_factor; * 1.3 VLAN and HybridIO support. * 1.4 Jumbo Frame support. * 1.5 Link State Notification support with optional support - * for Physical Link information. + * for Physical Link information. * 1.6 Support for RxDringData mode. */ static ver_sup_t vsw_versions[] = { {1, 6} }; @@ -471,7 +471,7 @@ vsw_port_detach(vsw_t *vswp, int p_instance) void vsw_detach_ports(vsw_t *vswp) { - vsw_port_list_t *plist = &vswp->plist; + vsw_port_list_t *plist = &vswp->plist; vsw_port_t *port = NULL; D1(vswp, "%s: enter", __func__); @@ -562,11 +562,11 @@ vsw_port_delete(vsw_port_t *port) static int vsw_ldc_attach(vsw_port_t *port, uint64_t ldc_id) { - vsw_t *vswp = port->p_vswp; - vsw_ldc_t *ldcp = NULL; - ldc_attr_t attr; + vsw_t *vswp = port->p_vswp; + vsw_ldc_t *ldcp = NULL; + ldc_attr_t attr; ldc_status_t istatus; - int status = DDI_FAILURE; + int status = DDI_FAILURE; char kname[MAXNAMELEN]; enum { PROG_init = 0x0, PROG_callback = 0x1, @@ -719,8 +719,8 @@ ldc_attach_fail: static void vsw_ldc_detach(vsw_ldc_t *ldcp) { - int rv; - vsw_t *vswp = ldcp->ldc_port->p_vswp; + int rv; + vsw_t *vswp = ldcp->ldc_port->p_vswp; int retries = 0; D2(vswp, "%s: detaching channel %lld", __func__, ldcp->ldc_id); @@ -773,7 +773,7 @@ vsw_ldc_detach(vsw_ldc_t *ldcp) (void) ldc_fini(ldcp->ldc_handle); ldcp->ldc_status = LDC_INIT; - ldcp->ldc_handle = NULL; + ldcp->ldc_handle = 0; ldcp->ldc_vswp = NULL; mutex_destroy(&ldcp->msg_thr_lock); @@ -800,7 +800,7 @@ vsw_ldc_detach(vsw_ldc_t *ldcp) static int vsw_ldc_init(vsw_ldc_t *ldcp) { - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; ldc_status_t istatus = 0; int rv; @@ -1238,7 +1238,7 @@ static uint_t vsw_ldc_cb(uint64_t event, caddr_t arg) { vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; D1(vswp, "%s: enter: ldcid (%lld)\n", __func__, ldcp->ldc_id); @@ -1246,7 +1246,7 @@ vsw_ldc_cb(uint64_t event, caddr_t arg) ldcp->ldc_stats.callbacks++; mutex_enter(&ldcp->status_lock); - if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == NULL)) { + if ((ldcp->ldc_status == LDC_INIT) || (ldcp->ldc_handle == 0)) { mutex_exit(&ldcp->status_lock); mutex_exit(&ldcp->ldc_cblock); return (LDC_SUCCESS); @@ -2075,11 +2075,11 @@ void vsw_process_pkt(void *arg) { vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; size_t msglen; vio_msg_tag_t *tagp; uint64_t *ldcmsg; - int rv = 0; + int rv = 0; D1(vswp, "%s enter: ldcid (%lld)\n", __func__, ldcp->ldc_id); @@ -2145,7 +2145,7 @@ vsw_process_pkt(void *arg) */ static void vsw_dispatch_ctrl_task(vsw_ldc_t *ldcp, void *cpkt, vio_msg_tag_t *tagp, - int msglen) + int msglen) { vsw_ctrl_task_t *ctaskp = NULL; vsw_port_t *port = ldcp->ldc_port; @@ -2221,7 +2221,7 @@ vsw_process_ctrl_pkt(void *arg) { vsw_ctrl_task_t *ctaskp = (vsw_ctrl_task_t *)arg; vsw_ldc_t *ldcp = ctaskp->ldcp; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; vio_msg_tag_t tag; uint16_t env; @@ -2305,7 +2305,7 @@ void vsw_process_ctrl_ver_pkt(vsw_ldc_t *ldcp, void *pkt) { vio_ver_msg_t *ver_pkt; - vsw_t *vswp = ldcp->ldc_vswp; + vsw_t *vswp = ldcp->ldc_vswp; D1(vswp, "%s(%lld): enter", __func__, ldcp->ldc_id); @@ -3362,7 +3362,7 @@ vsw_process_physlink_msg(vsw_ldc_t *ldcp, void *pkt) static void vsw_process_data_pkt(vsw_ldc_t *ldcp, void *dpkt, vio_msg_tag_t *tagp, - uint32_t msglen) + uint32_t msglen) { uint16_t env = tagp->vio_subtype_env; vsw_t *vswp = ldcp->ldc_vswp; @@ -3747,7 +3747,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) { mblk_t *mpt; int count; - vsw_ldc_t *ldcp = port->ldcp; + vsw_ldc_t *ldcp = port->ldcp; int status = 0; count = vsw_vlan_frame_untag(port, VSW_VNETPORT, &mp, &mpt); @@ -3763,7 +3763,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) * priority frames is also counted and returned. * * Params: - * vswp: pointer to the instance of vsw + * vswp: pointer to the instance of vsw * np: head of packet chain to be broken * npt: tail of packet chain to be broken * @@ -3775,7 +3775,7 @@ vsw_portsend(vsw_port_t *port, mblk_t *mp) */ static uint32_t vsw_get_pri_packets(vsw_t *vswp, mblk_t **np, mblk_t **npt, - mblk_t **hp, mblk_t **hpt) + mblk_t **hp, mblk_t **hpt) { mblk_t *tmp = NULL; mblk_t *smp = NULL; @@ -3840,7 +3840,7 @@ vsw_get_pri_packets(vsw_t *vswp, mblk_t **np, mblk_t **npt, static int vsw_ldctx_pri(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) { - vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; + vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; mblk_t *tmp; mblk_t *smp; mblk_t *hmp; /* high prio pkts head */ @@ -3884,7 +3884,7 @@ vsw_ldctx_pri(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) static int vsw_ldctx(void *arg, mblk_t *mp, mblk_t *mpt, uint32_t count) { - vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; + vsw_ldc_t *ldcp = (vsw_ldc_t *)arg; mblk_t *tmp = NULL; ASSERT(count != 0); @@ -3952,7 +3952,7 @@ vsw_ldcsend_pkt(vsw_ldc_t *ldcp, mblk_t *mp) vgen_stats_t *statsp = &ldcp->ldc_stats; if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { (void) atomic_inc_32(&statsp->tx_pri_fail); DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, @@ -4121,7 +4121,7 @@ vsw_descrsend(vsw_ldc_t *ldcp, mblk_t *mp) ASSERT(mp != NULL); if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DERR(vswp, "%s(%lld) status(%d) state (0x%llx), dropping pkt", __func__, ldcp->ldc_id, ldcp->ldc_status, ldcp->lane_out.lstate); @@ -4566,7 +4566,7 @@ vsw_map_dring_cmn(vsw_ldc_t *ldcp, vio_dring_reg_msg_t *dring_pkt) return (dp); fail: - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (*dp)); @@ -4836,9 +4836,9 @@ display_state(void) { vsw_t *vswp; vsw_port_list_t *plist; - vsw_port_t *port; - vsw_ldc_t *ldcp; - extern vsw_t *vsw_head; + vsw_port_t *port; + vsw_ldc_t *ldcp; + extern vsw_t *vsw_head; cmn_err(CE_NOTE, "***** system state *****"); diff --git a/usr/src/uts/sun4v/io/vsw_rxdring.c b/usr/src/uts/sun4v/io/vsw_rxdring.c index 5661a00bd8..adbed65efc 100644 --- a/usr/src/uts/sun4v/io/vsw_rxdring.c +++ b/usr/src/uts/sun4v/io/vsw_rxdring.c @@ -415,7 +415,7 @@ vsw_destroy_rx_dring(vsw_ldc_t *ldcp) } /* Finally, free the receive descriptor ring */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unbind(dp->dring_handle); (void) ldc_mem_dring_destroy(dp->dring_handle); } @@ -491,7 +491,7 @@ vsw_map_tx_dring(vsw_ldc_t *ldcp, void *pkt) return (dp); fail: - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (*dp)); @@ -512,10 +512,10 @@ vsw_unmap_tx_dring(vsw_ldc_t *ldcp) } /* Unmap tx data area and free data handle */ - if (dp->data_handle != NULL) { + if (dp->data_handle != 0) { (void) ldc_mem_unmap(dp->data_handle); (void) ldc_mem_free_handle(dp->data_handle); - dp->data_handle = NULL; + dp->data_handle = 0; } /* Free tx data area cookies */ @@ -527,9 +527,9 @@ vsw_unmap_tx_dring(vsw_ldc_t *ldcp) } /* Unmap peer's dring */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); - dp->dring_handle = NULL; + dp->dring_handle = 0; } mutex_destroy(&dp->txlock); @@ -877,7 +877,7 @@ vsw_dringsend_shm(vsw_ldc_t *ldcp, mblk_t *mp) vsw_t *vswp = ldcp->ldc_vswp; if ((!(lane_in->lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, lane_in->lstate); diff --git a/usr/src/uts/sun4v/io/vsw_txdring.c b/usr/src/uts/sun4v/io/vsw_txdring.c index afe0e5b6e5..26a9a401a9 100644 --- a/usr/src/uts/sun4v/io/vsw_txdring.c +++ b/usr/src/uts/sun4v/io/vsw_txdring.c @@ -394,7 +394,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) */ for (i = 0; i < vsw_num_descriptors; i++) { paddr = (vsw_private_desc_t *)dp->priv_addr + i; - if (paddr->memhandle != NULL) { + if (paddr->memhandle != 0) { if (paddr->bound == 1) { if (ldc_mem_unbind_handle( paddr->memhandle) != 0) { @@ -414,7 +414,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) "at pos %d", dp, i); continue; } - paddr->memhandle = NULL; + paddr->memhandle = 0; } mutex_destroy(&paddr->dstate_lock); } @@ -425,7 +425,7 @@ vsw_destroy_tx_dring(vsw_ldc_t *ldcp) /* * Now unbind and destroy the ring itself. */ - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unbind(dp->dring_handle); (void) ldc_mem_dring_destroy(dp->dring_handle); } @@ -505,7 +505,7 @@ vsw_unmap_rx_dring(vsw_ldc_t *ldcp) vsw_destroy_rxpools, fvmp, DDI_SLEEP); } - if (dp->dring_handle != NULL) { + if (dp->dring_handle != 0) { (void) ldc_mem_dring_unmap(dp->dring_handle); } kmem_free(dp, sizeof (dring_info_t)); @@ -800,7 +800,7 @@ vsw_dringsend(vsw_ldc_t *ldcp, mblk_t *mp) /* TODO: make test a macro */ if ((!(ldcp->lane_out.lstate & VSW_LANE_ACTIVE)) || - (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == NULL)) { + (ldcp->ldc_status != LDC_UP) || (ldcp->ldc_handle == 0)) { DWARN(vswp, "%s(%lld) status(%d) lstate(0x%llx), dropping " "packet\n", __func__, ldcp->ldc_id, ldcp->ldc_status, ldcp->lane_out.lstate); @@ -942,7 +942,7 @@ vsw_dringsend_free_exit: */ int vsw_dring_find_free_desc(dring_info_t *dringp, - vsw_private_desc_t **priv_p, int *idx) + vsw_private_desc_t **priv_p, int *idx) { vsw_private_desc_t *addr = NULL; int num = vsw_num_descriptors; diff --git a/usr/src/uts/sun4v/kt/Makefile b/usr/src/uts/sun4v/kt/Makefile index f4721ae345..4d2d27ba15 100644 --- a/usr/src/uts/sun4v/kt/Makefile +++ b/usr/src/uts/sun4v/kt/Makefile @@ -37,7 +37,6 @@ UTSBASE = ../.. # MODULE = SPARC-T3 OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -57,13 +56,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DKT_IMPL +CFLAGS += -DKT_IMPL # # The ATOMIC_BO_ENABLE_SHIFT enables backoff in atomic routines. @@ -95,12 +90,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/ldc/Makefile b/usr/src/uts/sun4v/ldc/Makefile index f1c044bb36..4e4aaba6d4 100644 --- a/usr/src/uts/sun4v/ldc/Makefile +++ b/usr/src/uts/sun4v/ldc/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = ldc OBJECTS = $(LDC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(LDC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -61,23 +60,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_ASSIGN_NARROW_CONV -LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW - CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-parentheses @@ -94,12 +78,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/n2piupc/Makefile b/usr/src/uts/sun4v/n2piupc/Makefile index c4cd3e1b44..2577303a0b 100644 --- a/usr/src/uts/sun4v/n2piupc/Makefile +++ b/usr/src/uts/sun4v/n2piupc/Makefile @@ -41,7 +41,6 @@ UTSBASE = ../.. # MODULE = n2piupc OBJECTS = $(N2PIUPC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(N2PIUPC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4v/io/n2piupc @@ -54,7 +53,6 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # @@ -62,10 +60,6 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # INC_PATH += -I$(UTSBASE)/sun4v/io/n2piupc -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += -_gcc=-Wno-unused-label # @@ -74,11 +68,6 @@ CERRWARN += -_gcc=-Wno-unused-label CFLAGS += -dalign -DMODULE_NAME=\"$(MODULE)\" # -# Lint needs module name too -# -LINTFLAGS += -DMODULE_NAME=\"$(MODULE)\" - -# # Default build targets. # .KEEP_STATE: @@ -91,12 +80,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/n2rng/Makefile b/usr/src/uts/sun4v/n2rng/Makefile index ba94b5bdfb..474b4294fa 100644 --- a/usr/src/uts/sun4v/n2rng/Makefile +++ b/usr/src/uts/sun4v/n2rng/Makefile @@ -40,7 +40,6 @@ COM_DIR = $(COMMONBASE)/crypto # MODULE = n2rng OBJECTS = $(N2RNG_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(N2RNG_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4v/io/n2rng @@ -60,14 +59,9 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) -# -# lint pass one enforcement -# CFLAGS += $(CCVERBOSE) -DN2 -I$(COM_DIR) -LINTFLAGS += -DN2 -I$(COM_DIR) CERRWARN += $(CNOWARN_UNINIT) # @@ -88,12 +82,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/niagara/Makefile b/usr/src/uts/sun4v/niagara/Makefile index 713198a991..181c06f9d4 100644 --- a/usr/src/uts/sun4v/niagara/Makefile +++ b/usr/src/uts/sun4v/niagara/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T1 OBJECTS = $(NIAGARACPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARACPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -60,13 +59,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DNIAGARA_IMPL +CFLAGS += -DNIAGARA_IMPL CERRWARN += -_gcc=-Wno-parentheses # @@ -88,12 +83,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/niagara2/Makefile b/usr/src/uts/sun4v/niagara2/Makefile index 39a01ef025..f6f4d3843e 100644 --- a/usr/src/uts/sun4v/niagara2/Makefile +++ b/usr/src/uts/sun4v/niagara2/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T2 OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -59,13 +58,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DNIAGARA2_IMPL +CFLAGS += -DNIAGARA2_IMPL # # cpu-module-specific flags @@ -97,12 +92,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/ntwdt/Makefile b/usr/src/uts/sun4v/ntwdt/Makefile index 5aae3d419a..2685934ffe 100644 --- a/usr/src/uts/sun4v/ntwdt/Makefile +++ b/usr/src/uts/sun4v/ntwdt/Makefile @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the ntwdt driver module. # # sun4v implementation architecture dependent @@ -37,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = ntwdt +MODULE = ntwdt OBJECTS = $(NTWDT_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NTWDT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4v/io @@ -59,15 +56,9 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# lint pass one enforcement -# -CFLAGS += -v - -# # Default build targets. # .KEEP_STATE: @@ -80,12 +71,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/ontario/io/tsalarm.c b/usr/src/uts/sun4v/ontario/io/tsalarm.c index ebf15565c8..7fb9577028 100644 --- a/usr/src/uts/sun4v/ontario/io/tsalarm.c +++ b/usr/src/uts/sun4v/ontario/io/tsalarm.c @@ -410,7 +410,7 @@ tsalarm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) * the device's softc, is used to direct peculiar behavior. */ if (ddi_create_minor_node(dip, "lom", S_IFCHR, 0, - DDI_PSEUDO, NULL) == DDI_FAILURE) { + DDI_PSEUDO, 0) == DDI_FAILURE) { goto attach_failed; } @@ -749,7 +749,7 @@ glvc_alarm_get(int alarm_type, int *alarm_state, tsalarm_softc_t *sc) req_ptr->alarm_id = alarm_type; send_msg.msg_type = PCP_ALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsal_pcp_alarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; @@ -824,7 +824,7 @@ glvc_alarm_set(int alarm_type, int new_state, tsalarm_softc_t *sc) req_ptr->alarm_id = alarm_type; send_msg.msg_type = PCP_ALARM_CONTROL; - send_msg.sub_type = NULL; + send_msg.sub_type = 0; send_msg.msg_len = sizeof (tsal_pcp_alarm_req_t); send_msg.msg_data = (uint8_t *)req_ptr; diff --git a/usr/src/uts/sun4v/pcie/Makefile b/usr/src/uts/sun4v/pcie/Makefile index 12cf0358a9..7378fe095d 100644 --- a/usr/src/uts/sun4v/pcie/Makefile +++ b/usr/src/uts/sun4v/pcie/Makefile @@ -42,8 +42,6 @@ UTSBASE = ../.. MODULE = pcie OBJECTS = $(PCIE_MISC_OBJS:%=$(OBJS_DIR)/%) \ $(PCI_STRING_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PCIE_MISC_OBJS:%.o=$(LINTS_DIR)/%.ln) \ - $(PCI_STRING_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -55,7 +53,6 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # @@ -81,12 +78,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/platsvc/Makefile b/usr/src/uts/sun4v/platsvc/Makefile index 0c56b38552..14315fe472 100644 --- a/usr/src/uts/sun4v/platsvc/Makefile +++ b/usr/src/uts/sun4v/platsvc/Makefile @@ -35,9 +35,8 @@ UTSBASE = ../.. # # Define the module and object file sets. # -MODULE = platsvc +MODULE = platsvc OBJECTS = $(PLATSVC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(PLATSVC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_MISC_DIR)/$(MODULE) # @@ -49,13 +48,8 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CERRWARN += $(CNOWARN_UNINIT) # @@ -81,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/sun4v/sys/ds_impl.h b/usr/src/uts/sun4v/sys/ds_impl.h index a2a06d21a3..00e8ba7680 100644 --- a/usr/src/uts/sun4v/sys/ds_impl.h +++ b/usr/src/uts/sun4v/sys/ds_impl.h @@ -196,7 +196,7 @@ typedef struct ds_port { uint32_t ver_idx; /* index of version during handshake */ ds_ldc_t ldc; /* LDC for this port */ ds_domain_hdl_t domain_hdl; /* LDOMs domain hdl assoc. with port */ - char *domain_name; /* LDOMs domain name assoc. with port */ + char *domain_name; /* LDOMs domain name assoc. with port */ } ds_port_t; #define IS_DS_PORT(port) 1 /* VBSC code compatability */ @@ -404,7 +404,7 @@ typedef struct ds_log_entry { #define DS_LOG_POOL_END (ds_log_entry_pool + DS_LOG_NPOOL) #define DS_IS_POOL_ENTRY(ep) (((ep) >= ds_log_entry_pool) && \ - ((ep) <= &(ds_log_entry_pool[DS_LOG_NPOOL]))) + ((ep) < &(ds_log_entry_pool[DS_LOG_NPOOL]))) /* VBSC code compatability related defines */ @@ -554,8 +554,8 @@ void ds_dump_msg(void *buf, size_t len); #define DS_DUMP_MSG(flags, buf, len) #define DS_DUMP_LDC_MSG(buf, len) -#define DS_BADHDL1 NULL -#define DS_BADHDL2 NULL +#define DS_BADHDL1 (ds_svc_hdl_t)0 +#define DS_BADHDL2 (ds_svc_hdl_t)0 #endif /* DEBUG */ diff --git a/usr/src/uts/sun4v/sys/ldc_impl.h b/usr/src/uts/sun4v/sys/ldc_impl.h index 4acea4f84f..be381ad018 100644 --- a/usr/src/uts/sun4v/sys/ldc_impl.h +++ b/usr/src/uts/sun4v/sys/ldc_impl.h @@ -229,7 +229,7 @@ typedef struct ldc_msg { uint8_t _type; /* Message type */ uint8_t _stype; /* Message subtype */ uint8_t _ctrl; /* Control/Error Message */ - uint8_t _env; /* Message Envelope */ + uint8_t _env; /* Message Envelope */ uint32_t _seqid; /* Sequence ID */ union { @@ -285,7 +285,7 @@ typedef union { pgszc:4; /* <3:0> pgsz code */ } mte_bit; - uint64_t ll; + uint64_t ll; } ldc_mte_t; @@ -300,8 +300,8 @@ typedef union { #define mte_pgszc mte_bit.pgszc #define MTE_BSZS_SHIFT(sz) ((sz) * 3) -#define MTEBYTES(sz) (MMU_PAGESIZE << MTE_BSZS_SHIFT(sz)) -#define MTEPAGES(sz) (1 << MTE_BSZS_SHIFT(sz)) +#define MTEBYTES(sz) (MMU_PAGESIZE << MTE_BSZS_SHIFT(sz)) +#define MTEPAGES(sz) (1 << MTE_BSZS_SHIFT(sz)) #define MTE_PAGE_SHIFT(sz) (MMU_PAGESHIFT + MTE_BSZS_SHIFT(sz)) #define MTE_PAGE_OFFSET(sz) (MTEBYTES(sz) - 1) #define MTE_PAGEMASK(sz) (~MTE_PAGE_OFFSET(sz)) @@ -400,7 +400,7 @@ typedef struct ldc_dring { ldc_mem_handle_t mhdl; /* Mem handle to desc ring */ struct ldc_dring *ch_next; /* Next dring in channel */ - struct ldc_dring *next; /* Next dring overall */ + struct ldc_dring *next; /* Next dring overall */ } ldc_dring_t; @@ -493,11 +493,11 @@ struct ldc_chan { * LDC module soft state structure */ typedef struct ldc_soft_state { - kmutex_t lock; /* Protects ldc_soft_state_t */ + kmutex_t lock; /* Protects ldc_soft_state_t */ ldc_cnex_t cinfo; /* channel nexus info */ uint64_t channel_count; /* Number of channels */ uint64_t channels_open; /* Number of open channels */ - ldc_chan_t *chan_list; /* List of LDC endpoints */ + ldc_chan_t *chan_list; /* List of LDC endpoints */ ldc_dring_t *dring_list; /* Descriptor rings (for export) */ kmem_cache_t *memhdl_cache; /* Memory handle cache */ @@ -522,9 +522,9 @@ if (ldcdbg & 0x02) \ if (ldcdbg & 0x04) \ ldcdebug #else -#define D1 -#define D2 -#define DWARN +#define D1(...) +#define D2(...) +#define DWARN(...) #endif #ifdef __cplusplus diff --git a/usr/src/uts/sun4v/sys/vnet.h b/usr/src/uts/sun4v/sys/vnet.h index 81b958fedf..04d2df006a 100644 --- a/usr/src/uts/sun4v/sys/vnet.h +++ b/usr/src/uts/sun4v/sys/vnet.h @@ -90,16 +90,16 @@ typedef struct vnet_hio_kstats { kstat_named_t oerrors; /* required by kstat for MIB II objects(RFC 1213) */ - kstat_named_t rbytes; /* MIB - ifInOctets */ + kstat_named_t rbytes; /* MIB - ifInOctets */ kstat_named_t rbytes64; - kstat_named_t obytes; /* MIB - ifOutOctets */ + kstat_named_t obytes; /* MIB - ifOutOctets */ kstat_named_t obytes64; - kstat_named_t multircv; /* MIB - ifInNUcastPkts */ - kstat_named_t multixmt; /* MIB - ifOutNUcastPkts */ + kstat_named_t multircv; /* MIB - ifInNUcastPkts */ + kstat_named_t multixmt; /* MIB - ifOutNUcastPkts */ kstat_named_t brdcstrcv; /* MIB - ifInNUcastPkts */ kstat_named_t brdcstxmt; /* MIB - ifOutNUcastPkts */ - kstat_named_t norcvbuf; /* MIB - ifInDiscards */ - kstat_named_t noxmtbuf; /* MIB - ifOutDiscards */ + kstat_named_t norcvbuf; /* MIB - ifInDiscards */ + kstat_named_t noxmtbuf; /* MIB - ifOutDiscards */ } vnet_hio_kstats_t; typedef struct vnet_tx_ring_stats { @@ -348,10 +348,10 @@ enum { DBG_LEVEL1 = 0x01, DBG_LEVEL2 = 0x02, DBG_WARN = 0x04, #else -#define DBG1(...) if (0) do { } while (0) -#define DBG2(...) if (0) do { } while (0) -#define DWARN(...) if (0) do { } while (0) -#define DERR(...) if (0) do { } while (0) +#define DBG1(...) +#define DBG2(...) +#define DWARN(...) +#define DERR(...) #endif diff --git a/usr/src/uts/sun4v/trapstat/Makefile b/usr/src/uts/sun4v/trapstat/Makefile index fa735a534e..1e1c5b71b1 100644 --- a/usr/src/uts/sun4v/trapstat/Makefile +++ b/usr/src/uts/sun4v/trapstat/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 production of the trapstat kernel module. # # sun4v implementation architecture dependent @@ -39,7 +37,6 @@ UTSBASE = ../.. # MODULE = trapstat OBJECTS = $(TRAPSTAT_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(TRAPSTAT_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/sun4/io @@ -52,23 +49,9 @@ include $(UTSBASE)/sun4v/Makefile.sun4v # Define targets # ALL_TARGET = $(BINARY) $(SRC_CONFFILE) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # -# 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 - -# # Default build targets. # .KEEP_STATE: @@ -81,12 +64,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/vdc/Makefile b/usr/src/uts/sun4v/vdc/Makefile index 9877103746..d9bf73ea19 100644 --- a/usr/src/uts/sun4v/vdc/Makefile +++ b/usr/src/uts/sun4v/vdc/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = vdc OBJECTS = $(VDC_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VDC_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -59,7 +58,6 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) @@ -83,12 +81,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/vds/Makefile b/usr/src/uts/sun4v/vds/Makefile index 664b987d0f..b4df7add5f 100644 --- a/usr/src/uts/sun4v/vds/Makefile +++ b/usr/src/uts/sun4v/vds/Makefile @@ -40,7 +40,6 @@ UTSBASE = ../.. # MODULE = vds OBJECTS = $(VDS_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VDS_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -59,7 +58,6 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) @@ -85,12 +83,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/vfalls/Makefile b/usr/src/uts/sun4v/vfalls/Makefile index 001654791b..57494194a4 100644 --- a/usr/src/uts/sun4v/vfalls/Makefile +++ b/usr/src/uts/sun4v/vfalls/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = SUNW,UltraSPARC-T2+ OBJECTS = $(NIAGARA2CPU_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(NIAGARA2CPU_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) CPU_DIR = . @@ -59,13 +58,9 @@ CLEANFILES += $(CPULIB) $(SYM_MOD) # Define targets # ALL_TARGET = $(SYM_MOD) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) -DVFALLS_IMPL +CFLAGS += -DVFALLS_IMPL # # cpu-module-specific flags @@ -97,12 +92,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) $(CPULIB): $(OBJECTS) diff --git a/usr/src/uts/sun4v/vlds/Makefile b/usr/src/uts/sun4v/vlds/Makefile index 7ef22bfc35..4bc93801bd 100644 --- a/usr/src/uts/sun4v/vlds/Makefile +++ b/usr/src/uts/sun4v/vlds/Makefile @@ -39,7 +39,6 @@ UTSBASE = ../.. # MODULE = vlds OBJECTS = $(VLDS_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VLDS_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -58,13 +57,8 @@ 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-parentheses # @@ -84,12 +78,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/vnet/Makefile b/usr/src/uts/sun4v/vnet/Makefile index 858c2c58da..21e1ea2b9c 100644 --- a/usr/src/uts/sun4v/vnet/Makefile +++ b/usr/src/uts/sun4v/vnet/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = vnet OBJECTS = $(VNET_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VNET_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -61,13 +60,8 @@ CLEANFILES += $(MODSTUBS_O) # Define targets # ALL_TARGET = $(BINARY) -LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) -# -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) CFLAGS += -DVGEN_HANDLE_LOST_PKTS # @@ -75,17 +69,6 @@ CFLAGS += -DVGEN_HANDLE_LOST_PKTS # LDFLAGS += -dy -N misc/mac -N drv/ip -N misc/ldc -N misc/platsvc -# -# 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 -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-unused-label @@ -107,12 +90,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/vsw/Makefile b/usr/src/uts/sun4v/vsw/Makefile index e7d0a439e7..7d012ec8a0 100644 --- a/usr/src/uts/sun4v/vsw/Makefile +++ b/usr/src/uts/sun4v/vsw/Makefile @@ -42,7 +42,6 @@ UTSBASE = ../.. # MODULE = vsw OBJECTS = $(VSW_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(VSW_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE) # @@ -65,26 +64,10 @@ LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # -# lint pass one enforcement -# -CFLAGS += $(CCVERBOSE) - -# # Module dependencies # LDFLAGS += -dy -Nmisc/ldc -Nmisc/mac -Nmisc/platsvc -# -# 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 -LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON - CERRWARN += -_gcc=-Wno-type-limits CERRWARN += -_gcc=-Wno-clobbered CERRWARN += -_gcc=-Wno-unused-variable @@ -105,12 +88,6 @@ clean: $(CLEAN_DEPS) clobber: $(CLOBBER_DEPS) -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - install: $(INSTALL_DEPS) # |