[Pdbg] [PATCH 7/8] libpdbg: Drop packing of hw units in separate section

Amitay Isaacs amitay at ozlabs.org
Thu Jun 13 13:24:15 AEST 2019


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/hwunit.c |  3 ---
 libpdbg/hwunit.h | 11 +++--------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/libpdbg/hwunit.c b/libpdbg/hwunit.c
index acd1457..c7ec63d 100644
--- a/libpdbg/hwunit.c
+++ b/libpdbg/hwunit.c
@@ -32,9 +32,6 @@ void pdbg_hwunit_register(const struct hw_unit_info *hw_unit)
 	g_hw_unit_count++;
 }
 
-extern struct hw_unit_info *__start_hw_units;
-extern struct hw_init_info *__stop_hw_units;
-
 const struct hw_unit_info *pdbg_hwunit_find_compatible(const char *compat)
 {
 	const struct hw_unit_info *p;
diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h
index 75d193a..ffda81b 100644
--- a/libpdbg/hwunit.h
+++ b/libpdbg/hwunit.h
@@ -34,22 +34,17 @@ struct hw_unit_info {
 void pdbg_hwunit_register(const struct hw_unit_info *hw_unit);
 const struct hw_unit_info *pdbg_hwunit_find_compatible(const char *compat);
 
-/* We can't pack the structs themselves directly into a special
- * section because there doesn't seem to be any standard way of doing
- * that due to alignment rules. So instead we pack pointers into a
- * special section.
- *
+/*
  * If this macro fails to compile for you, you've probably not
  * declared the struct pdbg_target as the first member of the
  * container struct. Not doing so will break other assumptions.
- * */
+ */
 #define DECLARE_HW_UNIT(name)						\
 	static inline void name ##_hw_unit_check(void) {		\
 		((void)sizeof(char[1 - 2 * (container_off(typeof(name), target) != 0)])); \
 	}								\
 	const struct hw_unit_info __used name ##_hw_unit =              \
-	{ .hw_unit = &name, .size = sizeof(name) }; 	                \
-	const struct hw_unit_info __used __section("hw_units") *name ##_hw_unit_p = &name ##_hw_unit
+	{ .hw_unit = &name, .size = sizeof(name) };
 
 struct htm {
 	struct pdbg_target target;
-- 
2.21.0



More information about the Pdbg mailing list