Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 105) sorted by relevance

12345

/sys/kern/
Dcopy.c15 extern int copy_unsafe(void *to_addr, void *from_addr, uintptr_t len);
16 extern int copystr_unsafe(void *to_addr, void *from_addr, uintptr_t len);
34 Copy_In(uintptr_t fromuser, void *tokernel, uintptr_t len) in Copy_In() argument
36 if (len == 0) in Copy_In()
46 if (len > (MEM_USERSPACE_TOP - fromuser)) { in Copy_In()
51 return copy_unsafe(tokernel, (void *)fromuser, len); in Copy_In()
70 Copy_Out(void *fromkernel, uintptr_t touser, uintptr_t len) in Copy_Out() argument
72 if (len == 0) in Copy_Out()
82 if (len > (MEM_USERSPACE_TOP - touser)) { in Copy_Out()
87 return copy_unsafe((void *)touser, fromkernel, len); in Copy_Out()
[all …]
Dsga.c14 sga->len = 0; in SGArray_Init()
18 SGArray_Append(SGArray *sga, uint64_t off, uint64_t len) in SGArray_Append() argument
20 ASSERT(sga->len < SGARRAY_MAX_ENTRIES) in SGArray_Append()
22 sga->entries[sga->len].offset = off; in SGArray_Append()
23 sga->entries[sga->len].length = len; in SGArray_Append()
24 sga->len++; in SGArray_Append()
26 return sga->len; in SGArray_Append()
35 for (i = 0; i < sga->len; i++) in SGArray_Dump()
Dvfs.c68 uint64_t len; in VFS_Lookup() local
84 len = (size_t)(end - start); in VFS_Lookup()
85 if (len == 0) { in VFS_Lookup()
89 if (len > 256) { in VFS_Lookup()
94 memcpy(curName, start, len); in VFS_Lookup()
95 curName[len] = '\0'; in VFS_Lookup()
180 VFS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len) in VFS_Read() argument
182 return fn->op->read(fn, buf, off, len); in VFS_Read()
198 VFS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len) in VFS_Write() argument
200 return fn->op->write(fn, buf, off, len); in VFS_Write()
[all …]
Dloader.c62 uintptr_t offset, uintptr_t len) in LoaderLoadSegment() argument
68 uintptr_t rlen = maxlen < len ? maxlen : len; in LoaderLoadSegment()
74 len -= rlen; in LoaderLoadSegment()
77 while (len > PGSIZE) { in LoaderLoadSegment()
82 len -= PGSIZE; in LoaderLoadSegment()
85 if (len > 0) { in LoaderLoadSegment()
87 VFS_Read(vn, raddr, offset, len); in LoaderLoadSegment()
98 LoaderZeroSegment(AS *as, uintptr_t vaddr, uintptr_t len) in LoaderZeroSegment() argument
104 uintptr_t rlen = maxlen < len ? maxlen : len; in LoaderZeroSegment()
109 len -= rlen; in LoaderZeroSegment()
[all …]
/lib/liblwip/src/core/snmp/
Dasn1_dec.c61 plen += p->len; in snmp_asn1_dec_type()
94 plen += p->len; in snmp_asn1_dec_length()
129 plen += p->len; in snmp_asn1_dec_length()
190 plen += p->len; in snmp_asn1_dec_length()
240 snmp_asn1_dec_u32t(struct pbuf *p, u16_t ofs, u16_t len, u32_t *value) in snmp_asn1_dec_u32t() argument
249 plen += p->len; in snmp_asn1_dec_u32t()
254 if ((len > 0) && (len < 6)) in snmp_asn1_dec_u32t()
266 if ((len > 1) && (*msg_ptr == 0)) in snmp_asn1_dec_u32t()
269 len--; in snmp_asn1_dec_u32t()
277 plen += p->len; in snmp_asn1_dec_u32t()
[all …]
Dmib_structs.c559 u16_t i, len; in snmp_search_tree() local
567 len = en->level_length(en->addr_inf,ext_level); in snmp_search_tree()
568 while ((i < len) && (en->ident_cmp(en->addr_inf,ext_level,i,*ident) != 0)) in snmp_search_tree()
572 if (i < len) in snmp_search_tree()
712 oidret->id[oidret->len] = an->objid[i]; in snmp_expand_tree()
713 (oidret->len)++; in snmp_expand_tree()
726 (oidret->len)--; in snmp_expand_tree()
727 oidret->id[oidret->len] = an->objid[i + 1]; in snmp_expand_tree()
728 (oidret->len)++; in snmp_expand_tree()
734 (oidret->len)--; in snmp_expand_tree()
[all …]
Dmsg_in.c405 …en->get_object_def_a(request_id, 1, &msg_ps->ext_oid.id[msg_ps->ext_oid.len - 1], &msg_ps->ext_obj… in snmp_msg_getnext_event()
413 en->get_object_def_pc(request_id, 1, &msg_ps->ext_oid.id[msg_ps->ext_oid.len - 1]); in snmp_msg_getnext_event()
490 en->get_object_def_q(en->addr_inf, request_id, 1, &oid.id[oid.len - 1]); in snmp_msg_getnext_event()
499 mn->get_object_def(1, &oid.id[oid.len - 1], &object_def); in snmp_msg_getnext_event()
919 u16_t len, ofs_base; in snmp_pdu_header_check() local
926 derr = snmp_asn1_dec_length(p, ofs+1, &len_octets, &len); in snmp_pdu_header_check()
928 (pdu_len != (1 + len_octets + len)) || in snmp_pdu_header_check()
936 derr = snmp_asn1_dec_length(p, ofs+1, &len_octets, &len); in snmp_pdu_header_check()
943 derr = snmp_asn1_dec_s32t(p, ofs + 1 + len_octets, len, &version); in snmp_pdu_header_check()
956 ofs += (1 + len_octets + len); in snmp_pdu_header_check()
[all …]
Dasn1_enc.c190 plen += p->len; in snmp_asn1_enc_type()
222 plen += p->len; in snmp_asn1_enc_length()
269 plen += p->len; in snmp_asn1_enc_length()
317 plen += p->len; in snmp_asn1_enc_u32t()
335 plen += p->len; in snmp_asn1_enc_u32t()
354 plen += p->len; in snmp_asn1_enc_u32t()
393 plen += p->len; in snmp_asn1_enc_s32t()
410 plen += p->len; in snmp_asn1_enc_s32t()
447 plen += p->len; in snmp_asn1_enc_oid()
472 plen += p->len; in snmp_asn1_enc_oid()
[all …]
/lib/liblwip/src/core/ipv4/
Dinet_chksum.c81 lwip_standard_chksum(void *dataptr, u16_t len) in lwip_standard_chksum() argument
90 while (len > 1) { in lwip_standard_chksum()
99 len -= 2; in lwip_standard_chksum()
101 if (len > 0) { in lwip_standard_chksum()
135 lwip_standard_chksum(void *dataptr, int len) in lwip_standard_chksum() argument
143 if (odd && len > 0) { in lwip_standard_chksum()
145 len--; in lwip_standard_chksum()
150 while (len > 1) { in lwip_standard_chksum()
152 len -= 2; in lwip_standard_chksum()
156 if (len > 0) { in lwip_standard_chksum()
[all …]
/lib/liblwip/src/core/
Dpbuf.c255 p->len = LWIP_MIN(length, PBUF_POOL_BUFSIZE_ALIGNED - LWIP_MEM_ALIGN_SIZE(offset)); in pbuf_alloc()
257 ((u8_t*)p->payload + p->len <= in pbuf_alloc()
269 rem_len = length - p->len; in pbuf_alloc()
289 q->len = LWIP_MIN((u16_t)rem_len, PBUF_POOL_BUFSIZE_ALIGNED); in pbuf_alloc()
294 ((u8_t*)p->payload + p->len <= in pbuf_alloc()
298 rem_len -= q->len; in pbuf_alloc()
314 p->len = p->tot_len = length; in pbuf_alloc()
335 p->len = p->tot_len = length; in pbuf_alloc()
407 p->pbuf.len = p->pbuf.tot_len = length; in pbuf_alloced_custom()
456 while (rem_len > q->len) { in pbuf_realloc()
[all …]
Dtcp_out.c63 #define TCP_DATA_COPY(dst, src, len, seg) do { \ argument
64 tcp_seg_add_chksum(LWIP_CHKSUM_COPY(dst, src, len), \
65 len, &seg->chksum, &seg->chksum_swapped); \
67 #define TCP_DATA_COPY2(dst, src, len, chksum, chksum_swapped) \ argument
68 tcp_seg_add_chksum(LWIP_CHKSUM_COPY(dst, src, len), len, chksum, chksum_swapped);
70 #define TCP_DATA_COPY(dst, src, len, seg) MEMCPY(dst, src, len) argument
71 #define TCP_DATA_COPY2(dst, src, len, chksum, chksum_swapped) MEMCPY(dst, src, len) argument
101 (p->len >= TCP_HLEN + optlen)); in tcp_output_alloc_header()
172 seg->len = p->tot_len - optlen; in tcp_create_segment()
260 *oversize = p->len - length; in tcp_pbuf_prealloc()
[all …]
/lib/liblwip/src/include/lwip/
Dsnmp_structs.h112 void (*get_value)(struct obj_def *od, u16_t len, void *value);
114 u8_t (*set_test)(struct obj_def *od, u16_t len, void *value);
116 void (*set_value)(struct obj_def *od, u16_t len, void *value);
132 void (*get_value)(struct obj_def *od, u16_t len, void *value);
133 u8_t (*set_test)(struct obj_def *od, u16_t len, void *value);
134 void (*set_value)(struct obj_def *od, u16_t len, void *value);
150 void (*get_value)(struct obj_def *od, u16_t len, void *value);
151 u8_t (*set_test)(struct obj_def *od, u16_t len, void *value);
152 void (*set_value)(struct obj_def *od, u16_t len, void *value);
176 void (*get_value)(struct obj_def *od, u16_t len, void *value);
[all …]
Dnetbuf.h74 void **dataptr, u16_t *len);
79 #define netbuf_copy_partial(buf, dataptr, len, offset) \ argument
80 pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
81 #define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) argument
82 #define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) argument
/lib/liblwip/src/netif/ppp/
Dchap.c147 static void ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len);
148 static void ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len);
368 int len; in ChapInput() local
381 GETSHORT(len, inp); in ChapInput()
382 if (len < CHAP_HEADERLEN) { in ChapInput()
386 if (len > packet_len) { in ChapInput()
390 len -= CHAP_HEADERLEN; in ChapInput()
397 ChapReceiveChallenge(cstate, inp, id, len); in ChapInput()
401 ChapReceiveResponse(cstate, inp, id, len); in ChapInput()
405 ChapReceiveFailure(cstate, inp, id, len); in ChapInput()
[all …]
Dppp_oe.c239 pppoe_find_softc_by_hunique(u8_t *token, size_t len, struct netif *rcvif) in pppoe_find_softc_by_hunique() argument
247 if (len != sizeof sc) { in pppoe_find_softc_by_hunique()
250 MEMCPY(&t, token, len); in pppoe_find_softc_by_hunique()
287 u16_t tag, len; in pppoe_dispatch_disc_pkt() local
308 if (pb->len < sizeof(*ethhdr)) { in pppoe_dispatch_disc_pkt()
321 if (pb->len - off < PPPOE_HEADERLEN) { in pppoe_dispatch_disc_pkt()
322 printf("pppoe: packet too short: %d\n", pb->len); in pppoe_dispatch_disc_pkt()
335 if (plen + off > pb->len) { in pppoe_dispatch_disc_pkt()
337 pb->len - off, plen); in pppoe_dispatch_disc_pkt()
340 if(pb->tot_len == pb->len) { in pppoe_dispatch_disc_pkt()
[all …]
Dlcp.c395 lcp_input(int unit, u_char *p, int len) in lcp_input() argument
399 fsm_input(f, p, len); in lcp_input()
407 lcp_extcode(fsm *f, int code, u_char id, u_char *inp, int len) in lcp_extcode() argument
413 lcp_rprotrej(f, inp, len); in lcp_extcode()
423 fsm_sdata(f, ECHOREP, id, inp, len); in lcp_extcode()
427 lcp_received_echo_reply(f, id, inp, len); in lcp_extcode()
446 lcp_rprotrej(fsm *f, u_char *inp, int len) in lcp_rprotrej() argument
452 if (len < (int)sizeof (u_short)) { in lcp_rprotrej()
503 lcp_sprotrej(int unit, u_char *p, int len) in lcp_sprotrej() argument
510 fsm_sdata(&lcp_fsm[unit], PROTREJ, ++lcp_fsm[unit].id, p, len); in lcp_sprotrej()
[all …]
Dpap.c339 int len; in upap_input() local
352 GETSHORT(len, inp); in upap_input()
353 if (len < (int)UPAP_HEADERLEN) { in upap_input()
357 if (len > l) { in upap_input()
361 len -= UPAP_HEADERLEN; in upap_input()
368 upap_rauthreq(u, inp, id, len); in upap_input()
372 upap_rauthack(u, inp, id, len); in upap_input()
376 upap_rauthnak(u, inp, id, len); in upap_input()
380 …UPAPDEBUG(LOG_INFO, ("pap_input: UNHANDLED default: code: %d, id: %d, len: %d.\n", code, id, len)); in upap_input()
390 upap_rauthreq(upap_state *u, u_char *inp, u_char id, int len) in upap_rauthreq() argument
[all …]
/lib/libc/posix/
Dmman.c35 mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) in mmap() argument
44 realAddr = OSMemMap(addr, len, prot | flags); in mmap()
55 munmap(void *addr, size_t len) in munmap() argument
59 return OSMemUnmap(addr, len); in munmap()
63 mprotect(void *addr, size_t len, int prot) in mprotect() argument
67 return OSMemProtect(addr, len, prot); in mprotect()
71 madvise(void *addr, size_t len, int behav) in madvise() argument
/lib/liblwip/src/core/ipv6/
Dinet6.c55 chksum(void *dataptr, u16_t len) in chksum() argument
61 for(acc = 0; len > 1; len -= 2) { in chksum()
66 if (len == 1) { in chksum()
91 acc += chksum(q->payload, q->len); in inet_chksum_pseudo()
95 if (q->len % 2 != 0) { in inet_chksum_pseudo()
129 inet_chksum(void *dataptr, u16_t len) in inet_chksum() argument
133 acc = chksum(dataptr, len); in inet_chksum()
149 acc += chksum(q->payload, q->len); in inet_chksum_pbuf()
153 if (q->len % 2 != 0) { in inet_chksum_pbuf()
/lib/liblwip/src/arch/
Detherif.c150 memcpy(bufptr, q->payload, q->len); in low_level_output()
151 bufptr += q->len; in low_level_output()
157 mbuf.len = p->tot_len; in low_level_output()
191 u16_t len; in low_level_input() local
198 mbuf.len = 1500; in low_level_input()
214 len = mbuf.len; in low_level_input()
217 len += ETH_PAD_SIZE; /* allow room for Ethernet padding */ in low_level_input()
221 p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); in low_level_input()
231 memcpy(q->payload, bufptr, q->len); in low_level_input()
232 bufptr += q->len; in low_level_input()
/include/
Dstring.h7 int memcmp(const void *b1, const void *b2, size_t len);
8 void *memcpy(void *dst, const void *src, size_t len);
9 void *memset(void *dst, int c, size_t len);
15 int strncmp(const char *s1, const char *s2, size_t len);
16 char *strncpy(char *to, const char *from, size_t len);
/sys/include/
Dmman.h18 void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
19 int munmap(void *addr, size_t len);
20 int mprotect(void *addr, size_t len, int prot);
21 int madvise(void *addr, size_t len, int behav);
Dvfs.h47 int (*read)(VNode *fn, void *buf, uint64_t off, uint64_t len);
48 int (*write)(VNode *fn, void *buf, uint64_t off, uint64_t len);
49 int (*readdir)(VNode *fn, void *buf, uint64_t len, uint64_t *off);
58 int VFS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len);
59 int VFS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len);
60 int VFS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off);
/sys/dev/x86/
Dide.c79 int IDE_ReadOne(IDEDrive *drive, void *buf, uint64_t off, uint64_t len);
80 int IDE_WriteOne(IDEDrive *drive, void *buf, uint64_t off, uint64_t len);
160 IDE_SwapAndTruncateString(char *str, int len) in IDE_SwapAndTruncateString() argument
164 ASSERT(len % 2 == 0); in IDE_SwapAndTruncateString()
166 for (i = 0; i < len/2; i++) in IDE_SwapAndTruncateString()
173 for (i = len - 1; i > 0; i--) { in IDE_SwapAndTruncateString()
279 for (i = 0; i < sga->len; i++) { in IDE_Read()
301 for (i = 0; i < sga->len; i++) { in IDE_Write()
340 IDE_ReadOne(IDEDrive *drive, void *buf, uint64_t off, uint64_t len) in IDE_ReadOne() argument
347 DLOG(ide, "read %llx %llx\n", off, len); in IDE_ReadOne()
[all …]
/sys/amd64/
Dmbentry.c26 extern void PAlloc_AddRegion(uintptr_t start, uintptr_t len);
175 mmap->len, in MachineBoot_Entry()
179 memRegionLen[memRegionIdx] = mmap->len; in MachineBoot_Entry()
200 uintptr_t len = memRegionLen[i]; in MachineBoot_AddMem() local
202 if (start + len < initRamEnd) in MachineBoot_AddMem()
206 len = initRamEnd - start; in MachineBoot_AddMem()
210 kprintf("AddRegion: %08llx %08llx\n", start, len); in MachineBoot_AddMem()
211 PAlloc_AddRegion(start + MEM_DIRECTMAP_BASE, len); in MachineBoot_AddMem()

12345