PageRenderTime 20ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/x86/lib/msr.c

https://bitbucket.org/thekraven/iscream_thunderc-2.6.35
C | 23 lines | 19 code | 4 blank | 0 comment | 1 complexity | a58b5237c57607d13f231de9320c6b82 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
 1#include <linux/module.h>
 2#include <linux/preempt.h>
 3#include <asm/msr.h>
 4
 5struct msr *msrs_alloc(void)
 6{
 7	struct msr *msrs = NULL;
 8
 9	msrs = alloc_percpu(struct msr);
10	if (!msrs) {
11		pr_warning("%s: error allocating msrs\n", __func__);
12		return NULL;
13	}
14
15	return msrs;
16}
17EXPORT_SYMBOL(msrs_alloc);
18
19void msrs_free(struct msr *msrs)
20{
21	free_percpu(msrs);
22}
23EXPORT_SYMBOL(msrs_free);