Commit Graph

26483 Commits

Author SHA1 Message Date
Ingo Weinhold 7805eb0cc2 Changed the handling for hardware-caused terminal signals:
* No longer send a SIGKILL when a page fault occurred, there was no
  signal handler, and the debugger told us to continue as usual. Instead
  we send a SIGSEGV. Instead in handle_signal() when not in the main
  thread and there's no handler for the signal, we first send the main
  thread a SIGKILL before letting the thread die.
  So in cases where the main thread caused an unhandled page fault, the
  team will die from the SIGSEGV, now. This fixes bug #2773. 
* For the other hardware-caused signals we do now do the same as in case
  of page faults, i.e. we first check whether the thread has a handler
  for the signal in question. If so, we don't notify the debugger, but
  send the signal right away.
* B_GENERAL_PROTECTION_FAULT is translated to SIGILL now. Seems better
  than SIGKILL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27757 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 14:08:13 +00:00
François Revol 02e08b15ef Add or fix copyright headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27756 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 01:04:05 +00:00
Ingo Weinhold 9618c0dc63 Panic when trying to access the small data region. It is not loaded from
disk.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 00:35:25 +00:00
Ingo Weinhold 1cd8c4cc08 Let the boot loader set the kernel image's name.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 00:33:20 +00:00
Ingo Weinhold 0dc4d1e5ca Reverted r27685, r27676, r27665, and r27664, the changes related to
letting the boot loader provide full paths for the pre-loaded images.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 00:28:10 +00:00
Ingo Weinhold 6075e354ab * Call module_init_post_boot_device() right after the boot volume has
been mounted, before anyone could try to load any modules from it.
  Also pass it a flag whether the boot volume is where the boot loader
  pre-loaded the modules from.
* module_init_post_boot_device() changes the pre-loaded module image
  paths to normalized boot volume paths, now. Got rid of the code in
  register_preloaded_module_image() which tried something like this.
* Changed module image ref counting. A referenced module has single
  reference to its image, which is released when the module becomes
  unreferenced.
* get_module() for a reference module will not try to re-get and re-set
  the module's image anymore. That could lead to a similar module (from
  different paths) being loaded at the same time. A module from a new
  file can only be loaded when the old one has been put completely.
* Simplified B_KEEP_ALIVE module handling a bit. When the module is
  initialized, we add another reference, which we'll never free. Thus
  the module remains loaded without special handling. Removed
  module_image::keep_loaded. A B_KEEP_ALIVE module remains referenced
  and thus its image remains referenced, too.
* Removed module::file, a cached path to the module's image. An
  optimization that wouldn't work with multiple root directories for
  modules (/boot/beos/..., /boot/common/...) or when module files were
  moved. get_module() does now always search the image file, when the
  module is still unreferenced. This should be a bit slower than before,
  but I didn't notice any difference in VMware at least. If it turns out
  to be a problem we could introduce a more intelligent cache that stays
  up to date by using node monitoring.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 23:59:53 +00:00
Ingo Weinhold e8d3eff968 * vfs_normalize_path() and _user_normalize_path() use a common helper
function (normalize_path()), now. There was some code duplication
  before.
* Added "bool traverseLink" parameter to vfs_normalize_path(). When
  true and the leaf component is a symlink, it will be resolved.
* KPath:
  - Added similar leaf link traversal parameter to SetTo() and
    SetPath().
  - Added Normalize().
  - Added DetachBuffer(), which returns the object's current buffer and
    unsets itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 23:30:28 +00:00
Ingo Weinhold 0914d6da5a Removed debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 23:08:29 +00:00
François Revol a3d8a94533 Hack to fix building for R5. Should go away later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 15:30:32 +00:00
Ingo Weinhold b22c760c73 Added header directory missing for <asm_defs.h>. Should fix the build on
BeOS compatible platforms.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 13:36:29 +00:00
Ingo Weinhold c3c841e223 Added <asm_defs.h> as a build header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-26 13:35:20 +00:00
Stefano Ceccherini 2b389c6e5a don't leak the bmessenger. CID 888
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 15:51:29 +00:00
Stefano Ceccherini 85d7d4bc41 the loop was never entered. CID 93
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:36:29 +00:00
Stefano Ceccherini 84dcf4f24f CID 996. Don't leak the BString
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:23:39 +00:00
Stefano Ceccherini 2e2f53f614 don't leak extendedPoseInfo on error. CID 997
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:19:59 +00:00
Stefano Ceccherini d0397c5424 don't leak the BMessengers. CID 1009 and 1010
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27742 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:03:25 +00:00
Stefano Ceccherini e32494d24f Check for NULL before dereferencing the pointer. CID 1050
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 13:56:50 +00:00
François Revol 717326c223 Add missing api_version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 13:18:22 +00:00
Stefano Ceccherini 02de38b077 Fixed leaks. CID 893 and 894. There are still some leaks in this file, but the code is too complex and I won't touch it. I'd feel better if someone who knows it better would have a look
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 13:12:19 +00:00
Ingo Weinhold 8ddfb2fdb5 Should fix problems with whitespace in path names (#2770).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 12:41:36 +00:00
Stefano Ceccherini 7483a2666e fixed leaks. CID 906 and 907
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27737 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 12:12:59 +00:00
Stefano Ceccherini d556a216cf delete the str array in any case, although if numBytes <= 0, the array woulnd't have been allocated. CID 882.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27736 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 12:06:32 +00:00
Stefano Ceccherini 0f85a3eb5b renamed field variables to fit our guidelines. Also use sem_id instead of long
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 12:00:03 +00:00
Stefano Ceccherini 68fba17fe7 style changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27734 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 11:55:00 +00:00
Stefano Ceccherini bdee0a3f6d Don't leak the BMessenger (CID 880)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27733 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 11:49:25 +00:00
Ingo Weinhold 5def543d91 Insert the application image at the head of the list. Work-around for
code (like found in Firefox) that relies on get_next_image_info() to
return it first.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 11:47:12 +00:00
Stefano Ceccherini 657a3676f9 don't leak the BMessenger. CID 884
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 10:39:48 +00:00
Stefano Ceccherini cd83a15bde BFilePanel doesn't take ownership of the passed entry_ref. That code wouldn't have worked anyway, since FindRef() returns B_OK on success. CID 933
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 10:31:31 +00:00
Stefano Ceccherini 2ad68d466a don't leak the BMessenger. CID 928 and 929
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 10:11:20 +00:00
Stefano Ceccherini c404bd0e22 BFilePanel makes a copy of the passed messenger
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 10:08:04 +00:00
Stefano Ceccherini 1c35c27bec renamed static variable to have the s prefix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 07:39:28 +00:00
Stefano Ceccherini 7696317d06 Style changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 07:37:23 +00:00
Stefano Ceccherini 97c7b4da99 minWidth could be used uninitialized. CID 1150
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 07:31:48 +00:00
Stefano Ceccherini e7d2f0f0e8 fix the problem reported in the TODO by using a reference to pointer
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 06:12:02 +00:00
Ingo Weinhold 07865c4022 Fixed check whether an address is contained in an image. Address + size
does overflow when the image ends at the end of the address space (like
the commpage).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 14:47:05 +00:00
Ingo Weinhold 8a85be4636 Register the commpage as an image and its entries as symbols.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 14:41:42 +00:00
Ingo Weinhold fec47a5702 Added functions elf_create_memory_image() and
elf_add_memory_image_symbol(). The former creates and registers a new
image that has not been loaded from a file. The latter adds a symbol to
its symbol table. This is mainly a debug feature, allowing to name code
or data in memory regions that aren't associated with loaded ELF
objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 14:40:24 +00:00
Stefano Ceccherini 727834785d Added a TODO explaining why BGameSoundDevice::Buffer() is broken. Small style changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 12:55:25 +00:00
Axel Dörfler 619780e1be * Patch by tqh from ticket #2761 that adds max_hdr, and puts some extra
parenthesis around the mtod() definition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-24 07:33:03 +00:00
Ingo Weinhold 8cc146385f Use the new <asm_defs.h> header in x86 assembly files. Particularly
added FUNCTION_END() calls for a good deal of functions. The respective
ELF symbols do now have a correct size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:50:30 +00:00
Ingo Weinhold 4069a00744 Header containing macro definitions used in various assembly sources.
I'm not happy with the location, but I didn't see any better one in the
header tree.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:46:07 +00:00
Ingo Weinhold a6d671fc8e The variable_stack_depth field in the profiler update message was not
set correctly. Could cause "profile" to crash.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:43:40 +00:00
Ingo Weinhold 52d0d5e53e elf_load_user_image() does now register the loaded image. That is every
team does have a runtime loader image. The "profile" tool can thus
translate addresses in the runtime loader correctly.
Note that this change will break code that assumes that the application
image is the first image returned by get_next_image_info().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 21:13:38 +00:00
Ingo Weinhold 95d4a71d89 Rather use MAP_PRIVATE instead of MAP_SHARED. It doesn't make a
difference ATM, but will, when we change the semantics of MAP_PRIVATE to
imply MAP_COPY.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 20:34:45 +00:00
Ingo Weinhold 5181b35bee Introduced a separate flag for indicating that disable_debugger() had
been called for a team, and fail installing the default debugger if it
is set. This makes disable_debugger() actually work. Fixes bug #2763.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 20:17:58 +00:00
Ingo Weinhold e9c4d47ad7 Added command line option "-d" to disable the debugger before crashing.
Shows that disable_debugger() isn't working ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27712 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 19:54:12 +00:00
Michael Lotz a6277def2a CID 1156 complained that this was an uninitialized variable, though it was
merely a completely unneccessary one.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 19:13:01 +00:00
Michael Lotz 0b559106bf * Only copy over the list content if resizing/allocating the list succeded.
Fixes CID 1268.
* Remove no more correct comment.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27710 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 19:07:13 +00:00
Rudolf Cornelissen 42dfe402c0 got the meaning of configure_dma()'s return value wrong. It respected the failsafe boot option after all. fixed plus few added dprintf() messages to see what's happening. Sorry for the fault. Searching more for the real problem..
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 19:02:51 +00:00
Stefano Ceccherini 250505c99b more small style changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27708 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 15:38:32 +00:00