Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/sparc/mm/tsb.c | static void __flush_huge_tsb_one_entry(unsigned long tsb, unsigned long v,
unsigned long hash_shift,
unsigned long nentries,
unsigned int hugepage_shift) {
unsigned int hpage_entries;
unsigned int i;... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c |
void flush_tsb_user(struct tlb_batch *tb) {
struct mm_struct *mm = tb->mm;
unsigned long nentries, base, flags;
spin_lock_irqsave(&mm->context.lock, flags);
if (tb->hugepage_shift < REAL_HPAGE_SHIFT) {
base = (unsigned long)mm->context.tsb_block[MM_TSB_BASE].tsb;
nentries = mm->context.tsb_block[MM_T... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c |
void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr,
unsigned int hugepage_shift) {
unsigned long nentries, base, flags;
spin_lock_irqsave(&mm->context.lock, flags);
if (hugepage_shift < REAL_HPAGE_SHIFT) {
base = (unsigned long)mm->context.tsb_block[MM_TSB_BASE].tsb... | [
0,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c |
void __init pgtable_cache_init(void) {
unsigned long i;
pgtable_cache =
kmem_cache_create("pgtable_cache", PAGE_SIZE, PAGE_SIZE, 0, _clear_page);
if (!pgtable_cache) {
prom_printf("pgtable_cache_init(): Could not create!\n");
prom_halt();
}
for (i = 0; i < ARRAY_SIZE(tsb_cache_names); i++) {
... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c | int init_new_context(struct task_struct *tsk, struct mm_struct *mm) {
unsigned long mm_rss = get_mm_rss(mm);
#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
unsigned long saved_hugetlb_pte_count;
unsigned long saved_thp_pte_count;
#endif
unsigned int i;
spin_lock_init(&mm->context.lo... | [
1,
0
] |
Linux Kernel | arch/sparc/mm/tsb.c | void destroy_context(struct mm_struct *mm) {
unsigned long flags, i;
for (i = 0; i < MM_NUM_TSBS; i++)
tsb_destroy_one(&mm->context.tsb_block[i]);
spin_lock_irqsave(&ctx_alloc_lock, flags);
if (CTX_VALID(mm->context)) {
unsigned long nr = CTX_NRBITS(mm->context);
mmu_context_bmap[nr >> 6] &= ~(1U... | [
1,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static inline bool is_simm5(unsigned int value) { return value + 0x10 < 0x20; } | [
0,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void emit_nop(struct jit_ctx *ctx) { emit(SETHI(0, G0), ctx); } | [
0,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void emit_alu(u32 opcode, u32 src, u32 dst, struct jit_ctx *ctx) {
emit(opcode | RS1(dst) | RS2(src) | RD(dst), ctx);
} | [
0,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void emit_alu3_K(unsigned int opcode, unsigned int src, unsigned int imm,
unsigned int dst, struct jit_ctx *ctx) {
bool small_immed = is_simm13(imm);
unsigned int insn = opcode;
insn |= RS1(src) | RD(dst);
if (small_immed) {
emit(insn | IMMED | S13(imm), ctx);
} else {
... | [
1,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c | static void emit_loadimm_sext(s32 K, unsigned int dest, struct jit_ctx *ctx) {
if (is_simm13(K)) {
emit(OR | IMMED | RS1(G0) | S13(K) | RD(dest), ctx);
} else {
emit_set_const_sext(K, dest, ctx);
}
} | [
0,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void analyze_64bit_constant(u32 high_bits, u32 low_bits, int *hbsp,
int *lbsp, int *abbasp) {
int lowest_bit_set, highest_bit_set, all_bits_between_are_set;
int i;
lowest_bit_set = highest_bit_set = -1;
i = 0;
do {
if ((lowest_bit_set == -1) && ((low_bits >> i) ... | [
1,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static bool const64_is_2insns(unsigned long high_bits, unsigned long low_bits) {
int highest_bit_set, lowest_bit_set, all_bits_between_are_set;
if (high_bits == 0 || high_bits == 0xffffffff)
return true;
analyze_64bit_constant(high_bits, low_bits, &highest_bit_set, &lowest_bit_set,
... | [
0,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void emit_branch(unsigned int br_opc, unsigned int from_idx,
unsigned int to_idx, struct jit_ctx *ctx) {
unsigned int off = to_idx - from_idx;
if (br_opc & XCC)
emit(br_opc | WDISP19(off << 2), ctx);
else
emit(br_opc | WDISP22(off << 2), ctx);
} | [
1,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static void emit_cbcondi(unsigned int cb_opc, unsigned int from_idx,
unsigned int to_idx, const u8 dst, s32 imm,
struct jit_ctx *ctx) {
unsigned int off = to_idx - from_idx;
emit(cb_opc | IMMED | WDISP10(off << 2) | RS1(dst) | S5(imm), ctx);
}
#define emit_read_y... | [
1,
0
] |
Linux Kernel | arch/sparc/net/bpf_jit_comp_64.c |
static int build_body(struct jit_ctx *ctx) {
const struct bpf_prog *prog = ctx->prog;
int i;
for (i = 0; i < prog->len; i++) {
const struct bpf_insn *insn = &prog->insnsi[i];
int ret;
ret = build_insn(insn, ctx);
if (ret > 0) {
i++;
ctx->offset[i] = ctx->idx;
continue;
}
... | [
0,
0
] |
Linux Kernel | arch/sparc/prom/init_64.c |
void __init prom_init(void *cif_handler) {
phandle node;
prom_cif_init(cif_handler);
prom_chosen_node = prom_finddevice(prom_chosen_path);
if (!prom_chosen_node || (s32)prom_chosen_node == -1)
prom_halt();
prom_stdout = prom_getint(prom_chosen_node, "stdout");
node = prom_finddevice("/openprom");
... | [
1,
0
] |
Linux Kernel | arch/sparc/prom/init_64.c |
void __init prom_init_report(void) {
printk("PROMLIB: Sun IEEE Boot Prom '%s'\n", prom_version);
printk("PROMLIB: Root node compatible: %s\n", prom_root_compatible);
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/memory.c |
static int sp_banks_cmp(const void *a, const void *b) {
const struct sparc_phys_banks *x = a, *y = b;
if (x->base_addr > y->base_addr)
return 1;
if (x->base_addr < y->base_addr)
return -1;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_32.c | void prom_feval(char *fstring) {
unsigned long flags;
if (!fstring || fstring[0] == 0)
return;
spin_lock_irqsave(&prom_lock, flags);
if (prom_vers == PROM_V0)
(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
else
(*(romvec->pv_fortheval.v2_eval))(fstring);
restore_current();
spin_u... | [
1,
0
] |
Linux Kernel | arch/sparc/prom/misc_32.c | int prom_getprev(void) { return prom_prev; } | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c |
int prom_map(int mode, unsigned long size, unsigned long vaddr,
unsigned long paddr) {
unsigned long args[11];
int ret;
args[0] = (unsigned long)prom_callmethod_name;
args[1] = 7;
args[2] = 1;
args[3] = (unsigned long)prom_map_name;
args[4] = (unsigned int)prom_get_mmu_ihandle();
args[5] ... | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c | int prom_getunumber(int syndrome_code, unsigned long phys_addr, char *buf,
int buflen) {
unsigned long args[12];
args[0] = (unsigned long)prom_callmethod_name;
args[1] = 7;
args[2] = 2;
args[3] = (unsigned long)"SUNW,get-unumber";
args[4] = (unsigned int)prom_get_memory_ihandle();
arg... | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c |
int prom_sleepsystem(void) {
unsigned long args[4];
args[0] = (unsigned long)"SUNW,sleep-system";
args[1] = 0;
args[2] = 1;
args[3] = (unsigned long)-1;
p1275_cmd_direct(args);
return (int)args[3];
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c |
int prom_wakeupsystem(void) {
unsigned long args[4];
args[0] = (unsigned long)"SUNW,wakeup-system";
args[1] = 0;
args[2] = 1;
args[3] = (unsigned long)-1;
p1275_cmd_direct(args);
return (int)args[3];
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c |
void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg) {
unsigned long args[6];
args[0] = (unsigned long)"SUNW,start-cpu-by-cpuid";
args[1] = 3;
args[2] = 0;
args[3] = (unsigned int)cpuid;
args[4] = pc;
args[5] = arg;
p1275_cmd_direct(args);
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/misc_64.c |
void prom_idleself(void) {
unsigned long args[3];
args[0] = (unsigned long)"SUNW,idle-self";
args[1] = 0;
args[2] = 0;
p1275_cmd_direct(args);
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/printf.c |
void notrace prom_printf(const char *fmt, ...) {
va_list args;
int i;
va_start(args, fmt);
i = vscnprintf(ppbuf, sizeof(ppbuf), fmt, args);
va_end(args);
prom_write(ppbuf, i);
} | [
1,
0
] |
Linux Kernel | arch/sparc/prom/ranges.c | static void prom_adjust_ranges(struct linux_prom_ranges *ranges1, int nranges1,
struct linux_prom_ranges *ranges2,
int nranges2) {
int rng1c, rng2c;
for (rng1c = 0; rng1c < nranges1; rng1c++) {
for (rng2c = 0; rng2c < nranges2; rng2c++)
if (ra... | [
1,
0
] |
Linux Kernel | arch/sparc/prom/ranges.c | void __init prom_ranges_init(void) {
phandle node, obio_node;
int success;
num_obio_ranges = 0;
node = prom_getchild(prom_root_node);
obio_node = prom_searchsiblings(node, "obio");
if (obio_node) {
success = prom_getproperty(obio_node, "ranges", (char *)promlib_obio_ranges,
... | [
1,
0
] |
Linux Kernel | arch/sparc/prom/tree_32.c | static phandle __prom_getsibling(phandle node) {
unsigned long flags;
phandle cnode;
spin_lock_irqsave(&prom_lock, flags);
cnode = prom_nodeops->no_nextnode(node);
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return cnode;
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/tree_32.c | void prom_getstring(phandle node, char *prop, char *user_buf, int ubuf_size) {
int len;
len = prom_getproperty(node, prop, user_buf, ubuf_size);
if (len != -1)
return;
user_buf[0] = 0;
} | [
1,
0
] |
Linux Kernel | arch/sparc/prom/tree_32.c | static char *__prom_nextprop(phandle node, char *oprop) {
unsigned long flags;
char *prop;
spin_lock_irqsave(&prom_lock, flags);
prop = prom_nodeops->no_nextprop(node, oprop);
restore_current();
spin_unlock_irqrestore(&prom_lock, flags);
return prop;
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/tree_64.c | inline phandle __prom_getsibling(phandle node) {
return prom_node_to_node(prom_peer_name, node);
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/tree_64.c |
phandle prom_getsibling(phandle node) {
phandle sibnode;
if ((s32)node == -1)
return 0;
sibnode = __prom_getsibling(node);
if ((s32)sibnode == -1)
return 0;
return sibnode;
} | [
0,
0
] |
Linux Kernel | arch/sparc/prom/tree_64.c | int prom_getproplen(phandle node, const char *prop) {
unsigned long args[6];
if (!node || !prop)
return -1;
args[0] = (unsigned long)"getproplen";
args[1] = 2;
args[2] = 1;
args[3] = (unsigned int)node;
args[4] = (unsigned long)prop;
args[5] = (unsigned long)-1;
p1275_cmd_direct(args);
retur... | [
0,
0
] |
Linux Kernel | arch/sparc/prom/tree_64.c | int prom_getint(phandle node, const char *prop) {
int intprop;
if (prom_getproperty(node, prop, (char *)&intprop, sizeof(int)) != -1)
return intprop;
return -1;
} | [
1,
0
] |
Linux Kernel | arch/sparc/prom/tree_64.c |
phandle prom_finddevice(const char *name) {
unsigned long args[5];
if (!name)
return 0;
args[0] = (unsigned long)"finddevice";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long)name;
args[4] = (unsigned long)-1;
p1275_cmd_direct(args);
return (int)args[4];
} | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vclock_gettime.c |
notrace static __always_inline u64 vgetsns(struct vvar_data *vvar) {
u64 v;
u64 cycles;
cycles = vread_tick();
v = (cycles - vvar->clock.cycle_last) & vvar->clock.mask;
return v * vvar->clock.mult;
} | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vclock_gettime.c |
notrace static __always_inline int
do_realtime_stick(struct vvar_data *vvar, struct __kernel_old_timespec *ts) {
unsigned long seq;
u64 ns;
do {
seq = vvar_read_begin(vvar);
ts->tv_sec = vvar->wall_time_sec;
ns = vvar->wall_time_snsec;
ns += vgetsns_stick(vvar);
ns >>= vvar->clock.shift;
}... | [
1,
0
] |
Linux Kernel | arch/sparc/vdso/vclock_gettime.c | notrace int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
struct timezone *tz) {
struct vvar_data *vvd = get_vvar_data();
if (likely(vvd->vclock_mode != VCLOCK_NONE)) {
if (likely(tv != NULL)) {
union tstv_t {
struct __kernel_old_timespec ts;
struct ... | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vdso2c.c | static void fail(const char *format, ...) {
va_list ap;
va_start(ap, format);
fprintf(stderr, "Error: ");
vfprintf(stderr, format, ap);
if (outfilename)
unlink(outfilename);
exit(1);
va_end(ap);
}
#define GBE(x, bits, ifnot) \
__builtin_choose_exp... | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c |
static void *one_section32(struct vdso_elfinfo32 *e, const char *name,
unsigned long *size) {
const char *snames;
Elf32_Shdr *shdrs;
unsigned int i;
shdrs = (void *)e->hdr + e->hdr->e_shoff;
snames = (void *)e->hdr + shdrs[e->hdr->e_shstrndx].sh_offset;
for (i = 1; i < e->hdr->e... | [
1,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c |
static Elf32_Sym *find_sym32(const struct vdso_elfinfo32 *e, const char *name) {
unsigned int i;
for (i = 0; i < (e->dynsymsize / sizeof(Elf32_Sym)); i++) {
Elf32_Sym *s = &e->dynsym[i];
if (s->st_name == 0)
continue;
if (!strcmp(e->dynstr + s->st_name, name))
return s;
}
return NULL;
... | [
1,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c |
static int patchsym32(struct vdso_elfinfo *_e, const char *orig,
const char *new) {
struct vdso_elfinfo32 *e = &_e->u.elf32;
Elf32_Sym *osym = find_sym32(e, orig);
Elf32_Sym *nsym = find_sym32(e, new);
if (!nsym || !osym) {
pr_err("VDSO32: Missing symbols.\n");
return -ENODEV;
... | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c | static int map_vdso(const struct vdso_image *image,
struct vm_special_mapping *vdso_mapping) {
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
unsigned long text_start, addr = 0;
int ret = 0;
mmap_write_lock(mm);
if (current->flags & PF_RANDOMIZE) {
addr =
g... | [
1,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c |
int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) {
if (!vdso_enabled)
return 0;
#if defined CONFIG_COMPAT
if (!(is_32bit_task()))
return map_vdso(&vdso_image_64_builtin, &vdso_mapping64);
else
return map_vdso(&vdso_image_32_builtin, &vdso_mapping32);
#else
return map_vd... | [
0,
0
] |
Linux Kernel | arch/sparc/vdso/vma.c |
static __init int vdso_setup(char *s) {
int err;
unsigned long val;
err = kstrtoul(s, 10, &val);
if (err)
return err;
vdso_enabled = val;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
static int not_configged_open(int input, int output, int primary, void *data,
char **dev_out) {
printk(KERN_ERR "Using a channel type which is configured out of "
"UML\n");
return -ENODEV;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
static int not_configged_window_size(int fd, void *data, unsigned short *rows,
unsigned short *cols) {
printk(KERN_ERR "Using a channel type which is configured out of "
"UML\n");
return -ENODEV;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
static void not_configged_free(void *data) {
printk(KERN_ERR "Using a channel type which is configured out of "
"UML\n");
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
int enable_chan(struct line *line) {
struct list_head *ele;
struct chan *chan;
int err;
INIT_DELAYED_WORK(&line->task, line_timer_cb);
list_for_each(ele, &line->chan_list) {
chan = list_entry(ele, struct chan, list);
err = open_one_chan(chan);
if (err) {
if (chan->primary)
goto ou... | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
void deactivate_chan(struct chan *chan, int irq) {
if (chan && chan->enabled)
deactivate_fd(chan->fd, irq);
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
int write_chan(struct chan *chan, const char *buf, int len, int write_irq) {
int n, ret = 0;
if (len == 0 || !chan || !chan->ops->write)
return 0;
n = chan->ops->write(chan->fd, buf, len, chan->data);
if (chan->primary) {
ret = n;
}
return ret;
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
int console_write_chan(struct chan *chan, const char *buf, int len) {
int n, ret = 0;
if (!chan || !chan->ops->console_write)
return 0;
n = chan->ops->console_write(chan->fd, buf, len);
if (chan->primary)
ret = n;
return ret;
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
int console_open_chan(struct line *line, struct console *co) {
int err;
err = open_chan(&line->chan_list);
if (err)
return err;
printk(KERN_INFO "Console initialized on /dev/%s%d\n", co->name, co->index);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_kern.c |
static void free_one_chan(struct chan *chan) {
list_del(&chan->list);
close_one_chan(chan, 0);
if (chan->ops->free != NULL)
(*chan->ops->free)(chan->data);
if (chan->primary && chan->output)
ignore_sigio_fd(chan->fd);
kfree(chan);
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/chan_user.c | int generic_write(int fd, const char *buf, int n, void *unused) {
int err;
err = write(fd, buf, n);
if (err > 0)
return err;
else if (errno == EAGAIN)
return 0;
else if (err == 0)
return -EIO;
return -errno;
} | [
0,
1
] |
Linux Kernel | arch/um/drivers/chan_user.c | static void winch_handler(int sig) {} | [
0,
0
] |
Linux Kernel | arch/um/drivers/chan_user.c |
void register_winch(int fd, struct tty_port *port) {
unsigned long stack;
int pid, thread, count, thread_fd = -1;
char c = 1;
if (!isatty(fd))
return;
pid = tcgetpgrp(fd);
if (is_skas_winch(pid, fd, port)) {
register_winch_irq(-1, fd, -1, port, 0);
return;
}
if (pid == -1) {
thread =... | [
1,
0
] |
Linux Kernel | arch/um/drivers/cow_sys.h |
static inline void cow_free(void *ptr) { kfree(ptr); } | [
0,
0
] |
Linux Kernel | arch/um/drivers/cow_sys.h |
static inline int cow_seek_file(int fd, __u64 offset) {
return os_seek_file(fd, offset);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/cow_user.c | int init_cow_file(int fd, char *cow_file, char *backing_file, int sectorsize,
int alignment, int *bitmap_offset_out,
unsigned long *bitmap_len_out, int *data_offset_out) {
unsigned long long size, offset;
char zero = 0;
int err;
err = write_cow_header(cow_file, fd, backing_f... | [
1,
0
] |
Linux Kernel | arch/um/drivers/daemon_kern.c | static void daemon_init(struct net_device *dev, void *data) {
struct uml_net_private *pri;
struct daemon_data *dpri;
struct daemon_init *init = data;
pri = netdev_priv(dev);
dpri = (struct daemon_data *)pri->user;
dpri->sock_type = init->sock_type;
dpri->ctl_sock = init->ctl_sock;
dpri->fd = -1;
dpri... | [
1,
0
] |
Linux Kernel | arch/um/drivers/daemon_kern.c |
static int register_daemon(void) {
register_transport(&daemon_transport);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/daemon_user.c |
static struct sockaddr_un *new_addr(void *name, int len) {
struct sockaddr_un *sun;
sun = uml_kmalloc(sizeof(struct sockaddr_un), UM_GFP_KERNEL);
if (sun == NULL) {
printk(UM_KERN_ERR "new_addr: allocation of sockaddr_un "
"failed\n");
return NULL;
}
sun->sun_family = AF_UNIX;... | [
1,
0
] |
Linux Kernel | arch/um/drivers/daemon_user.c |
static int daemon_user_init(void *data, void *dev) {
struct daemon_data *pri = data;
struct timeval tv;
struct {
char zero;
int pid;
int usecs;
} name;
if (!strcmp(pri->sock_type, "unix"))
pri->ctl_addr = new_addr(pri->ctl_sock, strlen(pri->ctl_sock) + 1);
name.zero = 0;
name.pid = os_ge... | [
1,
0
] |
Linux Kernel | arch/um/drivers/harddog_kern.c |
static long harddog_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
long ret;
mutex_lock(&harddog_mutex);
ret = harddog_ioctl_unlocked(file, cmd, arg);
mutex_unlock(&harddog_mutex);
return ret;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/harddog_user.c |
int ping_watchdog(int fd) {
int n;
char c = '\n';
n = write(fd, &c, sizeof(c));
if (n != sizeof(c)) {
printk("ping_watchdog - write failed, ret = %d, err = %d\n", n, errno);
if (n < 0)
return n;
return -EIO;
}
return 1;
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/hostaudio_kern.c | static int set_dsp(char *name, int *add) {
dsp = name;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/hostaudio_kern.c |
static __poll_t hostaudio_poll(struct file *file,
struct poll_table_struct *wait) {
#ifdef DEBUG
printk(KERN_DEBUG "hostaudio: poll called (unimplemented)\n");
#endif
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/hostaudio_kern.c |
static long hostaudio_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
struct hostaudio_state *state = file->private_data;
unsigned long data = 0;
int err;
#ifdef DEBUG
printk(KERN_DEBUG "hostaudio: ioctl called, cmd = %u\n", cmd);
#endif
switch (cmd) {
case SNDC... | [
1,
0
] |
Linux Kernel | arch/um/drivers/line.c |
void line_flush_buffer(struct tty_struct *tty) {
struct line *line = tty->driver_data;
unsigned long flags;
spin_lock_irqsave(&line->lock, flags);
flush_buffer(line);
spin_unlock_irqrestore(&line->lock, flags);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c | void line_flush_chars(struct tty_struct *tty) { line_flush_buffer(tty); } | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
void line_throttle(struct tty_struct *tty) {
struct line *line = tty->driver_data;
deactivate_chan(line->chan_in, line->read_irq);
line->throttled = 1;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
void line_unthrottle(struct tty_struct *tty) {
struct line *line = tty->driver_data;
line->throttled = 0;
chan_interrupt(line, line->read_irq);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
int line_install(struct tty_driver *driver, struct tty_struct *tty,
struct line *line) {
int ret;
ret = tty_standard_install(driver, tty);
if (ret)
return ret;
tty->driver_data = line;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
void line_hangup(struct tty_struct *tty) {
struct line *line = tty->driver_data;
tty_port_hangup(&line->port);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
void close_lines(struct line *lines, int nlines) {
int i;
for (i = 0; i < nlines; i++)
close_chan(&lines[i]);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
int setup_one_line(struct line *lines, int n, char *init,
const struct chan_opts *opts, char **error_out) {
struct line *line = &lines[n];
struct tty_driver *driver = line->driver->driver;
int err = -EINVAL;
if (line->port.count) {
*error_out = "Device is already open";
goto out;
... | [
1,
0
] |
Linux Kernel | arch/um/drivers/line.c |
int line_id(char **str, int *start_out, int *end_out) {
char *end;
int n;
n = simple_strtoul(*str, &end, 0);
if ((*end != '\0') || (end == *str))
return -1;
*str = end;
*start_out = n;
*end_out = n;
return n;
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/line.c |
static void __free_winch(struct work_struct *work) {
struct winch *winch = container_of(work, struct winch, work);
um_free_irq(WINCH_IRQ, winch);
if (winch->pid != -1)
os_kill_process(winch->pid, 1);
if (winch->stack != 0)
free_stack(winch->stack, 0);
kfree(winch);
} | [
1,
0
] |
Linux Kernel | arch/um/drivers/line.c |
static irqreturn_t winch_interrupt(int irq, void *data) {
struct winch *winch = data;
struct tty_struct *tty;
struct line *line;
int fd = winch->fd;
int err;
char c;
struct pid *pgrp;
if (fd != -1) {
err = generic_read(fd, &c, NULL);
if (err < 0) {
if (err != -EAGAIN) {
winch->fd... | [
1,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
static void mc_work_proc(struct work_struct *unused) {
struct mconsole_entry *req;
unsigned long flags;
while (!list_empty(&mc_requests)) {
local_irq_save(flags);
req = list_entry(mc_requests.next, struct mconsole_entry, list);
list_del(&req->list);
local_irq_restore(flags);
req->request.cmd... | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c | static irqreturn_t mconsole_interrupt(int irq, void *dev_id) {
long fd;
struct mconsole_entry *new;
static struct mc_request req; /* that's OK */
fd = (long)dev_id;
while (mconsole_get_request(fd, &req)) {
if (req.cmd->context == MCONSOLE_INTR)
(*req.cmd->handler)(&req);
else {
new = kma... | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
void mconsole_remove(struct mc_request *req) {
struct mc_device *dev;
char *ptr = req->request.data, *err_msg = "";
char error[256];
int err, start, end, n;
ptr += strlen("remove");
ptr = skip_spaces(ptr);
dev = mconsole_find_dev(ptr);
if (dev == NULL) {
mconsole_reply(req, "Bad remove option", 1,... | [
1,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
static void console_write(struct console *console, const char *string,
unsigned int len) {
struct list_head *ele;
int n;
if (list_empty(&clients))
return;
while (len > 0) {
n = min((size_t)len, ARRAY_SIZE(console_buf));
strncpy(console_buf, string, n);
string += n;
... | [
1,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
static void with_console(struct mc_request *req, void (*proc)(void *),
void *arg) {
struct mconsole_output entry;
unsigned long flags;
entry.req = req;
spin_lock_irqsave(&client_lock, flags);
list_add(&entry.list, &clients);
spin_unlock_irqrestore(&client_lock, flags);
(*proc)(... | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
static void stack_proc(void *arg) {
struct task_struct *task = arg;
show_stack(task, NULL, KERN_INFO);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c | void mconsole_stack(struct mc_request *req) {
char *ptr = req->request.data;
int pid_requested = -1;
struct task_struct *to = NULL;
ptr += strlen("stack");
ptr = skip_spaces(ptr);
/*
* Should really check for multiple pids or reject bad args here
*/
/* What do the arguments in mconsole_reply mean?... | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c | static int __init mconsole_init(void) {
long sock;
int err;
char file[UNIX_PATH_MAX];
mount_proc();
if (umid_file_name("mconsole", file, sizeof(file)))
return -1;
snprintf(mconsole_socket_name, sizeof(file), "%s", file);
sock = os_create_unix_socket(file, sizeof(file), 1);
if (sock < 0) {
pr... | [
1,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
void lock_notify(void) { spin_lock(¬ify_spinlock); } | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_kern.c |
void unlock_notify(void) { spin_unlock(¬ify_spinlock); } | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_user.c |
static int mconsole_reply_v0(struct mc_request *req, char *reply) {
struct iovec iov;
struct msghdr msg;
iov.iov_base = reply;
iov.iov_len = strlen(reply);
msg.msg_name = &(req->origin);
msg.msg_namelen = req->originlen;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = NULL;
msg.msg_cont... | [
0,
0
] |
Linux Kernel | arch/um/drivers/mconsole_user.c | int mconsole_reply_len(struct mc_request *req, const char *str, int total,
int err, int more) {
/*
* XXX This is a stack consumption problem. It'd be nice to
* make it global and serialize access to it, but there are a
* ton of callers to this function.
*/
struct mconsole_reply r... | [
1,
1
] |
Linux Kernel | arch/um/drivers/mmapper_kern.c |
static ssize_t mmapper_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos) {
return simple_read_from_buffer(buf, count, ppos, v_buf, mmapper_size);
} | [
0,
0
] |
Linux Kernel | arch/um/drivers/mmapper_kern.c | static int mmapper_mmap(struct file *file, struct vm_area_struct *vma) {
int ret = -EINVAL;
int size;
if (vma->vm_pgoff != 0)
goto out;
size = vma->vm_end - vma->vm_start;
if (size > mmapper_size)
return -EFAULT;
/*
* XXX A comment above remap_pfn_range says it should only be
* called when ... | [
0,
1
] |
Linux Kernel | arch/um/drivers/mmapper_kern.c |
static int mmapper_open(struct inode *inode, struct file *file) { return 0; } | [
0,
0
] |
Linux Kernel | arch/um/drivers/mmapper_kern.c |
static int __init mmapper_init(void) {
int err;
printk(KERN_INFO "Mapper v0.1\n");
v_buf = (char *)find_iomem("mmapper", &mmapper_size);
if (mmapper_size == 0) {
printk(KERN_ERR "mmapper_init - find_iomem failed\n");
return -ENODEV;
}
p_buf = __pa(v_buf);
err = misc_register(&mmapper_dev);
i... | [
0,
0
] |
Linux Kernel | arch/um/drivers/net_kern.c |
static int uml_net_close(struct net_device *dev) {
struct uml_net_private *lp = netdev_priv(dev);
netif_stop_queue(dev);
um_free_irq(dev->irq, dev);
if (lp->close != NULL)
(*lp->close)(lp->fd, &lp->user);
lp->fd = -1;
spin_lock(&opened_lock);
list_del(&lp->list);
spin_unlock(&opened_lock);
re... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.