/linux/include/linux/ |
H A D | highmem.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 14 #include "highmem-internal.h" 17 * kmap - Map a page for long term usage 18 * @page: Pointer to the page to be mapped 37 static inline void *kmap(struct page *page); 40 * kunmap - Unmap the virtual address mapped by kmap() 41 * @page: Pointer to the page which was mapped by kmap() 46 static inline void kunmap(struct page *page); 49 * kmap_to_page - Get the page for a kmap'ed address 52 * Returns: The page which is mapped to @addr. [all …]
|
H A D | scatterlist.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 13 unsigned int offset; member 31 #define sg_dma_address(sg) ((sg)->dma_address) 34 #define sg_dma_len(sg) ((sg)->dma_length) 36 #define sg_dma_len(sg) ((sg)->length) 55 * the page pointer AND encode information about the sg table as well. The two 71 * We overload the LSB of the page pointer to indicate whether it's 73 * Those low bits are there for everyone! (thanks mason :-) 79 return sg->page_link & SG_PAGE_LINK_MASK; in __sg_flags() 84 return (struct scatterlist *)(sg->page_link & ~SG_PAGE_LINK_MASK); in sg_chain_ptr() [all …]
|
H A D | swapops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 #include <linux/radix-tree.h> 18 * the low-order bits. 20 * We arrange the `type' and `offset' fields so that `type' is at the six 21 * high-order bits of the swp_entry_t and `offset' is right-aligned in the 25 * swp_entry_t's are *never* stored anywhere in their arch-dependen 86 swp_entry(unsigned long type,pgoff_t offset) swp_entry() argument 168 make_readable_device_private_entry(pgoff_t offset) make_readable_device_private_entry() argument 173 make_writable_device_private_entry(pgoff_t offset) make_writable_device_private_entry() argument 189 make_readable_device_exclusive_entry(pgoff_t offset) make_readable_device_exclusive_entry() argument 194 make_writable_device_exclusive_entry(pgoff_t offset) make_writable_device_exclusive_entry() argument 210 make_readable_device_private_entry(pgoff_t offset) make_readable_device_private_entry() argument 215 make_writable_device_private_entry(pgoff_t offset) make_writable_device_private_entry() argument 230 make_readable_device_exclusive_entry(pgoff_t offset) make_readable_device_exclusive_entry() argument 235 make_writable_device_exclusive_entry(pgoff_t offset) make_writable_device_exclusive_entry() argument 274 make_readable_migration_entry(pgoff_t offset) make_readable_migration_entry() argument 279 make_readable_exclusive_migration_entry(pgoff_t offset) make_readable_exclusive_migration_entry() argument 284 make_writable_migration_entry(pgoff_t offset) make_writable_migration_entry() argument 339 make_readable_migration_entry(pgoff_t offset) make_readable_migration_entry() argument 344 make_readable_exclusive_migration_entry(pgoff_t offset) make_readable_exclusive_migration_entry() argument 349 make_writable_migration_entry(pgoff_t offset) make_writable_migration_entry() argument 398 make_hwpoison_entry(struct page * page) make_hwpoison_entry() argument 411 make_hwpoison_entry(struct page * page) make_hwpoison_entry() argument 565 set_pmd_migration_entry(struct page_vma_mapped_walk * pvmw,struct page * page) set_pmd_migration_entry() argument [all...] |
/linux/fs/squashfs/ |
H A D | file.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Squashfs - a compressed read only filesystem for Linux 14 * compressed fragment block (tail-end packed block). The compressed size 23 * retaining a simple and space-efficient block list on disk. The cache 45 * Locate cache slot in range [offset, index] for specified inode. If 48 static struct meta_index *locate_meta_index(struct inode *inode, int offset, in locate_meta_index() argument 52 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; in locate_meta_index() 55 mutex_lock(&msblk->meta_index_mutex); in locate_meta_index() 57 TRACE("locate_meta_index: index %d, offset %d\n", index, offset); in locate_meta_index() 59 if (msblk->meta_index == NULL) in locate_meta_index() [all …]
|
H A D | block.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Squashfs - a compressed read only filesystem for Linux 12 * This file implements the low-level routines to read and decompress 31 * Returns the amount of bytes copied to the page actor. 35 int offset, int req_length) in copy_bio_to_actor() argument 50 int bytes_to_copy = min_t(int, bvec->bv_len - offset, in copy_bio_to_actor() 51 PAGE_SIZE - actor_offset); in copy_bio_to_actor() 54 req_length - copied_bytes); in copy_bio_to_actor() 57 offset, bytes_to_copy); in copy_bio_to_actor() 61 offset += bytes_to_copy; in copy_bio_to_actor() [all …]
|
/linux/sound/pci/emu10k1/ |
H A D | memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * EMU10K1 memory page allocation (PTB area) 18 /* page arguments of these two macros are Emu page (4096 bytes), not like 21 #define __set_ptb_entry(emu,page,addr) \ argument 22 (((__le32 *)(emu)->ptb_pages.area)[page] = \ 23 cpu_to_le32(((addr) << (emu->address_mode)) | (page))) 24 #define __get_ptb_entry(emu, page) \ argument 25 (le32_to_cpu(((__le32 *)(emu)->ptb_pages.area)[page])) 30 /* get aligned page from offset address */ 31 #define get_aligned_page(offset) ((offset) >> PAGE_SHIFT) argument [all …]
|
/linux/include/net/page_pool/ |
H A D | helpers.h | 1 /* SPDX-License-Identifier: GPL-2.0 11 * The page_pool allocator is optimized for recycling page or page fragment used 15 * which allocate memory with or without page splitting depending on the 19 * always smaller than half a page, it can use one of the more specific API 22 * 1. page_pool_alloc_pages(): allocate memory without page splitting when 23 * driver knows that the memory it need is always bigger than half of the page 24 * allocated from page pool. There is no cache line dirtying for 'struct page' 25 * when a page is recycled back to the page pool. 27 * 2. page_pool_alloc_frag(): allocate memory with page splitting when driver 29 * page allocated from page pool. Page splitting enables memory saving and thus [all …]
|
/linux/rust/kernel/ |
H A D | page.rs | 1 // SPDX-License-Identifier: GPL-2.0 3 //! Kernel page allocation and management. 14 /// A bitwise shift for the page size. 17 /// The number of bytes in a page. 20 /// A bitmask that gives the page containing a given address. 21 pub const PAGE_MASK: usize = !(PAGE_SIZE - 1); 27 pub const fn page_align(addr: usize) -> usize { 28 // Parentheses around `PAGE_SIZE - struct 29 page: NonNull<bindings::page>, global() field 34 unsafe impl Send for Page {} global() implementation 38 unsafe impl Sync for Page {} global() implementation 40 impl Page { global() implementation 67 let page = unsafe { bindings::alloc_pages(flags.as_raw(), 0) }; alloc_page() localVariable 68 let page = NonNull::new(page).ok_or(AllocError)?; alloc_page() localVariable 75 as_ptr(&self) -> *mut bindings::page as_ptr() argument 245 impl Drop for Page { global() implementation [all...] |
/linux/fs/hfsplus/ |
H A D | bitmap.c | 1 // SPDX-License-Identifier: GPL-2.0 20 u32 offset, u32 *max) in hfsplus_block_allocate() argument 23 struct page *page; in hfsplus_block_allocate() local 34 hfs_dbg(BITMAP, "block_allocate: %u,%u,%u\n", size, offset, len); in hfsplus_block_allocate() 35 mutex_lock(&sbi->alloc_mutex); in hfsplus_block_allocate() 36 mapping = sbi->alloc_file->i_mapping; in hfsplus_block_allocate() 37 page = read_mapping_page(mapping, offset / PAGE_CACHE_BITS, NULL); in hfsplus_block_allocate() 38 if (IS_ERR(page)) { in hfsplus_block_allocate() 42 pptr = kmap_local_page(page); in hfsplus_block_allocate() 43 curr = pptr + (offset & (PAGE_CACHE_BITS - 1)) / 32; in hfsplus_block_allocate() [all …]
|
/linux/drivers/nvmem/ |
H A D | rave-sp-eeprom.c | 1 // SPDX-License-Identifier: GPL-2.0+ 10 #include <linux/mfd/rave-sp.h> 12 #include <linux/nvmem-provider.h> 18 * enum rave_sp_eeprom_access_type - Supported types of EEPROM access 29 * enum rave_sp_eeprom_header_size - EEPROM command header sizes 43 * struct rave_sp_eeprom_page - RAVE SP EEPROM page 59 * struct rave_sp_eeprom - RAVE SP EEPROM device 76 * rave_sp_eeprom_io - Low-level part of EEPROM page access 80 * @idx: number of the EEPROM page 81 * @page: Data to write or buffer to store result (via page->data) [all …]
|
/linux/drivers/gpu/drm/i915/gem/ |
H A D | i915_gem_object.h | 2 * SPDX-License-Identifier: MIT 22 #define obj_to_i915(obj__) to_i915((obj__)->base.dev) 28 if (overflows_type(size, obj->base.size)) in i915_gem_object_size_2big() 87 * i915_gem_object_lookup_rcu - look up a temporary GEM object from its handle 102 return idr_find(&file->object_idr, handle); in i915_gem_object_lookup_rcu() 108 if (obj && !kref_get_unless_zero(&obj->base.refcount)) in i915_gem_object_get_rcu() 135 drm_gem_object_get(&obj->base); in i915_gem_object_get() 143 __drm_gem_object_put(&obj->base); in i915_gem_object_put() 146 #define assert_object_held(obj) dma_resv_assert_held((obj)->base.resv) 158 kref_read(&obj->base.refcount) > 0) in assert_object_held_shared() [all …]
|
/linux/drivers/video/fbdev/core/ |
H A D | fb_defio.c | 26 static struct page *fb_deferred_io_get_page(struct fb_info *info, unsigned long offs) in fb_deferred_io_get_page() 28 struct fb_deferred_io *fbdefio = info->fbdefio; in fb_deferred_io_get_page() 29 const void *screen_buffer = info->screen_buffer; in fb_deferred_io_get_page() 30 struct page *page = NULL; in fb_deferred_io_get_page() local 32 if (fbdefio->get_page) in fb_deferred_io_get_page() 33 return fbdefio->get_page(info, offs); in fb_deferred_io_get_page() 36 page = vmalloc_to_page(screen_buffer + offs); in fb_deferred_io_get_page() 37 else if (info->fix.smem_start) in fb_deferred_io_get_page() 38 page = pfn_to_page((info->fix.smem_start + offs) >> PAGE_SHIFT); in fb_deferred_io_get_page() 40 if (page) in fb_deferred_io_get_page() [all …]
|
/linux/arch/arm/mm/ |
H A D | dma-mapping.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * linux/arch/arm/mm/dma-mapping.c 5 * Copyright (C) 2000-2004 Russell King 17 #include <linux/dma-direct.h> 18 #include <linux/dma-map-ops.h> 28 #include <asm/page.h> 33 #include <asm/dma-iommu.h> 36 #include <asm/xen/xen-ops.h> 55 struct page *page; member 64 struct page **ret_page); [all …]
|
/linux/sound/pci/trident/ |
H A D | trident_memory.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Trident 4DWave-NX memory page allocation (TLB area) 19 /* page arguments of these two macros are Trident page (4096 bytes), not like 22 #define __set_tlb_bus(trident,page,addr) \ argument 23 (trident)->tlb.entries[page] = cpu_to_le32((addr) & ~(SNDRV_TRIDENT_PAGE_SIZE-1)) 24 #define __tlb_to_addr(trident,page) \ argument 25 (dma_addr_t)le32_to_cpu((trident->tlb.entries[page]) & ~(SNDRV_TRIDENT_PAGE_SIZE - 1)) 28 /* page size == SNDRV_TRIDENT_PAGE_SIZE */ 29 #define ALIGN_PAGE_SIZE PAGE_SIZE /* minimum page size for allocation */ 31 /* fill TLB entrie(s) corresponding to page with ptr */ [all …]
|
/linux/drivers/net/ethernet/intel/e1000e/ |
H A D | phy.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 1999 - 2018 Intel Corporation. */ 8 static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, 10 static u32 e1000_get_phy_addr_for_hv_page(u32 page); 11 static s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset, 37 * e1000e_check_reset_block_generic - Check if PHY reset is blocked 54 * e1000e_get_phy_id - Retrieve the PHY ID and revision 62 struct e1000_phy_info *phy = &hw->phy; in e1000e_get_phy_id() 67 if (!phy->ops.read_reg) in e1000e_get_phy_id() 75 phy->id = (u32)(phy_id << 16); in e1000e_get_phy_id() [all …]
|
/linux/lib/ |
H A D | iov_iter.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 #include <linux/fault-inject-usercopy.h> 78 * fault_in_iov_iter_readable - fault in iov iterator for reading 83 * @size. For each iovec, fault in each page that constitutes the iovec. 88 * Always returns 0 for non-userspace iterators. 94 n -= fault_in_readable(i->ubuf + i->iov_offset, n); in fault_in_iov_iter_readable() 95 return size - n; in fault_in_iov_iter_readable() 101 size -= count; in fault_in_iov_iter_readable() 102 for (p = iter_iov(i), skip = i->iov_offset; count; p++, skip = 0) { in fault_in_iov_iter_readable() 103 size_t len = min(count, p->iov_len - skip); in fault_in_iov_iter_readable() [all …]
|
/linux/arch/x86/include/uapi/asm/ |
H A D | sgx.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 3 * Copyright(c) 2016-20 Intel Corporation. 12 * enum sgx_page_flags - page control flags 13 * %SGX_PAGE_MEASURE: Measure the page contents with a sequence of 40 * struct sgx_enclave_create - parameter structure for the 42 * @src: address for the SECS page data 49 * struct sgx_enclave_add_pages - parameter structure for the 51 * @src: start address for the page data 52 * @offset: starting page offset 53 * @length: length of the data (multiple of the page size) [all …]
|
/linux/tools/virtio/linux/ |
H A D | scatterlist.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 9 unsigned int offset; member 15 #define sg_is_chain(sg) ((sg)->page_link & 0x01) 16 #define sg_is_last(sg) ((sg)->page_link & 0x02) 18 ((struct scatterlist *) ((sg)->page_link & ~0x03)) 21 * sg_assign_page - Assign a given page to an SG entry 23 * @page: The page 26 * Assign page to sg entry. Also see sg_set_page(), the most commonly used 30 static inline void sg_assign_page(struct scatterlist *sg, struct page *page) in sg_assign_page() argument 32 unsigned long page_link = sg->page_link & 0x3; in sg_assign_page() [all …]
|
/linux/fs/verity/ |
H A D | read_metadata.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 #include <linux/backing-dev.h> 17 void __user *buf, u64 offset, int length) in fsverity_read_merkle_tree() argument 19 const struct fsverity_operations *vops = inode->i_sb->s_vop; in fsverity_read_merkle_tree() 26 end_offset = min(offset + length, vi->tree_params.tree_size); in fsverity_read_merkle_tree() 27 if (offset >= end_offset) in fsverity_read_merkle_tree() 29 offs_in_page = offset_in_page(offset); in fsverity_read_merkle_tree() 30 last_index = (end_offset - 1) >> PAGE_SHIFT; in fsverity_read_merkle_tree() 33 * Iterate through each Merkle tree page in the requested range and copy in fsverity_read_merkle_tree() 38 for (index = offset >> PAGE_SHIFT; index <= last_index; index++) { in fsverity_read_merkle_tree() [all …]
|
/linux/net/ethtool/ |
H A D | eeprom.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 u32 offset; member 12 u8 page; member 33 u32 offset = request->offset; in fallback_set_params() local 34 u32 length = request->length; in fallback_set_params() 36 if (request->page) in fallback_set_params() 37 offset = request->page * ETH_MODULE_EEPROM_PAGE_LEN + offset; in fallback_set_params() 39 if (modinfo->type == ETH_MODULE_SFF_8472 && in fallback_set_params() 40 request->i2c_address == 0x51) in fallback_set_params() 41 offset += ETH_MODULE_EEPROM_PAGE_LEN * 2; in fallback_set_params() [all …]
|
/linux/crypto/async_tx/ |
H A D | async_xor.c | 1 // SPDX-License-Identifier: GPL-2.0-only 17 #include <linux/dma-mapping.h> 21 /* do_async_xor - dma map the pages and perform the xor with an engine */ 26 struct dma_device *dma = chan->device; in do_async_xor() 28 dma_async_tx_callback cb_fn_orig = submit->cb_fn; in do_async_xor() 29 void *cb_param_orig = submit->cb_param; in do_async_xor() 30 enum async_tx_flags flags_orig = submit->flags; in do_async_xor() 32 int src_cnt = unmap->to_cnt; in do_async_xor() 34 dma_addr_t dma_dest = unmap->addr[unmap->to_cnt]; in do_async_xor() 35 dma_addr_t *src_list = unmap->addr; in do_async_xor() [all …]
|
/linux/drivers/md/dm-vdo/indexer/ |
H A D | index-page-map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 6 #include "index-page-map.h" 10 #include "memory-alloc.h" 13 #include "string-utils.h" 14 #include "thread-utils.h" 16 #include "hash-utils.h" 20 * The index page map is conceptually a two-dimensional array indexed by chapter number and index 21 * page number within the chapter. Each entry contains the number of the last delta list on that 22 * index page. In order to save memory, the information for the last page in each chapter is not 28 #define PAGE_MAP_MAGIC_LENGTH (sizeof(PAGE_MAP_MAGIC) - 1) [all …]
|
/linux/drivers/hwmon/pmbus/ |
H A D | stpddc60.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 37 * Calculate the closest absolute offset between commanded vout value 44 int offset; in stpddc60_get_offset() local 47 v = 250 + (vout - 1) * 5; /* Convert VID to mv */ in stpddc60_get_offset() 53 offset = DIV_ROUND_CLOSEST(abs(l - v), 50); in stpddc60_get_offset() 55 if (offset > 0) in stpddc60_get_offset() 56 offset--; in stpddc60_get_offset() 58 return clamp_val(offset, 0, 7); in stpddc60_get_offset() 70 d = e - fixed; in stpddc60_adjust_linear() 75 m >>= -d; in stpddc60_adjust_linear() [all …]
|
/linux/drivers/md/ |
H A D | md-bitmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * bitmap.c two-level bitmap (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003 5 * bitmap_create - sets up the bitmap structure 6 * bitmap_destroy - destroys the bitmap structure 8 * additions, Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc.: 9 * - added disk storage for bitmap 10 * - changes to allow various bitmap chunk sizes 33 #include "md-bitmap.h" 36 /* version 4 insists the bitmap is in little-endian order 37 * with version 3, it is host-endian which is non-portable [all …]
|
/linux/arch/csky/mm/ |
H A D | dma-mapping.c | 1 // SPDX-License-Identifier: GPL-2.0 2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. 5 #include <linux/dma-map-ops.h> 17 struct page *page = phys_to_page(paddr); in cache_op() local 18 void *start = __va(page_to_phys(page)); in cache_op() 19 unsigned long offset = offset_in_page(paddr); in cache_op() local 25 if (offset + len > PAGE_SIZE) in cache_op() 26 len = PAGE_SIZE - offset; in cache_op() 28 if (PageHighMem(page)) { in cache_op() 29 start = kmap_atomic(page); in cache_op() [all …]
|