/freebsd/contrib/arm-optimized-routines/networking/aarch64/ |
H A D | chksum_simd.c | 19 slurp_head64(const void **pptr, uint32_t *nbytes) in slurp_head64() argument 21 Assert(*nbytes >= 8); in slurp_head64() 34 *nbytes -= 8 - off; in slurp_head64() 41 slurp_tail64(uint64_t sum, const void *ptr, uint32_t nbytes) in slurp_tail64() argument 43 Assert(nbytes < 8); in slurp_tail64() 44 if (likely(nbytes != 0)) in slurp_tail64() 47 uint64_t mask = ALL_ONES >> (CHAR_BIT * (8 - nbytes)); in slurp_tail64() 48 Assert(__builtin_popcountl(mask) / CHAR_BIT == nbytes); in slurp_tail64() 52 nbytes = 0; in slurp_tail64() 54 Assert(nbytes == 0); in slurp_tail64() [all …]
|
/freebsd/contrib/arm-optimized-routines/networking/ |
H A D | chksum.c | 14 slurp_head32(const void **pptr, uint32_t *nbytes) in slurp_head32() argument 17 Assert(*nbytes >= 4); in slurp_head32() 26 *nbytes -= 4 - off; in slurp_head32() 33 __chksum(const void *ptr, unsigned int nbytes) in __chksum() argument 38 if (nbytes > 300) in __chksum() 42 sum = slurp_head32(&ptr, &nbytes); in __chksum() 48 for (uint32_t nquads = nbytes / 16; nquads != 0; nquads--) in __chksum() 57 nbytes %= 16; in __chksum() 58 Assert(nbytes < 16); in __chksum() 61 while (nbytes >= 4) in __chksum() [all …]
|
/freebsd/sys/dev/bhnd/nvram/ |
H A D | bhnd_nvram_iores.c | 162 const void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_iores_read_ptr() argument 170 void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_iores_write_ptr() argument 186 size_t *nbytes) in bhnd_nvram_iores_validate_req() argument 194 *nbytes = 0; in bhnd_nvram_iores_validate_req() 203 *nbytes = ummin(*nbytes, iores->size - offset); in bhnd_nvram_iores_validate_req() 204 if (*nbytes < iores->bus_width && *nbytes % iores->bus_width != 0) in bhnd_nvram_iores_validate_req() 212 size_t nbytes) in bhnd_nvram_iores_read() argument 223 navail = nbytes; in bhnd_nvram_iores_read() 228 if (navail < nbytes) in bhnd_nvram_iores_read() 232 if (nbytes == 0) in bhnd_nvram_iores_read() [all …]
|
H A D | bhnd_nvram_value_prf.c | 214 size_t limit, nbytes; in bhnd_nvram_val_vprintf() local 220 nbytes = 0; in bhnd_nvram_val_vprintf() 227 if (limit > nbytes) \ in bhnd_nvram_val_vprintf() 228 *(outp + nbytes) = _c; \ in bhnd_nvram_val_vprintf() 230 if (nbytes == SIZE_MAX) \ in bhnd_nvram_val_vprintf() 232 nbytes++; \ in bhnd_nvram_val_vprintf() 544 if (limit > nbytes) in bhnd_nvram_val_vprintf() 545 nremain = limit - nbytes; in bhnd_nvram_val_vprintf() 548 memcpy(outp + nbytes, delim, delim_len); in bhnd_nvram_val_vprintf() 551 if (SIZE_MAX - nbytes < delim_len) in bhnd_nvram_val_vprintf() [all …]
|
H A D | bhnd_nvram_ioptr.c | 139 size_t nbytes, size_t *navail) in bhnd_nvram_ioptr_ptr() argument 148 if (avail < nbytes) in bhnd_nvram_ioptr_ptr() 162 const void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_ioptr_read_ptr() argument 171 error = bhnd_nvram_ioptr_ptr(ioptr, offset, &writep, nbytes, navail); in bhnd_nvram_ioptr_read_ptr() 182 void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_ioptr_write_ptr() argument 193 return (bhnd_nvram_ioptr_ptr(ioptr, offset, ptr, nbytes, navail)); in bhnd_nvram_ioptr_write_ptr() 198 size_t nbytes) in bhnd_nvram_ioptr_read() argument 204 if ((error = bhnd_nvram_io_read_ptr(io, offset, &ptr, nbytes, NULL))) in bhnd_nvram_ioptr_read() 208 memcpy(buffer, ptr, nbytes); in bhnd_nvram_ioptr_read() 214 void *buffer, size_t nbytes) in bhnd_nvram_ioptr_write() argument [all …]
|
H A D | bhnd_nvram_value.c | 666 size_t limit, nbytes; in bhnd_nvram_val_encode_null() local 677 nbytes = 0; in bhnd_nvram_val_encode_null() 683 nbytes = 0; in bhnd_nvram_val_encode_null() 691 *olen = nbytes; in bhnd_nvram_val_encode_null() 710 size_t limit, nbytes, nelem; in bhnd_nvram_val_encode_bool() local 739 nbytes = 0; in bhnd_nvram_val_encode_bool() 747 nbytes = strlen(str) + 1; in bhnd_nvram_val_encode_bool() 748 if (limit > nbytes) in bhnd_nvram_val_encode_bool() 769 *olen = nbytes; in bhnd_nvram_val_encode_bool() 823 size_t limit, nbytes; in bhnd_nvram_val_encode_string() local [all …]
|
H A D | bhnd_nvram_subr.c | 709 size_t *nbytes, void *outp, size_t *olen, bhnd_nvram_type otype) in bhnd_nvram_parse_int() argument 730 if (nbytes == NULL) in bhnd_nvram_parse_int() 731 nbytes = &local_nbytes; in bhnd_nvram_parse_int() 735 *nbytes = 0; in bhnd_nvram_parse_int() 744 for (; *nbytes < maxlen; (*nbytes)++) { in bhnd_nvram_parse_int() 745 if (!bhnd_nv_isspace(str[*nbytes])) in bhnd_nvram_parse_int() 750 if (*nbytes == maxlen) in bhnd_nvram_parse_int() 754 if (str[*nbytes] == '-') { in bhnd_nvram_parse_int() 757 (*nbytes)++; in bhnd_nvram_parse_int() 758 } else if (str[*nbytes] == '+') { in bhnd_nvram_parse_int() [all …]
|
H A D | bhnd_nvram_io.c | 62 size_t nbytes) in bhnd_nvram_io_read() argument 64 return (io->iops->read(io, offset, buffer, nbytes)); in bhnd_nvram_io_read() 94 const void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_io_read_ptr() argument 96 return (io->iops->read_ptr(io, offset, ptr, nbytes, navail)); in bhnd_nvram_io_read_ptr() 118 size_t nbytes) in bhnd_nvram_io_write() argument 120 return (io->iops->write(io, offset, buffer, nbytes)); in bhnd_nvram_io_write() 152 size_t nbytes, size_t *navail) in bhnd_nvram_io_write_ptr() argument 154 return (io->iops->write_ptr(io, offset, ptr, nbytes, navail)); in bhnd_nvram_io_write_ptr()
|
H A D | bhnd_nvram_iobuf.c | 254 size_t nbytes, size_t *navail) in bhnd_nvram_iobuf_ptr() argument 263 if (avail < nbytes) in bhnd_nvram_iobuf_ptr() 277 const void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_iobuf_read_ptr() argument 286 error = bhnd_nvram_iobuf_ptr(iobuf, offset, &ioptr, nbytes, navail); in bhnd_nvram_iobuf_read_ptr() 297 void **ptr, size_t nbytes, size_t *navail) in bhnd_nvram_iobuf_write_ptr() argument 304 return (bhnd_nvram_iobuf_ptr(iobuf, offset, ptr, nbytes, navail)); in bhnd_nvram_iobuf_write_ptr() 309 size_t nbytes) in bhnd_nvram_iobuf_read() argument 315 if ((error = bhnd_nvram_io_read_ptr(io, offset, &ptr, nbytes, NULL))) in bhnd_nvram_iobuf_read() 319 memcpy(buffer, ptr, nbytes); in bhnd_nvram_iobuf_read() 325 void *buffer, size_t nbytes) in bhnd_nvram_iobuf_write() argument [all …]
|
/freebsd/contrib/arm-optimized-routines/networking/arm/ |
H A D | chksum_simd.c | 18 __chksum_arm_simd(const void *ptr, unsigned int nbytes) in __chksum_arm_simd() argument 23 if (unlikely(nbytes < 40)) in __chksum_arm_simd() 25 uint64_t sum = slurp_small(ptr, nbytes); in __chksum_arm_simd() 31 Assert(nbytes >= 8); in __chksum_arm_simd() 47 nbytes -= 8 - off; in __chksum_arm_simd() 57 for (uint32_t i = 0; i < nbytes / 64; i++) in __chksum_arm_simd() 69 nbytes %= 64; in __chksum_arm_simd() 77 while (likely(nbytes >= 16)) in __chksum_arm_simd() 82 nbytes -= 16; in __chksum_arm_simd() 84 Assert(nbytes < 16); in __chksum_arm_simd() [all …]
|
/freebsd/sys/kern/ |
H A D | vfs_extattr.c | 52 size_t nbytes, int follow); 55 size_t nbytes, int follow); 59 int attrnamespace, void *data, size_t nbytes, int follow); 174 void *data, size_t nbytes, struct thread *td) in extattr_set_vp() argument 182 if (nbytes > IOSIZE_MAX) in extattr_set_vp() 191 aiov.iov_len = nbytes; in extattr_set_vp() 195 auio.uio_resid = nbytes; in extattr_set_vp() 199 cnt = nbytes; in extattr_set_vp() 227 size_t nbytes; member 240 attrname, uap->data, uap->nbytes)); in sys_extattr_set_fd() [all …]
|
/freebsd/sys/dev/random/fenestrasX/ |
H A D | fx_brng.c | 163 size_t nbytes) in fxrng_brng_getbytes_internal() argument 169 if (__predict_false(nbytes == 0)) { in fxrng_brng_getbytes_internal() 175 if (rng->brng_avail_idx + nbytes <= sizeof(rng->brng_buffer)) { in fxrng_brng_getbytes_internal() 176 memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal() 177 explicit_bzero(&rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal() 178 rng->brng_avail_idx += nbytes; in fxrng_brng_getbytes_internal() 184 if (nbytes < sizeof(rng->brng_buffer)) { in fxrng_brng_getbytes_internal() 190 ASSERT_DEBUG(nbytes > rem, "invariant"); in fxrng_brng_getbytes_internal() 195 nbytes -= rem; in fxrng_brng_getbytes_internal() 196 ASSERT_DEBUG(nbytes != 0, "invariant"); in fxrng_brng_getbytes_internal() [all …]
|
/freebsd/lib/libc/stdio/ |
H A D | fmemopen.c | 46 static int fmemopen_read(void *cookie, char *buf, int nbytes); 47 static int fmemopen_write(void *cookie, const char *buf, int nbytes); 164 fmemopen_read(void *cookie, char *buf, int nbytes) in fmemopen_read() argument 168 if (nbytes > ck->len - ck->off) in fmemopen_read() 169 nbytes = ck->len - ck->off; in fmemopen_read() 171 if (nbytes == 0) in fmemopen_read() 174 memcpy(buf, ck->buf + ck->off, nbytes); in fmemopen_read() 176 ck->off += nbytes; in fmemopen_read() 178 return (nbytes); in fmemopen_read() 182 fmemopen_write(void *cookie, const char *buf, int nbytes) in fmemopen_write() argument [all …]
|
H A D | xprintf_str.c | 60 size_t clen, nbytes; in __wcsconv() local 66 nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, &mbs); in __wcsconv() 67 if (nbytes == (size_t)-1) in __wcsconv() 76 nbytes = prec; in __wcsconv() 78 nbytes = 0; in __wcsconv() 84 (int)(nbytes + clen) > prec) in __wcsconv() 86 nbytes += clen; in __wcsconv() 90 if ((convbuf = malloc(nbytes + 1)) == NULL) in __wcsconv() 96 if ((nbytes = wcsrtombs(convbuf, (const wchar_t **)&p, in __wcsconv() 97 nbytes, &mbs)) == (size_t)-1) { in __wcsconv() [all …]
|
/freebsd/lib/libc/db/btree/ |
H A D | bt_split.c | 83 u_int32_t n, nbytes, nksize; in __bt_split() local 171 nbytes = NBINTERNAL(bi->ksize); in __bt_split() 175 nbytes = NBINTERNAL(bl->ksize); in __bt_split() 185 if (n < nbytes) { in __bt_split() 187 bt_pfxsaved += nbytes - n; in __bt_split() 189 nbytes = n; in __bt_split() 197 nbytes = NRINTERNAL; in __bt_split() 204 if ((u_int32_t)(h->upper - h->lower) < nbytes + sizeof(indx_t)) { in __bt_split() 207 bt_root(t, h, &l, &r, &skip, nbytes) : in __bt_split() 208 bt_page(t, h, &l, &r, &skip, nbytes); in __bt_split() [all …]
|
/freebsd/bin/sh/ |
H A D | memalloc.c | 57 ckmalloc(size_t nbytes) in ckmalloc() argument 63 p = malloc(nbytes); in ckmalloc() 75 ckrealloc(pointer p, int nbytes) in ckrealloc() argument 79 p = realloc(p, nbytes); in ckrealloc() 136 stnewblock(int nbytes) in stnewblock() argument 141 if (nbytes < MINSIZE) in stnewblock() 142 nbytes = MINSIZE; in stnewblock() 144 allocsize = ALIGN(sizeof(struct stack_block)) + ALIGN(nbytes); in stnewblock() 158 stalloc(int nbytes) in stalloc() argument 162 nbytes = ALIGN(nbytes); in stalloc() [all …]
|
/freebsd/contrib/file/src/ |
H A D | encoding.c | 80 size_t nbytes = b->flen; in file_encoding() local 96 if (nbytes > ms->encoding_max) in file_encoding() 97 nbytes = ms->encoding_max; in file_encoding() 99 mlen = (nbytes + 1) * sizeof((*ubuf)[0]); in file_encoding() 105 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding() 106 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding() 115 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding() 119 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding() 123 } else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding() 132 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding() [all …]
|
/freebsd/crypto/openssl/engines/ |
H A D | e_padlock.c | 314 const unsigned char *in_arg, size_t nbytes) in padlock_ecb_cipher() argument 317 ALIGNED_CIPHER_DATA(ctx), nbytes); in padlock_ecb_cipher() 322 const unsigned char *in_arg, size_t nbytes) in padlock_cbc_cipher() argument 328 if ((ret = padlock_cbc_encrypt(out_arg, in_arg, cdata, nbytes))) in padlock_cbc_cipher() 335 const unsigned char *in_arg, size_t nbytes) in padlock_cfb_cipher() argument 347 while (chunk < AES_BLOCK_SIZE && nbytes != 0) { in padlock_cfb_cipher() 349 chunk++, nbytes--; in padlock_cfb_cipher() 351 while (chunk < AES_BLOCK_SIZE && nbytes != 0) { in padlock_cfb_cipher() 354 ivp[chunk++] = c, nbytes--; in padlock_cfb_cipher() 360 if (nbytes == 0) in padlock_cfb_cipher() [all …]
|
/freebsd/usr.sbin/fdread/ |
H A D | fdread.c | 163 unsigned int nbytes, tracksize, mediasize, secsize, n; in doread() local 180 for (nbytes = 0; nbytes < mediasize;) { in doread() 181 if (lseek(fd, nbytes, SEEK_SET) != nbytes) in doread() 186 warnx("premature EOF after %u bytes", nbytes); in doread() 191 nbytes += rv; in doread() 193 fprintf(stderr, "%5d KB\r", nbytes / 1024); in doread() 201 if (lseek(fd, nbytes, SEEK_SET) != nbytes) in doread() 205 nbytes += rv; in doread() 208 nbytes / 1024); in doread() 266 nbytes, in doread() [all …]
|
/freebsd/lib/libsecureboot/openpgp/ |
H A D | dearmor.c | 42 dearmor(char *pem, size_t nbytes, size_t *len) in dearmor() argument 59 memmove(cp, ep, nbytes - (size_t)(ep - pem)); in dearmor() 60 nbytes -= (size_t)(ep - cp); in dearmor() 61 pem[nbytes] = '\0'; in dearmor() 69 memmove(cp, ep, nbytes - (size_t)(ep - pem)); in dearmor() 70 nbytes -= (size_t)(ep - cp); in dearmor() 71 pem[nbytes] = '\0'; in dearmor() 73 if ((po = decode_pem(pem, nbytes, &npo))) { in dearmor() 78 if ((bp = BIO_new_mem_buf(pem, (int)nbytes))) { in dearmor() 79 long llen = (long)nbytes; in dearmor()
|
/freebsd/sys/netinet/libalias/ |
H A D | alias_util.c | 74 int nbytes) in LibAliasInternetChecksum() argument 80 while (nbytes > 1) { in LibAliasInternetChecksum() 82 nbytes -= 2; in LibAliasInternetChecksum() 84 if (nbytes == 1) { in LibAliasInternetChecksum() 110 int nhdr, ntcp, nbytes; in TcpChecksum() local 120 nbytes = ntcp; in TcpChecksum() 122 while (nbytes > 1) { in TcpChecksum() 124 nbytes -= 2; in TcpChecksum() 126 if (nbytes == 1) { in TcpChecksum()
|
/freebsd/contrib/tcsh/ |
H A D | tc.alloc.c | 177 malloc(size_t nbytes) in malloc() argument 198 nbytes++; in malloc() 201 nbytes = MEMALIGN(MEMALIGN(sizeof(union overhead)) + nbytes + RSLOP); in malloc() 202 shiftr = (nbytes - 1) >> 2; in malloc() 219 xprintf(CGETS(19, 1, "nbytes=%zu: Out of memory\n"), nbytes); in malloc() 234 p->ov_size = (p->ov_index <= 13) ? (U_short)nbytes - 1 : 0; in malloc() 236 *((U_int *) (((caddr_t) p) + nbytes - RSLOP)) = RMAGIC; in malloc() 240 if (nbytes) in malloc() 386 realloc(ptr_t cp, size_t nbytes) in realloc() argument 396 return (malloc(nbytes)); in realloc() [all …]
|
/freebsd/libexec/rtld-elf/rtld-libc/ |
H A D | rtld_libc.h | 79 #define pread(fd, buf, nbytes, offset) __sys_pread(fd, buf, nbytes, offset) argument 80 #define read(fd, buf, nbytes) __sys_read(fd, buf, nbytes) argument 83 #define _write(fd, buf, nbytes) __sys_write(fd, buf, nbytes) argument 84 #define write(fd, buf, nbytes) __sys_write(fd, buf, nbytes) argument
|
/freebsd/contrib/ntp/libntp/lib/isc/ |
H A D | netaddr.c | 75 unsigned int nbytes; /* Number of significant whole bytes */ in isc_netaddr_eqprefix() local 107 nbytes = prefixlen / 8; in isc_netaddr_eqprefix() 110 if (nbytes > 0) { in isc_netaddr_eqprefix() 111 if (memcmp(pa, pb, nbytes) != 0) in isc_netaddr_eqprefix() 116 INSIST(nbytes < ipabytes); in isc_netaddr_eqprefix() 118 bytea = pa[nbytes]; in isc_netaddr_eqprefix() 119 byteb = pb[nbytes]; in isc_netaddr_eqprefix() 218 unsigned int nbits, nbytes, ipbytes = 0; in isc_netaddr_prefixok() local 237 nbytes = prefixlen / 8; in isc_netaddr_prefixok() 240 if ((p[nbytes] & (0xff>>nbits)) != 0U) in isc_netaddr_prefixok() [all …]
|
/freebsd/lib/libc/locale/ |
H A D | wcsnrtombs.c | 67 size_t nbytes; in __wcsnrtombs_std() local 71 nbytes = 0; in __wcsnrtombs_std() 79 return (nbytes + nb - 1); in __wcsnrtombs_std() 81 nbytes += nb; in __wcsnrtombs_std() 83 return (nbytes); in __wcsnrtombs_std() 115 return (nbytes + nb - 1); in __wcsnrtombs_std() 120 nbytes += nb; in __wcsnrtombs_std() 123 return (nbytes); in __wcsnrtombs_std()
|