| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
| D | hmm-tests.c | 1 // SPDX-License-Identifier: GPL-2.0 39 unsigned long size; member 50 #define ALIGN(x, a) (((x) + (a - 1)) & (~((a) - 1))) 82 self->page_size = sysconf(_SC_PAGE_SIZE); in FIXTURE_SETUP() 83 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() 85 self->fd = hmm_open(0); in FIXTURE_SETUP() 86 ASSERT_GE(self->fd, 0); in FIXTURE_SETUP() 91 self->page_size = sysconf(_SC_PAGE_SIZE); in FIXTURE_SETUP() 92 self->page_shift = ffs(self->page_size) - 1; in FIXTURE_SETUP() 94 self->fd0 = hmm_open(0); in FIXTURE_SETUP() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/vmwgfx/ |
| D | vmwgfx_cmdbuf.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 36 * Size of inline command buffers. Try to make sure that a page size is a 37 * multiple of the DMA pool allocation size. 41 (1024 - ALIGN(sizeof(SVGACBHeader), VMW_CMDBUF_INLINE_ALIGN)) 44 * struct vmw_cmdbuf_context - Command buffer context queues 61 * struct vmw_cmdbuf_man: - Command buffer manager 63 * @cur_mutex: Mutex protecting the command buffer used for incremental small 66 * main pool buffer space. 70 * @work: A struct work_struct implementeing command buffer error handling. [all …]
|
| /kernel/linux/linux-5.10/drivers/video/ |
| D | hdmi.c | 17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 34 static u8 hdmi_infoframe_checksum(const u8 *ptr, size_t size) in hdmi_infoframe_checksum() argument 40 for (i = 0; i < size; i++) in hdmi_infoframe_checksum() 43 return 256 - csum; in hdmi_infoframe_checksum() 46 static void hdmi_infoframe_set_checksum(void *buffer, size_t size) in hdmi_infoframe_set_checksum() argument 48 u8 *ptr = buffer; in hdmi_infoframe_set_checksum() 50 ptr[3] = hdmi_infoframe_checksum(buffer, size); in hdmi_infoframe_set_checksum() 54 * hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe 61 frame->type = HDMI_INFOFRAME_TYPE_AVI; in hdmi_avi_infoframe_init() 62 frame->version = 2; in hdmi_avi_infoframe_init() [all …]
|
| /kernel/linux/linux-6.6/include/linux/ |
| D | seq_buf.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 13 * seq_buf - seq buffer structure 14 * @buffer: pointer to the buffer 15 * @size: size of the buffer 16 * @len: the amount of data inside the buffer 19 char *buffer; member 20 size_t size; member 24 #define DECLARE_SEQ_BUF(NAME, SIZE) \ argument 26 .buffer = (char[SIZE]) { 0 }, \ 27 .size = SIZE, \ [all …]
|
| D | ring_buffer.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 22 * enum ring_buffer_type - internal ring buffer types 27 * size is variable depending on how much 31 * size = 4 + length (bytes) 35 * size = 8 bytes 42 * size = 8 bytes 49 * size = 4 + length (bytes) 52 * array[0..(length+3)/4-1] holds data 53 * size = 4 + length (bytes) 64 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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/drivers/tty/ |
| D | tty_buffer.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Tty buffer allocation management 32 * We default to dicing tty buffer allocations to this many characters 33 * in order to avoid multiple page allocations. We know the size of 35 * the buffer is 256 byte aligned. See tty_buffer_find for the allocation 39 #define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF) 42 * tty_buffer_lock_exclusive - gain exclusive access to buffer 43 * tty_buffer_unlock_exclusive - release exclusive access 45 * @port: tty port owning the flip buffer 48 * excluding the buffer work and any pending flush from using the flip [all …]
|
| /kernel/linux/linux-6.6/drivers/tty/ |
| D | tty_buffer.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Tty buffer allocation management 33 * We default to dicing tty buffer allocations to this many characters 34 * in order to avoid multiple page allocations. We know the size of 36 * buffer is 256 byte aligned. See tty_buffer_find for the allocation 40 #define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~TTYB_ALIGN_MASK) 43 * tty_buffer_lock_exclusive - gain exclusive access to buffer 44 * @port: tty port owning the flip buffer 47 * the buffer work and any pending flush from using the flip buffer. Data can 48 * continue to be added concurrently to the flip buffer from the driver side. [all …]
|
| /kernel/linux/linux-5.10/sound/core/ |
| D | pcm_memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 36 card->total_pcm_alloc_bytes += bytes; in __update_allocated_size() 41 mutex_lock(&card->memory_mutex); in update_allocated_size() 43 mutex_unlock(&card->memory_mutex); in update_allocated_size() 48 mutex_lock(&card->memory_mutex); in decrease_allocated_size() 49 WARN_ON(card->total_pcm_alloc_bytes < bytes); in decrease_allocated_size() 50 __update_allocated_size(card, -(ssize_t)bytes); in decrease_allocated_size() 51 mutex_unlock(&card->memory_mutex); in decrease_allocated_size() 55 size_t size, struct snd_dma_buffer *dmab) in do_alloc_pages() argument 59 /* check and reserve the requested size */ in do_alloc_pages() [all …]
|
| /kernel/linux/linux-5.10/fs/pstore/ |
| D | ram_core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 24 * struct persistent_ram_buffer - persistent circular RAM buffer 27 * signature to indicate header (PERSISTENT_RAM_SIG xor PRZ-type value) 30 * @size: 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() 60 raw_spin_lock_irqsave(&prz->buffer_lock, flags); in buffer_start_add() 62 old = atomic_read(&prz->buffer->start); in buffer_start_add() [all …]
|
| /kernel/linux/linux-6.6/sound/core/ |
| D | pcm_memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 36 card->total_pcm_alloc_bytes += bytes; in __update_allocated_size() 41 mutex_lock(&card->memory_mutex); in update_allocated_size() 43 mutex_unlock(&card->memory_mutex); in update_allocated_size() 48 mutex_lock(&card->memory_mutex); in decrease_allocated_size() 49 WARN_ON(card->total_pcm_alloc_bytes < bytes); in decrease_allocated_size() 50 __update_allocated_size(card, -(ssize_t)bytes); in decrease_allocated_size() 51 mutex_unlock(&card->memory_mutex); in decrease_allocated_size() 55 int str, size_t size, struct snd_dma_buffer *dmab) in do_alloc_pages() argument 60 /* check and reserve the requested size */ in do_alloc_pages() [all …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-6.6/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 …]
|
| /kernel/linux/linux-6.6/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. 34 { -1 } 53 void *buffer; in iov_kunit_create_buffer() local 65 buffer = vmap(pages, npages, VM_MAP | VM_MAP_PUT_PAGES, PAGE_KERNEL); in iov_kunit_create_buffer() 66 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buffer); in iov_kunit_create_buffer() 68 kunit_add_action_or_reset(test, iov_kunit_unmap, buffer); in iov_kunit_create_buffer() 69 return buffer; in iov_kunit_create_buffer() 75 void *buffer, size_t bufsize, in iov_kunit_load_kvec() argument 78 size_t size = 0; in iov_kunit_load_kvec() local [all …]
|
| /kernel/linux/linux-5.10/include/linux/ |
| D | ring_buffer.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 22 * enum ring_buffer_type - internal ring buffer types 27 * size is variable depending on how much 31 * size = 4 + length (bytes) 35 * size = 8 bytes 42 * size = 8 bytes 49 * size = 4 + length (bytes) 52 * array[0..(length+3)/4-1] holds data 53 * size = 4 + length (bytes) 70 * will try to remove the event from the ring buffer completely [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 …]
|