[Pdbg] [PATCH 0/8] Add registration of hardware units
Amitay Isaacs
amitay at ozlabs.org
Thu Jun 13 13:24:08 AEST 2019
Currently the pointers to hardware units are bundled in a hw_units ELF
section automagically using DECLARE_HW_UNIT macro. To make sure that
the hw_units section gets built in during compilation of any application,
special ldflags need to be specified to include the whole archive.
This hack has outlived it's usefulness and causes headaches every time new
application is built that uses libpdbg library. Instead, register the
hardware units on startup using constructor functions. This way all the
(compiled in) hardware units become available.
Amitay Isaacs (8):
libpdbg: Drop unused macros
libpdbg: Move hardware units to a separate header
libpdbg: Move hw_unit related code to a separate file
libpdbg: Add function to register hw units
libpdbg: Register all hw units explicitly
libpdbg: Find compatible hw unit from registered hw units
libpdbg: Drop packing of hw units in separate section
Makefile: Drop LDFLAGS to bundle whole library
Makefile.am | 9 +---
libpdbg/adu.c | 8 +++
libpdbg/bmcfsi.c | 8 ++-
libpdbg/cfam.c | 11 +++-
libpdbg/chip.c | 2 +-
libpdbg/device.c | 5 +-
libpdbg/fake.c | 10 ++++
libpdbg/host.c | 8 ++-
libpdbg/htm.c | 10 +++-
libpdbg/hwunit.c | 50 ++++++++++++++++++
libpdbg/hwunit.h | 135 +++++++++++++++++++++++++++++++++++++++++++++++
libpdbg/i2c.c | 7 +++
libpdbg/kernel.c | 8 ++-
libpdbg/p8chip.c | 9 +++-
libpdbg/p9chip.c | 10 +++-
libpdbg/target.c | 18 +------
libpdbg/target.h | 119 -----------------------------------------
libpdbg/xbus.c | 8 ++-
src/pdbgproxy.c | 2 +-
19 files changed, 282 insertions(+), 155 deletions(-)
create mode 100644 libpdbg/hwunit.c
create mode 100644 libpdbg/hwunit.h
--
2.21.0
More information about the Pdbg
mailing list