diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/wrsmstat/wrsmstat.c | 6 | ||||
-rw-r--r-- | usr/src/lib/libwrsmconf/libwrsmconf.c | 7 | ||||
-rw-r--r-- | usr/src/lib/wrsm/librsmwrsm.c | 20 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_cf.c | 19 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_driver.c | 4 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_getput.c | 4 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_intr.c | 5 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_lc.c | 6 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_mh.c | 7 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_nc.c | 4 | ||||
-rw-r--r-- | usr/src/uts/sun4u/io/wrsm/wrsm_nr.c | 11 | ||||
-rw-r--r-- | usr/src/uts/sun4u/sys/wrsm_memseg_impl.h | 4 |
12 files changed, 33 insertions, 64 deletions
diff --git a/usr/src/cmd/wrsmstat/wrsmstat.c b/usr/src/cmd/wrsmstat/wrsmstat.c index 8ea331861d..d190ffd03e 100644 --- a/usr/src/cmd/wrsmstat/wrsmstat.c +++ b/usr/src/cmd/wrsmstat/wrsmstat.c @@ -20,8 +20,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 2001 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -154,7 +154,7 @@ typedef union { static boolean_t msg_test = B_FALSE; #define NOT_FOUND 0xffffffff -#define NOT_FOUND64 0xffffffffffffffff +#define NOT_FOUND64 0xffffffffffffffffULL static uint32_t find_named(kstat_t *ksp, char *name); static uint64_t find_named64(kstat_t *ksp, char *name); static char *find_named_char(kstat_t *ksp, char *name); diff --git a/usr/src/lib/libwrsmconf/libwrsmconf.c b/usr/src/lib/libwrsmconf/libwrsmconf.c index ac46b7033c..e688342a28 100644 --- a/usr/src/lib/libwrsmconf/libwrsmconf.c +++ b/usr/src/lib/libwrsmconf/libwrsmconf.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -125,11 +125,6 @@ wrsm_check_config(wrsm_controller_t *cont) DPRINTF(("ERROR: members[%d] is null\n", i)); return (EINVAL); } - if (member->cnodeid >= WRSM_MAX_CNODES) { - DPRINTF(("ERROR: cnode id %d exceeds max of %d\n", - member->cnodeid, WRSM_MAX_CNODES)); - return (EINVAL); - } if (WRSM_IN_SET(cnode_bitmask, member->cnodeid)) { DPRINTF(("ERROR: cnode id %d appears twice\n", member->cnodeid)); diff --git a/usr/src/lib/wrsm/librsmwrsm.c b/usr/src/lib/wrsm/librsmwrsm.c index 75ffc975cb..5b1863699a 100644 --- a/usr/src/lib/wrsm/librsmwrsm.c +++ b/usr/src/lib/wrsm/librsmwrsm.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -225,8 +225,8 @@ wrsmlib_align(wrsmlib_raw_message_t *raw_msg) DEBUGP(PLUGIN_DEBUG, ("librsmwrsm: wrsmlib_align\n")); - addr = (void *)(((uint64_t)raw_msg + WRSMLIB_ALIGN) & - ~WRSMLIB_CACHELINE_MASK); + addr = (void *)(((uintptr_t)raw_msg + (uintptr_t)WRSMLIB_ALIGN) & + ~(uintptr_t)WRSMLIB_CACHELINE_MASK); return (addr); @@ -869,7 +869,7 @@ wrsm_memseg_import_get16(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint16_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x1) != 0) || + if ((((uintptr_t)datap & 0x1) != 0) || (((uint64_t)offset & 0x1) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } @@ -884,7 +884,7 @@ wrsm_memseg_import_get32(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint32_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x3) != 0) || + if ((((uintptr_t)datap & 0x3) != 0) || (((uint64_t)offset & 0x3) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } @@ -899,7 +899,7 @@ wrsm_memseg_import_get64(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint64_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x7) != 0) || + if ((((uintptr_t)datap & 0x7) != 0) || (((uint64_t)offset & 0x7) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } @@ -1003,7 +1003,7 @@ wrsm_memseg_import_get(rsm_memseg_import_handle_t im_memseg, off_t offset, seg = RSMNDI_GET_MAPADDR(im_memseg, offset); ASSERT(seg); - if (((uint64_t)dp & (uint64_t)WRSMLIB_CACHELINE_MASK) + if (((uintptr_t)dp & (uintptr_t)WRSMLIB_CACHELINE_MASK) == 0) { /* aligned cacheline - this is to be fixed */ if (!importsegp->isloopback) { @@ -1069,7 +1069,7 @@ wrsm_memseg_import_put16(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint16_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x1) != 0) || + if ((((uintptr_t)datap & 0x1) != 0) || (((uint64_t)offset & 0x1) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } @@ -1084,7 +1084,7 @@ wrsm_memseg_import_put32(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint32_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x3) != 0) || + if ((((uintptr_t)datap & 0x3) != 0) || (((uint64_t)offset & 0x3) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } @@ -1099,7 +1099,7 @@ wrsm_memseg_import_put64(rsm_memseg_import_handle_t im_memseg, off_t offset, size_t len = (size_t)(sizeof (uint64_t) * rep_cnt); /* Check for valid alignment */ - if ((((uint64_t)datap & 0x7) != 0) || + if ((((uintptr_t)datap & 0x7) != 0) || (((uint64_t)offset & 0x7) != 0)) { return (RSMERR_BAD_MEM_ALIGNMENT); } diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_cf.c b/usr/src/uts/sun4u/io/wrsm/wrsm_cf.c index 7cb45a466b..e6fa792833 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_cf.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_cf.c @@ -1693,12 +1693,6 @@ verify_config(wrsm_controller_t *config, ncslice_bitmask_t *new_ncslices) int err; wrsm_net_member_t *member; - if (config->cnodeid < 0 || config->cnodeid >= WRSM_MAX_CNODES) { - cmn_err(CE_NOTE, "verify: illegal local cnodeid %d", - config->cnodeid); - return (EINVAL); - } - /* * Verify that the local wnode is mentioned in the reachable * list and that it points to the local cnode @@ -1757,14 +1751,6 @@ verify_config(wrsm_controller_t *config, ncslice_bitmask_t *new_ncslices) return (EINVAL); } - /* Check that the remote cnodeid is valid */ - if (member->cnodeid < 0 || - member->cnodeid >= WRSM_MAX_CNODES) { - cmn_err(CE_NOTE, "verify: illegal local cnodeid %d", - member->cnodeid); - return (EINVAL); - } - /* Check that in and out driver comm offsets are unique */ for (j = 0; j < config->nmembers; ++j) { @@ -2739,7 +2725,7 @@ wrsm_cf_ncslicelist_to_bitmask(wrsm_node_ncslice_array_t slice_array, int i; *small_ncslicep = slice_array.id[0]; - if (*small_ncslicep == 0 || *small_ncslicep >= WRSM_MAX_NCSLICES) { + if (*small_ncslicep == 0) { return (EINVAL); } @@ -2754,9 +2740,6 @@ wrsm_cf_ncslicelist_to_bitmask(wrsm_node_ncslice_array_t slice_array, if (slice_array.id[i] == 0) { continue; } - if (slice_array.id[i] >= WRSM_MAX_NCSLICES) { - return (EINVAL); - } if (!wrsm_large_pages_supported) { cmn_err(CE_NOTE, "verify: large page ncslices not supported"); diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_driver.c b/usr/src/uts/sun4u/io/wrsm/wrsm_driver.c index f00fe29b89..fd13090931 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_driver.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_driver.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -384,7 +384,7 @@ wrsm_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) instance = minor_to_instance[minor]; if (instance == -1) return (DDI_FAILURE); - *result = (void *) instance; + *result = (void *)(uintptr_t)instance; return (DDI_SUCCESS); default: diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_getput.c b/usr/src/uts/sun4u/io/wrsm/wrsm_getput.c index 439d1e3ce3..2dc85fcd50 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_getput.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_getput.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -733,7 +733,7 @@ wrsm_smallput_plugin_ioctl(int minor, int cmd, intptr_t arg, int mode, pluginmsg.remote_cnodeid = pluginmsg32.remote_cnodeid; pluginmsg.offset = pluginmsg32.offset; - if (ddi_copyin((void *)pluginmsg32.buf, msg->putdata, + if (ddi_copyin((void *)(uintptr_t)pluginmsg32.buf, msg->putdata, pluginmsg32.len, mode) != 0) { DPRINTF(DBG_SMPUT, (CE_WARN, "wrsm_smallput_plugin_" diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_intr.c b/usr/src/uts/sun4u/io/wrsm/wrsm_intr.c index f4c21b99de..b73c18cf66 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_intr.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_intr.c @@ -127,8 +127,9 @@ static uint_t wrsm_intr_debug = INTRERR; * Macro RECVQ2MONDO extracts the mondo value from the aforementioned format. * Macro RECVQ_VALID tests to see if the item is indeed a valid recvq pointer. */ -#define CAST_MONDO2RECVQ(mondo) (wrsm_intr_recvq_t *)(((mondo) << 16) | 0x1) -#define CAST_RECVQ2MONDO(recvq) (((uint_t)(recvq)) >> 16) +#define CAST_MONDO2RECVQ(mondo) \ + (wrsm_intr_recvq_t *)(uintptr_t)(((mondo) << 16) | 0x1) +#define CAST_RECVQ2MONDO(recvq) (((uint_t)(uintptr_t)(recvq)) >> 16) #define RECVQ_VALID(recvq) ((recvq) && (((uint64_t)(recvq)) & 0x1) == 0) /* diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_lc.c b/usr/src/uts/sun4u/io/wrsm/wrsm_lc.c index f0c88b319b..e761cb1a8f 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_lc.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_lc.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1270,7 +1270,7 @@ wrsm_lc_wciinit(wrsm_softstate_t *softsp, cnodeid_t local_cnode, DPRINTF(LC_DEBUG, (CE_CONT, "in wrsm_lc_wciinit wci %d", softsp->portid)); ASSERT(softsp != NULL); - ASSERT(local_wnode < 16 && local_wnode >= 0); + ASSERT(local_wnode < 16); softsp->restart_timeout_id = 0; @@ -2830,7 +2830,7 @@ wrsm_lc_err_cnt(wrsm_softstate_t *softsp, boolean_t do_shortterm) cmn_err(CE_NOTE, "wci %u link %d, " "wci_sw_link_error_count = %lu, " "wci_sw_link_error_sum = %lu, " - "crc = %ld, framing = %ld, clocking = %ld", + "crc = %d, framing = %d, clocking = %d", softsp->portid, i, num_errs, softsp->wci_common_softst. wci_sw_link_error_count_sum[i], diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_mh.c b/usr/src/uts/sun4u/io/wrsm/wrsm_mh.c index 6c52513d84..129925f32e 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_mh.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_mh.c @@ -20,8 +20,9 @@ * CDDL HEADER END */ /* - * Copyright (c) 1999-2001 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -250,7 +251,7 @@ wrsm_mh_link_is_up(ncwci_handle_t ncwci, uint32_t local_linknum, wci->mh_state->link_state[local_linknum] = mh_link_up; - ASSERT(remote_wnode >= 0 && remote_wnode < WRSM_MAX_WNODES); + ASSERT(remote_wnode < WRSM_MAX_WNODES); /* * Use the one hop route if the current route uses more hops, or diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_nc.c b/usr/src/uts/sun4u/io/wrsm/wrsm_nc.c index 469a9834d2..a94a3d9942 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_nc.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_nc.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -122,7 +122,6 @@ config_new_node(wrsm_node_t *node) * used by the remote node. */ ASSERT(node->config->imported_ncslices.id[0]); - ASSERT(node->config->imported_ncslices.id[0] < WRSM_MAX_NCSLICES); /* * Note: no lock is needed because config operations are single * threaded, and only imported ncslices are managed during @@ -143,7 +142,6 @@ config_new_node(wrsm_node_t *node) for (i = 1; i < WRSM_NODE_NCSLICES; i++) { id = node->config->imported_ncslices.id[i]; if (id != 0) { - ASSERT(id < WRSM_MAX_NCSLICES); /* * Note: no lock is needed because config * operations are single threaded, and only diff --git a/usr/src/uts/sun4u/io/wrsm/wrsm_nr.c b/usr/src/uts/sun4u/io/wrsm/wrsm_nr.c index 3f9b7b648e..f303c6662a 100644 --- a/usr/src/uts/sun4u/io/wrsm/wrsm_nr.c +++ b/usr/src/uts/sun4u/io/wrsm/wrsm_nr.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -6421,15 +6421,6 @@ pt_ptlist_recv_hdlr(wrsm_network_t *network, wrsm_message_t *msg) wrsm_tl_dump_message("pt_ptlist_recv_hdlr: ", msg); #endif - if (cnodeid > WRSM_MAX_CNODES) { - /* - * ignore message! can't send a response to a non-existent - * node - */ - DPRINTF(DBG_ROUTE_EXTRA, (CE_CONT, "ctlr %d no node %d\n", - network->rsm_ctlr_id, cnodeid)); - return (B_FALSE); - } node = network->nodes[cnodeid]; bcopy(&(msg->body), &args, sizeof (args)); diff --git a/usr/src/uts/sun4u/sys/wrsm_memseg_impl.h b/usr/src/uts/sun4u/sys/wrsm_memseg_impl.h index 65c926bc09..bdcd13cc72 100644 --- a/usr/src/uts/sun4u/sys/wrsm_memseg_impl.h +++ b/usr/src/uts/sun4u/sys/wrsm_memseg_impl.h @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -83,7 +83,7 @@ extern "C" { #define WRSM_PTR_HASH_MASK \ ((WRSM_PTR_HASH_SIZE - 1) << WRSM_PTR_HASH_SHIFT) #define WRSM_PTR_HASH_FUNC(r) \ - ((((uint_t)r) & WRSM_PTR_HASH_MASK) >> WRSM_PTR_HASH_SHIFT) + ((((uint_t)(uintptr_t)r) & WRSM_PTR_HASH_MASK) >> WRSM_PTR_HASH_SHIFT) |