Commit Graph

4002 Commits

Author SHA1 Message Date
Jérôme Duval 30cce27770 Patch from kaliber: use path of executable instead of the command. Thanks!
this fixes bug #1773 and #1824. I tested only #1773.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-26 00:03:51 +00:00
Stephan Aßmus 46ea5b1e49 Further improvements to auto scrolling and text rect + container view resizing:
* Renaming things in Tracker list mode no longer magically grows the text view.
* ScrollToOffset() is not supposed to depend on the existence of any scroll
  bars, in R5 text views simply scroll to where they need to. This fixes
  renaming things in Tracker when hitting the window bounds (text widget stops
  growing and starts to autoscroll) and also the Text tool in WonderBrush.
* _ScrollToOffset() is therefor no longer needed.
* The insets of the text rect are not so interesting as the original width.
  In auto resizing mode, the original width is important when there is no
  container view. In this setup, the text rect auto resizing is mainly needed
  for auto scrolling, but it should never shrink below the original size.
* Further improved auto scrolling for right aligned and center aligned text
  views, it works like R5 now. Also take the line height into account when
  checking for the bounds bottom. Removed extra spacing for vertical
  scrolling.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 23:34:23 +00:00
Oliver Ruiz Dorantes 42d737bb2e Implementation for pretty_showing bluetooth physical addresses
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24123 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 20:14:15 +00:00
Axel Dörfler 49499c1707 Forgot to commit these; this fixes building the fs_shell, thanks Jerome!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 14:08:59 +00:00
Axel Dörfler 351b7a2d24 * Added B_WATCH_INTERIM_STAT, and B_STAT_INTERIM_UPDATE definitions to
NodeMonitor.h.
* The latter will be set in "statFields" for interim updates when you have
  asked to get them via the former.
* BFS now uses the B_STAT_INTERIM_UPDATE flag for sending updates to actively
  written files.
* This makes us more compatible with BeOS again; if you only asked for
  B_WATCH_STAT, you will now only receive a notification if the file in
  question has been closed.
* Tracker now uses B_WATCH_INTERIM_STAT to always get all updates (ie.
  downloading a file will update its size and modification time in Tracker
  periodically during the download).
* Wether "needsTrimming" was true or not has no influence on wether or not
  the size index needs to be updated in BFS - only the actual file size is
  stored there, not the on-disk size.
* Added a TODO comment in Inode::WriteAt() that it would actually need to
  update the size index when changing the file size, not when the file has
  been closed (but that's probably too slow).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 13:54:30 +00:00
Ingo Weinhold 0306945545 Patch by Christof Lutteroth:
* copyright headers for the files of the libraries linprog and alm
* new class Summand for representing summands in a linear constraint
* merged class SoftConstraint into class Constraint; Constraint now
  supports both soft and hard constraint functionality
* new AddConstraint methods in class LinearSpec for directly setting
  constraints with 1 to 4 summands
* code cleanups by using aforementioned AddConstraint methods
* a new very simple test application for alm
* some style corrections


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 01:54:05 +00:00
Ingo Weinhold f69d34a72c Updated headers/build/os/support/TypeConstants.h with the current
headers/os version and removed the now duplicate icon type constant
definitions from several sources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 00:55:57 +00:00
Karsten Heimrich 93608e10d1 * fixed coding style...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 22:22:43 +00:00
Stefano Ceccherini 576e2bf833 Patch by Julun: implements a refcounted BString. Thank You!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 21:16:58 +00:00
Stephan Aßmus b8872c02c1 BTextControl:
* Placed _BTextInput_ into BPrivate namespace.
* Made _BTextInput_::AlignTextRect() smarter, it centers the line vertically,
  for the case that the BTextControl has a larger label font. Improved insets
  for asthetics.
* Used _BTextInput_::AlignTextRect() consistently in BTextControl, no more
  custom calls to SetTextRect(). Account for minimum vertical inset of 2
  pixels in GetPreferredSize().
* Consistendly select all text when gaining focus in _BTextInput_.
* Override MouseDown() in case the control did not have focus before, or else
  BTextView::MouseDown() will deselct the text again and place the cursor.
  (in line with BeOS behavior)
* Removed unused fBool member from _BTextInput_ and other cleanup.

BTextView:
* Reimplemented BTextView::_AutoResize() so that it works well with
  BTextControl and autoscrolling when the alignment is not B_ALIGN_LEFT.
  I needed two new members for this, fLeftInset and fRightInset which are
  the original insets from the fTextRects. It might currently be broken
  for renaming things in Tracker, I will have to check. _AutoResize() no
  longer messes up the fTextRect insets.
* Fixed stray carrets sometimes being left over, mostly when auto scrolling,
  but I observed them in other cases as well.
* Prevent negative scrolling offsets when autoscrolling. Fixes weird scrolling
  offsets when navigating to the left.
* Reset scrolling to B_ORIGIN when SetText() is called. Fixes for example
  starting to type in the middle of the control in Vision when entering new
  text and autoscrolling was triggered before.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24101 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 20:39:29 +00:00
Stephan Aßmus fef3930499 patch by Rene Gollent:
* BListItems now store the top offset of the frame within the parent BListView.
* This allows binary searching the clicked item.
* ItemFrame() is now a cheap call.
* Fixed several bugs in the sorting code of BOutlineListView which lead to
  crashes of client applications.
* Implemented previously unimplemented functions in BOutlineListView.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24092 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 14:15:28 +00:00
Jérôme Duval 6213408838 added search.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24091 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 13:41:01 +00:00
Axel Dörfler f9bbab8848 * First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
  view - note though, that you must not remove a view before closing or
  hiding its window for now (and that you still need to set the 
  kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
  managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the 
  specified flags set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 11:18:52 +00:00
Jérôme Duval b3918e2f66 added SIZE_MAX to stdint.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24085 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-23 22:31:19 +00:00
Ingo Weinhold 7dc065bdb0 * syscall_restart_handle_timeout_pre(uint32&, bigtime_t&): A huge
negative relative timeout would be converted to B_INFINITE_TIMEOUT.
  For some reason the ScreenSaver preflet is snooze()ing with such
  a value.
* Some more comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24080 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-23 15:56:56 +00:00
Ingo Weinhold bc2001bb39 We have to update the pending signals thread flag when restoring the
signal block mask when returning from a signal handler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-22 14:54:03 +00:00
Axel Dörfler ea9d4cd0f7 Slightly increased the default key repeat rate to make it at least
bearable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-22 10:53:27 +00:00
François Revol 7f3937521f Add debugger module hooks to implement alternative io (I need laplink debugging...)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 22:41:49 +00:00
Oliver Ruiz Dorantes df05c82d14 Add using namespace pragmas
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 22:17:54 +00:00
Axel Dörfler 0dd3108ca0 * Added SIGNAL_FLAG_DONT_RESTART_SYSCALL for send_signal_etc() which
utilizes the THREAD_FLAG_DONT_RESTART_SYSCALL (but only in SIGCONT
  for now).
* resume_thread() is now using that flag to be compatible with BeOS.
* This fixes the Terminal hanging on close.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 13:19:54 +00:00
Ingo Weinhold 562e2f204a * Removed unused team::pending_signals.
* Added team::flags. Currently only used for setting a flag when a team
  has exec()ed.
* Some improvements of _user_setpgid():
  - It failed incorrectly when the target process was a process group
    leader. According to the standard it shall fail when the process is
    a session leader. Moving a process group leader to another process
    group is fine, even if that leaves the group leaderless.
  - Fixed race conditions. We need to recheck the error conditions when
    we hold the team spinlock. Otherwise the situation could change
    while we allocated the new process group. This was one of the
    reasons for bug #1799 -- after the shell fork()'s both parent and
    child invoke setpgid() for the child.
  - Fixed behavior for pid == pgid. It doesn't necessarily mean that a
    new group has to be created.
  - Fixed update of target process group orphaned state.
  - Squashed TODO: setpgid() on a child is supposed to fail after the
    child has exec()ed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 00:46:22 +00:00
Axel Dörfler 3a0782dc15 Added printf()/scanf() type definitions, courtesy of Curtis Wanner - thanks
a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24039 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 00:08:03 +00:00
Oliver Ruiz Dorantes d816d81682 Lesson learned, dont use system IOCTL codes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24038 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-20 21:10:53 +00:00
Axel Dörfler 9448bb6e0b Added add_node_listener() and remove_node_listener() kernel private functions
to watch a node.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-20 16:48:16 +00:00
Michael Lotz cf46897b4c Use a dedicated heap to allocate everything that is needed during heap growth.
This eliminates the edge case where the grow thread would not be able to create
a new area because no memory could be allocated for the allocation of the area.
As this case cannot happen anymore, it is also not possible to deadlock in
memalign. Therefore the timeout (which would only have prevented the deadlock
but wouldn't have solved the edge case anyway) has been removed too.
Add options to dump the dedicated grow heap and to only print the current heap
count to the "heap" debugger command.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-18 01:04:19 +00:00
Ingo Weinhold c72d22a5e8 Converting relative timeouts into absolute ones is fine in principle,
but there's a special handling for 0 us relative timeouts. Syscalls
usually return B_WOULD_BLOCK instead of B_TIMED_OUT in this case, and
callers might explicitely check for it. Hence we don't convert 0 us
timeouts anymore. gdb works again.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23989 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 18:05:49 +00:00
Ingo Weinhold 058494285a axeld + bonefish:
* Added syscall restart support for connect(), accept(), send(), recv(),
  which are implemented via ioctl()s. The actual restart support is done
  in the net stack driver's ioctl() hook. Lower layers need to correctly
  deal with socket timeouts, though, for which the stack module provides
  support functions.
* TCPEndpoint::_WaitForEstablished() does abort now when an error
  occurred earlier, so that trying to connect to an unused port fails
  immediately, as it should.
* Fixed and refactored TCP connection reset handling. The new
  TCPEndpoint::_HandleReset() does the job. Got rid of
  TCPEndpoint::fError.
* Fixed sequence numbers for SYNC/FINI packets.
* The former two fix the problem that connections wouldn't be closed
  correctly and could even be reused when trying to connect again (as
  was reproducible with svnserve + svn).
* Some style cleanup in CPEndpoint.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 16:25:07 +00:00
Ingo Weinhold 4048494ce4 axeld + bonefish:
* Implemented automatic syscall restarts:
  - A syscall can indicate that it has been interrupted and can be
    restarted by setting a respective bit in thread::flags. It can
    store parameters it wants to be preserved for the restart in
    thread::syscall_restart::parameters. Another thread::flags bit
    indicates whether it has been restarted.
  - handle_signals() clears the restart flag, if the handled signal
    has a handler function installed and SA_RESTART is not set. Another
    thread flag (THREAD_FLAGS_DONT_RESTART_SYSCALL) can prevent syscalls
    from being restarted, even if they could be (not used yet, but we
    might want to use it in resume_thread(), so that we stay
    behaviorally compatible with BeOS).
  - The architecture specific syscall handler restarts the syscall, if
    the restart flag is set. Implemented for x86 only.
  - Added some support functions in the private <syscall_restart.h> to
    simplify the syscall restart code in the syscalls.
  - Adjusted all syscalls that can potentially be restarted accordingly.
  - _user_ioctl() sets new thread flag THREAD_FLAGS_IOCTL_SYSCALL while
    calling the underlying FS's/driver's hook, so that syscall restarts
    can also be supported there.
* thread_at_kernel_exit() invokes handle_signals() in a loop now, as
  long as the latter indicates that the thread shall be suspended, so
  that after waking up signals received in the meantime will be handled
  before the thread returns to userland. Adjusted handle_signals()
  accordingly -- when encountering a suspending signal we don't check
  for further signals.
* Fixed sigsuspend(): Suspending the thread and rescheduling doesn't
  result in the correct behavior. Instead we employ a temporary
  condition variable and interruptably wait on it. The POSIX test
  suite test passes, now.
* Made the switch_sem[_etc]() behavior on interruption consistent.
  Depending on when the signal arrived (before the call or when already
  waiting) the first semaphore would or wouldn't be released. Now we
  consistently release it.
* Refactored _user_{read,write}[v]() syscalls. Use a common function for
  either pair. The iovec version doesn't fail anymore, if anything could
  be read/written at all. It also checks whether a complete vector
  could be read/written, so that we won't skip data, if the underlying
  FS/driver couldn't read/write more ATM.
* Some refactoring in the x86 syscall handler: The int 99 and sysenter
  handlers use a common subroutine to avoid code duplication.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 15:48:30 +00:00
Michael Lotz 4af6cd5f38 Adding two debug features to the new heap implementation:
* Tracing of allocations, reallocations and frees
* Leak checking infrastructure to dump allocations

The leak checking code records the team and thread id when an allocation is
made as well as stores the originally requested size. It also adds the
"allocations" debugger command that can dump all current allocations (usually
a huge list) or filter by either a team or thread id. This way it's easily
possible to find leftover allocations of no more active teams/threads.
Combined with the tracing support one might be able to track down the time and
reason of an allocation and possibly find the corresponding leak if it is one.
Note that kernel heap leak checking has to be enabled manually by setting the
KERNEL_HEAP_LEAK_CHECK define to 1.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-12 20:20:35 +00:00
Michael Lotz 5c4d1c5e21 Complete rework of the heap implementation. Freelists are now part of the pages
and pages are now kept in lists as well. This allows to return free pages once
a bin does not need them anymore. Partially filled pages are kept in a sorted
linked list so that allocation will always happen on the fullest page - this
favours having full pages and makes it more likely lightly used pages will get
completely empty so they can be returned. Generally this now goes more in the
direction of a slab allocator.
The allocation logic has been extracted, so a heap is now simply attachable to
a region of memory. This allows for multiple heaps and for dynamic growing. In
case the allocator runs out of free pages, an asynchronous growing thread is
notified to create a new area and attach a new heap to it.
By default the kernel heap is now set to 16MB and grows by 8MB each time all
heaps run full.
This should solve quite a few issues, like certain bins just claiming all pages
so that even if there is free space nothing can be allocated. Also it obviously
does aways with filling the heap page by page until it overgrows.
I think this is now a well performing and scalable allocator we can live with
for quite some time. It is well tested under emulation and real hardware and
performs as expected. If problems come up there is an extensive sanity checker
that can be enabled by PARANOID_VALIDATION that covers most aspects of the
allocator. For normal operation this is not necessary though and is therefore
disabled by default.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-10 21:00:13 +00:00
Jérôme Duval 176480764b declared entry_ref
clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23934 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 21:37:25 +00:00
Oliver Ruiz Dorantes ce28fccee2 Even code field has more sense like that
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 18:32:52 +00:00
Oliver Ruiz Dorantes 2573c43064 Change macros names, guidelines & consistency
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 18:29:33 +00:00
Ingo Weinhold 2c986936df Added new syscall _kern_normalize_path() to normalize a path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 03:06:14 +00:00
Ithamar R. Adema eb5a25ca41 Slight rework of my previous commit... now ports can be asked too ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 02:00:08 +00:00
Ithamar R. Adema 62cb58a8ef Make print_server track Transport addons too. This is because some of the NewTransportAddOns(tm) can also autodetect devices, e.g. USB printers. For this, the print_server needs to keep those transport addons loaded at all times. This code now also enables dynamic Transport discovery for the Printer prefs, e.g. 'hey print_server GET Transport 0' or 'hey print_server GET Transport 'USB Port'' will now work too ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 00:34:53 +00:00
Oliver Ruiz Dorantes 6ad588aae8 Added remaining event IDs I saw in new Bluetooth 2.1 specs plus some internal stack haiku is gonna use
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 19:56:08 +00:00
Ingo Weinhold 7486b72dd1 Added some kernel tracing to the runtime loader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 19:22:39 +00:00
Ingo Weinhold ed854de770 Also include info about the syscall return type in the
extended_syscall_info structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 16:03:00 +00:00
Axel Dörfler 6f58064f10 * Added flags field in net_protocol_module_info; there is currently a single
defined flag: NET_PROTOCOL_ATOMIC_MESSAGES.
* socket_send() now honours NET_PROTOCOL_ATOMIC_MESSAGES and returns either
  EMSGSIZE if the data to be send is larger than net_socket::send::buffer_size,
  or divides the data in appropriately sized chunks.
* This fixes sending >=64K over a TCP socket at once (TCP would just have
  returned an error in that case).
* TCP now overrides the default send buffer size (to 32768 for now).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 15:09:19 +00:00
Ingo Weinhold 9835c090a6 Added a boolean "force" parameter to thread_yield(). When true, the
function has the old behavior. When false, it just calls the scheduler
without any priority adjustment or other stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 11:40:31 +00:00
Stefano Ceccherini d082779211 Rewrote Input.h, adjusted Input.cpp accordingly, added nothrow on
allocations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 10:50:39 +00:00
Philippe Houdoin 6198a9798e Made DPC module binary compatible with BeOS one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 23:10:13 +00:00
Oliver Ruiz Dorantes 2f7e4b7c05 Add bluetooth error codes according 2.1+EDR official specs
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 18:00:04 +00:00
Oliver Ruiz Dorantes c9502bbe71 Added macros to parse port code, cointaining the event
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 17:57:29 +00:00
Axel Dörfler 392eb518d5 * Added gcvt() implementation - this fixes bug #1757.
* Added gcvt(), ecvt(), and fcvt() prototypes to stdlib.h - they are all
  marked legacy, but are still part of the POSIX standard, so we might want
  to implement them if the need arises.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 17:11:02 +00:00
Ingo Weinhold a101e99aad Added libalm.so and its dependency liblinprog.so. libalm.so provides a
BLayout implementation (BALMLayout) using the Auckland Layout Model
(ALM). The original ALM was implemented by Christof Lutteroth, the
Haiku/C++ version by James Kim.
The code needs some review, but the test programs seem to work fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23889 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 10:51:44 +00:00
Ingo Weinhold 38d596cb81 * Moved public headers to headers/libs/lp_solve.
* Added Jamfile by James Kim and Christof Lutteroth.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-06 10:37:19 +00:00
Ingo Weinhold 350b6dbc3a * Removed AbstractTraceEntry::sPrintTeamID and added a flags field to
TraceOutput for output options instead.
* Added "traced" option --difftime. Instead of the absolute system time
  it prints the difference time to the previously printed entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-04 17:54:40 +00:00
Axel Dörfler 7cb9337835 * Ingo broke binary compatibility of Window.h in r18649, thanks to Stefano
for finding this. This should fix bug #1734.
* Removed unused BWindow members and the temporary PrintToStream() method.
* Indentation cleanup (DirectWindow.h had some spaces instead of tabs).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-04 15:01:34 +00:00
Axel Dörfler 43711de9d2 * Added BSD specific errno.h for EDOOFUS (yeah, I know, great error code...)
* Added sigmask() macro.
* Fixed libutil.h I broke yesterday: it's thought to add functions only if
  you've included some other headers before; added the correct header guard
  we're using for our sys/param.h.
* Added pidfile.c to the build.
* Fixed warning in realhostname.c, and pidfile.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23840 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 16:20:16 +00:00
Michael Lotz f87d72d788 Introduce a B_NO_LOCK_VECTOR flag to be used with install_io_interrupt_handler().
When specified it desigantes that the interrupt handler should not lock the
vector with a spinlock when executing the installed interrupt handlers. This
is necessary to allow the same interrupt vector to be handled in parallel on
different CPUs. And it is required for the CPU halt to work synchronously when
there is more than one AP CPU. Though the acquire_spinlock() should cause IPIs
to be processed, only this fixed the SMP_MSG_FLAG_SYNC problem for me.
Not locking is safe as long as it is guaranteed that no interrupt handler is
registered or removed while the interrupt handler is running. We can guarantee
this for the SMP interrupt handlers we install in arch_smp_init() as they are
never uninstalled. Probably this flag should be made private though.
Restored the SMP_MSG_FLAG_SYNC when entering the kernel debugger.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 16:16:17 +00:00
Axel Dörfler a32a4683ff * Implemented flock() semantics to the advisory locking backend. Not tested
(must also compare to BSD; I've looked at their sources, but I might have
  missed something).
* Added sys/file.h and the flock() system call.
* common_fcntl() could forget to put back the file descriptor on some error
  conditions (I guess we should introduce and use a DescriptorGetter class).
* Cleaned up fcntl.h, moved the BSD extensions S_IREAD and S_IWRITE to
  sys/stat.h where they belong, and added the missing S_IEXEC to them.
* Added some more comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 15:37:31 +00:00
Axel Dörfler e5bc2a9e7a Added BSD extension vsyslog() - is also found on Linux.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 15:31:16 +00:00
François Revol 82610ec8eb * get rid of ppc stuff
* possible types of exception frames


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 11:39:28 +00:00
Stephan Aßmus ff5defe060 Include <sys/param.h> for MAXPATHLEN - fixes the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 19:08:58 +00:00
Axel Dörfler e6b30aee0f Minor improvements for the BSD compatibility library:
* Added {get|set|end}usershell() functions.
* Define MAXLOGNAME, and L_SET, L_INCR, and L_XTND.
* The pidfile stuff in libutil.h is now included, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23827 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 17:38:09 +00:00
Axel Dörfler b4fd412b3e * Added BSD's FD_COPY() macro (it's not POSIX, though).
* Some other minor improvements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 17:32:01 +00:00
Stephan Aßmus 96418817f9 * added a PrintToStream() method
* added optional tracing for the main operations
* fixed bad pointer arithmetic when reallocating/moving the object's data
* it was impossible to remove the very first space via _RemoveSpaces()
* added a little more variaty to error return codes for some
  functions to make them a little more helpful

-> This fixes the bogus space values in DriveSetup (#1737)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:38:15 +00:00
Axel Dörfler f033aee165 * Added B_NOT_SUPPORTED, B_KERNEL_READ_AREA, and B_KERNEL_WRITE_AREA to
HaikuBuildCompatibility.h; this fixes building agp_gart and the intel
  extreme driver for BeOS.
* Added sockaddr_storage to HaikuBuildCompatibility.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23823 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:18:55 +00:00
Axel Dörfler 45b17b80d1 * Temporarily switched to a recursive lock for the depot.
* While this is not a really good idea for a lock with supposedly little
  contention, but it'll fix bug #1731. I haven't tested it yet, but will
  do so in a minute :-)
* I will need to rework the slab anyway so that it's possible to use it
  as a replacement for our heap, and then I'll switch back to a benaphore
  again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23822 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:12:54 +00:00
Bruno G. Albuquerque ea2fe1498f It is a good idea to return a value. :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 23:24:10 +00:00
Axel Dörfler 5ccd99565d Benaphores are nice and fast, but they aren't useful for debugging at
all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 23:05:26 +00:00
Oliver Ruiz Dorantes b06bf23fb5 Add 'public' headers in order all stuff actually compiles
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 21:17:02 +00:00
Oliver Ruiz Dorantes 9b67804dce Add private bluetooth headers being used in the kit and the future server
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 20:59:14 +00:00
Ingo Weinhold 90e3bbf0cb Added optional kernel tracing for sending BMessages. Currently only the
destination of the message and it's "what" field are stored. It might be
nice to also get some info about its fields -- maybe as an additional
option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 12:35:00 +00:00
Axel Dörfler 78fa3affbc * Overlay on the G33 does not work anymore in the secondary ring buffer;
we now always only use the primary ring buffer.
* Removed secondary ring buffer allocation and member fields.
* Increased size of the primary ring buffer to 65536 bytes.
* The bytes per row register is computed differently for 9xx chips.
* On G33, the overlay does not need a physical address anymore, so we
  don't pass B_APERTURE_NEED_PHYSICAL to the allocation anymore for that
  device.
* intel_free_memory() accidently added the aperture base to the allocation
  and would therefore never free any memory.
* INTEL_RING_BUFFER_SIZE_MASK was shifted one bit to the right, didn't
  cause any harm with our buffer sizes, yet, though.
* With these changes, the driver runs stable on a G33 chipset (I have not
  yet tested the hardware cursor, though, it might need some work, too).
  The only known issue left is that overlay flickers a bit if its buffer
  is partially backed up by reserved and allocated memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23798 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 18:28:48 +00:00
Axel Dörfler 103d05f3c2 * Renamed GART's deallocate_memory() to free_memory().
* Removed "physical" parameter of GART's bind_aperture() - I don't think this
  be of use to anyone.
* Fixed binding/unbinding pages in the Intel GART driver; I accidently shifted
  the page offset twice.
* Actually forgot handling of allocated memory in Aperture::BindMemory().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23796 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 17:54:23 +00:00
Axel Dörfler 3cec75dc33 * Debugger modules now have two methods: enter_debugger() and exit_debugger().
* The kernel now opens up to 8 debugger modules (and puts them into an array;
  maybe we'll want to switch to a doubly linked list when there is the need).
* Implemented an example debugger module that prints a stack trace of the
  current thread when the kernel debugger is entered (not included in the
  image).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 12:25:43 +00:00
Axel Dörfler 1c34b9b1f5 Work in progress (might not work for you yet):
* Now uses the AGP GART module for memory management. This greatly simplifies
  the memory handling, and memory is now actually allocated on demand,
  instead of a fixed size (stolen memory is not freed, though).
* The Intel GART module should now also work with older chipsets.
* No longer remove the GTT size from the stolen memory; this appears to have
  been a mistake in the X driver. Not sure about the BIOS popup yet.
* The AGP module (in combination with the Intel GART module) is now mandatory
  to use the Intel driver.
* Removed now superfluous settings (like memory size). Only enabling/disabling
  the hardware cursor is still supported.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-29 08:55:36 +00:00
Axel Dörfler 7019a43544 * Added B_NOT_SUPPORTED.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-28 17:38:28 +00:00
Philippe Houdoin 46b5cc220a Corrected GLRenderer's instantiation function name.
(I guess frenchies are guilty here, as mmu_man's ThemeAddOn have the same disease...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23757 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-26 22:51:51 +00:00
Axel Dörfler 3adccb1935 * More or less completely rewrote the AGP bus manager.
* It now also serves as a generic GART manager and accepts bus modules as well
  as custom modules of graphics drivers if they want to (could be used for the
  Radeon PCI GART stuff, for example).
* Implemented GART support module for Intel i965 and G33 chipsets (the other
  Intel chips will come later).
* Renamed agp bus manager to agp_gart to reflect its new functionality (even
  though the AGP functionality is already outdated (due to PCIe), the GART
  stuff remains current).
* Adapted existing users of the AGP bus manager to the API changes.
* Not very well tested yet...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-26 22:18:52 +00:00
Axel Dörfler d75c88206e * Simplified usage of the INTEL_TYPE_xxx constants.
* Added some defines needed when playing with the bridge controller.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-26 21:59:02 +00:00
Stefano Ceccherini f095b4556b for some reason, BDirectWindow apps compiled with the r5 headers don't
work on haiku... let's start reverting some headers changes I did, 
although these don't look harmful.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-25 10:43:58 +00:00
Stefano Ceccherini 0e6fdcf676 Added back BGLScreen declaration. On second thought, we might want to
move it to its own file, but it's not implemented yet... we'll see.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-24 13:05:21 +00:00
Stefano Ceccherini 455a252e0d rewrote GLView.h (left out BGLScreen for now, will integrate it later),
adapted GLView.cpp to the new variable naming scheme.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23716 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-24 12:55:38 +00:00
Axel Dörfler 4dfa9e425f Some work in progress:
* set_gtt_entry() used the wrong index to fill the GTT - this could have never
  worked correctly when you specified more memory than the amount of stolen
  memory.
* Implementing maintaining resources for emulating overlay using the 3D engine
  on i965. I don't yet commit the actual overlay code, as that is a) ugly, and
  b) does not work yet.
* Moved AreaKeeper into its own header.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-23 17:50:27 +00:00
Ingo Weinhold 325b88a661 * Introduced debugger command flag B_KDEBUG_DONT_PARSE_ARGUMENTS.
For commands with this flag set, the parser won't parse the
  arguments provided (it will only check for matching parentheses and
  brackets), but will pass the unparsed argument list string to the
  command instead.
* Set the new flag for the "expr" command, so one doesn't have to quote
  the expression to evaluate anymore (or put it in parentheses).
* Fixed tokenizing of quoted and unquoted strings in expression mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 23:25:34 +00:00
Axel Dörfler 4a67038e56 * Added a new function hash_insert_grow() that grows the hash table when needed.
* Removed the public hash_grow() function again (at least for now, it's only
  private).
* Removed the newSize argument from hash_grow(); it will compute the new size
  automatically.
* The block cache is now using hash_insert_grow() instead of hash_insert()
  which should make hash lookups much faster with some 10 thousand blocks,
  also increased the initial table size from 32 to 1024...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 19:57:40 +00:00
Ingo Weinhold b4f58d8758 Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:29:00 +00:00
Ingo Weinhold a54c125e37 Added experimental ktrace_[v]printf() functions to libroot. Their output
is recorded in a kernel trace entry (if tracing is enabled).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:10:05 +00:00
Ingo Weinhold 64fe37ee89 * AbstractTraceEntry records the team ID too, now.
* Added "printteam" switch to "traced" command, enabling the printing of
  the team ID.
* Added "team" filter to the "traced" command expression language.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 13:31:27 +00:00
Ingo Weinhold 6d36996620 * Fixed my fix for make_space() wrapping. It's always a good idea to
write code aligned to what one has written in the comment (or the
  other way around).
* Made trace_entry structure doubly linked, by introducing a
  previous_size member. By using bit fields, shrinking the flags field
  to 4 bits, and not saving the lower two bits of size and previous_size
  (which are always 0 due to alignment), the structure remains 4 byte
  sized and can still address the same entry size.
* kBufferSize is no longer one less than it could be.
* "traced" command:
  - Use static variable for the iteration state rather then cluttering
    the temporary debug variable name space.
  - The <count> parameter can now be negative, in which case the entries
    before (and including) <start> are printed.
  - Added a new optional parameter, specifying the maximal number of
    entries to be filtered. Filtered iteration is beautifully
    comfortable now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 00:41:45 +00:00
Ingo Weinhold 902425896d Made kputs() available in the kernel and used it for printing debugger
command usage texts, which can be too long for kprintf().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 00:15:33 +00:00
François Revol 1778540a37 Cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 22:01:33 +00:00
François Revol 93b4dee849 * Add NeXT platform.
* Add platform methods for timer as it is platform dependent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 21:30:59 +00:00
Stefano Ceccherini 9c76ea4c52 Applied patch by Alexander Deckner (with a few small changes by myself):
Implemented palette mode and fixed bugs listed at ticket #1701. Thanks 
for your work!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 21:20:12 +00:00
Jérôme Duval 3d239d7451 added missing include
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 17:21:01 +00:00
Stephan Aßmus 23108d8b57 * include StorageDefs.h for convenience, otherwise stuff like B_READ_ONLY
is not defined if you just include File.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 14:44:02 +00:00
Ingo Weinhold 4c4b14c3bb The "traced" command can now be passed a filter expression consisting of
boolean operators ("not", "and", "or") and filters matching thread IDs
or contained strings.
I'm still not fully happy with the command. It should be possible to
define a filter and then comfortably scroll through the matching
entries. Currently having to specify an index range of the unfiltered
entries is rather unhandy in combination with filtering.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 00:34:37 +00:00
Ingo Weinhold f7a5d9c583 Changed TraceEntry::Dump() to take a TraceOutput& and removed
AbstractTraceEntry::AddDump(char*, size_t).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 22:23:32 +00:00
Jérôme Duval ec1315c2ea added arch_commpage.h for the m68k arch (copied on x86)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 18:16:45 +00:00
Ingo Weinhold ab23dfa7f7 Moved tracing macro definitions into separate tracing_config.h header.
So now there's a central place to enable tracing in general and for
individual components.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 17:24:34 +00:00
Ingo Weinhold 2477bce504 Added support for userland symbol lookup in "sc" and "call". Having
used it for an hour or so, I really wonder how we could live without it.
:-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 16:33:03 +00:00
Jérôme Duval 907f26dbb5 added a arch_commpage.h header for ppc, dunno if it needs to be changed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 15:43:45 +00:00
Jérôme Duval 8164606d77 fix a warning
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 14:26:59 +00:00
Ingo Weinhold f1047a1c3e Introduced helper class TraceOutput that represents an output buffer
and added AbstractTraceEntry::AddDump(TraceOutput&) method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 22:15:30 +00:00
Ingo Weinhold 19101ba0f4 Generate a kernel array kSyscallParametersInfos containing information
about syscall parameters. Particularly interesting is a type_code field
for each parameter. The mechanism isn't very accurate, but we can
classify everything in string, pointer, and integer types.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 19:25:28 +00:00
Axel Dörfler 5d0afa4e4e * cache_detach_sub_transaction() didn't really work: it did not put all needed
blocks into the new transaction, but it would set that transaction on all
  blocks of the old transaction, too. Also, it did not correctly update the
  num_blocks/sub_num_blocks fields of the old transaction. Even worse, it did
  return B_OK instead of the ID of the new transaction...
* get_writable_cached_block() did not correctly maintain the number of blocks
  in the sub transaction.
* write_cached_block() did not free the original_data of a block when it wrote
  it back as part of a previous transaction.
* Changed "cookie" for cache_next_block_in_transaction() to "long", so it will
  be 64 bits when needed.
* Improved the API for detaching sub transactions: you can now get the blocks
  of only the main (parent) transaction as well, added new
  cache_block_in_main_transaction() function.
* BFS now flushes the log when there is no space left for the current
  transaction.
* _WriteTransactionToLog() allocated a "vecs" array, but never freed it.
* _WriteTransactionToLog() now also supports detaching the current sub
  transaction if the whole thing is getting too large (it will now also panic
  if that doesn't work out).
* Removed a useless optimization: making the blocks available in the cache
  isn't really needed, as all blocks in a transaction are locked into the
  cache, anyway.
* Implemented Transaction::WriteBlocks().
* Minor cleanup, removed some dead code, fixed warnings in the fs_shell's
  block_cache when compiled with debug output on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 17:07:18 +00:00
Ingo Weinhold bd0689e668 Added usage message to "cvar" and "cvars" debugger commands and define
temporary variables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-17 23:22:29 +00:00
Ingo Weinhold 0b60583fec Added convenience functions alloc_tracing_buffer_{memcpy,strcpy}().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-17 01:58:08 +00:00
Ingo Weinhold 8a90d12e26 * Added add_debugger_command_etc() which is similar to
add_debugger_command(), but additionally takes parameters "usage"
  and "flags".
* Added add_debugger_command_alias() which creates another name for an
  existing command.
* Added print_debugger_command_usage() to print a command's usage.
* invoke_debugger_command() intercepts invocations with "--help" and
  prints the command's usage text, if it is known. If unknown, the
  command will be called normally.
* Made use of the new functions in debug.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 23:41:20 +00:00
Ingo Weinhold 1839792524 Change parse_expression() return value from uint32 to uint64.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 22:55:39 +00:00
Ingo Weinhold 06f78e9fb7 * Changed the way temporary variables work. They won't be unset before
a command is executed anymore. Instead the least recently used
  temporary variable is overwritten, if there's no free slot for a new
  temporary variable.
* Removed the special handling for the command result variable ("_"). It
  just works like any other temporary variable, now.
* Individual temporary variables can be removed (e.g. using the "unset"
  command).
* Added unset_all_debug_variables() and "unset_all" command to unset
  all persistent and temporary variables.
* Removed remove_all_temporary_debug_variables and renamed
  remove_debug_variable() to unset_debug_variable().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 21:50:59 +00:00
Axel Dörfler c6ee79ce38 * vm_create_anonymous_area() now accepts B_ANY_KERNEL_BLOCK_ADDRESS.
* As a temporary work-around for the current slab allocator's area usage,
  I added the CACHE_LARGE_SLAB flag, which will force the allocator to 
  use larger areas.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 20:30:16 +00:00
Ingo Weinhold 3b4fa1664e * Implemented parse_expression(). The back-end is an expression parser
that is a little more powerful than BeOS'. It features:
  - Persistent and temporary uint64 variables. The former kind is set
    only by the user. The latter (those prefixed "_") can be set
    automatically by commands, thus e.g. making it easier to access
    members of a dumped structure. They are unset when the next command
    is invoked. The special temporary variable "_" is defined as a
    command's return value.
  - Expressions can contain nested command invocations using brackets
    ("[ ... ]").
  - Command lines are parsed by the expression parser, too. They can
    contain command invocations (in brackets) and expressions (in
    parentheses).
* Added debugger commands:
  - expr: Evaluates the given expression and prints the result.
  - unset: Undefines a variable.
  - vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 00:01:20 +00:00
Stefano Ceccherini d01f3af185 Menu tracking now ignores mouse movements if they are too fast
(suggested by stippi). The movement threshold will be subject to 
changes, as I only tested on vmware and it's probably too high.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-15 13:40:13 +00:00
François Revol 82062f804c Works much better when actually allocating the TLS entry...
Now the backend works, Login can list users.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 02:03:34 +00:00
François Revol f9e760ccaa Some more bone compatibility.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 01:58:51 +00:00
Axel Dörfler 4fc4f2c8ae * Added a transaction listener mechanism to be notified when a
transaction ends or has been aborted.
* BFS now listens for transactions when it created an inode to see if 
  the transaction will be aborted without freeing the inode (in which 
  case it will panic for now).
* Started implementing tracing support, but it's not working yet.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 17:18:29 +00:00
Michael Lotz 8c2a9d7433 bonefish+mmlr:
As (our) gcc unfortunately uses atexit() to clean up lazily initialized static
variables inside functions we have to ensure that we do the right thing with
unloadable shared objects. In case a shared object was unloaded that installed
an atexit() hook the application would crash on exit. We now implement a
callback into libroot that is used to call all the atexit() hooks of a
component that is to be unloaded. Most prominently this fixes the media_server
crash at shutdown.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 12:08:34 +00:00
Axel Dörfler 8e43ece8b8 Some more work on the tracing API:
* Added function to allocate space in the buffer.
* Dump() now fills a buffer instead of printing its data directly.
* This allows the new "#pattern" argument of the "traced" command to 
  work. When you're using that, the index of the trace entry is printed
  out, too, so that you can then get a full dump around the hits.
* Added an AddDump() method to the AbstractTraceEntry class so that 
  there is no need to call the inherited function anymore.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 02:50:32 +00:00
Marcus Overhagen f0d174e96f fix comments
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 00:04:40 +00:00
Axel Dörfler 416458e9c4 * Added nothrow to the new operator because otherwise the C++ compiler
will not accept if the allocator returns NULL and crashes instead
  (ie. not compiling in tracing would have crashed if some module tried
  to use it).
* Added total entries count to the KDL command output.
* Fixed computing the start index of the KDL command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 23:55:53 +00:00
François Revol 884c36167c Flag for LPSTOP availability.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 23:55:53 +00:00
Axel Dörfler aa5d2a2df2 bonefish+axeld:
* Implemented an optional tracing layer that can be used in the kernel.
  Nice to use if you don't have serial output or need something that doesn't
  slow down the system as much.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 18:41:35 +00:00
Michael Lotz f82c11c079 bonefish+mmlr:
* Move most of MIME database support out of libbe and into registrar
* Use the (async) MessageDeliverer instead of a synchronous SendMessage in _SendMonitorUpdate

This fixes a deadlock when the message port of a MIME database watching
application gets full as documented in bug #1311.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 22:45:06 +00:00
Stephan Aßmus 374b5544a9 * expose the XOR function for BRegions (for now called "ExclusiveInclude")
which already existed in the region backend ported from XOrg


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 13:42:21 +00:00
Stefano Ceccherini 6e11b3f991 Close the whole menu hierarchy when invoking an item via keyboard. Added
a TODO comment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 12:08:21 +00:00
Ingo Weinhold 34b3b26b3b Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
  it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
  the assembly handler which now uses a jump table to call C functions
  handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
  interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
  rare events (signals, user debug enabling/disabling) on the
  common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
  retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
  the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
  common functions (currently memcpy() only). They are used in the
  kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
  member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
  (caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 00:36:44 +00:00
Axel Dörfler 3e5b9076f9 * Fixed (or rather, worked around) a deadlock in the VM: when a file was
resized but still had dirty pages to be written back, 
  vm_cache_resize() (which is called with the inode lock being held)
  deadlocked with the page writer.
* Now, I reintroduced busy_writing: it'll be set by everything that
  writes back pages (vm_page_write_modified(), and the page writer),
  and will be checked for in vm_cache_resize() - other functions are not
  affected for now, AFAICT.
* vm_cache_resize() will clear that flag, and the writer will check it
  again after it wrote back the page (which will fail when it's outside
  the file bounds), and if it's cleared, it will get rid of the page
  (if the file has been resized again in the mean time, writing it will
  succeed then, and we'll keep the page around).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23334 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-09 22:25:21 +00:00
Axel Dörfler bcb71f00e8 * My last change to vm_page.cpp made an existing bug much more likely to
appear: when freeing a modified page, it wouldn't have a cache
  anymore, but set_page_state_nolock() depended on it.
* To work around this, I added a vm_page_free() function, which the
  caches that free modified pages have to call (but others may, too).
  It will correctly maintain the sModifiedTemporaryPages counter in case
  the cache has already been removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23318 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-09 18:15:28 +00:00
François Revol 1dc0bb774c Avoid empty struct
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-06 00:40:17 +00:00
Jérôme Duval 0f928a18d2 updated mesa to 7.0.2
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-05 16:12:28 +00:00
Stefano Ceccherini 9e64a7ed1b Fixed problem with some popup menus (check ticket #1679)
Moved GetMouse() calls near the check for exit conditions.
Reorganized a bit the code, and hopefully simplified it in some places.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-03 07:30:05 +00:00
Axel Dörfler c88e5e410c * Added support for the G33 line of chips: mode setting and acceleration is working fine AFAICT.
* Implemented mapping the GTT area for i9xx chips other than the i965. This should also fix the
  driver working with these chips at all.
* The memory used by the driver now take the GTT area into account - before the GTT could be
  overwritten theoretically...
* Added fix for some i965 quirks from the X driver.
* Added some overlay definitions for the i965.
* Started support for G33 overlay (not complete yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-02 18:44:39 +00:00
Marcus Overhagen 70eb0da7e0 Mask io-space bit in promise_tx2 driver, the driver was broken after recent ide-adapter changes.
Replaced IDE_ADAPTER_IS_PRIMARY by IDE_ADAPTER_CHANNEL_INDEX to support more than 2 bus master channels,
and made ide_adapter aware of 3rd and 4th channel when calculating bus master dma address.
Fixed bus master DMA support in legacy_sata driver for tertiary and quaternary channel, channel 3 and 4
were using the DMA engine of primary and secondary channels (that might have destroyed your data).
Use PCI_address_io_mask instead of ~PCI_address_space (no functional change).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-01 20:31:14 +00:00
Stefano Ceccherini 921eba6e4d BPrintJob: PrintableRect(), PaperRect() and GetResolution() now call
_LoadDefaultSettings() if no settings were loaded already, in order to 
return valid values. Renamed private methods to fit our guidelines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23204 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-01 15:54:28 +00:00
Michael Pfeiffer 9ffc1f4105 Checked in too soon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23195 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-30 10:33:31 +00:00
Michael Pfeiffer 5d632c2aba - Fixed HW cursor issues:
- in order to set cursor position SVGA_CURSOR_ON_SHOW has to be written to register SVGA_REG_CURSOR_ON. 
  - do not use alpha cursor because it does not support inverting of source pixels.
- Fixed wrong usage of if-statement inside switch-statement
- Sync at end of SCREEN_TO_SCREEN_BLIT so that app_server does not write to frame buffer while accelerated operation is still running.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-30 10:06:46 +00:00
François Revol a78864975b Move mmu definitions to a header so the bootloader can also use them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 14:44:47 +00:00
François Revol 171a03646d Some more fields that helps compiling, but I'll have to sort that out later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 13:01:14 +00:00
François Revol 5eeaf46777 Minimal headers for atari_m68k
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 12:58:32 +00:00
Stefano Ceccherini d73c4e9fb1 Put the code to Extract a replicant into its own function.
BShelf::_AddReplicant() is finally getting acceptable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-28 11:07:28 +00:00
Stefano Ceccherini 898edb5ba7 Split BShelf::_AddReplicant() functionality into smaller methods. Not
yet done, but I hope it's getting better


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-28 10:49:04 +00:00
Marcus Overhagen 882123356b Added more debugging code. The partition code appears to be using objects that have been destroyed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-26 22:26:08 +00:00
Stephan Aßmus 099fb2d3be * removed declarations for methods which are not used/implemented in View.h
* improved naming of some private BView functions and used our underscore
  prefix
* added a _DrawAfterChildren method to BView which does the necessary setup
  and calls the DrawAfterChildren hook
* call the new _DrawAfterChildren method in the BWindow implementation, this
  was easy since the view tokens are already hierachically sorted
* implement support for B_DRAW_ON_CHILDREN in the app_server's ViewLayer, it
  simply means that children are ignored for the views clipping region, any
  drawing methods will paint over children (therefor the B_DRAW_ON_CHILDREN
  flag is even properly named)

With these changes, support for B_DRAW_ON_CHILDREN and the DrawAfterChildren()
hook are implemented and behave exactly as on R5 as far as I can tell, also
for the view background painting.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23154 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-25 14:47:06 +00:00
Axel Dörfler 8818c50507 * Made QueueCommands::Write() and MakeSpace() public.
* Implemented MakeSpace() (not yet tested).
* Changed intel_wait_engine_idle() to spin() between reads and to timeout
  after 1 second of waiting (could probably be done way earlier).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-13 14:56:28 +00:00
Michael Lotz fd0986401e Ignore disabled local APICs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-12 18:39:41 +00:00
Michael Lotz f108445b5e * Initial support for ACPI tables to detect multiprocessor configurations
* ACPI is evaluated first as it also handles things like multi core or hyper threading setups
* Removed other (disabled) hyper threading code per the notes in the corresponding ToDo
* Limit the detected CPU count to 2 for now as I wasn't able to get it working in either emulation nor real hardware with more than 2 CPUs
* Added a reserved byte to the mp_config_table struct, it worked only by luck as the compiler did padding there to get to the same size

I can now boot my Core 2 Quad with two out of four processors active :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-09 21:01:55 +00:00
Axel Dörfler 21885de266 * BFS now always writes back the whole block when it writes the super block.
* Therefore, I've added an I/O control that let's it update the boot block
  part of this block, so that makebootable can use it on a mounted volume
  (this will probably be moved into a disk system API later).
* Added user_memcpy() to the fs_shell.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-08 14:23:35 +00:00
Jérôme Duval d2d6724788 added pthread_once() implementation and tests
there is still a TODO on an init race condition 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-07 21:02:59 +00:00
Jérôme Duval 4ff6af6d52 applied patch by kaliber
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-07 19:30:34 +00:00
Michael Lotz dfa4dfe033 Something else that has been laying around for some time. Implemented hash_grow() that can grow a hash table to a new table size. Automatic growing is commented out in hash_insert() since there needs to be a way to disallow growing in certain cases (i.e. where no allocations can be made). This is detailed in the ToDo at the top of the file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-06 21:58:06 +00:00
Michael Lotz bbea21a256 Forgot the header change in the last commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-06 21:41:08 +00:00
Oliver Ruiz Dorantes d89505dc24 Wrong method name
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-30 19:51:44 +00:00
Ingo Weinhold 92ab20b3a4 Added a list of death_entry's to the teams structure. It stores the
exit status of (non-main) threads of a team. Fixes bug #1644.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-28 00:07:32 +00:00
Axel Dörfler 5845b6ecc5 * The boot loader now remembers the bytes per row as told by the graphics card, and
passes that information on to the kernel. This should fix wrong bytes per row with
  certain resolutions and graphics cards.
* The boot loader now recognizes 15 bit modes that are advertised as 16 bit modes.
  This should fix wrong colors in 16 bit modes on some cards.
* Reenabled setting MTRR for VESA mode - don't remember why I disabled it, but it
  works fine on my test machines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-27 16:33:19 +00:00
Axel Dörfler 3ae3b04bce * The boot loader (bios_ia32 only) now duplicates everything that goes to the
serial output, and puts it into the new kernel_args::debug_output field.
* syslog_init() will now check if there is anything in kernel_args::debug_output
  and will put that into the syslog buffer.
* dump_block() now also prints an offset.
* Fixed warning in mmu.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-27 12:59:34 +00:00