mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-28 20:16:09 +00:00
This patch refines the ACPI device passthrough framework by defining a generic framework. Note that when user gives an HID by "--acpidev_pt <HID>", the pt logic will go through all registered ops to see if there's a match. v4 -> v5: parse_pt_acpidev/parse_pt_mmiodev -> create_pt_acpidev/create_pt_mmiodev (there were already "init_xxx" function present, so rename to create_xxx) "super user" -> "superuser" multiple API renames Tracked-On: #6686 Signed-off-by: Yifan Liu <yifan1.liu@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
/*
|
|
* Copyright (C) 2020 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
|
|
#ifndef _MMIO_DEV_H_
|
|
#define _MMIO_DEV_H_
|
|
|
|
#include "acrn_common.h"
|
|
|
|
struct mmio_dev {
|
|
char name[16];
|
|
struct acrn_mmiodev dev;
|
|
};
|
|
|
|
struct acpi_dev_pt_ops {
|
|
char hid[8];
|
|
char modalias[32];
|
|
int (*match)(char *);
|
|
int (*init)(char *, struct mmio_dev *);
|
|
void (*write_dsdt)(struct vmctx *);
|
|
/* TODO: We may add more fields when we support other ACPI dev pt */
|
|
};
|
|
|
|
#define DEFINE_ACPI_PT_DEV(x) DATA_SET(acpi_dev_pt_ops_set, x);
|
|
|
|
struct mmio_dev *get_mmiodev(char *name);
|
|
int get_mmio_hpa_resource(char *name, uint64_t *res_start, uint64_t *res_size);
|
|
int get_more_acpi_dev_info(char *hid, uint32_t instance, struct acpi_dev_pt_ops *ops);
|
|
void acpi_dev_write_dsdt(struct vmctx *ctx);
|
|
|
|
int create_pt_acpidev(char *arg);
|
|
int create_pt_mmiodev(char *arg);
|
|
|
|
int init_mmio_devs(struct vmctx *ctx);
|
|
void deinit_mmio_devs(struct vmctx *ctx);
|
|
|
|
int mmio_dev_alloc_gpa_resource32(uint32_t *addr, uint32_t size_in);
|
|
uint64_t get_mmio_dev_tpm2_base_gpa(void);
|
|
|
|
#define MMIO_DEV_BASE 0xF0000000U
|
|
#define MMIO_DEV_LIMIT 0xFE000000U
|
|
#endif /* _MMIO_DEV_H_ */
|