Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp149417lqb; Tue, 4 Jun 2024 07:36:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTqYl8+0dbsVnSNua+LBIyw0ZSUBGlpuZqgO+5qF6vWKRNfFU4T97BPHXgXpnKGyDYct4JXJQL0YJ9rKp2uHC/mc76pSqoe2hy+E1Zyw== X-Google-Smtp-Source: AGHT+IG5u/Gxy/gjljm86ZOvtaMYXE+5okmWpLJ5UYWJLZ/xcap15Sh7HIGLIbJrlM7d2R2ATDXH X-Received: by 2002:a05:620a:4691:b0:794:f60e:c050 with SMTP id af79cd13be357-794f60f260cmr1444102485a.71.1717511818698; Tue, 04 Jun 2024 07:36:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717511818; cv=pass; d=google.com; s=arc-20160816; b=z7TsMYEPzIYCiuHi0MGHNDMOo23Wl1HugFLLvkuQoAJqpBIaDr8mlhER5O11rE5WZe PKnE95AjRHW2nqGOC4zQotA0Rlz4afi8N2YM9UK7gMP1dWAyBsznPSrrOtuJipt5Q+Ai Jqay9ucriwwYxs3u7biFUNIDAako+8jT4ezccrCkcGEOPELiULPAPObtFirOVFkQKt+U EfIN74sXIS6fEl4mBGhyfRenUZMngrdAh9+ldbt2fbqsG/EbG0MhZ68NhJww5qGXvLlv ewjAgrvo2HUoM38AhPw7pVLSkkuNGnxhlTQUGvVOEGuQWyBr290xq4cqpJwPa8S5m3mo Vknw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=A4uNHw4IdNH7fEJoQz/HvgEwiOBjKF4oOnqTDtpQz9s=; fh=PS2xZ37x6i1et2MxEVJy4TSpqrJZGNwd6DyYCR5/2fw=; b=JnZ1kDwicMf4WiaM7zlLf4fj7vx434g02/4SohTMtnRuefZ2Sh7SMHNeKPFYKMW5Tq h1Be1MIePUthDen5IEV2tsxABBTs4i01GQuOBeH7fFTZoy8GA80mxXS6yY7YTT3sDemD 7PPcIdYvWkrVqaJWS+NuzU28JWOoFRQIFezYZZBTYpGtCRLCIxi12j+ifp59pd8cbiej 6W8CYIkUCbeEhbSDk8V3FGDuAEKjWWAMRCclafYPefv3DfYZg017rUR+/ZlubUdQS423 hV1V6HbTH+gKAo4OiKPL4Kj8Wn2LATHz3GjHpNCpbckc4xWz0QhrelFkUiAdNlXsHLgG YDJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-200832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795149600fesi205088285a.574.2024.06.04.07.36.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-200832-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BCAAD1C25664 for ; Tue, 4 Jun 2024 14:35:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03457145B3A; Tue, 4 Jun 2024 14:32:40 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CE3D13CFBD; Tue, 4 Jun 2024 14:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717511559; cv=none; b=VRy5amiAWAVf5yYpah873rSHTy8vKBBpFi1LBf/PmR8x5FwtT2lSgcCgi6tCK4kxLHR6SDLOjxTIRZiNf0DfSgtXg8LQpCryHRKhmU3Jz9UHJOXLam4pbe6+oVFUiELdDYcWvaht3lV7zcdietxd7kSOdiziAMPe+QDMHEW4v+U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717511559; c=relaxed/simple; bh=dURqEr78iL4SJ+PjS1h9hXb4BsJXz45pIuev3F2tKPI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XcmHclsmPGfqzyDlIPmk7qgjGA4IHOZvnrZgZZH42gaXGwSFDqMldVXaE75VUE4NrQIZ/Sj5SmoQDIrm9Maj19i1tr5JQPpfuP7GCgVyy2TFov/ynBG0CYF+fnkYJzLV+GmVHy7kVwPGBHBk4MgB0B+DjmrT5fBV+US4xKXz/cc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 122B71042; Tue, 4 Jun 2024 07:33:02 -0700 (PDT) Received: from e127643.broadband (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AEB263F64C; Tue, 4 Jun 2024 07:32:34 -0700 (PDT) From: James Clark To: coresight@lists.linaro.org, suzuki.poulose@arm.com, gankulkarni@os.amperecomputing.com, mike.leach@linaro.org, leo.yan@linux.dev, anshuman.khandual@arm.com Cc: James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org Subject: [PATCH v2 10/16] coresight: Move struct coresight_trace_id_map to common header Date: Tue, 4 Jun 2024 15:30:19 +0100 Message-Id: <20240604143030.519906-11-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604143030.519906-1-james.clark@arm.com> References: <20240604143030.519906-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The trace ID maps will need to be created and stored by the core and Perf code so move the definition up to the common header. Reviewed-by: Anshuman Khandual Reviewed-by: Mike Leach Signed-off-by: James Clark --- .../hwtracing/coresight/coresight-trace-id.c | 1 + .../hwtracing/coresight/coresight-trace-id.h | 19 ------------------- include/linux/coresight.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-trace-id.c b/drivers/hwtracing/coresight/coresight-trace-id.c index af5b4ef59cea..19005b5b4dc4 100644 --- a/drivers/hwtracing/coresight/coresight-trace-id.c +++ b/drivers/hwtracing/coresight/coresight-trace-id.c @@ -3,6 +3,7 @@ * Copyright (c) 2022, Linaro Limited, All rights reserved. * Author: Mike Leach */ +#include #include #include #include diff --git a/drivers/hwtracing/coresight/coresight-trace-id.h b/drivers/hwtracing/coresight/coresight-trace-id.h index 3797777d367e..49438a96fcc6 100644 --- a/drivers/hwtracing/coresight/coresight-trace-id.h +++ b/drivers/hwtracing/coresight/coresight-trace-id.h @@ -32,10 +32,6 @@ #include #include - -/* architecturally we have 128 IDs some of which are reserved */ -#define CORESIGHT_TRACE_IDS_MAX 128 - /* ID 0 is reserved */ #define CORESIGHT_TRACE_ID_RES_0 0 @@ -46,21 +42,6 @@ #define IS_VALID_CS_TRACE_ID(id) \ ((id > CORESIGHT_TRACE_ID_RES_0) && (id < CORESIGHT_TRACE_ID_RES_TOP)) -/** - * Trace ID map. - * - * @used_ids: Bitmap to register available (bit = 0) and in use (bit = 1) IDs. - * Initialised so that the reserved IDs are permanently marked as - * in use. - * @pend_rel_ids: CPU IDs that have been released by the trace source but not - * yet marked as available, to allow re-allocation to the same - * CPU during a perf session. - */ -struct coresight_trace_id_map { - DECLARE_BITMAP(used_ids, CORESIGHT_TRACE_IDS_MAX); - DECLARE_BITMAP(pend_rel_ids, CORESIGHT_TRACE_IDS_MAX); -}; - /* Allocate and release IDs for a single default trace ID map */ /** diff --git a/include/linux/coresight.h b/include/linux/coresight.h index f09ace92176e..c16c61a8411d 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -218,6 +218,24 @@ struct coresight_sysfs_link { const char *target_name; }; +/* architecturally we have 128 IDs some of which are reserved */ +#define CORESIGHT_TRACE_IDS_MAX 128 + +/** + * Trace ID map. + * + * @used_ids: Bitmap to register available (bit = 0) and in use (bit = 1) IDs. + * Initialised so that the reserved IDs are permanently marked as + * in use. + * @pend_rel_ids: CPU IDs that have been released by the trace source but not + * yet marked as available, to allow re-allocation to the same + * CPU during a perf session. + */ +struct coresight_trace_id_map { + DECLARE_BITMAP(used_ids, CORESIGHT_TRACE_IDS_MAX); + DECLARE_BITMAP(pend_rel_ids, CORESIGHT_TRACE_IDS_MAX); +}; + /** * struct coresight_device - representation of a device as used by the framework * @pdata: Platform data with device connections associated to this device. -- 2.34.1