From patchwork Fri Jun 7 18:52:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 802321 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp949051wro; Fri, 7 Jun 2024 11:55:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV5g0iPSSIE86moMxNOmGnnE/CLj3qzfZWIuwECHyTtbAoN/+vPntq1JnQCrotF0br3jYL2L1x2147u0EAzdSdT X-Google-Smtp-Source: AGHT+IHO4gUQi5JKZJeTZe6ybPfZbEYutiuNN7aJOWsHdLPisJCWhlgeVE1hXOwzoZXy6XACWitx X-Received: by 2002:a50:8e11:0:b0:578:67db:7516 with SMTP id 4fb4d7f45d1cf-57c509a5d41mr1955004a12.37.1717786523198; Fri, 07 Jun 2024 11:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786523; cv=none; d=google.com; s=arc-20160816; b=M5SZ1reEgcSWwg64yL+59usKTp54rXNXPt428iPpWxcBNdjfOek0LoyoB4xT3FBgqj qB3GpBRQNgm7y2cXPXhT2q3+tSVcOuMLmcEazfDXaSGirs9hRvE7U2NY/iGTYzLf+vHJ 7zmoo7PqaoNp+1p7ANZ04fu/arFqO4knVo6IPh94bpTbXom13NN11fSGodSBgSSuhVDS +xkOkNosBSniFnJNfylg52OdRhHYGbt2BfCGenWYd941DwuMeUzzEc9BqVYR3Iqx06wi whPgHH3PFJrwq3gQlg+Y4IiYQIIWRXBz6Cm+mLOvwE5nL+EP1ITVL6OkZ43nL79sVzg7 8Trw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=isuAYFdNhrOJYsHU1w+6WSa7Tk1nv71bVkw6J0hDTMU=; fh=xLSOOz5Q0Mrmzd+lwBRTYS7D/8TpUWM8TEHgIjpMzow=; b=Vn+stfZbPFvvHDJRvkfBme5qgHcP8LMsDy10GjaThXIZoqk+4F/tG310CYJ6KJ4bc/ sUBs0A021e+vKHcepuSe3Oga6utl7ODm7NTvG5QEl5G+bD3aHdhAOhADZaxC33H4G4RO MkIwiQDQs61o3Av8aQO0Q6GefcYBFbgHoKcJ4jCL4QPyhzIg7IHypi+ZhK43LGKGHW7C olpIxddpK0ZHUOl0v2MQSp5tSxBxzHHPD2zHfB14XDsrxpn3ZQFOgpeWnuFAMcs38sRV OFLvVVOwsCdj5s9WHOHgS2PaNcBLAqtNIi7zw4Hu0GT+BH4nieYSILPHT0gMPD6AVxZV 3T2A==; 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 4fb4d7f45d1cf-57aae22892bsi2129806a12.394.2024.06.07.11.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:55:23 -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 49ADA88495; Fri, 7 Jun 2024 20:54:08 +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 715848846E; Fri, 7 Jun 2024 20:54:07 +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_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_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 773E4884AA for ; Fri, 7 Jun 2024 20:54:05 +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 6677A1480; Fri, 7 Jun 2024 11:54:29 -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 4BA2A3F792; Fri, 7 Jun 2024 11:54:02 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Fabio Estevam , Sughosh Ganu Subject: [RFC PATCH 10/31] event: add events to notify memory map changes Date: Sat, 8 Jun 2024 00:22:19 +0530 Message-Id: <20240607185240.1892031-11-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607185240.1892031-1-sughosh.ganu@linaro.org> References: <20240607185240.1892031-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 events which would be used for notifying changes in the respective 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 | 4 ++++ include/event.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/common/event.c b/common/event.c index 16c2ba6cc9..067ee9ee4e 100644 --- a/common/event.c +++ b/common/event.c @@ -48,6 +48,10 @@ const char *const type_name[] = { /* main loop events */ "main_loop", + + "lmb_map_update", + + "efi_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..9d8be7a103 100644 --- a/include/event.h +++ b/include/event.h @@ -153,6 +153,22 @@ 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_EFI_MEM_MAP_UPDATE: + * This event is triggered on an update to the EFI memory map. + * This can be used to notify about any EFI memory allocation + * or freeing of memory having occurred. + */ + EVT_EFI_MEM_MAP_UPDATE, + /** * @EVT_COUNT: * This constants holds the maximum event number + 1 and is used when @@ -203,6 +219,18 @@ union event_data { oftree tree; struct bootm_headers *images; } ft_fixup; + + struct event_lmb_map_update { + u64 base; + u64 size; + u8 op; + } lmb_map; + + struct event_efi_mem_map_update { + u64 base; + u64 size; + u8 op; + } efi_mem_map; }; /**