| /linux/tools/perf/util/ |
| H A D | map.h | 26 DECLARE_RC_STRUCT(map) { in DECLARE_RC_STRUCT() argument 43 struct kmap *__map__kmap(struct map *map); 44 struct kmap *map__kmap(struct map *map); 45 struct maps *map__kmaps(struct map *map); 47 static inline struct dso *map__dso(const struct map *map) in map__dso() argument 49 return RC_CHK_ACCESS(map)->dso; in map__dso() 52 static inline u64 map__start(const struct map *map) in map__start() argument 54 return RC_CHK_ACCESS(map)->start; in map__start() 57 static inline u64 map__end(const struct map *map) in map__end() argument 59 return RC_CHK_ACCESS(map)->end; in map__end() [all …]
|
| H A D | map.c | 12 #include "map.h" 105 static void map__init(struct map *map, u64 start, u64 end, u64 pgoff, in map__init() argument 108 map__set_start(map, start); in map__init() 109 map__set_end(map, end); in map__init() 110 map__set_pgoff(map, pgoff); in map__init() 111 assert(map__reloc(map) == 0); in map__init() 112 map__set_dso(map, dso__get(dso)); in map__init() 113 refcount_set(map__refcnt(map), 1); in map__init() 114 RC_CHK_ACCESS(map)->prot = prot; in map__init() 115 RC_CHK_ACCESS(map)->flags = flags; in map__init() [all …]
|
| H A D | hashmap.c | 4 * Generic non-thread safe hash map implementation. 38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init() argument 41 map->hash_fn = hash_fn; in hashmap__init() 42 map->equal_fn = equal_fn; in hashmap__init() 43 map->ctx = ctx; in hashmap__init() 45 map->buckets = NULL; in hashmap__init() 46 map->cap = 0; in hashmap__init() 47 map->cap_bits = 0; in hashmap__init() 48 map->sz = 0; in hashmap__init() 55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new() local [all …]
|
| H A D | mmap.c | 40 size_t mmap__mmap_len(struct mmap *map) in mmap__mmap_len() argument 42 return perf_mmap__mmap_len(&map->core); in mmap__mmap_len() 72 static int perf_mmap__aio_enabled(struct mmap *map) in perf_mmap__aio_enabled() argument 74 return map->aio.nr_cblocks > 0; in perf_mmap__aio_enabled() 78 static int perf_mmap__aio_alloc(struct mmap *map, int idx) in perf_mmap__aio_alloc() argument 80 map->aio.data[idx] = mmap(NULL, mmap__mmap_len(map), PROT_READ|PROT_WRITE, in perf_mmap__aio_alloc() 82 if (map->aio.data[idx] == MAP_FAILED) { in perf_mmap__aio_alloc() 83 map->aio.data[idx] = NULL; in perf_mmap__aio_alloc() 90 static void perf_mmap__aio_free(struct mmap *map, int idx) in perf_mmap__aio_free() argument 92 if (map->aio.data[idx]) { in perf_mmap__aio_free() [all …]
|
| /linux/drivers/base/regmap/ |
| H A D | regmap.c | 3 // Register map access API 36 static inline bool regmap_should_log(struct regmap *map) in regmap_should_log() argument 38 return (map->dev && strcmp(dev_name(map->dev), LOG_DEVICE) == 0); in regmap_should_log() 41 static inline bool regmap_should_log(struct regmap *map) { return false; } in regmap_should_log() argument 45 static int _regmap_update_bits(struct regmap *map, unsigned int reg, 74 bool regmap_check_range_table(struct regmap *map, unsigned int reg, in regmap_check_range_table() argument 90 bool regmap_writeable(struct regmap *map, unsigned int reg) in regmap_writeable() argument 92 if (map->max_register_is_set && reg > map->max_register) in regmap_writeable() 95 if (map->writeable_reg) in regmap_writeable() 96 return map->writeable_reg(map->dev, reg); in regmap_writeable() [all …]
|
| H A D | regcache-rbtree.c | 17 static int regcache_rbtree_write(struct regmap *map, unsigned int reg, 19 static int regcache_rbtree_exit(struct regmap *map); 40 struct regmap *map, in regcache_rbtree_get_base_top_reg() argument 45 *top = rbnode->base_reg + ((rbnode->blklen - 1) * map->reg_stride); in regcache_rbtree_get_base_top_reg() 48 static unsigned int regcache_rbtree_get_register(struct regmap *map, in regcache_rbtree_get_register() argument 51 return regcache_get_val(map, rbnode->block, idx); in regcache_rbtree_get_register() 54 static void regcache_rbtree_set_register(struct regmap *map, in regcache_rbtree_set_register() argument 59 regcache_set_val(map, rbnode->block, idx, val); in regcache_rbtree_set_register() 62 static struct regcache_rbtree_node *regcache_rbtree_lookup(struct regmap *map, in regcache_rbtree_lookup() argument 65 struct regcache_rbtree_ctx *rbtree_ctx = map->cache; in regcache_rbtree_lookup() [all …]
|
| /linux/drivers/mtd/maps/ |
| H A D | pci.c | 7 * Generic PCI memory map driver. We support the following boards: 17 #include <linux/mtd/map.h> 23 int (*init)(struct pci_dev *dev, struct map_pci_info *map); 24 void (*exit)(struct pci_dev *dev, struct map_pci_info *map); 25 unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs); 30 struct map_info map; member 32 void (*exit)(struct pci_dev *dev, struct map_pci_info *map); 33 unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs); 39 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_read8() local 41 val.x[0]= readb(map->base + map->translate(map, ofs)); in mtd_pci_read8() [all …]
|
| H A D | amd76xrom.c | 15 #include <linux/mtd/map.h> 42 struct map_info map; member 71 struct amd76xrom_map_info *map, *scratch; in amd76xrom_cleanup() local 82 list_for_each_entry_safe(map, scratch, &window->maps, list) { in amd76xrom_cleanup() 83 if (map->rsrc.parent) { in amd76xrom_cleanup() 84 release_resource(&map->rsrc); in amd76xrom_cleanup() 86 mtd_device_unregister(map->mtd); in amd76xrom_cleanup() 87 map_destroy(map->mtd); in amd76xrom_cleanup() 88 list_del(&map->list); in amd76xrom_cleanup() 89 kfree(map); in amd76xrom_cleanup() [all …]
|
| H A D | ichxrom.c | 15 #include <linux/mtd/map.h> 47 struct map_info map; member 59 struct ichxrom_map_info *map, *scratch; in ichxrom_cleanup() local 70 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ichxrom_cleanup() 71 if (map->rsrc.parent) in ichxrom_cleanup() 72 release_resource(&map->rsrc); in ichxrom_cleanup() 73 mtd_device_unregister(map->mtd); in ichxrom_cleanup() 74 map_destroy(map->mtd); in ichxrom_cleanup() 75 list_del(&map->list); in ichxrom_cleanup() 76 kfree(map); in ichxrom_cleanup() [all …]
|
| H A D | ck804xrom.c | 18 #include <linux/mtd/map.h> 46 struct map_info map; member 84 struct ck804xrom_map_info *map, *scratch; in ck804xrom_cleanup() local 94 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ck804xrom_cleanup() 95 if (map->rsrc.parent) in ck804xrom_cleanup() 96 release_resource(&map->rsrc); in ck804xrom_cleanup() 98 mtd_device_unregister(map->mtd); in ck804xrom_cleanup() 99 map_destroy(map->mtd); in ck804xrom_cleanup() 100 list_del(&map->list); in ck804xrom_cleanup() 101 kfree(map); in ck804xrom_cleanup() [all …]
|
| H A D | esb2rom.c | 21 #include <linux/mtd/map.h> 108 struct map_info map; member 120 struct esb2rom_map_info *map, *scratch; in esb2rom_cleanup() local 129 list_for_each_entry_safe(map, scratch, &window->maps, list) { in esb2rom_cleanup() 130 if (map->rsrc.parent) in esb2rom_cleanup() 131 release_resource(&map->rsrc); in esb2rom_cleanup() 132 mtd_device_unregister(map->mtd); in esb2rom_cleanup() 133 map_destroy(map->mtd); in esb2rom_cleanup() 134 list_del(&map->list); in esb2rom_cleanup() 135 kfree(map); in esb2rom_cleanup() [all …]
|
| /linux/net/sctp/ |
| H A D | tsnmap.c | 29 static void sctp_tsnmap_update(struct sctp_tsnmap *map); 30 static void sctp_tsnmap_find_gap_ack(unsigned long *map, __u16 off, 32 static int sctp_tsnmap_grow(struct sctp_tsnmap *map, u16 size); 35 struct sctp_tsnmap *sctp_tsnmap_init(struct sctp_tsnmap *map, __u16 len, in sctp_tsnmap_init() argument 38 if (!map->tsn_map) { in sctp_tsnmap_init() 39 map->tsn_map = kzalloc(len>>3, gfp); in sctp_tsnmap_init() 40 if (map->tsn_map == NULL) in sctp_tsnmap_init() 43 map->len = len; in sctp_tsnmap_init() 45 bitmap_zero(map->tsn_map, map->len); in sctp_tsnmap_init() 49 map->base_tsn = initial_tsn; in sctp_tsnmap_init() [all …]
|
| /linux/kernel/bpf/ |
| H A D | arraymap.c | 27 for (i = 0; i < array->map.max_entries; i++) { in bpf_array_free_percpu() 38 for (i = 0; i < array->map.max_entries; i++) { in bpf_array_alloc_percpu() 39 ptr = bpf_map_alloc_percpu(&array->map, array->elem_size, 8, in bpf_array_alloc_percpu() 74 /* avoid overflow on round_up(map->value_size) */ in array_map_alloc_check() 77 /* percpu map value size is bound by PCPU_MIN_UNIT_SIZE */ in array_map_alloc_check() 131 /* allocate all map elements and zero-initialize them */ in array_map_alloc() 147 array->map.bypass_spec_v1 = bypass_spec_v1; in array_map_alloc() 149 /* copy mandatory map attributes */ in array_map_alloc() 150 bpf_map_init_from_attr(&array->map, attr); in array_map_alloc() 158 return &array->map; in array_map_alloc() [all …]
|
| H A D | local_storage.c | 22 struct bpf_map map; member 29 static struct bpf_cgroup_storage_map *map_to_storage(struct bpf_map *map) in map_to_storage() argument 31 return container_of(map, struct bpf_cgroup_storage_map, map); in map_to_storage() 34 static bool attach_type_isolated(const struct bpf_map *map) in attach_type_isolated() argument 36 return map->key_size == sizeof(struct bpf_cgroup_storage_key); in attach_type_isolated() 39 static int bpf_cgroup_storage_key_cmp(const struct bpf_cgroup_storage_map *map, in bpf_cgroup_storage_key_cmp() argument 42 if (attach_type_isolated(&map->map)) { in bpf_cgroup_storage_key_cmp() 67 cgroup_storage_lookup(struct bpf_cgroup_storage_map *map, in cgroup_storage_lookup() argument 70 struct rb_root *root = &map->root; in cgroup_storage_lookup() 74 spin_lock_bh(&map->lock); in cgroup_storage_lookup() [all …]
|
| /linux/tools/lib/bpf/ |
| H A D | hashmap.c | 4 * Generic non-thread safe hash map implementation. 38 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init() argument 41 map->hash_fn = hash_fn; in hashmap__init() 42 map->equal_fn = equal_fn; in hashmap__init() 43 map->ctx = ctx; in hashmap__init() 45 map->buckets = NULL; in hashmap__init() 46 map->cap = 0; in hashmap__init() 47 map->cap_bits = 0; in hashmap__init() 48 map->sz = 0; in hashmap__init() 55 struct hashmap *map = malloc(sizeof(struct hashmap)); in hashmap__new() local [all …]
|
| /linux/tools/bpf/bpftool/Documentation/ |
| H A D | bpftool-map.rst | 4 bpftool-map 17 **bpftool** [*OPTIONS*] **map** *COMMAND* 25 MAP COMMANDS 28 | **bpftool** **map** { **show** | **list** } [*MAP*] 29 | **bpftool** **map create** *FILE* **type** *TYPE* **key** *KEY_SIZE* **value** *VALUE_SIZE* \ 30 | **entries** *MAX_ENTRIES* **name** *NAME* [**flags** *FLAGS*] [**inner_map** *MAP*] \ 32 | **bpftool** **map dump** *MAP* 33 | **bpftool** **map updat [all...] |
| /linux/drivers/mtd/lpddr/ |
| H A D | qinfo_probe.c | 16 #include <linux/mtd/map.h> 20 static int lpddr_chip_setup(struct map_info *map, struct lpddr_private *lpddr); 21 struct mtd_info *lpddr_probe(struct map_info *map); 22 static struct lpddr_private *lpddr_probe_chip(struct map_info *map); 23 static int lpddr_pfow_present(struct map_info *map, 44 static long lpddr_get_qinforec_pos(struct map_info *map, char *id_str) in lpddr_get_qinforec_pos() argument 48 int bankwidth = map_bankwidth(map) * 8; in lpddr_get_qinforec_pos() 58 printk(KERN_ERR"%s qinfo id string is wrong!\n", map->name); in lpddr_get_qinforec_pos() 63 static uint16_t lpddr_info_query(struct map_info *map, char *id_str) in lpddr_info_query() argument 66 int bits_per_chip = map_bankwidth(map) * 8; in lpddr_info_query() [all …]
|
| /linux/drivers/xen/ |
| H A D | gntdev.c | 76 static void unmap_grant_pages(struct gntdev_grant_map *map, 92 struct gntdev_grant_map *map; in gntdev_print_maps() local 95 list_for_each_entry(map, &priv->maps, next) in gntdev_print_maps() 97 map->index, map->count, in gntdev_print_maps() 98 map->index == text_index && text ? text : ""); in gntdev_print_maps() 102 static void gntdev_free_map(struct gntdev_grant_map *map) in gntdev_free_map() argument 104 if (map == NULL) in gntdev_free_map() 108 if (map->dma_vaddr) { in gntdev_free_map() 111 args.dev = map->dma_dev; in gntdev_free_map() 112 args.coherent = !!(map->dma_flags & GNTDEV_DMA_FLAG_COHERENT); in gntdev_free_map() [all …]
|
| H A D | pvcalls-front.c | 101 struct sock_mapping *map; in pvcalls_enter_sock() local 107 map = (struct sock_mapping *)sock->sk->sk_send_head; in pvcalls_enter_sock() 108 if (map == NULL) in pvcalls_enter_sock() 112 atomic_inc(&map->refcount); in pvcalls_enter_sock() 113 return map; in pvcalls_enter_sock() 118 struct sock_mapping *map; in pvcalls_exit_sock() local 120 map = (struct sock_mapping *)sock->sk->sk_send_head; in pvcalls_exit_sock() 121 atomic_dec(&map->refcount); in pvcalls_exit_sock() 134 static bool pvcalls_front_write_todo(struct sock_mapping *map) in pvcalls_front_write_todo() argument 136 struct pvcalls_data_intf *intf = map->active.ring; in pvcalls_front_write_todo() [all …]
|
| /linux/tools/testing/selftests/mm/ |
| H A D | mlock2-tests.c | 166 static int unlock_lock_check(char *map) in unlock_lock_check() argument 168 if (is_vmflag_set((unsigned long)map, LOCKED)) { in unlock_lock_check() 178 char *map; in test_mlock_lock() local 181 map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE, in test_mlock_lock() 183 if (map == MAP_FAILED) in test_mlock_lock() 186 if (mlock2_(map, 2 * page_size, 0)) { in test_mlock_lock() 187 munmap(map, 2 * page_size); in test_mlock_lock() 191 ksft_test_result(lock_check((unsigned long)map), "%s: Locked\n", __func__); in test_mlock_lock() 194 if (munlock(map, 2 * page_size)) { in test_mlock_lock() 195 munmap(map, 2 * page_size); in test_mlock_lock() [all …]
|
| /linux/drivers/ras/amd/atl/ |
| H A D | map.c | 5 * map.c : Functions to read and decode DRAM address maps 17 ctx->map.intlv_mode = FIELD_GET(DF2_INTLV_NUM_CHAN, ctx->map.base); in df2_get_intlv_mode() 19 if (ctx->map.intlv_mode == 8) in df2_get_intlv_mode() 20 ctx->map.intlv_mode = DF2_2CHAN_HASH; in df2_get_intlv_mode() 22 if (ctx->map.intlv_mode != NONE && in df2_get_intlv_mode() 23 ctx->map.intlv_mode != NOHASH_2CHAN && in df2_get_intlv_mode() 24 ctx->map.intlv_mode != DF2_2CHAN_HASH) in df2_get_intlv_mode() 32 ctx->map.intlv_mode = FIELD_GET(DF3_INTLV_NUM_CHAN, ctx->map.base); in df3_get_intlv_mode() 38 ctx->map.intlv_mode = FIELD_GET(DF3p5_INTLV_NUM_CHAN, ctx->map.base); in df3p5_get_intlv_mode() 40 if (ctx->map.intlv_mode == DF3_6CHAN) in df3p5_get_intlv_mode() [all …]
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | hashmap.c | 49 struct hashmap *map; in test_hashmap_generic() local 51 map = hashmap__new(hash_fn, equal_fn, NULL); in test_hashmap_generic() 52 if (!ASSERT_OK_PTR(map, "hashmap__new")) in test_hashmap_generic() 59 err = hashmap__update(map, k, v, &oldk, &oldv); in test_hashmap_generic() 65 err = hashmap__add(map, k, v); in test_hashmap_generic() 67 err = hashmap__set(map, k, v, &oldk, &oldv); in test_hashmap_generic() 76 if (CHECK(!hashmap__find(map, k, &oldv), "elem_find", in test_hashmap_generic() 83 if (CHECK(hashmap__size(map) != ELEM_CNT, "hashmap__size", in test_hashmap_generic() 84 "invalid map size: %zu\n", hashmap__size(map))) in test_hashmap_generic() 86 if (CHECK(hashmap__capacity(map) != exp_cap(hashmap__size(map)), in test_hashmap_generic() [all …]
|
| /linux/tools/lib/perf/ |
| H A D | threadmap.c | 10 static void perf_thread_map__reset(struct perf_thread_map *map, int start, int nr) in perf_thread_map__reset() argument 12 size_t size = (nr - start) * sizeof(map->map[0]); in perf_thread_map__reset() 14 memset(&map->map[start], 0, size); in perf_thread_map__reset() 15 map->err_thread = -1; in perf_thread_map__reset() 18 struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr) in perf_thread_map__realloc() argument 20 size_t size = sizeof(*map) + sizeof(map->map[0]) * nr; in perf_thread_map__realloc() 21 int start = map ? map->nr : 0; in perf_thread_map__realloc() 23 map = realloc(map, size); in perf_thread_map__realloc() 27 if (map) in perf_thread_map__realloc() 28 perf_thread_map__reset(map, start, nr); in perf_thread_map__realloc() [all …]
|
| H A D | mmap.c | 19 void perf_mmap__init(struct perf_mmap *map, struct perf_mmap *prev, in perf_mmap__init() argument 23 map->fd = -1; in perf_mmap__init() 24 map->overwrite = overwrite; in perf_mmap__init() 25 map->unmap_cb = unmap_cb; in perf_mmap__init() 26 refcount_set(&map->refcnt, 0); in perf_mmap__init() 28 prev->next = map; in perf_mmap__init() 31 size_t perf_mmap__mmap_len(struct perf_mmap *map) in perf_mmap__mmap_len() argument 33 return map->mask + 1 + page_size; in perf_mmap__mmap_len() 36 int perf_mmap__mmap(struct perf_mmap *map, struct perf_mmap_param *mp, in perf_mmap__mmap() argument 39 map->prev = 0; in perf_mmap__mmap() [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | map_ptr_kern.c | 38 static inline int check_bpf_map_fields(struct bpf_map *map, __u32 key_size, in check_bpf_map_fields() argument 41 VERIFY(map->map_type == g_map_type); in check_bpf_map_fields() 42 VERIFY(map->key_size == key_size); in check_bpf_map_fields() 43 VERIFY(map->value_size == value_size); in check_bpf_map_fields() 44 VERIFY(map->max_entries == max_entries); in check_bpf_map_fields() 45 VERIFY(map->id > 0); in check_bpf_map_fields() 92 struct bpf_map map; member 106 __s64 bpf_map_sum_elem_count(struct bpf_map *map) __ksym; 111 struct bpf_map *map = (struct bpf_map *)&m_hash; in check_hash() local 114 VERIFY(check_default_noinline(&hash->map, ma in check_hash() 136 struct bpf_map map; global() member 150 struct bpf_map *map = (struct bpf_map *)&m_array; check_array() local 182 struct bpf_map *map = (struct bpf_map *)&m_prog_array; check_prog_array() local 199 struct bpf_map *map = (struct bpf_map *)&m_perf_event_array; check_perf_event_array() local 216 struct bpf_map *map = (struct bpf_map *)&m_percpu_hash; check_percpu_hash() local 233 struct bpf_map *map = (struct bpf_map *)&m_percpu_array; check_percpu_array() local 241 struct bpf_map map; global() member 255 struct bpf_map *map = (struct bpf_map *)&m_stack_trace; check_stack_trace() local 273 struct bpf_map *map = (struct bpf_map *)&m_cgroup_array; check_cgroup_array() local 290 struct bpf_map *map = (struct bpf_map *)&m_lru_hash; check_lru_hash() local 307 struct bpf_map *map = (struct bpf_map *)&m_lru_percpu_hash; check_lru_percpu_hash() local 315 struct bpf_map map; global() member 334 struct bpf_map *map = (struct bpf_map *)&m_lpm_trie; check_lpm_trie() local 369 struct bpf_map *map = (struct bpf_map *)&m_array_of_maps; check_array_of_maps() local 396 struct bpf_map *map = (struct bpf_map *)&m_hash_of_maps; check_hash_of_maps() local 409 struct bpf_map map; global() member 422 struct bpf_map *map = (struct bpf_map *)&m_devmap; check_devmap() local 430 struct bpf_map map; global() member 443 struct bpf_map *map = (struct bpf_map *)&m_sockmap; check_sockmap() local 451 struct bpf_map map; global() member 464 struct bpf_map *map = (struct bpf_map *)&m_cpumap; check_cpumap() local 472 struct bpf_map map; global() member 485 struct bpf_map *map = (struct bpf_map *)&m_xskmap; check_xskmap() local 493 struct bpf_map map; global() member 506 struct bpf_map *map = (struct bpf_map *)&m_sockhash; check_sockhash() local 514 struct bpf_map map; global() member 527 struct bpf_map *map = (struct bpf_map *)&m_cgroup_storage; check_cgroup_storage() local 536 struct bpf_map map; global() member 550 struct bpf_map *map = (struct bpf_map *)&m_reuseport_sockarray; check_reuseport_sockarray() local 567 struct bpf_map *map = (struct bpf_map *)&m_percpu_cgroup_storage; check_percpu_cgroup_storage() local 576 struct bpf_map map; global() member 588 struct bpf_map *map = (struct bpf_map *)&m_queue; check_queue() local 604 struct bpf_map *map = (struct bpf_map *)&m_stack; check_stack() local 612 struct bpf_map map; global() member 626 struct bpf_map *map = (struct bpf_map *)&m_sk_storage; check_sk_storage() local 643 struct bpf_map *map = (struct bpf_map *)&m_devmap_hash; check_devmap_hash() local 651 struct bpf_map map; global() member 661 struct bpf_map *map = (struct bpf_map *)&m_ringbuf; check_ringbuf() local [all...] |