This interface is implemented by devices that can be mapped into address spaces (including port spaces). The operation() is called when the object is accessed through an address space.
The obj argument is a pointer to the mapped object and map_info contains information about how and where the device is mapped into memory. The mem_op argument to operation() contains information about the access.
The offset into the device mapping for the access is typically calculated in the following way:
offset = SIM_get_mem_op_physical_address(mem_op)
- map_info.base + map_info.start
exception_type_t
type, returned by the
operation() function may be used to signal errors to
Simics, but should in most cases be Sim_PE_No_Exception
.
If the device does not support inquiry accesses, it should return
Sim_PE_Inquiry_Unhandled
if mem_op->inquiry
is 1.
typedef enum { Sim_Addr_Space_Conf, Sim_Addr_Space_IO, Sim_Addr_Space_Memory } addr_space_t;
SIM_INTERFACE(io_memory) { int (*DEPRECATED_FUNC(map))(conf_object_t *NOTNULL obj, addr_space_t memory_or_io, map_info_t map_info); exception_type_t (*operation)(conf_object_t *NOTNULL obj, generic_transaction_t *NOTNULL mem_op, map_info_t map_info); }; #define IO_MEMORY_INTERFACE "io_memory"