From nobody Mon Feb 9 05:39:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1692181253; cv=none; d=zohomail.com; s=zohoarc; b=Qb+fpaSBqXn+Hs05RdUFSmD13XBJaNGY5v5Gs+TBYZHqRXQeD7KnBSy/RblGmvqcGDpn+b0yT95HvOfsAQxU+1kfkPPySWd/blOj30D4zVhpxWu0ZSy49+bSNUs9vHqVHdfRly98QpxrWKwMkRxMoxFQ+LncX7RPJmjIkfqkLQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692181253; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2SAv1/nVAEvC2eUP+A+JJrfLibXfd0eUAwY7nUEYbBk=; b=Lx91z4rdOmHDxYEBB6oZDz4krCFoF0rZDdq9ngrAbdz7CAgHagw7Fe1+QIc21uKa3EOKrrf3/2xgZEp08kSg2+rPqNDRynqSU87OpIGNd4TSsAPvPar6GTdmzgiaW0IPw+PKjNhFV9KPXNYwv+x7NKu51q0Xo1Wq9Hxi+9RJ2+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1692181253111704.1545709267672; Wed, 16 Aug 2023 03:20:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.584326.914940 (Exim 4.92) (envelope-from ) id 1qWDdY-0004tE-8p; Wed, 16 Aug 2023 10:20:24 +0000 Received: by outflank-mailman (output) from mailman id 584326.914940; Wed, 16 Aug 2023 10:20:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWDdX-0004r5-Th; Wed, 16 Aug 2023 10:20:23 +0000 Received: by outflank-mailman (input) for mailman id 584326; Wed, 16 Aug 2023 10:20:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qWDdW-0003R9-DX for xen-devel@lists.xenproject.org; Wed, 16 Aug 2023 10:20:22 +0000 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [2a00:1450:4864:20::432]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 81b7817a-3c1e-11ee-8779-cb3800f73035; Wed, 16 Aug 2023 12:20:21 +0200 (CEST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso5587202f8f.0 for ; Wed, 16 Aug 2023 03:20:21 -0700 (PDT) Received: from 192.168.1.26 ([151.25.98.127]) by smtp.gmail.com with ESMTPSA id g5-20020adfe405000000b0031773a8e5c4sm20877843wrm.37.2023.08.16.03.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 03:20:20 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 81b7817a-3c1e-11ee-8779-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692181221; x=1692786021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2SAv1/nVAEvC2eUP+A+JJrfLibXfd0eUAwY7nUEYbBk=; b=S79awHNCAcJstJrlgbvuJemfvHPBefJbtszclqjWwn56f5eLYgRVSYVjvWrHIwgzqI txeMs8p2B7bmTUuPOPE+ITdRoYJU7SqM+ud0iDyILY9sE9cVTAPP3Q+vy0+MT87WFY1X nLHy3QmaJlhp9naRdBGysXUaiSzDlNcoxSG5803284YXZY5qrM+yXgIbMfwp2YY7gStv 7LjwUCHNKh9H0OBPERmaxXy4A3d8oBtZXOFoK1qShQXezVZLc6N7n6W0G1qPyJdbuANZ tud1/cdVgQ4WHmOTKKX/jOuzqX7+HGvtk2bAyhSK937wN3SCBt/biczj+7cqgWgnIKGN li1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692181221; x=1692786021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2SAv1/nVAEvC2eUP+A+JJrfLibXfd0eUAwY7nUEYbBk=; b=VYkxwdo8scAU7tcN1KGEdqTJBFzRKgMTccmOTjKYsTFXsj3m17dtnW+FY9dWFeLceY dMQWKFiGovIuly10PzG0Bw2zn1itLl7Pu5X8fl4b5xfZi8ZjVbBoIgsKoZ2/WNf1akTP gtJAmux60dNFk6sT9aUPZFG05u+JjjgXxS2o3QZjo5jLNDQwuNticadSsaWXCA56DMYy CBtlZVL+LQCd3d5EmwQHupl4LrdMfZg9aD/hf5odvgN5GiKv3EggNLyPB3pAmQVBWhQ0 tKSlnJbKkAD3Twjif4rG6JPwdkW/GMvHmjczV/+476TF5m4K8c5ut+5lm4CH6pj2ko90 LNwQ== X-Gm-Message-State: AOJu0Yw3vZ+yMWv6QOCOeRpCh/qOIv82pgmnEyoyaqfI3y4jikrBJlLJ sR8XHS8s0V9Ypjng4XGgBTNkDx370zIkXEa7 X-Google-Smtp-Source: AGHT+IGvYv3B7sJqKLRG/GSmInwttmH0aBZVLOI7ZrwlPi8jlwctErMSTp7TPqm2OL7JPvCnMg6ZRg== X-Received: by 2002:a5d:6552:0:b0:316:efb9:ffa with SMTP id z18-20020a5d6552000000b00316efb90ffamr1091651wrv.35.1692181220817; Wed, 16 Aug 2023 03:20:20 -0700 (PDT) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Bob Eshleman , Alistair Francis , Connor Davis Subject: [PATCH v1 08/57] xen/riscv: introduce asm/device.h Date: Wed, 16 Aug 2023 13:19:18 +0300 Message-ID: <34988d4e9820b4b84a16f7cf72dbc4a908a3a304.1692181079.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1692181308735100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko --- xen/arch/riscv/include/asm/device.h | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 xen/arch/riscv/include/asm/device.h diff --git a/xen/arch/riscv/include/asm/device.h b/xen/arch/riscv/include/a= sm/device.h new file mode 100644 index 0000000000..e58178517a --- /dev/null +++ b/xen/arch/riscv/include/asm/device.h @@ -0,0 +1,55 @@ +#ifndef __ASM_RISCV_DEVICE_H__ +#define __ASM_RISCV_DEVICE_H__ + +struct dt_device_node; + +enum device_type +{ + DEV_DT, + DEV_PCI, +}; + +struct device { + enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE + struct dt_device_node *of_node; /* Used by drivers imported from Linux= */ +#endif +}; + +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_GIC, + DEVICE_PCI_HOSTBRIDGE, + /* Use for error */ + DEVICE_UNKNOWN, +}; + +struct device_desc { + /* Device name */ + const char *name; + /* Device class */ + enum device_class class; + /* List of devices supported by this driver */ + const struct dt_device_match *dt_match; + /* + * Device initialization. + * + * -EAGAIN is used to indicate that device probing is deferred. + */ + int (*init)(struct dt_device_node *dev, const void *data); +}; + +typedef struct device device_t; + +#define DT_DEVICE_START(_name, _namestr, _class) \ +static const struct device_desc __dev_desc_##_name __used \ +__section(".dev.info") =3D { \ + .name =3D _namestr, \ + .class =3D _class, \ + +#define DT_DEVICE_END \ +}; + +#endif /* __ASM_RISCV_DEVICE_H__ */ \ No newline at end of file --=20 2.41.0