event: Add basic support for events

Add a way to create and dispatch events without needing to allocate
memory. Also add a way to 'spy' on events, thus allowing 'hooks' to be
created.

Use a linker list for static events, which we can use to replace functions
like arch_cpu_init_f(). Allow an EVENT_DEBUG option which makes it
easier to see what is going on at runtime, but uses more code space.

Dynamic events allow the creation of a spy at runtime. This is not always
necessary, but can be enabled with EVENT_DYNAMIC if needed.

A 'test' event is the only option for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index fb171e0..b534ad6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -809,6 +809,12 @@
 F:	doc/usage/environment.rst
 F:	scripts/env2string.awk
 
+EVENTS
+M:	Simon Glass <sjg@chromium.org>
+S:	Maintained
+F:	common/event.c
+F:	include/event.h
+
 FASTBOOT
 S:	Orphaned
 F:	cmd/fastboot.c