From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0490C3451A3 for ; Sun, 11 Jan 2026 12:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133023; cv=none; b=YUKpn+8v42MIjwDxuo9O3ATzv0Rvt5Lh3FpGSWuagdzWEjwjn+wuknQ23+EmO1uGxTKpfv1CPn/WDPjRRAmZ8lBbw7EIoFIvJCpPU15PCWDL8cN6JGJX0vdw/vYVLeqX2V7eOSXKE0MwjvSovMLknkNDIEj6zCpSr8JJsfvWyc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133023; c=relaxed/simple; bh=yx+gv/xAymZl+d+eHImkyY7GWtHhYND6trIBTTk4w4M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DJJ6JjLTPRX6bHii46X+eZ3zF4K0VJKf+UTWAHr7oN+vPxbBQ9K+eQidGHwlDWORRUpAeDndtEXbrCbdyqdN9vKmhuaTE7oaynTgSccm78NJwYOuVbel5l4fPYcnNtZ3fqHiH6A7X/sDVaCfko8TJNterbOd56XQx6WHJMBXPOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BBlDdDnx; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BBlDdDnx" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-88a3bba9fd4so57366306d6.2 for ; Sun, 11 Jan 2026 04:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768133021; x=1768737821; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=zC8Ug+qUFJmMJ1Uojp7b3+ocpmm/yqP7ArwJepoYoVA=; b=BBlDdDnxk+wd/xH6B2nXt4L+NJIpIO3Q5OE0hKPPOUd54gR3UWsfWevBHEhMSgNzpU UXdvfPYjAz/Zd+QNfcKLo75wNvSlXDm7h1LgKgNyRbPQb6LxqC5txdnKv23FM1PDR26c j1JXSii8nPQ7DqZdyVaPP12lLcinwO333NMs17wdJwbVRL21ik6oOl4btPB92PXHX3Bu Bn4U4LcZ3y4F1oUYWjooEJHXqPAbPDQbe1ZWB9qGsCrMekL6qohpzYwfoFkd5aomuUWu 6P4pjQfwLc/vfG+lDzT+OV6W777pjmB+VWpheCK5vVUU/hZ6nkiX7tFcCF8IHhgn9NNI aPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768133021; x=1768737821; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zC8Ug+qUFJmMJ1Uojp7b3+ocpmm/yqP7ArwJepoYoVA=; b=VAN4xbhW1yff7XqNE1pjY70TsbQld5Mko+ADeR61I+RbluZmf8MCNg4zgDvi8K7GQA 6c/hfH5vh67YZH0PedlsULJG09dxi4MrV0yJzGOWW2mojf9zXvaH1r3S3skpWyppmwg1 0vcuxt0q2dyAkdyNpxqvcIk7B81JN9DZy4UKWqVscpuW6GHNMAIahdIJcMbcheSGk3QI Muei7fqbYYrbDUXqa6m3SQAi7JaV/MLE4YlTyPe+TRGJ/Ir8MptXH9pf+N6qbx5ITQoA ohxm7JriA5FNiZGrFAe/93BOyQdmw7Rurcb/sbqbBG32K7A9hCftMOPbjABqY7OtDsup t5uw== X-Forwarded-Encrypted: i=1; AJvYcCUaLYqqlgsWOP1kI6vRJXhA7a8XY+91JguazoYaFep5QjStnwj9bvofyFMinL0vB5040UQnjJ+HSaGWumA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9vvrADM8ahDZc2AFRfqkb45K9nOWkF8Wzxb1Ex54DpfxZBrKb 79XNfk3/OaBHR4fQUZyXRK9rmkGfnVkLpoDGyvGbn/2GWv4IdokzNr/F X-Gm-Gg: AY/fxX7g8B9HiiwTJJDdMOke5ZKu4Mi/nZgUkxJmrmsV4U5AdirTItMPY6R8d7xhtQt 57S2QnK0jO7jdGao6eAooFWhmmioLegsJEe91fr4a4yiIcQf0Idh6XCEBBZ9Tg7q6FBa/DGpWzA /rSRM0A56X3H1PIl8rI4+wxinrEVKNEm1JgaiCZetif91wC5JaqJD27mZaK3HVHKCRasro3eaXC Bl29voWr9qjW2rvx4LbCo8QN7uTsS2OCOiH4UZ/rowq93gFVfF1xPwdWpLskO9uv6ZFusi3uCRu 15T0LG7aiY2QKx9ZdInGUwMogaoShZvBpbuorq4DLewccf84SQmJhEjHr7yKqHDioKHDKJpTJ4X 5Yn440/4/EhVFqs9EH2IyBNqWmc3+loFHwfLvGkBNd1fbtkcnE9mbxTUwuI7kRt+DW3t71XxMku ILrC5JRNfrqz/xrcDuZ8iuK26eYWyyV7ntw5QMPfubGHbMMpNtuOQWlXsz03C6NsxTngOozWCrn WN8FRYYPZvX7e8= X-Google-Smtp-Source: AGHT+IGy+HUcaVxoQiPKmtvxKDdM/F7psZsD64W60zWijVnp1kJuuBjP/Q1CgxNg46WCTFJ3g43udA== X-Received: by 2002:ad4:5d47:0:b0:87c:28cc:9e69 with SMTP id 6a1803df08f44-89084262977mr220587016d6.55.1768133020865; Sun, 11 Jan 2026 04:03:40 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-890770e8cfasm116951846d6.21.2026.01.11.04.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jan 2026 04:03:40 -0800 (PST) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id EAFA9F40068; Sun, 11 Jan 2026 07:03:39 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Sun, 11 Jan 2026 07:03:39 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudeghedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpedvveekvddtffelffelfedvudefffeuheejgeeivedufffgledvgeduveffueeh leenucffohhmrghinhepmhhsghhiugdrlhhinhhknecuvehluhhsthgvrhfuihiivgepfe enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhiisehinhhfrh gruggvrggurdhorhhgpdhrtghpthhtohepmhhinhhgoheskhgvrhhnvghlrdhorhhgpdhr tghpthhtoheprhhushhtqdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorh hgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrg hrkhdrrhhuthhlrghnugesrghrmhdrtghomhdprhgtphhtthhopehtghhlgieslhhinhhu thhrohhnihigrdguvgdprhgtphhtthhopehojhgvuggrsehkvghrnhgvlhdrohhrghdprh gtphhtthhopehgrghrhiesghgrrhihghhuohdrnhgvth X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 Jan 2026 07:03:39 -0500 (EST) From: Boqun Feng To: "Peter Zijlstra" , "Ingo Molnar" Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, "Will Deacon" , "Mark Rutland" , "Thomas Gleixner" , "Miguel Ojeda" , "Gary Guo" , "Alice Ryhl" , "Andreas Hindborg" , "Benno Lossin" , "Danilo Krummrich" , Boqun Feng Subject: [PATCH 33/36] rust: time: Add __rust_helper to helpers Date: Sun, 11 Jan 2026 20:02:06 +0800 Message-ID: <20260111120209.6133-31-boqun.feng@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260111120209.6133-1-boqun.feng@gmail.com> References: <20260111115808.5702-1-boqun.feng@gmail.com> <20260111120209.6133-1-boqun.feng@gmail.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 From: Alice Ryhl This is needed to inline these helpers into Rust code. Reviewed-by: Boqun Feng Reviewed-by: Gary Guo Signed-off-by: Alice Ryhl Signed-off-by: Boqun Feng Link: https://patch.msgid.link/20260105-define-rust-helper-v2-22-51da5f454a67@google.com --- rust/helpers/time.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/helpers/time.c b/rust/helpers/time.c index 67a36ccc3ec4..32f495970493 100644 --- a/rust/helpers/time.c +++ b/rust/helpers/time.c @@ -4,37 +4,37 @@ #include #include -void rust_helper_fsleep(unsigned long usecs) +__rust_helper void rust_helper_fsleep(unsigned long usecs) { fsleep(usecs); } -ktime_t rust_helper_ktime_get_real(void) +__rust_helper ktime_t rust_helper_ktime_get_real(void) { return ktime_get_real(); } -ktime_t rust_helper_ktime_get_boottime(void) +__rust_helper ktime_t rust_helper_ktime_get_boottime(void) { return ktime_get_boottime(); } -ktime_t rust_helper_ktime_get_clocktai(void) +__rust_helper ktime_t rust_helper_ktime_get_clocktai(void) { return ktime_get_clocktai(); } -s64 rust_helper_ktime_to_us(const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_us(const ktime_t kt) { return ktime_to_us(kt); } -s64 rust_helper_ktime_to_ms(const ktime_t kt) +__rust_helper s64 rust_helper_ktime_to_ms(const ktime_t kt) { return ktime_to_ms(kt); } -void rust_helper_udelay(unsigned long usec) +__rust_helper void rust_helper_udelay(unsigned long usec) { udelay(usec); } -- 2.51.0