linux/arch/x86/lib/msr.c

// SPDX-License-Identifier: GPL-2.0
#include <linux/export.h>
#include <linux/percpu.h>
#include <linux/preempt.h>
#include <asm/msr.h>
#define CREATE_TRACE_POINTS
#include <asm/msr-trace.h>

struct msr __percpu *msrs_alloc(void)
{}
EXPORT_SYMBOL();

void msrs_free(struct msr __percpu *msrs)
{}
EXPORT_SYMBOL();

/**
 * msr_read - Read an MSR with error handling
 * @msr: MSR to read
 * @m: value to read into
 *
 * It returns read data only on success, otherwise it doesn't change the output
 * argument @m.
 *
 * Return: %0 for success, otherwise an error code
 */
static int msr_read(u32 msr, struct msr *m)
{}

/**
 * msr_write - Write an MSR with error handling
 *
 * @msr: MSR to write
 * @m: value to write
 *
 * Return: %0 for success, otherwise an error code
 */
static int msr_write(u32 msr, struct msr *m)
{}

static inline int __flip_bit(u32 msr, u8 bit, bool set)
{}

/**
 * msr_set_bit - Set @bit in a MSR @msr.
 * @msr: MSR to write
 * @bit: bit number to set
 *
 * Return:
 * * < 0: An error was encountered.
 * * = 0: Bit was already set.
 * * > 0: Hardware accepted the MSR write.
 */
int msr_set_bit(u32 msr, u8 bit)
{}

/**
 * msr_clear_bit - Clear @bit in a MSR @msr.
 * @msr: MSR to write
 * @bit: bit number to clear
 *
 * Return:
 * * < 0: An error was encountered.
 * * = 0: Bit was already cleared.
 * * > 0: Hardware accepted the MSR write.
 */
int msr_clear_bit(u32 msr, u8 bit)
{}

#ifdef CONFIG_TRACEPOINTS
void do_trace_write_msr(unsigned int msr, u64 val, int failed)
{}
EXPORT_SYMBOL();
EXPORT_TRACEPOINT_SYMBOL();

void do_trace_read_msr(unsigned int msr, u64 val, int failed)
{}
EXPORT_SYMBOL();
EXPORT_TRACEPOINT_SYMBOL();

void do_trace_rdpmc(unsigned counter, u64 val, int failed)
{}
EXPORT_SYMBOL();
EXPORT_TRACEPOINT_SYMBOL();

#endif