From patchwork Thu Sep 5 08:27:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 825617 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp186701wrb; Thu, 5 Sep 2024 01:29:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWch2ta1KqYKp7Ro0CAlkDG5fF5MS1Tnq+6pgb3JF0ssPx/tVCfO0f3idxTJdNYAj31IHbMdg==@linaro.org X-Google-Smtp-Source: AGHT+IF1GhqSVFhyVRUSIWH4sH+sp5vrZCRszVsAWwvQKt4B15ZP/HTATRqsTveDIzDHyMxOUxJu X-Received: by 2002:a17:907:ea7:b0:a7d:89ac:9539 with SMTP id a640c23a62f3a-a8a42f8af35mr436662266b.7.1725524958070; Thu, 05 Sep 2024 01:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725524958; cv=none; d=google.com; s=arc-20240605; b=R5Pzrc22v4ihf30ZDgyqiKgxbiugf8/rUMHyWkEt6jlkuPu4Au72AMkrPi09FB7mZ1 +oAS/bpfERHd812+FFZQsrgToCU4AeeupZRqsZR8Qp/ZmyA5B6aJ8mbohiT0Jh6WcLW9 2q3mvLNcY5ZpMbJBrSEojVqlHKrR5omaFINPKLenQQ8fP6XUIlnRpMNFCeJ5OeNwDPyj BUoZNSsjYnACEy5u/2F2vhne9KaHJgqjywpBahzrLo04VdtLxPv2nDf5Ofy1HkxGQPzE HeI9+EDpXK21CLhK3G2KMOR0PtCsDj6v24qeEjMcXmMOX5vuZN9l4C9FHJp87RvEn4G6 gFLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=bf6P9OR/6upTzM1d7VuQgmwOVCxoqTTjick5IpFrRRk=; fh=xhhG27Jur2HVmyj6xWbgrQg2vRawqr6LmtjP4yz05ls=; b=V2DAGTcdYZL1E5CFYJ4dDg5+vk3UumpTfkHgEoGCyotWd3cZ9vRx19tMD7q3wCXr0v q7EdbVihQfvn/kCnpIflg050KWLwAZYnInWq0XESv0ebCiIpKi/8GVxFS604SQS1mERq S2It/8h51mwycgQZ8klr8qkHnE5RU2PH0y9su4G9MXJAZjLr8y71QCHFHXN1/u8kwokN nq4eVoY/z158YFQ0RMwYtJsIzfqu7KpRiQPh017QWrLojXjTncJYhRB8VHtRJjMCtny7 jyzi4B2czgsYrBbSDWeX+5xs/OdPGzHM2Cnyj9L2f/O+gBWy/II4ABVGdiCVz9YGIdYg ga8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a8a623c3106si122897566b.490.2024.09.05.01.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 01:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 094F988C98; Thu, 5 Sep 2024 10:28:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id EEC2F88C9C; Thu, 5 Sep 2024 10:28:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 3E98088BFF for ; Thu, 5 Sep 2024 10:28:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B7D8FEC; Thu, 5 Sep 2024 01:29:12 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 59B793F66E; Thu, 5 Sep 2024 01:28:43 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng , Sughosh Ganu Subject: [PATCH 04/16] event: add event to notify lmb memory map changes Date: Thu, 5 Sep 2024 13:57:59 +0530 Message-Id: <20240905082811.1585467-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905082811.1585467-1-sughosh.ganu@linaro.org> References: <20240905082811.1585467-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add an event which would be used for notifying changes in the LMB modules' memory map. This is to be used for having a synchronous view of the memory that is currently in use, and that is available for allocations. Signed-off-by: Sughosh Ganu --- common/event.c | 2 ++ include/event.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/common/event.c b/common/event.c index dda569d447..fc8002603c 100644 --- a/common/event.c +++ b/common/event.c @@ -48,6 +48,8 @@ const char *const type_name[] = { /* main loop events */ "main_loop", + + "lmb_map_update", }; _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size"); diff --git a/include/event.h b/include/event.h index fb353ad623..fce7e96170 100644 --- a/include/event.h +++ b/include/event.h @@ -153,6 +153,14 @@ enum event_t { */ EVT_MAIN_LOOP, + /** + * @EVT_LMB_MAP_UPDATE: + * This event is triggered on an update to the LMB reserved memory + * region. This can be used to notify about any LMB memory allocation + * or freeing of memory having occurred. + */ + EVT_LMB_MAP_UPDATE, + /** * @EVT_COUNT: * This constants holds the maximum event number + 1 and is used when @@ -203,6 +211,12 @@ union event_data { oftree tree; struct bootm_headers *images; } ft_fixup; + + struct event_lmb_map_update { + u64 base; + u64 size; + u8 op; + } lmb_map; }; /**