Commit Graph

4795 Commits

Author SHA1 Message Date
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
Ingo Weinhold 9445c73970 * Fixed spelling typo.
* Switched from new[]/delete[] to malloc()/free().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 23:17:27 +00:00
Ingo Weinhold 1e90630527 * Added a "flags" parameter to vm_create_anonymous_area() and
create_area_etc().
* When the new flag CREATE_AREA_DONT_WAIT is specified, the functions
  don't wait for memory or pages to become available. They fail
  immediately instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 22:50:11 +00:00
Ingo Weinhold 2e8e6c9c6e Introduced vm_page_try_reserve_pages(), which fails when not enough
pages are free ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 22:43:52 +00:00
Jérôme Duval cc57c65424 updated libpng to 1.2.31: 1.2.30 had at least one serious regression
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 22:34:27 +00:00
François Revol e097cf0ba2 warning about to be fixed address collision
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 13:50:31 +00:00
Ingo Weinhold 1cda5944ad Added object_cache_set_minimum_reserve() which sets the minimal number
of free objects an object cache should try to have ready. If the number
of free objects drops below the threshold, a new urgent priority thread
is asked to asynchronously resize the object cache (pretty similar to
the heap grower thread). Such a mechanism is necessary for code paths
that are supposed to free pages, but may need memory themselves (like
the swap support).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:21:37 +00:00
Ingo Weinhold 9e637a6a84 * Added heap_set_get_caller() which can be used when heap leak checking
is enabled to set a per-heap get_caller() function.
* Added "-h <heap>" option to the "allocations_per_caller" command. If
  given only the allocation for the specified heap are considered.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27097 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:04:12 +00:00
Marcus Overhagen 1d19f96fff Removed my Copyright notice, assign future copyright to Haiku Inc, in contribution to ticket #2191
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 19:28:41 +00:00
Ingo Weinhold 2a79a7686f * VMCache::Write(): Added "uint32 flags" argument which is supposed to
be passed on to the IORequest. Most relevantly physical pages can now
  be written directly by passing B_PHYSICAL_IO_REQUEST.
* Added VMCache::WriteAsync() which is supposed to write pages
  asynchronously. The base class version version falls back to the
  synchronous Write(). Only VMVnodeCache implements WriteAsync() ATM,
  VMAnonymousCache (swap support) still has to be adjusted accordingly.
* write_page() doesn't need to map the page anymore as it can write the
  physical page directly.
* Modified the page writer to write pages asynchronously. This shouldn't
  have any noticeable effect yet. It will though as soon as the I/O
  scheduler reorders I/O operations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 23:28:34 +00:00
Ingo Weinhold 663948966c Added method vfs_asynchronous_write_pages(), which, unsurprisingly,
writes the given page iovecs asynchronously. The new class
AsyncIOCallback is used to inform the caller when the request has been
finished.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 23:09:10 +00:00
Jérôme Duval 13b2ca0205 updated mesa to 7.0.4
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27047 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 20:19:01 +00:00
Axel Dörfler 6e006912aa * Added ConvertToCMAP8() bitmap variant.
* Put header guards in the system namespace.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:40:01 +00:00
Axel Dörfler a3901de208 * Build fix: this should have been part of the last commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27030 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:03:03 +00:00
Jérôme Duval 0b25da8b45 updated libpng to 1.2.30
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27012 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 22:03:24 +00:00
Axel Dörfler 8ce6cfc999 * Added two more public functions: get_named_icon().
* Implemented B_GET_ICON_NAME in get_device_icon().
* Comments welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 14:32:33 +00:00
Axel Dörfler 06ba3f0acb * Added two new ways to retrieve an icon from a device:
- B_GET_ICON_NAME: returns the name of an icon. This will then be read from
    a predefined location on disk (not yet implemented). This would also allow
    to add specifiers like "-boot", or "-fat|bfs|ntfs|...", and have special
    icons for those.
  - B_GET_VECTOR_ICON: retrieves the vector icon of a device, if any.
* get_device_icon(BBitmap*, ...) now supports other color spaces than B_CMAP8.
* Added get_device_icon(), BPartition::GetIcon(), and BVolume::GetIcon()
  variants that can also retrieve the icon data directly (like
  BNodeInfo::GetIcon()).
* Reenabled the previous BPartition::GetIcon(), based on a patch by
  Justin O'Dell - this fixes #1391.
* Tracker's MountMenu class now uses B_RGBA32 icons, instead of B_CMAP8.
* Added vector icon to scsi_disk, and scsi_cd. The former doesn't have any
  special removable icon, though.
* Header cleanup, added/updated license, whitespace cleanup.
* Marked deprecated/obsolete driver ioctls in Drivers.h.
* Removed OpenBeOS namespace in the headers I touched that still had them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 11:27:07 +00:00
Salvatore Benedetto 6ae7f6879f * Reworked the way sem_undo requests are processed by following
Ingo suggestions: instead of having one global sem_undo list,
  we now have two local list, one per semaphore set and one per team
  which is held in its xsi_sem_context structure, along with a mutex.
  A mutex has also been added to the semaphore set class in order to
  protect the local list, but also in order to (hopefully) improve
  concurrency.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 18:20:54 +00:00
Axel Dörfler 63c96ae5a5 * Added find directory constants B_{BEOS|COMMON|USER}_DATA_DIRECTORY, which
currently points to /etc for the system, and dedicated "data" directories
  for common/user (the system directory should get a dedicated "data", too,
  though).
* Added B_USER_CACHE_DIRECTORY (in config/cache).
* These additions were discussed some years ago, but I just had a good reason
  to use them :-)
* Coding style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 11:05:59 +00:00
Oliver Ruiz Dorantes 85ce690475 Remove warning, use the common util function for the bdaddr utils class
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 19:08:48 +00:00
Axel Dörfler 6dc27eba0c * As requested by POSIX, we now have PTHREAD_STACK_MIN, and PTHREAD_KEYS_MAX
defined in limits.h.
* This closes ticket #2559.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 15:00:26 +00:00
Axel Dörfler 9e8be8bb9c * Added a net_timer::flags field, and used it to implement the new
wait_for_timer() function.
* Moved the internal Fifo class into utility.cpp - we should probably just
  remove it again.
* Fixed uninit_timers() so that it would even work in combination with the
  timer thread if there are timers left to be scheduled.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 14:46:16 +00:00
Axel Dörfler 70e2d4ac43 * Replaced the B_BLOCK_DEVICE_* defines with B_DMA_* defines that better match
our dma_restrictions structure (but we're using blocks instead of bytes,
  since unlike the block size, the restrictions attributes are constant).
* We might want to use blocks for the dma_restrictions structure as well in
  the future...
* Fixed another bug in the device_node variant of DMAResource::Init(): the max
  segment size was specified in blocks as well.
* Removed the "hardcode" block_io module and header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 15:08:16 +00:00
Ingo Weinhold f3e82cfe42 * Instead of a heap class index heap_create_allocator() gets an actual
heap_class object now. Removed unused heap_allocator::heap_class.
* Made heap_class, heap_create_allocator(), heap_memalign(), heap_free()
  public, so that a specialized allocator can be used elsewhere in the
  kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 00:40:40 +00:00
Axel Dörfler 80fb0607c5 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26959 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-13 12:50:53 +00:00
Ingo Weinhold ef7102fa29 * Made TraceEntryIterator available in the kernel.
* Fixed TraceEntryIterator::Current(): If fEntry was NULL, it would
  return 0x4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26955 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 21:16:15 +00:00
Axel Dörfler ae0606be74 * Added two more private InterfaceDefs functions: get_application_order(), and
get_window_order() will retrieve the application respectively window order
  on the selected workspace.
* Moved private BeOS compatible functions (as used by the Deskbar) into the
  private WindowInfo.h header.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:39:42 +00:00
Ingo Weinhold 46ec230162 When in the kernel debugger we do now record the relevant information
(fault address, pc, read/write) when a page fault occurs, and print them
in case this caused the termination of a debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:09:42 +00:00
Axel Dörfler 44cd4a02c7 * Deskbar's Switcher had an explanation what the window_info::layer field is
about. ServerWindow::GetInfo() now fills in that value following this logic
  as well as further testing.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 13:44:17 +00:00
Stephan Aßmus afbd081a6f * TRACE macro no longer needs double parenthesis.
* The global BPathMonitor looper is now always used, no more optional looper
  and no more BApplication looper usage. This way we know how the looper behaves
  and PathHandler::Quit() can be synchronous. In the end, the bug I was
  observing was not caused by the previous asynchronous node monitor stopping,
  but this should be safer anyways. When BPathMonitor::StopWatching() returns,
  you have really stopped watching and not some time later.
* Introduced "FileEntry" which is an entry_ref plus node id. This is now used
  instead of the node_ref for the "watched files set". The whole point
  is to really be able to add the "path" field to the B_PATH_MONITOR message.
  Previously, the initial path that was passed to StartWatching() was added,
  regardless if the message was for an entry somewhere down the hierarchy when
  watching recursively. The downside of the new method is that it uses a lot
  more RAM per entry. Another option would be to store the node id of the parent
  directory and iterate the directory always when in need to construct the path.
* Watching a folder recursively now really adds all the existing subfolders
  as well as all the files if not watching for folders only. The tests for the
  old implementation only tested what happens when the watched folder was newly
  created and then subfolders were created. Those where already added by the
  code. Now it also adds the subfolders of folder that appear in a watched
  folder.
TODO: Remove folders and files recursively when they dissappear. More testing
for B_ENTRY_MOVED. Optimizations are possible when some information is
retrieved twice. I am also planning to add a way for the BPathMonitor user to
filter the automatically watched files/folders in B_WATCH_RECURSIVELY mode.

I grepped the entire Haiku tree for usage of BPathMonitor. Only net_server
and Mail were using it, but both in a way that is not affected by these
changes. Anyways, TextSearch works more reliable now, even for entries in
subfolders.

Feedback very welcome! :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 20:02:59 +00:00
Axel Dörfler 8f38768e65 * Don't define DEBUG in public headers!!! Doing it this way will break the
build for others, namely those that also include <Debug.h>
* This fixes the remaining problems of building Pe under Haiku.
* Those files need a giant style cleanup... Fredrik, time to have a look at
  our style guide :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26931 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 16:45:26 +00:00
Karsten Heimrich 4b7da592ee * first steps towards a new printer api...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 23:26:38 +00:00
Salvatore Benedetto 461106374f * Fix year in license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26922 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 17:02:34 +00:00
Salvatore Benedetto 4093d16d51 * updating license
* use _{BEGIN|END}_DECL macro instead of ifdef C++



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 16:29:51 +00:00
François Revol 0bdaf02821 Start of a file map disk driver for the bootloader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 01:24:01 +00:00
Oliver Ruiz Dorantes 696b8e46f3 Move header to private, is meant to be used by acl component as well
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-09 20:47:30 +00:00
Ingo Weinhold 4d121ec067 Patch by Andreas Faerber with changes by myself: Work towards Solaris
build platform support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-09 15:36:24 +00:00
Ingo Weinhold a9d7be0708 * Implemented mprotect(). A vm_area does now have an optional array
specifying the protection of each page (4 bits per page).
* Added no-op implementation of posix_madvise().
* Replaced a few "addr_t size" parameters by "size_t size".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26871 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 01:00:06 +00:00
Salvatore Benedetto b3ae704659 * fix year in copyright
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 10:59:35 +00:00
Salvatore Benedetto 40353b088c * Updating license
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26855 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 08:14:09 +00:00
Stephan Aßmus f7c226f467 * StartWatching() now takes an optional BLooper pointer. This looper will
then be used for receiving node monitoring messages.
* Reenabled using be_app as default BLooper if the API user does not provide
  one. I think the problem that Stefano needed to work aroung in r23995 was
  actually caused by the incorrect locking (an never unlocking) of the looper
  before calling PathHandler::Quit().
->If I understand correctly, this code as supposed to work around the possible
  situation that the looper holding those PathHandlers may have already quit,
  leaving stale PathHandler pointers behind. But that case was not prevented
  by the old code anyways, since one would have had to access freed memory to
  even get the stale BLooper pointer. The real fix would be to store the
  BLooper pointer with each PathHandler so that the possible gone-ness of
  those loopers could be checked independent of accessing the PathHandler
  pointer. (The whole problem is that PathHandler adds itself to the BLooper
  and if the looper quits, it will free all its attached handlers.)
* Introduced a global fallback BLooper for the case that no BApplication is
  running, which resolves a TODO.

All this is yet untested, but should have a good chance of working.
(Famous last words...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26843 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 16:56:24 +00:00
Axel Dörfler f8009f7ba4 * Applied patch by kaliber: those headers weren't self-containing.
* This closes bug #2346.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 10:01:53 +00:00
Ingo Weinhold 8d12bd1370 * Moved the incrementing/decrementing of vm_page::wired_count into
dedicated functions.
* Introduced gMappedPagesCount variable which counts the total number of
  physical pages that are mapped.
* Added vm_page_get_stats() which fills in the memory related part of
  the system_info structure. Used and cached pages are computed
  differently, now. The "available" (== not committed) memory is no
  longer used for the computation as it doesn't say anything about the
  actually used/free pages (with swap support enabled it is even
  less meaningful, since we first commit swap space when possible).
  We do also consider the memory used by the block cache as cached
  pages, now. All in all these changes should fix the memory statistics
  reported by get_system_info(), IOW bug #2574.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:28:28 +00:00
Ingo Weinhold c79e66abb7 Added block_cache_used_memory() that returns the memory allocated by all
block caches for the block cache buffers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:09:31 +00:00
Ingo Weinhold 5db876653b Added object_cache_get_usage() function that returns the memory
allocated by an object cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:07:55 +00:00
Oliver Ruiz Dorantes 8bd7491914 Commit the file i forgot yesterday (ioctl change and cleanups)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 22:12:24 +00:00
Axel Dörfler 24593e2c79 * First baby steps in letting our drivers use the new I/O request/scheduler
architecture: for now, we do this on the lowest layer only, therefore all
  requests are handled synchronously (ie. in the scheduler's thread).
* Instead of using the block_io module, scsi_disk (and scsi_cd) are now
  exporting a device on their own, and use an I/O scheduler with an appropriate
  DMA resource.
* There are still lots of TODOs, and it can easily panic - don't update if
  you intend to demo Haiku.
* scsi_periph now only has an io() function that get an io_operation, instead
  of the previous read/write functions, moved preferred CCB size from those
  functions into the device registration.
* Changed all scsi_periph files to C++.
* scsi_cd ported, too, but untested.
* Removed block_io from image - it will be removed completely soon.
* Temporarily commented an ASSERT() in the ATA bus manager (in case you use
  it); it's sometimes triggered by the code now, and I haven't yet looked into
  the issue -- doesn't seem to harm, at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26828 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 21:11:51 +00:00
Axel Dörfler 8169e6b4e6 * Patch by Andreas that adds sched.h, and sched_yield() to Haiku.
* This closes ticket #2568.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:54:14 +00:00
Ingo Weinhold 57f2b5a013 * Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not
include the guard pages. Adjusted the kernel and boot loader code
  accordingly -- the guard pages size is added/not removed respectively.
  The stack size passed to _kern_spawn_thread() is now the actually usable
  size, and it is no longer possible to specify a size smaller than or
  equal to the guard pages size.
* vm_create_anonymous_area(): Precommit two pages maximum -- a stack with
  only one page usable size obviously doesn't need two pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:19:46 +00:00
Karsten Heimrich 6e758d67b9 * cleanup
* sync against the preview driver
* fixed totally broken multiple pages on single page preview



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26812 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 23:29:40 +00:00
François Revol 6ac63f933f - fix warning
- fix build (weird ioctl name)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26811 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 23:18:03 +00:00
Ingo Weinhold 783c4e20b4 Added comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 21:45:50 +00:00
Oliver Ruiz Dorantes 20a5113818 - Proper const use
- Styling



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26802 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 19:10:43 +00:00
Oliver Ruiz Dorantes af9ccaf254 Use const reference as input parameter as suggested by julun
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 17:58:09 +00:00
Oliver Ruiz Dorantes 8976dbe878 - First steps for SCO connections
- Some styling 
(Mika Lindqvist)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26799 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 17:14:06 +00:00
Axel Dörfler 423fcd43ae * Shuffled initializers around: the team, ELF, and module initializers come
now a lot earlier.
* That makes it now possible to use modules pretty early in the kernel (like
  before timer_init(), or int_init_post_vm()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26790 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 13:26:13 +00:00
Stephan Aßmus b5bc41debf * Use new header layout in PathMonitor.h
* Honor 80 char/line limit in PathMonitor.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26788 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 13:04:45 +00:00
Axel Dörfler 3c1a3047a4 * Added file_cache_is_enabled() function.
* Added file_map_set_mode() function that you can use to keep a whole file
  cached. This is needed for the swap file support: FILE_MAP_CACHE_ALL will
  not only precache all file_io_vecs when called, but it will also cause all
  file_map_translate() calls to fail that would require further caching (ie.
  if the file size had changed).
* Updated the fs_shell file map code to the latest one (with several bug fixes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 08:28:17 +00:00
Ingo Weinhold bf877a18ab Should have been part of r26779.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:19:10 +00:00
Ingo Weinhold 7491000f20 Added functions file_cache_{disable,enable}(). They allow to disable
actual caching in the file cache, i.e. all reads and writes go directly
to the underlying device. The implementation is not quite complete,
since the VM can still add pages to the cache when the file is mmap()ed,
which can lead to inconsistencies.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:15:50 +00:00
Ingo Weinhold 2f462cb8e9 Copied AutoDeleter.h for use in the FS shell.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:03:31 +00:00
Ingo Weinhold bca3215f8a * Introduced x86_get_double_fault_stack(), which returns the address
and size of the double fault stack.
* is_kernel_stack_address() does now also check whether the given
  address is on the double fault stack. This fixes stack traces on
  double faults, which were broken (i.e. went only to the double fault
  iframe) since we started checking whether the addresses are on the
  kernel stack at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:51:38 +00:00
Fredrik Modeen c3c574689d and now the files
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26767 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 18:29:21 +00:00
Fredrik Modeen cf859cccf6 Some small updates to joystick.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26763 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 18:20:05 +00:00
Axel Dörfler 6449b66e22 * As pointed out by Andreas, the previous patch wasn't really correct; ALLPERMS
should really contain all permission bits.
* It now uses S_ISVTX instead of S_ISTXT - this is how it works in Linux as
  well, while FreeBSD uses S_ISTXT there (but S_ISTXT and S_ISVTX have the
  same value there, too).
* Also fixed the fs_shell this time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 16:30:30 +00:00
François Revol 39eb52d83b Implemented keyboard input for KDL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 15:57:03 +00:00
Stephan Aßmus 59e13a3f06 Patch by Andrej Spielmann (GSoC):
* Simplified the subpixel related methods for the AGG "pixel format" template
  interface, the ones for the solid cover simply pass through the existing
  methods, so only one subpixel blending function is left which does the actual
  work (this removes a lot of the previously added code)
* Implemented a new rasterizer based on the original AGG rasterizer which
  implements subpixel anti-aliasing for any generic AGG vector pipelines. It
  is now optionally used in Painter and AGGTextRenderer (for vector fonts, ie
  rotated, sheared or big enough fonts) depending on the global subpixel
  setting.
* Put all subpixel variables into the new GlobalSubpixelSettings.h|cpp
* Simplified DesktopSettings related classes a bit and renamed previous
  FontSubpixelAntialiasing to just SubpixelAntialiasing.
* The private libbe functions for subpixel related settings moved from Font.cpp
  to InterfaceDefs.cpp where other such functions live. They are not related
  to fonts only anymore.
* Removed the subpixel related settings again from the Fonts preflet and added
  them to the Appearance preflet instead.

All of the above implements subpixel anti-aliasing on a global scale, which
to my knowledge no other OS is doing at the moment. Any vector rendering
can optionally use subpixel anti-aliasing in Haiku now. The bitmap cached fonts
are still affected by the Freetype complile time #define to enable the patented
subpixel rasterization (three times wide glyphs). Vector fonts and shapes are
not affected though at the moment.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 13:40:41 +00:00
Axel Dörfler 826df7bec8 * Patch by Andreas Färber: remove undefined S_ISTXT from ALLPERMS.
* This fixes bug #2560.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 12:51:40 +00:00
Oliver Ruiz Dorantes 001662ae04 A bit more styling on main headers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 21:15:02 +00:00
Axel Dörfler 011d716270 * Removed the feature_string from the cpu_ent structure.
* Dumping the features as string is now a one time thing, that only happens
  when DUMP_FEATURE_STRING is defined to 1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26733 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 15:50:50 +00:00
Axel Dörfler 272457553e * Renamed kernel_startup to gKernelStartup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 15:03:03 +00:00
Axel Dörfler 15374c5dbd * Renamed thread_spinlock and team_spinlock to gThreadSpinlock and
gTeamSpinlock.
* Renamed the static global variables in smp.c to match our style guide.
* Minor other cleanup.
* Removed superfluous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 14:55:53 +00:00
Salvatore Benedetto 51daeb7147 - Fixed warnings
- Fixed deadlock in xsi_sem_undo - RecordUndo
- Fixed issue in xsi_sem_undo: if the semaphore set does not exist
anymore, ignore the request but do remove the process from the sUndoList,
which wasn't previously done.
- free() in ClearUndos was called with interrupts disabled
- when a semaphore set ends to exist, remove all it's sem_undo request as it's ID
will be reused in the future.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 11:30:55 +00:00
François Revol 2fc21d4fad Use a bool to check if an irq was acknowledged by the MFP, else we don't call the handler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:36:33 +00:00
Axel Dörfler cc6c784ae7 * Sean C. Farley made me aware that some of the possible solutions to clear
the environment would crash on Haiku. Added a small test application that
  just checks every one of those.
* Fixed env locking (in userland, you better check against B_INTERRUPTED).
* Made our code safe against an environ of NULL.
* There is now an additional sManagedEnviron that points to the environment
  our code actually managed; whenever an application overrides environ, we'll
  get aware of it with the next *env() function invocation, and will handle
  it adequately.
* Added non-POSIX clearenv() function.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 15:02:03 +00:00
Axel Dörfler 9f6ae76f02 * Added acquire_vnode() call that you can use to get another reference to an
inode - unlike get_vnode() the busy flag won't prevent you from getting that
  reference.
* Changed put_vnode() to return an error in case the vnode couldn't be found.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 09:59:19 +00:00
Axel Dörfler aaad303e67 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26712 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-01 09:57:14 +00:00
Oliver Ruiz Dorantes ceddc28636 Bring to the stack the LinkKey datatype by Mika Lindqvist
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26707 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:11:42 +00:00
Oliver Ruiz Dorantes 26e7ba5602 More Stylistic changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:08:27 +00:00
Oliver Ruiz Dorantes b48fa68ace Fix bluetooth_server debug window tabs, they were getting out of bounds due the index assignation
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 21:03:17 +00:00
Ingo Weinhold 12c9f1761f * Added thread block type constant for rw_locks, so that they are listed
correctly by the "thread" and "threads" debugger commands.
* Added "rwlock" debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 20:43:40 +00:00
Oliver Ruiz Dorantes 0f9aa9c245 Patch by Fredrik Ekdahl. Fix tabs and whitespaces, this set of files were conflicting
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26702 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 19:55:13 +00:00
Oliver Ruiz Dorantes ded3259257 Patch by Fredrik Ekdahl. Fix tabs and whitespaces
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 19:51:16 +00:00
Axel Dörfler f9ae429701 * Replaced our SinglyLinkedList with one that has a similar interface as the
DoublyLinkedList. Not yet tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 11:47:17 +00:00
Axel Dörfler 850b759925 * Updated the fs_shell version of DoublyLinkedList.h to contain the latest
fixes made by Ingo. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-31 11:21:47 +00:00
Ingo Weinhold 7f12cc54a7 * It is now supported that I/O operations and requests are only handled
partially (e.g. due to hitting the end of file). The respective
  classes have grown new methods and attributes to deal with that. The
  "finished" callbacks have got additional parameters to indicate
  whether the transfer was only partial and how much has been
  transferred. Other callbacks and functions have a size_t* in/out
  parameter instead of a simple size_t, now.
* vfs_{read,write}_pages() do now use the I/O request framework instead
  of the underlying FS's {read,write}_pages() hooks (those should be
  unused now). Furthermore they've got an additional "flags" parameter,
  which is passed to IORequest::Init(), i.e. it allows to specify that
  the given vecs refer to physical addresses.
* The file cache's read_into_cache() reads directly into physical
  pages, now.
* Fixed bug in DoIO::IO(): The offset was not adjusted, so that all
  pages were incorrectly transferred from/to the same location.
* Fixed broken subrequest scheduling loop head in
  do_iterative_fd_io_iterate().
* Adjusted the test driver and implemented its io() hook. Using this
  driver I/O requests are passed all the way from the VFS/VM to the
  driver and through the I/O scheduler. It even seems to work. :-)
* Added missing const to the iovec* parameter of the IORequest::Init()
  methods.
* Disabled some debug output by default. Added new optional debug
  output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 23:34:10 +00:00
Karsten Heimrich df24dede80 * rename InterfaceUtils.h/cpp to BlockingWindow.h/cpp and adjust includes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 21:24:19 +00:00
Karsten Heimrich 1bf69d91a3 * remove all classes that where only used in pdf writer from InterfaceUtils
* get rid of three of them, i don't know why they where implemented in the first place

* fix broken scrollbar adjustment
* cleanup DocInfoWindow.h and DocInfoWindow.cpp
* make the window resizable and get rid of the tabview



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 20:32:10 +00:00
Axel Dörfler 37de5a0d83 * The rw_lock now behaves just like a recursive locker if KDEBUG_RW_LOCK_DEBUG
is defined to 1; this allows asserting the read lock case, too.
* Added ASSERT_{READ|WRITE}_LOCKED_RW_LOCK() macros. The read assertion is only
  working when KDEBUG_RW_LOCK_DEBUG is defined to 1, the write assertion works
  always.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 15:27:58 +00:00
Axel Dörfler 0b46f622d1 * Made struct ring_buffer public (within the kernel).
* Added "syslog" command that dumps the contents of the syslog ring buffer into
  KDL. Use the '-n' option to only show what hasn't been sent to the syslog
  daemon yet.
* When entering the kernel debugger, the current thread ID and name are also
  printed (not only the current CPU).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-30 10:03:22 +00:00
Axel Dörfler 47ca7595ca First patch by Salvatore to implement XSI semaphores with a few changes
by myself:
* renamed xsi_do_undo() to xsi_sem_undo() (there is more to XSI than sems).
* Fixed coding style issues in sys/sem.h and xsi_sem.cpp.
* Added _kern_*() syscall prototypes to syscalls.h.
* Added a TODO in xsi_sem.cpp and xsi_semaphore.h about moving union semun to
  a shared header.
* Made the team::xsi_sem_undo_requests int32 - due to padding, it would have
  needed 4 bytes anyway; please always use specific types over int/short/long.
* xsi_sem_undo() now checks if it needs to do anything - the calls in team.cpp
  no longer needs to do this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 12:03:41 +00:00
Ingo Weinhold fe00c1a5ea AutoDeleter calls the destructor operator also when the object is NULL,
so we need to check for that explicitly in the CObjectDeleter and
MethodDeleter cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-29 01:48:38 +00:00
Ingo Weinhold cfae07b6ac Added kernel private vfs_vnode_io() which performs an io_request on a
vnode (falling back to synchronous I/O if the io() is not supported).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 23:46:50 +00:00
Ingo Weinhold 7e3c202478 Added fssh_volume_for_vnode() and fssh_do[_iterative]_fd_io() to the
FS shell. The latter two lack an implementation yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26670 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 23:36:08 +00:00
Ingo Weinhold 7df40c23f6 Added handy function volume_for_vnode() which returns the fs_volume for
a given given fs_vnode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26669 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 23:33:49 +00:00
Stephan Aßmus 162a7f5f8e * Implemented new BView drawing functions DrawBitmap[Async](
const BBitmap* bitmap, BRect bitmapRect, BRect viewRect, uint32 options).
  Only option so far is B_FILTER_BITMAP_BILINEAR.
* BView::DrawBitmap[Async](const BBitmap* bitmap, BRect viewRect) was accessing
  the bitmap pointer without checking it. Would therefore crash when passing
  NULL, unlike the other methods.
* The BPicture code already reserved room for the BBitmap flags, but did not
  store the actual flags and neiter use them for anything. Since the bitmap
  data is stored anyways, the bitmap creation flags do not matter. So I reused
  this for the new bitmap drawing options.
* Rewrote Bitmap.h and removed the B_BITMAP_SCALE_BILINEAR flag again.
* Tried to optimize Painter::_DrawBitmapBilinearCopy32() a little by giving
  the compiler better hints. There seems to be a marginal, possibly imagined
  speed increase < 0.05 ms. ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26665 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 18:58:30 +00:00
Stephan Aßmus 3c7dd7c346 Added const versions of the methods that should have been declared like
that from the start. Please review for possible binary compatibility problems!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 18:50:07 +00:00
Stephan Aßmus 1c111165b0 Cleanup only.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26661 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 16:27:13 +00:00
Ingo Weinhold ec598fe493 * Added FS interface hooks io() and cancel_io(). The former is supposed
to provide asynchrounous (or only synchronous, if asynchronous is not
  supported) I/O request support. It will eventually replace
  {read,write}_pages(). None of the FS implementations implement them
  yet.
* Implemented some support functions for request-based I/O. File system
  implementations can use do_fd_io() which passes an I/O request to the
  layer responsible for a given FD, and do_iterative_fd_io(), which
  translates a request for a file to subrequests for the underlying
  device and passes them on. Both fall back to synchrounous processing
  when the io() hook is not supported.
  Furthermore added vfs_synchronous_io() which should be handy for the
  devfs to perform io_requests synchronously for devices that don't
  support the io() hook.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-28 02:07:20 +00:00
Stephan Aßmus dcd70f0e39 * Introduced new BBitmap flag B_BITMAP_SCALE_BILINEAR.
* When drawing BBitmaps with scaling in the app_server, use a bilinear
  filter when a bitmap has this flag set. (Hope nobody objects, otherwise
  I can revert or improve this. Performance can certainly be improved, since
  the AGG implementation is too generic. But that goes for the nearest
  neighbor implementation as well.)
* Flags are uint32, fix app_server side code to declare them correctly. Use
  appropriate link methods in BBitmap and ServerApp.
* Enable the BeOS compatibility mode for B_RGB32 (works just like B_RGBA32
  in B_OP_ALPHA mode).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-26 23:40:13 +00:00
Karsten Heimrich 0ca6b749f4 * merge parts of libprint and libprintutils to make both indepentend
* adjust all drivers to take that into account
* fix UpdateText() signature in JSDSlider to avoid warning



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-26 22:36:01 +00:00