/illumos-gate/usr/src/lib/libslp/clib/ |
H A D | SLPOpen.c | 37 slp_handle_impl_t *hp; in SLPOpen() local 44 if (!(hp = malloc(sizeof (*hp)))) { in SLPOpen() 50 hp->pending_outcall = SLP_FALSE; in SLPOpen() 51 (void) mutex_init(&(hp->outcall_lock), USYNC_THREAD, NULL); in SLPOpen() 52 (void) cond_init(&(hp->outcall_cv), USYNC_THREAD, NULL); in SLPOpen() 53 hp->close_on_end = SLP_FALSE; in SLPOpen() 54 hp->consumer_tid = 0; in SLPOpen() 57 if (!(hp->locale = SLPGetProperty(SLP_CONFIG_LOCALE))) { in SLPOpen() 58 hp->locale = pcLang; in SLPOpen() 61 if (!(hp->locale = strdup(hp->locale))) { in SLPOpen() [all …]
|
H A D | slp_ua_common.c | 37 slp_handle_impl_t *hp; member 51 slp_handle_impl_t *hp; in slp_ua_common() local 59 hp = (slp_handle_impl_t *)hSLP; in slp_ua_common() 62 if ((err = slp_new_target_list(hp, scopes, &targets)) != SLP_OK) in slp_ua_common() 64 if ((err = check_message_fit(hp, targets)) != SLP_OK) { in slp_ua_common() 76 args->hp = hp; in slp_ua_common() 86 hp->q = q; in slp_ua_common() 95 hp->producer_tid = tid; in slp_ua_common() 97 if (hp->async) { in slp_ua_common() 106 hp->cancel = 1; in slp_ua_common() [all …]
|
H A D | slp_net.c | 69 slp_handle_impl_t *hp; member 125 void slp_uc_tcp_send(slp_handle_impl_t *hp, slp_target_t *target, in slp_uc_tcp_send() argument 131 if (!hp->tcp_lock) { in slp_uc_tcp_send() 132 if (!(hp->tcp_lock = malloc(sizeof (*(hp->tcp_lock))))) { in slp_uc_tcp_send() 137 (void) mutex_init(hp->tcp_lock, USYNC_THREAD, NULL); in slp_uc_tcp_send() 139 if (!hp->tcp_wait) { in slp_uc_tcp_send() 140 if (!(hp->tcp_wait = malloc(sizeof (*(hp->tcp_wait))))) { in slp_uc_tcp_send() 145 (void) cond_init(hp->tcp_wait, USYNC_THREAD, NULL); in slp_uc_tcp_send() 147 (void) mutex_lock(hp->tcp_lock); in slp_uc_tcp_send() 148 (hp->tcp_ref_cnt)++; in slp_uc_tcp_send() [all …]
|
/illumos-gate/usr/src/uts/common/refhash/ |
H A D | refhash.c | 35 refhash_t *hp; in refhash_create() local 38 hp = kmem_alloc(sizeof (refhash_t), km_flags); in refhash_create() 39 if (hp == NULL) in refhash_create() 41 hp->rh_buckets = kmem_zalloc(bucket_count * sizeof (list_t), km_flags); in refhash_create() 42 if (hp->rh_buckets == NULL) { in refhash_create() 43 kmem_free(hp, sizeof (refhash_t)); in refhash_create() 46 hp->rh_bucket_count = bucket_count; in refhash_create() 49 list_create(&hp->rh_buckets[i], sizeof (refhash_link_t), in refhash_create() 52 list_create(&hp->rh_objs, sizeof (refhash_link_t), in refhash_create() 55 hp->rh_obj_size = obj_size; in refhash_create() [all …]
|
/illumos-gate/usr/src/contrib/ast/src/cmd/ksh93/edit/ |
H A D | history.c | 71 #define hist_ind(hp,c) ((int)((c)&(hp)->histmask)) argument 133 static int acctinit(History_t *hp) in acctinit() argument 136 Namval_t *np = nv_search("ACCTFILE",((Shell_t*)hp->histshell)->var_tree,0); in acctinit() 178 static int sh_checkaudit(History_t *hp, const char *name, char *logbuf, size_t len) in sh_checkaudit() argument 231 register History_t *hp; in sh_histinit() local 251 if(hp=wasopen) in sh_histinit() 255 shgd->hist_ptr = hist_ptr = hp; in sh_histinit() 256 if(strcmp(histname,hp->histname)==0) in sh_histinit() 309 if(!(hp=new_of(History_t,(--histmask)*sizeof(off_t)))) in sh_histinit() 314 shgd->hist_ptr = hist_ptr = hp; in sh_histinit() [all …]
|
/illumos-gate/usr/src/common/ctf/ |
H A D | ctf_hash.c | 36 ctf_hash_create(ctf_hash_t *hp, ulong_t nelems) in ctf_hash_create() argument 46 bzero(hp, sizeof (ctf_hash_t)); in ctf_hash_create() 47 hp->h_buckets = (ushort_t *)_CTF_EMPTY; in ctf_hash_create() 48 hp->h_nbuckets = 1; in ctf_hash_create() 52 hp->h_nbuckets = 211; /* use a prime number of hash buckets */ in ctf_hash_create() 53 hp->h_nelems = nelems + 1; /* we use index zero as a sentinel */ in ctf_hash_create() 54 hp->h_free = 1; /* first free element is index 1 */ in ctf_hash_create() 56 hp->h_buckets = ctf_alloc(sizeof (ushort_t) * hp->h_nbuckets); in ctf_hash_create() 57 hp->h_chains = ctf_alloc(sizeof (ctf_helem_t) * hp->h_nelems); in ctf_hash_create() 59 if (hp->h_buckets == NULL || hp->h_chains == NULL) { in ctf_hash_create() [all …]
|
/illumos-gate/usr/src/uts/common/io/ |
H A D | bofi.c | 933 struct bofi_shadow *hp; in bofi_ioctl() local 1508 for (hp = hhashp->hnext; hp != hhashp; hp = hp->hnext) { in bofi_ioctl() 1509 if (!driver_under_test(hp->dip)) in bofi_ioctl() 1511 if (ddi_name_to_major(ddi_get_name(hp->dip)) != in bofi_ioctl() 1514 if (hp->instance != get_handles.instance) in bofi_ioctl() 1521 " %s %d %s ", hp->name, hp->instance, in bofi_ioctl() 1522 (hp->type == BOFI_INT_HDL) ? "INTR" : in bofi_ioctl() 1523 (hp->type == BOFI_ACC_HDL) ? "PIO" : in bofi_ioctl() 1524 (hp->type == BOFI_DMA_HDL) ? "DMA" : in bofi_ioctl() 1525 (hp->hparrayp != NULL) ? "DVMA" : "DMA*"); in bofi_ioctl() [all …]
|
/illumos-gate/usr/src/lib/scsi/libscsi/common/ |
H A D | scsi_subr.c | 67 libscsi_set_errno(libscsi_hdl_t *hp, libscsi_errno_t err) in libscsi_set_errno() argument 69 hp->lsh_errno = err; in libscsi_set_errno() 70 hp->lsh_errmsg[0] = '\0'; in libscsi_set_errno() 82 libscsi_verror(libscsi_hdl_t *hp, libscsi_errno_t err, const char *fmt, in libscsi_verror() argument 98 errmsg = alloca(sizeof (hp->lsh_errmsg)); in libscsi_verror() 99 (void) vsnprintf(errmsg, sizeof (hp->lsh_errmsg), fmt, ap); in libscsi_verror() 100 (void) libscsi_set_errno(hp, err); in libscsi_verror() 107 bcopy(errmsg, hp->lsh_errmsg, n + 1); in libscsi_verror() 114 libscsi_error(libscsi_hdl_t *hp, libscsi_errno_t err, const char *fmt, ...) in libscsi_error() argument 119 return (libscsi_set_errno(hp, err)); in libscsi_error() [all …]
|
/illumos-gate/usr/src/lib/libdtrace/common/ |
H A D | dt_inttab.c | 55 dt_inthash_t *hp, *np; in dt_inttab_destroy() local 57 for (hp = ip->int_head; hp != NULL; hp = np) { in dt_inttab_destroy() 58 np = hp->inh_next; in dt_inttab_destroy() 59 dt_free(ip->int_hdl, hp); in dt_inttab_destroy() 70 dt_inthash_t *hp; in dt_inttab_insert() local 73 for (hp = ip->int_hash[h]; hp != NULL; hp = hp->inh_hash) { in dt_inttab_insert() 74 if (hp->inh_value == value && hp->inh_flags == flags) in dt_inttab_insert() 75 return (hp->inh_index); in dt_inttab_insert() 79 if ((hp = dt_alloc(ip->int_hdl, sizeof (dt_inthash_t))) == NULL) in dt_inttab_insert() 82 hp->inh_hash = ip->int_hash[h]; in dt_inttab_insert() [all …]
|
/illumos-gate/usr/src/cmd/ipf/lib/ |
H A D | printhashdata.c | 16 void printhashdata(hp, opts) in printhashdata() argument 17 iphtable_t *hp; in printhashdata() 22 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON) 24 switch (hp->iph_type & ~IPHASH_ANON) 31 if (hp->iph_flags & FR_INQUE) 33 else if (hp->iph_flags & FR_OUTQUE) 39 PRINTF("%#x", hp->iph_type); 44 PRINTF("Hash Table Number: %s", hp->iph_name); 45 if ((hp->iph_type & IPHASH_ANON) == IPHASH_ANON) 51 switch (hp->iph_unit) [all …]
|
/illumos-gate/usr/src/uts/sun4u/ngdr/io/ |
H A D | dr.c | 361 static int dr_copyin_iocmd(dr_handle_t *hp); 362 static int dr_copyout_iocmd(dr_handle_t *hp); 363 static int dr_copyout_errs(dr_handle_t *hp); 364 static int dr_pre_op(dr_handle_t *hp); 365 static int dr_post_op(dr_handle_t *hp); 366 static int dr_exec_op(dr_handle_t *hp); 367 static void dr_assign_board(dr_handle_t *hp); 368 static void dr_unassign_board(dr_handle_t *hp); 369 static void dr_connect(dr_handle_t *hp); 370 static int dr_disconnect(dr_handle_t *hp); [all …]
|
/illumos-gate/usr/src/lib/libnwam/common/ |
H A D | libnwam_object.c | 124 struct nwam_handle *hp; in nwam_create() local 128 if (nwam_read(type, dbname, name, 0, &hp) == NWAM_SUCCESS) { in nwam_create() 129 nwam_free(hp); in nwam_create() 137 nwam_get_name(struct nwam_handle *hp, char **namep) in nwam_get_name() argument 139 assert(hp != NULL && namep != NULL); in nwam_get_name() 141 if ((*namep = strdup(hp->nwh_name)) == NULL) { in nwam_get_name() 149 nwam_set_name(struct nwam_handle *hp, const char *name) in nwam_set_name() argument 151 assert(hp != NULL && name != NULL); in nwam_set_name() 153 if (hp->nwh_committed) in nwam_set_name() 156 if (strlen(name) >= sizeof (hp->nwh_name)) in nwam_set_name() [all …]
|
/illumos-gate/usr/src/uts/i86pc/io/dr/ |
H A D | dr.c | 362 static int dr_copyin_iocmd(dr_handle_t *hp); 363 static int dr_copyout_iocmd(dr_handle_t *hp); 364 static int dr_copyout_errs(dr_handle_t *hp); 365 static int dr_pre_op(dr_handle_t *hp); 366 static int dr_post_op(dr_handle_t *hp, int rv); 367 static int dr_exec_op(dr_handle_t *hp); 368 static void dr_assign_board(dr_handle_t *hp); 369 static void dr_unassign_board(dr_handle_t *hp); 370 static void dr_connect(dr_handle_t *hp); 371 static int dr_disconnect(dr_handle_t *hp); [all …]
|
/illumos-gate/usr/src/uts/common/vm/ |
H A D | vm_seg.c | 285 seg_padd_abuck(struct seg_phash *hp) in seg_padd_abuck() argument 289 ASSERT(MUTEX_HELD(&hp->p_hmutex)); in seg_padd_abuck() 290 ASSERT((struct seg_phash *)hp->p_hnext != hp); in seg_padd_abuck() 291 ASSERT((struct seg_phash *)hp->p_hprev != hp); in seg_padd_abuck() 292 ASSERT(hp->p_hnext == hp->p_hprev); in seg_padd_abuck() 293 ASSERT(!IS_PCP_WIRED(hp->p_hnext)); in seg_padd_abuck() 294 ASSERT(hp->p_hnext->p_hnext == (struct seg_pcache *)hp); in seg_padd_abuck() 295 ASSERT(hp->p_hprev->p_hprev == (struct seg_pcache *)hp); in seg_padd_abuck() 296 ASSERT(hp >= seg_phashtab_win && in seg_padd_abuck() 297 hp < &seg_phashtab_win[seg_phashsize_win]); in seg_padd_abuck() [all …]
|
/illumos-gate/usr/src/uts/sun4u/sys/ |
H A D | sbd.h | 82 int sbdp_assign_board(sbdp_handle_t *hp); 83 int sbdp_connect_board(sbdp_handle_t *hp); 84 int sbdp_disconnect_board(sbdp_handle_t *hp); 85 int sbdp_get_board_num(sbdp_handle_t *hp, dev_info_t *dip); 87 int sbdp_cancel_component_release(sbdp_handle_t *hp); 88 processorid_t sbdp_get_cpuid(sbdp_handle_t *hp, dev_info_t *dip); 92 int sbdp_get_mem_alignment(sbdp_handle_t *hp, dev_info_t *dip, uint64_t *align); 93 struct memlist *sbdp_get_memlist(sbdp_handle_t *hp, dev_info_t *dip); 94 int sbdp_del_memlist(sbdp_handle_t *hp, struct memlist *mlist); 95 int sbdp_get_unit_num(sbdp_handle_t *hp, dev_info_t *dip); [all …]
|
/illumos-gate/usr/src/uts/sun4u/io/ |
H A D | sbd.c | 86 static void sbd_exec_op(sbd_handle_t *hp); 87 static void sbd_dev_configure(sbd_handle_t *hp); 88 static int sbd_dev_release(sbd_handle_t *hp); 89 static int sbd_dev_unconfigure(sbd_handle_t *hp); 90 static void sbd_attach_cpu(sbd_handle_t *hp, sbderror_t *ep, 92 static void sbd_detach_cpu(sbd_handle_t *hp, sbderror_t *ep, 94 static int sbd_detach_mem(sbd_handle_t *hp, sbderror_t *ep, int unit); 95 static void sbd_cancel(sbd_handle_t *hp); 324 static void sbd_release_handle(sbd_handle_t *hp); 325 static int sbd_pre_op(sbd_handle_t *hp); [all …]
|
/illumos-gate/usr/src/uts/intel/os/ |
H A D | ddi_i86.c | 151 ddi_acc_impl_t *hp; in impl_acc_hdl_alloc() local 159 if ((hp = kmem_zalloc(sizeof (ddi_acc_impl_t), sleepflag)) == NULL) in impl_acc_hdl_alloc() 161 if ((hp->ahi_err = (ndi_err_t *)kmem_zalloc( in impl_acc_hdl_alloc() 163 kmem_free(hp, sizeof (ddi_acc_impl_t)); in impl_acc_hdl_alloc() 168 kmem_free(hp->ahi_err, sizeof (ndi_err_t)); in impl_acc_hdl_alloc() 169 kmem_free(hp, sizeof (ddi_acc_impl_t)); in impl_acc_hdl_alloc() 172 hp->ahi_err->err_ontrap = otp; in impl_acc_hdl_alloc() 173 hp->ahi_common.ah_platform_private = (void *)hp; in impl_acc_hdl_alloc() 175 return ((ddi_acc_handle_t)hp); in impl_acc_hdl_alloc() 186 ddi_acc_impl_t *hp; in impl_acc_hdl_free() local [all …]
|
/illumos-gate/usr/src/uts/common/os/ |
H A D | dumpsubr.c | 560 helper_t *hp, *hpend; in dump_update_clevel() local 575 for (hp = old->helper; hp != hpend; hp++) { in dump_update_clevel() 576 if (hp->lzbuf != NULL) in dump_update_clevel() 577 kmem_free(hp->lzbuf, PAGESIZE); in dump_update_clevel() 578 if (hp->page != NULL) in dump_update_clevel() 579 kmem_free(hp->page, PAGESIZE); in dump_update_clevel() 652 for (hp = new->helper; hp != hpend; hp++) { in dump_update_clevel() 653 hp->tag = tag++; in dump_update_clevel() 654 if (hp < &new->helper[MINHELPERS]) { in dump_update_clevel() 655 hp->lzbuf = kmem_alloc(PAGESIZE, KM_SLEEP); in dump_update_clevel() [all …]
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop/ |
H A D | snoop_ipaddr.c | 110 struct hostent *hp = NULL; in iplookup() local 135 hp = getipnodebyaddr((char *)&ipaddr, sizeof (int), in iplookup() 137 if (hp == NULL && inet_lnaof(ipaddr) == 0) { in iplookup() 150 hp ? hp->h_name : inet_ntoa(ipaddr), in iplookup() 151 hp ? hp->h_aliases : NULL); in iplookup() 152 if (hp != NULL) in iplookup() 153 freehostent(hp); in iplookup() 161 struct hostent *hp = NULL; in ip6lookup() local 185 hp = getipnodebyaddr(ip6addr, sizeof (struct in6_addr), in ip6lookup() 192 hp = NULL; in ip6lookup() [all …]
|
/illumos-gate/usr/src/cmd/mailx/ |
H A D | tty.c | 113 grabh(register struct header *hp, int gflags, int subjtop) in grabh() argument 130 hp->h_to = addto(NOSTR, readtty("To: ", hp->h_to)); in grabh() 131 if (hp->h_to != NOSTR) in grabh() 132 hp->h_seq++; in grabh() 135 hp->h_subject = readtty("Subject: ", hp->h_subject); in grabh() 136 if (hp->h_subject != NOSTR) in grabh() 137 hp->h_seq++; in grabh() 140 hp->h_cc = addto(NOSTR, readtty("Cc: ", hp->h_cc)); in grabh() 141 if (hp->h_cc != NOSTR) in grabh() 142 hp->h_seq++; in grabh() [all …]
|
/illumos-gate/usr/src/uts/sun4/os/ |
H A D | ddi_impl.c | 1268 ddi_acc_impl_t *hp; in impl_acc_hdl_alloc() local 1277 if ((hp = kmem_zalloc(sizeof (ddi_acc_impl_t), sleepflag)) == NULL) in impl_acc_hdl_alloc() 1279 if ((hp->ahi_err = (ndi_err_t *)kmem_zalloc( in impl_acc_hdl_alloc() 1281 kmem_free(hp, sizeof (ddi_acc_impl_t)); in impl_acc_hdl_alloc() 1286 kmem_free(hp->ahi_err, sizeof (ndi_err_t)); in impl_acc_hdl_alloc() 1287 kmem_free(hp, sizeof (ddi_acc_impl_t)); in impl_acc_hdl_alloc() 1290 hp->ahi_err->err_ontrap = otp; in impl_acc_hdl_alloc() 1291 hp->ahi_common.ah_platform_private = (void *)hp; in impl_acc_hdl_alloc() 1293 return ((ddi_acc_handle_t)hp); in impl_acc_hdl_alloc() 1304 ddi_acc_impl_t *hp; in impl_acc_hdl_free() local [all …]
|
/illumos-gate/usr/src/lib/scsi/plugins/scsi/engines/uscsi/ |
H A D | uscsi.c | 50 uscsi_open(libscsi_hdl_t *hp, const void *target) in uscsi_open() argument 55 if ((dp = libscsi_zalloc(hp, sizeof (struct uscsi_dev))) == NULL) in uscsi_open() 58 if ((dp->dev = libscsi_strdup(hp, target_name)) == NULL) { in uscsi_open() 59 libscsi_free(hp, dp); in uscsi_open() 64 (void) libscsi_error(hp, ESCSI_BADTARGET, "failed to open %s " in uscsi_open() 66 libscsi_free(hp, dp->dev); in uscsi_open() 67 libscsi_free(hp, dp); in uscsi_open() 75 uscsi_close(libscsi_hdl_t *hp, void *private) in uscsi_close() argument 85 libscsi_free(hp, dp->dev); in uscsi_close() 86 libscsi_free(hp, dp); in uscsi_close() [all …]
|
/illumos-gate/usr/src/uts/sun4u/serengeti/io/ |
H A D | sbdp_mbox.c | 117 sbdp_get_board_status(sbdp_handle_t *hp, sbd_stat_t *stp) in sbdp_get_board_status() argument 119 int board = hp->h_board; in sbdp_get_board_status() 120 int node = hp->h_wnode; in sbdp_get_board_status() 126 sbd_error_t *sep = hp->h_err; in sbdp_get_board_status() 136 if (hp->h_opts != NULL && hp->h_opts->copts != NULL) { in sbdp_get_board_status() 137 sbdp_set_err(sep, ESBD_INVAL_OPT, hp->h_opts->copts); in sbdp_get_board_status() 247 sbdp_assign_board(sbdp_handle_t *hp) in sbdp_assign_board() argument 249 int board = hp->h_board; in sbdp_assign_board() 250 int node = hp->h_wnode; in sbdp_assign_board() 262 sep = hp->h_err; in sbdp_assign_board() [all …]
|
/illumos-gate/usr/src/cmd/xstr/ |
H A D | xstr.c | 313 struct hash *hp, *hp0; in hashit() local 315 hp = hp0 = &bucket[lastchr(str) & 0177]; in hashit() 316 while (hp->hnext) { in hashit() 317 hp = hp->hnext; in hashit() 318 i = istail(str, hp->hstr); in hashit() 320 return (hp->hpt + i); in hashit() 322 if ((hp = calloc(1, sizeof (*hp))) == NULL) { in hashit() 327 hp->hpt = mesgpt; in hashit() 328 hp->hstr = savestr(str); in hashit() 329 mesgpt += strlen(hp->hstr) + 1; in hashit() [all …]
|
/illumos-gate/usr/src/cmd/tcpd/ |
H A D | scaffold.c | 44 static struct hostent *dup_hostent(hp) in dup_hostent() argument 45 struct hostent *hp; in dup_hostent() 56 for (count = 0; hp->h_addr_list[count] != 0; count++) 60 + (hp->h_length + sizeof(char *)) * count)) == 0) { 65 hb->host.h_addrtype = hp->h_addrtype;; 66 hb->host.h_length = hp->h_length; 71 for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) { 72 hb->host.h_addr_list[count] = data + hp->h_length * count; 73 memcpy(hb->host.h_addr_list[count], addr, hp->h_length); 84 struct hostent *hp; local [all …]
|