#define pr_fmt(fmt) …
#include <asm/amd_hsmp.h>
#include <asm/amd_nb.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/semaphore.h>
#include <linux/acpi.h>
#define DRIVER_NAME …
#define DRIVER_VERSION …
#define ACPI_HSMP_DEVICE_HID …
#define HSMP_STATUS_NOT_READY …
#define HSMP_STATUS_OK …
#define HSMP_ERR_INVALID_MSG …
#define HSMP_ERR_INVALID_INPUT …
#define HSMP_MSG_TIMEOUT …
#define HSMP_SHORT_SLEEP …
#define HSMP_WR …
#define HSMP_RD …
#define SMN_HSMP_BASE …
#define SMN_HSMP_MSG_ID …
#define SMN_HSMP_MSG_ID_F1A_M0H …
#define SMN_HSMP_MSG_RESP …
#define SMN_HSMP_MSG_DATA …
#define HSMP_INDEX_REG …
#define HSMP_DATA_REG …
#define HSMP_CDEV_NAME …
#define HSMP_DEVNODE_NAME …
#define HSMP_METRICS_TABLE_NAME …
#define HSMP_ATTR_GRP_NAME_SIZE …
#define MSG_IDOFF_STR …
#define MSG_ARGOFF_STR …
#define MSG_RESPOFF_STR …
#define MAX_AMD_SOCKETS …
struct hsmp_mbaddr_info { … };
struct hsmp_socket { … };
struct hsmp_plat_device { … };
static struct hsmp_plat_device plat_dev;
static int amd_hsmp_pci_rdwr(struct hsmp_socket *sock, u32 offset,
u32 *value, bool write)
{ … }
static void amd_hsmp_acpi_rdwr(struct hsmp_socket *sock, u32 offset,
u32 *value, bool write)
{ … }
static int amd_hsmp_rdwr(struct hsmp_socket *sock, u32 offset,
u32 *value, bool write)
{ … }
static int __hsmp_send_message(struct hsmp_socket *sock, struct hsmp_message *msg)
{ … }
static int validate_message(struct hsmp_message *msg)
{ … }
int hsmp_send_message(struct hsmp_message *msg)
{ … }
EXPORT_SYMBOL_GPL(…);
static int hsmp_test(u16 sock_ind, u32 value)
{ … }
static long hsmp_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
{ … }
static const struct file_operations hsmp_fops = …;
static const guid_t acpi_hsmp_uuid = …;
static inline bool is_acpi_hsmp_uuid(union acpi_object *obj)
{ … }
static inline int hsmp_get_uid(struct device *dev, u16 *sock_ind)
{ … }
static acpi_status hsmp_resource(struct acpi_resource *res, void *data)
{ … }
static int hsmp_read_acpi_dsd(struct hsmp_socket *sock)
{ … }
static int hsmp_read_acpi_crs(struct hsmp_socket *sock)
{ … }
static int hsmp_parse_acpi_table(struct device *dev, u16 sock_ind)
{ … }
static ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count)
{ … }
static int hsmp_get_tbl_dram_base(u16 sock_ind)
{ … }
static umode_t hsmp_is_sock_attr_visible(struct kobject *kobj,
struct bin_attribute *battr, int id)
{ … }
static int hsmp_init_metric_tbl_bin_attr(struct bin_attribute **hattrs, u16 sock_ind)
{ … }
#define NUM_HSMP_ATTRS …
static int hsmp_create_attr_list(struct attribute_group *attr_grp,
struct device *dev, u16 sock_ind)
{ … }
static int hsmp_create_non_acpi_sysfs_if(struct device *dev)
{ … }
static int hsmp_create_acpi_sysfs_if(struct device *dev)
{ … }
static int hsmp_cache_proto_ver(u16 sock_ind)
{ … }
static inline bool is_f1a_m0h(void)
{ … }
static int init_platform_device(struct device *dev)
{ … }
static const struct acpi_device_id amd_hsmp_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, amd_hsmp_acpi_ids);
static int hsmp_pltdrv_probe(struct platform_device *pdev)
{ … }
static void hsmp_pltdrv_remove(struct platform_device *pdev)
{ … }
static struct platform_driver amd_hsmp_driver = …;
static struct platform_device *amd_hsmp_platdev;
static int hsmp_plat_dev_register(void)
{ … }
static bool legacy_hsmp_support(void)
{ … }
static int __init hsmp_plt_init(void)
{ … }
static void __exit hsmp_plt_exit(void)
{ … }
device_initcall(hsmp_plt_init);
module_exit(hsmp_plt_exit);
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;