diff options
| author | GuEe-GUI <[email protected]> | 2024-12-20 14:45:08 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2025-02-11 14:58:18 +0800 |
| commit | 578cfc0b2a8c769630199f8a1cc12fcef42e8b8f (patch) | |
| tree | 0310bb41c67c15108808fd7c6afdea6bbddb5ec2 /components/drivers | |
| parent | d41a0351dbbd11c555143cd1053cdd6a01857d1f (diff) | |
[DM/CORE] Add IDA init in runtime
Signed-off-by: GuEe-GUI <[email protected]>
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/include/drivers/core/dm.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/core/dm.h b/components/drivers/include/drivers/core/dm.h index 1a3723a650..4c110ca7eb 100644 --- a/components/drivers/include/drivers/core/dm.h +++ b/components/drivers/include/drivers/core/dm.h @@ -40,6 +40,11 @@ struct rt_dm_ida }; #define RT_DM_IDA_INIT(id) { .master_id = MASTER_ID_##id } +#define rt_dm_ida_init(ida, id) \ +do { \ + (ida)->master_id = MASTER_ID_##id; \ + rt_spin_lock_init(&(ida)->lock); \ +} while (0) int rt_dm_ida_alloc(struct rt_dm_ida *ida); rt_bool_t rt_dm_ida_take(struct rt_dm_ida *ida, int id); |
