Functions add_map and del_map are used to add and remove maps, map_obj will be mapped in the address space indicated by type according to the information in info.
Functions add_function, del_function, enable_function and disable_function are used to add, delete, enable and disable functions, both virtual and physical. The supplied map_obj must be a valid map-target, it will receive both Config and Message transactions. For Message transactions, the device id (not including bus number) will be in bits 55:48 of the 64-bit address. For Config transactions, the device id is not part of the address. The supplied device_and_function passed to these methods should contain the device and function number (D:F part of B:D:F).
The function get_device_id returns the current device id of dev_obj, as a 16 bit number. Note that the bus number part is saved immediately after the RC/Switch sets it, even if no successful Config-Write has been made.
Note: This interface is considered tech-preview and may change without notice.
typedef enum {
PCIE_Type_Not_Set,
PCIE_Type_Mem,
PCIE_Type_IO,
PCIE_Type_Cfg,
PCIE_Type_Msg,
PCIE_Type_Other,
} pcie_type_t;
SIM_INTERFACE(pcie_map) {
void (*add_map)(conf_object_t *obj, conf_object_t *map_obj,
map_info_t info, pcie_type_t type);
void (*del_map)(conf_object_t *obj, conf_object_t *map_obj,
physical_address_t base, pcie_type_t type);
void (*add_function)(conf_object_t *obj, conf_object_t *map_obj,
uint16 device_and_function);
void (*del_function)(conf_object_t *obj, conf_object_t *map_obj,
uint16 device_and_function);
void (*enable_function)(conf_object_t *obj, uint16 device_and_function);
void (*disable_function)(conf_object_t *obj,
uint16 device_and_function);
uint16 (*get_device_id)(conf_object_t *obj, conf_object_t *dev_obj);
};
#define PCIE_MAP_INTERFACE "pcie_map"