From patchwork Thu Jul 4 07:35:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 809944 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1043818wru; Thu, 4 Jul 2024 00:43:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVC10eSof159p5Qizl7DV1GDaK+TW144xWLXn/TPnMF4RvQROK3SL3JJkJZp8aIibWpv8sYzJFjSbIWh57Ab1cF X-Google-Smtp-Source: AGHT+IFSCEpoYWTeXvRM3Gq5BPkw7Z1VxBvRKGQOKP6r8DqiLy3/G6WUuK8vQunHgN4YljInuc54 X-Received: by 2002:a17:907:94d0:b0:a6f:96b0:ed2 with SMTP id a640c23a62f3a-a77ba46c9b7mr65991966b.30.1720078982167; Thu, 04 Jul 2024 00:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720078982; cv=none; d=google.com; s=arc-20160816; b=bPFQQyhls0xVIrIwy8qzwLkLaHJvYx+aAryPynRgyAxaUgD8z19EyL3fyqZxZzLBIx tjc2hGks223m8aIOat1ZkzWxlmEMqp+mhwDm3v/YklYdDIm6A6n9fwxI78JU97ZKOdYo WlAokKrSrwqJcGVEldg74u++bBykKBhbii0w/T8w5RaY0nkK9lZCabw8x52pV1gajs2D pZClydPa3pVIgoOKHf/2G/sEhzmlNjmHttJNHgCVjDZmdzXCjYmW+iFO0Idlwz2kbvJz ckVeUBs7Ck7wDQoNBjoBR8YteMQGtAJMnsYco/U5jxtf4InAlNdO5jrO7derRzUtADBb 45Ow== 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=+v3mscqFQ08/dO/M691h6i/sK9cuGla+zYiHKY4m+eQ=; fh=ez1zzjhC0XWyqTp7tWutqrA/nFdALDnQKrnQnXYhk5Q=; b=oAJ2hNif0tHcwVXTFIihdTcBz4PKpb6wYlh7kkqYunMfBbwDDD5grN+U2f9hjKzWAm tSHivrgYWZrdDQgCg4xeIeY+gfeImxMzirQ85tnOrm72AlBmP9pLe6tABbRwA50DjRXF JueYbknJiZ03UITzTTYgGMmjRcPDo39UYSpuArgY2a32ypUlJxYCXYf6c0kL8l4MGks1 Et7vU3CR4oAnCeJry2etn4DtkVBvlwRXNCCHpYWiITNNkdj2rg15VmVYcLffn++5bXfF ia9Fzj2t+lUkNHwXU2su6M3Fl6CN9eQyJbcBDtRUDgCDAeVqkegcI3D7+J5RMtwIiFNs v6HA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a72ab095e3csi621142466b.768.2024.07.04.00.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jul 2024 00:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 A79E78897C; Thu, 4 Jul 2024 09:38:23 +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 1850688974; Thu, 4 Jul 2024 09:38:23 +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 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 DFCC98895E for ; Thu, 4 Jul 2024 09:38:20 +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 6D54EDA7; Thu, 4 Jul 2024 00:38:45 -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 325D63F762; Thu, 4 Jul 2024 00:38:16 -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 , Michal Simek , Sughosh Ganu Subject: [RFC PATCH v2 37/48] event: add event to notify lmb memory map changes Date: Thu, 4 Jul 2024 13:05:33 +0530 Message-Id: <20240704073544.670249-38-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240704073544.670249-1-sughosh.ganu@linaro.org> References: <20240704073544.670249-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 --- Changes since V1: * Remove the event for EFI notifications. 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; }; /**