Manpage for read_msr and write_msr libx86info.so library functions From: Thomas Renninger Index: x86info-1.24/x86info.3 =================================================================== --- /dev/null +++ x86info-1.24/x86info.3 @@ -0,0 +1,75 @@ +.\" Copyright 2009 Thomas Renninger, SuSE Products GmbH, Novell +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one. +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.\" The numa.3 manpage from Andi Kleen has been used as a template for +.\" this manpage. +.TH X86INFO 3 "April 2009" "Linux" "Linux Programmer's Manual" +.SH NAME +x86info \- X86 processor information library +.SH SYNOPSIS +.B #include +.sp +.B cc ... -lx86info +.sp +.B int read_msr(int cpu, unsigned int index, unsigned long long *value) +.sp +.B int write_msr(int cpu, unsigned int index, unsigned long long value) +.SH DESCRIPTION +.B libx86info +Offers a simple programming interface to read out from and modify system +information on x86 processors. +Currently only reading and writing to a CPU's MSRs (Machine Specific Register) +is supported via the library. + +.B read_msr() +reads the MSR address +.I index +from the CPU core +.I cpu +and stores the result in +.I value. +On success zero is returned, -1 if an error occured. + +.B write_msr() +writes +.I value +to the MSR address +.I index +on CPU core +.I cpu. +On success zero is returned, -1 if an error occured. + +.SH NOTES +To be able to read or write MSRs you have to +have the msr kernel driver loaded and the appropriate devices +under /dev/cpu/X/msr created. + +.SH ERRORS +If +.B read_msr +or +.B write_msr +does not succeed, -1 is returned and errno is set by the underlying file +accessing calls. Also look at +.B open(2) +what errors you generally could expect. + +.SH SEE ALSO +.I x86info(1) +.I lsmsr(8)