Commit Graph

4795 Commits

Author SHA1 Message Date
Jérôme Duval 03d1f00c86 now uses DIRECT_BUFFER_INFO_AREA_SIZE as the direct_buffer_info area size
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-05 23:40:29 +00:00
Karsten Heimrich ff693eba44 * fix wrong cast in Minute()
* fix _SetTime(), was using the wrong * operator, resulting in
  an overflow at some point that lead to the mentioned jumping

 fixes 2878 and 3057



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-05 23:23:02 +00:00
Axel Dörfler 2c1e463c7e * Removed B_{MIN|MAX}_PRIORITY from OS.h - they were never really intended
as public defines. They are now called THREAD_{MIN|MAX}_SET_PRIORITY to
  better reflect what they are for. Minimum priority is now 1, ie. you no
  longer can set another thread to the idle priority. This fixes part of
  ticket #2959.
* set_thread_priority() will no longer allow to change the priority of the
  idle thread to something else. This fixes the rest of ticket #2959.
* Automatic whitespace cleanup in OS.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28521 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-05 18:11:58 +00:00
Jérôme Duval d2184e65c1 * whitespace cleanup
* implemented the disabled look and color ramping


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-04 19:08:26 +00:00
Axel Dörfler 5b812019b4 * Added function block_cache_discard() that flushes blocks from the block cache,
discarding their changes. This functionality currently only works correctly
  when no transactions are used.
* Started test application for the block cache, doesn't do anything yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28496 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-04 14:49:33 +00:00
Ingo Weinhold 10b4b5d175 * Added an "add-on" interface for the runtime loader. Pre-loaded images
can export a structure containing callback hooks invoked by the
  runtime loader when certain image events occur (image loaded,
  relocated, initialized, etc.).
* Also added a mechanism to patch image symbols. For an image callback
  functions can be installed that patch symbols exported or imported by
  the image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-03 13:27:14 +00:00
Ingo Weinhold 56eb43e3ca * Made kernel_cpp.h usable in the runtime loader.
* Added new(mynothrow) operators which avoid clashes when also linking
  against libgcc.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-03 13:15:12 +00:00
Jérôme Duval 13cb35848b takes into account the column title width
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 12:33:32 +00:00
Ingo Weinhold 19d40f9eb7 Moved the rld_export structure from <user_runtime.h> to
<runtime_loader.h>, since it isn't a kernel <-> userland interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 03:43:01 +00:00
Ingo Weinhold ca618b2259 * Changed the way symbols are resolved. For each root image (program,
add-on) we create a breadth-first sorted image list and use that to
  search for symbols.
* Added support for preloading libraries. The environment variable
  LD_PRELOAD can contain a whitespace-separated list of shared objects
  that will be loaded before the program. This allows to replace
  symbols without changing the executable or libraries.
* Resolved TODO in load_program() regarding the order of remapping the
  images and initializing the dependencies (problem fixed in r28453).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 03:16:30 +00:00
François Revol 9da2356857 Work in progress to pass the image extents to the kernel,
- code is disabled yet as the bootloader doesn't have add_boot_item.. will need to pass via kernel args
- add a GetFileMap() method to the vfs, and implement it in FAT code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-01 20:39:14 +00:00
François Revol ebb7d4466e add header & (c)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28444 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-01 20:33:39 +00:00
Stephan Aßmus 6849a22864 Patch by Clemens Zeilder:
* Implemented Synaptics touchpad support in the PS2 bus_manager by
  refactoring/splitting the structure some and adding touchpad device
  handling.
* Implemented Touchpad input_server device add-on
* Created Touchpad preflet for configuring advances Synaptics touchpad
  options like scroll region (both horizontal and vertical) as well
  as other neat stuff

Thanks a lot, Clemens!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-01 10:48:35 +00:00
David McPaul daa2f87441 correct spelling
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 22:33:06 +00:00
Ingo Weinhold 3a39905b59 Implemented __freading(), __fpurge(), and fpurge().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 13:02:40 +00:00
Axel Dörfler b4c8ccc372 * The boot loader now creates a CRTCInfoBlock structure when detailed EDID
mode informations are available.
* This is passed to the graphics card when the mode is set in the hopes that it
  will be more conforming.
* Not yet tested on real hardware, though, therefore the VESA driver doesn't
  do anything like this yet. I will test next, but please report any problems
  with this nonetheless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 09:52:57 +00:00
Jérôme Duval 2c558054fe supports double clicking column title separator to preferred column size
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-29 22:50:52 +00:00
Ingo Weinhold a9d23be2f3 Don't define "protected" macro in C++ mode.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-29 00:48:57 +00:00
Jérôme Duval 58b80f0913 updated libpng to 1.2.32
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28357 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-28 19:35:14 +00:00
Axel Dörfler 6e036f0479 * Updated glob.h and its implementation to FreeBSD current (1.10, 1.27),
adapted them to work on Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-28 14:13:30 +00:00
Axel Dörfler a58e2ed8f8 * Added functions FindPartitionByVolume() and FindPartitionByMountPoint()
that conveniently bridge BVolumes/mount points with BPartitions.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28346 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 15:33:37 +00:00
Axel Dörfler d5b30a2548 * As Marcus correctly pointed out indirectly, the bitmask for
ide_mask_sector_count_48, and ide_mask_LBA_*_48 were all wrong.
* Using the high byte in LBA48 mode should work now, too (wasn't written
  to the IDE controller before, but that shouldn't have been a problem yet with
  today's disks).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-26 22:14:20 +00:00
Axel Dörfler e2040be893 * Applied patch by Romain Picard: added support for the GNU extension dladdr(),
thanks!
* This closes ticket #2818.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 09:53:48 +00:00
Ingo Weinhold bc3955fea5 Preparations for removing __BEOS__ from the compiler defines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28305 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-23 21:46:26 +00:00
Stefano Ceccherini 4cc3ec9fdd Moved _joystick_info definition to JoystickTweaker.h, since there is no point to keep it public. Removed default parameter in the second version of Open(), otherwise the two functions can't be used unambiguously. Should fix bug #2904
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-23 08:18:48 +00:00
Jérôme Duval d5de4fbb6c helper functions to get device and vendor names from usbdevs list
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 22:32:37 +00:00
Ingo Weinhold 9a42ad7a77 When switching to a kernel thread we no longer set the page directory.
This is not necessary, since userland teams' page directories also
contain the kernel mappings, and avoids unnecessary TLB flushes. To make
that possible the vm_translation_map_arch_info objects are reference
counted now.

This optimization reduces the kernel time of the Haiku build on my
machine with SMP disabled a few percent, but interestingly the total
time decreases only marginally. Haven't tested with SMP yet, but for
full impact CPU affinity would be needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 15:12:32 +00:00
Ingo Weinhold 412319e8eb * Use a singly linked list for the deferred free entries.
* Added deferred_delete() that takes a DeferredDeletable and deletes it
  asynchronously.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 14:46:20 +00:00
Ingo Weinhold 63a9f18f31 Added MoveFrom().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 14:43:46 +00:00
Axel Dörfler 89b1afd16c * Added a new window feel kPasswordWindowFeel that is above all other feels.
* Changed the password window to use this feel.
* Later, the screen saver itself should use this feel whenever the password
  mode is enabled. The password window should then use a modal-app feel, but
  this doesn't work yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 11:51:23 +00:00
François Revol d4dcbf95f6 - Fix build.
- make system_time() return something sensible until platform code works.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 21:23:55 +00:00
Karsten Heimrich 9a321797d9 * fix wrong cast
* fix r5 target build



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 20:21:16 +00:00
Ingo Weinhold 53892c92a0 * Replaced scheduler_remove_from_run_queue() by
scheduler_set_thread_priority(). Setting the thread priority was the
  only situation in which it was used.
* Renamed scheduler.cpp to scheduler_simple.cpp.
* The scheduler functions are no longer called directly. Instead there's
  an operation vector now, which is initialized at kernel init time.
  This allows for picking the most suitable scheduler for the machine
  (e.g. a non-SMP scheduler on a non-SMP machine).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 12:37:13 +00:00
Axel Dörfler 9e163a7a93 * Made BScrollView work when using it with the layout system.
* Added a layout friendly constructor - it's not so nice to use, though, since
  the original one already doesn't get a BRect (we just don't need the
  resizing mode, and have to set the B_SUPPORTS_LAYOUT flag).
* Refactored size/frame computation a bit.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 10:14:24 +00:00
Ingo Weinhold 59dbd26f5f * Moved more debug macros to kernel_debug_config.h.
* Turned the checks for all those macros to "#if"s instead of "#ifdef"s.
* Introduced macro KDEBUG_LEVEL which serves as a master setting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-20 14:24:46 +00:00
Ingo Weinhold 1894a0a98b Consistently use KDEBUG. It is always defined and therefore must be
checked with "#if".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-20 13:06:04 +00:00
Ingo Weinhold 47c40a10a1 * Prefixed memset_physical() and memcpy_to_physical() with "vm_",
added vm_memcpy_from_physical() and vm_memcpy_physical_page(), and
  added respective functions to the vm_translation_map operations. The
  architecture specific implementation can now decide how to implement
  them most efficiently. Added generic implementations that can be used,
  though.
* Changed vm_{get,put}_physical_page(). The former no longer accepts
  flags (the only flag PHYSICAL_PAGE_DONT_WAIT wasn't needed anymore).
  Instead it returns an implementation-specific handle that has to be
  passed to the latter. Added vm_{get,put}_physical_page_current_cpu()
  and *_debug() variants, that work only for the current CPU,
  respectively when in the kernel debugger. Also adjusted the
  vm_translation_map operations accordingly.
* Made consequent use of the physical memory operations in the source
  tree.
* Also adjusted the m68k and ppc implementations with respect to the
  vm_translation_map operation changes, but they are probably broken,
  nevertheless.
* For x86 the generic physical page mapper isn't used anymore. It is
  suboptimal in any case. For systems with small memory it is too much
  overhead, since one can just map the complete physical memory (that's
  not done yet, though). For systems with large memory it counteracts
  the VM strategy to reuse the least recently used pages. Since those
  pages will most likely not be mapped by the page mapper anymore, it
  will keep remapping chunks. This was also the reason why building
  Haiku in Haiku was significantly faster with only 256 MB RAM (since
  that much could be kept mapped all the time).
  Now we're using a different strategy: We have small pools of virtual
  page slots per CPU that are used for the physical page operations
  (memset_physical(), memcpy_*_physical()) with CPU-pinned thread.
  Furthermore we have four slots per translation map, which are used to
  map page tables.

These changes speed up the Haiku image build in Haiku significantly. On
my Core2 Duo 2.2 GHz 2 GB machine about 40% to 20 min 40 s (KDEBUG
disabled, block cache debug disabled). Still more than factor 3 slower
than FreeBSD and Linux, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-20 00:06:09 +00:00
Axel Dörfler 23debb05d0 * Rewrote InputServerDevice.h header.
* Renamed _BDeviceAddOn_ to DeviceAddOn, and put it into the BPrivate namespace.
* Moved the DeviceManager functionality into the AddOnManager - this also
  solves a locking issue, as BInputServerDevice::Control() was called in the
  context of the DeviceManager before.
* The AddOnManager now uses the BPathMonitor to monitor the devices that
  BInputServerDevices ask for - this greatly simplifies the code.
* Got rid of TList.h, and use ObjectList.h instead.
* Added PathList class that has a list of paths with reference count, used by
  DeviceAddOn and the AddOnManager.
* DeviceAddOn got an actual implementation that lives in InputServerDevice.cpp.
* Added an experimental BInputServerDevice::AddDevices() that could be used
  instead of recursing over devices manually. It replaces the functionality
  that was found in the DeviceManager before (this was done implicitely for
  all monitored devices).
* Greatly cleaned up and simplified the AddOnManager.
* Also fixed lots of potential errors/leaks when things go wrong.
* Removed the extra locker in AddOnManager - its BLooper lock is now used
  instead.
* Replaced PRINT()/PRINTERR() macros in the AddOnManager with TRACE(), and
  ERROR(), both now use debug_printf().
* Hopefully this fixes the problem that I don't have keyboard under VirtualBox
  from time to time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 15:48:34 +00:00
Axel Dörfler ab42853558 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 13:17:29 +00:00
Karsten Heimrich d751323939 * reintroduce member fOffscreen which got removed in r2917
* check if locking the offscreen window succeeds before calling delete on it
* don't return offscreen windows in CountWindows and WindowAt (works now as on R5)

  fixes ticket 1522, 1591, 1946, 2318 and propably more

  While creating an BBitmap in BApplication the bitmaps window looper would
  be added to the applications gLooperList, thus calling Quit() on that window
  and later delete on a stale window pointer in BBitmaps dtor. The Lock() check
  would fix the problem, but tests on R5 have shown that BApplication hides the
  offscreen window in CountWindows() and WindowAt().



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28236 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 12:23:18 +00:00
Karsten Heimrich a02979bb3f * cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 12:05:37 +00:00
Rene Gollent ca5e024130 Probably forgotten changes in the last commit, though I'm not sure if Axel had any other style cleanups in mind in this file. Fixes build at any rate.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28230 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 15:45:57 +00:00
Ingo Weinhold 7ab39de989 * Removed unused SMP_MSG_RESCHEDULE ICI message.
* Introduced flag "invoke_scheduler" in the per CPU structure. It is
  evaluated in hardware_interrupt() (x86 only ATM).
* Introduced SMP_MSG_RESCHEDULE_IF_IDLE message, which enters the
  scheduler when the CPU currently runs an idle thread.
* Don't do dprintf() "CPU x halted!" when handling a SMP_MSG_CPU_HALT
  ICI message. It uses nested spinlocks and could thus potentially
  deadlock itself (acquire_spinlock() processes ICI messages, so it
  could already hold one of the locks). This is a pretty likely scenario
  on machines with more than two CPUs, but is also possible when the
  panic()ing thread holds the threads spinlock. Probably fixes #2572.
* Reworked the way the kernel debugger is entered and added a "cpu"
  command that allows switching the CPU once in KDL. It is thus possible
  to get a stack trace of the thread not on the panic()ing CPU.
* When a thread is added to the run queue, we do now check, if another
  CPU is idle and ask it to reschedule, if it is. Before this change, the
  CPU was continuing to idle until the quantum of the idle thread
  expired. Speeds up the libbe.so build about 8% on my machine (haven't
  tested the full Haiku image build yet).
* When spinlock debugging is enabled (DEBUG_SPINLOCKS) we also record
  the spinlock acquirer on non-smp machines. Added "spinlock" debugger
  command to get the info.
* Added debugger commands "ici" and "ici_message", printing info on
  pending ICI message respectively on a given one.
* Process not only a single ICI message in acquire_spinlock() and other
  places, but all pending ones.
* Also process ICI messages when waiting for a free one -- avoids a
  potential deadlock.
* Mask out non-existing CPUs in send_multicast_ici(). panic() instead of
  just returning when there's no target CPU left.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 18:14:08 +00:00
Ingo Weinhold 78c90d44ca Moved definition of the PAUSE macro to <cpu.h>, respectively
<arch/cpu.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:53:31 +00:00
Ingo Weinhold 901f1930e1 * Moved memset_physical() to vm.cpp and made it available in the kernel.
* Added memcpy_to_physical().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 16:32:12 +00:00
Michael Lotz f7de7fa4e3 Add throw() to the nogrow new operator. This will cause the right version to be
used that handles NULL returns and doesn't expect an exception. This fixes that
certain constructors would still be called even if the allocation failed in low
memory situations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28208 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 08:32:42 +00:00
Ingo Weinhold 6e595b29e3 Moved KERNEL_BREAKPOINTS to kernel_debug_config.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28197 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:43:32 +00:00
Ingo Weinhold 3b248948f2 Added ThreadCPUPinner AutoLocker class.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:41:11 +00:00
Michael Lotz 88db388930 Remove one line of whitespace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 21:22:00 +00:00
Michael Lotz 3c6372b44a Rename BMessage::CompareData() to HasSameData() as this makes more sense for the
bool return type. Did I mention this was an unstable Haiku extension?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 20:45:12 +00:00
Stephan Aßmus 11c5023a77 Applied patch by Stephen Deken:
* Added a new class BAffineTransform, currently in the BPrivate namespace
  and the inofficial "shared kit".
* Extended BPolygon to be transformable by a BAffineTransform.

Thanks a lot!

Minor fixes by myself:
* The class accidentally still derived from agg::trans_affine.
* Added then missing comparator operators.
* Swapped the BPoint* and count arguments of Apply(), since that seems
  to be the more common order in the other Be API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28176 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 19:10:10 +00:00
Michael Lotz 5b25b917f9 Introduce BMessage::CompareData() which is a Haiku API extension. It compares
the data of two BMessages and allows recursive comparison (BMessage inside
BMessage). Note that using this API might require you to recompile your app in
the path to R1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28174 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 15:55:36 +00:00
François Revol 2cf4975b4b Add FAT32 support. This allows the bootloader to find a BFS image file (currently named BEOS\IMAGE.BE) and start booting for it, until the kernel tries to mount the boot partition.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 23:54:04 +00:00
Michael Lotz 945a6a41ac bonefish + mmlr:
* Add possibility to restart a complete pipe through B_KDEBUG_RESTART_PIPE.
* Implement tail in the kernel debugger making use of the former.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28154 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 23:43:27 +00:00
Stephan Aßmus 431dc47dde Patch by Artur Wyszynski with some changes by myself:
* Resolved TODO: The type of the gradient is no longer encoded twice in the
  app_server link protocoll.
* Moved instantiation of the BGradient into the LinkReceiver::ReadGradient()
  method.
* Check success for (at least) ReadGradient() in ServerWindow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 19:47:00 +00:00
Axel Dörfler 051bb0bb64 * Added a comment to SO_BINDTODEVICE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 12:33:59 +00:00
Oliver Tappe 39fbf5509b bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved
  virtual function slots: instead of statically invoking the method
  that corresponds to the reserved slot on the class that contains the
  slot, we now invoke the virtual Perform() method. Perform() then dispatches 
  the method invocation to the "proper" class, i.e. the highest class in the 
  hierarchy that  actually implements the requested method.
  This fixes a crash in apps that use liblayout's MSlider class and
  should fix one or other spurious bug with old apps or libraries, too.
* added new header folder 'binary_compatibility' that contains files that
  define the method codes and data structures required by Perform()
* looked for and implemented all used reserved virtual slot functions to
  invoke Perform() where necessary or to pass on the method call statically
  (for slots that were already maintained by Be)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 09:29:06 +00:00
Stephan Aßmus 991547ef6c Patch by Artur Wyszynski:
* Implemented BGradient, BGradientLinear, BGradientRadial,
  BGradientDiamond, BGradientConic and BGradientRadialFocus
  new Interface Kit classes.
* Implemented all the (AGG-based) backend necessary in
  the app_server to render gradients (Painter, DrawingEngine)
* app_server/View can convert a BGradient layout to screen
  coordinates.
* Added BGradient methods of the Fill* methods in BView.
* Implemented a test app and added it to the image as a
  demo.
* Adopted Icon-O-Matic and libs/icon in order to avoid
  clashing with the new BGradient class. Re-use some
  parts where possible.

Awesome work, Artur! Thanks a lot. Now a more modern
looking GUI has just become much easier to implement! :-)

TODO:
* Remove the need to have gradient type twice in the
  app_server protocol.
* Refactor some parts of the patch to remove duplicated
  code (Painter, DrawingEngine).
* Adopt the BPicture protocol to know about BGradients.
* Review some parts of the BArchivable implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 21:27:42 +00:00
Oliver Ruiz Dorantes 9e6975723d Header for a common kernel module to handle all BT Stack data structures. Its sources can wait...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28108 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 20:50:44 +00:00
Oliver Ruiz Dorantes 07e4b460ce Add flow specificacion command. Add port names being used among the Stack.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 20:34:30 +00:00
Oliver Ruiz Dorantes 2c6619e446 Styling and define module path outside the driver
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28105 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 20:28:22 +00:00
François Revol 86cb5b45da - Move MFP freq to a separate header
- initialize the time_base_frequency kernel arg (should be done in the bootloader though...). We will use MFP timer to support system_time(). At least try to.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 18:40:45 +00:00
Stephan Aßmus d3cfdf5740 Updated copyright.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28081 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 13:17:24 +00:00
Stephan Aßmus ed3215ee21 Save one check in certain situations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28080 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 13:16:44 +00:00
Axel Dörfler c7cf50a4e5 * Added a handy BDiskSystem::SupportsWriting().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:47:30 +00:00
Axel Dörfler 057f999da6 * Added a flag B_DISK_SYSTEM_SUPPORTS_WRITING to determine whether or not a
file system can write to files before mounting.
* Set the flag for all file systems that actually can write.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 22:32:27 +00:00
Axel Dörfler 38bbc95758 * Made the use of file devices more convenient and complete by adding
the methods IsFile() and GetFilePath() to BDiskDevice, and
  BDiskDeviceRoster::GetFileDeviceForPath().
* Added new syscalls to implement this functionality.
* Added new flag B_DISK_DEVICE_IS_FILE.
* Fixed wrong operator precedence assumption in the BDiskDevice class at
  several places.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:51:43 +00:00
Jérôme Duval b9de80bbb8 * updated build opengl headers to 7.2
* added opengl to build be api headers
* define USES_BE_API for gen_matypes
this should fix the build for Linux which don't provide GL headers :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 21:10:52 +00:00
Jérôme Duval a9d11d2365 updated mesa to 7.2
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 19:37:51 +00:00
François Revol 9a787d297d ADd platform hooks to read RTC. platform code should mimic the PC CMOS chip.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 13:55:57 +00:00
François Revol 7d49488b80 - cleanup
- remove dead ppc code
- add support for probing hardware registers the way linux does (early, hook with VBR to trap faults)
- detect MFPs this way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 12:56:16 +00:00
Axel Dörfler ddecb4a7da * Changed the way the demangle functionality works: instead of having a kernel
debugger add-on set a demangle hook, all modules under debugger/demangle/ are
  now considered demangle modules.
* Added another function to the demangle module interface that gives you access
  to the arguments.
* Implemented a demangling module for GCC2.
* The older demangling module is now called "gcc3+", but doesn't support
  getting the arguments yet.
* The "call" KDL command is now using demangling to automatically show you
  the arguments of a call from a stack crawl.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:50:41 +00:00
Stephan Aßmus 71ea6c9229 * Refactored a method for getting the transit from a mouse moved message.
* In _StealMouseMessage(), don't maintain fLastMouseMovedView, instead,
  prevent B_MOUSE_MOVED message from being stolen that are important for
  detecting transit changes. The point is that some apps (like Tracker) are
  shooting themselves in the foot because they steal mouse messages via
  GetMouse() in one place, but then rely on sane transit values in another
  place. The way it works now, the view in question may get notified of the
  same mouse moved coordinate twice, once via GetMouse() and once via
  MouseMoved().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 19:30:59 +00:00
François Revol 5222f12a32 - Add m68k pendant of: r27529 & r27778 - handle skipIframes parameter
r27530 - allow faults with ints disabled if there is a handler
r27648 - call the end-of-interrupt thread callback
r27718 - add <asm_defs.h>, not used yet
r27722 - register the commpage as image and symbols (but we don't use it yet)
- remove dupped call to thread_get_current_thread()
- use 16MB iospace for now, 4MB seems too small.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 18:13:11 +00:00
Ingo Weinhold c73aeac11e We need to let the runtime loader call shared object termination hooks
from exit().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 12:26:27 +00:00
Axel Dörfler 27e0dea9f0 * Actually implemented the SO_BINDTODEVICE socket option I added some time ago.
* This makes it possible to select a specific device, even if no interface
  has been configured for it yet. To make it work, each interface now has a
  private direct route which will be returned if a socket is bound to a device.
* This will be used for example in DHCP to make it work when more than one
  adapter is attached.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 22:10:31 +00:00
Ingo Weinhold 1b6eff280f * Replaced the vm_get_physical_page() "flags"
PHYSICAL_PAGE_{NO,CAN}_WAIT into an actual flag
  PHYSICAL_PAGE_DONT_WAIT.
* Pass the flags through to the chunk mapper callback.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 20:55:32 +00:00
Ingo Weinhold 6503e5d9c6 Added functions to pin a thread to the current CPU (i.e. it will only be
scheduled on that CPU) and to avoid unscheduling it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 18:11:12 +00:00
Oliver Tappe c4c2a6192d * we no longer demand the socket that receives a broadcast
datagram to have the SO_BROADCAST flags set (the flag
  is only needed for sending a broadcast) - fixes part of 
  #2065 

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 17:28:57 +00:00
François Revol de398d21ff Remove that cirrus driver I never really started on. QEMU is getting vmware graphics support anyway now.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 15:05:11 +00:00
Ingo Weinhold 4eaa43ac48 * Added "flags" parameter to VMCache::Read().
* Use the new VMCache::Read() flags parameter to directly read into the
  physical page in the page fault handler instead of mapping it first.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 07:30:44 +00:00
Axel Dörfler 2716cfd3d7 * Threw away the broken stat() vs. _stat() mechanism to allow for more fields
in struct stat.
* Instead, I followed Marcus' great idea and added a compatibility check in
  the runtime loader: now, R5 binaries (also shared libraries) are detected,
  and they get special versions for stat(), fstat(), and lstat() that return
  the smaller stat struct.
* However, I've disabled (in src/system/libroot/posix/sys/stat.c) using the
  larger stat field for now, as this breaks some of our optional packages.
  So until we rebuild them all, this shouldn't be enabled.
* This should now also be used for BeOS compatibility in libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27961 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 22:13:05 +00:00
Karsten Heimrich fe93c7b3ea * rewrote BTime to operate entirely on microseconds
* added some convenient functions, operator etc...
* reused parts of the patch by Stephen Deken, thanks



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 18:51:15 +00:00
Ingo Weinhold cfe2aa898c Should have been part of the previous commit. x86 commpage definition
for memset().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 18:44:44 +00:00
Ingo Weinhold b18c9b97ae * Implemented x86 assembly version of memset().
* memset() is now available through the commpage.
* CPU modules can provide a model-optimized memset().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27952 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 18:43:46 +00:00
François Revol 68083f29a3 The last 16MB (physical) on Atari is used for IO, and we currently map it through transparent translation register. Move commpage out of the way.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-09 09:48:08 +00:00
Ingo Weinhold 74785e79db * Added "from" address space parameter to vm_swap_address_space()/
arch_vm_aspace_swap().
* The x86 implementation does now maintain a bit mask per
  vm_translation_map_arch_info indicating on which CPUs the address
  space is active. This allows flush_tmap() to avoid ICI for user
  address spaces when the team isn't currently running on any other CPU.
  In this context ICI is relatively expensive, particularly since we map
  most pages via vm_map_page() and therefore invoke flush_tmap() pretty
  much for every single page.
  This optimization speeds up a "hello world" compilation about 20% on
  my machine (KDEBUG turned off, freshly booted), but interestingly it
  has virtually no effect on the "-j2" haiku build time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 21:39:19 +00:00
Ingo Weinhold 6bbe7eb8ca * smp.c -> smp.cpp
* Added smp_send_multicast_ici(), which sends the message to all CPUs
  specified via a mask.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 21:14:24 +00:00
Ingo Weinhold dbe295f827 Moved vm_translation_map_arch_info definition to the header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27902 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 11:49:13 +00:00
Ingo Weinhold e43cb37bcd Moved several VM related debug settings to kernel_debug_config.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-05 13:15:04 +00:00
Axel Dörfler c1379d357b Update for the S3 driver by Gerald:
* The hardware cursor is now disabled at 640x480 with a Virge VX (before it
  was just invisible).
* EDID info can now be read for all S3 chips.
* For the Savage IX, Savage MX, and SuperSavage chips the display is no 
  longer expanded to fill a laptop LCD display when the mode resolution is 
  less than the size of LCD display.
* Savage IX, Savage MX, and SuperSavage chips will now display mode 
  1400x1050 on a 1400x1050 laptop LCD display.  Previously the display was 
  blank at that resolution. 
* Previously about half the Savage chips would not draw properly at 
  1400x1050.  That is, the image was badly skewed and unusable.  All of 
  them now draw properly at 1400x1050.
* Some code was reorganized to remove unnecessary and redundant code.  


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-04 08:09:40 +00:00
Stefano Ceccherini 4e0c2a797d Menus can be scrolled also using the mouse wheel
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27844 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-03 06:03:27 +00:00
Ingo Weinhold 567f78895b Fully inline {disable,restore}_interrupts() and friends when including
<int.h>. Performance-wise not really significant, but gives nicer
profiling results.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27827 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-01 14:33:10 +00:00
Ingo Weinhold f8bdc2443d Created a central place for putting kernel debug enabling macros.
Currently it only contains KDEBUG and the block cache debugging macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-01 11:56:44 +00:00
Axel Dörfler b2ec044cb8 * Added stat::st_blocks field as required by POSIX. This also closes ticket
#2261.
* Made at least BFS report it more or less correctly (the attributes are
  ignored, though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27791 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-30 14:16:39 +00:00
Stephan Aßmus dc55af6452 Applied patch by Urias McCullough:
* Added stdio_ext.h header with declaration for the only currently implemented
  stdio extensions fsetlocking() and flushlbf() and associated constants. This
  helps compiling some software like gettext and cvs.

NOTE: I have not tested this myself, but trust the review done by Andreas
and Scott.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-30 10:04:22 +00:00
Ingo Weinhold f965a969b1 Extended the profiling API. When using the variable stack trace depth
buffer format, the buffer can now also contain other events than just
stack traces. ATM these are only references to the image events
(created/deleted). Therefore we no longer have to flush the profiling
buffer after such an event, since the debugger can exactly match the
samples. Since we couldn't flush when the profiling timer hit while the
thread was in the kernel, that wasn't working that well anyway.
"profile -f" fails to translate stack trace addresses only very rarely,
now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-29 00:53:38 +00:00
Michael Lotz 7e1490e0ad Introduce some extensions to the USB v3 module API that allow for device
enumeration (getting roothubs, enumerating child devices and detecting device
topology) and hub port management (resetting and disabling ports). These were
laying around for quite some time.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-28 13:42:59 +00:00
Ingo Weinhold 0dc4d1e5ca Reverted r27685, r27676, r27665, and r27664, the changes related to
letting the boot loader provide full paths for the pre-loaded images.


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


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


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


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


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 20:17:58 +00:00
Ingo Weinhold 0135e2e324 * Increased the maximum profiling caller stack depth significantly.
* Extended the profiling API by an option to record a variable number of
  samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
  increments the hit counts of all symbols in the full available caller
  stack. I.e. the resulting hit counts will approximate the total time
  spent in each function or any function directly or indirectly called
  by it. Thus "_start" and "main" will usually get 100% and leaf
  functions only what time has actually been spent in them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27699 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 01:08:27 +00:00
Ingo Weinhold 114c07e6e2 Overdue copyright update.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27698 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 23:17:48 +00:00
Ingo Weinhold ab30ce0e84 * Removed obsolete B_DEBUG_MAX_PROFILE_FUNCTIONS.
* Relaxed the stack depth and profiling interval limits a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 23:03:25 +00:00
Axel Dörfler 4a47b14ea4 * Enlarged a single kernel_args chunk to 32 KB (was 16 KB).
* Reduced the kernel_args array size from 32 to 16 (7 are used on a normal
  build).
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 15:36:46 +00:00
Ingo Weinhold 65a9d40a9d * Added hash_dump_table() function, dumping the whole table.
* Fixed hash_remove_current(): It didn't update "lastElement" and thus
  always also removed all elements in the same bucket preceding the one
  to be removed. Also got rid of the useless "for" loop.
  Fixes #2757.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 14:58:40 +00:00
Ingo Weinhold 8839d592bc Added syscall _kern_read_kernel_image_symbols() for reading a kernel
image's symbol and string tables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-22 11:13:38 +00:00
Rene Gollent 90b7764dc3 Move WidthBuffer and TextGapBuffer into BPrivate and use them from there in BPoseView and BTextView. This (correctly) fixes the previous gcc4 build issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 20:47:16 +00:00
Rene Gollent 40ca6c57ee Declare BPoseView as a friend of BTextView. This allows it to use the private width buffer classes, and fixes the gcc4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 18:03:17 +00:00
Stephan Aßmus 8864334702 * First steps towards making BTextView behave well within the layout management.
* The class calculates a minimum width now, which is based on the line height,
  this may also fix the bug with the small text inputs in the Pe Find window.
* Added TODOs about implementing GetHeightForWidth(), which may be a good idea
  when a BTextView is used as non-editable informative text in an interface,
  and one wants to make sure that the entire text is shown.
* Replaced the call to _Refresh() in Draw(), which recalculates all the line
  breaks for no reason with _DrawLines() again. The TODO mentioned that text
  will be drawn without drawing the background first, but maybe this is a
  relict from times where Draw() was invoked directly? At least I cannot see
  any negative consequences, and this should be much more efficient.
  (Other than that, this patch should hopefully have no potential negative
  side effects...<crosses fingers>)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 15:36:44 +00:00
Ingo Weinhold 6aa2c9ecf1 * Directory stores its parent directory (if any), now.
* Adjusted used files systems accordingly.
* BFS::Stream::GetName() was broken. It accessed the small data region
  which wasn't loaded, since BFS::Stream derived from bfs_inode, which
  is a variably-sized structure with the small data region at the end.
  Changed that to a ref-counted, shared member instead.
* Implemented RootFileSystem::GetName().
* Added Directory::GetPath() to get a full path of the directory or an
  entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 12:55:41 +00:00
Stephan Aßmus e6378518c4 Fixed typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 09:15:35 +00:00
Stephan Aßmus 6168332c35 Sorry, should have been part of r27660. Moved BTextView::UndoBuffer derivatives
into BTextView class as well, hopefully fixing the GCC4 build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 08:43:06 +00:00
Ingo Weinhold ecfad924e0 Solution for the potential deadlock when needing to flush the profiling
buffer during a timer event that interrupted a kernel function: We do
now flush the buffer as soon as it is 70% full, *if* we didn't interrupt
a kernel function. When the buffer runs full and we still haven't hit a
user function, we drop the tick. The number of dropped ticks is recorded
and sent to the debugger with the next update message.
Reverted the previous partial solution (the temporary disabling of
profiling while in debugger support code).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 22:04:03 +00:00
Ingo Weinhold eba9a4c3ee * Introduced a per-team counter that is incremented whenever an image
is created or deleted (or exec*() has been invoked). The counter is
  sent with several debugger messages.
* Track the image event counter that is used when samples are added to
  the profiling buffer. If the current team counter differs, we flush
  the buffer first (sending an update message to the debugger), so that
  the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
  code. This fixes potential deadlocks which could occur when a
  profiling timer event occurred that would require the buffer to be
  flushed while the thread was just sending something to the debugger or
  waiting for a command. As it turns out, this is not sufficient either,
  since we should never try to flush the buffer when the timer event
  occurred in the kernel, since the thread might hold a lock that the
  debugger thread could try to acquire. Will implement a more general
  solution later.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27656 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 20:37:10 +00:00
Stephan Aßmus a682d9819f Quite a cleanup action to avoid polluting the global namespace with private
BTextView classes:

* Declared the directly used BTextView helper classes as private BTextView
  classes and changed all affected files.
* Realized that Tracker's BPoseView was (accidentally?) using what used to
  be _BWidthBuffer_. It had declared it's own class with the same name and
  same members/size in headers/private/tracker/TextViewSupport.h, but the
  implementation was nowhere to be found. I can only explain this that
  the BTextView implementation was then actually linked and used. But the big
  problem was that it was used without locking (unlike in BTextView)! When
  many Tracker windows opened during system startup or later and they happened
  to each request characters not yet in the cache, I imagine things could have
  gone bad and corrupted memory. Anyways, since I can see the usefulness of
  the cache, BPoseView uses BTextView::WidthBuffer on purpose now. And I moved
  the locking inside BTextView::WidthBuffer::StringWidth().
* Adjusted InterfaceDefs.cpp accordingly.
* TODO: Move subsequent classes into BTextView namespace as well, ie derived
  classes that BTextView doesn't directly know about. All stuff in src/kits/
   inteface/textview_support/
* Added preliminary and not yet implemented layout friendly BTextView
  constructors.
* I will try to handle the insets imposed by BTextView::fTextRect a bit
  differently when used inside the new layout management framework. For this,
  I added BTextView::SetInsets() and GetInsets(). SetInsets() doesn't do
  anything yet.

So far, everything seems to work still... ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 15:08:40 +00:00
Ingo Weinhold 4ed8088f9a Added new debugger message B_DEBUGGER_MESSAGE_TEAM_EXEC, sent when
exec*() has been called.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27650 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 13:59:41 +00:00
Ingo Weinhold 78b13af677 The handling of a full profiling buffer couldn't work for two reasons:
* We can't enable interrupts in an interrupt handler. Instead we use the
  newly introduced callback feature, which notifies the debugger right
  before returning from the interrupt.
* We didn't indicate that the profiling buffer was full and that the
  thread shouldn't be profiled ATM. Therefore it could happen that it
  was profiled while trying to notify the debugger that the profiling
  buffer was full, resulting in a deadlock. Introduce a respective flag
  in the thread debug structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 12:44:41 +00:00
Ingo Weinhold 23884ae025 Introduced a callback field in the thread structure. It can be set in an
interrupt handler and will be executed right before returning from the
interrupt.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 12:38:27 +00:00
Stephan Aßmus 37b9874302 Update header indentation style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 10:09:32 +00:00
Ingo Weinhold 424f833bc9 * Changed the profiling API: Instead of sending all functions that shall
be tracked to the kernel, which then counts the hits, an area is
  passed to kernel in which the hits are recorded. When the area is
  full, the debugger is notified. For some reason that part doesn't work
  yet -- the whole system freezes when waiting for a reply.
* Reorganized the profile tool code a bit. For one with respect to the
  changed API, but also to prepare tracking of image creation/deletion.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 00:34:03 +00:00
Axel Dörfler 491da20dbf * Added a is_timer_running() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-19 09:11:12 +00:00
Axel Dörfler 8f3c0d9fcc * wait_for_timer() now returns a status code.
* wait_for_timer() now detects if it has been called from within the timer
  execution thread, and will return in error instead of waiting for itself
  forever. This fixes bug #2682.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-18 12:45:43 +00:00
Axel Dörfler ca7cb625b9 * Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
  accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 16:27:17 +00:00
Stefano Ceccherini 6dcce65687 port the changes made to the libbe counterpart (r27297 and r27485)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 09:15:48 +00:00
Jérôme Duval bacba30b6f white space cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 21:31:47 +00:00
Stephan Aßmus 43f8c6143a * Updated the coding style.
* The layout friendly constructors don't need to mess with the control size.
* The layout friendly constructors can use the respective BControl constructor.
* Refactored some duplicated code.
* Removed duplicated GetFontHeight() calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 15:08:02 +00:00
Stephan Aßmus 349c911ee9 * Implemented a lot of layout related methods and resolved a few TODOs by
doing a lot of these things the same way as BMenuField are already doing.
  Perhaps a private helper class could be refactored from these two controls
  to avoid duplicating a lot of this code, although there are a few subtle
  differences here and there.

These changes make a BTextControl behave properly in the layout management
frame work, in case CreateLabelLayoutItem() and CreateTextViewLayoutItem()
are _not_ used to layout the BTextControl.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 10:50:31 +00:00
Stephan Aßmus 08edea662b * Don't set an explicit max size, instead calculate a proper max size in
MaxSize(). This makes sure that MaxSize() returns a proper size when the
  user "unsets" the explicite max size.
* minimum label height is 0 if there is no label.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-16 10:45:27 +00:00
Stephan Aßmus 93ba577c3e * Updated header indentation
* Removed unused fClean member
* Got rid of fSkipSetFlags member by simply calling the BView::SetFlags()
  directly where fSkipSetFlags was supposed to prevent the custom
  implementation.
* Added some debugging facilities.
* Used the layout friendly constructors of BControl where appropriate.
* Used B_FOLLOW_ALL for the child text input, it should be more correct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 19:43:18 +00:00
Ingo Weinhold 127f6d39ef Decreased minimum profiling sampling interval to 100 us. At least in
VMware this doesn't produce very good results though. In my tests I only
got twice as many hits as with 1 ms, although it should be roughly ten
times as many. Might work better on real hardware.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 15:02:40 +00:00
Ingo Weinhold cbcebd3330 * Extended the debugger API by sampling-based profiling support. This is
still pretty much work in progress.
* Introduced init_thread_debug_info() which is used instead of
  clear_thread_debug_info() when the thread is created. The latter
  requires former initialization.
* user_debug_thread_deleted() is now already invoked in thread_exit(),
  not in the undertaker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 13:36:31 +00:00
Ingo Weinhold e670fc6f63 Added new parameter "skipIframes" to arch_debug_get_stack_trace(). That
many iframes are supposed to be skipped before recording the stack
trace. Currently implemented for x86 only.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 13:09:14 +00:00
Ingo Weinhold b4ec7b8ee5 Added (kernel private) B_PEEK_PORT_MESSAGE flag for read_port_etc().
When specified, the message is read but not removed from the port.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 12:59:49 +00:00
Ingo Weinhold 68e6763b07 Added functionality for iterating through the symbols of a debugged
team's image to libdebug.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 12:47:59 +00:00
Stephan Aßmus 14f6345690 Several fixes to BMenuField layout calculations.
* The most important fix is that in BMenuField::_ValidateLayoutData(),
  divider was calculated, but then never used. If the menu field was not
  using the layout management, it should take the existing fDivider into
  account, but never did. This caused #2728.
* Added some tracing that helped me debug this.
* Fixed a bunch of layouting inconsistencies. It will also improve some
  unnecessary resizing of the menu bar.

Will test all of this some more. But in the test app I do have, the BMenuField
works more like in BeOS now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 19:01:54 +00:00
Stephan Aßmus 0ce571055a This class helps me with tracing function enter/leave output. It is passed
a static integer that it uses for indentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 18:46:26 +00:00
Stephan Aßmus 21bb6bd22b * Update header indentation.
* Added BScrollBar::SetOrientation().
* Improved _DrawArrowButton() to have a good visual result even when the
  scroll bar does not have the standard width or height.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 19:20:18 +00:00
Fredrik Modeen 2d9f1f59b3 fixes pointed by Axel and some stile changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:29:30 +00:00
Jérôme Duval 53e8a878e6 isnan and isfinite are macros
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:45:17 +00:00
Jérôme Duval 645fa87a21 added lsearch and lfind
remove unknown infnanf and strtcopy functions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 22:27:55 +00:00
Salvatore Benedetto 40dae3708f * Adding msg{rcv,snd,get,ctl} syscalls to the system
* Add message queue init function call to main.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 15:03:01 +00:00
Salvatore Benedetto f22e1421a4 * Adding sys/msg.h header and relative syscalls
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-11 14:52:35 +00:00
Michael Lotz 89dda28052 * Extend the usb_raw interface by alternate interface aware getters for
interfaces, endpoints and generic descriptors.
* Add getter for active interface index and simplify the count operation as
  it isn't misused to also get interface descriptors anymore.
* Refactor out some common code into helper functions.
* Adapt the USBKit to the changed/new interface.
* Change how alternate interfaces are exposed by USBKit by providing normal
  BUSBInterface objects for alternate interfaces that can easily be examined
  and used.
* Make BUSBInterface class aware of its alternate index and use the alternate
  aware usb_raw functionallity to build the endpoint and descriptor lists.
* Add ActiveAlternateIndex() to find out what alternate is currently active.
* Style cleanup of the USBKit classes, use std::nothrow everywhere and check
  all allocations. Simplify some code by removing optimization where the benefit
  is questionable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27409 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 21:52:32 +00:00
Stephan Aßmus 1b0471487a Added layout friendly constructor (untested).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 21:07:32 +00:00
Stephan Aßmus 7bf5abf425 Implemented BSize returning layout methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 20:34:10 +00:00
Stephan Aßmus 8bd9493d55 "_IMPORT" was not defined, but most (all?) BeOS software that could be compiled
for PPC would give compiler errors if this is not defined (to nothing). For
the MetroWerks compiler, one needed to explicitely import/export classes and
methods, but GCC does not need it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 20:29:50 +00:00
Axel Dörfler cb387cfb2f * Added acpi_shutdown() method. If the ACPI bus manager is installed, this will
be used now. Tested only with VMware so far.
* apm_shutdown() is now called with interrupts turned on.
* Renamed arch_cpu.c to arch_cpu.cpp.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 19:50:08 +00:00
Axel Dörfler a181d013aa * Divided enter_sleep_state() to have a prepare_sleep_state() that accepts a
wake vector (not tested at all).
* Removed disabling interrupts when entering the sleep state - looks like
  ACPI still needs memory then.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-10 19:24:37 +00:00
Ingo Weinhold ee1a1571a2 Implemented a simple directory entry cache to speed up path resolution.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-08 05:08:37 +00:00
Jérôme Duval b0b788ce0c fixed Atom id. Thanks katisu!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-07 20:59:30 +00:00
Ingo Weinhold 3c529bf7fe * Retry in benaphore_lock() when interrupted.
* Added TODO in benaphore_lock_etc().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-07 15:27:14 +00:00
Ingo Weinhold dcadb2ba8d Patch by Zhao Shuai:
* Imported radix bitmap tree implementation from FreeBSD and adjusted it
  for Haiku.
* Make use of the radix tree in the swap support implementation instead
  of using simple bitmaps. This will allow for faster swap slot
  allocations. ATM Haiku doesn't benefit that much, since we always
  allocate single pages, but that will change eventually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-07 13:57:25 +00:00
Jérôme Duval ab2b993da9 added nexttoward()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 15:00:33 +00:00
Jérôme Duval bb97148298 added more posix functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 14:31:28 +00:00
Jérôme Duval 2eb280d3a8 added a few more math functions, rearranged some functions in math.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-05 23:21:33 +00:00
Jérôme Duval dc08d5dc1e added B_CPU_INTEL_ATOM, untested
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 19:08:05 +00:00
Ingo Weinhold e032a7f50e Scheduling analysis: Also record the number of times a thread waits on a
locking primitive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 00:07:11 +00:00
Ingo Weinhold 020ac56840 * Fixed bug in the "scheduler" command: The check when a thread was
unscheduled was incorrect.
* Introduced _kern_analyze_scheduling() syscall. It requires scheduler
  kernel tracing to be enabled. It uses the tracing entries for a given
  period of time to do a similar analysis the "scheduler" debugger
  command does (i.e. number of runs, run time, latencies, preemption
  times) for each thread. Additionally the analysis includes for each
  thread how long the thread waited on each locking primitive in total.
* Added kernel tracing for the creation of semaphores and initialization
  of condition variables, mutexes, and rw locks. The enabling macro is
  SCHEDULING_ANALYSIS_TRACING. The only purpose is to provide
  _kern_analyze_scheduling() with more info on the locking primitives
  (the name in particular).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 15:10:44 +00:00
Ingo Weinhold d5488b7703 Added ConditionVariable::ObjectType() getter.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:53:01 +00:00
Ingo Weinhold aa1a64f35a Added [un]lock_tracing_buffer(). This allows other components to analyze
tracing buffer entries even when not in the kernel debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27302 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:51:00 +00:00
Ingo Weinhold 232fd3bae3 Moved the wait type definitions to <thread_defs.h>. We're going to use
them in userland, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:48:47 +00:00
Ingo Weinhold dd1c278d4b Added elf_get_image_info_for_address() to get an image info for a kernel
image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27300 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:47:26 +00:00
Stefano Ceccherini 9fb13d5822 the virtual version is const
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 11:23:15 +00:00
Stephan Aßmus 3f524cfc8d Rewrote ChannelControl.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-02 11:28:32 +00:00
Rene Gollent 9442a1bb44 Just noticed this file was using CR/LF newlines...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27276 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 20:12:13 +00:00
Jérôme Duval 9c91170f95 added fpclassifyl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27272 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 19:37:23 +00:00
Jérôme Duval dd114a0c3f space cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27270 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 18:37:13 +00:00
Karsten Heimrich de13e4c0bd * implement julian day handling
* more get/ set functions, operators
* date until 1582 are handled in julian calendar
* date above 1582 are handled in gregorian calendar



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 13:11:29 +00:00
Salvatore Benedetto f273b13ddb * Renamed xsi_ipc_init() to xsi_sem_init() as there will be a xsi_msg_init()
for message queue
* Removed unnecessary header Vector.h
* Removed HasSemaphoreSet method: since there will be an IPC table for each
  subsystem, if a key exist, it already has a semaphore set associated
  with it


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:59:32 +00:00
Karsten Heimrich 870f6b196f * implement AddMonths(...) and AddYears(...) functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27255 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:37:37 +00:00
Salvatore Benedetto 9309ec8635 Start implementing POSIX message queue IPC
* Implemented _kern_msgget()

Work in progress, some stuff may be removed.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:31:08 +00:00
Salvatore Benedetto 29fd670a1b * Updated license
* Removed extraneous tabs
* Implemented lldiv (#2688)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 10:40:58 +00:00
Ingo Weinhold 3b3e3805f8 Added thread::io_priority field and functions to get/set it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 00:37:02 +00:00
Ingo Weinhold 4612433715 * Added parameter "size_t align" to file_map_translate(). If > 1, the
vector at the end of the file will be aligned to the given value.
* BFS uses an alignment of 512 bytes (should be block size of the
  underlying device or BFS block size, whatever is less), which should
  be fine, since file data are only stored in BFS blocks. This totally
  avoids any partial operations at the I/O scheduler level, thus saving
  disk operations. Not that I could measure any performance difference.
  Theoretically it should help a lot though, particularly when dealing
  with lots of small files, since we avoid using bounce buffers, which
  are (a) limited in number and (b) require copying of the data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 23:06:28 +00:00
Michael Pfeiffer f0932941dd Simplified initialization of week days for a month.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 16:13:05 +00:00
Karsten Heimrich 78092ae789 * move DateTime and CalendarView into shared
* adjust Time preflet to take that into account



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 19:26:58 +00:00
Ingo Weinhold 1d059a02b9 Enabled swap file support by default. I successfully built Haiku with
256 MB RAM, 1.5 GB swap, and "jam -j2", so it basically seems to do its
job alright.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27233 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 13:48:55 +00:00
Stephan Aßmus ec56835f51 Patch by David Powell:
* Implement color palette generation for the boot splash images in the
  generate_boot_screen build tool. Only 4-bit screen support is missing now.
* Adopted images.h with the new results from generate_boot_screen.

This should fix black boot screens for graphics cards that don't support
true color modes for the native resolution. I've tried to find the ticket,
#2177 almost looks like the one, but it looks more like the mode is out
of range if I understand the ticket right.

Thanks a lot, David, and sorry it took so very long to apply your patch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 16:59:34 +00:00
Stephan Aßmus 740fe892ac Added a BColorQuantizer class to the "shared kit" based on a patch by David
Powel. The functionality was written by Jeff Prosise and Davide Pizzolato and
has been cleaned up and adopted to the Haiku coding style by David Powell and
myself. The class can perform a color quantization for generating the optimal
color index palette (with given maximum size) from a given RGBA image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 16:33:12 +00:00
Ingo Weinhold 0490454cb8 Made safe to be included from assembly code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-27 12:50:56 +00:00
Ingo Weinhold 18f2a9c17d Added support for architecture specific debug variables, e.g. for
referencing iframe registers. Their prefix is "$". E.g. "$eax" refers to
the eax register of the current iframe. The features cooperates with the
"in_context" command, i.e. "in_context 92 $eip = 0" will set the eip
register of thread 92 to 0 (thus sealing its fate ;-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 23:01:43 +00:00
Ingo Weinhold ed43619500 * vm_page: Swapped members usage_count and wired_count. We lost 4 bytes
due to alignment padding before.
* Reorganized merging of caches a bit. Renamed MergeStore() to Merge()
  and moved some more functionality into it. The method also moves the
  pages from source to consumer, now. This is necessary, since
  VMAnonymousCache needs to consider both physical pages and swap pages
  at the same time. Before we first moved the physical pages and the
  swap pages later, which was broken for two reasons: (1) A swap page in
  the consumer cache shadows a physical page of the source cache, which
  we ignored. (2) A source cache's physical page that also had a swap
  page would lose the latter in the process when moved to the consumer
  cache, i.e. if the page was not marked modified, it could be stolen
  and its data would be lost.

These changes improve the situation when building Haiku with 256 MB RAM
in that jam doesn't crash anymore, but in my test the system became
totally unusable after about an hour or 7000 targets (GUI froze). For
some reason it didn't manage to free pages anymore although swapping
heavily.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 19:01:01 +00:00
Fredrik Modeen 88b0546730 Code cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 11:16:31 +00:00
Fredrik Modeen 9ae4d7e586 Code cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 11:16:14 +00:00
Ingo Weinhold 0739b87ee9 * Added arch_debug_get_interrupt_pc(), which is supposed to return the
PC of the innermost iframe.
* The "in_context" command does now set the currently debugged thread
  respectively.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:59:21 +00:00
Ingo Weinhold ec16be9366 Added i386_get_current_iframe(), returning the innermost iframe, if any.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:55:43 +00:00
Ingo Weinhold 290e3dd228 Introduced the notion of a currently debugged thread in the kernel
debugger and added respective getter/setter methods
debug_{get,set}_debugged_thread(). By default the currently debugged
thread is the thread that dropped into the kernel debugger, but commands
like "in_context" can change it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:54:49 +00:00
Ingo Weinhold 07569b03c9 * Added kernel private thread_state_to_text() which just calls
state_to_text().
* state_to_text() can now deal with a NULL thread argument.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:51:22 +00:00
Ingo Weinhold 0deddbe36c Added function parse_next_debug_command_argument(), which parses the
first command line argument of a given command line string.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 15:38:57 +00:00
Axel Dörfler 5a123e3591 * Added a post boot device module init function that unloads all unused modules,
as they aren't unloaded when there is no boot device yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 09:41:10 +00:00
Stefano Ceccherini 17d39c90b1 code for initializing hpet in the bootloader. Moved around some hpet definitions. HPET initialization is commented out, at the moment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:15:14 +00:00
Stefano Ceccherini 6a8cce077f add hpet locations to the kernel_args. Patch by Dustin Howett (GSOC)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:03:25 +00:00
Ingo Weinhold 77b93362c2 * Refactored the kernel daemon code into a class.
* Added a second kernel daemon service, resource resizer, which is
  mainly supposed to be used for resizing allocations asynchrounously.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 01:13:18 +00:00
Ingo Weinhold fc06a3f822 Added methods that allow asynchronous resizing of the hash table.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 01:10:24 +00:00