From patchwork Tue Sep 24 16:42:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13811067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC0E1CF9C6B for ; Tue, 24 Sep 2024 16:42:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.803179.1213662 (Exim 4.92) (envelope-from ) id 1st8cb-0007Se-As; Tue, 24 Sep 2024 16:42:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 803179.1213662; Tue, 24 Sep 2024 16:42:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8cb-0007SI-6y; Tue, 24 Sep 2024 16:42:41 +0000 Received: by outflank-mailman (input) for mailman id 803179; Tue, 24 Sep 2024 16:42:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8ca-0006l4-C5 for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:42:40 +0000 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [2a00:1450:4864:20::534]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 02749c78-7a94-11ef-99a2-01e77a169b0f; Tue, 24 Sep 2024 18:42:38 +0200 (CEST) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so94150a12.0 for ; Tue, 24 Sep 2024 09:42:38 -0700 (PDT) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4972f8sm925880a12.36.2024.09.24.09.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:42:37 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 02749c78-7a94-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196158; x=1727800958; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JpiTxUeUSpHZmFA9gDCH6CikYygBa+0X5ZnJt34uvZk=; b=mJ5rTO0D8ZmPXvvIEvYYkkfecNOItq1Dg9gB9Yv4jaiqnR4du+4fx1NaHUTKNtkd2b StY864oe8ibLpcgyoceLpbt3hmck8z1XurElpVw3rZjJxqcXOUO0opGjGj58OA8URhCe /wcUXt3vbgNmKwZFJg3CMh/WmlyFtx7z3dWl0X0UU/LGqSDeFbzr/wk3j92wX2P8ERO2 HxDMjN1T/i913BWCCjFwFDTA+W13WRqssCuuB5YEvjWTDLviuYY2rblTfUEfrN1gfOqE lWZtzOLucGltWHTmjjDOnZJggfxyn6vDDh4Ftass1bkNC6/sS7kAdLf8ruKaILRKnpus X0uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196158; x=1727800958; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JpiTxUeUSpHZmFA9gDCH6CikYygBa+0X5ZnJt34uvZk=; b=ZnUYkefX/8yTPOX+nfLc2kCrO0jJjmvngRMremo0Yl/PkzimH9Eo7/3DHlyq1t3g01 9edfwIOizWJnLK+j8tkdybxLBCaOvDcKaOscfETZc8JSIEuzkJcyJIijWhmf1GnBew+s HBJnGxMwNM2BJ53cleYls7tePNNfh6AaPihMRMjzdJnKUwTz62v7SMEDbJvMyZ6jwykp /2Pg7Ax71tlFr68M2Kzf3jGwWHeI9VBt/iJ9SHSMuNWlpUIi+rwPYJ1zzrCwY+nFkh// 2aIA/kLj6p9ObqnEfAkxw1/U5T2mJdneP1A2AuLkinhtWqFQVygsMupWEyBe3wX2tq6B WG4w== X-Gm-Message-State: AOJu0YyHi+fa+JSq+NL9VPVkmj3Z7Pe4Kf+m1DTFGsFlCbRAvCzg+B+r /DTU79w0tCXCvXrA5TmaUXcJMzZstCMdqo7q7ds6XmOyVmcEX+J3Lbaidw== X-Google-Smtp-Source: AGHT+IEUnXM7IZTZCimwbNEeZWLMVxAbf54udbfeB7ku6paT9NPSl/Lecl68FtioNsEGg/0eYCXzBw== X-Received: by 2002:a05:6402:4313:b0:5c7:18c7:a005 with SMTP id 4fb4d7f45d1cf-5c718c7a1ebmr2282328a12.10.1727196157622; Tue, 24 Sep 2024 09:42:37 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Alistair Francis , Bob Eshleman , Connor Davis Subject: [PATCH v3 0/5] Move {acpi_}device_init() and device_get_class() to common code Date: Tue, 24 Sep 2024 18:42:29 +0200 Message-ID: X-Mailer: git-send-email 2.46.1 MIME-Version: 1.0 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 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 (5): 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 | 10 +---- xen/arch/ppc/xen.lds.S | 5 +++ xen/arch/riscv/xen.lds.S | 5 +++ xen/common/Makefile | 2 + xen/common/device.c | 82 +++++++++++++++++++++++++++++++++++++++ xen/include/xen/xen.lds.h | 10 +++++ 7 files changed, 108 insertions(+), 77 deletions(-) create mode 100644 xen/common/device.c