haiku/src/system/kernel/arch
Ingo Weinhold bb163c0289 * Added a set_mtrrs() hook to x86_cpu_module_info, which is supposed to set
all MTRRs at once.
* Added a respective x86_set_mtrrs() kernel function.
* x86 CPU module:
  - Implemented the new hook.
  - Prefixed most debug output with the CPU index. Otherwise it gets quite
    confusing with multiple CPUs.
  - generic_init_mtrrs(): No longer clear all MTRRs, if they are already
    enabled. This lets us benefit from the BIOS's setup until we install our
    own -- otherwise with caching disabled things are *really* slow.
* arch_vm.cpp: Completely rewrote the MTRR handling as the old one was not
  only slow (O(2^n)), but also broken (resulting in incorrect setups (e.g.
  with cachable ranges larger than requested)), and not working by design for
  certain cases (subtractive setups intersecting ranges added later).
  Now we maintain an array with the successfully set ranges. When a new range
  is added, we recompute the complete MTRR setup as we need to. The new
  algorithm analyzing the ranges has linear complexity and also handles range
  base addresses with an alignment not matching the range size (e.g. a range
  at address 0x1000 with size 0x2000) and joining of adjacent/overlapping
  ranges of the same type.

This fixes the slow graphics on my 4 GB machine (though unfortunately the
8 MTRRs aren't enough to fully cover the complete frame buffer (about 35
pixel lines remain uncachable), but that can't be helped without rounding up
the frame buffer size, for which we don't have enough information). It might
also fix #1823.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34197 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-23 15:06:08 +00:00
..
arm * Added an arch_debug_stack_trace() function that is called from the KDL loop 2009-10-18 19:50:13 +00:00
generic
m68k * Added an arch_debug_stack_trace() function that is called from the KDL loop 2009-10-18 19:50:13 +00:00
mips
mipsel Added and modified kernel stubs and headers for arch mipsel. Correctness not included. 2009-08-23 02:52:09 +00:00
ppc Force C linkage on those two, fixes them being undefined after the .c to .cpp rename. 2009-11-14 19:44:00 +00:00
x86 * Added a set_mtrrs() hook to x86_cpu_module_info, which is supposed to set 2009-11-23 15:06:08 +00:00
Jamfile