blob: 63da0ccbe1fefe1021827cd7b65c01024e45f88c [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef __ASM_X86_MSR_H_
20#define __ASM_X86_MSR_H_
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <asm/msr-index.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080022#ifndef __ASSEMBLY__
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#include <linux/types.h>
25#endif
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080026#ifdef __i386__
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027#else
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#ifndef __ASSEMBLY__
30#include <linux/errno.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031#define rdmsr(msr,val1,val2) __asm__ __volatile__("rdmsr" : "=a" (val1), "=d" (val2) : "c" (msr))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032#define rdmsrl(msr,val) do { unsigned long a__,b__; __asm__ __volatile__("rdmsr" : "=a" (a__), "=d" (b__) : "c" (msr)); val = a__ | (b__<<32); } while(0)
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#define wrmsr(msr,val1,val2) __asm__ __volatile__("wrmsr" : : "c" (msr), "a" (val1), "d" (val2))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035#define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036#define rdtsc(low,high) __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037#define rdtscl(low) __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define rdtscp(low,high,aux) __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#define rdtscll(val) do { unsigned int __a,__d; __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); } while(0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041#define rdtscpll(val, aux) do { unsigned long __a, __d; __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); (val) = (__d << 32) | __a; } while (0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
Ben Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#define write_rdtscp_aux(val) wrmsr(0xc0000103, val, 0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045#define rdpmc(counter,low,high) __asm__ __volatile__("rdpmc" : "=a" (low), "=d" (high) : "c" (counter))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080046#endif
47#endif
Ben Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#endif