The {acpi_}device_init() and device_get_class() functions are identical across
Arm and RISC-V, and they are likely to remain the same for other architectures
like PPC.
Since there is no architecture-specific logic within these functions, they are
good candidates to be moved to the common codebase.

This patch series refactors the code by moving these functions to the common
directory, reducing code duplication and simplifying future maintenance.

---
Changes in V5:
 - Rename SIMPLE_DECL_SECTION to DECL_SECTION_WITH_LADDR and update the other
   patches correspondingly.
 - Drop macros argument for  ACPI_DEV_INFO and DT_DEV_INFO.
---
Changes in V4:
 - Introduce SIMPLE_DECL_SECTION to cover the cases when an architecture wants
   to use section declaration without specifying an load address.
 - Refactor macors ACPI_DEV_INFO and DT_DEV_INFO and update their defintion.
---
Changes in V3:
 - drop _SECTIONS from the name of the macros ADEV_INFO and DT_DEV_INFO
 - update the definion of macros ADEV_INFO and DT_DEV_INFO
 - drop DEVICE_INIT config.
---
Changes in v2:
 - Introduce macros for definition of ACPI and Device Tree sections.
 - Introduce CONFIG_DEVICE_INIT to make common/device.o compilable only for Arm,
   PPC and RISC-V.
---

Oleksii Kurochko (6):
  xen: introduce DECL_SECTION_WITH_LADDR
  xen: define ACPI and DT device info sections macros
  xen/arm: use {DT,ACPI}_DEV_INFO for device info sections
  xen/ppc: add section for device information in linker script
  xen/riscv: add section for device information in linker script
  xen/common: move device initialization code to common code

 xen/arch/arm/device.c     | 71 +--------------------------------
 xen/arch/arm/xen.lds.S    | 14 +------
 xen/arch/ppc/xen.lds.S    |  4 ++
 xen/arch/riscv/xen.lds.S  |  2 +
 xen/arch/x86/xen.lds.S    |  6 ++-
 xen/common/Makefile       |  2 +
 xen/common/device.c       | 82 +++++++++++++++++++++++++++++++++++++++
 xen/include/xen/xen.lds.h | 22 +++++++++++
 8 files changed, 120 insertions(+), 83 deletions(-)
 create mode 100644 xen/common/device.c

-- 
2.46.1


Reply via email to