VIRTUTECH CONFIDENTIAL    Previous - Up - Next

event_poster

Implemented By
AM79C960, AM79C960-dml, AM79C973, BCM5703C, BCM5704C, CS8900A, DEC21041, DEC21140A, DEC21143, DS12887, DS12887-dml, DS17485, FAS366U, ISP1040, ISP2200, M5823, MK48T08, NS16450, NS16550, PCF8584, SA1110-device, SYM53C810, SYM53C875, Z8530, alpha-ev5, apic, armv5te, cassini, central-client, cheerio-hme, clock, cpc700-gpt, etg, ethernet-link, fc-disk, fiesta-tomatillo, gdb-remote, generic-flash-memory, gfx-console, i8042, i82077, i8254, i8259x2, ia64-itanium, ia64-itanium2, ide, image, leon2, leon2_irq, leon2_timer, mii-transceiver, mips-4kc, mips-5kc, msp430, niagara-strand-mmu, piix4_power, piix4_usb, ppc405gp, ppc405gp-iic, ppc440gp, ppc440gp-iic, ppc440gx, ppc440gx-iic, ppc603e, ppc7400, ppc7447, ppc7450, ppc7457, ppc750, ppc750fx, ppc750gx, ppc970fx, python, ragexl, recorder, rev-execution, sample_micro_arch_x86, sb16, sbus-hme, scsi-bus, scsi-cdrom, scsi-disk, serengeti-console, serengeti-console-old, serengeti-schizo, serial-link, server-console, service-node, state-assertion, sun4u-counter, sun4u-fasdma, sun4u-fhc, sunfire-psycho, sunfire-sysio, telos-timer, telos-usart, text-console, ultrasparc-ii, ultrasparc-iii, ultrasparc-iii-i, ultrasparc-iii-plus, ultrasparc-iv, ultrasparc-iv-plus, ultrasparc-t1, vga, vga_pci, voodoo3, voodoo3-agp, x86-486sx, x86-hammer, x86-p2, x86-p4
Description

This interface is intended for objects that post events. Each events has a pointer to a call-back function and a data pointer associated with it. These pointers need to be converted to values that can be represented in a file when a configuration is written (a checkpoint is taken), and converted back to pointers when a configuration is read (a checkpoint is opened). Simics also needs some way to get a text description of an event that can be presented to the user. These functions should be implemented through the event-poster interface by all objects posting event.

struct event_poster_interface {
        attr_value_t (*get_event_info_val)(conf_object_t *NOTNULL obj,
                                           void (*NOTNULL func)(
                                                            conf_object_t *obj,
                                                            lang_void *param),
                                           void *user_data);
        const char *(*describe_event)(conf_object_t *NOTNULL obj,
                                      void (*NOTNULL func)(conf_object_t *obj,
                                                           lang_void *param),
                                      void *user_data);
        void (*get_event_info)(attr_value_t *NOTNULL checkpoint_value,
                               conf_object_t *NOTNULL obj,
                               void (*NOTNULL func)(conf_object_t *obj,
                                                    lang_void *param),
                               void *user_data);
        int (*set_event_info)(conf_object_t *NOTNULL obj,
                              attr_value_t *NOTNULL checkpoint_value,
                              void (**NOTNULL out_func)(conf_object_t *obj,
                                                        lang_void *param),
                              void **NOTNULL out_info);
};

#define EVENT_POSTER_INTERFACE "event_poster"

get_event_info_val() is called for each event posted by the object obj present in the event queues when writing a configuration. Using the func and the info parameters get_event_info_val() should return a checkpoint value so that set_event_info() can restore both func and info when the configuration is later read. If the event should not be saved, get_event_info_val() should return Sim_Val_Nil.

get_event_info() is an alternative interface kept for compatibility. It modifies the checkpoint_value parameter instead of returning a value. It is only used if get_event_info_val() is not present.

set_event_info() is called for each event associated with obj found when restoring events from a saved configuration. Using the checkpoint_value set_event_info() should fill in out_func and out_info with the associated values. set_event_info() should return one of Sim_Set_Ok, Sim_Set_Ignored and Sim_Set_Illegal_Value. Sim_Set_Ok should be returned if the event was recognised and should be posted, Sim_Set_Ignored if the event was recognised for backwards compatibility but should not be posted, and Sim_Set_Illegal_Value if the event was not recognised.

describe_event() should return a string describing the event using the func and user_data parameters. The string is for example used when the event queue is printed.

VIRTUTECH CONFIDENTIAL    Previous - Up - Next