type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <linux/perf_event.h>
includes
#include <linux/kprobes.h>
includes
#include <linux/pipe_fs_i.h>
includes
#include <linux/oom.h>
includes
#include <linux/kmod.h>
includes
#include <linux/capability.h>
includes
#include <linux/binfmts.h>
includes
#include <asm/uaccess.h>
includes
#include <asm/processor.h>
includes
#include <asm/nmi.h>
includes
#include <asm/stacktrace.h>
includes
#include <asm/io.h>
includes
#include <asm/setup.h>
includes
#include <linux/acct.h>
includes
#include <linux/rtmutex.h>
includes
#include <linux/lockdep.h>
includes
#include <scsi/sg.h>
includes
#include <linux/nmi.h>
includes
#include <linux/inotify.h>
defines
#define TMPBUFLEN 22
structs
struct do_proc_dointvec_minmax_conv_param { int *min; int *max; };
functions
int sysrq_sysctl_handler(ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int error; error = proc_dointvec(table, write, buffer, lenp, ppos); if (error) return error; if (write) sysrq_toggle_support(__sysrq_enabled); return 0; }
functions
if defined(CONFIG_LOCKUP_DETECTOR) { .procname = "watchdog", .data = &watchdog_enabled, .maxlen = sizeof (int), .mode = 0644, .proc_handler = proc_dowatchdog, .extra1 = &zero, .extra2 = &one, }
functions
if defined(CONFIG_X86) { .procname = "panic_on_unrecovered_nmi", .data = &panic_on_unrecovered_nmi, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }
functions
if defined(CONFIG_MMU) { .procname = "randomize_va_space", .data = &randomize_va_space, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }
functions
if defined(CONFIG_OPTPROBES) { .procname = "kprobes-optimization", .data = &sysctl_kprobes_optimization, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_kprobes_optimization_handler, .extra1 = &zero, .extra2 = &one, }
functions
__init sysctl_init(void) { register_sysctl_table(sysctl_base_table); return 0; }
functions
int _proc_do_string(void* data, int maxlen, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { size_t len; char __user *p; char c; if (!data || !maxlen || !*lenp) { *lenp = 0; return 0; }
functions
int proc_dostring(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, ppos); }
functions
size_t proc_skip_spaces(char **buf) { size_t ret; char *tmp = skip_spaces(*buf); ret = tmp - *buf; *buf = tmp; return ret; }
functions
void proc_skip_char(char **buf, size_t *size, const char v) { while (*size) { if (**buf != v) break; (*size)--; (*buf)++; }
functions
int proc_get_long(char **buf, size_t *size, unsigned long *val, bool *neg, const char *perm_tr, unsigned perm_tr_len, char *tr) { int len; char *p, tmp[TMPBUFLEN]; if (!*size) return -EINVAL; len = *size; if (len > TMPBUFLEN - 1) len = TMPBUFLEN - 1; memcpy(tmp, *buf, len); tmp[len] = 0; p = t...
functions
int proc_put_long(void __user **buf, size_t *size, unsigned long val, bool neg) { int len; char tmp[TMPBUFLEN], *p = tmp; sprintf(p, "%s%lu", neg ? "-" : "", val); len = strlen(tmp); if (len > *size) len = *size; if (copy_to_user(*buf, tmp, len)) return -EFAULT; *size -= len; *buf += len; return 0; }
functions
int proc_put_char(void __user **buf, size_t *size, char c) { if (*size) { char __user **buffer = (char __user **)buf; if (put_user(c, *buffer)) return -EFAULT; (*size)--, (*buffer)++; *buf = *buffer; }
functions
int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp, int *valp, int write, void *data) { if (write) { *valp = *negp ? -*lvalp : *lvalp; }
functions
int proc_dointvec(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table,write,buffer,lenp,ppos, NULL,NULL); }
functions
int proc_taint(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; unsigned long tmptaint = get_taint(); int err; if (write && !capable(CAP_SYS_ADMIN)) return -EPERM; t = *table; t.data = &tmptaint; err = proc_doulongvec_minmax(&t, write, buffe...
functions
int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { if (write && !capable(CAP_SYS_ADMIN)) return -EPERM; return proc_dointvec_minmax(table, write, buffer, lenp, ppos); }
functions
int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, int *valp, int write, void *data) { struct do_proc_dointvec_minmax_conv_param *param = data; if (write) { int val = *negp ? -*lvalp : *lvalp; if ((param->min && *param->min > val) || (param->max && *param->max < val)) return -EI...
functions
int proc_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct do_proc_dointvec_minmax_conv_param param = { .min = (int *) table->extra1, .max = (int *) table->extra2, }
functions
int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul, unsigned long convdiv) { unsigned long *i, *min, *max; int vleft, first = 1, err = 0; unsigned long page = 0; size_t left; char...
functions
int do_proc_doulongvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos, unsigned long convmul, unsigned long convdiv) { return __do_proc_doulongvec_minmax(table->data, table, write, buffer, lenp, ppos, convmul, convdiv); }
functions
int proc_doulongvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); }
functions
int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, HZ, 1000l); }
functions
int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp, int *valp, int write, void *data) { if (write) { if (*lvalp > LONG_MAX / HZ) return 1; *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ); }
functions
int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp, int *valp, int write, void *data) { if (write) { if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ) return 1; *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); }
functions
int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp, int *valp, int write, void *data) { if (write) { *valp = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); }
functions
int proc_dointvec_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table,write,buffer,lenp,ppos, do_proc_dointvec_jiffies_conv,NULL); }
functions
int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table,write,buffer,lenp,ppos, do_proc_dointvec_userhz_jiffies_conv,NULL); }
functions
int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return do_proc_dointvec(table, write, buffer, lenp, ppos, do_proc_dointvec_ms_jiffies_conv, NULL); }
functions
int proc_do_cad_pid(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct pid *new_pid; pid_t tmp; int r; tmp = pid_vnr(cad_pid); r = __do_proc_dointvec(&tmp, table, write, buffer, lenp, ppos, NULL, NULL); if (r || !write) return r; new_pid = find_get_...
functions
int proc_do_large_bitmap(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { int err = 0; bool first = 1; size_t left = *lenp; unsigned long bitmap_len = table->maxlen; unsigned long *bitmap = (unsigned long *) table->data; unsigned long *tmp_bitmap = NULL; char tr_a[] = { ...
functions
int proc_dostring(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_dointvec(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_dointvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_dointvec_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_doulongvec_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
functions
int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { return -ENOSYS; }
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <stddef.h>
includes
#include <ctype.h>
functions
else if (tcode == TLOGICAL) { /* allocate memory for the array of logical values */ carray = (char *) malloc((size_t) nelem); /* call the logical column reading routine */ ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp, *nulval, carray, nularray, anynul, status); ...
functions
else if (tcode == TCOMPLEX) { /* allocate memory for the array of double values */ earray = (float *) calloc((size_t) (nelem * 2), sizeof(float) ); ffgcle(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2, 1, 1, FLOATNULLVALUE, earray, nularray, anynul, status); if (...
functions
else if (tcode == TDBLCOMPLEX) { /* allocate memory for the array of double values */ darray = (double *) calloc((size_t) (nelem * 2), sizeof(double) ); ffgcld(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2, 1, 1, DOUBLENULLVALUE, darray, nularray, anynul, status); ...
functions
else if (tcode == TLONGLONG) { /* allocate memory for the array of LONGLONG values */ llarray = (LONGLONG *) calloc((size_t) nelem, sizeof(LONGLONG) ); flgarray = (char *) calloc((size_t) nelem, sizeof(char) ); dwidth = 20; /* max width of displayed long long integer value */ if (ffg...
functions
else if (scaled && tcode == TLONG) { /* scaled long integer column == double */ strcpy(cform, "%#23.15G"); }
functions
else if (tcode == TBYTE) { /* 'B' */ strcpy(cform, "%4d"); }
functions
else if (tcode == TSHORT) { /* 'I' */ strcpy(cform, "%6d"); }
functions
else if (tcode == TLONG) { /* 'J' */ strcpy(cform, "%11.0f"); intcol = 0; /* needed to support unsigned int */ }
functions
else if (tcode == TFLOAT) { /* 'E' */ strcpy(cform, "%#14.6G"); }
functions
else if (tcode == TDOUBLE) { /* 'D' */ strcpy(cform, "%#23.15G"); }
functions
else if (scaled && tcode == TLONG) { /* scaled long integer col == double; default format is 23.15G */ *width = 23; }
functions
else if (tcode == TSTRING) { if (ffgcprll( fptr, colnum, firstrow, firstelem, nelem, 0, &scale, &zero, tform, &twidth, &tcode, &maxelem, &startpos, &elemnum, &incre, &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0) return(*status); /* if string length is greater than a F...
includes
#include <linux/module.h>
includes
#include <linux/init.h>
includes
#include <linux/fs.h>
includes
#include <linux/miscdevice.h>
includes
#include <linux/device.h>
includes
#include <mach/hardware.h>
includes
#include <asm/io.h>
includes
#include <linux/vmalloc.h>
includes
#include <linux/uaccess.h>
includes
#include <linux/delay.h>
includes
#include <linux/fs.h>
includes
#include <linux/slab.h>
includes
#include <mach/sync_write.h>
includes
#include <mach/mt_reg_base.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/signal.h>
defines
#define AUDDRV_ANC_NAME "MediaTek Audio ANC Driver"
defines
#define AUDDRV_AUTHOR "MediaTek WCX"
functions
bool anc_ipimsg_wait() { int timeout = 0; while (ancserv.ipimsgwait) { msleep(ANC_WAITCHECK_INTERVAL_MS); if (timeout++ >= ANC_IPIMSG_TIMEOUT) { printk("[ANC Kernel] Error: IPI MSG timeout\n"); ancserv.ipimsgwait = false; return false; }
functions
bool anc_swaptcm_wait() { int timeout = 0; while (ancserv.swapwait) { msleep(ANC_WAITCHECK_INTERVAL_MS); if (timeout++ >= ANC_SWAPTCM_TIMEOUT) { printk("[ANC] Error: Swap TCM from/to ANC timeout\n"); ancserv.swapid = -1; ancserv.swapwait = true; ...
functions
bool anc_ipi_sendmsg(anc_ipi_msgid_t id, void *buf, unsigned int size, unsigned int type, uint wait) { ipi_status status; short ipibuf[24]; ipibuf[0] = id; ipibuf[1] = size; if (type == 0) { memcpy((void *)&ipibuf[2], buf, size); status = md32_ipi_send(IPI_ANC, (void *)ipibuf, s...
functions
void anc_ipi_handler(int id, void *data, unsigned int len) { anc_ipi_msg_t *msg_md2ap = (anc_ipi_msg_t *)data; switch (msg_md2ap->id) { case MD32_IPIMSG_ANC_ENABLE_ACK: { printk("[ANC_Kernel] MD32_IPIMSG_ANC_Enable_ACK\n"); ancserv.ipimsgwait = false; bre...
functions
int md32_anc_notify(struct notifier_block *self, unsigned long action, void *dev) { MD32_REQUEST_SWAP *request_swap = (MD32_REQUEST_SWAP *)dev; int ret; switch (action) { #ifdef DYNAMIC_TCM_SWAP case MD32_SELF_TRIGGER_TCM_SWAP: { ret = md32_tcm_swap(ancserv.swapid); ...
functions
void anc_service_Init(void) { printk("[ANC_Kernel] md32_anc_init\n"); ancserv.swapid = -1; ancserv.swapwait = false; ancserv.ipimsgwait = false; ancserv.dumpwait = false; ancserv.debugmode = false; ancserv.dumpaddr = -1; ancserv.init_coeff_addr = ...