Re: Access MSR functions in userspace?

From: H. Peter Anvin
Date: Wed Feb 06 2008 - 20:09:35 EST


Hasan Rashid wrote:
I am using kernel 2.4.32. Inside msr.c it is trying to register cpu/msr as
shown here.

int __init msr_init(void)
{
if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
printk(KERN_ERR "msr: unable to get major %d for msr\n",
MSR_MAJOR);
return -EBUSY;
}
return 0;
}

I did use the MAKEDEV script with the tools but since the msr module isn't
trying to register at any of those locations, they don't work.

Nonsense. All that matters is major:minor.

There is only one processor on my board, I am going to register device under
cpu/0/msr and see if that solves the issue.

It's irrelevant where it "registers" (on your kernel it only affects /proc/devices, nothing else, unless you're using devfs, in which case, well, don't.) The MAKEDEV script with the tools creates the appropriate device entries.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/