https://github.com/torvalds/linux
Raw File
Tip revision: ddf28352b80c86754a6424e3a61e8bdf9213b3c7 authored by Linus Torvalds on 04 September 2011, 22:45:10 UTC
Linux 3.1-rc5
Tip revision: ddf2835
msr.c
#include <linux/module.h>
#include <linux/preempt.h>
#include <asm/msr.h>

struct msr *msrs_alloc(void)
{
	struct msr *msrs = NULL;

	msrs = alloc_percpu(struct msr);
	if (!msrs) {
		pr_warning("%s: error allocating msrs\n", __func__);
		return NULL;
	}

	return msrs;
}
EXPORT_SYMBOL(msrs_alloc);

void msrs_free(struct msr *msrs)
{
	free_percpu(msrs);
}
EXPORT_SYMBOL(msrs_free);
back to top