Notifiers Haps
API Reference Manual  /  Device API  /  Device API Functions  / 

Global Notifiers

SIM_add_global_notifier

Name

SIM_add_global_notifier — add a global notifier callback

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

global_notifier_callback_t *
SIM_add_global_notifier(
        global_notifier_type_t type,
        conf_object_t *subscriber,
        void (*callback)(conf_object_t *subscriber, lang_void *data),
        lang_void *data);

Python

import simics

simics.SIM_add_global_notifier(...)

Description

SIM_add_global_notifier installs a callback on the global notifier of type type. The callback will be executed in Global Context. The callback can uninstall itself, using SIM_delete_global_notifier, but must not uninstall any other global notifiers.

The subscriber argument should be the object listening on the notifier; this object is passed as the first argument to the callback. The installed callback is automatically removed if the subscriber object is deleted. It is legal to pass NULL in the subscriber argument if there is no object associated with the callback.

The function returns a handle to the installed callback or NULL if the notifier type is unknown.

Adding a notifier callback from another notifier callback of the same notifier type does not trigger an immediate callback invocation.

Execution Context

Global Context

SIM_add_global_notifier_once

Name

SIM_add_global_notifier_once — add a global notifier callback

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

global_notifier_callback_t *
SIM_add_global_notifier_once(
        global_notifier_type_t type,
        conf_object_t *subscriber,
        void (*callback)(conf_object_t *subscriber, lang_void *data),
        lang_void *data);

Python

import simics

simics.SIM_add_global_notifier_once(...)

Description

The SIM_add_global_notifier_once is similar to SIM_add_global_notifier, except that the notifier will be removed automatically after the callback has been called once.

Execution Context

Global Context

SIM_delete_global_notifier

Name

SIM_delete_global_notifier — delete global notifier callback

Synopsis

C and DML

#include <simics/device-api.h> // in C
// always available in DML

void
SIM_delete_global_notifier(global_notifier_callback_t *handle);

Python

import simics

simics.SIM_delete_global_notifier(...)

Description

SIM_delete_global_notifier deletes the global notifier callback specified by the handle handle.

Global notifier callbacks are deleted automatically when the subscribing object is deleted.

Deleting a notifier callback from another notifier callback of the same notifier type may or may not inhibit the last invocation of the deleted callback; this is undefined.

Execution Context

Global Context

Notifiers Haps