All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Anup Patel <anup.patel@oss.qualcomm.com>
Cc: Atish Patra <atish.patra@linux.dev>,
	 Andrew Jones <andrew.jones@oss.qualcomm.com>,
	Samuel Holland <samuel.holland@sifive.com>,
	 Anup Patel <anup@brainfault.org>,
	opensbi@lists.infradead.org
Subject: Re: [PATCH 1/3] include: sbi: Add sbi_scratch_hartindex() macro
Date: Thu, 23 Apr 2026 16:55:06 +1000	[thread overview]
Message-ID: <aenCOuhEsaT1c9KK@lima-default> (raw)
In-Reply-To: <20260415110002.2610929-2-anup.patel@oss.qualcomm.com>

On Wed, Apr 15, 2026 at 04:30:00PM +0530, Anup Patel wrote:
> Add helper macro to extract hart index from scratch pointer. This
> can be used to check whether scratch pointer belongs to a particular
> hart or not.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

> 
> Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
> ---
>  include/sbi/sbi_scratch.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
> index 58d54628..c12aa796 100644
> --- a/include/sbi/sbi_scratch.h
> +++ b/include/sbi/sbi_scratch.h
> @@ -166,9 +166,11 @@ do {									\
>  					= (__type)(__ptr);		\
>  } while (0)
>  
> +/** Get the hart index of a particular sbi_scratch */
> +#define sbi_scratch_hartindex(__scratch) ((__scratch)->hartindex)
> +
>  /** Get the hart index of the current hart */
> -#define current_hartindex() \
> -	(sbi_scratch_thishart_ptr()->hartindex)
> +#define current_hartindex() sbi_scratch_hartindex(sbi_scratch_thishart_ptr())
>  
>  /** Number of harts managed by this OpenSBI instance */
>  extern u32 sbi_scratch_hart_count;
> -- 
> 2.43.0
> 
> 
> -- 
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

  reply	other threads:[~2026-04-23  6:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 10:59 [PATCH 0/3] Timer events for OpenSBI Anup Patel
2026-04-15 11:00 ` [PATCH 1/3] include: sbi: Add sbi_scratch_hartindex() macro Anup Patel
2026-04-23  6:55   ` Nicholas Piggin [this message]
2026-04-15 11:00 ` [PATCH 2/3] lib: sbi_timer: Introduce per-HART timer state Anup Patel
2026-04-23  6:55   ` Nicholas Piggin
2026-04-15 11:00 ` [PATCH 3/3] lib: sbi_timer: Add support for timer events Anup Patel
2026-04-23  6:54   ` Nicholas Piggin
2026-04-23  8:25     ` Anup Patel
2026-04-24  1:09       ` Nicholas Piggin
2026-04-23  6:57 ` [PATCH 0/3] Timer events for OpenSBI Nicholas Piggin
2026-04-23  8:08   ` Anup Patel
2026-04-24  3:56     ` Nicholas Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aenCOuhEsaT1c9KK@lima-default \
    --to=npiggin@gmail.com \
    --cc=andrew.jones@oss.qualcomm.com \
    --cc=anup.patel@oss.qualcomm.com \
    --cc=anup@brainfault.org \
    --cc=atish.patra@linux.dev \
    --cc=opensbi@lists.infradead.org \
    --cc=samuel.holland@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.