/netbsd-src/external/mit/isl/dist/ |
H A D | basis_reduction_tab.c | 2 * Copyright 2008-2009 Katholieke Universiteit Leuven 7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium 91 static void set_lp_obj(struct tab_lp *lp, isl_int *row, int dim); 92 static int solve_lp(struct tab_lp *lp); 93 static void get_obj_val(struct tab_lp* lp, GBR_type *F); 94 static void delete_lp(struct tab_lp *lp); 95 static int add_lp_row(struct tab_lp *lp, isl_int *row, int dim); 96 static void get_alpha(struct tab_lp* lp, int row, GBR_type *alpha); 97 static int del_lp_row(struct tab_lp *lp) WARN_UNUSED; 98 static int cut_lp_to_hyperplane(struct tab_lp *lp, isl_int *row); [all …]
|
/netbsd-src/external/gpl2/lvm2/dist/tools/ |
H A D | lvresize.c | 4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 5 * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. 15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 53 struct lvresize_params *lp) in _validate_stripesize() argument 66 if (!(vg->fid->fmt->features & FMT_SEGMENTS)) in _validate_stripesize() 68 else if (arg_uint_value(cmd, stripesize_ARG, 0) > vg->extent_size * 2) { in _validate_stripesize() 73 display_size(cmd, (uint64_t) vg->extent_size)); in _validate_stripesize() 74 lp->stripe_size = vg->extent_size; in _validate_stripesize() 76 lp->stripe_size = arg_uint_value(cmd, stripesize_ARG, 0); in _validate_stripesize() 78 if (lp->mirrors) { in _validate_stripesize() [all …]
|
H A D | lvcreate.c | 4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. 5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 30 static int _lvcreate_name_params(struct lvcreate_params *lp, in _lvcreate_name_params() argument 38 lp->lv_name = arg_str_value(cmd, name_ARG, NULL); in _lvcreate_name_params() 40 if (lp->snapshot && !arg_count(cmd, virtualsize_ARG)) { in _lvcreate_name_params() 47 lp->origin = argv[0]; in _lvcreate_name_params() 48 (*pargv)++, (*pargc)--; in _lvcreate_name_params() 49 if (!(lp->vg_name = extract_vgname(cmd, lp->origin))) { in _lvcreate_name_params() 56 if ((ptr = strrchr(lp->origin, (int) '/'))) in _lvcreate_name_params() [all …]
|
H A D | lvconvert.c | 4 * Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved. 14 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 47 static int _lvconvert_name_params(struct lvconvert_params *lp, in _lvconvert_name_params() argument 54 if (lp->snapshot) { in _lvconvert_name_params() 61 lp->origin = *pargv[0]; in _lvconvert_name_params() 62 (*pargv)++, (*pargc)--; in _lvconvert_name_params() 63 if (!(lp->vg_name = extract_vgname(cmd, lp->origin))) { in _lvconvert_name_params() 70 if ((ptr = strrchr(lp->origin, (int) '/'))) in _lvconvert_name_params() 71 lp->origin = ptr + 1; in _lvconvert_name_params() 79 lp->lv_name = lp->lv_name_full = (*pargv)[0]; in _lvconvert_name_params() [all …]
|
/netbsd-src/external/cddl/osnet/dist/lib/libuutil/common/ |
H A D | uu_list.c | 35 #define ELEM_TO_NODE(lp, e) \ argument 36 ((uu_list_node_impl_t *)((uintptr_t)(e) + (lp)->ul_offset)) 38 #define NODE_TO_ELEM(lp, n) \ argument 39 ((void *)((uintptr_t)(n) - (lp)->ul_offset)) 44 * in the low-bits of the index, to help prevent mistakes. 49 #define INDEX_MAX (sizeof (uintptr_t) - 1) 53 #define NODE_TO_INDEX(p, n) (((uintptr_t)(n) & ~INDEX_MAX) | (p)->ul_index) 54 #define INDEX_VALID(p, i) (((i) & INDEX_MAX) == (p)->ul_index) 69 uu_check_name(name, UU_NAME_DOMAIN) == -1 || in uu_list_pool_create() 86 (void) strlcpy(pp->ulp_name, name, sizeof (pp->ulp_name)); in uu_list_pool_create() [all …]
|
/netbsd-src/sys/arch/mvme68k/mvme68k/ |
H A D | disksubr.c | 51 static void bsdtocpulabel(struct disklabel *lp, struct cpu_disklabel *clp); 52 static void cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp); 55 static void printlp(struct disklabel *lp, const char *str); 69 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, in readdisklabel() argument 76 bp = geteblk((int)lp->d_secsize); in readdisklabel() 79 bp->b_dev = dev; in readdisklabel() 80 bp->b_blkno = 0; /* contained in block 0 */ in readdisklabel() 81 bp->b_bcount = lp->d_secsize; in readdisklabel() 82 bp->b_flags |= B_READ; in readdisklabel() 83 bp->b_cylinder = 0; /* contained in block 0 */ in readdisklabel() [all …]
|
/netbsd-src/sys/arch/next68k/next68k/ |
H A D | disksubr.c | 75 parse_nextstep_label(struct next68k_disklabel *ondisk, struct disklabel *lp, in parse_nextstep_label() argument 81 if (ondisk->cd_version == NEXT68K_LABEL_CD_V3) { in parse_nextstep_label() 82 checksum = &ondisk->NEXT68K_LABEL_cd_v3_checksum; in parse_nextstep_label() 84 checksum = &ondisk->NEXT68K_LABEL_cd_checksum; in parse_nextstep_label() 91 osdep->od_version = ondisk->cd_version; in parse_nextstep_label() 92 lp->d_magic = lp->d_magic2 = DISKMAGIC; in parse_nextstep_label() 93 lp->d_type = DKTYPE_SCSI; in parse_nextstep_label() 94 lp->d_subtype = 0; in parse_nextstep_label() 95 if (sizeof(lp->d_typename) > sizeof(ondisk->cd_name)) in parse_nextstep_label() 96 lp->d_typename[sizeof (ondisk->cd_name)] = '\0'; in parse_nextstep_label() [all …]
|
/netbsd-src/sys/net/agr/ |
H A D | ieee8023ad_lacp_sm_rx.c | 3 /*- 78 lacp_sm_rx(struct lacp_port *lp, const struct lacpdu *du) in lacp_sm_rx() argument 86 if (!(lp->lp_state & LACP_STATE_AGGREGATION)) { in lacp_sm_rx() 94 if (!lacp_compare_systemid(&du->ldu_actor.lip_systemid, in lacp_sm_rx() 95 &lp->lp_actor.lip_systemid)) { in lacp_sm_rx() 100 * EXPIRED, DEFAULTED, CURRENT -> CURRENT in lacp_sm_rx() 103 lacp_sm_rx_update_selected(lp, du); in lacp_sm_rx() 104 lacp_sm_rx_update_ntt(lp, du); in lacp_sm_rx() 105 lacp_sm_rx_record_pdu(lp, du); in lacp_sm_rx() 107 timeout = (lp->lp_state & LACP_STATE_TIMEOUT) ? in lacp_sm_rx() [all …]
|
H A D | ieee8023ad_lacp.c | 3 /*- 97 struct lacp_port *lp; in ieee8023ad_lacp_input() local 100 port = ifp->if_lagg; /* XXX race with agr_remport. */ in ieee8023ad_lacp_input() 101 if (__predict_false(port->port_flags & AGRPORT_DETACHING)) { in ieee8023ad_lacp_input() 115 if (m->m_pkthdr.len != sizeof(*du)) { in ieee8023ad_lacp_input() 119 if ((m->m_flags & M_MCAST) == 0) { in ieee8023ad_lacp_input() 123 if (m->m_len < sizeof(*du)) { in ieee8023ad_lacp_input() 132 if (memcmp(&du->ldu_eh.ether_dhost, in ieee8023ad_lacp_input() 137 KASSERT(du->ldu_sph.sph_subtype == SLOWPROTOCOLS_SUBTYPE_LACP); in ieee8023ad_lacp_input() 145 if (du->ldu_sph.sph_version != 1) { in ieee8023ad_lacp_input() [all …]
|
H A D | ieee8023ad_lacp_sm_mux.c | 3 /*- 50 lacp_sm_mux(struct lacp_port *lp) in lacp_sm_mux() argument 54 (lp->lp_partner.lip_state & LACP_STATE_SYNC) != 0; in lacp_sm_mux() 56 (lp->lp_partner.lip_state & LACP_STATE_COLLECTING) != 0; in lacp_sm_mux() 57 enum lacp_selected selected = lp->lp_selected; in lacp_sm_mux() 60 /* LACP_DPRINTF((lp, "%s: state %d\n", __func__, lp->lp_mux_state)); */ in lacp_sm_mux() 63 la = lp->lp_aggregator; in lacp_sm_mux() 64 KASSERT(lp->lp_mux_state == LACP_MUX_DETACHED || la != NULL); in lacp_sm_mux() 65 new_state = lp->lp_mux_state; in lacp_sm_mux() 66 switch (lp->lp_mux_state) { in lacp_sm_mux() [all …]
|
/netbsd-src/sys/arch/ofppc/ofppc/ |
H A D | disksubr.c | 3 /*- 77 * blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE); 80 * greater sector sizes (e.g. 640MB MO-media with 2048 bytes/sector) 81 * we must multiply block numbers with (lp->d_secsize / DEV_BSIZE) 86 #define baddr(bp) (void *)((bp)->b_data) 103 * XXX - 110 read_dos_label(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, in read_dos_label() argument 120 bp = geteblk((int)lp->d_secsize); in read_dos_label() 121 bp->b_dev = dev; in read_dos_label() 124 bp->b_blkno = MBR_BBSECTOR; in read_dos_label() [all …]
|
/netbsd-src/sys/arch/sparc64/dev/ |
H A D | ldc.c | 47 ldc_rx_ctrl(struct ldc_conn *lc, struct ldc_pkt *lp) in ldc_rx_ctrl() argument 49 switch (lp->ctrl) { in ldc_rx_ctrl() 51 ldc_rx_ctrl_vers(lc, lp); in ldc_rx_ctrl() 55 ldc_rx_ctrl_rts(lc, lp); in ldc_rx_ctrl() 59 ldc_rx_ctrl_rtr(lc, lp); in ldc_rx_ctrl() 63 ldc_rx_ctrl_rdx(lc, lp); in ldc_rx_ctrl() 67 DPRINTF(("CTRL/0x%02x/0x%02x\n", lp->stype, lp->ctrl)); in ldc_rx_ctrl() 74 ldc_rx_ctrl_vers(struct ldc_conn *lc, struct ldc_pkt *lp) in ldc_rx_ctrl_vers() argument 76 switch (lp->stype) { in ldc_rx_ctrl_vers() 78 DPRINTF(("CTRL/INFO/VERS major %d minor %d\n", lp->major, lp->minor)); in ldc_rx_ctrl_vers() [all …]
|
/netbsd-src/sys/arch/amiga/amiga/ |
H A D | disksubr.c | 80 * blkno = bp->b_blkno / (lp->d_secsize / DEV_BSIZE); 83 * greater sector sizes (e.g. 640MB MO-media with 2048 bytes/sector) 84 * we must multiply block numbers with (lp->d_secsize / DEV_BSIZE) 114 #define baddr(bp) (void *)((bp)->b_data) 130 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *c… in readdisklabel() argument 143 clp->rdblock = RDBNULL; in readdisklabel() 148 if (lp->d_secperunit == 0) in readdisklabel() 149 lp->d_secperunit = 0x1fffffff; in readdisklabel() 150 if (lp->d_secpercyl == 0) in readdisklabel() 151 lp->d_secpercyl = 0x1fffffff; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/hpc/hpc/ |
H A D | disksubr.c | 49 -1 }; 51 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1) 58 * Otherwise, copy valid MBR partition-table into dp, and if a NetBSD 69 /* Note: Magic number is little-endian. */ in mbr_findslice() 70 mbrmagicp = (uint16_t *)((char*)bp->b_data + MBR_MAGIC_OFFSET); in mbr_findslice() 75 memcpy(dp, (char*)bp->b_data + MBR_PART_OFFSET, in mbr_findslice() 87 /* didn't find it -- look for 386BSD partition */ in mbr_findslice() 125 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, in readdisklabel() argument 137 if (lp->d_secsize == 0) in readdisklabel() 138 lp->d_secsize = DEV_BSIZE; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/ofppc/stand/ofwboot/ |
H A D | rdb.c | 3 /*- 49 while (cnt--) in rdbchksum() 119 search_rdb_label(struct of_dev *devp, char *buf, struct disklabel *lp) in search_rdb_label() argument 140 if (rbp->id == RDBLOCK_ID && rdbchksum(rbp) == 0) in search_rdb_label() 145 if (dlp->d_magic == DISKMAGIC && dkcksum(dlp) == 0) { in search_rdb_label() 146 *lp = *dlp; in search_rdb_label() 154 lp->d_npartitions = RAW_PART + 1; in search_rdb_label() 156 lp->d_partitions[i].p_size = 0; in search_rdb_label() 157 lp->d_partitions[i].p_offset = 0; in search_rdb_label() 158 lp->d_partitions[i].p_fstype = 0; in search_rdb_label() [all …]
|
/netbsd-src/external/lgpl3/gmp/dist/mpn/generic/ |
H A D | strongfibo.c | 1 /* mpn_fib2m -- calculate Fibonacci numbers, modulo m. 38 #include "gmp-impl.h" 43 /* Stores |{ap,n}-{bp,n}| in {rp,n}, 44 returns the sign of {ap,n}-{bp,n}. */ 49 while (--n >= 0) in abs_sub_n() 64 return -1; in abs_sub_n() 74 Lucas-Lehmer-Riesel test, indexing backward: 75 L_i = L_{i+1}^2 - 2 78 The starting point is given in L_{count+1} = {lp, mn}. 84 Note: (+/-2)^2-2=2, (+/-1)^2-2=-1, 0^2-2=-2 [all …]
|
/netbsd-src/sbin/disklabel/ |
H A D | printlabel.c | 60 showinfo(FILE *f, struct disklabel *lp, const char *specialname) in showinfo() argument 65 if ((unsigned) lp->d_type < DKMAXTYPES) in showinfo() 66 (void)fprintf(f, "type: %s\n", dktypenames[lp->d_type]); in showinfo() 68 (void)fprintf(f, "type: %" PRIu16 "\n", lp->d_type); in showinfo() 69 (void)fprintf(f, "disk: %.*s\n", (int) sizeof(lp->d_typename), in showinfo() 70 lp->d_typename); in showinfo() 71 (void)fprintf(f, "label: %.*s\n", (int) sizeof(lp->d_packname), in showinfo() 72 lp->d_packname); in showinfo() 74 if (lp->d_flags & D_REMOVABLE) in showinfo() 76 if (lp->d_flags & D_ECC) in showinfo() [all …]
|
/netbsd-src/sys/net/lagg/ |
H A D | if_lagg.c | 216 (_sc)->sc_if.if_xname : "lagg", ##_args); \ 233 s = sizeof(*_dummy) - sizeof(_dummy->sc_if); in lagg_sizeof_softc() 253 sc->sc_evgroup, name); in lagg_evcnt_attach() 263 if (ISSET(ifp->if_flags, IFF_UP)) in lagg_in6_ifattach() 283 lagg_lp_ioctl(struct lagg_port *lp, u_long cmd, void *data) in lagg_lp_ioctl() argument 288 if (lp->lp_ioctl == NULL) in lagg_lp_ioctl() 291 ifp_port = lp->lp_ifp; in lagg_lp_ioctl() 293 error = lp->lp_ioctl(ifp_port, cmd, data); in lagg_lp_ioctl() 372 ifp = &sc->sc_if; in lagg_clone_create() 374 mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_SOFTNET); in lagg_clone_create() [all …]
|
/netbsd-src/sys/arch/mipsco/mipsco/ |
H A D | disksubr.c | 55 #define LABELSIZE(lp) ((char *)&lp->d_partitions[lp->d_npartitions] - \ argument 56 (char *)lp) 67 readdisklabel(dev_t dev, void (*strat)(struct buf *bp), register struct disklabel *lp, struct cpu_d… in readdisklabel() argument 75 if (lp->d_secperunit == 0) in readdisklabel() 76 lp->d_secperunit = 0x1fffffff; in readdisklabel() 77 if (lp->d_npartitions == 0) { in readdisklabel() 78 lp->d_npartitions = RAW_PART + 1; in readdisklabel() 79 if (lp->d_partitions[RAW_PART].p_size == 0) in readdisklabel() 80 lp->d_partitions[RAW_PART].p_size = 0x1fffffff; in readdisklabel() 81 lp->d_partitions[RAW_PART].p_offset = 0; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/sgimips/sgimips/ |
H A D | disksubr.c | 50 static int disklabel_bsd_to_sgimips(struct disklabel *lp, 53 struct disklabel *lp); 57 #define LABELSIZE(lp) ((char *)&lp->d_partitions[lp->d_npartitions] - \ argument 58 (char *)lp) 74 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *c… in readdisklabel() argument 82 if (lp->d_secsize == 0) in readdisklabel() 83 lp->d_secsize = DEV_BSIZE; in readdisklabel() 84 if (lp->d_secperunit == 0) in readdisklabel() 85 lp->d_secperunit = 0x1fffffff; in readdisklabel() 88 bp = geteblk((int)lp->d_secsize); in readdisklabel() [all …]
|
/netbsd-src/sys/arch/sh3/sh3/ |
H A D | disksubr.c | 51 -1 }; 53 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1) 72 #define SW16(X) nlp->X = bswap16(olp->X) in swap_endian_disklabel() 73 #define SW32(X) nlp->X = bswap32(olp->X) in swap_endian_disklabel() 80 memcpy(nlp->d_typename, olp->d_typename, sizeof(nlp->d_typename)); in swap_endian_disklabel() 83 memcpy(nlp->d_packname, olp->d_packname, sizeof(nlp->d_packname)); in swap_endian_disklabel() 102 SW32(d_trkseek); /* track-to-track seek, usec */ in swap_endian_disklabel() 106 SW32(d_drivedata[i]); /* drive-type specific information */ in swap_endian_disklabel() 124 nlp->d_partitions[i].p_fstype = olp->d_partitions[i].p_fstype; in swap_endian_disklabel() 125 nlp->d_partitions[i].p_frag = olp->d_partitions[i].p_frag; in swap_endian_disklabel() [all …]
|
/netbsd-src/sys/arch/x68k/x68k/ |
H A D | disksubr.c | 65 struct disklabel *lp, struct cpu_disklabel *osdep) in readdisklabel() argument 68 struct dkbad *bdp = &osdep->bad; in readdisklabel() 75 dp = osdep->dosparts; in readdisklabel() 77 if (lp->d_secsize == 0) in readdisklabel() 78 lp->d_secsize = DEF_BSIZE; in readdisklabel() 79 if (lp->d_secperunit == 0) in readdisklabel() 80 lp->d_secperunit = 0x1fffffff; in readdisklabel() 81 lp->d_npartitions = RAW_PART + 1; in readdisklabel() 83 lp->d_partitions[i].p_size = 0; in readdisklabel() 84 lp->d_partitions[i].p_offset = 0; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/evbmips/sbmips/ |
H A D | disksubr.c | 42 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1) 49 * Otherwise, copy valid MBR partition-table into dp, and if a NetBSD 60 /* Note: Magic number is little-endian. */ in mbr_findslice() 61 mbrmagicp = (uint16_t *)((char *)bp->b_data + MBR_MAGIC_OFFSET); in mbr_findslice() 66 memcpy(dp, (char *)bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp)); in mbr_findslice() 96 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *o… in readdisklabel() argument 107 if (lp->d_secsize == 0) in readdisklabel() 108 lp->d_secsize = DEV_BSIZE; in readdisklabel() 109 if (lp->d_secperunit == 0) in readdisklabel() 110 lp->d_secperunit = 0x1fffffff; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/sbmips/sbmips/ |
H A D | disksubr.c | 42 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1) 49 * Otherwise, copy valid MBR partition-table into dp, and if a NetBSD 60 /* Note: Magic number is little-endian. */ in mbr_findslice() 61 mbrmagicp = (uint16_t *)((char *)bp->b_data + MBR_MAGIC_OFFSET); in mbr_findslice() 66 memcpy(dp, (char *)bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp)); in mbr_findslice() 96 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *o… in readdisklabel() argument 107 if (lp->d_secsize == 0) in readdisklabel() 108 lp->d_secsize = DEV_BSIZE; in readdisklabel() 109 if (lp->d_secperunit == 0) in readdisklabel() 110 lp->d_secperunit = 0x1fffffff; in readdisklabel() [all …]
|
/netbsd-src/sys/arch/playstation2/playstation2/ |
H A D | disksubr.c | 41 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1) 48 * Otherwise, copy valid MBR partition-table into dp, and if a NetBSD 59 /* Note: Magic number is little-endian. */ in mbr_findslice() 60 mbrmagicp = (u_int16_t *)((char*)bp->b_data + MBR_MAGIC_OFFSET); in mbr_findslice() 65 memcpy(dp, (char*)bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp)); in mbr_findslice() 95 readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, in readdisklabel() argument 107 if (lp->d_secsize == 0) in readdisklabel() 108 lp->d_secsize = DEV_BSIZE; in readdisklabel() 109 if (lp->d_secperunit == 0) in readdisklabel() 110 lp->d_secperunit = 0x1fffffff; in readdisklabel() [all …]
|