Commit Graph

4231 Commits

Author SHA1 Message Date
Oliver Tappe
7e965f506d More consolidation of timezone code:
* dropped DaylightSavingTime from real_time_clock code in kernel, it was
  never really being used for what it meant (and just being referred to by
  gettimeofday(), which put a different meaning to it
* adjusted the syscalls get_timezone() & set_timezone() as well as their callers 
  accordingly
* got rid of get_rtc_info() and rtc_info struct in kernel, as it was only
  being referred to by the FAT add-on and that one (like gettimeofday()) put a
  different meaning to tz_minuteswest. Added a comment to FAT's util.c
  showing a possible solution, should the hardcoded GMT timezone pose a problem.
* fixed declaration of gettimeofday() to match POSIX base specs, issue 7
* changed implementation of gettimeofday() to not bother trying to fill struct
  timezone - it was using wrong values before, anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 23:02:57 +00:00
Axel Dörfler
dac5d7fe4f * Made sure that at least the common case with a single writer exits write()
once the file descriptor is closed.
* Reinstantiated the FIFO functionality as long there are no writers yet as
  explained by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 19:27:52 +00:00
Oliver Tappe
80ac9aef07 * corrected the copyright header, as that file no longer contains what
the copyright header refers to

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 17:48:48 +00:00
Oliver Tappe
96ac47e312 Made some progress with consolidation of timezone-related code:
* renamed syscalls _kern_[gs]et_tzfilename 
  to _kern_[gs]et_real_time_clock_is_gmt, as the filename part is no longer
  relevant (and the two corresponding parameters were removed)
* C++-ified and reworked clockconfig to use the info from 'Time settings' 
  to setup the timezone info during boot
* removed invocation of _kern_get_tzfilename() from tzset(), as the syscall
  no longer exists and tzset() is currently broken anyway
* adjusted the Time preflet to use the renamed syscall when getting/setting 
  the RTC info


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 17:47:26 +00:00
Oliver Tappe
308ca58d67 * deprecated set_timezone(), as we no longer support (and need) timezone files
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 16:50:28 +00:00
Axel Dörfler
1ffa502964 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37861 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 07:35:42 +00:00
Axel Dörfler
81fcd71e3a * Implemented a different way to notify waiting read()s when a file descriptor
is closed; their ReadRequest will now be notified with B_FILE_ERROR.
* This is a better fix for #5947, though note that I left the changes in
  Inode::ReadDataFromBuffer() in place, as I think this is what POSIX requires.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 06:55:28 +00:00
Axel Dörfler
8e855d520a * Changed some POSIX error codes to native ones.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37842 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 14:17:35 +00:00
Axel Dörfler
29145bab8a * Allow heap.cpp to compile if both, KERNEL_HEAP_LEAK_CHECK, and
USE_SLAB_ALLOCATOR_FOR_MALLOC are defined.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 11:10:51 +00:00
Axel Dörfler
da6c14611b * I see no reason for the fActive check here. Until Ingo enlightens me, this
fixes bug #5947, IOW BePDF should now close fine again :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 09:43:29 +00:00
Axel Dörfler
9061bf7e80 * Improved debug output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 09:41:25 +00:00
Axel Dörfler
61729d9323 * Reworked the complete stack to allow more than one address per network
interface - this caused quite a number of changes.
* Network interfaces, and its addresses are now reference counted (not yet
  complete, though, InterfaceAddresses need to hold references to their
  interface as well).
* There are two known regressions of this commit that I will fix later:
  - you cannot remove interfaces anymore
  - IPv4 multicast was broken anyway, but now it's disabled, too.
* Moved a device_interfaces.cpp|h out of interfaces.cpp.
* The datalink layer chain is now instantiated per domain per interface,
  not just per interface anymore.
* When a buffer reaches the network layer, it has no known interface yet, ie.
  the ipv4|6|whatever modules need to set this manually.
* Added more debug output, and some new debugger commands, the control option
  is now printed in clear text.
* Added hash_address() function to the address modules. Added "const" to
  set_to_defaults() where needed.
* Fixed net_buffer's restore header functions offset use as reported by Atis.
* Improved buffer dump output, use the domain module to print the address if
  available.
* Moved net_buffer::type into the union, as it's not needed by the upper layers
  anymore.
* Moved IPv6 specific code from {add|remove}_default_route() to where it
  belongs, but disabled it for the time being.
* Completely discarded useless ipv4_datagram module.
* Added ping6 to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-28 17:38:23 +00:00
Axel Dörfler
2ebcf777bf * Implemented support for the 'z' qualifier prefix for [s]size_t.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-27 15:39:47 +00:00
Matt Madia
2dc707e529 Utilize HAIKU_DISTRO_COMPATIBILITY for the boot splash. Currently only
'--distro-compatibility official' will result in the HAIKU logo being
displayed. When 'default' or 'compatible', only the icons will display. Due to
issues with generate_boot_screen, the "development" logo is not utilized.

Relates to #6183 and #6255


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-25 20:22:10 +00:00
Oliver Tappe
60656c54d1 * don't use B_USE_POSITIVE_POSIX_ERRORS in libroot, let any interested party
use that and the posix_error_mapper

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37737 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-25 17:20:39 +00:00
Oliver Tappe
ac055d4bf8 Avoid rm switching to interactive mode for any locale other than POSIX:
* reset errno to 0 if it has been set during execution of any ICU method
  (which doesn't set errno itself, but may invoke system functions that do)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37736 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-25 17:10:52 +00:00
Oliver Tappe
bc981208fa * replace use of strcmp with strcasecmp, as locale names are supposed to be
case insensitive

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-25 11:31:56 +00:00
Oliver Tappe
a4823efd7d Fix problems with sed and gcc caused by reintegration of posix-locale:
* support invocation of ctype/wctype macros with EOF/WEOF (-1), which would
  access more or less random memory before - I don't know why this worked
  more or less reliably for the POSIX locale, but it didn't for any other


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-24 16:20:52 +00:00
Oliver Tappe
c0f9765409 * minor cleanup (whitespace and superfluous include)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-24 16:04:43 +00:00
Oliver Tappe
a3f665982e * reintegrated posix-locale
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 23:13:00 +00:00
Oliver Tappe
bca50be432 Second go at fixing what should have been part of r31927:
* uncommented fwscanf() in wchar.h to make it available
* imported wcsftime() from FreeBSD-8 (which just wraps strftime()), so that we 
  not only declare it, but provide an implementation, too
As a result, the next build of gcc4 should be able to detect full support for wchar_t and in turn activate wchar_t-based template types (like std::wstring).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-23 17:34:33 +00:00
Ingo Weinhold
3c0b4af4b4 Remove unused macro.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 20:49:00 +00:00
Ingo Weinhold
e653b86511 Free(), FreeRawOrReturnCache(), GetAllocationInfo(), CacheForAddress(): Check
Assert that the meta chunk the given address lies in is actually in use.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 20:47:12 +00:00
Ingo Weinhold
93a56baf09 Moved the Area structure from the beginning of area to one page inside the
area. The first page is not mapped, so someone writing over the bounds of the
previous area will be axed immediately.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 20:35:41 +00:00
Ingo Weinhold
5cdadcae91 page_writer(): Fixed the pagesSinceLastSuccessfulWrite computation. Only the
skipped pages were added, not the failed ones.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 11:40:18 +00:00
Ingo Weinhold
2ab433ba90 * PageWriteWrapper::Done(): Returns whether the page was successfully written,
now.
* PageWriterRun::Go(): Returns the number of pages that could not be written.
* page_writer()/next_modified_page():
  - Don't use a marker page anymore. A visited page is requeued at the tail.
    This also makes the functions that schedule pages work a bit better (they
    queue the pages at the head of the queue).
  - Have an eye on pages that are busy or failed to write. If we ran through
    the whole modified queue without writing a single page, sleep for a short
    time. This mitigates the busyness the page writer falls into when there
    are enough modified pages to make it run all the time but none that can be
    written successfully.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 11:32:42 +00:00
Ingo Weinhold
4e08fb8589 Added rw_lock_read_lock_with_timeout().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 11:10:48 +00:00
Ingo Weinhold
0a1dabca7e Added public io_request_is_vip(), returning whether the given request has the
VIP flag set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-22 11:08:34 +00:00
Axel Dörfler
1316462ab0 * Added some test code to make sure that we run on the boot CPU on shutdown;
I haven't tested it on the problematic machine yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-20 21:45:48 +00:00
Axel Dörfler
403ad05453 * Fixed warnings that occur with GCC4.4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-19 15:00:17 +00:00
Axel Dörfler
8a5b57ee47 * Enlarged chunk size to 64k - this fixes boot over the network.
* Fixed typos.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-19 12:19:54 +00:00
Axel Dörfler
98e415e567 * Corrected and improved debug output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-19 09:20:29 +00:00
Ingo Weinhold
45849022ce syslog_sender():
* After an unsuccessful find_port() wait a while before trying again.
  find_port() is quite expensive and particularly during the boot process it
  was called quite busily. Essentially a find_port() per written syslog
  message was performed.
* Added TODOs regarding using a semaphore and using find_port().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-18 23:55:39 +00:00
Ingo Weinhold
935c5e8278 Fixed build with TRACE_VFS_REQUEST_IO enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-18 13:25:26 +00:00
Adrien Destugues
7b8dcda464 Add gcc version information to kdl info command. This could help debugging in some cases and fixes #3240.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37562 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-18 12:21:42 +00:00
Ingo Weinhold
54f25b672a Fixed build with TRACE_VM86 enabled. Closes #6325.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37556 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-17 16:17:14 +00:00
Ingo Weinhold
c019945cbd Added detail to the comment about why we can't call the create() hook without
O_EXCL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-17 16:11:56 +00:00
Ingo Weinhold
3aea1d4f53 * Added ObjectCache::alignment, the object alignment and used the alignment for
incrementing the cache color cycle. Using the fixed value (8) would
  potentially misalign the object again.
* Don't use CACHE_ALIGN_ON_SIZE for object caches any longer -- we have the
  alignment parameter anyway (the flag is still used for the MemoryManager,
  though).
* ObjectCache::InitSlab(): Slab coloring *was* done when CACHE_ALIGN_ON_SIZE
  was given, i.e. exactly the wrong way around. Also the cache_color_cycle
  computation was weird -- color 0 was used twice in a row.
* The "slabs" and "slab_cache" KDL commands also print the alignment, now.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-16 01:27:27 +00:00
Ingo Weinhold
44db70a313 * Resolved TODO: Use an object cache for the thread structure alloction.
* Align the allocated objects to 16 byte. This is required by the x86
  arch_thread structure. Haiku only didn't crash and burn since the until
  recently used heap allocator apparently aligned the structures to 16 byte
  anyway and the now used slab allocator has a bug preventing slab coloring
  for that object size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-16 01:13:22 +00:00
Ingo Weinhold
3121f39481 thread_exit(): Postpone deleting the thread's user stack until after sending
the thread's death notifications. The fixes issues where other threads depend
on objects on its stack (particularly relevant for the main thread). Fixes
#6315.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-14 01:20:58 +00:00
Ingo Weinhold
737b989128 Patch by Lucian Adrian Grijincu (slightly modified by myself):
ObjectCache::ReturnObjectToSlab(): Check the returned object pointer for
obvious invalidity (out of bounds or misalignment).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-14 00:48:45 +00:00
Ingo Weinhold
e40e5ebf8c arch_clear_watchpoint(): Passed incorrect flag to clear_breakpoint(), so
watchpoints would never be cleared.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-13 23:56:14 +00:00
Ingo Weinhold
2fd209cf00 page_writer(): Added TODO about potential deadlock in case of loop file
systems/devices.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-13 23:42:31 +00:00
Ingo Weinhold
bb486a7223 cache_end_transaction(): Allow the hook parameter to be NULL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-10 15:09:46 +00:00
Ingo Weinhold
b944766870 * Moved the vm_page initialization from vm_page.cpp:vm_page_init() to the new
vm_page::Init().
* Made vm_page::wired_count private and added accessor methods.
* Added VMCache::fWiredPagesCount (the number of wired pages the cache
  contains) and accessor methods.
* Made more use of vm_page::IsMapped().
* vm_copy_on_write_area(): Added vm_page_reservation* parameter that can be
  used to request a special handling for wired pages. If given the wired pages
  are replaced by copies and the original pages are moved to the upper cache.
* vm_copy_area():
  - We don't need to do any wired ranges handling, if the source area is a
    B_SHARED_AREA, since we don't touch the area's mappings in this case.
  - We no longer wait for wired ranges of the concerned areas to disappear.
    Instead we use the new vm_copy_on_write_area() feature and just let it
    copy the wired pages. This fixes #6288, an issue introduced with the use
    of user mutexes in libroot: When executing multiple concurrent fork()s all
    but the first one would wait on the fork mutex, which (being a user mutex)
    would wire a page that the vm_copy_area() of the first fork() would wait
    for.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-10 15:08:13 +00:00
Ingo Weinhold
61728e1e09 Use MovePage() instead of RemovePage() + InsertPage().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-10 14:39:15 +00:00
Ingo Weinhold
f75e014cb8 Patch by Lucian Adrian Grijincu: Added support for loading kernel modules
with only a single readable/writable/executable text+data segment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-06 21:47:08 +00:00
Ingo Weinhold
4d7859f031 elf_resolve_symbol(): If a weak undefined symbol could not be resolved,
return 0 as its address.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37412 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-06 15:41:33 +00:00
Ingo Weinhold
59c754571e Fixed warnings with TRACE_VM_PAGE enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-06 14:31:34 +00:00
Clemens Zeidler
6df7fdcf03 Fix reading of the irq routing table.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-04 02:59:31 +00:00
Clemens Zeidler
b22ea6300c Disable io apic for now. Fix irq argument for ioapic_configure_io_interrupt.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-04 02:57:40 +00:00
Ingo Weinhold
05951b9b6a * Added optional paranoid checking of the slab memory manager meta chunks
after each chunk allocation/deallocation.
* The commands that dump chunks also verify, whether chunks that look free
  are in the free list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-02 23:33:55 +00:00
Ingo Weinhold
b0eaa06c26 Disable re-attaching the tracing buffer of a previous session. It still has
some problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-02 23:29:59 +00:00
François Revol
2f1e7c8aeb Just leave the stubs here and use other cpu-specific files.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-02 16:35:52 +00:00
François Revol
d6e6e36c04 Fork arch_video.cpp into cpu-specific versions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-02 16:32:50 +00:00
Axel Dörfler
5fe246510a * Building with syscall tracing obviously needs this header now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-01 19:24:25 +00:00
François Revol
dae84707ac Patch by "notzed" (Ticket #5380): Add support for setting video mode for OMAP3.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37321 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-30 17:39:36 +00:00
François Revol
9020ce87e6 Patch by "notzed" (ticket #5368) (modified): Add bootloader support for BeagleBoard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37319 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-30 17:24:11 +00:00
François Revol
46f639a821 Add an (unused yet) cylinder count var on sfdisk. We don't have any mean of calculating it from the desired image size in jam anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37318 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-30 15:52:54 +00:00
François Revol
2eeee81944 Fix (c) years.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37316 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-30 15:46:03 +00:00
François Revol
0a8bfb8353 Cleanup. Use SDRAM_BASE from board_config.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37315 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-30 15:44:07 +00:00
Andreas Färber
7656ad6be1 kernel_ppc: Use saved register state for stack trace of current thread
Suggested by Ingo in ticket #6139. This shortens the stack trace and makes it
independent of whether called implicitly on KDL entry or manually from the
kernel debugger prompt.

For a kernel panic, "panic" is now the top-most frame printed.

Closes ticket #6160.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37282 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-27 21:34:31 +00:00
Andreas Färber
d46ce4d62a kernel_ppc: Save caller's stack pointer in arch_debug_save_registers
Suggested by Ingo in ticket #6139. Code is adapted from x86.
Note that on ppc64 GPR1 needs to be 64-bit, thus the choice of addr_t.

Resolves part of ticket #6160.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-27 20:16:59 +00:00
Andreas Färber
4fa4224a1d OpenFirmware: Assure machine type is initialized
On QEMU's emulation of a PowerPC Old World Mac (g3beige), determine_machine()
returns without setting the machine type to unknown, since the root device
does not provide a device_type property.

Move the variable assignment up a few lines to remedy this.

Closes ticket #6123.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-27 17:56:05 +00:00
Andreas Färber
b62981b983 OpenFirmware: Make of_milliseconds() return error
The only user of of_milliseconds(), the boot loader's system_time(),
checks for an error that would never be signalled since the zero-initialized
number of milliseconds would always be returned.

Return OF_FAILED instead to allow explicit error handling in that case.

While this is a behavioral change, it is not yet a functional change,
for system_time()'s implementation translates OF_FAILED back to zero currently.

Resolves part of ticket #6061.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-27 15:17:59 +00:00
Philippe Saint-Pierre
216cd910b6 Fix small typo in safe mode options menu.
"compatibilty" => "compatibility"


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-27 01:36:47 +00:00
Andreas Färber
04ec719a70 Convert line endings to LF
In r33670 the svn:eol-style property was dropped, which took care of
locally converting the line endings to the user's native style.
While most files use Unix-style LF line endings, some files have
Windows-style CR LF line endings.

Assure that the following r37262 directories use Unix-style line endings:

src/system/boot/
src/system/boot/arch/
src/system/boot/arch/ppc/
src/system/boot/loader/
src/system/boot/loader/net/
src/system/boot/platform/
src/system/boot/platform/openfirmware/
src/system/boot/platform/openfirmware/arch/
src/system/boot/platform/openfirmware/arch/ppc/
src/system/kernel/
src/system/kernel/arch/
src/system/kernel/arch/ppc/
src/system/kernel/platform/
src/system/kernel/platform/openfirmware/
headers/private/kernel/
headers/private/kernel/arch/
headers/private/kernel/arch/ppc/
headers/private/kernel/platform/
headers/private/kernel/platform/openfirmware/
headers/private/kernel/boot/
headers/private/kernel/boot/net/
headers/private/kernel/boot/platform/
headers/private/kernel/boot/platform/openfirmware/

This avoids patches containing irrelevant lines unintentionally converted.

No functional changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-26 17:38:03 +00:00
Ingo Weinhold
45bd7bb3db Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 22:16:10 +00:00
Siarzhuk Zharski
d31f4dd5eb fix for "deprecated conversion from string constant to 'char*'" error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 20:20:59 +00:00
Ingo Weinhold
85db3873a9 find_directory.c, driver_settings.c: Converted to C++.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 13:40:51 +00:00
Ingo Weinhold
5ef3166234 Added missing includes (respectively they would be missing soon).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 13:38:36 +00:00
Axel Dörfler
36c80d7002 * Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37251 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 08:35:02 +00:00
Axel Dörfler
9209acd256 * Renamed the remaining C files to C++ files.
* Fixed some copyrights.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 08:30:17 +00:00
Axel Dörfler
b6add3ffb6 * Renamed remaining .c files to .cpp, and made the necessary changes to let
them compile still.
* Some cleanup in ARM's start2.cpp.
* m68k stuff is still missing, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37249 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 08:03:58 +00:00
Axel Dörfler
2f0e75de7b * Fixed warnings.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-25 08:02:37 +00:00
Ingo Weinhold
b7f5e03101 Fixed build with debug output enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-24 23:20:39 +00:00
Ingo Weinhold
fbcffaefd3 Fixed non-x86 builds. __get_memory_map_haiku() must be the default.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37237 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 18:43:06 +00:00
Ingo Weinhold
2a25d16d33 * get_memory_map(): Changed parameters types to fixed-width types.
* Added BeOS compatibility wrappers for get_memory_map(), map_physical_memory(),
  and create_area().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 16:09:26 +00:00
Ingo Weinhold
ef4fd448b5 vm_create_anonymous_area(): Optimized the B_32_BIT_{FULL_LOCK,CONTIGUOUS}
cases for B_HAIKU_PHYSICAL_BITS > 32 and accessible physical memory < 4 GB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 13:55:44 +00:00
Ingo Weinhold
b46540452a Added vm_page_max_address() which returns the greatest address of accessible
physical memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37230 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 13:52:32 +00:00
Ingo Weinhold
58bdffb967 Disabled tracing and removed a bit of debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 13:37:53 +00:00
Ingo Weinhold
9fb2d73772 Replaced B_32_BIT_MEMORY by B_32_BIT_FULL_LOCK and B_32_BIT_CONTIGUOUS, so
the constraint can be expressed more precisely. ATM B_32_BIT_FULL_LOCK is
implemented as B_32_BIT_CONTIGUOUS when B_HAIKU_PHYSICAL_BITS > 32, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 13:29:25 +00:00
Ingo Weinhold
7b1d69ecbb Added safe mode option B_SAFEMODE_4_GB_MEMORY_LIMIT (plus a boot loader menu
item) and kernel settings option "4gb_memory_limit". Enabling either one
causes the memory beyond 4 GB to be ignored.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 11:13:39 +00:00
Ingo Weinhold
ff9151d11f Added ignore_physical_memory_ranges_beyond_4gb() which removes the memory
beyond 4 GB from the physical memory ranges.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-23 11:10:01 +00:00
Ingo Weinhold
91af25d302 vm_create_anonymous_area():
* Fixed check: If a low *or* high address restriction is given, we need to
  force B_CONTIGUOUS wiring.
* Optimization: Contiguous single-page allocation can be allocated as
  full-lock, if the no low/high address restrictions are given.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 18:22:42 +00:00
Ingo Weinhold
be87d0a03e * Added area creation "lock" constant B_32_BIT_MEMORY for physically
contiguous memory < 4 GB.
* vm_create_anonymous_area(): Implemented support for B_LOMEM and
  B_32_BIT_MEMORY.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37200 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 16:46:19 +00:00
Ingo Weinhold
13638944db Removed never read VMCache::scan_skip.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37195 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 15:10:37 +00:00
Ingo Weinhold
94226016cc Mark caches of null areas temporary, so we don't try to write back modified
pages when deleting the area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37194 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 15:07:32 +00:00
Ingo Weinhold
2a81a99203 Optimized implementations for UnmapPages() and UnmapArea().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 14:43:42 +00:00
Ingo Weinhold
86b6de1fae UnmapPages(): Avoid potential integer overflow.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 14:28:07 +00:00
Ingo Weinhold
8bcc0694ad Simplifications and indentation correction.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37191 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 13:58:05 +00:00
Ingo Weinhold
a19f81b6c7 Unmap(),Protect(): Removed goto programming by a do {} while loop. Also fixed
problem with potential integer overflow at the end of the address space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37190 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 13:57:00 +00:00
Ingo Weinhold
66f9974b06 Use InvalidatePage() instead of playing with the invalidation cache by hand.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 13:41:23 +00:00
Ingo Weinhold
c6f52e8328 Missed in r37187: Use the new VMTranslationMap::[Accessed]PageUnmapped()
helper methods to avoid code duplication.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 13:39:52 +00:00
Ingo Weinhold
0d5ab7a14d Moved duplicate code from the VMTranslationMap subclasses' UnmapPage() and
ClearAccessedAndModified() implementations into helper methods PageUnmapped()
and UnaccessedPageUnmapped() in the base class.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-21 13:32:33 +00:00
Wim van der Meer
2a2b528e73 Report ignored memory pages seperately, thanks to bonefish for the patch review. Closes ticket #6178
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37175 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-19 14:07:26 +00:00
Ingo Weinhold
fa04c15cde object_cache_low_memory(): Reduce the cache pressure indicator even for the
"note" low resource state. Not doing so could result in a very high limit for
the number of empty slabs, which wouldn't change until reaching the "warning"
state.
Fixes #5816.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-18 21:24:34 +00:00
Ingo Weinhold
1cafaecaf5 * Introduced block_cache::unused_block_count, which counts the elements of
block_cache::unused_blocks.
* block_cache::Allocate(): No longer removes unused blocks when in a low
  resource state. That just removed too many blocks too quickly, when the
  cache was actively used for writing, seriously affecting performance.
* block_cache::_LowMemoryHandler(): Compute the number of unused blocks to
  remove depending on the total unused block number. This way we cull huge
  block caches with lots of old blocks much quicker.

Treats part of #5816.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-18 21:17:11 +00:00
Ingo Weinhold
1cdc3cbbe4 The vnode cache also considers the address space low resource state, now.
Together with vnode associated structures like file cache, VMCache, and file
system specific structures the impact on heap usage (and thus address space)
is considerable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37169 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-18 21:05:53 +00:00
Ingo Weinhold
0af5c55487 * Changed the address space note, warning, critical limits to fixed values. The
value for note remains the same, the others are significantly higher, now.
* compute_state(): Log low resource state changes.
* "low_resource" command: Also print the current resource values.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-18 21:01:27 +00:00
Ingo Weinhold
c955359cb6 Added vm_available_not_needed_memory_debug(), a
vm_available_not_needed_memory() version that can be called from within the
kernel debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37167 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-18 20:57:05 +00:00
Axel Dörfler
cdb638a8ee * Seems like someone wasn't quite awake when doing these changes; the kernel
now compiles again with tracing turned on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37162 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-17 07:24:19 +00:00
Ingo Weinhold
ce97aa1274 DMAResource::Init(): Also evaluate the device node's B_DMA_LOW_ADDRESS and
B_DMA_HIGH_ADDRESS attributes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37143 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-15 00:09:51 +00:00
Ingo Weinhold
9f134a3a2e * compute_state(): Fixed computation of the low resource state for the address
space (missing elses). The state would never get higher than "note". There
  still seems to be an issue (probably vm_kernel_address_space_left() not
  returning the correct value), since even at 2021 MB (as reported by "aspaces")
  the state is still only "note", while the heap grower is not able to allocate
  heap areas anymore.
* "low_resource" command: The address space flag was not printed for hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37140 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-15 00:06:19 +00:00
Ingo Weinhold
0d46b36584 VMAddressSpace::_DumpListCommand(): Sum up also null-cache areas. Those are
used e.g. by the slab allocator. The interesting part is the address space
usage anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37139 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-14 23:59:38 +00:00
Ingo Weinhold
377ecfe797 * Renamed cache_type_to_string() to vm_cache_type_to_string() and made in
kernel private.
* Moved dumping code from dump_cache() to new VMCache::Dump().
* Override VMCache::Dump() in VMVnodeCache to also print the vnode.
* Removed no longer needed VMCache::GetLock().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-14 23:57:00 +00:00
Ingo Weinhold
14a322f332 IORequest::_Copy*(): Resolved TODO: Don't cast the generic_addr_t to void*
anymore as that truncates physical addresses when PAE is enabled.
Now, if a 4 GB physical address limit is forced in DMAResource, the system
continues to work fine when the physical memory > 4 GB is used. Otherwise it
hangs or crashes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-14 21:33:11 +00:00
Ingo Weinhold
a8ad734f1c * Introduced structures {virtual,physical}_address_restrictions, which specify
restrictions for virtual/physical addresses.
* vm_page_allocate_page_run():
  - Fixed conversion of base/limit to array indexes. sPhysicalPageOffset was not
    taken into account.
  - Takes a physical_address_restrictions instead of base/limit and also
    supports alignment and boundary restrictions, now.
* map_backing_store(), VM[User,Kernel]AddressSpace::InsertArea()/
  ReserveAddressRange() take a virtual_address_restrictions parameter, now. They
  also support an alignment independent from the range size.
* create_area_etc(), vm_create_anonymous_area(): Take
  {virtual,physical}_address_restrictions parameters, now.
* Removed no longer needed B_PHYSICAL_BASE_ADDRESS.
* DMAResources:
  - Fixed potential overflows of uint32 when initializing from device node
    attributes.
  - Fixed bounce buffer creation TODOs: By using create_area_etc() with the
    new restrictions parameters we can directly support physical high address,
    boundary, and alignment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-14 16:25:14 +00:00
Ingo Weinhold
8d2572165b X86PagingMethodPAE::PutPageTableEntryInTable(): Incorrectly used 32 bit type,
which caused the upper 32 bit of the address to be ignored, thus mapping to
the wrong page.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-13 19:58:43 +00:00
Ingo Weinhold
9e93cc9ab7 X86PagingMethodPAE::MemoryTypeToPageTableEntryFlags(): Return value must be
uint64, since that's the width of the page table entry. Was harmless, though,
since the flags are in the lower 32 bits anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-13 19:56:04 +00:00
Ingo Weinhold
96732e8650 X86VMTranslationMap{32bit,PAE}::UnmapPage(): Added some helpful output to
asserts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-13 19:54:13 +00:00
Ingo Weinhold
8a8043dce6 vm_page_get_stats(): Forgot to added sIgnoredPages to system_info::max_pages
in r37117 as well, which was really the main point of introducing it.
Improves #6124 (reported memory lower than installed).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-13 18:59:11 +00:00
Axel Dörfler
05b7510980 * Applied patch by Andreas to use RECEIVE_BUFFER_SIZE where it should be used.
* This closes ticket #6165.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-13 16:17:23 +00:00
Ingo Weinhold
03732070d7 * vm_page_init_num_pages(): Sum up the number of pages between the usable
physical memory ranges.
* vm_page_num_pages(), vm_page_get_stats(): Report the actually existing
  memory, count memory ignored by the boot loader as used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 16:04:49 +00:00
Ingo Weinhold
84e9db7fb7 x86 mmu_init(): Sum up the physical memory we ignore for whatever reason --
stored in kernel_args::ignored_physical_memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 15:57:21 +00:00
Ingo Weinhold
61d2b06c40 Use PAE only when there's memory beyond the 4G limit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 15:11:53 +00:00
Travis Geiselbrecht
9623c48284 SMP: remove the tracking of apic id -> cpu id. Don't pass between bootloader and kernel.
Kernel doesn't use it, and it could be regenerated in the kernel if it did need it.

This also unlocks the apic range the bios can use. Previously the apic ids would have
to fit within 0..MAX_CPUS or it'd reject the cpu. Some boxes (mine in particular)
seem to sparsely populate the apic id so that the range is pretty large.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 01:01:54 +00:00
Ingo Weinhold
977ffe5233 No longer ignore the physical memory beyond 4 GB, if we have a 64 bit
phys_addr_t. IOW, if PAE is enabled, that memory should be put to use now.
Apparently we report an incorrect amount of total memory (also counting
memory gaps), which also suggests that we need another method to manage the
vm_page structures (currently a huge array with indexes proportional to
physical page addresses, i.e. wasting memory for the gaps).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37107 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 00:36:44 +00:00
Ingo Weinhold
4d2b2dc4d2 Enable PAE on all CPUs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 00:13:54 +00:00
Ingo Weinhold
bd4454cb95 * Simplified smp_trap_non_boot_cpus() and smp_wake_up_non_boot_cpus(): We don't
need a spinlock per CPU; a single variable suffices.
* Extended call_all_cpus[_sync]() to work before smp_wake_up_non_boot_cpus()
  (even before smp_init()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-12 00:13:30 +00:00
Ingo Weinhold
4bdc89aa14 * Implemented X86PagingMethodPAE::PhysicalPageSlotPool::AllocatePool().
* Implemented X86PagingMethodPAE::IsKernelPageAccessible().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-11 23:23:44 +00:00
Ingo Weinhold
83c3e7d3ba Added kPAEPageDirRange constant.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-11 23:21:02 +00:00
Ingo Weinhold
68b53104ba * Implemented X86VMTranslationMapPAE and X86PagingStructuresPAE destruction.
* Implemented X86VMTranslationMapPAE::QueryInterrupt().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-11 16:21:13 +00:00
Ingo Weinhold
b35f3d132c X86VMTranslationMapPAE::Init(): Implemented the initialization for userland
maps. Now we can at least fully boot in qemu with one CPU. A few things
still need to be implemented, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-10 17:45:38 +00:00
Ingo Weinhold
5d89694992 Added methods {Allocate,Free}32BitPage(), which allocate+map/unmap+free a
page with a 32 bit physical address (needed for the PDPTs). A small set of
free pages is cached, so the rather expensive vm_page_allocate_page_run() can
be avoided most of the time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37088 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-10 17:38:47 +00:00
Ingo Weinhold
1d26c7248f vm_page_allocate_page_run(): Added parameter "limit", specifying the upper
physical address limit for the page run to allocate.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37086 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-10 17:30:49 +00:00
Ingo Weinhold
0c4c918a3d Fleshed out most of the unimplemented methods. The kernel boots up to the
creation of the initial shell, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37085 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-10 13:25:36 +00:00
Ingo Weinhold
1c01dd3be0 Added InvalidatePage() which adds a new address to the invalidation cache.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-10 13:22:44 +00:00
Ingo Weinhold
5d6d1935d6 Implemented X86PagingMethodPAE::Init() and all of its direct dependencies:
* The 32 bit paging structures inherited from the boot loader are translated
  to PAE structures and PAE is enabled.
* Implemented the initialization of the initial PhysicalPageSlotPool, so that
  the physical page mapper can be initialized.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-09 21:31:00 +00:00
Ingo Weinhold
38bde24102 Added some definitions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-09 21:23:45 +00:00
Ingo Weinhold
e5885c7d0c Moved kPageTableAlignment to paging.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-09 21:22:23 +00:00
Ingo Weinhold
641b3c82df Renamed allocate_early_physical_page() to vm_allocate_early_physical_page()
and made it public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-09 21:21:18 +00:00
Ingo Weinhold
2ea7b17cf3 * vm_allocate_early(): Replace "bool blockAlign" parameter by a more flexible
"addr_t aligmnent".
* X86PagingMethod32Bit::PhysicalPageSlotPool::InitInitial(),
  generic_vm_physical_page_mapper_init(): Use vm_allocate_early()'s alignment
  feature instead of aligning by hand.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37070 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-09 11:15:43 +00:00
Ingo Weinhold
c8a1d3ad1e Added PAE bits and type definitions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 22:12:20 +00:00
Ingo Weinhold
a410098f28 Only use PAE, if supported by the CPU.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 21:43:19 +00:00
Ingo Weinhold
12f0b50c3a Removed not needed and no longer existing header. Fixes the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 21:21:55 +00:00
Ingo Weinhold
5b4d62a261 Skeleton classes for PAE support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 21:15:29 +00:00
Ingo Weinhold
1c7fda897e * Moved X86VMTranslationMap32Bit to its own source file.
* Made all helper function operating on paging structures static methods of
  X86PagingMethod32Bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 20:35:53 +00:00
Ingo Weinhold
2434bdc4d9 * Introduced global variable gX86PagingMethod, so the paging method can be
accessed from anywhere. Added static X86PagingMethod32Bit::Method()
  returning it as the subtype pointer -- to be used in the code related to
  that method only, of course.
* Made a bunch of static variables non-static members of
  X86PagingMethod32Bit and added accessors for them. This makes them
  accessible in other source files (allowing for more refactoring) and saves
  memory, when we actually have another paging method implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37062 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 16:18:57 +00:00
Ingo Weinhold
f0675bf757 Moved X86PagingStructures32Bit into its own source/header pair.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 15:39:47 +00:00
Ingo Weinhold
1b3e83adde Moved paging related files to new subdirectories paging and paging/32bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 15:00:56 +00:00
Ingo Weinhold
5aa0503c7c * Removed i386_translation_map_get_pgdir() and adjusted the one place where it
was used.
* Renamed X86VMTranslationMap to X86VMTranslationMap32Bit and pulled the paging
  method agnostic part into new base class X86VMTranslationMap.
* Moved X86PagingStructures into its own header/source pair.
* Moved pgdir_virt from X86PagingStructures to X86PagingStructures32Bit where
  it is actually used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-08 00:20:34 +00:00
Ingo Weinhold
b0d49fc06b Made X86PhysicalPageMapper and the large memory implementation paging method
agnostic:
* Changed return value of X86PhysicalPageMapper::[Interrupt]GetPageTableAt()
  from page_table_entry* to void*.
* Made PhysicalPageSlotPool an abstract base class. The paging method provides
  an implementation and creates the pools now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37054 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-07 23:11:01 +00:00
Ingo Weinhold
c6caf520ca * Added a level of indirection for the arch_vm_translation_map functions.
Introduced the interface X86PagingMethod which is used by those. ATM
  there's one implementing class, X86PagingMethod32Bit.
* Made X86PagingStructures a base class, with one derived class,
  X86PagingStructures32Bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-07 20:36:33 +00:00
Ingo Weinhold
e845f05e28 Patch by Andreas Faerber: stack_trace(): Skip stack_trace() itself in the
stack trace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-06 13:05:47 +00:00
Ingo Weinhold
48f2523d15 Patch by Andreas Faerber: Implemented arch_debug_get_caller().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37032 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-06 13:03:17 +00:00
Ingo Weinhold
0d319095f4 UnmapPages(), UnmapArea(): Fixed incorrect check. All actually mapped pages
would be skipped. Concerned non-x86 only, as for x86 the methods are
overridden.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-06 12:42:01 +00:00
Ingo Weinhold
0618516355 Debug output of map_backing_store(), vm_map_physical_memory[_vecs](): Print
the potential input parameter (virtual address) rather than its address. As
suggested by Andreas Faerber in #6141.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-06 11:28:33 +00:00
Ingo Weinhold
1ba89e67ed Removed no-op VMTranslationMap::InitPostSem() and
VMAddressSpace::InitPostSem().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 22:20:34 +00:00
Ingo Weinhold
c3e021e862 x86:
* Renamed i386_context_switch() to x86_context_switch().
* x86_context_switch() no longer sets the page directory.
  arch_thread_context_switch() does that explicitly, now. This allows to solve
  the TODO by reordering releasing the previous paging structures reference and
  setting the new page directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37024 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 22:09:24 +00:00
Ingo Weinhold
fabdf00e6a Renamed i386_swap_pgdir() to x86_swap_pgdir.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 21:53:32 +00:00
Ingo Weinhold
8421714089 x86:
* Renamed vm_translation_map_arch_info to X86PagingStructures, and all
  members and local variables of that type accordingly.
* arch_thread_context_switch(): Added TODO: The still active paging structures
  can indeed be deleted before we stop using them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37022 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 21:51:05 +00:00
Ingo Weinhold
3329d8c055 Patch by Andreas Faerber: Implemented arch_debug_call_with_fault_handler().
That makes the automatic stack traces in case of kernel panics work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 18:36:44 +00:00
Ingo Weinhold
538a374b8a Patch by Andreas Faerber: Added support for
cpu_ent::fault_handler[_stack_pointer].


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37020 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 18:34:37 +00:00
Ingo Weinhold
193a433af0 Patch by Andreas Faerber: Generate an assembler compatible header with
structure offset definitions for PPC as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37019 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-05 18:32:44 +00:00
Ingo Weinhold
521aff921f Moved the page mapper and the page invalidation cache from
vm_translation_map_arch_info to X86VMTranslationMap where they actually
belong.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-04 22:53:17 +00:00
Ingo Weinhold
78dde7abd7 Consequently use uint32 for the physical page directory address.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-04 22:23:22 +00:00
Ingo Weinhold
2e04c067f9 Patch by Andreas Faerber:
vm_free_unused_boot_loader_range(): Don't free any memory beyond the given
range.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-04 22:04:20 +00:00
Axel Dörfler
db3aa13aaf * Patch by Andreas Färber that removes unneeded includes, mostly ones that don't
even have to be available in the generic case. See bug #6105, patch 1 & 2.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-04 08:03:02 +00:00
Ingo Weinhold
23aa437d66 Fixed nasty cast that breaks with sizeof(phys_addr_t) == 64.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-02 21:22:04 +00:00
Ingo Weinhold
1d578e15fe Fixed more address types related issues. Mostly printf() or comparison
warnings, but also some oversights from earlier changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-02 20:46:49 +00:00
Ingo Weinhold
8c9b84a588 Replaced the swap_addr_t and SWAP_SLOT_NONE in RadixBitmap.{h,cpp} by
radix_slot_t and RADIX_SLOT_NONE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-02 20:42:53 +00:00
Ingo Weinhold
435c43f591 * Introduced type generic_io_vec, which is similar to iovec, but uses types
that are wide enough for both virtual and physical addresses.
* DMABuffer, IORequest, IOScheduler,... and code using them: Use
  generic_io_vec and generic_{addr,size}_t where necessary.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-02 18:42:20 +00:00
Axel Dörfler
03768a4052 * Introduced IOScheduler::MediaChanged() - this is now called by scsi_cd instead
of having the logic be triggered by IOScheduler::SetDeviceCapacity(), as that
  one might actually be called more often (for each call to update_capacity(),
  ie. each B_GET_GEOMETRY/B_GET_DEVICE_SIZE will trigger it), and there is no
  reason to throw away the cache every time (will make a difference during
  partition/file system detection).
* In cd_init_device() just call update_capacity() instead of duplicating its
  code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-01 12:05:24 +00:00
Ingo Weinhold
64d79eff72 * Changed physical_entry::{address,size} to phys_{addr,size}_t and changed
map_physical_memory()'s physicalAddress parameter type from void* to
  phys_addr_t. This breaks source compatibility, but -- as long as
  phys_{addr,size}_t remain 32 bit wide -- keeps binary compatibility with
  BeOS.
* Adjusted all code using the affected interfaces (Oh what fun!). Added a few
  TODOs in places where the wrong types (e.g. void* for physical addresses
  are used). Looks like quite a few drivers aren't 64 bit safe and others
  will break with PAE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-27 22:07:27 +00:00
Jérôme Duval
533119eab0 Patch from Joseph Prostko to fix the build with GCC 4.4 (ticket #4204).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-27 19:58:28 +00:00
Ingo Weinhold
e5846dfa61 Added shared sort_[physical_]address_ranges() to avoid code duplication. Also
fixes the m68k build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-27 17:08:47 +00:00
Ingo Weinhold
d73ddac5bf * Introduced phys_addr_range type, an equivalent to addr_range for physical
address ranges, and a set of support functions working with it.
* Changed the type of the kernel_args physical address range arrays to
  phys_addr_range and adjusted the code working with those.
* Removed a bunch of duplicated address range code in the PPC's mmu.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36947 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-27 11:50:40 +00:00
Ingo Weinhold
147133b76c * First run through the kernel's private parts to use phys_{addr,size}_t
where appropriate.
* Typedef'ed page_num_t to phys_addr_t and used it in more places in
  vm_page.{h,cpp}.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-25 21:34:08 +00:00
Ingo Weinhold
9d570af7c8 Changed the type of the "op" parameter of the fs_vnode_ops::ioctl() hook and
the _kern_ioctl() syscall from ulong to uint32.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 21:04:22 +00:00
Ingo Weinhold
3a5655a502 * Reverted r34863.
* Don't keep any memory mappings from the OF for the time being. We can't
  keep mappings < 2 GB, since those aren't in the kernel address space and
  we don't handle memory mapped registers or the like correctly either.
Ticket #5193.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-21 15:33:28 +00:00
Ingo Weinhold
f51bcfb25b Added a heap_init_post_area() which is called right after areas can be
created, and moved the heap's grow and VIP heap initialization to it. Should
fix #5956.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-18 15:51:27 +00:00
Travis Geiselbrecht
53d7472637 BOOT SMP: allow systems with a large number of cpus and/or sparse apic ids to actually boot
The old mechanism to route an apic id back to a cpu id is faulty, built with the assumption that
the bios will 'pack' the apic ids from 0-num_cpus. In systems that dont do that, the code would
randomly corrupt the bootloader. Fatal in this case.

This quick fix simply rejects all apic ids >= MAX_CPUS (8). No way it would have worked before
if you had a box that started with >= 8 or anything, so it shouldn't regress any existing system.

Better solution is to allow any apic id to exist (0-255).

On this particular box the ids (from lunix dmesg):
SRAT: PXM 0 -> APIC 0 -> Node 0
SRAT: PXM 1 -> APIC 16 -> Node 1
SRAT: PXM 0 -> APIC 2 -> Node 0
SRAT: PXM 0 -> APIC 4 -> Node 0
SRAT: PXM 0 -> APIC 6 -> Node 0
SRAT: PXM 1 -> APIC 18 -> Node 1
SRAT: PXM 1 -> APIC 20 -> Node 1
SRAT: PXM 1 -> APIC 22 -> Node 1
SRAT: PXM 0 -> APIC 1 -> Node 0
SRAT: PXM 0 -> APIC 3 -> Node 0
SRAT: PXM 0 -> APIC 5 -> Node 0
SRAT: PXM 0 -> APIC 7 -> Node 0
SRAT: PXM 1 -> APIC 17 -> Node 1
SRAT: PXM 1 -> APIC 19 -> Node 1
SRAT: PXM 1 -> APIC 21 -> Node 1
SRAT: PXM 1 -> APIC 23 -> Node 1



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-17 03:47:24 +00:00
Axel Dörfler
ae26daa623 * The '-' modifier was ignored for anything but relative seconds. Now, months,
days, and years are supported as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-15 14:32:45 +00:00
Ingo Weinhold
8ccc58ffa9 Missing line breaks in dprintf().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-10 17:26:50 +00:00
Ingo Weinhold
07e1164e59 syslog_init(): Bail out, if kernel_args::debug_output is NULL. Would crash on
platforms that are ignorant of the debug syslog feature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-08 17:02:02 +00:00
Ingo Weinhold
13fa4c845a * Introduced new area creation flag CREATE_AREA_DONT_COMMIT_MEMORY.
map_backing_store() doesn't commit memory when this flag is given.
* Used the new flag vm_copy_area(): We no longer commit memory for read-only
  areas. This prevents read-only mapped files from suddenly requiring memory
  after fork(). Might improve the situation on machines with very little RAM
  a bit.
  We should probably mark writable copies over-committing, since the usual
  case is fork() + exec() where the child normally doesn't need more than a
  few pages until calling exec(). That would significantly reduce the memory
  requirement for jamming the Haiku tree.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36651 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-06 14:59:14 +00:00
Ingo Weinhold
83bc49d051 vm_page_requeue(): Disabled DEBUG_PAGE_ACCESS_CHECK(). Since r36155
idle_scan_active_pages() cannot satisfy this assertion anymore. Added TODO
for a better fix which can wait until after the release.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-06 13:42:24 +00:00
Ingo Weinhold
7b926f5135 Allocate memory for the DEBUG_CACHE_LIST debug feature only when there's
plenty available.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36634 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 21:18:46 +00:00
Ingo Weinhold
3735d4e299 mark_page_range_in_use(): When the given range lies partially outside the
array at least work with the part intersecting with the array. Log those
quasi error cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 21:17:28 +00:00
Ingo Weinhold
8588e7fc6f Fixed broken mmu_allocate_physical():
* Now it checks whether the given physical range exists at all.
* Not only check whether any range of the given size is free, but also check
  whether the given range is free.
* B_BAD_VALUE is not a particularly good return value for a function supposed
  to return a bool

Fixes #5911. With only 64 MB RAM the usual debug syslog buffer location may
be outside the actually existing physical memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 21:15:33 +00:00
Ingo Weinhold
863c623f9a Added is_address_range_covered(), returning whether the given address range
is fully covered by the ranges in the array.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 21:09:11 +00:00
Axel Dörfler
18654db620 * Fixed minor style issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 14:37:35 +00:00
Axel Dörfler
cd7a139273 * boot_item_init() must come before debug_init_post_vm() or else neither the
boot screen cannot be updated, nor might VESA work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 14:36:03 +00:00
Axel Dörfler
7198f76564 * During early kernel startup, we must not create areas without the
CREATE_AREA_DONT_WAIT flag; waiting at this point is not allowed.
* I hope I found all occurences, but there might be some areas left (note,
  only those that don't use B_ALREADY_WIRED are problematic).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 13:12:07 +00:00
Axel Dörfler
8c8fcd770a * Moved the addition of the basic debugger commands directly after the VM init.
* Separated the other stuff previously done in debug_init_post_vm() to the new
  debug_init_post_settings().
* Removed superfluous status_t return codes - they are ignored, anyway, and if
  there really is a show stopper in the init process, panicking would be the
  thing one should do.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 10:05:25 +00:00
Axel Dörfler
55d903d249 * Fixed typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-05 10:03:32 +00:00
Ingo Weinhold
c4697c01a9 Patch by Andreas Faerber: Implemented fallbacks (e801 and 88) to get the
memory map in case e820 is not supported by the BIOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-03 13:15:18 +00:00
Ingo Weinhold
38d2fc985c IORequest::NotifyFinished(): Assert that the request hasn't been finished
before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-03 12:44:48 +00:00
Ingo Weinhold
fa0c1e96a0 Hopefully the last work on the MTRR code for the time being:
Since we also force uncacheability via the PTEs, it is no longer necessary to
use MTRRs for uncacheable ranges. It is recommended, which is why we still do
it, if possible, but when we run out of MTRRs, the algorithm ignores
uncacheable ranges now -- iteratively it increases the minimum size of ranges
to drop until the available MTRRs suffice.
Should fix #5703 and #5865.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 23:05:38 +00:00
Ingo Weinhold
6f2772b135 vm_map_physical_memory(): When alreadyWired we have to explicitly set the
memory type for the mapped pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 22:52:25 +00:00
Ingo Weinhold
001a0e0987 memory_type_to_pte_flags(): Also set the write-through flag for uncacheable
memory. This avoids implementation defined behavior on Pentium Pro/II when
intersecting with an write-combining or write-protected MTRR range.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 22:50:30 +00:00
Ingo Weinhold
f23be5bbed Support memory types in page mappings to the degree that is possible without
PAT support (i.e. uncacheable, write-through, and write-back). Has pretty
much no effect ATM, as the MTRRs restrict the types to what is actually
requested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 15:30:52 +00:00
Ingo Weinhold
bfb3b117eb mmu_init(): In case we couldn't get a memory map from the BIOS the fixed
memory setup was 1 MiB larger than advertised.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 12:56:40 +00:00
Ingo Weinhold
e33adea4dc Fixed PPC build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 12:53:47 +00:00
Stefano Ceccherini
c65e6981d2 rest of the patch by Kaliber in ticket #5875.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36578 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-02 10:34:57 +00:00
Ingo Weinhold
c1be1e0761 * VMTranslationMap::Map()/Protect(): Added "memoryType" parameter. Not
implemented for any architecture yet.
* vm_set_area_memory_type(): Call VMTranslationMap::ProtectArea() to change the
  memory type for the already mapped pages.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-01 21:33:12 +00:00
Ingo Weinhold
3b0c1b5227 * VMArea: Made memory_type private and added setter and getter methods.
* Don't set the VMArea's memory type in arch_vm_set_memory_type(), but let the
  callers do that.
* vm_set_area_memory_type(): Does nothing, if the memory type doesn't change.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-01 20:41:57 +00:00
Ingo Weinhold
907886143f * Changed some parameters of VM syscalls from int to uint32, mostly for sake
of consistency.
* Moved the B_OVERCOMMITTING_AREA flag from B_KERNEL_AREA_FLAGS to
  B_USER_AREA_FLAGS, since we really allow it to be passed from userland.
* Most VM syscalls check the provided protection against B_USER_AREA_FLAGS
  instead of B_USER_PROTECTION, now. This way they allow for
  B_OVERCOMMITTING_AREA as well.
* _user_map_file(), _user_set_memory_protection(): Check the protection like
  the other syscalls do and use fix_protection() instead of doing that
  manually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-01 19:47:39 +00:00
Ingo Weinhold
a5de454f45 VM{Kernel,User}Area::Create(): On error free the area's memory heeding the
given allocation flags. Could deadlock otherwise.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-01 18:50:21 +00:00