/freebsd/sys/net/route/ |
H A D | nhop.c | 78 struct nh_control *ctl; in nhops_init_rib() local 83 ctl = malloc(sizeof(struct nh_control), M_NHOP, M_WAITOK | M_ZERO); in nhops_init_rib() 92 CHT_SLIST_INIT(&ctl->nh_head, ptr, num_buckets); in nhops_init_rib() 99 bitmask_init(&ctl->nh_idx_head, ptr, num_items); in nhops_init_rib() 101 NHOPS_LOCK_INIT(ctl); in nhops_init_rib() 103 rh->nh_control = ctl; in nhops_init_rib() 104 ctl->ctl_rh = rh; in nhops_init_rib() 106 FIB_CTL_LOG(LOG_DEBUG2, ctl, "nhops init: ctl %p rh %p", ctl, rh); in nhops_init_rib() 112 destroy_ctl(struct nh_control *ctl) in destroy_ctl() argument 115 NHOPS_LOCK_DESTROY(ctl); in destroy_ctl() [all …]
|
H A D | nhgrp.c | 87 static void consider_resize(struct nh_control *ctl, uint32_t new_gr_buckets, 138 find_nhgrp(struct nh_control *ctl, const struct nhgrp_priv *key) in find_nhgrp() argument 142 NHOPS_RLOCK(ctl); in find_nhgrp() 143 CHT_SLIST_FIND_BYOBJ(&ctl->gr_head, mpath, key, priv_ret); in find_nhgrp() 150 NHOPS_RUNLOCK(ctl); in find_nhgrp() 156 link_nhgrp(struct nh_control *ctl, struct nhgrp_priv *grp_priv) in link_nhgrp() argument 161 NHOPS_WLOCK(ctl); in link_nhgrp() 163 new_num_buckets = CHT_SLIST_GET_RESIZE_BUCKETS(&ctl->gr_head); in link_nhgrp() 164 new_num_items = bitmask_get_resize_items(&ctl->nh_idx_head); in link_nhgrp() 166 if (bitmask_alloc_idx(&ctl->nh_idx_head, &idx) != 0) { in link_nhgrp() [all …]
|
H A D | nhop_var.h | 63 #define NHOPS_WLOCK(ctl) rw_wlock(&(ctl)->ctl_lock) argument 64 #define NHOPS_RLOCK(ctl) rw_rlock(&(ctl)->ctl_lock) argument 65 #define NHOPS_WUNLOCK(ctl) rw_wunlock(&(ctl)->ctl_lock) argument 66 #define NHOPS_RUNLOCK(ctl) rw_runlock(&(ctl)->ctl_lock) argument 67 #define NHOPS_LOCK_INIT(ctl) rw_init(&(ctl)->ctl_lock, "nhop_ctl") argument 68 #define NHOPS_LOCK_DESTROY(ctl) rw_destroy(&(ctl)->ctl_lock) argument 69 #define NHOPS_WLOCK_ASSERT(ctl) rw_assert(&(ctl)->ctl_lock, RA_WLOCKED) argument 103 struct nhop_priv *find_nhop(struct nh_control *ctl, 105 int link_nhop(struct nh_control *ctl, struct nhop_priv *nh_priv); 106 struct nhop_priv *unlink_nhop(struct nh_control *ctl, struct nhop_priv *nh_priv);
|
H A D | nhgrp_ctl.c | 80 static struct nhgrp_priv *get_nhgrp(struct nh_control *ctl, 338 struct nh_control *ctl; in nhgrp_free() local 374 ctl = nhg_priv->nh_control; in nhgrp_free() 375 if (unlink_nhgrp(ctl, nhg_priv) == NULL) { in nhgrp_free() 466 struct nh_control *ctl; in nhgrp_alloc() local 473 ctl = rh->nh_control; in nhgrp_alloc() 480 if (ctl->gr_head.hash_size == 0) { in nhgrp_alloc() 482 if (nhgrp_ctl_alloc_default(ctl, M_NOWAIT) == 0) { in nhgrp_alloc() 492 if (wn[i].nh->nh_priv->nh_control != ctl) { in nhgrp_alloc() 507 nhg_priv->nh_control = ctl; in nhgrp_alloc() [all …]
|
H A D | nhop_ctl.c | 88 static int finalize_nhop(struct nh_control *ctl, struct nhop_object *nh, bool link); 489 finalize_nhop(struct nh_control *ctl, struct nhop_object *nh, bool link) in finalize_nhop() argument 515 MPASS(nh->nh_priv->nh_fibnum == ctl->ctl_rh->rib_fibnum); in finalize_nhop() 519 NHOPS_WLOCK(ctl); in finalize_nhop() 521 NHOPS_WUNLOCK(ctl); in finalize_nhop() 522 } else if (link_nhop(ctl, nh->nh_priv) == 0) { in finalize_nhop() 589 struct nh_control *ctl; in nhop_free() local 629 ctl = nh_priv->nh_control; in nhop_free() 630 if (unlink_nhop(ctl, nh_priv) == NULL) { in nhop_free() 1057 struct nh_control *ctl; in nhops_update_ifmtu() local [all …]
|
/freebsd/sys/netlink/ |
H A D | netlink_module.c | 72 free_nl_ctl(struct nl_control *ctl) in free_nl_ctl() argument 74 rm_destroy(&ctl->ctl_lock); in free_nl_ctl() 75 free(ctl, M_NETLINK); in free_nl_ctl() 81 struct nl_control *ctl; in vnet_nl_ctl_init() local 83 ctl = malloc(sizeof(struct nl_control), M_NETLINK, M_WAITOK | M_ZERO); in vnet_nl_ctl_init() 84 rm_init(&ctl->ctl_lock, "netlink lock"); in vnet_nl_ctl_init() 85 CK_LIST_INIT(&ctl->ctl_port_head); in vnet_nl_ctl_init() 86 CK_LIST_INIT(&ctl->ctl_pcb_head); in vnet_nl_ctl_init() 93 atomic_store_ptr(&V_nl_ctl, ctl); in vnet_nl_ctl_init() 94 CK_LIST_INSERT_HEAD(&vnets_head, ctl, ctl_next); in vnet_nl_ctl_init() [all …]
|
H A D | netlink_domain.c | 215 struct nl_control *ctl = atomic_load_ptr(&V_nl_ctl); in nl_send_group() local 216 if (__predict_false(ctl == NULL)) { in nl_send_group() 225 NLCTL_RLOCK(ctl); in nl_send_group() 227 CK_LIST_FOREACH(nlp, &ctl->ctl_pcb_head, nl_next) { in nl_send_group() 253 NLCTL_RUNLOCK(ctl); in nl_send_group() 333 struct nl_control *ctl = atomic_load_ptr(&V_nl_ctl); in nl_pru_attach() local 334 if (ctl == NULL) in nl_pru_attach() 335 ctl = vnet_nl_ctl_init(); in nl_pru_attach() 366 NLCTL_WLOCK(ctl); in nl_pru_attach() 368 CK_LIST_INSERT_HEAD(&ctl->ctl_pcb_head, nlp, nl_next); in nl_pru_attach() [all …]
|
/freebsd/sbin/ipf/ipsend/ |
H A D | dlcommon.c | 43 struct strbuf ctl; in dlinforeq() local 48 ctl.maxlen = 0; in dlinforeq() 49 ctl.len = sizeof (info_req); in dlinforeq() 50 ctl.buf = (char *) &info_req; in dlinforeq() 54 if (putmsg(fd, &ctl, (struct strbuf*) NULL, flags) < 0) in dlinforeq() 62 struct strbuf ctl; in dlinfoack() local 65 ctl.maxlen = MAXDLBUF; in dlinfoack() 66 ctl.len = 0; in dlinfoack() 67 ctl.buf = bufp; in dlinfoack() 69 strgetmsg(fd, &ctl, (struct strbuf*)NULL, &flags, "dlinfoack"); in dlinfoack() [all …]
|
/freebsd/sys/netlink/route/ |
H A D | nexthop.c | 116 static void consider_resize(struct unhop_ctl *ctl, uint32_t new_size); 156 struct unhop_ctl *ctl = atomic_load_ptr(&V_un_ctl); in nl_find_nhop() local 159 if (__predict_false(ctl == NULL)) in nl_find_nhop() 173 UN_RLOCK(ctl); in nl_find_nhop() 174 CHT_SLIST_FIND_BYOBJ(&ctl->un_head, unhop, &key, unhop); in nl_find_nhop() 177 UN_RLOCK(ctl); in nl_find_nhop() 187 CHT_SLIST_FIND_BYOBJ(&ctl->un_head, unhop, &key, unhop); in nl_find_nhop() 189 UN_RUNLOCK(ctl); in nl_find_nhop() 194 UN_RUNLOCK(ctl); in nl_find_nhop() 215 UN_WLOCK(ctl); in nl_find_nhop() [all …]
|
/freebsd/sys/dev/sound/pci/hda/ |
H A D | hdaa.h | 209 struct hdaa_audio_ctl *ctl; member 244 #define MINQDB(ctl) \ argument 245 ((0 - (ctl)->offset) * ((ctl)->size + 1)) 247 #define MAXQDB(ctl) \ argument 248 (((ctl)->step - (ctl)->offset) * ((ctl)->size + 1)) 250 #define RANGEQDB(ctl) \ argument 251 ((ctl)->step * ((ctl)->size + 1)) 253 #define VAL2QDB(ctl, val) \ argument 254 (((ctl)->size + 1) * ((int)(val) - (ctl)->offset)) 256 #define QDB2VAL(ctl, qdb) \ argument [all …]
|
H A D | hdaa.c | 202 index == NULL || devinfo->ctl == NULL || in hdaa_audio_ctl_each() 206 return (&devinfo->ctl[(*index)++]); in hdaa_audio_ctl_each() 213 struct hdaa_audio_ctl *ctl; in hdaa_audio_ctl_amp_get() local 216 if (devinfo == NULL || devinfo->ctl == NULL) in hdaa_audio_ctl_amp_get() 220 while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { in hdaa_audio_ctl_amp_get() 221 if (ctl->enable == 0) in hdaa_audio_ctl_amp_get() 223 if (ctl->widget->nid != nid) in hdaa_audio_ctl_amp_get() 225 if (dir && ctl->ndir != dir) in hdaa_audio_ctl_amp_get() 227 if (index >= 0 && ctl->ndir == HDAA_CTL_IN && in hdaa_audio_ctl_amp_get() 228 ctl->dir == ctl->ndir && ctl->index != index) in hdaa_audio_ctl_amp_get() [all …]
|
/freebsd/contrib/bearssl/src/rsa/ |
H A D | rsa_i15_privexp.c | 251 uint32_t ctl; in br_rsa_i15_compute_privexp() local 262 ctl = GT(v1, v0); in br_rsa_i15_compute_privexp() 264 u0 -= (u1 - (r & -ctl)) & -sab; in br_rsa_i15_compute_privexp() 265 v0 -= (v1 - (e & -ctl)) & -sab; in br_rsa_i15_compute_privexp() 268 ctl = GT(v0, v1); in br_rsa_i15_compute_privexp() 270 u1 -= (u0 - (r & -ctl)) & -sba; in br_rsa_i15_compute_privexp() 271 v1 -= (v0 - (e & -ctl)) & -sba; in br_rsa_i15_compute_privexp() 277 ctl = v0 & 1; in br_rsa_i15_compute_privexp() 279 u0 ^= (u0 ^ ((u0 >> 1) + (hr & -ctl))) & -da; in br_rsa_i15_compute_privexp() 280 v0 ^= (v0 ^ ((v0 >> 1) + (he & -ctl))) & -da; in br_rsa_i15_compute_privexp() [all …]
|
H A D | rsa_i31_privexp.c | 251 uint32_t ctl; in br_rsa_i31_compute_privexp() local 262 ctl = GT(v1, v0); in br_rsa_i31_compute_privexp() 264 u0 -= (u1 - (r & -ctl)) & -sab; in br_rsa_i31_compute_privexp() 265 v0 -= (v1 - (e & -ctl)) & -sab; in br_rsa_i31_compute_privexp() 268 ctl = GT(v0, v1); in br_rsa_i31_compute_privexp() 270 u1 -= (u0 - (r & -ctl)) & -sba; in br_rsa_i31_compute_privexp() 271 v1 -= (v0 - (e & -ctl)) & -sba; in br_rsa_i31_compute_privexp() 277 ctl = v0 & 1; in br_rsa_i31_compute_privexp() 279 u0 ^= (u0 ^ ((u0 >> 1) + (hr & -ctl))) & -da; in br_rsa_i31_compute_privexp() 280 v0 ^= (v0 ^ ((v0 >> 1) + (he & -ctl))) & -da; in br_rsa_i31_compute_privexp() [all …]
|
/freebsd/lib/libmixer/ |
H A D | mixer.c | 218 mix_ctl_t *ctl, *cp; in mixer_add_ctl() local 225 if ((ctl = calloc(1, sizeof(mix_ctl_t))) == NULL) in mixer_add_ctl() 227 ctl->parent_dev = parent_dev; in mixer_add_ctl() 228 ctl->id = id; in mixer_add_ctl() 230 (void)strlcpy(ctl->name, name, sizeof(ctl->name)); in mixer_add_ctl() 231 ctl->mod = mod; in mixer_add_ctl() 232 ctl->print = print; in mixer_add_ctl() 233 dp = ctl->parent_dev; in mixer_add_ctl() 241 TAILQ_INSERT_TAIL(&dp->ctls, ctl, ctls); in mixer_add_ctl() 251 mixer_add_ctl_s(mix_ctl_t *ctl) in mixer_add_ctl_s() argument [all …]
|
/freebsd/lib/libc/db/test/hash.tests/ |
H A D | tread2.c | 54 HASHINFO ctl; local 59 ctl.nelem = INITIAL; 60 ctl.hash = NULL; 61 ctl.bsize = 64; 62 ctl.ffactor = 1; 63 ctl.cachesize = atoi(*argv++); 64 ctl.lorder = 0; 65 if (!(dbp = dbopen( "hashtest", O_RDONLY, 0400, DB_HASH, &ctl))) {
|
H A D | tverify.c | 54 HASHINFO ctl; local 60 ctl.nelem = INITIAL; 61 ctl.hash = NULL; 62 ctl.bsize = 64; 63 ctl.ffactor = 1; 64 ctl.cachesize = 1024 * 1024; /* 1 MEG */ 65 ctl.lorder = 0; 66 if (!(dbp = dbopen( "hashtest", O_RDONLY, 0400, DB_HASH, &ctl))) {
|
H A D | tdel.c | 51 HASHINFO ctl; local 58 ctl.nelem = INITIAL; 59 ctl.hash = NULL; 60 ctl.bsize = atoi(*argv++); 61 ctl.ffactor = atoi(*argv++); 62 ctl.cachesize = 1024 * 1024; /* 1 MEG */ 63 ctl.lorder = 0; 65 if (!(dbp = dbopen( NULL, O_CREAT|O_RDWR, 0400, DB_HASH, &ctl))) {
|
H A D | tcreat3.c | 50 HASHINFO ctl; local 57 ctl.hash = NULL; 58 ctl.bsize = atoi(*argv++); 59 ctl.ffactor = atoi(*argv++); 60 ctl.nelem = atoi(*argv++); 61 ctl.lorder = 0; 63 O_CREAT|O_TRUNC|O_RDWR, 0600, DB_HASH, &ctl))){
|
H A D | thash4.c | 53 HASHINFO ctl; local 61 ctl.hash = NULL; 62 ctl.bsize = atoi(*argv++); 63 ctl.ffactor = atoi(*argv++); 64 ctl.nelem = atoi(*argv++); 65 ctl.cachesize = atoi(*argv++); 66 ctl.lorder = 0; 67 if (!(dbp = dbopen( NULL, O_CREAT|O_RDWR, 0400, DB_HASH, &ctl))) {
|
/freebsd/contrib/libpcap/ |
H A D | pcap-enet.c | 148 struct eniocb ctl; in initdevice() local 168 if (ioctl(if_fd, EIOCGETP, (char *)&ctl) == -1) { in initdevice() 176 ctl.en_rtout = 1 * ctl.en_hz; in initdevice() 177 ctl.en_tr_etherhead = 1; in initdevice() 178 ctl.en_tap_network = 1; in initdevice() 179 ctl.en_multi_packet = 1; in initdevice() 180 ctl.en_maxlen = BUFSPACE; in initdevice() 182 ctl.en_rtout = 64; /* randomly picked value for HZ */ in initdevice() 184 if (ioctl(if_fd, EIOCSETP, &ctl) == -1) { in initdevice() 200 maxwaiting = ctl.en_maxwaiting; in initdevice()
|
H A D | pcap-dlpi.c | 187 struct strbuf ctl = { in pcap_read_dlpi() local 219 ctl.buf = (char *)ctlbuf; in pcap_read_dlpi() 220 ctl.maxlen = MAXDLBUF; in pcap_read_dlpi() 221 ctl.len = 0; in pcap_read_dlpi() 222 if (getmsg(p->fd, &ctl, &data, &flags) < 0) { in pcap_read_dlpi() 1160 struct strbuf ctl; local 1163 ctl.maxlen = 0; 1164 ctl.len = len; 1165 ctl.buf = ptr; 1168 if (putmsg(fd, &ctl, (struct strbuf *) NULL, flags) < 0) { [all …]
|
/freebsd/sys/x86/x86/ |
H A D | mca.c | 91 unsigned int (*ctl)(int); member 186 .ctl = mca_ia32_ctl_reg, 836 uint64_t ctl; in cmci_update() local 842 ctl = rdmsr(MSR_MC_CTL2(bank)); in cmci_update() 844 cur_threshold = ctl & MC_CTL2_THRESHOLD; in cmci_update() 852 ctl &= ~MC_CTL2_THRESHOLD; in cmci_update() 853 ctl |= new_threshold; in cmci_update() 854 wrmsr(MSR_MC_CTL2(bank), ctl); in cmci_update() 1176 uint64_t ctl; in cmci_monitor() local 1194 ctl = rdmsr(MSR_MC_CTL2(i)); in cmci_monitor() [all …]
|
/freebsd/contrib/bearssl/src/int/ |
H A D | i32_div32.c | 41 uint32_t w, ctl, hi2, lo2; in br_divrem() local 45 ctl = GE(w, d) | (hi >> k); in br_divrem() 48 hi = MUX(ctl, hi2, hi); in br_divrem() 49 lo = MUX(ctl, lo2, lo); in br_divrem() 50 q |= ctl << k; in br_divrem()
|
/freebsd/tools/tools/net80211/wesside/dics/ |
H A D | dics.c | 113 } ctl; in check_signal() local 119 memset(&ctl, 0, sizeof(ctl)); in check_signal() 124 msg.msg_control = &ctl; in check_signal() 125 msg.msg_controllen = sizeof(ctl); in check_signal() 136 if ( ctl.hdr.cmsg_level != IPPROTO_IP || in check_signal() 138 ctl.hdr.cmsg_type != IP_TTL in check_signal() 140 ctl.hdr.cmsg_type != IP_RECVTTL in check_signal() 145 ctl.hdr.cmsg_len, ctl.hdr.cmsg_level, ctl.hdr.cmsg_type); in check_signal() 153 *ttl = ctl.ttl; in check_signal()
|
/freebsd/stand/i386/libi386/ |
H A D | textvidc.c | 122 v86.ctl = 0; in vidc_biosputchar() 200 v86.ctl = 0; in get_pos() 216 v86.ctl = 0; in curs_move() 227 v86.ctl = 0; in curs_move() 248 v86.ctl = 0; in scroll_up() 262 v86.ctl = 0; in write_char() 284 v86.ctl = 0; in CD() 296 v86.ctl = 0; in CD() 510 v86.ctl = 0; in vidc_getchar() 524 v86.ctl = V86_FLAGS; in vidc_ischar()
|