Lines Matching +full:memory +full:- +full:mapping
1 // SPDX-License-Identifier: GPL-2.0
5 //! Virtual memory.
8 //! VMA corresponds to a region of memory that the userspace process can access, and the VMA lets
9 //! you control what happens when userspace reads or writes to that region of memory.
29 /// It represents an area of virtual memory.
42 /// Access a virtual memory area given a raw pointer.
49 pub unsafe fn from_raw<'a>(vma: *const bindings::vm_area_struct) -> &'a Self { in from_raw()
56 pub fn as_ptr(&self) -> *mut bindings::vm_area_struct { in as_ptr()
62 pub fn mm(&self) -> &MmWithUser { in mm()
64 // read lock or stronger. This implies that the underlying mm has a non-zero value of in mm()
69 /// Returns the flags associated with the virtual memory area.
73 pub fn flags(&self) -> vm_flags_t { in flags()
79 /// Returns the (inclusive) start address of the virtual memory area.
81 pub fn start(&self) -> usize { in start()
87 /// Returns the (exclusive) end address of the virtual memory area.
89 pub fn end(&self) -> usize { in end()
98 /// tables intact, and freeing any memory referenced by the VMA in this range. That is,
99 /// anonymous memory is completely freed, file-backed memory has its reference count on page
103 /// table structure used to map physical memory into a virtual address space - each virtual
109 /// memory.
138 pub fn as_mixedmap_vma(&self) -> Option<&VmaMixedMap> { in as_mixedmap_vma()
151 /// It represents an area of virtual memory.
172 fn deref(&self) -> &VmaRef { in deref()
178 /// Access a virtual memory area given a raw pointer.
185 pub unsafe fn from_raw<'a>(vma: *const bindings::vm_area_struct) -> &'a Self { in from_raw()
190 /// Maps a single page at the given address within the virtual memory area.
194 pub fn vm_insert_page(&self, address: usize, page: &Page) -> Result { in vm_insert_page()
201 /// A configuration object for setting up a VMA in an `f_ops->mmap()` hook.
203 /// The `f_ops->mmap()` hook is called when a new VMA is being created, and the hook is able to
211 /// `f_ops->mmap()` hook.
222 fn deref(&self) -> &VmaRef { in deref()
228 /// Access a virtual memory area given a raw pointer.
234 pub unsafe fn from_raw<'a>(vma: *mut bindings::vm_area_struct) -> &'a Self { in from_raw()
261 pub fn set_mixedmap(&self) -> &VmaMixedMap { in set_mixedmap()
272 /// This is used for memory mapped IO and similar. The flag tells other parts of the kernel to
273 /// avoid looking at the pages. For memory mapped IO this is useful as accesses to the pages
312 /// This flag indicates whether userspace is mapping this vma as readable.
314 pub fn readable(&self) -> bool { in readable()
326 pub fn try_clear_mayread(&self) -> Result { in try_clear_mayread()
337 /// This flag indicates whether userspace is mapping this vma as writable.
339 pub fn writable(&self) -> bool { in writable()
351 pub fn try_clear_maywrite(&self) -> Result { in try_clear_maywrite()
362 /// This flag indicates whether userspace is mapping this vma as executable.
364 pub fn executable(&self) -> bool { in executable()
376 pub fn try_clear_mayexec(&self) -> Result { in try_clear_mayexec()
398 /// Mapping allows reads.
401 /// Mapping allows writes.
404 /// Mapping allows execution.
407 /// Mapping is shared.
410 /// Mapping may be updated to allow reads.
413 /// Mapping may be updated to allow writes.
416 /// Mapping may be updated to allow execution.
419 /// Mapping may be updated to be shared.
422 /// Page-ranges managed without `struct page`, just pure PFN.
425 /// Memory mapped I/O or similar.
446 /// Synchronous page faults. (DAX-specific)
449 /// Architecture-specific flag.