Commit Graph

4857 Commits

Author SHA1 Message Date
Fredrik Holmqvist
cdca279abd Remove unused header hpet.h. 2012-09-09 14:47:49 +02:00
Alexander von Gluck IV
534268052d Kernel VM: Utilize swap_auto option
* Refine the swap logic a little
* Refine header copyright to preferred format
  I had hamishm's verbal permission to change his entry
2012-09-07 00:13:14 +00:00
Alexander von Gluck IV
4517ef5728 Kernel VM: A few changes as per Axel in #7742
* Avoid floating point numbers in the kernel
* Warning would always show if custom swap file in use
* Don't change a custom swap file size if low space occurs
* Ram > 1GB? Don't double the memory for the automatic size
2012-09-04 15:35:10 -05:00
Alexander von Gluck IV
3e01905aca Kernel VM: Add compatibility logic
* If old-format swap config file found, parse it properly
2012-09-04 13:27:33 -05:00
Alexander von Gluck IV
0606074fd9 Kernel VM: Improve swap file selection
* Heavily based on Hamish Morrison's GCI work with some
  modified logic and cleanup. #3723
* Adds automatic swap as well as user specified swap
* Limits:
  Automatic: (ram * 2) up to 25% of the disk
  User: user specified up to 90% of the disk
* Supports changing the swap disk location
2012-09-04 12:31:56 -05:00
Alexander von Gluck IV
3d87b8120c Kernel VM: Style cleanup; No functional change 2012-09-04 08:42:36 -05:00
Axel Dörfler
098967cee1 Fixed the new issue in #8910 from r44585.
* The ASSERT() I introduced in r44585 was incorrect: when the sub transaction
  used block_cache_get_empty() to get the block, there is no original_data for
  a reason.
* Added a test case that reproduces this situation.
* The block must be moved to the unused list in this situation, though, or else
  it might contain invalid data. Since the block can only be allocated in the
  current transaction, this should not be a problem, though, AFAICT.
2012-09-04 01:00:33 +02:00
Yongcong Du
19187c464b x86: Initialize IA32_MSR_ENERGY_PERF_BIAS
The lowest 4 bits of the MSR serves as a hint to the hardware to
favor performance or energy saving. 0 means a hint preference for
highest performance while 15 corresponds to the maximum energy
savings. A value of 7 translates into a hint to balance performance
with energy savings.

The default reset value of the MSR is 0. If BIOS doesn't intialize
the MSR, the hardware will run in performance state. This patch
initialize the MSR with value of 7 for balance between performance
and energy savings

Signed-off-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2012-08-29 22:11:56 +02:00
Axel Dörfler
713945cecb The original_data could be freed late.
* In cache_abort_sub_transaction(), the original_data can already be freed
  when the block is being removed from the transaction.
* block_cache::_GetUnusedBlock() no longer frees original/parent data - it
  now requires them to be freed already (it makes no sense to have them still
  around at this point).
* AFAICT the previous version did not have any negative consequences besides
  freeing the original data late.
2012-08-27 20:00:06 +02:00
Axel Dörfler
9089ab06bd Minor block cache refactoring.
* Extracted a write_blocks_in_previous_transaction() function out of
  cache_end_transaction(), and cache_detach_sub_transaction().
2012-08-27 12:46:22 +02:00
Axel Dörfler
dd9d610500 Fixed broken block list introduced in hrev44357.
* cache_abort_sub_transaction() was setting the transaction_next pointer to
  NULL in order to remove a block from a transaction -- however, it forgot to
  actually remove it from the transaction's block list.
* Minor restructuring.
2012-08-27 12:42:48 +02:00
Axel Dörfler
153d895337 Fixed broken discard handling in cache_start_sub_transaction().
* This actually resolves a TODO.
2012-08-27 12:38:35 +02:00
Axel Dörfler
8f9dac699d Cleanup, no functional change intended. 2012-08-27 11:21:42 +02:00
Edward Robbins
6912e7dc03 getrlimit with RLIMIT_STACK now returns USER_MAIN_THREAD_STACK_SIZE
Signed-off-by: Rene Gollent <anevilyak@gmail.com>
2012-08-24 18:29:59 -04:00
Rene Gollent
1e068aea46 Slight improvement to tracing output.
- If a trace entry has a stack trace, attempt to demangle the associated symbols.
  Could be enhanced further to also demangle the arguments but doesn't yet.
  Interestingly there are some mangled symbols that our demangler appears to
  not handle correctly (gcc4).
2012-08-19 16:04:36 -04:00
Fredrik Holmqvist
ac827a2baa Make strcmp do four byte comparisons on aligned strings.
Used libMicro's strcmp test to evaluate performance:
OPTS="-E -C 200 -S -W"
bin/strcmp	$OPTS -N "strcmp_10"	-s 10	-I 10
bin/strcmp	$OPTS -N "strcmp_100"	-s 100	-I 20
bin/strcmp	$OPTS -N "strcmp_1k"	-s 1k	-I 50
bin/strcmp	$OPTS -N "strcmp_10k"	-s 10k	-I 800
bin/strcmp	$OPTS -N "strcmp_1m"	-s 1m   -I 500000
bin/strcmp	$OPTS -N "strcmp_10m"	-s 10m  -I 5000000

Before:
             prc thr   usecs/call      samples   errors cnt/samp     size
strcmp_10      1   1      0.02510          201        0    10000       10
strcmp_100     1   1      0.17520          169        0     5000      100
strcmp_1k      1   1      1.67700          177        0     2000     1024
strcmp_10k     1   1     17.24800          194        0      125    10240
strcmp_1m      1   1  17892.00000          160        0        1  1048576
strcmp_10m     1   1 183136.00000          201        0        1 10485760

After:
strcmp_10      1   1      0.01800          194        0    10000       10
strcmp_100     1   1      0.13540          190        0     5000      100
strcmp_1k      1   1      1.24950          188        0     2000     1024
strcmp_10k     1   1     12.85600          190        0      125    10240
strcmp_1m      1   1  12930.00000          170        0        1  1048576
strcmp_10m     1   1 134382.00000          195        0        1 10485760
2012-08-19 11:39:16 +02:00
Michael Lotz
c936a02360 Move MSI initialization before IO-APIC to fix missing init.
Initializing the IO-APIC will initialize the PCI module, which does
read the MSI config of the devices only when MSIs are available.
Since we initialized them only after that, that condition wasn't met.
Later, due to the uninitialized arch info, MSIs were still marked as
available (0xcc = 204 MSIs). Due to the also uninitialized configured
count, they were always deemed busy however, in effect just breaking
MSI support whereever IO-APICs were available.
2012-08-16 00:31:18 +02:00
Axel Dörfler
846b2f90f6 Changed the kernel's file_map.cpp to be usable from the fs_shell as well.
* This should reduce our maintenance burden a tiny bit :-)
* It also fixes a bug in the fs_shell, see hrev43395.
2012-07-24 16:00:22 +02:00
Philippe Saint-Pierre
a65ef31585 CID 609036: Avoid to exceed length of string 2012-07-20 18:31:43 -04:00
Axel Dörfler
752f5c972f cache_abort_[sub_]transaction() did not work correctly.
* cache_abort_transaction() left the block dirty which was causing bug
  #8123 as well.
* cache_abort_sub_transaction() did, in addition to not clearing the dirty
  flag, not reset the block's transaction member either if the block was
  not part of the parent transaction.
2012-07-20 00:03:38 +02:00
Axel Dörfler
0579a69564 Added a bit of documentation, minor cleanup.
* Documented the cached_block::transaction, and previous_transaction
  members.
2012-07-20 00:03:37 +02:00
Andreas Henriksson
8959a4e0c3 An unused dirty block would put again into the unused list.
* This could cause bug #8123. While this fixes the crash, one underlying
  problem is still there, as dirty blocks should never leave a transaction.
2012-07-19 23:44:25 +02:00
Ingo Weinhold
e6418c88b5 Declare syscall_numbers.h include for x86_signals_asm.S
Fixes #8718 (again).
2012-07-13 07:08:52 +02:00
Fredrik Holmqvist
a51a5f3e1e Fixes to Haiku specific code to work with ACPICA 20120711. 2012-07-12 18:32:56 +02:00
Alex Smith
7dc738b0fb Fixed ordering of registers in arch_debug_gdb_get_registers.
Current code was sending EAX, EBX, ECX, EDX..., GDB (all versions as far
as I can tell) expects EAX, ECX, EDX, EBX... Also added missing FS and GS.
2012-07-12 15:59:50 +01:00
Ingo Weinhold
8c51cca27e Fix accidental partial revert of 0174267 2012-07-12 11:06:10 +02:00
Ingo Weinhold
b1700b2cd1 Declare syscall_numbers.h include for x86_signals.cpp
Fixes #8718.
2012-07-12 10:54:30 +02:00
Ingo Weinhold
e2d2662bc4 Automatic whitespace cleanup 2012-07-12 10:53:42 +02:00
Fredrik Holmqvist
0174267ad4 Move ACPICA files into acpica subdir and use acpica subdir layout.
This matches layout in ACPICA and keeps a cleaner boundry between
Haiku and ACPICA code. The only haiku specific file in ACPICA is
achaiku.h and it will hopefully be included upstream soon.

Merging will be simpler as we can just replace acpica contents and
fix Jamfile and build errors in our code.
2012-07-11 18:50:06 +02:00
Rene Gollent
fd04f5cc26 Fix image deletion events.
- Due to (most likely) a copy/paste error, image deletion events were
  mistakenly being sent to the userland debugger as creation events.
2012-07-08 10:50:46 -04:00
Rene Gollent
7f7b659ec5 Use safer but slower approach to copying the string. 2012-07-02 20:17:03 -04:00
Rene Gollent
29291c8c92 Cleanups/optimizations. 2012-07-02 19:42:20 -04:00
Rene Gollent
dc5a16bb70 Add TODO note with respect to needed asm implementations. 2012-07-02 15:42:38 -04:00
Rene Gollent
8695be5049 Fix regressions in arch_cpu_user_strlcpy().
- repnz movsb turns out to not actually be a legal instruction,
  resulting in various strings being copied incorrectly, leading to
  random crashes in various places. Rework to use loop instead.
  Thanks to Alex Smith for helping review changes and offering
  improvements.
- Minor cleanups.
- Fixes #8650 properly.
2012-07-02 15:07:17 -04:00
Rene Gollent
fb8447d595 Fix ticket #8650.
- Replace arch_cpu_user_strlcpy() and arch_cpu_user_memset() with x86 assembly
  versions. These correctly handle the fault handler, which had broken again
  on gcc4 for the C versions, causing stack corruption in certain error cases.
  The other architectures will still need to have corresponding asm variants
  added in order for them to not run into the same issue though.
2012-07-02 02:06:29 -04:00
Michael Lotz
5521e28415 Reuse two unused lower ASCII chars for block drawing.
Characters 17, 18 and 19 (device control 1, 2 and 3) become "full block",
"upper filled block" and "lower filled block". Using back- and foreground
color inversion these could be reduced to a single "half block", but
having them available as idividual chars is more convenient.
2012-07-01 06:37:26 +02:00
Michael Lotz
fcc4ecb0c7 Add debug_calloc() to the debug_heap. 2012-07-01 06:37:25 +02:00
Fredrik Holmqvist
91102c544e Logging calculations was done outside the #def TRACE_VM_PAGE, but never printed.
Now done inside #def as well as this triggered unused variables warnings.
2012-06-23 22:43:24 +02:00
Alexander von Gluck IV
548b1a4988 cpuid: Rework AMD CPUID numbers
* If family is 0xF, we grab extended family and model
  like Intel does
* Idenfify AMD cpu's more correctly
2012-06-04 11:01:39 -05:00
François Revol
dc09611aad U-Boot: move gFDT declaration to shell.S
* this avoids it falling into the BSS section which we clear quite late,
and allows setting it from asm code if needed.
2012-06-02 13:46:45 +02:00
François Revol
cce9d8cf89 U-Boot PPC: Enable ppc440 FPU correctly
* On ppc440, the FPU is implemented as an Auxiliary Processing Unit,
we must therefore enable sending commands to it,
in addition to setting the MSR bit.
2012-06-02 01:30:48 +02:00
Alexander von Gluck IV
b7aa0a94ff ARM platform: Undo change to MMU page table assignment
* While the baremetal arm book I have says mrc, it breaks
  verdex and doesn't work on the Pi.
* Moving the page table address to the p15 coprocessor makes
  more logical sense anyway... i think mrc was a typo.
2012-05-24 10:25:52 -05:00
François Revol
1348022133 PPC: Move asm helpers to U-Boot arch Jamfile
* the OpenFirmware arch/ppc/Jamfile already has it, so move it to avoid duplicated symbols.
2012-05-24 21:55:21 +02:00
Alexander von Gluck IV
93d5b79f06 rPi console: Implement console_wait_for_key 2012-05-24 08:53:32 -05:00
François Revol
037f252fd0 U-Boot: split cpu.cpp into arch-specific and common parts
* the common part should try to use the U-Boot API when found.
* the arch part can make use of cpu features (like timer register)
* the ppc code enables the FPU in the MSR, since it's used by vsnprintf(),
which at least saves one FP register in its prologue.
2012-05-24 21:27:37 +02:00
François Revol
3bd0ac4aa3 PPC: Add eioio as barrier for the UART class
* probably unneeded but it shouldn't harm.
2012-05-24 21:20:15 +02:00
François Revol
6ca4ac0978 PPC: Add some kernel asm helpers to the bootloader
* get/set_msr() will be useful for U-Boot.
2012-05-24 21:20:14 +02:00
François Revol
134ef79db0 U-Boot: add some sections to the ppc ldscript
* it seems ld creates most of them anyway, taken from the openfirmware script.
2012-05-24 21:20:14 +02:00
Alexander von Gluck IV
9b2efb1ad5 rPi Console: Fix console vt100 calls
* Use correct clear screen escape codes
* Use correct set cursor location escape codes
* Use correct set color escape codes
2012-05-24 06:39:43 -05:00
Alexander von Gluck IV
361ec26f10 rPi MMU: Cleanup, add gPeripheralBase
* gPeripheralBase keeps track of the device
  peripherals before and after mmu_init
* Add ability to disable mmu for troubleshooting
* Remove static FB_BASE, we actually don't know
  where the FB is yet. (depends on firmware used)
2012-05-24 06:39:43 -05:00