File Index
Files and directories
Sign in
FILE

msr.h

File preview with syntax highlighting.

linux-6.19.14/arch/x86/include/asm/shared/msr.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ASM_X86_SHARED_MSR_H
 3#define _ASM_X86_SHARED_MSR_H
 4
 5struct msr {
 6	union {
 7		struct {
 8			u32 l;
 9			u32 h;
10		};
11		u64 q;
12	};
13};
14
15/*
16 * The kernel proper already defines rdmsr()/wrmsr(), but they are not for the
17 * boot kernel since they rely on tracepoint/exception handling infrastructure
18 * that's not available here.
19 */
20static inline void raw_rdmsr(unsigned int reg, struct msr *m)
21{
22	asm volatile("rdmsr" : "=a" (m->l), "=d" (m->h) : "c" (reg));
23}
24
25static inline void raw_wrmsr(unsigned int reg, const struct msr *m)
26{
27	asm volatile("wrmsr" : : "c" (reg), "a"(m->l), "d" (m->h) : "memory");
28}
29
30#endif /* _ASM_X86_SHARED_MSR_H */
~/ Read-only file preview.