* Added a comment to vm_remove_all_page_mappings() that shows that we need to
change the mapping spinlock into a mutex.
* Pointed out some potential problems in the code.
* Added vm_page_at_index(), vm_clear_map_activation(), and vm_test_map_activation()
in preparation of the page scanner rewrite.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20407 a95241bf-73f2-0310-859d-f6bbb57e9c96
that points to both, the page and the area the page is in. This will allow a page
scanner to steal unused pages when necessary.
* The locking is currently done with a spinlock which we might want to have another
look at one day.
* dump_page() and dump_area_struct() now dump the page mappings as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20356 a95241bf-73f2-0310-859d-f6bbb57e9c96
* vm_area and vm_page now have a new field "mappings" where they will store lists
of vm_page_mapping structures. vm_page::ref_count is gone, as it's no longer
needed (it was never updated correctly, anyway).
* vm_caches now have a type field, ie. CACHE_TYPE_RAM for anonymous areas - this
makes the stores a bit less independent, but is quite handy in several places.
* Added new vm_map_page() and vm_unmap_pages() functions to be used whenever you
map in or unmap pages into/from an area. They don't do much more than handling
vm_page::wired_count correctly right now, though (ie. B_LAZY_LOCK is now working
as expected as well).
* Moved the device fault handler to vm_map_physical_memory(); it was not really
used as a fault handler, anyway.
* Didn't notice Ingo's changes to the I/O space region broke lock_memory(). It
now checks the type of the area that contains the memory, and doesn't lock
anymore if not needed which solves the problem in a platform independent way.
* Implemented lock_memory() and unlock_memory() for real: they now change the
vm_page::wired_count member to identify pages that shouldn't be paged out.
* vm_area_for() now uses vm_area_lookup() internally.
* Fixed various potential overflow conditions with areas that reach 0xffffffff.
* Creating anonymous areas with B_FULL_LOCK no longer causes vm_soft_fault()
to be called, instead, the pages are allocated and mapped (via vm_map_page())
directly.
* Removed the _vm_ prefix for create_area_struct() and create_reserved_area_struct().
* Fixed a bug in vm_page_write_modified() that would not have enqueued pages that
failed to be written to the modified queue again when needed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20251 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Renamed them, made everything static besides vm_allocate_early() (previous
vm_alloc_from_kernel_args()) which now allows you to specify a different
virtual than physical size, and therefore makes vm_alloc_virtual_from_kernel_args()
superfluous (which isn't exported anymore, and is now called allocate_early_virtual()).
* Enabled printing a stack trace on serial output on team crash - it doesn't hurt
for now, anyway.
* Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20244 a95241bf-73f2-0310-859d-f6bbb57e9c96
* "sc"/"where"/"bt" now prints the area where the function of the stack frame
is located in case there is no other information (using the above function).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19800 a95241bf-73f2-0310-859d-f6bbb57e9c96
this saves 4 bytes per page. To compensate the loss of bytes, the offset is now
stored in page size units, that's enough to address 2^44 or 16 TB (which is now
the maximal supported file size!).
* Renamed vm_page::ppn to physical_page_number.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15637 a95241bf-73f2-0310-859d-f6bbb57e9c96
them apart (this even saves a pointer from vm_virtual_map to its address space)
* aspace -> address_space
* vm_create_address_space() did not check if creating the semaphore succeeded
* Removed team::kaspace - was not really needed (introduced a new vm_kernel_address_space()
function that doesn't grab a reference to the address space)
* Removed vm_address_space::name - it was just a copy of the team name, anyway,
and there is always only one address space per team
* Removed aspace_id - the address space is now using the team_id
* Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15609 a95241bf-73f2-0310-859d-f6bbb57e9c96
has not yet been tested, though - I'll do this after this commit):
* Removed the arch_memory_type stuff from vm_area; since there are only 8 memory
ranges on x86, it's simply overkill. The MTRR code now remembers the area ID
and finds the MTRR that way (it could also iterate over the existing MTRRs).
* Introduced some post_modules() init functions.
* If the other x86 CPUs out there don't differ a lot, MTRR functionality might
be put back into the kernel.
* x86_write_msr() was broken, it wrote the 64 bit number with the 32 bit words
switched - it took me some time (and lots of #GPs) to figure that one out.
* Removed the macro read_ebp() and introduced a function x86_read_ebp()
(it's not really a time critical call).
* Followed the Intel docs on how to change MTRRs (symmetrically on all CPUs
with caches turned off).
* Asking for memory types will automatically change the requested length to
a power of two - note that BeOS seems to behave in the same, although that's
not really very clean.
* fixed MTRRs are ignored for now - we should make sure at least, though,
that they are identical on all CPUs (or turn them off, even though I'd
prefer the BIOS stuff to be uncacheable, which we don't enforce yet, though).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15528 a95241bf-73f2-0310-859d-f6bbb57e9c96
following 1152 MB - that area only guarantees that the heap can grow this much before
the application need the memory for something else. And even then, the heap range
is reused from top-to-bottom, allowing for maximum heap usage. Of course, if the
memory after the heap range is not claimed yet, it can still be claimed by the heap,
too. Added new syscall to create the reserved range.
Fixed a bug in vm_delete_areas(): when it removed reserved areas, the area list
could get messed up.
Fixed a bug in resize_area(): resized areas could never be deleted (missing vm_put_area())!
resize_area() now supports reserved regions (but not perfectly yet, see ToDo items).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12692 a95241bf-73f2-0310-859d-f6bbb57e9c96
only if memory becomes tight, and then the range is used from end to
start.
This is useful to reserve heap address ranges.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12675 a95241bf-73f2-0310-859d-f6bbb57e9c96
Renamed vm_area::lock to vm_area::protection to be less confusing - wiring
is still called wiring, though (might be renamed to lock later, as that's
how BeOS calls it).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9858 a95241bf-73f2-0310-859d-f6bbb57e9c96
- the above file now also exports a function to finally complete the kernel's
address space translation map after semaphores became available (was just
not done before)
- renamed some functions, especially the *_init2() functions are now called
like *_init_post_area() to indicate they are called after the area functionality
became available
- removed the _struct suffix from certain structures
- fixed some return types
- added prototype for vm_free_unused_boot_loader_range() to be called by
arch code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9423 a95241bf-73f2-0310-859d-f6bbb57e9c96
This cleans the page handling when having to make an area copy-on-write;
regions belong to vm_cache_ref, pages to vm_cache.
Added prototype for new call vm_copy_area().
Fixed some return types.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9263 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the way a vm_address_space is deleted: instead of having to explicitly
call vm_delete_aspace(), the last vm_put_aspace() will remove it.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9254 a95241bf-73f2-0310-859d-f6bbb57e9c96
syscalls or to the syscall mechanism (which exposed naming and parameter
inconsistencies).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8703 a95241bf-73f2-0310-859d-f6bbb57e9c96
they are now replaced by get_area_info() and the area_info structure.
get_area_info() still misses some pieces, though.
Added all missing VM user/kernel syscalls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4352 a95241bf-73f2-0310-859d-f6bbb57e9c96
some broken C++ export definitions, added missing licenses etc.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3152 a95241bf-73f2-0310-859d-f6bbb57e9c96
Changed the file_descriptor structure (more status_t, name removed).
Changed "extern inline" to "static inline" in thread.h/arch_thread.h as those
also work with -O0 -g.
Added prototypes for [arch_cpu_]user_strlcpy().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1454 a95241bf-73f2-0310-859d-f6bbb57e9c96