type
stringclasses
5 values
content
stringlengths
9
163k
functions
void note_interrupt(int irq, irq_desc_t *desc, irqreturn_t action_ret) { if (action_ret != IRQ_HANDLED) { desc->irqs_unhandled++; if (action_ret != IRQ_NONE) report_bad_irq(irq, desc, action_ret); }
functions
void disable_irq_nosync(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; unsigned long flags; spin_lock_irqsave(&desc->lock, flags); if (!desc->depth++) { desc->status |= IRQ_DISABLED; desc->handler->disable(irq); }
functions
void disable_irq(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; disable_irq_nosync(irq); if (desc->action) synchronize_irq(irq); }
functions
void enable_irq(unsigned int irq) { irq_desc_t *desc = irq_desc + irq; unsigned long flags; spin_lock_irqsave(&desc->lock, flags); switch (desc->depth) { case 1: { unsigned int status = desc->status & ~(IRQ_DISABLED | IRQ_INPROGRESS); desc->status = status; if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_P...
functions
int do_IRQ(unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs regs) { /* * We ack quickly, we don't want the irq controller * thinking we're snobs just because some other CPU has * disabled global interrupts (we have already done the * INT_ACK cycles, it's ...
functions
void free_irq(unsigned int irq, void *dev_id) { irq_desc_t *desc; struct irqaction **p; unsigned long flags; if (irq >= ACTUAL_NR_IRQS) return; desc = irq_desc + irq; spin_lock_irqsave(&desc->lock,flags); p = &desc->action; for (;;) { struct irqaction * action = *p; if (action) { struct irqaction **p...
functions
long probe_irq_on(void) { unsigned int i; irq_desc_t *desc; unsigned long val; unsigned long delay; down(&probe_sem); /* * something may have generated an irq long ago and we want to * flush such a longstanding irq before considering it as spurious. */ for (i = NR_IRQS-1; i > 0; i--) { desc = irq_desc...
functions
int probe_irq_mask(unsigned long val) { int i; unsigned int mask; mask = 0; for (i = 0; i < NR_IRQS; i++) { irq_desc_t *desc = irq_desc + i; unsigned int status; spin_lock_irq(&desc->lock); status = desc->status; if (status & IRQ_AUTODETECT) { if (i < 16 && !(status & IRQ_WAITING)) mask |= 1 << ...
functions
int probe_irq_off(unsigned long val) { int i, irq_found, nr_irqs; nr_irqs = 0; irq_found = 0; for (i=0; i<NR_IRQS; i++) { irq_desc_t *desc = irq_desc + i; unsigned int status; spin_lock_irq(&desc->lock); status = desc->status; if (status & IRQ_AUTODETECT) { if (!(status & IRQ_WAITING)) { if (!nr...
functions
int setup_irq(unsigned int irq, struct irqaction * new) { int shared = 0; struct irqaction *old, **p; unsigned long flags; irq_desc_t *desc = irq_desc + irq; if (desc->handler == &no_irq_type) return -ENOSYS; /* * Some drivers like serial.c use request_irq() heavily, * so we have to be careful not to inte...
functions
void init_irq_proc(void) { }
functions
void synchronize_irq(unsigned int irq) { /* is there anything to synchronize with? */ if (!irq_desc[irq].action) return; while (irq_desc[irq].status & IRQ_INPROGRESS) barrier(); }
includes
#include <uapi/linux/time.h>
includes
#include <asm/vgtod.h>
includes
#include <asm/hpet.h>
includes
#include <asm/vvar.h>
includes
#include <asm/unistd.h>
includes
#include <asm/msr.h>
includes
#include <asm/pvclock.h>
includes
#include <linux/math64.h>
includes
#include <linux/time.h>
includes
#include <linux/kernel.h>
defines
#define gtod (&VVAR(vsyscall_gtod_data))
functions
cycle_t vread_hpet(void) { return *(const volatile u32 *)(&hpet_page + HPET_COUNTER); }
functions
long vdso_fallback_gettime(long clock, struct timespec *ts) { long ret; asm("syscall" : "=a" (ret) : "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory"); return ret; }
functions
long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) { long ret; asm("syscall" : "=a" (ret) : "0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory"); return ret; }
functions
long vdso_fallback_gettime(long clock, struct timespec *ts) { long ret; asm( "mov %%ebx, %%edx \n" "mov %2, %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" : "=a" (ret) : "0" (__NR_clock_gettime), "g" (clock), "c" (ts) : "memory", "edx"); return ret; }
functions
long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) { long ret; asm( "mov %%ebx, %%edx \n" "mov %2, %%ebx \n" "call __kernel_vsyscall \n" "mov %%edx, %%ebx \n" : "=a" (ret) : "0" (__NR_gettimeofday), "g" (tv), "c" (tz) : "memory", "edx"); return ret; }
functions
cycle_t vread_pvclock(int *mode) { const struct pvclock_vcpu_time_info *pvti = &get_pvti0()->pvti; cycle_t ret; u64 tsc, pvti_tsc; u64 last, delta, pvti_system_time; u32 version, pvti_tsc_to_system_mul, pvti_tsc_shift; /* * Note: The kernel and hypervisor must guarantee that cpu ID * number maps 1:1 to per-C...
functions
cycle_t vread_tsc(void) { cycle_t ret = (cycle_t)rdtsc_ordered(); u64 last = gtod->cycle_last; if (likely(ret >= last)) return ret; /* * GCC likes to generate cmov here, but this branch is extremely * predictable (it's just a funciton of time and the likely is * very likely) and there's a data dependence,...
functions
u64 vgetsns(int *mode) { u64 v; cycles_t cycles; if (gtod->vclock_mode == VCLOCK_TSC) cycles = vread_tsc(); #ifdef CONFIG_HPET_TIMER else if (gtod->vclock_mode == VCLOCK_HPET) cycles = vread_hpet(); #endif #ifdef CONFIG_PARAVIRT_CLOCK else if (gtod->vclock_mode == VCLOCK_PVCLOCK) cycles = vread_pvclock(mode...
functions
__always_inline do_realtime(struct timespec *ts) { unsigned long seq; u64 ns; int mode; do { seq = gtod_read_begin(gtod); mode = gtod->vclock_mode; ts->tv_sec = gtod->wall_time_sec; ns = gtod->wall_time_snsec; ns += vgetsns(&mode); ns >>= gtod->shift; }
functions
__always_inline do_monotonic(struct timespec *ts) { unsigned long seq; u64 ns; int mode; do { seq = gtod_read_begin(gtod); mode = gtod->vclock_mode; ts->tv_sec = gtod->monotonic_time_sec; ns = gtod->monotonic_time_snsec; ns += vgetsns(&mode); ns >>= gtod->shift; }
functions
void do_realtime_coarse(struct timespec *ts) { unsigned long seq; do { seq = gtod_read_begin(gtod); ts->tv_sec = gtod->wall_time_coarse_sec; ts->tv_nsec = gtod->wall_time_coarse_nsec; }
functions
void do_monotonic_coarse(struct timespec *ts) { unsigned long seq; do { seq = gtod_read_begin(gtod); ts->tv_sec = gtod->monotonic_time_coarse_sec; ts->tv_nsec = gtod->monotonic_time_coarse_nsec; }
functions
int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) { switch (clock) { case CLOCK_REALTIME: if (do_realtime(ts) == VCLOCK_NONE) goto fallback; break; case CLOCK_MONOTONIC: if (do_monotonic(ts) == VCLOCK_NONE) goto fallback; break; case CLOCK_REALTIME_COARSE: do_realtime_coarse(ts); brea...
functions
int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) { if (likely(tv != NULL)) { if (unlikely(do_realtime((struct timespec *)tv) == VCLOCK_NONE)) return vdso_fallback_gtod(tv, tz); tv->tv_usec /= 1000; }
functions
time_t __vdso_time(time_t *t) { /* This is atomic on x86 so we don't need any locks. */ time_t result = ACCESS_ONCE(gtod->wall_time_sec); if (t) *t = result; return result; }
includes
#include <linux/kernel.h>
includes
#include <linux/init.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/delay.h>
includes
#include <linux/err.h>
includes
#include <asm/mach-types.h>
includes
#include <asm/gpio.h>
includes
#include <asm/io.h>
includes
#include <linux/skbuff.h>
includes
#include <linux/gpio.h>
includes
#include <linux/module.h>
includes
#include <linux/vmalloc.h>
includes
#include <linux/slab.h>
defines
#define ATH6KL_BOARD_DATA_FILE_SIZE (4 * 1024)
defines
#define ATH6K_FW_FILE_SIZE (124 * 1024)
defines
#define ATH6K_TEST_FW_FILE_SIZE (48 * 1024)
defines
#define ATH6K_FW_NUM 3
structs
struct ath6kl_prealloc_mem_struct { void *mem_ptr; unsigned long size; };
functions
int ath6kl_prealloc_mem(void) { int i; printk("%s\n",__func__); for(i = 0 ; i < ATH6K_FW_NUM; i++) { ath6kl_fw_buf[i].mem_ptr = kmalloc(ath6kl_fw_buf[i].size, GFP_KERNEL); if (ath6kl_fw_buf[i].mem_ptr == NULL) return -ENOMEM; }
functions
void config_gpio_table(uint32_t *table, int len) { int n, rc; for (n = 0; n < len; n++) { rc = gpio_tlmm_config(table[n], GPIO_CFG_ENABLE); if (rc) { pr_err("[WLAN] %s: gpio_tlmm_config(%#x)=%d\n", __func__, table[n], rc); break; }
functions
int atheros_wifi_power(bool on) { int ret = 0; printk(KERN_INFO "[WLAN] %s: %d\n", __func__, on); if (on) { config_gpio_table(wifi_on_gpio_table, ARRAY_SIZE(wifi_on_gpio_table)); mdelay(200); ret = cpld_gpio_write(CPLD_EXT_GPIO_WIFI_SHUTDOWN, 1); if (ret < 0) printk(KERN_INFO "[WLAN] %s write error CP...
functions
__init cp3_wifi_init(void) { int ret = 0; printk(KERN_INFO "[WLAN] %s\n", __func__); ath6kl_prealloc_mem(); config_gpio_table(wifi_off_gpio_table, ARRAY_SIZE(wifi_off_gpio_table)); #ifdef ATH_OOB_IRQ ret= gpio_request(GPIO_WIFI_IRQ, "WLAN_IRQ"); if (ret) { printk(KERN_INFO "[WLAN] %s: gpio_request is failed...
includes
#include <config.h>
defines
#define HIETH_SFV300
functions
int hieth_glb_preinit_dummy(struct hieth_netdev_local *ld) { local_lock_init(ld); /* FIXME: hieth_glb_preinit_dummy * HW MAX DEFAULT RX-PKT-LEN [42,1518] * HW MAC FILTER TABLE DISABLE */ /*soft reset*/ hieth_writel_bits(ld, 1, GLB_SOFT_RESET, BITS_ETH_SOFT_RESET); udelay(1000); hieth_writel_bits(ld, 0, GLB_...
includes
#include <linux/module.h>
includes
#include <linux/types.h>
includes
#include <linux/mm.h>
includes
#include <linux/fcntl.h>
includes
#include <linux/socket.h>
includes
#include <linux/in.h>
includes
#include <linux/inet.h>
includes
#include <linux/netdevice.h>
includes
#include <linux/if_packet.h>
includes
#include <linux/gfp.h>
includes
#include <net/ip.h>
includes
#include <net/protocol.h>
includes
#include <net/netlink.h>
includes
#include <linux/skbuff.h>
includes
#include <net/sock.h>
includes
#include <linux/errno.h>
includes
#include <linux/timer.h>
includes
#include <asm/uaccess.h>
includes
#include <asm/unaligned.h>
includes
#include <linux/filter.h>
includes
#include <linux/ratelimit.h>
includes
#include <linux/seccomp.h>
defines
#define K (fentry->k)
defines
#define ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \
functions
int sk_filter(struct sock *sk, struct sk_buff *skb) { int err; struct sk_filter *filter; /* * If the skb was allocated from pfmemalloc reserves, only * allow SOCK_MEMALLOC sockets to use it as this socket is * helping free memory */ if (skb_pfmemalloc(skb) && !sock_flag(sk, SOCK_MEMALLOC)) return -ENOMEM...
functions
int sk_run_filter(const struct sk_buff *skb, const struct sock_filter *fentry) { void *ptr; u32 A = 0; /* Accumulator */ u32 X = 0; /* Index Register */ u32 mem[BPF_MEMWORDS]; /* Scratch Memory Store */ u32 tmp; int k; /* * Process array of filter instructions. */ for (;; fentry++) { #if defined...
functions
int check_load_and_stores(struct sock_filter *filter, int flen) { u16 *masks, memvalid = 0; /* one bit per cell, 16 cells */ int pc, ret = 0; BUILD_BUG_ON(BPF_MEMWORDS > 16); masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL); if (!masks) return -ENOMEM; memset(masks, 0xff, flen * sizeof(*masks)); for (pc = ...
functions
int sk_chk_filter(struct sock_filter *filter, unsigned int flen) { /* * Valid instructions are initialized to non-0. * Invalid instructions are initialized to 0. */ static const u8 codes[] = { [BPF_ALU|BPF_ADD|BPF_K] = BPF_S_ALU_ADD_K, [BPF_ALU|BPF_ADD|BPF_X] = BPF_S_ALU_ADD_X, [BPF_ALU|BPF_SUB|BPF_K] ...
functions
break switch (ftest->k) { ANCILLARY(PROTOCOL); ANCILLARY(PKTTYPE); ANCILLARY(IFINDEX); ANCILLARY(NLATTR); ANCILLARY(NLATTR_NEST); ANCILLARY(MARK); ANCILLARY(QUEUE); ANCILLARY(HATYPE); ANCILLARY(RXHASH); ANCILLARY(CPU); ANCILLARY(ALU_XOR_X); }
functions
void sk_filter_release_rcu(struct rcu_head *rcu) { struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); bpf_jit_free(fp); }
functions
int __sk_prepare_filter(struct sk_filter *fp) { int err; fp->bpf_func = sk_run_filter; err = sk_chk_filter(fp->insns, fp->len); if (err) return err; bpf_jit_compile(fp); return 0; }
functions
int sk_unattached_filter_create(struct sk_filter **pfp, struct sock_fprog *fprog) { struct sk_filter *fp; unsigned int fsize = sizeof(struct sock_filter) * fprog->len; int err; /* Make sure new filter is there and in the right amounts. */ if (fprog->filter == NULL) return -EINVAL; fp = kmalloc(fsize + siz...
functions
void sk_unattached_filter_destroy(struct sk_filter *fp) { sk_filter_release(fp); }
functions
int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) { struct sk_filter *fp, *old_fp; unsigned int fsize = sizeof(struct sock_filter) * fprog->len; unsigned int sk_fsize = sk_filter_size(fprog->len); int err; /* Make sure new filter is there and in the right amounts. */ if (fprog->filter == NULL) re...
functions
int sk_detach_filter(struct sock *sk) { int ret = -ENOENT; struct sk_filter *filter; filter = rcu_dereference_protected(sk->sk_filter, sock_owned_by_user(sk)); if (filter) { RCU_INIT_POINTER(sk->sk_filter, NULL); sk_filter_uncharge(sk, filter); ret = 0; }
includes
#include <linux/compat.h>
includes
#include <linux/netdevice.h>