type
stringclasses
5 values
content
stringlengths
9
163k
functions
__init init_amd_microcode(void) { struct cpuinfo_x86 *c = &cpu_data(0); if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { pr_warning("AMD CPU family 0x%x not supported\n", c->x86); return NULL; }
functions
__exit exit_amd_microcode(void) { cleanup(); }
includes
#include <linux/delay.h>
includes
#include <linux/dw_apb_timer.h>
includes
#include <linux/of.h>
includes
#include <linux/of_address.h>
includes
#include <linux/of_irq.h>
includes
#include <linux/clk.h>
includes
#include <linux/sched_clock.h>
functions
__init timer_get_base_and_rate(struct device_node *np, void __iomem **base, u32 *rate) { struct clk *timer_clk; struct clk *pclk; *base = of_iomap(np, 0); if (!*base) panic("Unable to map regs for %s", np->name); /* * Not all implementations use a periphal clock, so don't panic * if it's not prese...
functions
__init add_clockevent(struct device_node *event_timer) { void __iomem *iobase; struct dw_apb_clock_event_device *ced; u32 irq, rate; irq = irq_of_parse_and_map(event_timer, 0); if (irq == 0) panic("No IRQ for clock event timer"); timer_get_base_and_rate(event_timer, &iobase, &rate); ced = dw_apb_clockevent_...
functions
__init add_clocksource(struct device_node *source_timer) { void __iomem *iobase; struct dw_apb_clocksource *cs; u32 rate; timer_get_base_and_rate(source_timer, &iobase, &rate); cs = dw_apb_clocksource_init(300, source_timer->name, iobase, rate); if (!cs) panic("Unable to initialise clocksource device"); dw_...
functions
notrace read_sched_clock(void) { return ~readl_relaxed(sched_io_base); }
functions
__init init_sched_clock(void) { struct device_node *sched_timer; sched_timer = of_find_matching_node(NULL, sptimer_ids); if (sched_timer) { timer_get_base_and_rate(sched_timer, &sched_io_base, &sched_rate); of_node_put(sched_timer); }
functions
long dw_apb_delay_timer_read(void) { return ~readl_relaxed(sched_io_base); }
functions
__init dw_apb_timer_init(struct device_node *timer) { switch (num_called) { case 0: pr_debug("%s: found clockevent timer\n", __func__); add_clockevent(timer); break; case 1: pr_debug("%s: found clocksource timer\n", __func__); add_clocksource(timer); init_sched_clock(); #ifdef CONFIG_ARM dw_apb_delay_t...
includes
#include <fcntl.h>
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <sys/ioctl.h>
defines
#define _GNU_SOURCE /* for program_invocation_short_name */
defines
#define VCPU_ID 0
defines
#define MSR_PLATFORM_INFO_MAX_TURBO_RATIO 0xff00
functions
void guest_code(void) { uint64_t msr_platform_info; for (;;) { msr_platform_info = rdmsr(MSR_PLATFORM_INFO); GUEST_SYNC(msr_platform_info); asm volatile ("inc %r11"); }
functions
void set_msr_platform_info_enabled(struct kvm_vm *vm, bool enable) { struct kvm_enable_cap cap = {}
functions
void test_msr_platform_info_enabled(struct kvm_vm *vm) { struct kvm_run *run = vcpu_state(vm, VCPU_ID); struct ucall uc; set_msr_platform_info_enabled(vm, true); vcpu_run(vm, VCPU_ID); TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, "Exit_reason other than KVM_EXIT_IO: %u (%s),\n", run->exit_reason, exit_re...
functions
void test_msr_platform_info_disabled(struct kvm_vm *vm) { struct kvm_run *run = vcpu_state(vm, VCPU_ID); set_msr_platform_info_enabled(vm, false); vcpu_run(vm, VCPU_ID); TEST_ASSERT(run->exit_reason == KVM_EXIT_SHUTDOWN, "Exit_reason other than KVM_EXIT_SHUTDOWN: %u (%s)\n", run->exit_reason, exit_reason_...
main
int main(int argc, char *argv[]) { struct kvm_vm *vm; int rv; uint64_t msr_platform_info; /* Tell stdout not to buffer its content */ setbuf(stdout, NULL); rv = kvm_check_cap(KVM_CAP_MSR_PLATFORM_INFO); if (!rv) { print_skip("KVM_CAP_MSR_PLATFORM_INFO not supported"); exit(KSFT_SKIP); }
includes
#include <linux/module.h>
includes
#include <linux/moduleparam.h>
includes
#include <linux/init.h>
includes
#include <linux/delay.h>
includes
#include <linux/pm.h>
includes
#include <linux/pm_runtime.h>
includes
#include <linux/regmap.h>
includes
#include <linux/slab.h>
includes
#include <sound/core.h>
includes
#include <sound/pcm.h>
includes
#include <sound/pcm_params.h>
includes
#include <sound/soc.h>
includes
#include <sound/jack.h>
includes
#include <sound/initval.h>
includes
#include <sound/tlv.h>
includes
#include <linux/mfd/arizona/core.h>
includes
#include <linux/mfd/arizona/registers.h>
defines
#define WM8997_NG_SRC(name, base) \
defines
#define ARIZONA_MIXER_INPUT_ROUTES(name) \
defines
#define WM8997_RATES SNDRV_PCM_RATE_8000_192000
defines
#define WM8997_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
defines
#define WM8997_DIG_VU 0x0200
structs
struct wm8997_priv { struct arizona_priv core; struct arizona_fll fll[2]; };
functions
int wm8997_sysclk_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { struct snd_soc_codec *codec = w->codec; struct arizona *arizona = dev_get_drvdata(codec->dev->parent); struct regmap *regmap = arizona->regmap; const struct reg_default *patch = NULL; int i, patch_size; switch ...
functions
int wm8997_set_fll(struct snd_soc_codec *codec, int fll_id, int source, unsigned int Fref, unsigned int Fout) { struct wm8997_priv *wm8997 = snd_soc_codec_get_drvdata(codec); switch (fll_id) { case WM8997_FLL1: return arizona_set_fll(&wm8997->fll[0], source, Fref, Fout); case WM8997_FLL2: return arizona_s...
functions
int wm8997_codec_probe(struct snd_soc_codec *codec) { struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec); arizona_init_spk(codec); snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS"); priv->core.arizona->dapm = &codec->dapm; return 0; }
functions
int wm8997_codec_remove(struct snd_soc_codec *codec) { struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec); priv->core.arizona->dapm = NULL; return 0; }
functions
int wm8997_probe(struct platform_device *pdev) { struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); struct wm8997_priv *wm8997; int i; wm8997 = devm_kzalloc(&pdev->dev, sizeof(struct wm8997_priv), GFP_KERNEL); if (wm8997 == NULL) return -ENOMEM; platform_set_drvdata(pdev, wm8997); wm8997->...
functions
int wm8997_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
includes
#include <linux/kernel.h>
includes
#include <linux/fs.h>
includes
#include <linux/blkdev.h>
includes
#include <linux/elevator.h>
includes
#include <linux/bio.h>
includes
#include <linux/module.h>
includes
#include <linux/slab.h>
includes
#include <linux/init.h>
includes
#include <linux/compiler.h>
includes
#include <linux/delay.h>
includes
#include <linux/blktrace_api.h>
includes
#include <linux/hash.h>
includes
#include <linux/uaccess.h>
includes
#include <trace/events/block.h>
defines
#define ELV_HASH_BLOCK(sec) ((sec) >> 3)
defines
#define ELV_HASH_FN(sec) \
defines
#define ELV_HASH_ENTRIES (1 << elv_hash_shift)
defines
#define rq_hash_key(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq))
defines
#define to_elv(atr) container_of((atr), struct elv_fs_entry, attr)
functions
int elv_iosched_allow_merge(struct request *rq, struct bio *bio) { struct request_queue *q = rq->q; struct elevator_queue *e = q->elevator; if (e->ops->elevator_allow_merge_fn) return e->ops->elevator_allow_merge_fn(q, rq, bio); return 1; }
functions
int elv_rq_merge_ok(struct request *rq, struct bio *bio) { if (!rq_mergeable(rq)) return 0; /* * Don't merge file system requests and discard requests */ if ((bio->bi_rw & REQ_DISCARD) != (rq->bio->bi_rw & REQ_DISCARD)) return 0; /* * Don't merge discard requests and secure discard requests */ if ((b...
functions
int elv_try_merge(struct request *__rq, struct bio *bio) { int ret = ELEVATOR_NO_MERGE; /* * we can merge and sequence is ok, check if it's possible */ if (elv_rq_merge_ok(__rq, bio)) { if (blk_rq_pos(__rq) + blk_rq_sectors(__rq) == bio->bi_sector) ret = ELEVATOR_BACK_MERGE; else if (blk_rq_pos(__rq) - b...
functions
void elevator_put(struct elevator_type *e) { module_put(e->elevator_owner); }
functions
void elevator_attach(struct request_queue *q, struct elevator_queue *eq, void *data) { q->elevator = eq; eq->elevator_data = data; }
functions
__init elevator_setup(char *str) { /* * Be backwards-compatible with previous kernels, so users * won't get the wrong elevator. */ strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1); return 1; }
functions
void elevator_release(struct kobject *kobj) { struct elevator_queue *e; e = container_of(kobj, struct elevator_queue, kobj); elevator_put(e->elevator_type); kfree(e->hash); kfree(e); }
functions
int elevator_init(struct request_queue *q, char *name) { struct elevator_type *e = NULL; struct elevator_queue *eq; void *data; if (unlikely(q->elevator)) return 0; INIT_LIST_HEAD(&q->queue_head); q->last_merge = NULL; q->end_sector = 0; q->boundary_rq = NULL; if (name) { e = elevator_get(name); if (!...
functions
void elevator_exit(struct elevator_queue *e) { mutex_lock(&e->sysfs_lock); if (e->ops->elevator_exit_fn) e->ops->elevator_exit_fn(e); e->ops = NULL; mutex_unlock(&e->sysfs_lock); kobject_put(&e->kobj); }
functions
void __elv_rqhash_del(struct request *rq) { hlist_del_init(&rq->hash); }
functions
void elv_rqhash_del(struct request_queue *q, struct request *rq) { if (ELV_ON_HASH(rq)) __elv_rqhash_del(rq); }
functions
void elv_rqhash_add(struct request_queue *q, struct request *rq) { struct elevator_queue *e = q->elevator; BUG_ON(ELV_ON_HASH(rq)); hlist_add_head(&rq->hash, &e->hash[ELV_HASH_FN(rq_hash_key(rq))]); }
functions
void elv_rqhash_reposition(struct request_queue *q, struct request *rq) { __elv_rqhash_del(rq); elv_rqhash_add(q, rq); }
functions
void elv_rb_del(struct rb_root *root, struct request *rq) { BUG_ON(RB_EMPTY_NODE(&rq->rb_node)); rb_erase(&rq->rb_node, root); RB_CLEAR_NODE(&rq->rb_node); }
functions
void elv_dispatch_sort(struct request_queue *q, struct request *rq) { sector_t boundary; struct list_head *entry; int stop_flags; if (q->last_merge == rq) q->last_merge = NULL; elv_rqhash_del(q, rq); q->nr_sorted--; boundary = q->end_sector; stop_flags = REQ_SOFTBARRIER | REQ_STARTED; list_for_each_prev(...
functions
void elv_dispatch_add_tail(struct request_queue *q, struct request *rq) { if (q->last_merge == rq) q->last_merge = NULL; elv_rqhash_del(q, rq); q->nr_sorted--; q->end_sector = rq_end_sector(rq); q->boundary_rq = rq; list_add_tail(&rq->queuelist, &q->queue_head); }
functions
int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) { struct elevator_queue *e = q->elevator; struct request *__rq; int ret; /* * Levels of merges: * nomerges: No merges at all attempted * noxmerges: Only simple one-hit cache try * merges: All merge tries attempted */ if...
functions
bool elv_attempt_insert_merge(struct request_queue *q, struct request *rq) { struct request *__rq; if (blk_queue_nomerges(q)) return false; /* * First try one-hit cache. */ if (q->last_merge && blk_attempt_req_merge(q, q->last_merge, rq)) return true; if (blk_queue_noxmerges(q)) return false;...
functions
void elv_merged_request(struct request_queue *q, struct request *rq, int type) { struct elevator_queue *e = q->elevator; if (e->ops->elevator_merged_fn) e->ops->elevator_merged_fn(q, rq, type); if (type == ELEVATOR_BACK_MERGE) elv_rqhash_reposition(q, rq); q->last_merge = rq; }
functions
void elv_merge_requests(struct request_queue *q, struct request *rq, struct request *next) { struct elevator_queue *e = q->elevator; const int next_sorted = next->cmd_flags & REQ_SORTED; if (next_sorted && e->ops->elevator_merge_req_fn) e->ops->elevator_merge_req_fn(q, rq, next); elv_rqhash_reposition(q...
functions
void elv_bio_merged(struct request_queue *q, struct request *rq, struct bio *bio) { struct elevator_queue *e = q->elevator; if (e->ops->elevator_bio_merged_fn) e->ops->elevator_bio_merged_fn(q, rq, bio); }
functions
void elv_requeue_request(struct request_queue *q, struct request *rq) { /* * it already went through dequeue, we need to decrement the * in_flight count again */ if (blk_account_rq(rq)) { q->in_flight[rq_is_sync(rq)]--; if (rq->cmd_flags & REQ_SORTED) elv_deactivate_rq(q, rq); }
functions
void elv_drain_elevator(struct request_queue *q) { static int printed; while (q->elevator->ops->elevator_dispatch_fn(q, 1)) ; if (q->nr_sorted == 0) return; if (printed++ < 10) { printk(KERN_ERR "%s: forced dispatching is broken " "(nr_sorted=%u), please report this\n", q->elevator->elevator...