Home
last modified time | relevance | path

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

123

/scripts/dtc/
Ddata.c51 while ((d.len + xlen) > newsize) in data_grow_for()
59 struct data data_copy_mem(const char *mem, int len) in data_copy_mem() argument
63 d = data_grow_for(empty_data, len); in data_copy_mem()
65 d.len = len; in data_copy_mem()
66 memcpy(d.val, mem, len); in data_copy_mem()
71 struct data data_copy_escape_string(const char *s, int len) in data_copy_escape_string() argument
77 d = data_grow_for(empty_data, len + 1); in data_copy_escape_string()
80 while (i < len) { in data_copy_escape_string()
86 q[d.len++] = c; in data_copy_escape_string()
89 q[d.len++] = '\0'; in data_copy_escape_string()
[all …]
Dutil.c41 int len = strlen(s) + 1; in xstrdup() local
42 char *d = xmalloc(len); in xstrdup()
44 memcpy(d, s, len); in xstrdup()
53 int len; in join_path() local
57 len = lenp + lenn + 2; in join_path()
60 len--; in join_path()
63 str = xmalloc(len); in join_path()
73 bool util_is_printable_string(const void *data, int len) in util_is_printable_string() argument
79 if (len == 0) in util_is_printable_string()
83 if (s[len - 1] != '\0') in util_is_printable_string()
[all …]
Dutil.h41 static inline void *xmalloc(size_t len) in xmalloc() argument
43 void *new = malloc(len); in xmalloc()
51 static inline void *xrealloc(void *p, size_t len) in xrealloc() argument
53 void *new = realloc(p, len); in xrealloc()
56 die("realloc() failed (len=%d)\n", len); in xrealloc()
73 bool util_is_printable_string(const void *data, int len);
97 char *utilfdt_read_len(const char *filename, off_t *len);
115 int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len);
185 void utilfdt_print_data(const char *data, int len);
Dfdtput.c76 int len; /* length of this cell/string/byte */ in encode_value() local
89 for (; arg_count > 0; arg++, arg_count--, upto += len) { in encode_value()
92 len = strlen(*arg) + 1; in encode_value()
94 len = disp->size == -1 ? 4 : disp->size; in encode_value()
97 if (upto + len > value_size) { in encode_value()
98 value_size = (upto + len) + 500; in encode_value()
109 memcpy(ptr, *arg, len); in encode_value()
115 if (len == 4) in encode_value()
135 const char *property, const char *buf, int len) in store_key_value() argument
146 err = fdt_setprop(blob, node, property, buf, len); in store_key_value()
[all …]
Dfdtget.c67 static int show_data(struct display_info *disp, const char *data, int len) in show_data() argument
77 if (len == 0) in show_data()
81 (!disp->type && util_is_printable_string(data, len)); in show_data()
83 if (data[len - 1] != '\0') { in show_data()
87 for (s = data; s - data < len; s += strlen(s) + 1) { in show_data()
96 size = (len % 4) == 0 ? 4 : 1; in show_data()
97 } else if (len % size) { in show_data()
105 for (i = 0; i < len; i += size, p += size) { in show_data()
210 int len, err = 0; in show_data_for_item() local
223 value = fdt_getprop(blob, node, property, &len); in show_data_for_item()
[all …]
Dtreesource.c70 assert(str[val.len-1] == '\0'); in write_propval_string()
79 for (i = 0; i < (val.len-1); i++) { in write_propval_string()
132 assert (m->offset == val.len); in write_propval_string()
139 void *propend = val.val + val.len; in write_propval_cells()
161 assert (m->offset == val.len); in write_propval_cells()
169 void *propend = val.val + val.len; in write_propval_bytes()
189 assert (m->offset == val.len); in write_propval_bytes()
197 int len = prop->val.len; in write_propval() local
204 if (len == 0) { in write_propval()
209 for (i = 0; i < len; i++) { in write_propval()
[all …]
Dflattree.c67 static void bin_emit_string(void *e, char *str, int len) in bin_emit_string() argument
71 if (len == 0) in bin_emit_string()
72 len = strlen(str); in bin_emit_string()
74 *dtbuf = data_append_data(*dtbuf, str, len); in bin_emit_string()
89 *dtbuf = data_append_data(*dtbuf, d.val, d.len); in bin_emit_data()
147 static void asm_emit_string(void *e, char *str, int len) in asm_emit_string() argument
152 if (len != 0) { in asm_emit_string()
154 c = str[len]; in asm_emit_string()
155 str[len] = '\0'; in asm_emit_string()
160 if (len != 0) { in asm_emit_string()
[all …]
Dfdtdump.c20 static void print_data(const char *data, int len) in print_data() argument
26 if (len == 0) in print_data()
29 if (util_is_printable_string(data, len)) { in print_data()
31 } else if ((len % 4) == 0) { in print_data()
33 for (i = 0; i < len; i += 4) in print_data()
35 i < (len - 4) ? " " : ""); in print_data()
39 for (i = 0; i < len; i++) in print_data()
40 printf("%02x%s", *p++, i < len - 1 ? " " : ""); in print_data()
Ddtc.h85 int len; member
103 struct data data_copy_mem(const char *mem, int len);
104 struct data data_copy_escape_string(const char *s, int len);
105 struct data data_copy_file(FILE *f, size_t len);
107 struct data data_append_data(struct data d, const void *p, int len);
109 const void *p, int len);
116 struct data data_append_zeroes(struct data d, int len);
231 struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len);
Dsrcpos.c42 int len = slash - path; in get_dirname() local
43 char *dir = xmalloc(len + 1); in get_dirname()
45 memcpy(dir, path, len); in get_dirname()
46 dir[len] = '\0'; in get_dirname()
214 void srcpos_update(struct srcpos *pos, const char *text, int len) in srcpos_update() argument
223 for (i = 0; i < len; i++) in srcpos_update()
/scripts/mod/
Dsumversion.c170 const unsigned char *data, unsigned int len) in md4_update() argument
174 mctx->byte_count += len; in md4_update()
176 if (avail > len) { in md4_update()
178 data, len); in md4_update()
187 len -= avail; in md4_update()
189 while (len >= sizeof(mctx->block)) { in md4_update()
193 len -= sizeof(mctx->block); in md4_update()
196 memcpy(mctx->block, data, len); in md4_update()
199 static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len) in md4_final_ascii() argument
221 snprintf(out, len, "%08X%08X%08X%08X", in md4_final_ascii()
[all …]
/scripts/dtc/libfdt/
Dfdt_ro.c59 const char *s, int len) in _fdt_nodename_eq() argument
61 const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); in _fdt_nodename_eq()
67 if (memcmp(p, s, len) != 0) in _fdt_nodename_eq()
70 if (p[len] == '\0') in _fdt_nodename_eq()
72 else if (!memchr(s, '@', len) && (p[len] == '@')) in _fdt_nodename_eq()
84 const char *s, int len) in _fdt_string_eq() argument
88 return (strlen(p) == len) && (memcmp(p, s, len) == 0); in _fdt_string_eq()
207 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len) in fdt_get_name() argument
216 if (len) in fdt_get_name()
217 *len = strlen(nh->name); in fdt_get_name()
[all …]
Dfdt_wip.c59 const void *val, int len) in fdt_setprop_inplace() argument
68 if (proplen != len) in fdt_setprop_inplace()
71 memcpy(propval, val, len); in fdt_setprop_inplace()
75 static void _fdt_nop_region(void *start, int len) in _fdt_nop_region() argument
79 for (p = start; (char *)p < ((char *)start + len); p++) in _fdt_nop_region()
86 int len; in fdt_nop_property() local
88 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property()
90 return len; in fdt_nop_property()
92 _fdt_nop_region(prop, len + sizeof(*prop)); in fdt_nop_property()
Dfdt_rw.c157 int len = strlen(s) + 1; in _fdt_find_add_string() local
166 err = _fdt_splice_string(fdt, len); in _fdt_find_add_string()
170 memcpy(new, s, len); in _fdt_find_add_string()
208 int len, struct fdt_property **prop) in _fdt_resize_property() argument
218 FDT_TAGALIGN(len)))) in _fdt_resize_property()
221 (*prop)->len = cpu_to_fdt32(len); in _fdt_resize_property()
226 int len, struct fdt_property **prop) in _fdt_add_property() argument
241 proplen = sizeof(**prop) + FDT_TAGALIGN(len); in _fdt_add_property()
249 (*prop)->len = cpu_to_fdt32(len); in _fdt_add_property()
277 const void *val, int len) in fdt_setprop() argument
[all …]
Dfdt_sw.c73 static void *_fdt_grab_space(void *fdt, size_t len) in _fdt_grab_space() argument
81 if ((offset + len < offset) || (offset + len > spaceleft)) in _fdt_grab_space()
84 fdt_set_size_dt_struct(fdt, offset + len); in _fdt_grab_space()
205 int len = strlen(s) + 1; in _fdt_find_add_string() local
213 offset = -strtabsize - len; in _fdt_find_add_string()
218 memcpy(strtab + offset, s, len); in _fdt_find_add_string()
219 fdt_set_size_dt_strings(fdt, strtabsize + len); in _fdt_find_add_string()
223 int fdt_property(void *fdt, const char *name, const void *val, int len) in fdt_property() argument
234 prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len)); in fdt_property()
240 prop->len = cpu_to_fdt32(len); in fdt_property()
[all …]
Dfdt.c77 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
82 || ((absoffset + len) < absoffset) in fdt_offset_ptr()
83 || (absoffset + len) > fdt_totalsize(fdt)) in fdt_offset_ptr()
87 if (((offset + len) < offset) in fdt_offset_ptr()
88 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
232 int len = strlen(s) + 1; in _fdt_find_string() local
233 const char *last = strtab + tabsize - len; in _fdt_find_string()
237 if (memcmp(p, s, len) == 0) in _fdt_find_string()
/scripts/
Dkallsyms.c35 unsigned int len; member
167 s->len = strlen(str) + 1; in read_symbol()
168 s->sym = malloc(s->len + 1); in read_symbol()
306 static int expand_symbol(unsigned char *data, int len, char *result) in expand_symbol() argument
310 while (len) { in expand_symbol()
324 len--; in expand_symbol()
433 printf("\t.byte 0x%02x", table[i].len); in write_src()
434 for (k = 0; k < table[i].len; k++) in write_src()
438 off += table[i].len + 1; in write_src()
469 static void learn_symbol(unsigned char *symbol, int len) in learn_symbol() argument
[all …]
Dextract-sys-certs.pl36 my $len = Math::BigInt->new("0x" . $3);
44 len => $len,
108 my $s_len = $sec->{len};
147 my $len = sysread(FD, $buf, $size);
148 die "$vmlinux" if (!defined($len));
149 die "Short read on $vmlinux\n" if ($len != $size);
154 $len = syswrite(FD, $buf, $size);
155 die "$keyring" if (!defined($len));
156 die "Short write on $keyring\n" if ($len != $size);
Dextract-module-sig.pl33 my $len = sysread(FD, $buf, $st[7]);
34 die "$modfile" unless (defined($len));
35 die "Short read on $modfile\n" unless ($len == $st[7]);
38 print STDERR "Read ", $len, " bytes from module file\n";
41 if ($len < 12 + length($magic_number));
46 my $p = $len - length($magic_number);
49 die "Magic number not found at $len\n"
51 print STDERR "Found magic number at $len\n";
/scripts/basic/
Dfixdep.c161 int len = strlen(buf); in do_extra_deps() local
162 if (len < 2 || buf[len-1] != '\n') { in do_extra_deps()
166 print_config(buf, len-1); in do_extra_deps()
173 unsigned int len; member
194 static int is_defined_config(const char *name, int len, unsigned int hash) in is_defined_config() argument
199 if (aux->hash == hash && aux->len == len && in is_defined_config()
200 memcmp(aux->name, name, len) == 0) in is_defined_config()
209 static void define_config(const char *name, int len, unsigned int hash) in define_config() argument
211 struct item *aux = malloc(sizeof(*aux) + len); in define_config()
217 memcpy(aux->name, name, len); in define_config()
[all …]
/scripts/kconfig/lxdialog/
Dinputbox.c49 int show_x, len, pos; in dialog_inputbox() local
101 len = strlen(instr); in dialog_inputbox()
102 pos = len; in dialog_inputbox()
104 if (len >= box_width) { in dialog_inputbox()
105 show_x = len - box_width + 1; in dialog_inputbox()
111 input_x = len; in dialog_inputbox()
137 if (pos < len) { in dialog_inputbox()
138 for (i = pos - 1; i < len; i++) { in dialog_inputbox()
144 len--; in dialog_inputbox()
145 instr[len] = '\0'; in dialog_inputbox()
[all …]
/scripts/kconfig/
Dnconf.gui.c226 int len = get_line_length(line); in fill_window() local
227 strncpy(tmp, line, min(len, x)); in fill_window()
228 tmp[len] = '\0'; in fill_window()
272 int len = get_line_length(line); in btn_dialog() local
273 if (msg_width < len) in btn_dialog()
274 msg_width = len; in btn_dialog()
384 int len = get_line_length(line); in dialog_inputbox() local
385 prompt_width = max(prompt_width, len); in dialog_inputbox()
434 int len = strlen(result); in dialog_inputbox() local
447 len-cursor_position+1); in dialog_inputbox()
[all …]
Dkxgettext.c12 static char *escape(const char* text, char *bf, int len) in escape() argument
23 --len; in escape()
29 len -= 3; in escape()
32 while (*text != '\0' && len > 1) { in escape()
41 len -= 5; in escape()
47 len--; in escape()
51 --len; in escape()
Dutil.c85 gs.len = 64; in str_new()
97 gs->len = 0; in str_free()
106 if (l > gs->len) { in str_append()
108 gs->len = l; in str_append()
/scripts/genksyms/
Dkeywords.hash.c_shipped34 static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
47 is_reserved_hash (register const char *str, register unsigned int len)
78 …return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values…
88 is_reserved_word (register const char *str, register unsigned int len)
216 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
218 register int key = is_reserved_hash (str, len);

123