/linux-6.12.1/tools/testing/selftests/mm/ |
D | hmm-tests.c | 1 // SPDX-License-Identifier: GPL-2.0 40 unsigned long size; member 58 #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) 136 self->page_size = sysconf(_SC_PAGE_SIZE); in FIXTURE_SETUP() 137 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() 139 self->fd = hmm_open(variant->device_number); in FIXTURE_SETUP() 140 if (self->fd < 0 && hmm_is_coherent_type(variant->device_number)) in FIXTURE_SETUP() 142 ASSERT_GE(self->fd, 0); in FIXTURE_SETUP() 147 self->page_size = sysconf(_SC_PAGE_SIZE); in FIXTURE_SETUP() 148 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() [all …]
|
/linux-6.12.1/drivers/android/ |
D | binder_alloc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 * Copyright (C) 2007-2017 Google, Inc. 50 static struct binder_buffer *binder_buffer_next(struct binder_buffer *buffer) in binder_buffer_next() argument 52 return list_entry(buffer->entry.next, struct binder_buffer, entry); in binder_buffer_next() 55 static struct binder_buffer *binder_buffer_prev(struct binder_buffer *buffer) in binder_buffer_prev() argument 57 return list_entry(buffer->entry.prev, struct binder_buffer, entry); in binder_buffer_prev() 61 struct binder_buffer *buffer) in binder_alloc_buffer_size() argument 63 if (list_is_last(&buffer->entry, &alloc->buffers)) in binder_alloc_buffer_size() 64 return alloc->buffer + alloc->buffer_size - buffer->user_data; in binder_alloc_buffer_size() 65 return binder_buffer_next(buffer)->user_data - buffer->user_data; in binder_alloc_buffer_size() [all …]
|
/linux-6.12.1/drivers/video/ |
D | hdmi.c | 17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 35 static u8 hdmi_infoframe_checksum(const u8 *ptr, size_t size) in hdmi_infoframe_checksum() argument 41 for (i = 0; i < size; i++) in hdmi_infoframe_checksum() 44 return 256 - csum; in hdmi_infoframe_checksum() 47 static void hdmi_infoframe_set_checksum(void *buffer, size_t size) in hdmi_infoframe_set_checksum() argument 49 u8 *ptr = buffer; in hdmi_infoframe_set_checksum() 51 ptr[3] = hdmi_infoframe_checksum(buffer, size); in hdmi_infoframe_set_checksum() 55 * hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe 62 frame->type = HDMI_INFOFRAME_TYPE_AVI; in hdmi_avi_infoframe_init() 63 frame->version = 2; in hdmi_avi_infoframe_init() [all …]
|
/linux-6.12.1/drivers/md/dm-vdo/ |
D | encodings.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 #include "memory-alloc.h" 15 #include "status-codes.h" 37 * Note: this size isn't just the payload size following the header, like it is everywhere 40 .size = sizeof(struct geometry_block) + sizeof(struct volume_geometry), 50 * Note: this size isn't just the payload size following the header, like it is everywhere 53 .size = sizeof(struct geometry_block) + sizeof(struct volume_geometry_4_0), 71 .size = sizeof(struct block_map_state_2_0), 80 .size = sizeof(struct recovery_journal_state_7_0), 89 .size = sizeof(struct slab_depot_state_2_0), [all …]
|
/linux-6.12.1/drivers/gpu/drm/vmwgfx/ |
D | vmwgfx_cmdbuf.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 4 * Copyright 2015-2023 VMware, Inc., Palo Alto, CA., USA 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 37 * Size of inline command buffers. Try to make sure that a page size is a 38 * multiple of the DMA pool allocation size. 42 (1024 - ALIGN(sizeof(SVGACBHeader), VMW_CMDBUF_INLINE_ALIGN)) 45 * struct vmw_cmdbuf_context - Command buffer context queues 63 * struct vmw_cmdbuf_man - Command buffer manager 65 * @cur_mutex: Mutex protecting the command buffer used for incremental small 68 * main pool buffer space. [all …]
|
/linux-6.12.1/drivers/net/ethernet/mellanox/mlx5/core/en/ |
D | port_buffer.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 37 u16 port_buff_cell_sz = priv->dcbx.port_buff_cell_sz; in mlx5e_port_query_buffer() 38 struct mlx5_core_dev *mdev = priv->mdev; in mlx5e_port_query_buffer() 41 void *buffer; in mlx5e_port_query_buffer() local 48 return -ENOMEM; in mlx5e_port_query_buffer() 55 buffer = MLX5_ADDR_OF(pbmc_reg, out, buffer[i]); in mlx5e_port_query_buffer() 56 port_buffer->buffer[i].lossy = in mlx5e_port_query_buffer() 57 MLX5_GET(bufferx_reg, buffer, lossy); in mlx5e_port_query_buffer() 58 port_buffer->buffer[i].epsb = in mlx5e_port_query_buffer() [all …]
|
/linux-6.12.1/tools/testing/selftests/drivers/net/mlxsw/ |
D | qos_headroom.sh | 2 # SPDX-License-Identifier: GPL-2.0 32 # of buffer that priority X is mapped to. 33 dcb -j buffer show dev $swp | 34 jq -r '[.prio_buffer | .[] | tostring + " "] | add' 41 dcb -j pfc show dev $swp | 42 jq -r '[.prio_pfc | .[] | if . then "1 " else "0 " end] | add' 49 dcb -j ets show dev $swp | 50 jq -r '[.prio_tc | .[] | tostring + " "] | add' 57 dcb -j buffer show dev $swp | jq ".buffer_size[$idx]" 62 dcb -j buffer show dev $swp | jq '.total_size' [all …]
|
/linux-6.12.1/include/linux/ |
D | seq_buf.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 16 * struct seq_buf - seq buffer structure 17 * @buffer: pointer to the buffer 18 * @size: size of the buffer 19 * @len: the amount of data inside the buffer 22 char *buffer; member 23 size_t size; member 27 #define DECLARE_SEQ_BUF(NAME, SIZE) \ argument 29 .buffer = (char[SIZE]) { 0 }, \ 30 .size = SIZE, \ [all …]
|
D | ring_buffer.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 24 * enum ring_buffer_type - internal ring buffer types 29 * size is variable depending on how much 33 * size = 4 + length (bytes) 37 * size = 8 bytes 44 * size = 8 bytes 51 * size = 4 + length (bytes) 54 * array[0..(length+3)/4-1] holds data 55 * size = 4 + length (bytes) 66 u64 ring_buffer_event_time_stamp(struct trace_buffer *buffer, [all …]
|
D | lz4.h | 4 * Copyright (C) 2016, Sven Schmidt <4sschmid@informatik.uni-hamburg.de> 11 * for LZ4 - Fast LZ compression algorithm. 13 * LZ4 - Fast LZ compression algorithm 14 * Copyright (C) 2011-2016, Yann Collet. 15 * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 37 * - LZ4 homepage : http://www.lz4.org 38 * - LZ4 source repository : https://github.com/lz4/lz4 47 /*-************************************************************************ 52 * Memory usage formula : N->2^N Bytes 53 * (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) [all …]
|
D | zstd.h | 1 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ 6 * This source code is licensed under both the BSD-style license (found in the 10 * above-listed licenses. 17 * This is a kernel-style API that wraps the upstream zstd API, which cannot be 30 * zstd_compress_bound() - maximum compressed size in worst case scenario 31 * @src_size: The size of the data to compress. 33 * Return: The maximum compressed size in the worst case scenario. 38 * zstd_is_error() - tells if a size_t function result is an error code 41 * Return: Non-zero iff the code is an error. 46 * enum zstd_error_code - zstd error codes [all …]
|
/linux-6.12.1/drivers/tty/ |
D | tty_buffer.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Tty buffer allocation management 34 * We default to dicing tty buffer allocations to this many characters 35 * in order to avoid multiple page allocations. We know the size of 37 * buffer is 256 byte aligned. See tty_buffer_find for the allocation 41 #define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~TTYB_ALIGN_MASK) 44 * tty_buffer_lock_exclusive - gain exclusive access to buffer 45 * @port: tty port owning the flip buffer 48 * the buffer work and any pending flush from using the flip buffer. Data can 49 * continue to be added concurrently to the flip buffer from the driver side. [all …]
|
/linux-6.12.1/sound/core/ |
D | pcm_memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 35 card->total_pcm_alloc_bytes += bytes; in __update_allocated_size() 40 guard(mutex)(&card->memory_mutex); in update_allocated_size() 46 guard(mutex)(&card->memory_mutex); in decrease_allocated_size() 47 WARN_ON(card->total_pcm_alloc_bytes < bytes); in decrease_allocated_size() 48 __update_allocated_size(card, -(ssize_t)bytes); in decrease_allocated_size() 52 int str, size_t size, struct snd_dma_buffer *dmab) in do_alloc_pages() argument 57 /* check and reserve the requested size */ in do_alloc_pages() 58 scoped_guard(mutex, &card->memory_mutex) { in do_alloc_pages() 60 card->total_pcm_alloc_bytes + size > max_alloc_per_card) in do_alloc_pages() [all …]
|
D | memalloc.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 11 #include <linux/dma-mapping.h> 12 #include <linux/dma-map-ops.h> 22 void *(*alloc)(struct snd_dma_buffer *dmab, size_t size); 27 unsigned int ofs, unsigned int size); 34 __GFP_RETRY_MAYFAIL | /* don't trigger OOM-killer */ \ 35 __GFP_NOWARN) /* no stack trace print - this call is non-critical */ 39 static void *__snd_dma_alloc_pages(struct snd_dma_buffer *dmab, size_t size) in __snd_dma_alloc_pages() argument 43 if (WARN_ON_ONCE(!ops || !ops->alloc)) in __snd_dma_alloc_pages() 45 return ops->alloc(dmab, size); in __snd_dma_alloc_pages() [all …]
|
/linux-6.12.1/fs/pstore/ |
D | ram_core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 26 * struct persistent_ram_buffer - persistent circular RAM buffer 28 * @sig: Signature to indicate header (PERSISTENT_RAM_SIG xor PRZ-type value) 29 * @start: First valid byte in the buffer. 30 * @size: Number of valid bytes in the buffer. 31 * @data: The contents of the buffer. 36 atomic_t size; member 44 return atomic_read(&prz->buffer->size); in buffer_size() 49 return atomic_read(&prz->buffer->start); in buffer_start() 59 if (!(prz->flags & PRZ_FLAG_NO_LOCK)) in buffer_start_add() [all …]
|
/linux-6.12.1/sound/isa/gus/ |
D | gus_dram.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 14 unsigned int address, unsigned int size) in snd_gus_dram_poke() argument 18 char buffer[256], *pbuffer; in snd_gus_dram_poke() local 20 while (size > 0) { in snd_gus_dram_poke() 21 size1 = size > sizeof(buffer) ? sizeof(buffer) : size; in snd_gus_dram_poke() 22 if (copy_from_user(buffer, _buffer, size1)) in snd_gus_dram_poke() 23 return -EFAULT; in snd_gus_dram_poke() 24 if (gus->interwave) { in snd_gus_dram_poke() 25 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gus_dram_poke() 28 outsb(GUSP(gus, DRAM), buffer, size1); in snd_gus_dram_poke() [all …]
|
/linux-6.12.1/lib/ |
D | kunit_iov_iter.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 /* I/O iterator tests. This can only test kernel-backed iterator types. 35 { -1 } 54 void *buffer; in iov_kunit_create_buffer() local 67 pages[i]->index = i; in iov_kunit_create_buffer() 69 buffer = vmap(pages, npages, VM_MAP | VM_MAP_PUT_PAGES, PAGE_KERNEL); in iov_kunit_create_buffer() 70 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buffer); in iov_kunit_create_buffer() 72 kunit_add_action_or_reset(test, iov_kunit_unmap, buffer); in iov_kunit_create_buffer() 73 return buffer; in iov_kunit_create_buffer() 79 void *buffer, size_t bufsize, in iov_kunit_load_kvec() argument [all …]
|
/linux-6.12.1/Documentation/core-api/ |
D | swiotlb.rst | 1 .. SPDX-License-Identifier: GPL-2.0 7 swiotlb is a memory buffer allocator used by the Linux kernel DMA layer. It is 9 buffer because of hardware limitations or other requirements. In such a case, 10 the DMA layer calls swiotlb to allocate a temporary memory buffer that conforms 11 to the limitations. The DMA is done to/from this temporary memory buffer, and 12 the CPU copies the data between the temporary buffer and the original target 13 memory buffer. This approach is generically called "bounce buffering", and the 14 temporary memory buffer is called a "bounce buffer". 19 These APIs use the device DMA attributes and kernel-wide settings to determine 24 Because the CPU copies data between the bounce buffer and the original target [all …]
|
/linux-6.12.1/drivers/infiniband/hw/hfi1/ |
D | eprom.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 14 * partition 1: 4K config file (sector size) 22 /* controller page size, in bytes */ 24 #define EP_PAGE_MASK (EP_PAGE_SIZE - 1) 62 u32 buffer[EP_PAGE_DWORDS]; in read_length() local 75 * command address range. Note that '>' is correct below - the end in read_length() 79 return -EINVAL; in read_length() 88 read_page(dd, read_start, buffer); in read_length() 91 bytes = EP_PAGE_SIZE - start_offset; in read_length() 95 memcpy(dest, (u8 *)buffer + start_offset, len); in read_length() [all …]
|
/linux-6.12.1/drivers/net/ethernet/intel/ixgbe/ |
D | ixgbe_mbx.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 1999 - 2018 Intel Corporation. */ 10 * ixgbe_read_mbx - Reads a message from the mailbox 12 * @msg: The message buffer 13 * @size: Length of buffer 16 * returns SUCCESS if it successfully read message from buffer 18 int ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) in ixgbe_read_mbx() argument 20 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbe_read_mbx() 22 /* limit read to size of mailbox */ in ixgbe_read_mbx() 23 if (size > mbx->size) in ixgbe_read_mbx() [all …]
|
/linux-6.12.1/include/crypto/ |
D | dh.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * Diffie-Hellman secret to be used with kpp API along with helper functions 23 * struct dh - define a DH private key 26 * @p: Diffie-Hellman parameter P 27 * @g: Diffie-Hellman generator G 28 * @key_size: Size of the private DH key 29 * @p_size: Size of DH parameter P 30 * @g_size: Size of DH generator G 42 * crypto_dh_key_len() - Obtain the size of the private DH key 45 * This function returns the packet DH key size. A caller can use that [all …]
|
/linux-6.12.1/drivers/net/ethernet/qlogic/qed/ |
D | qed_dbg_hsi.h | 1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 3 * Copyright (c) 2019-2021 Marvell International Ltd. 116 /* binary debug buffer types */ 149 /* Attention block per-type data */ 224 /* Chip-specific block debug data */ 254 /* Chip-specific block user debug data */ 282 u8 data_size; /* size in dwords of the data following this header */ 324 u16 data_size; /* size in dwords of the data following this header */ 350 u16 size; /* register size in dwords */ member 378 u16 size; /* register size in dwords */ member [all …]
|
/linux-6.12.1/drivers/hwtracing/coresight/ |
D | coresight-tmc-etr.c | 1 // SPDX-License-Identifier: GPL-2.0 9 #include <linux/dma-mapping.h> 17 #include "coresight-catu.h" 18 #include "coresight-etm-perf.h" 19 #include "coresight-priv.h" 20 #include "coresight-tmc.h" 26 size_t size; member 36 * etr_perf_buffer - Perf buffer used for ETR 37 * @drvdata - The ETR drvdaga this buffer has been allocated for. 38 * @etr_buf - Actual buffer used by the ETR [all …]
|
/linux-6.12.1/tools/testing/selftests/arm64/mte/ |
D | check_buffer_fill.c | 1 // SPDX-License-Identifier: GPL-2.0 17 1, 555, 1033, MT_GRANULE_SIZE - 1, MT_GRANULE_SIZE, 18 /* page size - 1*/ 0, /* page_size */ 0, /* page size + 1 */ 0 47 /* Check the buffer whether it is filled. */ in check_buffer_by_byte() 80 mte_initialize_current_context(mode, (uintptr_t)ptr, -underflow_range); in check_buffer_underflow_by_byte() 82 /* Set some value in tagged memory and make the buffer underflow */ in check_buffer_underflow_by_byte() 83 for (j = sizes[i] - 1; (j >= -underflow_range) && in check_buffer_underflow_by_byte() 84 (!cur_mte_cxt.fault_valid); j--) { in check_buffer_underflow_by_byte() 90 /* Check whether the buffer is filled */ in check_buffer_underflow_by_byte() 94 ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%lx\n", in check_buffer_underflow_by_byte() [all …]
|
/linux-6.12.1/drivers/net/ethernet/intel/igb/ |
D | e1000_mbx.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 2007 - 2018 Intel Corporation. */ 7 * igb_read_mbx - Reads a message from the mailbox 9 * @msg: The message buffer 10 * @size: Length of buffer 14 * returns SUCCESS if it successfully read message from buffer 16 s32 igb_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id, in igb_read_mbx() argument 19 struct e1000_mbx_info *mbx = &hw->mbx; in igb_read_mbx() 20 s32 ret_val = -E1000_ERR_MBX; in igb_read_mbx() 22 /* limit read to size of mailbox */ in igb_read_mbx() [all …]
|