/scripts/dtc/ |
D | data.c | 36 while ((d.len + xlen) > newsize) in data_grow_for() 44 struct data data_copy_mem(const char *mem, int len) in data_copy_mem() argument 48 d = data_grow_for(empty_data, len); in data_copy_mem() 50 d.len = len; in data_copy_mem() 51 memcpy(d.val, mem, len); in data_copy_mem() 56 struct data data_copy_escape_string(const char *s, int len) in data_copy_escape_string() argument 63 d = data_grow_for(d, len + 1); in data_copy_escape_string() 66 while (i < len) { in data_copy_escape_string() 72 q[d.len++] = c; in data_copy_escape_string() 75 q[d.len++] = '\0'; in data_copy_escape_string() [all …]
|
D | util.c | 27 int len = strlen(s) + 1; in xstrdup() local 28 char *d = xmalloc(len); in xstrdup() 30 memcpy(d, s, len); in xstrdup() 87 int len; in join_path() local 91 len = lenp + lenn + 2; in join_path() 94 len--; in join_path() 97 str = xmalloc(len); in join_path() 107 bool util_is_printable_string(const void *data, int len) in util_is_printable_string() argument 113 if (len == 0) in util_is_printable_string() 117 if (s[len - 1] != '\0') in util_is_printable_string() [all …]
|
D | util.h | 38 static inline void *xmalloc(size_t len) in xmalloc() argument 40 void *new = malloc(len); in xmalloc() 48 static inline void *xrealloc(void *p, size_t len) in xrealloc() argument 50 void *new = realloc(p, len); in xrealloc() 53 die("realloc() failed (len=%zd)\n", len); in xrealloc() 74 bool util_is_printable_string(const void *data, int len); 92 char *utilfdt_read(const char *filename, size_t *len); 104 int utilfdt_read_err(const char *filename, char **buffp, size_t *len); 174 void utilfdt_print_data(const char *data, int len);
|
D | fdtput.c | 62 int len; /* length of this cell/string/byte */ in encode_value() local 75 for (; arg_count > 0; arg++, arg_count--, upto += len) { in encode_value() 78 len = strlen(*arg) + 1; in encode_value() 80 len = disp->size == -1 ? 4 : disp->size; in encode_value() 83 if (upto + len > value_size) { in encode_value() 84 value_size = (upto + len) + 500; in encode_value() 95 memcpy(ptr, *arg, len); in encode_value() 101 if (len == 4) in encode_value() 121 const char *property, const char *buf, int len) in store_key_value() argument 132 err = fdt_setprop(blob, node, property, buf, len); in store_key_value() [all …]
|
D | treesource.c | 49 static void write_propval_string(FILE *f, const char *s, size_t len) in write_propval_string() argument 51 const char *end = s + len - 1; in write_propval_string() 53 if (!len) in write_propval_string() 102 static void write_propval_int(FILE *f, const char *p, size_t len, size_t width) in write_propval_int() argument 104 const char *end = p + len; in write_propval_int() 105 assert(len % width == 0); in write_propval_int() 165 int len = prop->val.len; in guess_value_type() local 172 for (i = 0; i < len; i++) { in guess_value_type() 186 if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul)) in guess_value_type() 189 } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) { in guess_value_type() [all …]
|
D | fdtget.c | 53 static int show_data(struct display_info *disp, const char *data, int len) in show_data() argument 63 if (len == 0) in show_data() 67 (!disp->type && util_is_printable_string(data, len)); in show_data() 69 if (data[len - 1] != '\0') { in show_data() 73 for (s = data; s - data < len; s += strlen(s) + 1) { in show_data() 82 size = (len % 4) == 0 ? 4 : 1; in show_data() 83 } else if (len % size) { in show_data() 91 for (i = 0; i < len; i += size, p += size) { in show_data() 196 int len, err = 0; in show_data_for_item() local 209 value = fdt_getprop(blob, node, property, &len); in show_data_for_item() [all …]
|
D | yamltree.c | 32 static void yaml_propval_int(yaml_emitter_t *emitter, struct marker *markers, char *data, int len, … in yaml_propval_int() argument 46 assert(len % width == 0); in yaml_propval_int() 52 for (off = 0; off < len; off += width) { in yaml_propval_int() 95 static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len) in yaml_propval_string() argument 100 assert(str[len-1] == '\0'); in yaml_propval_string() 103 for (i = 0; i < len; i++) in yaml_propval_string() 108 len-1, 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE); in yaml_propval_string() 115 int len = prop->val.len; in yaml_propval() local 125 if (len == 0) { in yaml_propval() 148 chunk_len = type_marker_length(m) ? : len; in yaml_propval() [all …]
|
D | fdtdump.c | 21 static void print_data(const char *data, int len) in print_data() argument 27 if (len == 0) in print_data() 30 if (util_is_printable_string(data, len)) { in print_data() 32 } else if ((len % 4) == 0) { in print_data() 34 for (i = 0; i < len; i += 4) in print_data() 36 i < (len - 4) ? " " : ""); in print_data() 40 for (i = 0; i < len; i++) in print_data() 41 printf("%02x%s", *p++, i < len - 1 ? " " : ""); in print_data()
|
D | flattree.c | 52 static void bin_emit_string(void *e, const char *str, int len) in bin_emit_string() argument 56 if (len == 0) in bin_emit_string() 57 len = strlen(str); in bin_emit_string() 59 *dtbuf = data_append_data(*dtbuf, str, len); in bin_emit_string() 74 *dtbuf = data_append_data(*dtbuf, d.val, d.len); in bin_emit_data() 132 static void asm_emit_string(void *e, const char *str, int len) in asm_emit_string() argument 136 if (len != 0) in asm_emit_string() 137 fprintf(f, "\t.string\t\"%.*s\"\n", len, str); in asm_emit_string() 158 while ((d.len - off) >= sizeof(uint32_t)) { in asm_emit_data() 163 while ((d.len - off) >= 1) { in asm_emit_data() [all …]
|
/scripts/dtc/libfdt/ |
D | fdt_wip.c | 16 int len) in fdt_setprop_inplace_namelen_partial() argument 26 if (proplen < (len + idx)) in fdt_setprop_inplace_namelen_partial() 29 memcpy((char *)propval + idx, val, len); in fdt_setprop_inplace_namelen_partial() 34 const void *val, int len) in fdt_setprop_inplace() argument 43 if (proplen != len) in fdt_setprop_inplace() 48 val, len); in fdt_setprop_inplace() 51 static void fdt_nop_region_(void *start, int len) in fdt_nop_region_() argument 55 for (p = start; (char *)p < ((char *)start + len); p++) in fdt_nop_region_() 62 int len; in fdt_nop_property() local 64 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property() [all …]
|
D | fdt_overlay.c | 31 int len; in overlay_get_target_phandle() local 33 val = fdt_getprop(fdto, fragment, "target", &len); in overlay_get_target_phandle() 37 if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) in overlay_get_target_phandle() 121 int len; in overlay_phandle_add_offset() local 123 val = fdt_getprop(fdt, node, name, &len); in overlay_phandle_add_offset() 125 return len; in overlay_phandle_add_offset() 127 if (len != sizeof(*val)) in overlay_phandle_add_offset() 432 int len; in overlay_fixup_phandle() local 435 &label, &len); in overlay_fixup_phandle() 437 if (len == -FDT_ERR_NOTFOUND) in overlay_fixup_phandle() [all …]
|
D | fdt_ro.c | 14 const char *s, int len) in fdt_nodename_eq_() argument 19 if (!p || olen < len) in fdt_nodename_eq_() 23 if (memcmp(p, s, len) != 0) in fdt_nodename_eq_() 26 if (p[len] == '\0') in fdt_nodename_eq_() 28 else if (!memchr(s, '@', len) && (p[len] == '@')) in fdt_nodename_eq_() 37 size_t len; in fdt_get_string() local 48 len = fdt_totalsize(fdt) - absoffset; in fdt_get_string() 56 if ((fdt_size_dt_strings(fdt) - stroffset) < len) in fdt_get_string() 57 len = fdt_size_dt_strings(fdt) - stroffset; in fdt_get_string() 63 if ((-stroffset) < len) in fdt_get_string() [all …]
|
D | fdt_rw.c | 120 int len = strlen(s) + 1; in fdt_find_add_string_() local 131 err = fdt_splice_string_(fdt, len); in fdt_find_add_string_() 137 memcpy(new, s, len); in fdt_find_add_string_() 171 int len, struct fdt_property **prop) in fdt_resize_property_() argument 181 FDT_TAGALIGN(len)))) in fdt_resize_property_() 184 (*prop)->len = cpu_to_fdt32(len); in fdt_resize_property_() 189 int len, struct fdt_property **prop) in fdt_add_property_() argument 205 proplen = sizeof(**prop) + FDT_TAGALIGN(len); in fdt_add_property_() 216 (*prop)->len = cpu_to_fdt32(len); in fdt_add_property_() 244 int len, void **prop_data) in fdt_setprop_placeholder() argument [all …]
|
D | fdt_sw.c | 90 static void *fdt_grab_space_(void *fdt, size_t len) in fdt_grab_space_() argument 98 if ((offset + len < offset) || (offset + len > spaceleft)) in fdt_grab_space_() 101 fdt_set_size_dt_struct(fdt, offset + len); in fdt_grab_space_() 246 int len = strlen(s) + 1; in fdt_add_string_() local 249 offset = -strtabsize - len; in fdt_add_string_() 254 memcpy(strtab + offset, s, len); in fdt_add_string_() 255 fdt_set_size_dt_strings(fdt, strtabsize + len); in fdt_add_string_() 263 int len = strlen(s) + 1; in fdt_del_last_string_() local 265 fdt_set_size_dt_strings(fdt, strtabsize - len); in fdt_del_last_string_() 285 int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp) in fdt_property_placeholder() argument [all …]
|
D | fdt.c | 109 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument 114 || ((absoffset + len) < absoffset) in fdt_offset_ptr() 115 || (absoffset + len) > fdt_totalsize(fdt)) in fdt_offset_ptr() 119 if (((offset + len) < offset) in fdt_offset_ptr() 120 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr() 267 int len = strlen(s) + 1; in fdt_find_string_() local 268 const char *last = strtab + tabsize - len; in fdt_find_string_() 272 if (memcmp(p, s, len) == 0) in fdt_find_string_()
|
D | fdt_addresses.c | 18 int len; in fdt_cells() local 20 c = fdt_getprop(fdt, nodeoffset, name, &len); in fdt_cells() 22 return len; in fdt_cells() 24 if (len != sizeof(*c)) in fdt_cells()
|
/scripts/mod/ |
D | sumversion.c | 170 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/ |
D | kallsyms.c | 35 unsigned int len; member 159 s->len = strlen(sym) + 1; in read_symbol() 160 s->sym = malloc(s->len + 1); in read_symbol() 300 static int expand_symbol(unsigned char *data, int len, char *result) in expand_symbol() argument 304 while (len) { in expand_symbol() 318 len--; in expand_symbol() 427 printf("\t.byte 0x%02x", table[i].len); in write_src() 428 for (k = 0; k < table[i].len; k++) in write_src() 432 off += table[i].len + 1; in write_src() 463 static void learn_symbol(unsigned char *symbol, int len) in learn_symbol() argument [all …]
|
D | extract-module-sig.pl | 35 my $len = sysread(FD, $buf, $st[7]); 36 die "$modfile" unless (defined($len)); 37 die "Short read on $modfile\n" unless ($len == $st[7]); 40 print STDERR "Read ", $len, " bytes from module file\n"; 43 if ($len < 12 + length($magic_number)); 48 my $p = $len - length($magic_number); 51 die "Magic number not found at $len\n" 53 print STDERR "Found magic number at $len\n";
|
D | extract-sys-certs.pl | 38 my $len = Math::BigInt->new("0x" . $3); 46 len => $len, 110 my $s_len = $sec->{len}; 149 my $len = sysread(FD, $buf, $size); 150 die "$vmlinux" if (!defined($len)); 151 die "Short read on $vmlinux\n" if ($len != $size); 156 $len = syswrite(FD, $buf, $size); 157 die "$keyring" if (!defined($len)); 158 die "Short write on $keyring\n" if ($len != $size);
|
/scripts/kconfig/lxdialog/ |
D | inputbox.c | 36 int show_x, len, pos; in dialog_inputbox() local 88 len = strlen(instr); in dialog_inputbox() 89 pos = len; in dialog_inputbox() 91 if (len >= box_width) { in dialog_inputbox() 92 show_x = len - box_width + 1; in dialog_inputbox() 98 input_x = len; in dialog_inputbox() 125 if (pos < len) { in dialog_inputbox() 126 for (i = pos - 1; i < len; i++) { in dialog_inputbox() 132 len--; in dialog_inputbox() 133 instr[len] = '\0'; in dialog_inputbox() [all …]
|
/scripts/basic/ |
D | fixdep.c | 166 unsigned int len; member 187 static int is_defined_config(const char *name, int len, unsigned int hash) in is_defined_config() argument 192 if (aux->hash == hash && aux->len == len && in is_defined_config() 193 memcmp(aux->name, name, len) == 0) in is_defined_config() 202 static void define_config(const char *name, int len, unsigned int hash) in define_config() argument 204 struct item *aux = malloc(sizeof(*aux) + len); in define_config() 210 memcpy(aux->name, name, len); in define_config() 211 aux->len = len; in define_config() 299 static int is_ignored_file(const char *s, int len) in is_ignored_file() argument 301 return str_ends_with(s, len, "include/generated/autoconf.h") || in is_ignored_file() [all …]
|
/scripts/kconfig/ |
D | nconf.gui.c | 226 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 448 len-cursor_position+1); in dialog_inputbox() [all …]
|
/scripts/genksyms/ |
D | keywords.c | 65 static int is_reserved_word(register const char *str, register unsigned int len) in is_reserved_word() argument 71 if (len == l && !memcmp(str, r->name, len)) in is_reserved_word()
|
/scripts/selinux/genheaders/ |
D | genheaders.c | 95 int len = strlen(map->name), l = sizeof(s) - 1; in main() local 96 if (len >= l && memcmp(map->name + len - l, s, l) == 0) in main() 122 int len = strlen(map->name); in main() local 130 39-len, map->perms[j], 1U<<j); in main()
|