Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | scripts/dtc/fdtput.c | static int create_paths(void *blob, const char *in_path) {
const char *path = in_path;
const char *sep;
int node, offset = 0;
while (*path == '/')
path++;
for (sep = path; *sep; path = sep + 1, offset = node) {
/* equivalent to strchrnul(), but it requires _GNU_SOURCE */
sep = strchr(path, '/');... | [
0,
0
] |
Linux Kernel | scripts/dtc/fdtput.c |
static void usage(const char *msg) {
if (msg)
fprintf(stderr, "Error: %s\n\n", msg);
fprintf(stderr, "%s", usage_msg);
exit(2);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/flattree.c |
static void bin_emit_string(void *e, const char *str, int len) {
struct data *dtbuf = e;
if (len == 0)
len = strlen(str);
*dtbuf = data_append_data(*dtbuf, str, len);
*dtbuf = data_append_byte(*dtbuf, '\0');
} | [
0,
0
] |
Linux Kernel | scripts/dtc/flattree.c |
static void bin_emit_property(void *e, struct label *labels) {
bin_emit_cell(e, FDT_PROP);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/flattree.c | static void asm_emit_beginnode(void *e, struct label *labels) {
FILE *f = e;
struct label *l;
for_each_label(labels, l) {
fprintf(f, "\t.globl\t%s\n", l->label);
fprintf(f, "%s:\n", l->label);
}
fprintf(f, "\t\n");
asm_emit_cell(e, FDT_BEGIN_NODE);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/flattree.c |
static struct data flat_read_data(struct inbuf *inb, int len) {
struct data d = empty_data;
if (len == 0)
return empty_data;
d = data_grow_for(d, len);
d.len = len;
flat_read_chunk(inb, d.val, len);
flat_realign(inb, sizeof(uint32_t));
return d;
} | [
1,
0
] |
Linux Kernel | scripts/dtc/fstree.c |
static struct node *read_fstree(const char *dirname) {
DIR *d;
struct dirent *de;
struct stat st;
struct node *tree;
d = opendir(dirname);
if (!d)
die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno));
tree = build_node(NULL, NULL, NULL);
while ((de = readdir(d)) != NULL) {
char *... | [
1,
0
] |
Linux Kernel | scripts/dtc/fstree.c |
struct dt_info *dt_from_fs(const char *dirname) {
struct node *tree;
tree = read_fstree(dirname);
tree = name_node(tree, "");
return build_dt_info(DTSF_V1, NULL, tree, guess_boot_cpuid(tree));
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt.c |
size_t fdt_header_size(const void *fdt) {
return can_assume(LATEST) ? FDT_V17_SIZE : fdt_header_size_(fdt_version(fdt));
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt.c |
int fdt_check_prop_offset_(const void *fdt, int offset) {
if (!can_assume(VALID_INPUT) && ((offset < 0) || (offset % FDT_TAGSIZE)))
return -FDT_ERR_BADOFFSET;
if (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)
return -FDT_ERR_BADOFFSET;
return offset;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_overlay.c | static int overlay_phandle_add_offset(void *fdt, int node, const char *name,
uint32_t delta) {
const fdt32_t *val;
uint32_t adj_val;
int len;
val = fdt_getprop(fdt, node, name, &len);
if (!val)
return len;
if (len != sizeof(*val))
return -FDT_ERR_BADPHANDLE;
... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_overlay.c | static int overlay_adjust_local_phandles(void *fdto, uint32_t delta) {
return overlay_adjust_node_phandles(fdto, 0, delta);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_overlay.c | static int overlay_fixup_one_phandle(void *fdt, void *fdto, int symbols_off,
const char *path, uint32_t path_len,
const char *name, uint32_t name_len,
int poffset, const char *label) {
const char *symbol_pat... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_overlay.c | static int overlay_merge(void *fdt, void *fdto) {
int fragment;
fdt_for_each_subnode(fragment, fdto, 0) {
int overlay;
int target;
int ret;
overlay = fdt_subnode_offset(fdto, fragment, "__overlay__");
if (overlay == -FDT_ERR_NOTFOUND)
continue;
if (overlay < 0)
return overlay;... | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c | const char *fdt_get_string(const void *fdt, int stroffset, int *lenp) {
int32_t totalsize;
uint32_t absoffset;
size_t len;
int err;
const char *s, *n;
if (can_assume(VALID_INPUT)) {
s = (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
if (lenp)
*lenp = strlen(s);
return s;
}
... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c |
const char *fdt_string(const void *fdt, int stroffset) {
return fdt_get_string(fdt, stroffset, NULL);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c |
static int fdt_string_eq_(const void *fdt, int stroffset, const char *s,
int len) {
int slen;
const char *p = fdt_get_string(fdt, stroffset, &slen);
return p && (slen == len) && (memcmp(p, s, len) == 0);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c |
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name) {
return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c |
int fdt_path_offset(const void *fdt, const char *path) {
return fdt_path_offset_namelen(fdt, path, strlen(path));
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c | int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle) {
int offset;
if ((phandle == 0) || (phandle == ~0U))
return -FDT_ERR_BADPHANDLE;
FDT_RO_PROBE(fdt);
/* FIXME: The algorithm here is pretty horrible: we
* potentially scan each property of a node in
* fdt_get_phandle(), then if that ... | [
0,
1
] |
Linux Kernel | scripts/dtc/libfdt/fdt_ro.c | const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
const char *property, int idx, int *lenp) {
const char *list, *end;
int length;
list = fdt_getprop(fdt, nodeoffset, property, &length);
if (!list) {
if (lenp)
*lenp = length;
return NULL;
}
end = ... | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_rw.c |
static int fdt_splice_mem_rsv_(void *fdt, struct fdt_reserve_entry *p, int oldn,
int newn) {
int delta = (newn - oldn) * sizeof(*p);
int err;
err = fdt_splice_(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
if (err)
return err;
fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(f... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_rw.c |
int fdt_appendprop(void *fdt, int nodeoffset, const char *name, const void *val,
int len) {
struct fdt_property *prop;
int err, oldlen, newlen;
FDT_RW_PROBE(fdt);
prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
if (prop) {
newlen = len + oldlen;
err = fdt_splice_struct... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_rw.c |
int fdt_del_node(void *fdt, int nodeoffset) {
int endoffset;
FDT_RW_PROBE(fdt);
endoffset = fdt_node_end_offset_(fdt, nodeoffset);
if (endoffset < 0)
return endoffset;
return fdt_splice_struct_(fdt, fdt_offset_ptr_w_(fdt, nodeoffset),
endoffset - nodeoffset, 0);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c | static int fdt_sw_probe_struct_(void *fdt) {
int err = fdt_sw_probe_(fdt);
if (err)
return err;
if (!can_assume(VALID_INPUT) && fdt_off_dt_strings(fdt) != fdt_totalsize(fdt))
return -FDT_ERR_BADSTATE;
return 0;
}
#define FDT_SW_PROBE_STRUCT(fdt) \
{ ... | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c | int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags) {
const int hdrsize =
FDT_ALIGN(sizeof(struct fdt_header), sizeof(struct fdt_reserve_entry));
void *fdt = buf;
if (bufsize < hdrsize)
return -FDT_ERR_NOSPACE;
if (flags & ~FDT_CREATE_FLAGS_ALL)
return -FDT_ERR_BADFLAGS;
memset(... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c |
int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size) {
struct fdt_reserve_entry *re;
int offset;
FDT_SW_PROBE_MEMRSV(fdt);
offset = fdt_off_dt_struct(fdt);
if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
return -FDT_ERR_NOSPACE;
re = (struct fdt_reserve_entry *)((char *)fdt + offse... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c |
int fdt_end_node(void *fdt) {
fdt32_t *en;
FDT_SW_PROBE_STRUCT(fdt);
en = fdt_grab_space_(fdt, FDT_TAGSIZE);
if (!en)
return -FDT_ERR_NOSPACE;
*en = cpu_to_fdt32(FDT_END_NODE);
return 0;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c |
static int fdt_find_add_string_(void *fdt, const char *s, int *allocated) {
char *strtab = (char *)fdt + fdt_totalsize(fdt);
int strtabsize = fdt_size_dt_strings(fdt);
const char *p;
*allocated = 0;
p = fdt_find_string_(strtab - strtabsize, strtabsize, s);
if (p)
return p - strtab;
*allocated = 1;... | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_sw.c | int fdt_finish(void *fdt) {
char *p = (char *)fdt;
fdt32_t *end;
int oldstroffset, newstroffset;
uint32_t tag;
int offset, nextoffset;
FDT_SW_PROBE_STRUCT(fdt);
end = fdt_grab_space_(fdt, sizeof(*end));
if (!end)
return -FDT_ERR_NOSPACE;
*end = cpu_to_fdt32(FDT_END);
/* Relocate the string ta... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_wip.c |
int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
const char *name, int namelen,
uint32_t idx, const void *val,
int len) {
void *propval;
int proplen;
propval = fdt_getprop_na... | [
1,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_wip.c |
int fdt_node_end_offset_(void *fdt, int offset) {
int depth = 0;
while ((offset >= 0) && (depth >= 0))
offset = fdt_next_node(fdt, offset, &depth);
return offset;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/fdt_wip.c |
int fdt_nop_node(void *fdt, int nodeoffset) {
int endoffset;
endoffset = fdt_node_end_offset_(fdt, nodeoffset);
if (endoffset < 0)
return endoffset;
fdt_nop_region_(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset);
return 0;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/libfdt_env.h |
static inline uint16_t fdt16_to_cpu(fdt16_t x) {
return (FDT_FORCE uint16_t)CPU_TO_FDT16(x);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/libfdt/libfdt_env.h | static inline size_t fdt_strnlen(const char *string, size_t max_count) {
const char *p = memchr(string, 0, max_count);
return p ? p - string : max_count;
}
#endif | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
void delete_labels(struct label **labels) {
struct label *label;
for_each_label(*labels, label) label->deleted = 1;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct property *reverse_properties(struct property *first) {
struct property *p = first;
struct property *head = NULL;
struct property *next;
while (p) {
next = p->next;
p->next = head;
head = p;
p = next;
}
return head;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct node *build_node_delete(struct srcpos *srcpos) {
struct node *new = xmalloc(sizeof(*new));
memset(new, 0, sizeof(*new));
new->deleted = 1;
new->srcpos = srcpos_copy(srcpos);
return new;
} | [
1,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct node *name_node(struct node *node, char *name) {
assert(node->name == NULL);
node->name = name;
return node;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct node *chain_node(struct node *first, struct node *list) {
assert(first->next_sibling == NULL);
first->next_sibling = list;
return first;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
void add_property(struct node *node, struct property *prop) {
struct property **p;
prop->next = NULL;
p = &node->proplist;
while (*p)
p = &((*p)->next);
*p = prop;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
void delete_property_by_name(struct node *node, char *name) {
struct property *prop = node->proplist;
while (prop) {
if (streq(prop->name, name)) {
delete_property(prop);
return;
}
prop = prop->next;
}
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct reserve_info *chain_reserve_entry(struct reserve_info *first,
struct reserve_info *list) {
assert(first->next == NULL);
first->next = list;
return first;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
cell_t propval_cell(struct property *prop) {
assert(prop->val.len == sizeof(cell_t));
return fdt32_to_cpu(*((fdt32_t *)prop->val.val));
} | [
1,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
struct node *get_node_by_ref(struct node *tree, const char *ref) {
struct node *target = tree;
const char *label = NULL, *path = NULL;
if (streq(ref, "/"))
return tree;
if (ref[0] == '/')
path = ref;
else
label = ref;
if (label) {
const char *slash = strchr(label, '/');
char *buf = N... | [
1,
0
] |
Linux Kernel | scripts/dtc/livetree.c | cell_t get_node_phandle(struct node *root, struct node *node) {
static cell_t phandle = 1; /* FIXME: ick, static local */
struct data d = empty_data;
if (phandle_is_valid(node->phandle))
return node->phandle;
while (get_node_by_phandle(root, phandle))
phandle++;
node->phandle = phandle;
d = data... | [
0,
1
] |
Linux Kernel | scripts/dtc/livetree.c | uint32_t guess_boot_cpuid(struct node *tree) {
struct node *cpus, *bootcpu;
struct property *reg;
cpus = get_node_by_path(tree, "/cpus");
if (!cpus)
return 0;
bootcpu = cpus->children;
if (!bootcpu)
return 0;
reg = get_property(bootcpu, "reg");
if (!reg || (reg->val.len != sizeof(uint32_t)))
... | [
1,
1
] |
Linux Kernel | scripts/dtc/livetree.c |
static int cmp_reserve_info(const void *ax, const void *bx) {
const struct reserve_info *a, *b;
a = *((const struct reserve_info *const *)ax);
b = *((const struct reserve_info *const *)bx);
if (a->address < b->address)
return -1;
else if (a->address > b->address)
return 1;
else if (a->size < b->s... | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
static int cmp_prop(const void *ax, const void *bx) {
const struct property *a, *b;
a = *((const struct property *const *)ax);
b = *((const struct property *const *)bx);
return strcmp(a->name, b->name);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
static bool any_local_fixup_tree(struct dt_info *dti, struct node *node) {
struct node *c;
struct property *prop;
struct marker *m;
for_each_property(node, prop) {
m = prop->val.markers;
for_each_marker_of_type(m, REF_PHANDLE) {
if (get_node_by_ref(dti->dt, m->ref))
return true;
}
... | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c | static void add_local_fixup_entry(struct dt_info *dti, struct node *lfn,
struct node *node, struct property *prop,
struct marker *m, struct node *refnode) {
struct node *wn, *nwn;
fdt32_t value_32;
char **compp;
int i, depth;
/* walk back re... | [
1,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
static void generate_local_fixups_tree_internal(struct dt_info *dti,
struct node *lfn,
struct node *node) {
struct node *dt = dti->dt;
struct node *c;
struct property *prop;
struct marker *m;
struct node *refnode;... | [
0,
0
] |
Linux Kernel | scripts/dtc/livetree.c |
void generate_fixups_tree(struct dt_info *dti, char *name) {
if (!any_fixup_tree(dti, dti->dt))
return;
generate_fixups_tree_internal(dti, build_root_node(dti->dt, name), dti->dt);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
static char *get_dirname(const char *path) {
const char *slash = strrchr(path, '/');
if (slash) {
int len = slash - path;
char *dir = xmalloc(len + 1);
memcpy(dir, path, len);
dir[len] = '\0';
return dir;
}
return NULL;
} | [
1,
0
] |
Linux Kernel | scripts/dtc/srcpos.c | static char *fopen_any_on_path(const char *fname, FILE **fp) {
const char *cur_dir = NULL;
struct search_path *node;
char *fullname;
assert(fp);
if (current_srcfile)
cur_dir = current_srcfile->dir;
fullname = try_open(cur_dir, fname, fp);
/* Failing that, try each search path in turn */
for (node ... | [
0,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
FILE *srcfile_relative_open(const char *fname, char **fullnamep) {
FILE *f;
char *fullname;
if (streq(fname, "-")) {
f = stdin;
fullname = xstrdup("<stdin>");
} else {
fullname = fopen_any_on_path(fname, &f);
if (!f)
die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
}
if (d... | [
1,
0
] |
Linux Kernel | scripts/dtc/srcpos.c | bool srcfile_pop(void) {
struct srcfile_state *srcfile = current_srcfile;
assert(srcfile);
current_srcfile = srcfile->prev;
if (fclose(srcfile->f))
die("Error closing \"%s\": %s\n", srcfile->name, strerror(errno));
/* FIXME: We allow the srcfile_state structure to leak,
* because it could still be ... | [
0,
1
] |
Linux Kernel | scripts/dtc/srcpos.c | void srcfile_add_search_path(const char *dirname) {
struct search_path *node;
node = xmalloc(sizeof(*node));
node->next = NULL;
node->dirname = xstrdup(dirname);
/* Add to the end of our list */
if (search_path_tail)
*search_path_tail = node;
else
search_path_head = node;
search_path_tail = &n... | [
0,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
struct srcpos *srcpos_extend(struct srcpos *pos, struct srcpos *newtail) {
struct srcpos *p;
if (!pos)
return newtail;
for (p = pos; p->next != NULL; p = p->next)
;
p->next = newtail;
return pos;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
char *srcpos_string(struct srcpos *pos) {
const char *fname = "<no-file>";
char *pos_str;
if (pos->file && pos->file->name)
fname = pos->file->name;
if (pos->first_line != pos->last_line)
xasprintf(&pos_str, "%s:%d.%d-%d.%d", fname, pos->first_line,
pos->first_column, pos->last_line, po... | [
1,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
void srcpos_verror(struct srcpos *pos, const char *prefix, const char *fmt,
va_list va) {
char *srcstr;
srcstr = srcpos_string(pos);
fprintf(stderr, "%s: %s ", prefix, srcstr);
vfprintf(stderr, fmt, va);
fprintf(stderr, "\n");
free(srcstr);
} | [
1,
0
] |
Linux Kernel | scripts/dtc/srcpos.c |
void srcpos_error(struct srcpos *pos, const char *prefix, const char *fmt,
...) {
va_list va;
va_start(va, fmt);
srcpos_verror(pos, prefix, fmt, va);
va_end(va);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/treesource.c |
struct dt_info *dt_from_source(const char *fname) {
parser_output = NULL;
treesource_error = false;
srcfile_push(fname);
yyin = current_srcfile->f;
yylloc.file = current_srcfile;
if (yyparse() != 0)
die("Unable to parse input tree\n");
if (treesource_error)
die("Syntax error parsing input tree... | [
0,
0
] |
Linux Kernel | scripts/dtc/treesource.c |
static void write_prefix(FILE *f, int level) {
int i;
for (i = 0; i < level; i++)
fputc('\t', f);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/treesource.c |
static bool isstring(char c) {
return (isprint((unsigned char)c) || (c == '\0') ||
strchr("\a\b\t\n\v\f\r", c));
} | [
0,
0
] |
Linux Kernel | scripts/dtc/treesource.c |
static enum markertype guess_value_type(struct property *prop) {
int len = prop->val.len;
const char *p = prop->val.val;
struct marker *m = prop->val.markers;
int nnotstring = 0, nnul = 0;
int nnotstringlbl = 0, nnotcelllbl = 0;
int i;
for (i = 0; i < len; i++) {
if (!isstring(p[i]))
nnotstrin... | [
1,
0
] |
Linux Kernel | scripts/dtc/util.c |
int xasprintf_append(char **strp, const char *fmt, ...) {
int n;
va_list ap;
va_start(ap, fmt);
n = xavsprintf_append(strp, fmt, ap);
va_end(ap);
return n;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/util.c | static char get_hex_char(const char *s, int *i) {
char x[3];
char *endx;
long val;
x[2] = '\0';
strncpy(x, s + *i, 2);
val = strtol(x, &endx, 16);
if (!(endx > x))
die("\\x used with no following hex digits\n");
(*i) += endx - x;
return val;
} | [
1,
0
] |
Linux Kernel | scripts/dtc/util.c |
int utilfdt_write(const char *filename, const void *blob) {
int ret = utilfdt_write_err(filename, blob);
if (ret) {
fprintf(stderr, "Couldn't write blob to '%s': %s\n", filename,
strerror(ret));
}
return ret ? -1 : 0;
} | [
0,
0
] |
Linux Kernel | scripts/dtc/util.c | int utilfdt_decode_type(const char *fmt, int *type, int *size) {
int qualifier = 0;
if (!*fmt)
return -1;
*size = -1;
if (strchr("hlLb", *fmt)) {
qualifier = *fmt++;
if (qualifier == *fmt) {
switch (*fmt++) {
/* TODO: case 'l': qualifier = 'L'; break;*/
case 'h':
quali... | [
1,
1
] |
Linux Kernel | scripts/dtc/util.c |
void NORETURN util_version(void) {
printf("Version: %s\n", DTC_VERSION);
exit(0);
} | [
0,
0
] |
Linux Kernel | scripts/dtc/yamltree.c | static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len) {
yaml_event_t event;
int i;
assert(str[len - 1] == '\0');
for (i = 0; i < len; i++)
assert(isascii(str[i]));
yaml_scalar_event_initialize(&event, NULL, (yaml_char_t *)YAML_STR_TAG,
(yaml_char_t ... | [
0,
0
] |
Linux Kernel | scripts/dtc/yamltree.c |
void dt_to_yaml(FILE *f, struct dt_info *dti) {
yaml_emitter_t emitter;
yaml_event_t event;
yaml_emitter_initialize(&emitter);
yaml_emitter_set_output_file(&emitter, f);
yaml_stream_start_event_initialize(&event, YAML_UTF8_ENCODING);
yaml_emitter_emit_or_die(&emitter, &event);
yaml_document_start_event... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/arm_ssp_per_task_plugin.c | static bool no(void) { return false; } | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline unsigned int rebuild_cgraph_edges(void) {
return cgraph_edge::rebuild_edges();
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline struct cgraph_node_hook_list *
cgraph_add_node_removal_hook(cgraph_node_hook hook, void *data) {
return symtab->add_cgraph_removal_hook(hook, data);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline void
cgraph_remove_node_removal_hook(struct cgraph_node_hook_list *entry) {
symtab->remove_cgraph_removal_hook(entry);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline void
cgraph_remove_node_duplication_hook(struct cgraph_2node_hook_list *entry) {
symtab->remove_cgraph_duplication_hook(entry);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h | static inline gimple gimple_build_assign_with_ops(enum tree_code subcode,
tree lhs, tree op1,
tree op2 MEM_STAT_DECL) {
return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline gassign *as_a_gassign(gimple stmt) {
return as_a<gassign *>(stmt);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline const gcall *as_a_const_gcall(const_gimple stmt) {
return as_a<const gcall *>(stmt);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline ggoto *as_a_ggoto(gimple stmt) { return as_a<ggoto *>(stmt); } | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/gcc-common.h |
static inline greturn *as_a_greturn(gimple stmt) {
return as_a<greturn *>(stmt);
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/latent_entropy_plugin.c | static void latent_entropy_start_unit(void *gcc_data __unused,
void *user_data __unused) {
tree type, id;
int quals;
if (in_lto_p)
return;
quals = TYPE_QUALS(long_unsigned_type_node) | TYPE_QUAL_VOLATILE;
type = build_qualified_type(long_unsigned_type_node, quals);
... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/latent_entropy_plugin.c | __visible int plugin_init(struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version) {
bool enabled = true;
const char *const plugin_name = plugin_info->base_name;
const int argc = plugin_info->argc;
const struct plugin_argument *const argv = plugin_info->argv;
int i;
... | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static inline unsigned int name_hash(const unsigned char *name) {
unsigned long hash = 0;
unsigned int len = strlen((const char *)name);
while (len--)
hash = partial_name_hash(*name++, hash);
return (unsigned int)hash;
} | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c |
static tree handle_randomize_layout_attr(tree *node, tree name, tree args,
int flags, bool *no_add_attrs) {
tree type;
*no_add_attrs = true;
if (TREE_CODE(*node) == FUNCTION_DECL) {
error("%qE attribute does not apply to functions (%qF)", name, *node);
return NUL... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static void shuffle(const_tree type, tree *newtree, unsigned long length) {
unsigned long i;
u64 seed[4];
ranctx prng_state;
const unsigned char *structname;
if (length == 0)
return;
gcc_assert(TREE_CODE(type) == RECORD_TYPE);
structname = ORIG_TYPE_NAME(type);
#ifdef __DEBUG_PLUGIN
fprintf(stde... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static bool is_flexible_array(const_tree field) {
const_tree fieldtype;
const_tree typesize;
const_tree elemtype;
const_tree elemsize;
fieldtype = TREE_TYPE(field);
typesize = TYPE_SIZE(fieldtype);
if (TREE_CODE(fieldtype) != ARRAY_TYPE)
return false;
elemtype = TREE_TYPE(fieldtype);
elemsize =... | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static bool is_fptr(const_tree fieldtype) {
if (TREE_CODE(fieldtype) != POINTER_TYPE)
return false;
return TREE_CODE(TREE_TYPE(fieldtype)) == FUNCTION_TYPE;
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static void check_bad_casts_in_constructor(tree var, tree init) {
unsigned HOST_WIDE_INT idx;
tree field, val;
tree field_type, val_type;
FOR_EACH_CONSTRUCTOR_ELT(CONSTRUCTOR_ELTS(init), idx, field, val) {
if (TREE_CODE(val) == CONSTRUCTOR) {
check_bad_casts_in_constructor(var, val);
continue;
... | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/randomize_layout_plugin.c | static void check_global_variables(void *event_data, void *data) {
struct varpool_node *node;
tree init;
FOR_EACH_VARIABLE(node) {
tree var = NODE_DECL(node);
init = DECL_INITIAL(var);
if (init == NULL_TREE)
continue;
if (TREE_CODE(init) != CONSTRUCTOR)
continue;
check_bad_casts... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/sancov_plugin.c |
static void sancov_start_unit(void __unused *gcc_data,
void __unused *user_data) {
tree leaf_attr, nothrow_attr;
tree BT_FN_VOID = build_function_type_list(void_type_node, NULL_TREE);
sancov_fndecl = build_fn_decl("__sanitizer_cov_trace_pc", BT_FN_VOID);
DECL_ASSEMBLER_NAME(sanc... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/sancov_plugin.c | __visible int plugin_init(struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version) {
int i;
const char *const plugin_name = plugin_info->base_name;
const int argc = plugin_info->argc;
const struct plugin_argument *const argv = plugin_info->argv;
bool enable = true;
... | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c |
static bool is_alloca(gimple stmt) {
if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA))
return true;
if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA_WITH_ALIGN))
return true;
return false;
} | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c |
static tree get_current_stack_pointer_decl(void) {
varpool_node_ptr node;
FOR_EACH_VARIABLE(node) {
tree var = NODE_DECL(node);
tree name = DECL_NAME(var);
if (DECL_NAME_LENGTH(var) != sizeof("current_stack_pointer") - 1)
continue;
if (strcmp(IDENTIFIER_POINTER(name), "current_stack_pointe... | [
1,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c | static void remove_stack_tracking_gcall(void) {
rtx_insn *insn, *next;
for (insn = get_insns(); insn; insn = next) {
rtx body;
next = NEXT_INSN(insn);
/* Check the expression code of the insn */
if (!CALL_P(insn))
continue;
/*
* Check the expression code of the insn body, which is... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c | static bool remove_stack_tracking_gasm(void) {
bool removed = false;
rtx_insn *insn, *next;
gcc_assert(build_for_x86);
/*
* Find stackleak_track_stack() asm calls. Loop through the chain of
* insns, which is an RTL representation of the code for a function.
*
* The example of a matching insn:
*... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c | static void stackleak_start_unit(void *gcc_data __unused,
void *user_data __unused) {
tree fntype;
fntype = build_function_type_list(void_type_node, NULL_TREE);
track_function_decl = build_fn_decl(track_function, fntype);
DECL_ASSEMBLER_NAME(track_function_decl); /* for LTO */
... | [
0,
0
] |
Linux Kernel | scripts/gcc-plugins/stackleak_plugin.c |
static bool stackleak_cleanup_gate(void) { return stackleak_gate(); }
#define PASS_NAME stackleak_cleanup
#define TODO_FLAGS_FINISH TODO_dump_func
#include "gcc-generate-rtl-pass.h" | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.