type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
structs | struct pjmedia_resample
{
double factor; /* Conversion factor = rate_out / rate_in. */
pj_bool_t large_filter; /* Large filter? */
pj_bool_t high_quality; /* Not fast? */
unsigned xoff; /* History and lookahead size, in samples */
unsigned frame_size; /* Samples per frame. ... |
functions | else if (channel_count > 1) {
unsigned i, size;
/* Allocate input buffer table */
size = channel_count * sizeof(pj_int16_t*);
resample->in_buffer = (pj_int16_t**)pj_pool_alloc(pool, size);
/* Allocate input buffer */
size = (samples_per_frame/channel_count + 2*resample->xoff) *
sizeof(pj_int16_t);
for... |
includes |
#include <linux/kernel.h> |
includes | #include <linux/types.h> |
includes | #include <linux/errno.h> |
includes | #include <linux/err.h> |
includes | #include <linux/io.h> |
defines | #define OMAP4_RST_CTRL_ST_OFFSET 4 |
functions | void omap4_prm_base_init(struct omap_globals *omap2_globals)
{
_prm_bases[OMAP4430_PRM_PARTITION] = omap2_globals->prm;
_prm_bases[OMAP4430_PRCM_MPU_PARTITION] = omap2_globals->prcm_mpu;
_prm_bases[OMAP4430_SCRM_PARTITION] = omap2_globals->scrm;
} |
functions | u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx)
{
BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
part == OMAP4430_INVALID_PRCM_PARTITION ||
!_prm_bases[part]);
return __raw_readl(_prm_bases[part] + inst + idx);
} |
functions | void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
{
BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
part == OMAP4430_INVALID_PRCM_PARTITION ||
!_prm_bases[part]);
__raw_writel(val, _prm_bases[part] + inst + idx);
} |
functions | u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
u16 idx)
{
u32 v;
v = omap4_prminst_read_inst_reg(part, inst, idx);
v &= ~mask;
v |= bits;
omap4_prminst_write_inst_reg(v, part, inst, idx);
return v;
} |
functions | int omap4_prminst_is_hardreset_asserted(u8 shift, u8 part, s16 inst,
u16 rstctrl_offs)
{
u32 v;
v = omap4_prminst_read_inst_reg(part, inst, rstctrl_offs);
v &= 1 << shift;
v >>= shift;
return v;
} |
functions | int omap4_prminst_assert_hardreset(u8 shift, u8 part, s16 inst,
u16 rstctrl_offs)
{
u32 mask = 1 << shift;
omap4_prminst_rmw_inst_reg_bits(mask, mask, part, inst, rstctrl_offs);
return 0;
} |
functions | int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
u16 rstctrl_offs)
{
int c;
u32 mask = 1 << shift;
u16 rstst_offs = rstctrl_offs + OMAP4_RST_CTRL_ST_OFFSET;
/* Check the current status to avoid de-asserting the line twice */
if (omap4_prminst_is_hardreset_asserted(shift, part, inst,
... |
functions | void omap4_prminst_global_warm_sw_reset(void)
{
u32 v;
s16 dev_inst = cpu_is_omap44xx() ? OMAP4430_PRM_DEVICE_INST :
OMAP54XX_PRM_DEVICE_INST;
v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
dev_inst,
OMAP4_PRM_RSTCTRL_OFFSET);
v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
omap4_prminst_w... |
functions | void omap4_prminst_global_cold_sw_reset(void)
{
u32 v;
s16 dev_inst = cpu_is_omap44xx() ? OMAP4430_PRM_DEVICE_INST :
OMAP54XX_PRM_DEVICE_INST;
/* If bootloader/PPA has'nt cleared, ensure it is cleared */
omap4_prminst_write_inst_reg(OMAP4430_GLOBAL_COLD_RST_MASK,
OMAP4430_PRM_PARTITION,
d... |
includes | #include <linux/kernel.h> |
includes | #include <linux/module.h> |
includes | #include <linux/init.h> |
includes | #include <linux/sched.h> |
includes | #include <linux/string.h> |
includes | #include <linux/errno.h> |
includes | #include <linux/proc_fs.h> |
includes | #include <linux/seq_file.h> |
includes | #include <linux/spinlock.h> |
includes |
#include <asm/proc-fns.h> |
includes | #include <asm/ptrace.h> |
includes | #include <asm/mach/time.h> |
includes |
#include <mach/cputype.h> |
includes | #include <mach/hardware.h> |
includes | #include <mach/dvfm.h> |
includes | #include <mach/mspm_prof.h> |
includes | #include <mach/pxa168_pm.h> |
includes | #include <mach/pxa168_dvfm.h> |
includes | #include <mach/regs-timers.h> |
defines |
#define LOWPOWER_CORE_EXTIDLE_THRE 0 |
defines | #define LOWPOWER_SYS_SLEEP_THRE 1500 |
defines | #define IDLE_STATS_NUM 1000 |
structs | struct idle_stats {
unsigned int index;
unsigned int ticks;
}; |
structs | struct mspm_idle_stats {
struct idle_stats stats[IDLE_STATS_NUM];
unsigned int stats_index;
spinlock_t lock;
}; |
functions | void mspm_cpu_idle(void)
{
struct op_info *info = NULL;
int op;
op = dvfm_get_op(&info);
mspm_add_event(op, CPU_STATE_RUN);
cpu_do_idle();
mspm_add_event(op, CPU_STATE_IDLE);
} |
functions | void record_idle_stats(void)
{
int i;
spin_lock(&mspm_stats.lock);
if (++mspm_stats.stats_index == IDLE_STATS_NUM)
mspm_stats.stats_index = 0;
i = mspm_stats.stats_index;
memset(&mspm_stats.stats[i], 0, sizeof(struct idle_stats));
mspm_stats.stats[i].index = i;
mspm_stats.stats[i].ticks = read_timer();
spin_... |
functions | void update_idle_stats(void)
{
int i;
spin_lock(&mspm_stats.lock);
i = mspm_stats.stats_index;
mspm_stats.stats[i].ticks = read_timer()
- mspm_stats.stats[i].ticks;
spin_unlock(&mspm_stats.lock);
} |
functions | void set_idle_op(int idx, int mode)
{
switch (mode) {
case POWER_MODE_CORE_EXTIDLE:
core_extidle_opidx = idx;
break;
case POWER_MODE_SYS_SLEEP:
sys_sleep_opidx = idx;
break;
} |
functions | int lpidle_is_valid(int enable, unsigned int msec,
struct dvfm_freqs *freqs, int lp_idle)
{
struct op_info *info = NULL;
struct pxa168_md_opt *op;
int prev_op;
int ret;
int threshold = 0;
if ((freqs == NULL)
|| (lp_idle == IDLE_CORE_EXTIDLE && core_extidle_opidx == -1)
|| (lp_idle == IDLE_SYS_SLEEP && sys_... |
functions | int get_remain_slice(void)
{
uint32_t val1 = 0;
uint32_t val2 = 0;
val1 = __raw_readl(TIMERS1_VIRT_BASE + TMR_TN_MM(0, 0));
val2 = read_timer();
return (val1-val2)/3250;
} |
functions | void mspm_do_idle(void)
{
struct dvfm_freqs freqs;
int ret = -EINVAL;
unsigned int msec;
#ifdef CONFIG_MSPM_PXA168_STATS
struct op_info *info = NULL;
int op;
#endif
local_irq_disable();
if (!need_resched()) {
msec = get_remain_slice();
record_idle_stats();
if (cpu_is_pxa168_A0() == 0) {
if (lpidle_is_v... |
functions | int stats_show(struct seq_file *s, void *v)
{
struct idle_stats *p = NULL;
int i, ui;
unsigned long flags;
spin_lock_irqsave(&mspm_stats.lock, flags);
ui = mspm_stats.stats_index;
for (i = 0; i < IDLE_STATS_NUM; i++) {
p = &mspm_stats.stats[ui++];
seq_printf(s, "index:%u idle_ticks:%u\n",
p->index, p->ti... |
functions | int stats_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, &stats_show, NULL);
} |
functions | int mspm_proc_init(void)
{
entry_dir = proc_mkdir("driver/mspm", NULL);
if (entry_dir == NULL)
return -ENOMEM;
entry_stats = create_proc_entry("stats", 0, entry_dir);
if (entry_stats)
entry_stats->proc_fops = &stats_seq_ops;
return 0;
} |
functions | void mspm_proc_cleanup(void)
{
remove_proc_entry("stats", entry_dir);
remove_proc_entry("driver/mspm", NULL);
} |
functions | void mspm_idle_load(void)
{
if (pm_idle != mspm_do_idle) {
orig_idle = pm_idle;
pm_idle = mspm_do_idle;
} |
functions | void mspm_idle_clean(void)
{
if (pm_idle == mspm_do_idle)
pm_idle = orig_idle;
} |
functions | __init mspm_init(void)
{
/*if (!cpu_is_pxa910())
return -EFAULT;*/
/* Create file in procfs */
if (mspm_proc_init())
return -EFAULT;
mspm_prof_init();
pr_info("Initialize PXA910 MSPM\n");
return 0;
} |
functions | __exit mspm_exit(void)
{
/* Remove procfs */
mspm_proc_cleanup();
mspm_prof_exit();
pr_info("Quit PXA910 MSPM\n");
} |
functions | GType
empathy_log_store_get_type (void)
{
static GType type = 0;
if (type == 0) {
static const GTypeInfo info = {
sizeof (EmpathyLogStoreInterface),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data... |
functions | gboolean
empathy_log_store_exists (EmpathyLogStore *self,
TpAccount *account,
const gchar *chat_id,
gboolean chatroom)
{
if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->exists)
return FALSE;
return EMPATHY_LOG_STORE_GET_INTERFACE (self)... |
functions | gboolean
empathy_log_store_add_message (EmpathyLogStore *self,
const gchar *chat_id,
gboolean chatroom,
EmpathyMessage *message,
GError **error)
{
if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->ad... |
functions | void
empathy_log_store_ack_message (EmpathyLogStore *self,
const gchar *chat_id,
gboolean chatroom,
EmpathyMessage *message)
{
if (!EMPATHY_LOG_STORE_GET_INTERFACE (self)->ack_message)
return;
EMPATHY_LOG_STORE_GET_INT... |
includes |
#include <sys/types.h> |
includes | #include <sys/socket.h> |
includes | #include <sys/uio.h> |
includes | #include <sys/un.h> |
includes | #include <sys/wait.h> |
includes | #include <sys/select.h> |
includes | #include <sys/time.h> |
includes | #include <unistd.h> |
includes | #include <limits.h> |
includes | #include <fcntl.h> |
includes | #include <stdio.h> |
includes | #include <stdlib.h> |
includes | #include <getopt.h> |
includes | #include <stdint.h> |
includes | #include <pwd.h> |
includes | #include <sys/stat.h> |
includes | #include <stdarg.h> |
includes | #include <sys/types.h> |
defines |
#define PARG(arg) \ |
functions | int fork_zero_fucks() {
int pid = fork();
if (pid) {
int status;
waitpid(pid, &status, 0);
return pid;
} |
functions | int from_init(struct su_initiator *from) {
char path[PATH_MAX], exe[PATH_MAX];
char args[4096], *argv0, *argv_rest;
int fd;
ssize_t len;
int i;
int err;
from->uid = getuid();
from->pid = getppid();
if (is_daemon) {
from->uid = daemon_from_uid;
from->pid = daemon_fro... |
functions | void populate_environment(const struct su_context *ctx) {
struct passwd *pw;
if (ctx->to.keepenv)
return;
pw = getpwuid(ctx->to.uid);
if (pw) {
setenv("HOME", pw->pw_dir, 1);
if (ctx->to.shell)
setenv("SHELL", ctx->to.shell, 1);
else
setenv("SHEL... |
functions | void set_identity(unsigned int uid) {
/*
* Set effective uid back to root, otherwise setres[ug]id will fail
* if uid isn't root.
*/
if (seteuid(0)) {
PLOGE("seteuid (root)");
exit(EXIT_FAILURE);
} |
functions | void usage(int status) {
FILE *stream = (status == EXIT_SUCCESS) ? stdout : stderr;
fprintf(stream,
"Usage: su [options] [--] [-] [LOGIN] [--] [args...]\n\n"
"Options:\n"
" --daemon start the su daemon agent\n"
" -c, --command COMMAND pass COMMAND to the invoked s... |
functions | void deny(struct su_context *ctx) {
char *cmd = get_command(&ctx->to);
ALOGW("request rejected (%u->%u %s)", ctx->from.uid, ctx->to.uid, cmd);
fprintf(stderr, "%s\n", strerror(EACCES));
exit(EXIT_FAILURE);
} |
functions | void allow(struct su_context *ctx, const char *packageName) {
char *arg0;
int argc, err;
umask(ctx->umask);
char *binary;
argc = ctx->to.optind;
if (ctx->to.command) {
binary = ctx->to.shell;
ctx->to.argv[--argc] = ctx->to.command;
ctx->to.argv[--argc] = "-c";
} |
functions | else if (ctx->to.shell) {
binary = ctx->to.shell;
} |
functions | int get_api_version() {
char sdk_ver[PROPERTY_VALUE_MAX];
char *data = read_file("/system/build.prop");
get_property(data, sdk_ver, "ro.build.version.sdk", "0");
int ver = atoi(sdk_ver);
free(data);
return ver;
} |
functions | void fork_for_samsung(void) {
// Samsung CONFIG_SEC_RESTRICT_SETUID wants the parent process to have
// EUID 0, or else our setresuid() calls will be denied. So make sure
// all such syscalls are executed by a child process.
int rv;
switch (fork()) {
case 0:
return;
case -1:
... |
functions | int setxxid() {
setgid(0);
setuid(0);
setregid(0, 0);
setgroups(0, 0);
seteuid(0);
setegid(0);
setreuid(0, 0);
return 0;
} |
functions | int su_main(int argc, char *argv[], int need_client) {
// start up in daemon mode if prompted
if (argc == 2) {
setxxid();
if (strcmp(argv[1], "--daemon") == 0) {
return run_daemon();
} |
functions | otherwise
if (ctx.from.uid == AID_ROOT) {
ALOGD("Allowing root/system/radio.");
allow(&ctx, NULL);
} |
functions | point
if (ctx.from.uid == AID_SHELL) {
ALOGD("Allowing shell.");
allow(&ctx, NULL);
} |
main | int main(int argc, char *argv[]) {
return su_main(argc, argv, 1);
} |
includes |
#include <linux/clk.h> |
includes | #include <linux/completion.h> |
includes | #include <linux/delay.h> |
includes | #include <linux/err.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/io.h> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.