Commit Graph

4599 Commits

Author SHA1 Message Date
François Revol
d1460ff57b ARM: Rename flash and mmc base generic targets
They are not so much arm-specific, really.
We now have haiku-flash-*image variations,
and haiku-mmc-image.
2011-11-21 01:30:02 +01:00
François Revol
1d6f7e86ee ARM: Use proper Jamfiles for u-boot/arch/ subdirs 2011-11-21 01:22:32 +01:00
François Revol
e3591817b3 ARM: move kernel calling code to arch specific file
* needs some more cleanup.
* had to change gUBootOS to 32bit to avoid a linker bug.
2011-11-21 01:22:32 +01:00
Michael Lotz
8a5fb91c07 Stricter tests for PCI bridges at interrupt routing.
Validate the candidate child device a bit more by checking the device ID
and the base and subclass of the device. We don't even know if the child
is still on the PCI bus and some firmware may mark disabled devices by
simply invalidating one of these values. Possibly fixes #8111.

Added TODO concerning that we might not want to fail at all since we
ensure that we matched all devices after routing preparation at which
state we would notice any missing child devices anyway.
2011-11-18 13:03:46 +01:00
Michael Lotz
35632c56af Fix harmless oversight marking pages with the wrong state.
While the log of hrev35726 says that unusable page ranges are supposed
to be marked with PAGE_STATE_UNUSED and allocated ones with
PAGE_STATE_WIRED, both actually marked with PAGE_STATE_UNUSED.
2011-11-16 11:06:46 +01:00
Michael Lotz
4200073542 Tiny optimization by skipping a no-op iteration.
We initialize the physicalPagesEnd from physical_memory_range[0] so
re-evaluating that range is a no-op.
2011-11-16 10:56:16 +01:00
Michael Lotz
3dbd9c1148 Fix the LIMIT_AVAILABLE_MEMORY debug option.
When limiting the available memory by reducing the page count it may not
be enough to just limit sNumPages. Depending on the physical memory map
non existing pages between ranges (sNonExistingPages) would still be
added up and later subtracted from the sNumPages, resulting in a wrong
max page count. Also due to the fixed removal of non existing page
ranges the actually available memory would usually not be the amount
set via LIMIT_AVAILABLE_MEMORY.

Instead we now calculate the available memory when going through the
physical memory ranges and limit/exit as soon as we've reached the
desired amount of available memory (also ignoring further non-existing
pages).
2011-11-16 10:40:56 +01:00
Michael Lotz
c12f51264b Ensure the sanity of the stats returned, make the TODO a Note.
* Ensure that we don't underflow the used_pages count and that used
  + cached pages don't overflow max_pages. As there is no locking the
  values may change while we read them so that such situations could
  arise.
* Make the TODO about the missing locking into a Note explaining the
  above, as it is not really worth adding locking here. The stats are
  only informational.
2011-11-14 19:07:37 +01:00
François Revol
478dc9887e PPC: Preliminary untested boot support for Common Firmware Environment
CFE is used in the upcoming Amiga X-1000 dualcore PPC board.
* Largely inspired by the OF and U-Boot code.
* Still largely stubbed out.
* The loader builds but I don't have a machine to test it. Anyone interested?
2011-11-14 01:31:50 +01:00
Michael Lotz
5247333d36 Don't do the heap size calculation when using the slab as heap.
The initial heap size calculation only applies to the legacy/debug
heap, so it isn't needed when using the slab as kernel heap.
2011-11-13 22:20:24 +01:00
Michael Lotz
a28bab4790 Add the object pointers to the panic messages. 2011-11-13 22:18:29 +01:00
Michael Lotz
3733c51d38 Fix the computation of used memory and add a TODO.
* The altered used pages calculation of hrev43168 wasn't correct, as
  the inactive page queue may (validly) contain mapped pages as well.
  Those would then get counted twice (as they are included in
  gMappedPagesCount already).
  Instead we calculate the used pages from the total page count, minus
  everything we account for otherwise. Doing it this way is possible
  without introducing any additional counters, as all the counts to
  subtract are already present (as opposed to some of the ones that
  would be needed for adding the counts up). Fixes #8109.
* Added TODO regarding the problem of not locking any of the counters
  which runs the risk of them getting modified while we haven't yet read
  all of them.
2011-11-13 22:02:36 +01:00
François Revol
9638d7f4aa ARM: Use the serial port as console for now, as VT100.
* Subclass ConsoleNode as VTConsole
* use it to implement SerialConsole
* Use it as the default console for now to simplify debugging.
VTConsole could probably be factored out into boot/platform/generic/ someday.
2011-11-12 23:58:56 +01:00
François Revol
9e5b2c347a Fix typo. 2011-11-12 17:35:02 +01:00
Ingo Weinhold
ee87d51d97 Build fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-07 20:03:57 +00:00
Michael Lotz
a5c94bedb6 * Verify the MP config table signature and add some more sanity checks.
* Also reset the local and IO APIC base physical addresses when configuration
  failed.

Should fix #8102, but is otherwise untested for lack of old enough hardware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-07 19:23:33 +00:00
Ingo Weinhold
fae2ce1945 Enlarge threads and ports KMessage notification stack buffers
They were too small for all the fields added. This is why the system
profiler skipped "thread added" notifications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43216 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-07 19:22:02 +00:00
Ingo Weinhold
40287cba78 Add opt-in panic for KMessage buffer overflow
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-07 19:19:34 +00:00
Ingo Weinhold
65d7b9312b x86: Also set iframe::orig_{eax,edx} in TRAP_ERRC(). This makes
get_iframe_registers() in arch_user_debugger.cpp return the correct
eax/edx values also when the kernel was entered via an exception that
doesn't push an error code (e.g. page fault).
Fixes incorrect eax and edx values shown in Debugger and variable values
based on them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-06 12:53:20 +00:00
Michael Lotz
90c6930ebb Add VM page allocation tracking similar to what happens in the slab already.
Introduces "page_allocation_infos" and "page_allocations_per_caller" KDL
commands.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43190 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 18:07:07 +00:00
Michael Lotz
905c75a595 Tiny pointer style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 18:04:22 +00:00
Michael Lotz
75088a863b Move AllocationTrackingInfo into a header. This way it can be re-used outside
of the slab code. It is generic as it only contains the link to a tracing entry
and not any application specific info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 18:03:34 +00:00
Michael Lotz
6d41dfd95c Move some of the trace entries around so that we know the page(s) they concern
and add that info to the trace entries.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 18:01:15 +00:00
Michael Lotz
865a0be1c0 Add optional stack traces to {Allocate|Free}Page[Run] tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43185 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 17:58:50 +00:00
Michael Lotz
448d8d6fcb Indent cleanup only, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 17:57:42 +00:00
François Revol
9b74cc6637 Further reduced the region allocated for the uncompressed data to 8 MB.
Wastes a bit less time allocating pages for nothing, and makes debugging
mmu support less verbose as well.
The (gunzipped) tar file is still less than 4MB and will never be 8MB
realistically anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 17:54:31 +00:00
François Revol
e5081da48c Large cleanup of the bootloader shell code. Replaced the x86 comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-04 17:22:01 +00:00
Rene Gollent
58ce0a2c12 When calculating the number of used pages for a get_system_info() request,
also include inactive pages. Fixes #7714.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-03 20:51:17 +00:00
François Revol
a4b79a647b Allow up to 2MB for the kernel, since it's already over 1MB.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-03 02:48:33 +00:00
François Revol
983b0dfa95 Fix building libroot on m68k.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43148 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-03 02:41:14 +00:00
François Revol
b29bbc9a80 Fix the bootloader build for m68k.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-03 01:09:49 +00:00
Ingo Weinhold
951c43ff21 Allocate VMKernelAddressRange and VMKernelArea in their own object
caches to reduce slab area fragmentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 22:04:37 +00:00
Ingo Weinhold
f8154d172d mmlr (distracted) + bonefish:
* Turn VMCache::consumers C list into a DoublyLinkedList.
* Use object caches for the different VMCache types and the VMCacheRefs.
  The purpose is to reduce slab area fragmentation.
* Requires the introduction of a pure virtual VMCache::DeleteObject()
  method, implemented in the derived classes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 21:14:11 +00:00
Ingo Weinhold
b0ee1941f3 Revert change that did accidentally sneak into the style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43124 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 19:12:46 +00:00
Ingo Weinhold
ab3d6a3eaf Style cleanup. No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 19:09:48 +00:00
Michael Lotz
3d1f420b23 bonefish+mmlr:
* Add "allocation_infos" KDL command. Can be used to print the allocation info,
  including the stack trace, given an object cache, slab, allocation within a
  slab or allocation address. It can also optionally be filtered by team/thread.
* Fix the AllocationDetailPrinterCallback to not access a possibly invalid
  trace entry for printing a stack trace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 16:12:48 +00:00
Michael Lotz
81fea74394 bonefish+mmlr:
Add MemoryManager::DebugObjectCacheForAddress() to retrieve the ObjectCache for
a certain address from KDL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 16:09:49 +00:00
Michael Lotz
9a79e531ef bonefish+mmlr:
* Introduce TracingMetaData::IsInBuffer() to validate that a certain memory
  range is within the valid tracing buffer limits.
* Use that when validating in tracing_is_entry_valid() before trying to access
  the entry, resolving a TODO.
* Validate the candidate time against the handed in time (if specified) as an
  additional check.
* Tiny unrelated text cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-02 16:02:07 +00:00
Michael Lotz
45cbd81436 Fix build with tracing disabled. Since capture_tracing_stack_trace() doesn't
return a stack trace when tracing is disabled we don't really need to be able
to print one either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43088 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 22:49:32 +00:00
Ingo Weinhold
f606e8fd79 mmlr + bonefish:
* AllocationTrackingCallback::ProcessTrackingInfo(): Also pass the
  allocation pointer.
* "allocations_per_caller" KDL command: Add option "-d". When given,
  each allocation for the specified caller is printed, including the
  respective stack trace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43087 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 22:26:23 +00:00
Ingo Weinhold
e32699b404 mmlr + bonefish:
Add ObjectCache::ObjectAtIndex().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43086 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 22:23:37 +00:00
Ingo Weinhold
328df922e6 mmlr + bonefish:
* Add TraceOutput::PrintArgs(), a va_list version of Print().
* Move code of TraceOutput::Print() to new private template function
  print_stack_trace().
* Add public tracing_print_stack_trace().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43085 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 22:22:14 +00:00
Michael Lotz
a5e2a43050 Fix the build with memory manager tracing disabled. The guard was missing
in the header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 21:40:40 +00:00
François Revol
7014f7f3e4 Fix method name in trace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43083 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 21:29:19 +00:00
Ingo Weinhold
50175c99c4 mmlr + bonefish:
Refactor the "allocations_per_caller" KDL command related functions.
They expect an instance of a class implementing the new
AllocationTrackingCallback interface, now. The only implementation ATM
is AllocationCollectorCallback, which does the work the now removed
slab_debug_add_allocation_for_caller() did before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 21:16:14 +00:00
Ingo Weinhold
f908ff9bb6 mmlr + bonefish:
* Fix build broken in r43078. The slab_debug_add_allocation_for_caller()
  wasn't guarded correctly.
* slab_debug_add_allocation_for_caller(): Add bool resetAllocationInfos
  parameter, which makes the function clear the allocation tracking
  infos after processing the data.
* "allocations_per_caller" KDL command: Add option "-r" to reset the
  allocation tracking infos. The next invocation of the command will
  only show the allocations made after the reset.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43079 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 20:35:49 +00:00
Ingo Weinhold
0422a0f3ae mmlr + bonefish:
* dump_allocations_per_caller(): Compute the total allocation count and
  size from the caller infos instead of using return arguments in the
  helper functions called.
* Move caller info update code from analyze_allocation_callers() to new
  function slab_debug_add_allocation_for_caller(), so it can be reused.
* Add MemoryManager::AnalyzeAllocationCallers() to collect the
  allocation information for the memory manager.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 19:40:27 +00:00
François Revol
8fe82997ba Some more tracing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 18:59:47 +00:00
François Revol
f6fbf32a02 Dump the 68040 mmu registers before touching them.
Added a comment about the Milan clone which uses the mmu in the BIOS to emulate Atari hardware, and the Transparent Translation registers to map the PCI bus, which screws up with our current code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 18:58:18 +00:00
Ingo Weinhold
e1c6140eaa mmlr + bonefish:
* Add optional stack trace capturing for slab memory manager tracing.
* Add allocation tracking for the slab allocator (enabled via
  SLAB_ALLOCATION_TRACKING). The allocation tracking requires tracing
  with stack traces to be enabled for object caches and/or the memory
  manager.
  - Add class AllocationTrackingInfo that associates an allocation with
    its respective tracing entry. The structure is added to the end of
    an allocation done by the memory manager. For the object caches
    there's a separate array for each slab.
  - Add code range markers to the slab code, so that the first caller
    into the slab code can be retrieved from the stack traces.
  - Add KDL command "allocations_per_caller" that lists all allocations
    summarized by caller.
* Move debug definitions from slab_private.h to slab_debug.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-01 18:34:21 +00:00