diff options
| author | Tom Rini <[email protected]> | 2022-03-10 08:28:40 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-03-10 08:28:40 -0500 |
| commit | cb83a7a0c360d58a3a9bf2ba3828e576eafecb91 (patch) | |
| tree | 23eeff85c6606bece47b2d99611786a3392416dc /doc/usage | |
| parent | 0bf4e0bb935e5c7fc016142e0228882610ecbf39 (diff) | |
| parent | abe5d1184f276a0789365316061a14834dbc8dc4 (diff) | |
Merge branch '2022-03-09-events-subsystem' into next
To quote the author:
It is a common need in U-Boot to have one subsystem notify another
when something happens. An example is reading a partition table when a
new block device is set up.
It is also common to add weak functions and 'hook' functions to modify
how U-Boot works. See for example ft_board_setup() and the like.
U-Boot would benefit from a generic mechanism to handle these cases,
with the ability to hook into various 'events' in a
subsystem-independent and transparent way.
This series provides a way to create and dispatch events, with a way of
registering a 'spy' which watches for events of different types. This
allows 'hook' functions to be created in a generic way.
It also includes a script to list the hooks in an image, which is a bit
easier to debug than weak functions, as well as an 'event' command to
do the same from within U-Boot.
These 'static' events can be used to replace hooks like misc_init_f(),
for example. Also included is basic support for 'dynamic' events, where
a spy can be registered at runtime. The need for this is still being
figured out.
Diffstat (limited to 'doc/usage')
| -rw-r--r-- | doc/usage/event.rst | 49 | ||||
| -rw-r--r-- | doc/usage/index.rst | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/doc/usage/event.rst b/doc/usage/event.rst new file mode 100644 index 00000000000..c0f8acd727b --- /dev/null +++ b/doc/usage/event.rst @@ -0,0 +1,49 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +event command +============= + +Synopsis +-------- + +:: + + event list + +Description +----------- + +The event command provides spy list. + +This shows the following information: + +Seq + Sequence number of the spy, numbered from 0 + +Type + Type of the spy, both as a number and a label. If `CONFIG_EVENT_DEBUG` is + not enabled, the label just shows `(unknown)`. + +Function + Address of the function to call + +ID + ID string for this event, if `CONFIG_EVENT_DEBUG` is enabled. Otherwise this + just shows `?`. + + +See :doc:`../develop/event` for more information on events. + +Example +------- + +:: + + => event list + Seq Type Function ID + 0 7 misc_init_f 55a070517c68 ? + +Configuration +------------- + +The event command is only available if CONFIG_CMD_EVENT=y. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 0aacf531b22..750102830b5 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -29,6 +29,7 @@ Shell commands x86/cbsysinfo conitrace echo + event exception extension exit |
