/dragonfly/contrib/tre/lib/ |
H A D | tre-mem.c | 31 tre_mem_t mem; in tre_mem_new_impl() local 35 memset(mem, 0, sizeof(*mem)); in tre_mem_new_impl() 38 mem = xcalloc(1, sizeof(*mem)); in tre_mem_new_impl() 39 if (mem == NULL) in tre_mem_new_impl() 41 return mem; in tre_mem_new_impl() 58 xfree(mem); in tre_mem_destroy() 70 if (mem->failed) in tre_mem_alloc_impl() 83 mem->failed = 1; in tre_mem_alloc_impl() 90 if (mem->n < size) in tre_mem_alloc_impl() 144 ptr = mem->ptr; in tre_mem_alloc_impl() [all …]
|
H A D | tre-mem.h | 32 void *tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block, 40 #define tre_mem_alloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 0, size) argument 45 #define tre_mem_calloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 1, size) argument 54 #define tre_mem_alloca(mem, size) \ argument 55 ((mem)->n >= (size) \ 56 ? tre_mem_alloc_impl((mem), 1, NULL, 0, (size)) \ 57 : tre_mem_alloc_impl((mem), 1, alloca(TRE_MEM_BLOCK_SIZE), 0, (size))) 62 void tre_mem_destroy(tre_mem_t mem);
|
/dragonfly/sys/platform/pc64/acpica/ |
H A D | acpi_srat.c | 47 ACPI_SRAT_MEM_AFFINITY mem; member 57 srat_entry_t *mem; in srat_probe() local 95 mem = (srat_entry_t *)((char *)mem + mem->head.Length)) { in srat_probe() 101 if ((mem->mem.Flags & ACPI_SRAT_MEM_ENABLED) == 0) in srat_probe() 105 mem->mem.BaseAddress, in srat_probe() 106 mem->mem.Length / (1024 * 1024), in srat_probe() 107 mem->mem.ProximityDomain); in srat_probe() 113 mem->mem.ProximityDomain != cpu->cpu.ProximityDomainLo) { in srat_probe() 124 if (mem->mem.ProximityDomain == in srat_probe() 136 vm_numa_organize(mem->mem.BaseAddress, in srat_probe() [all …]
|
/dragonfly/sys/dev/agp/ |
H A D | agp.c | 473 mem = kmalloc(sizeof *mem, M_AGP, M_INTWAIT); in agp_generic_alloc_memory() 476 mem->am_type = 0; in agp_generic_alloc_memory() 479 mem->am_offset = 0; in agp_generic_alloc_memory() 484 return mem; in agp_generic_alloc_memory() 498 kfree(mem, M_AGP); in agp_generic_free_memory() 638 mem->am_offset = 0; in agp_generic_unbind_memory() 685 return mem; in agp_find_memory() 723 if (mem) { in agp_allocate_user() 737 if (mem) { in agp_deallocate_user() 750 if (!mem) in agp_bind_user() [all …]
|
/dragonfly/contrib/lvm2/dist/lib/report/ |
H A D | report.c | 95 if (!dm_pool_begin_object(mem, 256)) { in _format_pvsegs() 151 if (!dm_pool_grow_object(mem, "\0", 1)) { in _format_pvsegs() 182 if (!dm_pool_begin_object(mem, 256)) { in _tags_disp() 195 if (!dm_pool_grow_object(mem, "\0", 1)) { in _tags_disp() 212 if (!(modules = str_list_create(mem))) { in _modules_disp() 217 if (!list_lv_modules(mem, lv, modules)) in _modules_disp() 304 if (!(repstr = dm_pool_zalloc(mem, 7))) { in _lvstatus_disp() 400 if (!(repstr = dm_pool_zalloc(mem, 3))) { in _pvstatus_disp() 426 if (!(repstr = dm_pool_zalloc(mem, 7))) { in _vgstatus_disp() 617 struct dm_pool *mem, in _size64_disp() argument [all …]
|
/dragonfly/sys/dev/drm/ttm/ |
H A D | ttm_bo_util.c | 175 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_reserve_vm() local 195 struct ttm_mem_reg *mem = &bo->mem; in ttm_mem_io_free_vm() local 218 if (mem->bus.addr) { in ttm_mem_reg_ioremap() 219 addr = mem->bus.addr; in ttm_mem_reg_ioremap() 222 addr = ioremap_wc(mem->bus.base + mem->bus.offset, mem->bus.size); in ttm_mem_reg_ioremap() 224 addr = ioremap_nocache(mem->bus.base + mem->bus.offset, mem->bus.size); in ttm_mem_reg_ioremap() 540 struct ttm_mem_reg *mem = &bo->mem; in ttm_bo_ioremap() local 542 if (bo->mem.bus.addr) { in ttm_bo_ioremap() 548 map->virtual = ioremap_wc(bo->mem.bus.base + bo->mem.bus.offset + offset, in ttm_bo_ioremap() 562 struct ttm_mem_reg *mem = &bo->mem; in ttm_bo_kmap_ttm() local [all …]
|
H A D | ttm_agp_backend.c | 46 struct agp_memory *mem; member 55 struct agp_memory *mem; in ttm_agp_bind() local 60 if (unlikely(mem == NULL)) in ttm_agp_bind() 63 mem->page_count = 0; in ttm_agp_bind() 70 mem->pages[mem->page_count++] = page; in ttm_agp_bind() 72 agp_be->mem = mem; in ttm_agp_bind() 74 mem->is_flushed = 1; in ttm_agp_bind() 88 if (agp_be->mem) { in ttm_agp_unbind() 92 agp_be->mem = NULL; in ttm_agp_unbind() 101 if (agp_be->mem) in ttm_agp_destroy() [all …]
|
H A D | ttm_bo.c | 97 bo, bo->mem.num_pages, bo->mem.size >> 10, in ttm_bo_mem_space_debug() 278 bo->mem = *mem; in ttm_bo_handle_move_mem() 297 swap(*mem, bo->mem); in ttm_bo_handle_move_mem() 299 swap(*mem, bo->mem); in ttm_bo_handle_move_mem() 315 if (bo->mem.mm_node) in ttm_bo_handle_move_mem() 681 if (place->fpfn >= (bo->mem.start + bo->mem.num_pages) || in ttm_bo_eviction_valuable() 786 if (mem->mm_node) in ttm_bo_mem_put() 837 if (mem->mm_node) in ttm_bo_mem_force_space() 1024 mem.size = mem.num_pages << PAGE_SHIFT; in ttm_bo_move_buffer() 1025 mem.page_alignment = bo->mem.page_alignment; in ttm_bo_move_buffer() [all …]
|
/dragonfly/sbin/cryptdisks/ |
H A D | safe_mem.c | 60 char *mem, *user_mem; in _alloc_safe_mem() local 67 free(mem); in _alloc_safe_mem() 71 memset(mem, 0, alloc_sz); in _alloc_safe_mem() 105 char *mem = mem_ptr; in _free_safe_mem() local 107 mem -= sizeof(*hdr); in _free_safe_mem() 143 memset(mem, 0xFF, alloc_sz); in _free_safe_mem() 144 memset(mem, 0, alloc_sz); in _free_safe_mem() 146 free(mem); in _free_safe_mem() 154 char *mem; in check_and_purge_safe_mem() local 176 mem = (void *)hdr; in check_and_purge_safe_mem() [all …]
|
/dragonfly/sys/dev/drm/amd/amdgpu/ |
H A D | amdgpu_gtt_mgr.c | 113 struct ttm_mem_reg *mem) in amdgpu_gtt_mgr_alloc() argument 122 if (amdgpu_gtt_mgr_has_gart_addr(mem)) in amdgpu_gtt_mgr_alloc() 146 mem->start = node->node.start; in amdgpu_gtt_mgr_alloc() 164 struct ttm_mem_reg *mem) in amdgpu_gtt_mgr_new() argument 171 if ((&tbo->mem == mem || tbo->mem.mem_type != TTM_PL_TT) && in amdgpu_gtt_mgr_new() 186 node->node.size = mem->num_pages; in amdgpu_gtt_mgr_new() 188 mem->mm_node = node; in amdgpu_gtt_mgr_new() 194 mem->mm_node = NULL; in amdgpu_gtt_mgr_new() 199 mem->start = node->node.start; in amdgpu_gtt_mgr_new() 220 struct ttm_mem_reg *mem) in amdgpu_gtt_mgr_del() argument [all …]
|
H A D | amdgpu_vram_mgr.c | 110 struct ttm_mem_reg *mem = &bo->tbo.mem; in amdgpu_vram_mgr_bo_visible_size() local 175 mem->start = 0; in amdgpu_vram_mgr_new() 176 pages_left = mem->num_pages; in amdgpu_vram_mgr_new() 201 if (start > mem->num_pages) in amdgpu_vram_mgr_new() 202 start -= mem->num_pages; in amdgpu_vram_mgr_new() 205 mem->start = max(mem->start, start); in amdgpu_vram_mgr_new() 213 mem->mm_node = nodes; in amdgpu_vram_mgr_new() 237 struct ttm_mem_reg *mem) in amdgpu_vram_mgr_del() argument 245 if (!mem->mm_node) in amdgpu_vram_mgr_del() 261 kvfree(mem->mm_node); in amdgpu_vram_mgr_del() [all …]
|
/dragonfly/sys/platform/pc64/include/ |
H A D | lock.h | 55 #define SPIN_INIT(mem) \ argument 56 movq $0,mem ; \ 58 #define SPIN_INIT_NOREG(mem) \ argument 59 SPIN_INIT(mem) ; \ 61 #define SPIN_LOCK(mem) \ argument 67 movq mem, %rax ; \ 94 SPIN_LOCK(mem) ; \ 97 #define SPIN_UNLOCK(mem) \ argument 98 pushq mem ; \ 99 movq $0,mem ; \ [all …]
|
/dragonfly/lib/libtcplay/ |
H A D | safe_mem.c | 60 char *mem, *user_mem; in _alloc_safe_mem() local 67 free(mem); in _alloc_safe_mem() 71 memset(mem, 0, alloc_sz); in _alloc_safe_mem() 104 char *mem = mem_ptr; in _free_safe_mem() local 106 mem -= sizeof(*hdr); in _free_safe_mem() 142 memset(mem, 0xFF, alloc_sz); in _free_safe_mem() 143 memset(mem, 0, alloc_sz); in _free_safe_mem() 145 free(mem); in _free_safe_mem() 170 char *mem; in check_and_purge_safe_mem() local 192 mem = (void *)hdr; in check_and_purge_safe_mem() [all …]
|
/dragonfly/contrib/lvm2/dist/lib/format1/ |
H A D | format1.c | 131 vg->vgmem = mem; in _build_vg() 162 dm_pool_free(mem, vg); in _build_vg() 175 if (!mem) in _format1_vg_read() 190 dm_pool_destroy(mem); in _format1_vg_read() 204 dl->mem = mem; in _flatten_pv() 252 if (!mem) in _format1_vg_write() 262 dm_pool_destroy(mem); in _format1_vg_write() 277 if (!mem) in _format1_pv_read() 294 dm_pool_destroy(mem); in _format1_pv_read() 359 struct dm_pool *mem; in _format1_pv_write() local [all …]
|
/dragonfly/lib/libnvmm/ |
H A D | libnvmm_x86.c | 619 (*vcpu->cbs.mem)(&mem); in read_guest_memory() 676 (*vcpu->cbs.mem)(&mem); in write_guest_memory() 2764 (*vcpu->cbs.mem)(mem); in EXEC_DISPATCHER() 2796 (*vcpu->cbs.mem)(mem); in x86_func_and() 2826 (*vcpu->cbs.mem)(mem); in x86_func_xchg() 2831 (*vcpu->cbs.mem)(mem); in x86_func_xchg() 2853 (*vcpu->cbs.mem)(mem); in x86_func_sub() 2885 (*vcpu->cbs.mem)(mem); in x86_func_xor() 2918 (*vcpu->cbs.mem)(mem); in x86_func_cmp() 2941 (*vcpu->cbs.mem)(mem); in x86_func_test() [all …]
|
/dragonfly/crypto/libressl/crypto/ocsp/ |
H A D | ocsp_ht.c | 114 BIO_free(rctx->mem); in OCSP_REQ_CTX_free() 138 if (BIO_puts(rctx->mem, name) <= 0) in OCSP_REQ_CTX_add1_header() 143 if (BIO_puts(rctx->mem, value) <= 0) in OCSP_REQ_CTX_add1_header() 172 BIO_free(rctx->mem); in OCSP_sendreq_new() 181 BIO_free(rctx->mem); in OCSP_sendreq_new() 188 BIO_free(rctx->mem); in OCSP_sendreq_new() 285 n = BIO_get_mem_data(rctx->mem, &p); in OCSP_sendreq_nbio() 301 (void)BIO_reset(rctx->mem); in OCSP_sendreq_nbio() 328 n = BIO_get_mem_data(rctx->mem, &p); in OCSP_sendreq_nbio() 338 if (BIO_should_retry(rctx->mem)) in OCSP_sendreq_nbio() [all …]
|
/dragonfly/contrib/lvm2/dist/libdm/ |
H A D | libdm-report.c | 29 struct dm_pool *mem; member 127 if (!(repstr = dm_pool_zalloc(rh->mem, 13))) { in dm_report_field_int() 156 if (!(repstr = dm_pool_zalloc(rh->mem, 12))) { in dm_report_field_uint32() 321 dm_pool_free(rh->mem, fp); in _add_field() 646 dm_pool_destroy(rh->mem); in dm_report_free() 770 if (!dm_pool_begin_object(rh->mem, 128)) { in _report_headings() 812 dm_pool_abandon_object(rh->mem); in _report_headings() 977 if (!dm_pool_begin_object(rh->mem, 512)) { in _output_as_rows() 1026 dm_pool_abandon_object(rh->mem); in _output_as_rows() 1072 dm_pool_free(rh->mem, row); in _output_as_columns() [all …]
|
/dragonfly/contrib/lvm2/dist/lib/format_pool/ |
H A D | import_export.c | 47 vg->name = dm_pool_strdup(mem, pl->pd.pl_pool_name); in import_pool_vg() 64 if (!(lv = alloc_lv(mem))) in import_pool_lvs() 111 if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl)))) { in import_pool_pvs() 119 if (!import_pool_pv(fmt, mem, vg, pvl->pv, pl)) { in import_pool_pvs() 160 if (!alloc_pv_segment_whole_pv(mem, pv)) in import_pool_pv() 179 static int _add_stripe_seg(struct dm_pool *mem, in _add_stripe_seg() argument 199 if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur, in _add_stripe_seg() 212 str_list_add(mem, &seg->tags, _cvt_sptype(usp->type)); in _add_stripe_seg() 221 static int _add_linear_seg(struct dm_pool *mem, in _add_linear_seg() argument 274 if (!_add_stripe_seg(mem, &usp[i], lv, &le_cur)) in import_pool_segments() [all …]
|
/dragonfly/sys/dev/sound/pci/hda/ |
H A D | hdac.c | 317 HDAC_WRITE_1(&sc->mem, in hdac_intr_handler() 682 struct hdac_mem *mem; in hdac_mem_alloc() local 684 mem = &sc->mem; in hdac_mem_alloc() 693 mem->mem_tag = rman_get_bustag(mem->mem_res); in hdac_mem_alloc() 694 mem->mem_handle = rman_get_bushandle(mem->mem_res); in hdac_mem_alloc() 707 struct hdac_mem *mem; in hdac_mem_free() local 709 mem = &sc->mem; in hdac_mem_free() 712 mem->mem_res); in hdac_mem_free() 713 mem->mem_res = NULL; in hdac_mem_free() 1512 HDAC_WRITE_4(&sc->mem, HDAC_GCTL, HDAC_READ_4(&sc->mem, HDAC_GCTL) | in hdac_attach2() [all …]
|
H A D | hdac_private.h | 41 #define HDAC_READ_1(mem, offset) \ argument 42 bus_space_read_1((mem)->mem_tag, (mem)->mem_handle, (offset)) 43 #define HDAC_READ_2(mem, offset) \ argument 44 bus_space_read_2((mem)->mem_tag, (mem)->mem_handle, (offset)) 45 #define HDAC_READ_4(mem, offset) \ argument 46 bus_space_read_4((mem)->mem_tag, (mem)->mem_handle, (offset)) 47 #define HDAC_WRITE_1(mem, offset, value) \ argument 48 bus_space_write_1((mem)->mem_tag, (mem)->mem_handle, (offset), (value)) 50 bus_space_write_2((mem)->mem_tag, (mem)->mem_handle, (offset), (value)) 52 bus_space_write_4((mem)->mem_tag, (mem)->mem_handle, (offset), (value)) [all …]
|
/dragonfly/sys/dev/pccard/exca/ |
H A D | exca.c | 181 mem = &sc->mem[win]; in exca_do_mem_map() 191 ((mem->addr + mem->realsize - 1) >> in exca_do_mem_map() 194 (((mem->addr + mem->realsize - 1) >> in exca_do_mem_map() 231 mem->addr, mem->size, mem->realsize, in exca_do_mem_map() 232 mem->cardaddr); in exca_do_mem_map() 268 sc->mem[win].size = rman_get_end(res) - sc->mem[win].addr + 1; in exca_mem_map() 269 sc->mem[win].realsize = sc->mem[win].size + EXCA_MEM_PAGESIZE - 1; in exca_mem_map() 270 sc->mem[win].realsize = sc->mem[win].realsize - in exca_mem_map() 274 win, sc->mem[win].addr, sc->mem[win].size, sc->mem[win].cardaddr); in exca_mem_map() 384 sc->mem[win].realsize = sc->mem[win].size + delta + in exca_mem_set_offset() [all …]
|
/dragonfly/contrib/lvm2/dist/libdm/regex/ |
H A D | parse_rx.c | 22 struct dm_pool *mem; member 211 dm_pool_free(mem, n); in _node() 265 n = _node(ps->mem, STAR, l, NULL); in _closure_term() 269 n = _node(ps->mem, PLUS, l, NULL); in _closure_term() 273 n = _node(ps->mem, QUEST, l, NULL); in _closure_term() 305 if (!(n = _node(ps->mem, CAT, l, r))) in _cat_term() 328 if (!(n = _node(ps->mem, OR, l, r))) in _or_term() 334 struct rx_node *rx_parse_tok(struct dm_pool *mem, in rx_parse_tok() argument 345 ps->mem = mem; in rx_parse_tok() 346 ps->charset = dm_bitset_create(mem, 256); in rx_parse_tok() [all …]
|
/dragonfly/usr.sbin/mpsutil/ |
H A D | mps_flash.c | 123 unsigned char *mem = NULL; in flash_update() local 165 if (mem == MAP_FAILED) { in flash_update() 177 munmap(mem, st.st_size); in flash_update() 183 munmap(mem, st.st_size); in flash_update() 190 if (((mem[0x01]<<8) + mem[0x00]) != 0xaa55) { in flash_update() 192 munmap(mem, st.st_size); in flash_update() 199 munmap(mem, st.st_size); in flash_update() 211 munmap(mem, st.st_size); in flash_update() 221 munmap(mem, st.st_size); in flash_update() 231 munmap(mem, st.st_size); in flash_update() [all …]
|
/dragonfly/contrib/lvm2/dist/libdm/mm/ |
H A D | pool-debug.c | 53 struct dm_pool *mem = dm_malloc(sizeof(*mem)); in dm_pool_create() local 55 if (!mem) { in dm_pool_create() 61 mem->name = name; in dm_pool_create() 62 mem->begun = 0; in dm_pool_create() 63 mem->object = 0; in dm_pool_create() 64 mem->blocks = mem->tail = NULL; in dm_pool_create() 68 mem->stats.blocks_max = 0; in dm_pool_create() 69 mem->stats.bytes = 0; in dm_pool_create() 70 mem->stats.maxbytes = 0; in dm_pool_create() 72 mem->orig_pool = mem; in dm_pool_create() [all …]
|
/dragonfly/contrib/lvm2/dist/lib/filters/ |
H A D | filter-regex.c | 23 struct dm_pool *mem; member 28 static int _extract_pattern(struct dm_pool *mem, const char *pat, in _extract_pattern() argument 75 if (!(r = dm_pool_strdup(mem, pat))) in _extract_pattern() 124 rf->accept = dm_bitset_create(rf->mem, count); in _build_matcher() 186 dm_pool_destroy(rf->mem); in _regex_destroy() 191 struct dm_pool *mem = dm_pool_create("filter regex", 10 * 1024); in regex_filter_create() local 195 if (!mem) in regex_filter_create() 198 if (!(rf = dm_pool_alloc(mem, sizeof(*rf)))) in regex_filter_create() 201 rf->mem = mem; in regex_filter_create() 206 if (!(f = dm_pool_zalloc(mem, sizeof(*f)))) in regex_filter_create() [all …]
|