From 67ce5a763cfbcfb2edca7eab3d383e15d1a7330f Mon Sep 17 00:00:00 2001 From: Cheng Yang Date: Thu, 8 Feb 2024 11:14:32 +0800 Subject: platform: generic: Add support for specify coldboot harts in DT Added support for the generic platform to specify the set of coldboot hart in DT. If not specified in DT, all harts are allowed to coldboot as before. The functions related to sbi_hartmask are not available before coldboot, so I used bitmap, and added a new bitmap_test() function to test whether a certain bit of the bitmap is set. Signed-off-by: Cheng Yang Reviewed-by: Anup Patel --- include/sbi/sbi_bitmap.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/sbi/sbi_bitmap.h b/include/sbi/sbi_bitmap.h index 4f0ebb63..354476c9 100644 --- a/include/sbi/sbi_bitmap.h +++ b/include/sbi/sbi_bitmap.h @@ -62,6 +62,11 @@ static inline void bitmap_zero(unsigned long *dst, int nbits) } } +static inline int bitmap_test(unsigned long *bmap, int bit) +{ + return __test_bit(bit, bmap); +} + static inline void bitmap_zero_except(unsigned long *dst, int exception, int nbits) { -- cgit v1.3.1