Constructor support

Allow devices/drivers to register themselves via constructors.
Destructors are not needed (can be registered from a constructor)
and "priority" has been renamed and changed to an enum for clarity.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2009-05-14 19:29:53 +01:00 committed by Paul Brook
parent 70ec5dc0af
commit 0bfe3ca51e
6 changed files with 145 additions and 17 deletions

View file

@ -8,10 +8,13 @@
%.o: %.m
$(call quiet-command,$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)," LINK $(TARGET_DIR)$@")
WAS=-Wl,--whole-archive
WAE=-Wl,--no-whole-archive
LINK = $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(1) $(LIBS) $(WAS) $(ARLIBS) $(WAE)," LINK $(TARGET_DIR)$@")
%$(EXESUF): %.o
$(LINK)
$(call LINK,$^)
%.a:
$(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")