| /linux/tools/testing/radix-tree/ |
| H A D | idr-test.c | 25 void item_idr_remove(struct idr *idr, int id) in item_idr_remove() argument 27 struct item *item = idr_find(idr, id); in item_idr_remove() 29 idr_remove(idr, id); in item_idr_remove() 36 DEFINE_IDR(idr); in idr_alloc_test() 38 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0, 0x4000, GFP_KERNEL) == 0); in idr_alloc_test() 39 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0x3ffd, 0x4000, GFP_KERNEL) == 0x3ffd); in idr_alloc_test() 40 idr_remove(&idr, 0x3ffd); in idr_alloc_test() 41 idr_remove(&idr, 0); in idr_alloc_test() 52 id = idr_alloc_cyclic(&idr, item, 1, 0x4000, GFP_KERNEL); in idr_alloc_test() 56 idr_for_each(&idr, item_idr_free, &idr); in idr_alloc_test() [all …]
|
| H A D | Makefile | 5 TARGETS = main idr-test multiorder xarray maple 8 regression3.o regression4.o tag_check.o multiorder.o idr-test.o \ 18 idr-test.o: ../../../lib/test_ida.c 19 idr-test: idr-test.o $(CORE_OFILES) 28 $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/*
|
| H A D | .gitignore | 5 idr.c 6 idr-test
|
| /linux/include/linux/ |
| H A D | idr.h | 20 struct idr { struct 57 #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) 67 static inline unsigned int idr_get_cursor(const struct idr *idr) in idr_get_cursor() argument 69 return READ_ONCE(idr->idr_next); in idr_get_cursor() 80 static inline void idr_set_cursor(struct idr *idr, unsigned int val) in idr_set_cursor() argument 82 WRITE_ONCE(idr->idr_next, val); in idr_set_cursor() 102 #define idr_lock(idr) xa_lock(&(idr)->idr_rt) argument 103 #define idr_unlock(idr) xa_unlock(&(idr)->idr_rt) argument 104 #define idr_lock_bh(idr) xa_lock_bh(&(idr)->idr_rt) argument 105 #define idr_unlock_bh(idr) xa_unlock_bh(&(idr)->idr_rt) argument [all …]
|
| H A D | powercap.h | 66 struct idr idr; member 143 struct idr idr; member 144 struct idr *parent_idr;
|
| H A D | pid_namespace.h | 27 struct idr idr; member
|
| /linux/lib/ |
| H A D | idr.c | 33 int idr_alloc_u32(struct idr *idr, void *ptr, u32 *nextid, in idr_alloc_u32() argument 38 unsigned int base = idr->idr_base; in idr_alloc_u32() 41 if (WARN_ON_ONCE(!(idr->idr_rt.xa_flags & ROOT_IS_IDR))) in idr_alloc_u32() 42 idr->idr_rt.xa_flags |= IDR_RT_MARKER; in idr_alloc_u32() 48 slot = idr_get_free(&idr->idr_rt, &iter, gfp, max - base); in idr_alloc_u32() 54 radix_tree_iter_replace(&idr->idr_rt, &iter, slot, ptr); in idr_alloc_u32() 55 radix_tree_iter_tag_clear(&idr->idr_rt, &iter, IDR_FREE); in idr_alloc_u32() 81 int idr_alloc(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc() argument 89 ret = idr_alloc_u32(idr, ptr, &id, end > 0 ? end - 1 : INT_MAX, gfp); in idr_alloc() 119 int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc_cyclic() argument [all …]
|
| /linux/Documentation/translations/zh_CN/core-api/ |
| H A D | idr.rst | 5 :Original: Documentation/core-api/idr.rst 66 IDR同步的相关内容请见include/linux/idr.h文件中的“DOC: idr sync”。 71 IDA的用法的相关内容请见lib/idr.c文件中的“DOC: IDA description”。 78 include/linux/idr.h 80 lib/idr.c
|
| /linux/drivers/reset/ |
| H A D | reset-ti-sci.c | 40 struct idr idr; member 72 control = idr_find(&data->idr, id); in ti_sci_reset_set() 153 control = idr_find(&data->idr, id); in ti_sci_reset_status() 201 return idr_alloc(&data->idr, control, 0, 0, GFP_KERNEL); in ti_sci_reset_of_xlate() 231 idr_init(&data->idr); in ti_sci_reset_probe() 244 idr_destroy(&data->idr); in ti_sci_reset_remove()
|
| /linux/sound/soc/qcom/qdsp6/ |
| H A D | q6apm.h | 64 struct idr graph_idr; 65 struct idr graph_info_idr; 66 struct idr sub_graphs_idr; 67 struct idr containers_idr; 68 struct idr modules_idr;
|
| /linux/drivers/irqchip/ |
| H A D | irq-gic-v5-irs.c | 685 u32 idr, spi_count; in gicv5_irs_init() local 710 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1); in gicv5_irs_init() 711 iaffid_bits = FIELD_GET(GICV5_IRS_IDR1_IAFFID_BITS, idr) + 1; in gicv5_irs_init() 719 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR2); in gicv5_irs_init() 720 if (WARN(!FIELD_GET(GICV5_IRS_IDR2_LPI, idr), in gicv5_irs_init() 726 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR7); in gicv5_irs_init() 727 irs_data->spi_min = FIELD_GET(GICV5_IRS_IDR7_SPI_BASE, idr); in gicv5_irs_init() 729 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR6); in gicv5_irs_init() 730 irs_data->spi_range = FIELD_GET(GICV5_IRS_IDR6_SPI_IRS_RANGE, idr); in gicv5_irs_init() 747 idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR1); in gicv5_irs_init() [all …]
|
| /linux/include/drm/ |
| H A D | drm_auth.h | 64 struct idr magic_map; 121 struct idr leases; 129 struct idr lessee_idr;
|
| H A D | drm_file.h | 314 struct idr object_idr; 320 struct idr syncobj_idr;
|
| /linux/drivers/tee/optee/ |
| H A D | supp.c | 27 idr_init(&supp->idr); in optee_supp_init() 35 idr_destroy(&supp->idr); in optee_supp_uninit() 47 idr_for_each_entry(&supp->idr, req, id) { in optee_supp_release() 48 idr_remove(&supp->idr, id); in optee_supp_release() 156 *id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL); in supp_pop_entry() 296 req = idr_find(&supp->idr, id); in supp_pop_req() 303 idr_remove(&supp->idr, id); in supp_pop_req()
|
| /linux/drivers/gpu/drm/vmwgfx/ |
| H A D | ttm_object.c | 97 struct idr idr; member 203 ret = idr_alloc(&tdev->idr, base, 1, 0, GFP_NOWAIT); in ttm_base_object_init() 219 idr_remove(&tdev->idr, base->handle); in ttm_base_object_init() 231 idr_remove(&tdev->idr, base->handle); in ttm_release_base() 281 base = idr_find(&tdev->idr, key); in ttm_base_object_lookup_for_ref() 440 idr_init_base(&tdev->idr, VMWGFX_NUM_MOB + 1); in ttm_object_device_init() 453 WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); in ttm_object_device_release() 454 idr_destroy(&tdev->idr); in ttm_object_device_release()
|
| /linux/tools/testing/shared/ |
| H A D | shared.mk | 11 SHARED_OFILES = xarray-shared.o radix-tree.o idr.o linux.o $(LIBS) 22 ../../../include/linux/idr.h \ 50 idr.c: ../../../lib/idr.c
|
| /linux/kernel/ |
| H A D | pid.c | 75 .idr = IDR_INIT(init_pid_ns.idr), 142 idr_remove(&ns->idr, upid->nr); in free_pid() 216 nr = idr_alloc(&tmp->idr, NULL, tid, in alloc_pid() 230 if (idr_get_cursor(&tmp->idr) > RESERVED_PIDS) in alloc_pid() 237 nr = idr_alloc_cyclic(&tmp->idr, NULL, pid_min, in alloc_pid() 280 idr_replace(&upid->ns->idr, pid, upid->nr); in alloc_pid() 298 idr_remove(&upid->ns->idr, upid->nr); in alloc_pid() 303 idr_set_cursor(&ns->idr, 0); in alloc_pid() 320 return idr_find(&ns->idr, nr); in find_pid_ns() 539 return idr_get_next(&ns->idr, &nr); in find_ge_pid() [all …]
|
| H A D | pid_namespace.c | 100 idr_init(&ns->idr); in create_pid_namespace() 132 idr_destroy(&ns->idr); in create_pid_namespace() 157 idr_destroy(&ns->idr); in destroy_pid_namespace() 228 idr_for_each_entry_continue(&pid_ns->idr, pid, nr) { in zap_pid_ns_processes() 296 next = idr_get_cursor(&pid_ns->idr) - 1; in pid_ns_ctl_handler() 302 idr_set_cursor(&pid_ns->idr, next + 1); in pid_ns_ctl_handler()
|
| /linux/Documentation/core-api/ |
| H A D | idr.rst | 69 .. kernel-doc:: include/linux/idr.h 70 :doc: idr sync 75 .. kernel-doc:: lib/idr.c 81 .. kernel-doc:: include/linux/idr.h 83 .. kernel-doc:: lib/idr.c
|
| /linux/drivers/tee/ |
| H A D | tee_shm.c | 163 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_alloc_user_buf() 171 idr_remove(&teedev->idr, id); in tee_shm_alloc_user_buf() 177 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_alloc_user_buf() 241 ref->shm.id = idr_alloc(&ref->shm.ctx->teedev->idr, &ref->shm, in tee_shm_register_fd() 537 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_register_user_buf() 546 idr_remove(&teedev->idr, id); in tee_shm_register_user_buf() 552 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_register_user_buf() 701 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id() 738 idr_remove(&teedev->idr, shm->id); in tee_shm_put()
|
| /linux/drivers/counter/ |
| H A D | 104-quad-8.c | 64 u8 idr[QUAD8_NUM_COUNTERS]; member 394 synchronous_mode = u8_get_bits(priv->idr[id], INDEX_MODE) == ENABLE_INDEX_MODE; in quad8_function_write() 396 ret = quad8_control_register_update(priv->map, priv->idr, id, DISABLE_INDEX_MODE, in quad8_function_write() 603 *index_polarity = u8_get_bits(priv->idr[channel_id], INDEX_POLARITY); in quad8_index_polarity_get() 619 ret = quad8_control_register_update(priv->map, priv->idr, channel_id, index_polarity, in quad8_index_polarity_set() 666 *synchronous_mode = u8_get_bits(priv->idr[channel_id], INDEX_MODE); in quad8_synchronous_mode_get() 684 quadrature_mode = u8_get_bits(priv->idr[channel_id], QUADRATURE_MODE); in quad8_synchronous_mode_set() 690 ret = quad8_control_register_update(priv->map, priv->idr, channel_id, synchronous_mode, in quad8_synchronous_mode_set() 1270 priv->idr[channel] = SELECT_IDR | u8_encode_bits(DISABLE_INDEX_MODE, INDEX_MODE) | in quad8_init_counter() 1272 return regmap_write(priv->map, QUAD8_CONTROL(channel), priv->idr[channel]); in quad8_init_counter()
|
| /linux/drivers/misc/ocxl/ |
| H A D | ocxl_internal.h | 48 struct idr contexts_idr; 81 struct idr irq_idr;
|
| /linux/sound/soc/atmel/ |
| H A D | mchp-spdiftx.c | 245 u32 sr, imr, pending, idr = 0; in mchp_spdiftx_interrupt() local 256 idr |= SPDIFTX_IR_TXUDR; in mchp_spdiftx_interrupt() 261 idr |= SPDIFTX_IR_TXOVR; in mchp_spdiftx_interrupt() 268 idr |= SPDIFTX_IR_UDRDY; in mchp_spdiftx_interrupt() 275 idr |= SPDIFTX_IR_CSRDY; in mchp_spdiftx_interrupt() 278 regmap_write(dev->regmap, SPDIFTX_IDR, idr); in mchp_spdiftx_interrupt()
|
| /linux/drivers/char/ipmi/ |
| H A D | kcs_bmc_aspeed.c | 491 { .idr = LPC_IDR1, .odr = LPC_ODR1, .str = LPC_STR1 }, 492 { .idr = LPC_IDR2, .odr = LPC_ODR2, .str = LPC_STR2 }, 493 { .idr = LPC_IDR3, .odr = LPC_ODR3, .str = LPC_STR3 }, 494 { .idr = LPC_IDR4, .odr = LPC_ODR4, .str = LPC_STR4 }, 510 ioreg.idr = be32_to_cpup(reg); in aspeed_kcs_of_get_channel()
|
| /linux/fs/notify/inotify/ |
| H A D | inotify_fsnotify.c | 181 idr_for_each(&group->inotify_data.idr, idr_callback, group); in inotify_free_group_priv() 182 idr_destroy(&group->inotify_data.idr); in inotify_free_group_priv()
|