Commit Graph

5748 Commits

Author SHA1 Message Date
Oliver Ruiz Dorantes d923116745 Fix mask and endline style
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-03 21:19:47 +00:00
Ingo Weinhold 5800e8a486 * Moved the page management functionality into its own file.
* Renamed page_queue to VMPageQueue and made it a proper C++ class. Use
  DoublyLinkedList instead of own list code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34874 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-03 17:10:32 +00:00
Ingo Weinhold be7782af0f * Removed DoublyLinkedListLinkImpl constructor. DoublyLinkedListLink doesn't
have one anymore anyway.
* Removed unnecessary setting the list links to NULL after removing a node.
* Replaced "element == NULL" check in Insert() by an assert. This just hid
  potential errors.
* Added Insert{Before,After}() methods and declared the Insert() version
  with the InsertBefore() semantics obsolete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34873 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-03 17:07:56 +00:00
Stephan Aßmus f5088d8f82 Patch by Andreas Faerber:
* Define __BYTE_ORDER for Solaris host.

Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34849 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-02 09:24:57 +00:00
Axel Dörfler 4e8123ba98 * Accidently moved the fdopendir() prototype around.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34839 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-01 18:52:09 +00:00
Axel Dörfler 31e49a2f1d * Implemented missing alphasort(), and scandir() POSIX functions. Completely
untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-01 18:49:55 +00:00
Ingo Weinhold 355dc6bef4 Inlined several VMCache methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-01 17:09:23 +00:00
Ingo Weinhold 1021fd2826 * agp_gart(): Use vm_page_[un]reserve_pages().
* Removed unused vm_page_allocate_pages().
* Removed now unused (always true) "reserved" parameter from
  vm_page_allocate_page().
* Removed unused (always false) "stealActive" parameter from steal_page().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-01 16:37:14 +00:00
Axel Dörfler e30dd2c076 * If the VESA driver remaps the frame buffer on init, it will now also make
sure that the kernel's frame buffer console points to the right data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-01 14:54:41 +00:00
Ingo Weinhold 2ea2527fe4 R/W lock implementation:
* Changed the rw_lock_{read,write}_unlock() return values to void. They
  returned a value != B_OK only in case of user error and no-one checked them
  anyway.
* Optimized rw_lock_read_[un]lock(). They are inline now and as long as
  there's no contending write locker, they will only perform an atomic_add().
* Changed the semantics of nested locking after acquiring a write lock: Read
  and write locks are counted separately, so read locks no longer implicitly
  become write locks. This does e.g. make degrading a write lock to a read
  lock by way of read_lock + write_unlock (as used in the VM) actually work.

These changes speed up the -j8 Haiku image build on my machine by a few
percent, but more interestingly they reduce the total kernel time by 25 %.
Apparently we get more contention on other locks, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-31 17:03:41 +00:00
Ingo Weinhold eb8dc1ebfb * Removed DEBUG_PAGE_CACHE_TRANSITIONS debugging.
* Added VMCache::MovePage() and MoveAllPages() to move pages between caches.
* VMAnonymousCache:
  - _MergeSwapPages(): Avoid doing anything, if neither cache has swapped out
    pages.
  - _MergeSwapPages() does now also remove source cache pages that are
    shadowed by consumer swap pages. This allows us to call _MergeSwapPages()
    before _MergePagesSmallerSource(), save the swap page shadowing check
    there and get rid of the vm_page::merge_swap flag. This is an
    optimization based on the assumption that usually none or only few pages
    are swapped out, so we save a lot of checks.
  - Implemented _MergePagesSmallerConsumer() as an alternative to
    _MergePagesSmallerSource(). The former is used when the source cache has
    more pages than the consumer cache. It iterates over the consumer cache's
    pages, moves them to the source and finally moves all pages back to the
    consumer. The final move is relatively cheap (though unfortunately we
    still have to update all pages' vm_page::cache field), so that overall we
    save iterations of the main loop with the more expensive checks.

The optimizations particularly improve the common fork()+exec*() situations.
fork() uses CoW, which is implemented by putting two new empty caches between
the to be copied area and its cache. exec*() destroys one copy of the area,
its cache and thus causes merging of the other new cache with the old cache.
Since this usually happens in a very short time, the old cache does still
contain many pages and the new cache only few. Previously the many pages were
all checked and moved individually. Now we do that for the few pages instead.

A very extreme example of this situation is the Haiku image build. jam has a
huge heap (> 200 MB) and it fork()s+exec*()s for every action to be executed.
Since during the cache merging the cache is locked, any write access to a
heap page causes jam to block until the cache merging is done. Formerly that
took so long that it killed a lot of parallelism in multi-job builds. That
could be observed particularly well when lots of small actions where executed
(like the Link, XRes, Mimeset, SetType, SetVersion combos when building
executables/libraries/add-ons). Those look dramatically better now.
The overall speed improvement for a -j8 image build on my machine is only
about 15%, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34784 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-27 16:14:13 +00:00
Ingo Weinhold 6afe50d424 * Added assignment operators.
* Some automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-27 15:19:17 +00:00
Ingo Weinhold 2e74d74f4f * Added method VMCache::TransferAreas() moving areas from one cache to
another. The code originates from vm_copy_on_write_area(). We now generate
  the VM cache tracing entries, though.
* count_writable_areas() -> VMCache::CountWritableAreas()
* Added debugger command "cache_stack" which is enabled when VM cache tracing
  is enabled. It prints the source caches of a given cache or area at the
  time of a specified tracing entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-22 22:00:35 +00:00
Colin Günther cfcee452a4 Whitespace cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34748 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-22 16:53:28 +00:00
Ingo Weinhold a38f850360 * arch_debug_get_stack_trace():
- Replaced the "userOnly" parameter by a "flags" parameter, that allows to
    specify kernel and userland stack traces individually.
  - x86, m68k: Don't always skip the first frame as that prevents the caller
    from being able to record its own address.
* capture_tracing_stack_trace(): Replaced the "userOnly" parameter by
  "kernelOnly", since one is probably always interested in the kernel stack
  trace, but might not want the userland stack trace.
* Added stack trace support for VM cache kernel tracing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34742 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-22 15:15:07 +00:00
Ingo Weinhold 1fde952c1d DefaultNotificationService:
* Added Lock()/Unlock() for explicit locking by a service user.
* Added NotifyLocked() and made Notify() inline.
* Added HasListeners() so one can check whether there is a listener at all
  before preparing the event message.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34736 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-21 20:56:50 +00:00
Ingo Weinhold 97eaabdfb0 Also allow gcc 3 as the host compiler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-20 13:07:43 +00:00
Ingo Weinhold 189010cbc2 Added support for I/O scheduling events to the system profiler interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-19 14:33:29 +00:00
Axel Dörfler 861f2ade03 * Rewrote header.
* Cleaned up private method names as much as possible (it's probably not a good
  idea to rename BStatable::set_stat() for compatibility reasons).
* Cleaned up sources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-18 15:05:37 +00:00
Ingo Weinhold 0338371f26 * All scheduler implementations:
- enqueue_in_run_queue() no longer returns whether rescheduling is supposed
    to happen. Instead is sets cpu_ent::invoke_scheduler on the current CPU.
  - reschedule() does now handle cpu_ent::invoke_scheduler_if_idle(). No need
    to let all callers do that.
* thread_unblock[_locked]() no longer return whether rescheduling is supposed
  to happen.
* Got rid of the B_INVOKE_SCHEDULER handling. The interrupt hooks really
  can't know, when it makes sense to reschedule or not.
* Introduced scheduler_reschedule_if_necessary[_locked]() functions for
  checking+invoking the scheduler.
* Some semaphore functions (e.g. delete_sem()) invoke the scheduler now, if
  they wake up anything with greater priority.
  I've also tried to add scheduler invocations in the condition variable and
  mutex/rw_lock code, but that actually has a negative impact on performance,
  probably because it causes too much ping-ponging between threads when
  multiple locking primitives are involved.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-13 21:18:27 +00:00
Jérôme Duval fe69204315 added more missing prototypes in math.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-13 16:35:25 +00:00
Jérôme Duval 0270440a97 added missing prototypes for fmin, fma, fmax functions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-13 16:22:56 +00:00
Ingo Weinhold 4c06f2b600 Added boolean deleteIfOwning parameter to MakeEmpty().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-12 18:17:15 +00:00
Ingo Weinhold b4be7c9021 * Added cpu_ent::running_thread which is maintained by the schedulers.
* simple_smp scheduler: Rewrote the interesting part of
  enqueue_in_run_queue(). It always selects a target CPU for the inserted
  thread, now. If no CPU is idle, the CPU running the thread with the lowest
  priority is chosen. If the thread running on the target CPU has a lower
  priority than the inserted one, it will be asked to reschedule. If that's
  the current CPU, we'll return the correct value (wasn't done before at
  all).
  These changes help reducing latencies. On my machine in an idle system
  playing music DebugAnalyzer shows maximum latencies of about 1 us. I still
  find that a bit much, but it's several orders of magnitude better than
  before. The -j8 Haiku image build time dropped about 10%.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-11 19:06:57 +00:00
Colin Günther 281f1ab86c Choosing an even number for SIOCEND as suggested by François. Thank you.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-10 20:51:26 +00:00
Colin Günther b56f3c65ff Add two more socket ioctl's as they are needed by the aironet (if_an.c) and
wavelan (if_wi.c) drivers I'm currently porting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34617 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-10 15:46:37 +00:00
Ingo Weinhold 3533b6597d * Reintroduced the SMP_MSG_RESCHEDULE_IF_IDLE ICI message. This time
implemented by means of an additional member in cpu_ent.
* Removed thread::keep_scheduled and the related functions. The feature
  wasn't used yet and wouldn't have worked as implemented anyway.
* Resurrected an older, SMP aware version of our simple scheduler and made it
  the default instead of the affine scheduler. The latter is in no state to
  be used yet. It causes enormous latencies (I've seen up to 0.1s) even when
  six or seven CPUs were idle at the same time, totally killing parallelism.
  That's also the reason why a -j8 build was slower than a -j2. This is no
  longer the case. On my machine the -j2 build takes about 10% less time now
  and the -j8 build saves another 20%. The latter is not particularly
  impressive (compared with Linux), but that seems to be due to lock
  contention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-10 11:54:38 +00:00
Colin Günther ccc02f719a * Moved socket ioctls from FreeBSD compat layer into the corresponding Haiku
header. This shall ensure uniqueness of the ioctls.
* Added a special SIOCEND define to Haiku's sockio.h, so that drivers can define
  private ioctls as can be seen in src/add-ons/kernel/drivers/network/wlan/atheros/dev/ath/if_athioctl.h.
* Modified ioccom.h of the FreeBSD compat layer, to make use of the special
  SIOCEND define.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34612 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-10 11:11:03 +00:00
Ingo Weinhold e973f15a44 Missing includes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 17:56:24 +00:00
Clemens Zeidler 5237897801 Check if we have 64 or 32 bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 17:49:20 +00:00
Axel Dörfler 6cafce94b5 * Moved the port pool into the new request_data.cpp file; it's no longer
accessible from the outside.
* Instead, request_data now retrieves/releases a reply port on its own.
* There were some more places that still used write_port()/read_port() instead
  of QueryServer().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 17:40:45 +00:00
Axel Dörfler e4c87231a3 * Renamed the xfer_* structures to fit the rest, and let them inherit from the
usual structures.
* Also, they now use the QueryServer()/SendToServer() functions instead of
  duplicating them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 17:17:01 +00:00
Axel Dörfler 5f207b83ae * Moved all server interface definitions from DataExchange.h to
ServerInterface.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 16:57:22 +00:00
Axel Dörfler 1fcbc5470b * More cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 16:48:49 +00:00
Axel Dörfler 9c3b4706dd * Cleaned up the node manager, got rid of its use of Map, and List.
* Fixed at least two reference counting problems, but nodes from killed teams
  still remain alive (will look into this at a later point).
* GetLiveNodes() is now using transfer_area() as well.
* Made all sizes in the SendTo*() and Query*() functions size_t.
* Replaced reinterpret_casts with static_casts when casting void pointers.
* Ordered the request/reply structures by target.
* Tried to consolidate the use of add_on vs. addon.
* More cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-09 16:22:24 +00:00
Axel Dörfler c28dd9fdc3 * Implemented getting/setting the audio gain of media files.
* Renamed "remove_ref_for" command structures and constants to
  "invalidate_item".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-08 19:56:04 +00:00
Axel Dörfler 7e5d04c543 Beware! The following commit will crash your system when open "Sounds"; I'll
look into this now.
* Renamed the MMediaFilesManager to MediaFilesManager.
* Got rid of its Map usage, we're using std::map now instead.
* The media_server is using an unsafe method to transfer areas from the server
  to the client. I've changed this for the BMediaFiles API to use Haiku's new
  transfer_area() function. However, this seems to cause the above mentioned
  problems.
* Improved naming and data exchange structures used for the BMediaFiles API.
* Fixed BMediaFiles leaking its lists.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-08 14:22:56 +00:00
Ingo Weinhold d8d4b902cb * The system profiler scheduling event structures sport nanotime_ts now.
* Adjusted the DebugAnalyzer to handle nanosecond times.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 22:56:29 +00:00
Ingo Weinhold 34a48c70ef Added type nanotime_t (an int64 storing a nanoseconds value) and function
system_time_nsecs(), returning the system time in nanoseconds. The function
is only really implemented for x86. For the other architectures
system_time() * 1000 is returned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:43:19 +00:00
Axel Dörfler 559a6a891c * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34541 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:32:59 +00:00
Axel Dörfler 9834d875d0 * Rewrote PortPool, and put it into the BPrivate namespace.
* Renamed global variable _PortPool to gPortPool.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:28:08 +00:00
Axel Dörfler 92c66394a2 * Accidently put gDormantNodeManager into the public namespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34539 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:27:21 +00:00
Axel Dörfler 29bb91d6e5 * Cleaned up DormantNodeManager.
* Renamed global variable _DormantNodeManager to gDormantNodeManager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:11:13 +00:00
Ingo Weinhold 522c2f19d4 * Added a simple mechanism to wait for events to VMCache. WaitForPageEvents()
waits for certain events on a given page, NotifyPageEvents() wakes up
  waiting threads respectively.
* Used the new feature instead of condition variables for waiting on busy
  pages. We save publishing and unpublishing of a condition variable whenever
  a page is marked busy. There's only something to do, if there's at least
  one thread waiting in the list of the respective cache. The general
  assumption is that this is only rarely the case and even if it happens,
  there should be only very few threads.
* Added an apparently missing notification in cache_io(). At least I didn't
  see the reason for it not being there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 15:42:08 +00:00
Ingo Weinhold 6440406a59 Style changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 14:28:56 +00:00
Ingo Weinhold be7328a9f6 Moved VMCache related definitions to <vm/VMCache.h>.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 14:14:21 +00:00
Ingo Weinhold e55886c3a3 Make iteration safe. VMKernelAddressSpace::Next() doesn't like NULL pointers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 01:56:01 +00:00
Ingo Weinhold 40cd019ea0 * Renamed VMAddressSpace::ResizeArea{Head,Tail}() to ShrinkArea{Head,Tail}()
to clarify that they never enlarge the area.
* Reimplemented VMKernelAddressSpace. It is somewhat inspired by Bonwick's
  vmem resource allocator (though we have different requirements):
  - We consider the complete address space to be divided into contiguous
    ranges of type free, reserved, or area, each range being represented by
    a VMKernelAddressRange object.
  - The range objects are managed in an AVL tree and a doubly linked list
    (the latter only for faster iteration) sorted by address. This provides
    O(log(n)) lookup, insertion and removal.
  - For each power of two size we maintain a list of free ranges of at least
    that size. Thus for the most common case of B_ANY*_ADDRESS area
    allocation, we find a free range in constant time (the rest of the
    processing being O(log(n))) with a rather good fit. This should also
    help avoiding address space fragmentation.
  While the new implementation should be faster, particularly with an
  increasing number of areas, I couldn't measure any difference in the -j2
  haiku build. From a cursory test the -j8 build hasn't tangibly benefitted
  either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 17:18:04 +00:00
Ingo Weinhold a54549a8cd * AVLTree:
- Renamed to AVLTreeBase and moved it into its own header/source file.
  - Renamed FindClose() to FindClosest().
  - Added CheckTree() method for debugging purposes. It checks the validity
    of the tree.
* Added a templatized class AVLTree which doesn't offer a map-like interface
  like AVLTreeMap, but rather one similar to BOpenHashMap and SplayTree. It
  is more convenient to use, if one wants to store objects that already
  contain the key.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 15:59:37 +00:00
Ingo Weinhold 4fb60da357 Removed the DoublyLinkedListLink constructor and destructor. They are not
necessary and prevent the structures from being used in a union.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 15:47:34 +00:00
Ingo Weinhold 6490c5b621 Fixed __HAIKU_PRI_PREFIX_ADDR definition.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 15:46:03 +00:00
Stephan Aßmus b8ec67f491 * Simplified and optimized a lot the "ToString()" debugging facilities.
* *::Index() is now const, thanks to the BList improvements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34521 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 13:14:45 +00:00
Stephan Aßmus b0850e9ba1 * Code and header indentation cleanup
* Added operator== and !=
 * Added check for list != this in operator=
 * Added HasItem() and IndexOf() versions that take const void*, duplicating
   the code, since I didn't want to introduce another function call in these
   potentially time critical methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 12:44:38 +00:00
Axel Dörfler 2f9ed888a2 * The SharedBufferList is now only cloned once in a team, no longer once for
each buffer, and once for each buffer group.
* Also, SharedBufferList::Get() now gets the area to clone from itself, if
  necessary, the caller no longer has to provide it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-05 11:52:01 +00:00
Axel Dörfler 9dec231042 Sorry for this large commit in advance; it's not really possible to divide this
into smaller parts:

media_addon_server:
* Removed (broken) use of (broken and inefficient) home-brewn Map, and List
  classes. This also fixes a crash on shutdown when used with the malloc_debug
  implementation. It's using stl::vector, and stl::map now instead.

_shared_buffer_list:
* Renamed _shared_buffer_list to SharedBufferList, and put it into the BPrivate
  namespace. Also, made a class out of it.
* Separated shared buffer list creation from cloning.
* Enlarged maximum number of buffers to something that is not that evil, but
  actually uses the space it has (ie. is a useful multiple of
  shared_buffer_info that fills a multiple of B_PAGE_SIZE as much as possible).
* No longer drops into the debugger if the
* The list that is currently used is very inefficient for the features it
  provides though (no change there).

_buffer_id_cache:
* Renamed to BufferCache, and put it into the private namespace
* It now deletes its buffers on deletion; since the BBufferConsumer will be
  gone, too, at this point, there is little chance that there are still buffers
  in use.
* Also, it's now using std::map instead of the (see above) Map class.

BBuffer:
* Got rid of the fBufferID member.

Misc.:
* Got rid of the global "team" variable; the media kit is now using the
  private app kit's current_team() now.
* Added a lot of missing error checks (mostly memory allocations).
* Renamed fields like "flavorid" to flavor_id, renamed "dfi_*" fields to
  something more detailed.
* Moved ServerInterface.h from src/servers/media/ to headers/private/media.
* Notifications.h was not self contained.
* Added missing licenses.
* Lots of cleanups, and coding style fixes.

What this doesn't fix:
* Bug #4954 which started all this (this comes next, though)
* Deinitialization is broken, as the PortPool is uninitialized too early, and
  still used afterwards.
* The strange add-on monitoring code in the media_addon_server


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34500 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-05 11:11:28 +00:00
Ingo Weinhold 2c1886aeae * Added VMArea subclasses VM{Kernel,User}Area and moved the address space list
link to them.
* VM{Kernel,User}AddressSpace manage the respective VMArea subclass now, and
  VMAddressSpace has grown factory methods {Create,Delete}Area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-04 17:07:16 +00:00
Ingo Weinhold e2518ddbb1 Made VMAddressSpace an abstract base class and moved the area management into
new derived classes VM{Kernel,User}AddressSpace. Currently those are
identical, but that will change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-04 14:45:08 +00:00
Ingo Weinhold 38a97b2c36 Moved all knowledge of reserved areas from vm.cpp to VMAddressSpace. It's a
pure address space feature, so it should be handled there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-04 13:33:25 +00:00
Axel Dörfler 4ed344af25 * Moved _SoundPlayNode into the BPrivate namespace and dismissed the '_' prefix.
* Further cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 22:16:54 +00:00
Axel Dörfler 812fde99a1 * When you even already have the typedefs, why wouldn't you want to use them?
* Some cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 19:48:11 +00:00
Ingo Weinhold f69032f22b * Added VMAddressSpace::ResizeArea{Head,Tail}() to adjust an area's base
and size.
* Made VMArea::Set{Base,Size}() private and made VMAddressSpace a friend.
  In vm.cpp the new VMAddressSpace::ResizeArea{Head,Tail}() are used
  instead.
Finally all address space changes happen in VMAddressSpace only. *phew*
Now it's ready to be thoroughly butchered. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34467 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 15:21:18 +00:00
Axel Dörfler 751ce9e228 * Removed the interface fallback from the datalink module's is_local_address().
* Instead, added a new function is_local_link_address() which returns the
  interface with the matching link level address, and can additionally test
  for unconfigured interfaces.
* Merged the two versions of fill_sockaddr_in() together in ipv4.cpp.
* ipv4 now uses the new is_local_link_address() function to figure out whether
  the received packet should be processed or not. This should fix a few DHCP
  issues with multiple and configured interfaces as recently explained on the
  mailing list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34466 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 14:31:39 +00:00
Ingo Weinhold bbd97b4bb4 Made the VMArea fields base and size private and added accessors instead.
This makes it more explicit where the fields are modified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 14:18:24 +00:00
Colin Günther af983c175d Coding style cleanups. Thanks axeld.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 13:05:39 +00:00
Ingo Weinhold f5251d5b60 Added comment regarding use restriction.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 12:47:29 +00:00
Ingo Weinhold 35d940014e * Changed the address space area list to doubly linked. The reason is to
simplify migration of the area management, but as a side effect, it also
  makes area deletion O(1) (instead of O(n), n == number of areas in the
  address space).
* Moved more area management functionality from vm.cpp to VMAddressSpace and
  VMArea structure creation to VMArea. Made the list and list link members
  itself private.
* VMAddressSpace tracks its amount of free space, now. This also replaces
  the previous mechanism to do that only for the kernel address space. It
  was broken anyway, since delete_area() subtracted the area size instead of
  adding it.
* vm_free_unused_boot_loader_range():
  - lastEnd could be set to a value < start, which could cause memory
    outside of the given range to be unmapped. Haven't checked whether this
    could happen in practice -- if so, it would be seriously unhealthy.
  - The range between the end of the last area in the range and the end of
    the range would never be freed.
  - Fixed potential integer overflows when computing addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 12:41:11 +00:00
Colin Günther 1581b764e0 * Adding static Notify{One,All} functions. This allows a cleaner implementation
of the condition variable and synchronization subsystem of the freebsd compat
  layer which will be committed next.
* Also there was a discussion about adding these functions on the commit
  mailing list. The mail in http://www.freelists.org/post/haiku-commits/r34395-in-haikutrunksrclibscompatfreebsd-network-compatsys,3
  is a good sum up of it (need to scroll somewhat down, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 12:24:17 +00:00
Ingo Weinhold f34a1dd5d7 Created VMArea.{h,cpp} and moved VMArea and the global area hash table (new
class VMAreaHash) there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-02 19:55:59 +00:00
Ingo Weinhold e50cf8765b * Moved the VM headers into subdirectory vm/.
* Renamed vm_cache.h/vm_address_space.h to VMCache.h/VMAddressSpace.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-02 18:05:10 +00:00
Ingo Weinhold 90d870c155 * Moved VMAddressSpace definition to vm_address_space.h.
* "Classified" VMAddressSpace, i.e. turned the vm_address_space_*() functions
  into methods, made all attributes (but "areas") private, and added
  accessors.
* Also turned the vm.cpp functions vm_area_lookup() and
  remove_area_from_address_space() into VMAddressSpace methods. The rest of
  the area management functionality will follow soon.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-02 16:12:15 +00:00
Ingo Weinhold fc7864091e Attempt at allowing to use C++ structures in C only code: We use the
CreateAsmStructOffsetsHeader mechanism to generate a header with macros
defined to the sizes of the structures we're interested in and when compiling
in C mode define the structures as "struct { char bytes[size]; }".
It works in principle, but due to how jam works, one would have to specify the
dependency to the generated header for all sources that include it directly or
indirectly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-02 10:56:10 +00:00
Ingo Weinhold a477e3cf20 Finished renaming of vm_cache to VMCache.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 17:45:55 +00:00
Ingo Weinhold a99eb6b56f vm_area -> VMArea
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 17:40:04 +00:00
Ingo Weinhold b0db552cd9 Renamed vm_address_space to VMAddressSpace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 17:27:09 +00:00
Axel Dörfler ccedee2295 * Replaced rtm_* placeholders with a real implementation based on the boot
loader's heap. Unlike the BeBook documents, we always lock their memory,
  though.
* Added Haiku extension rtm_available() that returns how much space is left in
  a pool.
* I've disabled the undocumented functions for now - please open a bug report
  if you encounter them used in applications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34419 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 17:21:46 +00:00
Axel Dörfler 8de72f9d58 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 16:32:48 +00:00
Ingo Weinhold e182b46db6 Since there were no further complaints: Added mutex_lock_with_timeout().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 09:38:34 +00:00
Ingo Weinhold f8ec4c04a0 Initialize BRoster's MIME messenger lazily.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 09:36:23 +00:00
Ingo Weinhold 840be9d6e6 Added __init_once(), an almost exact clone of pthread_once(), with the
difference that the initialization function has an additional void* argument,
so that it is suitable for initializing stuff in objects.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 09:34:58 +00:00
Ingo Weinhold bc0693b219 * Construct the MIME data base directories lazily.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 08:52:13 +00:00
Axel Dörfler 6bb7a8908c * Cleanup, removed author information.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34398 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 07:58:45 +00:00
Axel Dörfler ec1bcf6243 * Added private methods get_app_server_port() (that stores the server port,
and doesn't have to find it every time), and create_desktop_connection() that
  is now used from BApplication::_ConnectToServer() as well as the DesktopLink.
* Move PortLink::SetTo() into base class ServerLink.
* Eliminated duplicated member fReplyPort in DesktopLink.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 07:53:09 +00:00
Ingo Weinhold 4701b640d9 * Give the BClipboard lock a name.
* be_clipboard is no longer created at libbe initialization time. The
  BApplication creates it as done in BeOS. This requires manual
  initialization in the registrar to avoid a deadlock on shutdown.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 17:14:00 +00:00
Ingo Weinhold 240a2c89e8 Removed no longer needed gInitializationLock.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 16:34:13 +00:00
Ingo Weinhold 015943d78f Use pthread_once() to guard the initialization of sPaletteConverter. This
changes the semantics slightly: Previously after a failed initialization
another invocation of InitializeDefault() could theoretically initialize the
converter. Since the only error conditions are out of memory and broken app
server connection, this shouldn't really matter, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 16:26:10 +00:00
Ingo Weinhold 1cbfe2ef6e Moved the static stuff into a singleton.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34376 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 14:43:35 +00:00
Ingo Weinhold 4b9cf09f14 * Got rid of is_running_on_haiku(). It was used for the test environment,
but wouldn't work when running it on Haiku anyway. At any rate, it was
  relatively expensive (uname()) and used already in the libbe
  initialization.
* Got rid of the non-Haiku support of main_thread_for().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 12:14:02 +00:00
Ingo Weinhold 879f9a0937 Got rid of the static app resources lock. We use pthread_once() now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 11:54:30 +00:00
Ingo Weinhold adcb834590 * The WidthBuffer lock was unnecessarily static. Made it an object member.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 11:25:13 +00:00
Ingo Weinhold 4ac097c559 Made the BToolTipManager lock non-static. Create the singleton via
pthread_once().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 11:06:51 +00:00
Ingo Weinhold 258b34c594 * Fixed wrong parameter of lazy_mutex_destroy().
* Split locks.cpp into mutex.cpp, recursive_lock.cpp, and rw_lock.cpp (new
  subdirectory locks/).
* runtime_loader no longer includes the rw_lock, allowing removal of the TLS
  dependency again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34364 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-30 10:29:51 +00:00
Colin Günther 53b11310d4 Needed header to allow compilation of the wlan stack.
Bosii is a transcription of 802.11. It is a work-in-progress title to
point out parts of the wlan stack which are still in an experimental state.
For example the control codes within bosii_driver.h are moving targets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 18:09:33 +00:00
Ingo Weinhold 8bef23107e Added a lazy_recursive_lock implementation -- identical to recursive_lock,
just using a lazy_mutex instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 11:14:50 +00:00
Ingo Weinhold 937b23cb21 Added locking primitive lazy_mutex, which has essentially the same behaviour
as a mutex, but allocates its semaphore lazily. This comes at the cost of an
additional atomic_add() when the semaphore has actually to be acquired, but
saves the semaphore creation completely in single-threaded programs and in
any program when there's no lock contention.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 10:44:07 +00:00
Ingo Weinhold 93b9f21335 Added recursive lock implementation (an adapted kernel version).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-29 09:54:58 +00:00
Oliver Ruiz Dorantes 31f8763031 - Proper implementation of accept/bind l2cap socket interface
- Add more debug info for the KDL debug command
- Request channel pointer also for non l2cap signal frames
- Add locks for packet queues



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34333 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-28 20:03:15 +00:00
Ingo Weinhold 1f3f5ca265 Fixed header guard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 21:10:08 +00:00
Axel Dörfler aeb728e132 * Removed useless legacy header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 18:31:35 +00:00
Ingo Weinhold a492466dad Created new private system header computed_asm_macros.h defining the macro we
use for the asm_offsets.cpp file, so it can be reused elsewhere.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 14:07:05 +00:00
Axel Dörfler b8a73945cf * The kernel's address space is now also a resource that is known to the low
resource manager.
* Could be drastically improved, though, by taking the fragmentation into
  account.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-27 13:03:28 +00:00
Axel Dörfler f4ab5d73ce * This fixes the remaining warnings in exit.c
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 17:00:09 +00:00
Axel Dörfler 3f67d04bc4 * This fixes the "'noreturn' function returns" warning in exit().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:59:46 +00:00
Axel Dörfler 486fffdaaf * Forgot to add linkat(), this really closes #4928 now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:30:16 +00:00
Axel Dörfler fb2500da15 * Added missing AT_EACCESS.
* Implemented renameat(), faccessat(), fchownat(), fchmodat(), and mkfifoat().
* Added stub for mknodat().
* The kernel backend for faccessat() does not yet differentiate between
  effective and real user/group IDs, though.
* Removed B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT, as we now support everything
  (more or less). This also closes ticket #4928.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:17:17 +00:00
Axel Dörfler 64266621a2 * Map O_NOTRAVERSE to rarely used or non portable O_ modes if possible.
* Fixed indentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 16:02:07 +00:00
Axel Dörfler aec945c959 * Removed the O_* modes that we currently don't and probably won't support
(O_MOUNT, O_EXLOCK, and O_SHLOCK). I only left the non-standard O_TEMPORARY
  for the time being (as it shouldn't fool anyone).
* Fixed libutil that already used O_EXLOCK, even though it did not do anything.
* Moved O_NOCACHE, and O_NOFOLLOW to the section with implemented modes.
* Added O_DIRECTORY.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34278 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 14:17:46 +00:00
Ingo Weinhold 318cb33fbf Undefine B_HAIKU_{32,64}_BIT macros before defining them. Fixes warning when
building on Haiku, since those will be defined already -- by way of the host
platform's <BeBuild.h>, which currently is included by the POSIX headers..


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34272 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 10:20:42 +00:00
Ingo Weinhold a1fb0cb3ed Renamed headers/build/config to headers/build/config_build, so it doesn't
shadow the host platform's <config/...> headers anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-26 10:18:13 +00:00
Ingo Weinhold 6236ae8570 Also include HaikuBuildCompatibility.h on a Haiku host platform and
conditionally define some of the new stuff there. That fixes the build under
a r34172 Haiku, though it also causes some problems that needed working around.
Haven't tested under newer Haiku revisions yet. Will do tomorrow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 23:48:45 +00:00
Ingo Weinhold fff4c66437 Also define a B_HAIKU_32_BIT.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 23:44:23 +00:00
Ingo Weinhold 7870a9ffc7 Updated the messaging related build platform code with the current Haiku
version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 21:34:59 +00:00
Ingo Weinhold d1456cc2de Added new [FSSH]_B_HAIKU_{32,64}_BIT macros.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 21:21:58 +00:00
Ingo Weinhold abb72bec4b Fixed __HAIKU_ARCH for m68k.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 19:38:09 +00:00
Ingo Weinhold 4d8a54be0d Updated the resources support with the unmodified Haiku version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34251 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 17:19:14 +00:00
Ingo Weinhold d3ed58a7c9 Added ELF64 support to BResources.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 17:14:29 +00:00
Axel Dörfler 1ba04177d3 * load_image() now has exec() semantics wrt file descriptors; before each team
would always inherit them all, causing quite a number of open files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 16:16:22 +00:00
Ingo Weinhold ff4d0f1c92 * Style cleanup.
* Removed AutoDeleter class and use the shared one instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 15:00:40 +00:00
Axel Dörfler 4d89dfc712 * Completely rewrote the ChunkCache - the previous version had some issues with
regards to locking and seeking.
* Furthermore, we now not only cache 4 chunks, but chunk up to a certain
  memory size (MediaExtractor uses 1 MB for now).
* Since I still have occasional hickups, it looks like this wasn't the main
  cause for our audio problems. Still, this will reduce drive access
  considerably during play.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 14:24:52 +00:00
Ingo Weinhold cf844822db * Added B_PRIdTIME and B_PRIiTIME macros (for time_t).
* Added FSSH_[S]SIZE_MAX to headers/private/fs_shell/fssh_types.h.
* Fixed various 64 bit compiler warnings. Nothing too serious, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 12:02:20 +00:00
Axel Dörfler 608d959d73 * ChunkCache::fLocker is now aggregated.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 11:51:24 +00:00
Ingo Weinhold b20286c41c For the time being go with BeOS compatible types for all but 64 bit
architectures. Fixes the PPC build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 09:44:38 +00:00
Ingo Weinhold a8a03488b1 * Don't even try to use the BeOS compatible types on the build platform.
That's just leading to problems.
* Fixed various 64 bit warnings when building libbe_build.so. One of the more
  serious issues, that might bite us, is that 64 bit Linux defines dev_t to
  unsigned long, while Haiku code assumes that it is signed and 32 bit. We'll
  see...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34227 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 23:36:10 +00:00
Ingo Weinhold 045852f952 Forgot the search and replace step after the copy and paste.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 23:01:22 +00:00
Ingo Weinhold b23206b6e4 * Fixed operator<<() versions clashing with 64 bit compilers.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 22:55:52 +00:00
Ingo Weinhold a1f8d8a11c Updated the build versions of <BeBuild.h> and <SupportDefs.h>. Copied
modified versions of the new config headers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 22:50:55 +00:00
Ingo Weinhold 0fde9192c9 Fixed indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 20:30:01 +00:00
Ingo Weinhold d71135d687 Fixed typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 20:20:10 +00:00
Ingo Weinhold 2222d0559d * Introduced new header directory "config", which ATM contains HaikuConfig.h
and types.h. The idea is to provide a basic architecture/compiler
  abstraction by defining types and macros that allow the posix/ and os/
  headers to be mostly architecture/compiler agnostic. 
* Adjusted the posix/ and os/ headers accordingly.
* <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI*
  and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int*
  types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX
  macros. Also the B_PRI* and B_SCN* macros are available unconditionally,
  unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be
  defined in C++ mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 19:44:07 +00:00
Ingo Weinhold b5a20f9d11 Removed headers and sources not needed for build platform version for libbe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 18:59:40 +00:00
Ingo Weinhold a85cf9d793 * configure: Pass gcc's host machine string to the jam build system.
* BuildSetup: Set jam variable HOST_PLATFORM_IS_64_BIT and add host define
  HAIKU_HOST_PLATFORM_64_BIT if the host platform is 64 bit. Removed the
  check from BeOSBuildCompatibility.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34211 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 18:57:49 +00:00
Axel Dörfler 15fe75b9a0 * Added a protocol version field to AS_GET_DESKTOP. This should be bumped after
incompatible releases, and makes sure clients using the old libbe.so will be
  rejected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34210 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 17:22:44 +00:00
Axel Dörfler 5472c0c23e * The VESA driver now tries to find the PCI card that it is controlling by
checking the physical frame buffer location.
* This allows us to map the whole frame buffer at once, which means there is no
  need anymore to remap the memory on mode change.
* Also, this will ease the burden of the MTRRs, as the memory size will be
  properly aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 15:26:52 +00:00
Clemens Zeidler d503f2628b Forget ACPI.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34202 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-23 21:31:18 +00:00
Ingo Weinhold bb163c0289 * Added a set_mtrrs() hook to x86_cpu_module_info, which is supposed to set
all MTRRs at once.
* Added a respective x86_set_mtrrs() kernel function.
* x86 CPU module:
  - Implemented the new hook.
  - Prefixed most debug output with the CPU index. Otherwise it gets quite
    confusing with multiple CPUs.
  - generic_init_mtrrs(): No longer clear all MTRRs, if they are already
    enabled. This lets us benefit from the BIOS's setup until we install our
    own -- otherwise with caching disabled things are *really* slow.
* arch_vm.cpp: Completely rewrote the MTRR handling as the old one was not
  only slow (O(2^n)), but also broken (resulting in incorrect setups (e.g.
  with cachable ranges larger than requested)), and not working by design for
  certain cases (subtractive setups intersecting ranges added later).
  Now we maintain an array with the successfully set ranges. When a new range
  is added, we recompute the complete MTRR setup as we need to. The new
  algorithm analyzing the ranges has linear complexity and also handles range
  base addresses with an alignment not matching the range size (e.g. a range
  at address 0x1000 with size 0x2000) and joining of adjacent/overlapping
  ranges of the same type.

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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34197 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-23 15:06:08 +00:00
Jérôme Duval 2795d5dca5 Play startup sound after the first defaults rescan is done. This fixed #1902.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-22 16:26:12 +00:00
Jérôme Duval b7b67e723a correctly ordered
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-21 15:26:19 +00:00
Jérôme Duval 8684e35ad7 added wcsdup to wchar.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34169 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-21 08:39:38 +00:00
Ingo Weinhold 4d7a736bbf Some more style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 13:57:20 +00:00
Ingo Weinhold 0d1fab522b * Added flag KMESSAGE_CLONE_BUFFER, which will cause buffer passed to SetTo()
to be cloned.
* Added "flags" parameter to the SetTo(const void*,...) version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 13:52:23 +00:00
Ingo Weinhold 395fb0895f Style cleanup. No functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 11:04:12 +00:00
Ingo Weinhold c77f643a2b Added support for in-kernel node monitoring ({add,remove}_node_listener()).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 07:59:09 +00:00
Ingo Weinhold 9837ec16c8 Fixed spelling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34144 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-20 07:10:23 +00:00
Ingo Weinhold f0a0bca5bb Should have been part of r34137. Request definitions for the new I/O request
functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34139 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-19 16:33:52 +00:00
Ingo Weinhold 1ca0b78f54 Extended the public I/O request C API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-19 07:38:33 +00:00
Axel Dörfler 09749e95dc * Added a BWindow::InViewTransaction() that determines whether or not the
window is currently updating its drawings as suggested by Stippi.
* Add this method to decide whether to call _FontChanged() in
  BListView::SetFont().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-18 10:48:44 +00:00
Stephan Aßmus d0f1a68746 Added method BlockSize() to get the block size of the underlying file system.
Untested but with good chances to actually work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-18 09:47:42 +00:00
Bruno G. Albuquerque 7d911b2ad9 - Coding style fixes. Thanks Axel for the heads up.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34097 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-17 16:13:00 +00:00
Bruno G. Albuquerque ada17216f9 - Added wait3() and wait4() to the bsd compatibility library.
- Untested, but should work (will test it when I get home later today).
- This is my first attempt at adding something for compatibility reasons. Let
  me know if something in wrong.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34091 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-17 15:53:17 +00:00
Rene Gollent f4dc59983b Partially implement ticket #4916:
- Rename "Configure Favorites..." to "Edit Favorites...".
	- Remove the old-style Configure Favorites dialog in favor of simply
	  opening the favorites folder (~/config/settings/Tracker/go) in a
	  Tracker window for the user to manipulate.
	- Rename the "Favorite Folders" section to simply "Favorites" as files
 	  are also allowed (i.e. to easily open a template document).
 	- Removed completely arbitrary (and silent) 20 item limit to favorites
 	  list.
 	- Automatic whitespace cleanup
Still to do: Grab the ref filter from the file panel (if any) and run the
favorites through it as well, since we want to filter out any non-folder
favorites that the app is incapable of handling. Also, the setting for
the favorites menu to show recent documents needs a new home, as it was
previously in the no longer existing Configure Favorites window. Suggestions
welcome, as I'm not currently seeing a spot in the Tracker prefs that would
make good sense.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-16 01:07:40 +00:00
Oliver Ruiz Dorantes b2ebb71755 File not yet ready, revert
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-13 22:09:00 +00:00
Oliver Ruiz Dorantes 02d67528b5 Add class to handle all code values to be sent in the ports
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34024 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-13 22:03:33 +00:00
Ingo Weinhold 050aa61bd6 Implemented a tool ("package") that implements creation and extraction of
packages of the newly invented Haiku Package format
(http://dev.haiku-os.org/wiki/PackageFormat). It basically works, but it's
still work in progress (e.g. compression is not implemented yet), as is the
format itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-13 13:45:49 +00:00
Jérôme Duval ce80623dff added some definitions in termios.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-12 23:49:58 +00:00
Ingo Weinhold 6c00aabc9e Implemented POSIX.1-2008 functions unlinkat(), symlinkat(), mkdirat(),
utimensat(), and futimens().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-12 19:14:42 +00:00
Axel Dörfler e629da4a47 * Changed parameter back to socklen_t (which follows POSIX, but not RFC 2553;
obviously POSIX got it wrong, as socklen_t hardly makes sense here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-11 17:03:34 +00:00
Axel Dörfler 119371a51e * Rewrote arpa/inet.h header, also dropping the __inet* defines.
* Resurrected the __inet* prefix for binary compatibility with older Haiku
  versions - this could be a temporary solution in case we want to export the
  inet_* functions not just as weak symbols. In that case, the __inet* versions
  would be dropped.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-11 14:28:18 +00:00
Axel Dörfler 338cf53758 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-11 14:26:11 +00:00
Axel Dörfler 8e4966ebca * Applied patch by Adrian to fix the command structures used for the media
server with GCC4 in a GCC2 system (and vice versa). See #4920 which this
  patch closes, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33997 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-11 09:16:32 +00:00
Ingo Weinhold db2b554fa3 Moved the POSIX *at() functions and AT_* macros out of the default namespace
as long as the full set hasn't been implemented. They are guarded by the
B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT macro until then. Fixes the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 17:12:03 +00:00
Axel Dörfler b299a6e9d3 * Moved resolv.conf to /boot/common/settings/network/.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33989 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 16:42:03 +00:00
Ingo Weinhold a6147679a3 Added AT_SYMLINK_[NO]FOLLOW constants and fstatat(). Fixes the findutils
gnulib build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 14:51:25 +00:00
Axel Dörfler 492dd892ce * Removed /system/etc directory.
* /etc now points to /boot/common/etc/, and the remaining contents of the former
  "etc" are put there now, as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 14:26:42 +00:00
Axel Dörfler f9a80fec95 * LocaleRoster.h was not self-containing.
* Moved the locale stuff to the data directory as well (some parts were in /etc).
* The DefaultCatalog will now also scan the user directory for catalogs.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 13:44:22 +00:00
Ingo Weinhold b189a2014e Added readlinkat().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 11:24:46 +00:00
Ingo Weinhold 098906f1d4 * src/system/libroot/posix: Moved open.c and fcntl.c out of the unistd
directory, where they were misplaced, and joined them to fcntl.cpp.
* Added openat().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 11:15:35 +00:00
Ingo Weinhold 9e81ddee87 * Fixed fdopendir(): We have to explicitly (re-)open the directory, because FDs
returned by open() aren't suitable for directory iteration and because checks
  have to be performed (like whether this is a directory at all and whether the
  user has read permission).
* Added __create_dir_struct() for the attribute, index, and query open
  functions to use instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 10:55:43 +00:00
Axel Dörfler d6ac23c010 * Moved the location of the "hosts" file to
B_COMMON_SETTINGS_DIRECTORY/network/hosts.
* Moved the location of the "services" file to
  B_COMMON_DATA_DIRECTORY/network/services.
* Removed headers I forgot to remove.
* Made getnameinfo() use socklen_t internally as well.
* Removed _PATH_* constants from netdb.h that we don't deliver anymore.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-10 10:13:19 +00:00
Axel Dörfler 4bd3cce627 * Ported libbind-6.0 to Haiku, and into our libnetwork.so.
* Got rid of the TLS/multi-thread hacks of the previous port.
* Took over irs/lcl_sv.cpp, and irs/lcl_ho.c, and irs/lcl_pr.c from the previous
  version as they contain customizations.
* Removed unused files from libbind.
* Only barely tested, so beware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-09 22:18:34 +00:00
Axel Dörfler ecf6b86c92 * The pthread_thread structure is now allocated for all threads.
* Therefore, all pthread functions should now work fine on all threads.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-09 21:33:35 +00:00
Axel Dörfler c73ea8216d * Removed superfluous wcstoul() version pointed out by Scott.
* Removed superfluous "int" before wcstol().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33957 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-09 08:43:32 +00:00
Jérôme Duval 35e2c7ab62 updated libpng to 1.2.40
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33956 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-08 23:30:28 +00:00
Axel Dörfler 6242fd5977 * Added the possibility to debug latency issues with spinlocks.
* When DEBUG_SPINLOCK_LATENCIES is 1, the system will panic if any spinlock is
  held longer than DEBUG_LATENCY micro seconds (currently 200). If your system
  doesn't boot anymore, a new safemode setting can disable the panic.
* Besides some problems during boot when the MTRRs are set up, 200 usecs work
  fine here if all debug output is turned off (the output stuff is definitely
  problematic, though I don't have a good idea on how to improve upon it a lot).
* Renamed the formerly BeOS compatible safemode settings to look better; there
  is no need to be compatible there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-08 20:26:48 +00:00
Axel Dörfler 01ce3f26d2 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-08 17:31:39 +00:00
Ingo Weinhold d0b21f13dd Removed obsolete comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-07 08:20:00 +00:00
Ingo Weinhold 9c7b2520c2 Added get_pthread_thread_id() function returning the Haiku thread_id of a
pthread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-07 08:19:24 +00:00
Axel Dörfler 5569f33367 * Someone obviously forgot to check in some header changes. Build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33917 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-06 15:32:55 +00:00
Ingo Weinhold be350af3d9 Added methods AddToMessage() and SetFromMessage() to add the value of the
variant as a field to a message, respectively initialize the variant from
one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33901 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 17:24:58 +00:00
Ingo Weinhold 8d24cfc6c2 * Added Iterator::NextValuePointer().
* Made reference returned by _GetKey() const. That's sufficient.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33898 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 17:18:12 +00:00
Ingo Weinhold 239222b236 * Moved everything into the SymbolPatcher namespace.
* Several fixes to get things building with gcc 4.
* Changed lookup of the _GLOBAL_OFFSET_TABLE_ symbol. It is hidden and static
  and get_image_symbol() doesn't find it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-05 17:16:17 +00:00
Oliver Tappe a85a827cd0 * introduced two new private methods, _PreviousWordStart() and _NextWordStart(),
which are now being used to implement the word-wise keyboard navigation,
  fixing #4785


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-04 18:49:15 +00:00
Ingo Weinhold 4736b6b9e5 * Made BReferenceable the class implementation and BPrivate::Referenceable the
typedef, so it's clearer which one is the preferred one.
* Added BReference, a clone of BPrivate::Reference.

BPrivate::{Referenceable,Reference} are being phased out. Only the B* versions
should be used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33879 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-04 15:08:53 +00:00
Axel Dörfler 29e37d8842 * Made BTokenSpace not throw any exceptions on memory shortage.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33874 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-04 12:19:59 +00:00
Jérôme Duval 15f18c0947 added missing posix functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-03 20:04:10 +00:00
Oliver Tappe 3c9dcb418e * corrected tab/space confusion of my last change
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-02 19:23:18 +00:00
Oliver Tappe 7e0d60f5b7 adding POSIX-functions llround*(), which Maxime reported missing
* copied implementations for llround(), llroundf() and llroundl() from
  glibc-2.3.2
* added corresponding declarations to math.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-02 19:13:15 +00:00
Colin Günther 8ac8b52a03 Removed part about where RadixBitmap is currently used, because the FreeBSD compat layer uses it, too. I think it is prone to inconsistency managing a usage list in the header file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33860 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-01 20:37:03 +00:00
Brecht Machiels 8b20f2e4ae forgot to add this file in r33815
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-28 21:37:38 +00:00
Axel Dörfler ea607d6f7f * Applied a patch by Christof Lutteroth that updates ALM, and brings new test
apps.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33805 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-28 09:00:14 +00:00
Axel Dörfler d337132b41 * Coding style cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33792 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 18:22:39 +00:00
Axel Dörfler 5234616d1a * That patent is obsolete now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 14:46:53 +00:00
Axel Dörfler 954da749a5 * Added SCHED_SPORADIC, and sorted the constants the way it's done in the specs.
* Also changed their numbering.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 13:10:17 +00:00
Axel Dörfler d88b4037b0 * Reduce maximum priority to B_URGENT_DISPLAY_PRIORITY; real time threads isn't
really something to play with without knowing the outcome.
* Fixed indentation/coding style violations introduced with r33783. Please take
  more care when accepting patches!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-27 12:34:27 +00:00
Jérôme Duval f386c5910b Patch from Michael Franz (ticket #4696): sched.h and pthreads to allow setting of the thread priority
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 22:56:43 +00:00
Axel Dörfler 86a999adfb * delete_owned_ports() no longer scans the whole port array for ports belonging
to the owning team.
* Instead, the team now maintains a list containing the ports it owns.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33771 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-26 13:34:43 +00:00
Axel Dörfler 7691a788d0 * Minor cleanup, updated copyright.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33762 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-25 15:14:49 +00:00
Rene Gollent 203049400f Also remove _B_APP_INFO_RESERVED1_ as it's used for nothing whatsoever.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-25 13:11:29 +00:00
Stefano Ceccherini 510fae5f1d Also add layout-friendly constructor for BOptionPopUp (not yet tested)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33757 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-25 10:49:28 +00:00
Stefano Ceccherini ba69bf196e Added layout friendly constructor for BOptionControl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33756 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-25 10:45:42 +00:00
Rene Gollent 75f60c8b38 Set default flags to B_MULTIPLE_LAUNCH only, as is the case on BeOS. This fixes issues where apps that forgot to specify flags in their resources would be unable to receive remote messages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-25 03:34:24 +00:00
Rene Gollent 650454ae2e gcc4 build fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-24 01:26:14 +00:00
Jérôme Duval 505a5551a4 added SOCK_SEQPACKET
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-24 01:01:17 +00:00
Brecht Machiels dfdfbd3eef * added support for GM45 (might work for other chips in the G4 series)
* added header for dealing with binary numbers and bitmasks (C++ templates)
   these "macro's" might not work well for long words, though


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-23 23:03:49 +00:00
Axel Dörfler ddbe12007a * Semaphores are now put into the team struct in a doubly linked list.
* This makes sem_delete_owned_sems() a lot more efficient; before it would need
  to scan the entire semaphore table.
* This speeds up the test build of the kernel by another 2 seconds (with
  KDEBUG=2) on my laptop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-23 02:06:51 +00:00
Axel Dörfler f28dd36b82 * The alphabet is obviously hard, moved some tracing defines at their
(hopefully) correct place.
* It seems to be even harder to understand basic locking primitives: when you
  think about it, it shouldn't surprise you that conditional variables never
  return B_WOULD_BLOCK. This fixes gdb again.
* Added tracing support to the ports subsystem.
* get_port_message() will now resize the port heap if needed (but will also
  take timeouts into account while doing so, more or less). The initial port
  space is 4MB (as before), the growth rate is the same, and the system wide
  limit is arbitrarily set to 64 MB (all swappable). A team limit has been set
  to 8 MB, but is not enforced yet. Since ports are using up address space in
  the kernel, those seems to be proper limits.
* This also fixes a strange, and rare lockup where the mouse cursor would still
  move, but everything else would basically hang, but look perfectly normal from
  KDL on the first look. As recently happened on Brecht's laptop, and debugged
  by mmlr and me: the cbuf space got used up when lots of windows wanted to
  redraw after a workspace switch. The app_server wouldn't answer anymore to
  client requests, but thought it would have done so, as LinkSender::Flush()
  doesn't care if it got a B_NO_MEMORY (the ports will now block until memory
  is available if possible, so that should not be a problem anymore).
* Improved "port" KDL command, it now also prints the messages in the port.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 23:14:10 +00:00
Brecht Machiels 926e63c885 * added click to focus mouse mode; right-click for bring-to-front and send-to-back
(might cause some regressions in FFM)
* made accept first click user configurable
* updated the Mouse preflet to use the layout kit
* removed the warp and instant warp modes from the Mouse preflet
* changed internal representation of mouse modes (warp modes moved)
* coding style fixes



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 21:10:19 +00:00
Axel Dörfler e8885f2097 Basically rewrote the ports subsystem to use:
* its own heap allocator instead of cbuf - this makes cbuf superfluous, and I
  therefore removed it from the kernel. The heap is swappable, so lifts the
  kernel's resource usage a bit. In the future, the heap should grow as well;
  right now it should be at least as good as before.
* it no longer uses spinlocks, but just mutexes now for better scalability - it
  was not usable with interrupts turned off anyway (due to its semaphore usage).
* it no longer uses semaphores, but condition variables.
* Needed to move the port initialization to a later point, as swappable memory
  wasn't usable that early.
* All ports test are still passing, hopefully I didn't mess anything up :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 13:24:12 +00:00
Axel Dörfler e0aad96f94 * Allow to use symbols as variables (prefixed with '@'). Now only tab completion
for variable names is missing B-}


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 11:44:29 +00:00
Axel Dörfler 68d9d8809b * Just use the heap instead of cbuf for send_data().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33722 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 11:42:51 +00:00
Michael Lotz 4bee71c211 * Implement per-CPU heaps. They only get enabled in case there's enough memory.
* Allow an allocator to be created on the heap to allow for non-locked
  allocators to be created.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-22 08:57:34 +00:00
Michael Lotz 5ee1f125e5 Make use of the wait status field so it can be provided in Notify() and then
read out in the ConditionVariableEntry::WaitStatus(). That way you can notify
with a specific status that can be read out on the other end.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-21 23:44:59 +00:00
Oliver Tappe 32c8ab89a9 * added _TabExpandedStyledWidth(), which makes sure to expand all tab chars
during the width calculation
* used _TabExpandedStyledWidth() at all places that need to expand tabs,
  fixing #4822
* removed _StyledWidthUTF8Safe() as it didn't make sense - we now perform
  the same auto-scrolling horizontally as we do vertically


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-21 19:09:20 +00:00
Oliver Tappe b18f133db3 generally overhauled non-wrapping mode of BTextView, as it was considerably broken:
* switching from wrapping to non-wrapping mode triggers a recomputation of
  the text rect
* non-wrapping mode now triggers updating of the data rect for the horizontal 
  scrollbar as needed, fixing #4705
* corrected a couple of width computations that confused bounds and text
  rect width, leading to drawing artefacts at the end of a line
* unified computation of text rect width to always take all lines into
  account (not just the first one)
* some cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-21 13:42:25 +00:00
François Revol 546376e654 Typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 23:23:33 +00:00
Oliver Tappe 571d840abf * dropped svn:keywords property from all files that carried it
to avoid recurring problems during migration of subversion checkouts
  (restored binary files that were garbled by subversions during checkout)
* added appropriate svn:mime-type property for problematic (binary) files
* removed a single (mistyped) svn:mimetype property 
* dropped svn:eol-style property for cleanup (they all contained 'native')



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 22:42:52 +00:00
François Revol 7c595f3353 ARM920T specific definitions (not done yet).
Board config file for the FreeRunner.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 21:13:46 +00:00
Clemens Zeidler 7f6d3afb1d Add ns_handle_to_pathname acpi function to the acpi module.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 19:00:26 +00:00
Clemens Zeidler cb6cd182c4 Remove type variable from reference, it is already defined as object_type before of the union.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 17:42:18 +00:00
Scott McCreary 0869aa838f Second try, this time with the right define in the second case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 15:25:44 +00:00
Scott McCreary f70f0cf049 Missed the Haiku specific changes in ftoption, putting them back in.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 15:13:32 +00:00
Rudolf Cornelissen b793b9cbd0 added dithering support for DAC1. Dithering is enabled for digitally connected panels on DAC1 on laptops. This should remove the 'colorbands' displayed previously on gradients. Bumped version to 1.06.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 10:33:01 +00:00
Scott McCreary f1b1e2fc9a updated freetype to 2.3.11
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33650 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 07:03:46 +00:00
Axel Dörfler 39e3058e5b * Reverted r33643 - while it doubled the performance for my test case (with
high contention of the read lock (I experimented with the VM page mapping
  lock)), it actually hurt the compile performance pretty obviously.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 00:16:54 +00:00
Stephan Aßmus 7d05cf36fc Revert my additions to the patch from #4733, Core 2, Core 2 Duo and Core 2
Quad are all reported as "Core 2", because the CPU count is already reported
separately.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-19 00:07:59 +00:00
Axel Dörfler 22ea088498 * The rw_lock is now using a mutex to protect its reader/writer counts. This
makes the reader case a lot less expensive, and should relieve the thread
  spinlock contention a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-18 19:52:09 +00:00
Axel Dörfler b2a7fcb404 * Added an arch_debug_stack_trace() function that is called from the KDL loop
in case there aren't any KDL commands available yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33642 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-18 19:50:13 +00:00
Axel Dörfler 795bd7a697 * The save_lvds_mode() function did not correctly support the i965 chipset -
I've now removed that code, and factored out a retrieve_current_mode()
  function that can work on head A and B.
* This fixes Adrien's flickering problem on his laptop - I can't find the
  bug ticket, though. Hopefully it does not break other laptop chips. Testing
  would be welcome, as I don't have any other machine here.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-18 10:03:01 +00:00
Axel Dörfler 20a11271d0 * Added a (to be virtual) DefaultItemSpacing() method to control look. This is
what you should use in for example BGroupLayout as spacing/inset.
* Changed the label spacing to be dependent on the font size, too (and enlarged
  it a bit as well).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 17:01:22 +00:00
Axel Dörfler 676ef01ba7 * Applied patch by Hong Yul Yang to update linprog.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-16 12:13:07 +00:00
Axel Dörfler 9b912c694a * Cleanup, no functional change - this is now a pure C++ header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 10:13:02 +00:00
Axel Dörfler 3066f3dbf8 * Reverted r33547, this closes bug #4782 - this is obviously a regression in
GCC4.
* Adapted code accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 07:48:31 +00:00
Ingo Weinhold 2fc49d9b36 Added ColumnAt(BPoint) version.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 04:31:42 +00:00
Axel Dörfler e628f41c49 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33586 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-14 12:51:19 +00:00
Oliver Tappe 41426d9bac * Moved three locale-related headers back into a safe place (where no
software looking for them will find them) as a temporary fix for #4747.
  In the long run, the functions declared in these headers should be
  implemented by means of ICU and then the headers shall be made public again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33575 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-13 17:15:49 +00:00
Axel Dörfler b74a098352 * Got rid of the duplicated functionalities provided by RWLocker.cpp, and
Locker.cpp.
* The services are now using recursive_locks, and rw_locks instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 14:29:05 +00:00
Axel Dörfler 4baa865937 * Added casts to the *_INITIALIZER macros, so that they can also be used in
a member constructor list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 14:27:02 +00:00
Michael Lotz 93b63126e1 Adding mutex and rw_lock with the same interface as the kernel versions to
libroot. The mutex is a simple benaphore, the rw_lock is pretty much the same
as the one from libkernelland_emu but uses a mutex per lock instead of emulating
a global thread lock. Also added MutexLocking and RWLock{Read|Write}Locking and
AutoLockers based on them. It's cased with __cplusplus so the locks are also
usable from C. Everything's currently exposed in shared/private/locks.h but I
think we should make these locking primitves public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 11:19:33 +00:00
Michael Lotz 7ebd7cfc40 Add a vm_page_allocate_page_run_no_base. It bases its search on the pages found
in the free and/or clear queue. This performs better in the case where only few
pages are free/clear but performs worse in the case where there are a lot of
usable pages. It's not used anywhere but it might come in handy one time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:55:21 +00:00
Michael Lotz 44778a8a28 Introduce vm_map_physical_memory_vecs. It is like vm_map_physical_memory but
takes a list of iovecs describing the physical pages to be mapped. With it one
can map a set of physically disjoint pages into one linear virtual range. This
is a private API right now, but we might want to make it public as
map_physical_memory_vecs alongside map_physical_memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33523 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:48:03 +00:00
Axel Dörfler 6e6b0851ca * Applied (cleaned up) patch by Stefano to fix bug #4742.
* Note while this fixed running BeOS apps using BJoystick, it breaks all apps
  (and SDL) that have been compiled for Haiku R1/alpha1. It's really bad that
  r27171 went through unnoticed. We should really try harder next time (and
  try to get the ABI change detection script working in an automated way).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:40:12 +00:00
Michael Lotz 1af7d11504 * Rework page writing to combine page writes where possible. For now the pages
are required to be physically contiguos, which should be reworked to put them
  into seperate iovecs. Still this manages to combine a great deal of page
  writes into larger bursts already. Reduces the amount of IO requests being
  scheduled (and greatly benefits media where page wise writes are slow when
  they are accessed through a non-IOScheduler path, i.e. USB mass storage until
  that is properly implemented).
* Abstracted per page page writing tasks into a PageWriteWrapper class.
* Abstracted per transfer page writing tasks into PageWriteTransfer class which
  formerly was the PageWriterCallback.
* Use both classes from the PageWriterRun and from
  vm_page_write_modified_page_range to remove code duplication.
* Adjusted synchronous VMAnonymousCache::Write() to cope correctly with larger
  iovecs and more than one iovec. It assumed that there was exactly one page per
  vector previously.
* Introduced MaxPagesPerWrite() and MaxPagesPerAsyncWrite() to VMCache to allow
  a cache to specify restricitions. VMAnonymousCache does restrict the max pages
  to 1 for WriteAsync right now as I didn't feel like reworking that one to cope
  with non single page writes just yet.
* Pulled out PageWriteTransfer methods for better readability.
* Some typo fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-10 22:37:26 +00:00
Michael Lotz 793d0f340d Add a nogrow variant for new[] as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-10 22:29:11 +00:00
Stephan Aßmus 011a4cdbfc * Removed now obsolete notification (this was not even used in Tracker
anymore).
* Added interface to get the current settings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-07 19:31:57 +00:00
Stephan Aßmus 21f2402e20 Work in progress of moving the (audo-)mounting functionality from Tracker into
a dedicated mount server. This is pretty much a straight copy from the
AutoMounter code from Tracker, except
* the eject on unmount setting has been added (in Tracker, it's part of the
  general settings, not the mount specific ones),
* scripting features have been added, such that it becomes possible to trigger
  mounting the previoulsy mounted volumes from the outside, and most
  importantly block until the operation is done (waiting for the reply).

TODO:
* Change Tracker to not run it's own AutoMounter, but send messages to the
  new server.
* Move the eject when unmounting setting to the mount settings window.
* Enable the mount_server in the Bootscript.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-07 18:34:29 +00:00
Axel Dörfler 931cd377aa * Added a new flag kAcceptKeyboardFocusFlag that allows B_AVOID_FOCUS windows
to still receive keyboard events. This is now used for menu windows (before,
  the menu feel alone would trigger that behaviour).
* This also fixes bug #4691, as tool tip windows use the menu feel as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-07 16:26:32 +00:00
Oliver Ruiz Dorantes 515209e338 Merge view class in the window object
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 20:03:36 +00:00
Stephan Aßmus b0488dca68 Patch by "v" to fix ticket #4733, there are Core and Core 2 Celerons. I
enhanced it to also say Core 2 Quad and Core 2 Duo again, instead of just
Core 2. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 17:08:24 +00:00
Axel Dörfler fc548b41f3 * Removed the pretty useless "Multifinger scrolling" option - it's now always
the same as the two finger scrolling option (could be disabled, too, opinions
  welcome).
* Added a new settings to disable horizontal two finger scrolling, since it's
  not that easy to only scroll in one direction with this. Maybe a higher
  starting boundary would also be an option for this instead, Clemens what do
  you think?
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33468 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 14:30:57 +00:00
Stephan Aßmus 852e81f6cb Come to think of it, this is actually a multi-line if...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 12:27:19 +00:00
Stephan Aßmus 8ee28a00be Fixed a style violation that I missed, thanks Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 12:26:06 +00:00
Stephan Aßmus b2e0606edc Patch by "v" to distinguish between different processors with the same CPU-ID.
Slightly enhanced coding style by myself. Should fix ticket #3541. Thanks a
bunch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 11:54:28 +00:00