summaryrefslogtreecommitdiff
path: root/vm/vm_kmem.c
AgeCommit message (Collapse)Author
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit 9c7906d8ad6ebec014b22b8757d916e9cad7d6d3.
2017-09-07Use accessors when referring to global kernel objectsRichard Braun
The kernel_map/kernel_pmap/kernel_task/etc... names were reused as they were in the Mach source code. They've been a (mostly harmless) long-standing violation of the coding rules.
2017-09-06vm: rename min/max macros to start/end variantsRichard Braun
The real problem actually only applies to "max" names, for which the value is ambiguous, as "max" usually implies the value is included in the associated range, which is not the case for these macros.
2017-09-02Make assert have no side effectsRichard Braun
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
2017-08-04vm/vm_page: rename vm_page_atop and vm_page_ptoaRichard Braun
Talk about "bytes" instead of "addresses" for better clarity.
2017-07-13Switch to initialization operationsRichard Braun
2017-07-02vm/vm_kmem: create a VM object to track mapped kernel pagesRichard Braun
2017-06-25Remove the param moduleRichard Braun
Move the page properties into the new x86/page module, and the virtual memory layout macros into the x86/pmap module.
2017-06-22kern/macros: move the __read_mostly macro hereRichard Braun
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
2017-02-04Clean up compilationRichard Braun
Instead of mixing standard headers and internal redefinitions of standard types, completely rely on the compiler for what is guaranteed for a free standing environment. This results in the removal of kern/stddef.h and kern/stdint.h. The kern/types.h header is reintroduced for the different (and saner) purpose of defining types not specified in standard C, namely ssize_t for now.
2017-02-04kern/types: split into module-specific type headersRichard Braun
Using a single header for all types causing inclusion circular dependencies isn't very elegant and doesn't scale.
2017-01-27vm/vm_kmem: return NULL instead of 0 where appropriateRichard Braun
2017-01-13Replace unsigned long with uintptr_t for integer/pointer conversionsRichard Braun
This is mostly done for the machine-independent part.
2017-01-09x86/pmap: report pmap update failuresRichard Braun
Update the test_vm_page_fill module accordingly. The vm_kmem module needs to be reworked in order to correctly handle failures.
2016-12-09Force brackets around one-line conditional statementsRichard Braun
This change was done using astyle, with a few manual editing here and there.
2014-12-10vm/vm_kmem: replace call to pmap_extractRichard Braun
2014-12-10vm/vm_kmem: remove vm_kmem_lookup_pageRichard Braun
This function is now unused, and there shouldn't be any need for it in the future.
2014-12-10vm/vm_kmem: directmap updateRichard Braun
Now that a direct physical mapping is available, memory can be allocated out of it without the need of an early virtual memory allocator.
2014-11-17vm/vm_kmem: minor interface updatesRichard Braun
Make functions accept and return pointers instead of integers. Most users of the kernel allocator directly use the returned addresses. Pointers make that more practical.
2014-11-17vm/vm_map: minor interface updatesRichard Braun
Update interface so that it's closer to the standard mmap() call. Fix some offset declarations as uint64_t.
2014-06-19vm/vm_kmem: fix page allocation error handlingRichard Braun
Although not yet clearly stated since it's not yet decided whether it will remain the normal behaviour, the pmap functions assume physical mappings to be valid on removal or protection update. But the kernel virtual memory allocation function vm_kmem_alloc would merely call vm_kmem_free if a page couldn't be allocated, resulting on the unconditional removal of the underlying physical mappings of the whole range, including addresses for which no mapping was created.
2014-05-08x86/pmap: per-CPU page tablesRichard Braun
Although currently not very useful since all pmap operations are global, this change enables the precise targeting of processors when maintaining the consistency of physical maps. It is essential to a scalable virtual memory system where non-overlapping mapping operations can be processed concurrently. It also temporarily removes some functionalities such as the ability to manipulate non-kernel pmaps and lazy TLB invalidation. These will be added again in the future.
2014-01-02Declare variables as read mostly where appropriateRichard Braun
2013-07-20x86/pmap: remove kernel-specific functionsRichard Braun
Remove the pmap_klimit, pmap_kgrow, pmap_kenter and pmap_kremove functions from the pmap interface. The regular pmap_enter and pmap_remove functions are now used instead. The kernel physical map is handled almost exactly like user physical maps, except shared root page table pages need special care. The pmap_kenter and pmap_kremove functions still exist but are private to the pmap implementation.
2013-07-10vm/vm_page: introduce page usage typesRichard Braun
2013-07-09vm/vm_phys: merge into the vm_page moduleRichard Braun
The original idea was to separate physical page allocation from page list management, but it doesn't make much sense any more.
2013-07-03x86/pmap: change pmap_kenter to pass protectionRichard Braun
2013-06-28x86/pmap: replace pmap_kupdate with pmap_updateRichard Braun
Similar to pmap_protect and pmap_extract, pmap_update is meant to handle both kernel and regular pmap updates.
2013-06-28x86/pmap: replace pmap_kextract with pmap_extractRichard Braun
As it was done for pmap_protect, replace a kernel-specific call with one that can handle both the kernel and regular pmaps. The new function isn't complete yet and cannot handle physical maps that aren't the kernel pmap or the currently loaded pmap.
2013-06-15vm/vm_map: rework flagsRichard Braun
Add vm/vm_adv.h for VM_ADV_xxx advice macros, and directly use VM_{ADV,INHERIT,PROT}_xxx macros in the "packed" format used for mapping requests and in map entries. This allows simpler comparisons between stored flags and user provided values.
2013-06-15vm/vm_map: advice macros updateRichard Braun
Use slightly shorter names, add WILLNEED and DONTNEED, and update users.
2012-12-22vm/vm_kmem: make vm_kmem_{alloc,free}_va publicRichard Braun
2012-12-22x86/pmap: rename pmap_growkernel to pmap_kgrowRichard Braun
2012-12-11vm/vm_kmem: fix pmap update argumentsRichard Braun
2012-12-09x86/pmap: inter-processor TLB updatesRichard Braun
Scheduling is temporarily disabled until the thread module is able to cope with multiple processors.
2012-12-07kern/kmem: rework buffer-to-slab lookupRichard Braun
Instead of using a red-black tree, rely on the VM system to store kmem specific private data.
2012-11-21x86/pmap: turn pmap_klimit into a functionRichard Braun
Let the pmap module internally handle the mapping limit.
2012-11-03Merge lib into kernRichard Braun
There are no precise enough criteria to justify the separation of these two directories.
2012-10-15x86/pmap: rewrite to support both i386 and amd64Richard Braun
This new code handles 32-bit (including PAE, as before) and 64-bit paging. A few macros and tables only are adjusted depending on the selected mode.
2012-10-10Rename vm_phys_t to phys_addr_tRichard Braun
2012-09-30Initial commitRichard Braun