osa_machine_notification osa_mapper_admin
API Reference Manual  /  7 Simulator-to-Simulator Interfaces  / 

osa_machine_query

Description

read_register reads the register with number reg (number can be retrieved with get_register_number) from processor cpu and returns the value of that register.

get_register_number returns the register number of the register with name reg from processor cpu or -1 upon error.

read_phys_memory reads len bytes of memory from physical address addr of processor cpu. The returned value is an uint64 with the value if the read succeeded, otherwise nil. The len argument should use one of the lengths declared in the osa_read_len_t enum.

read_phys_bytes reads len bytes of memory from physical address addr. The length to read can be up to 1024 bytes. The returned value is of data type containing the bytes read upon success or nil otherwise.

virtual_to_physical translates the virtual address vaddr of processor cpu to a physical address as translation would be for a data read. The returned value is the physical address as an uint64 upon success, otherwise nil. For x86 this uses linear to physical translation (as opposed to the logical to physical variant).

cpu_mode returns the current processor mode of cpu.

get_all_processors returns all available processors. For example, when detecting parameters, a tracker should use its known processors if the system is enabled, otherwise it can get them via get_all_processors. For hypervisor configurations, the tracker framework must be enabled in order to detect parameters for a guest.

get_exception_number returns the exception number of the exception with name name from processor cpu. Returns -1 if no exception with the given name exists.

For all functions, the tracker argument should be the tracker calling this interface. This makes it possible for a hypervisor tracker to handle guests differently.

SIM_INTERFACE(osa_machine_query) {
        uint64 (*read_register)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, int reg);
        int (*get_register_number)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, const char *reg);
        attr_value_t (*read_phys_memory)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, physical_address_t addr,
                osa_read_len_t len);
        attr_value_t (*read_phys_bytes)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, physical_address_t paddr,
                unsigned len);
        attr_value_t (*virtual_to_physical)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, uint64 vaddr);
        processor_mode_t (*cpu_mode)(conf_object_t *NOTNULL obj,
                                     conf_object_t *NOTNULL tracker,
                                     conf_object_t *NOTNULL cpu);
        attr_value_t (*get_all_processors)(conf_object_t *NOTNULL obj,
                                           conf_object_t *NOTNULL tracker);
        int (*get_exception_number)(
                conf_object_t *NOTNULL obj, conf_object_t *NOTNULL tracker,
                conf_object_t *NOTNULL cpu, const char *name);
};

#define OSA_MACHINE_QUERY_INTERFACE "osa_machine_query"

Execution Context
Cell Context for all methods.

osa_machine_notification osa_mapper_admin