Commit Graph

4428 Commits

Author SHA1 Message Date
Axel Dörfler
06d5e1b3b6 * Added ReadLocker/WriteLocker classes to auto lock an rw_lock.
* Added *_init_etc() functions to the fs_shell.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26302 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 18:12:33 +00:00
Axel Dörfler
e2dfe00484 * Replaced most of the error enums with #defines.
* fssh_auto_locker.h should probably better use an FS-Shell header instead of
  stddef.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 18:10:21 +00:00
Axel Dörfler
e0fc5e7380 * The fssh_auto_locker.h header was not self-contained.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:26:57 +00:00
Axel Dörfler
af370c702a * Added a recursive_lock_trylock() function.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26297 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 16:17:34 +00:00
Axel Dörfler
589f1a9133 * Made the private kernel locking primitives available to file systems as well.
* Applied Korli's mutex_unlock() fix to block_cache.cpp.
* Removed block_cache_priv.h, as it's no longer needed (moved its definitions
  into block_cache.cpp, as in the kernel file).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26296 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 15:19:19 +00:00
Axel Dörfler
52ecda6ecf * Added some optional KDL command and statistics to the file map implementation.
* Turned them on for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 12:02:24 +00:00
François Revol
26e45f0523 Would work better with the definition...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-07 11:30:12 +00:00
Oliver Tappe
1aa3d2e3f3 Resolved a couple of problems in BNetAddress implementation:
* fixed several byte order inconsistencies, it does not make sense to always
  convert the byte order input/output values - no we convert where it can
  be expected and leave it where it is confusing
* fixed size inconsistencies with respect to family and port, both of which
  were sometimes handled as int8, as int16 and as int32 in different places
  (now they are always int16)
These fixes make Beam connect to the correct address and port, but it still doesn't work, as it seems to be using UDP instead of TCP (doh!). Will look into that tomorrow.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26269 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-05 22:37:06 +00:00
Stefano Ceccherini
165db546bf should've been part of the previous commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26266 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-05 20:45:17 +00:00
Stefano Ceccherini
6e29a04d36 Patch by Dustin Howett which 'modularizes' timers. The best timer is
automatically selected at boot time. Pit and Apic timers are implemented
for now. Thanks Dustin!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-05 20:40:06 +00:00
Axel Dörfler
0875ae984f * Preparations for a module listener API - this will be used in the (disk)
device managers.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-03 11:52:36 +00:00
Oliver Ruiz Dorantes
75c310bc5b Fix EOL
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 21:12:07 +00:00
Oliver Ruiz Dorantes
ade530ec1d Fix EOL
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 21:10:24 +00:00
Oliver Ruiz Dorantes
c8bc2d8897 Fix EOL
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 20:01:02 +00:00
Oliver Ruiz Dorantes
9bfe62f9aa Cleapups, Fix memory leaks,
Patch by Mika Lindqvist. Could we give give him Commit access? 
I am getting daily patches from him with fixes and new features.
 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26227 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 19:41:45 +00:00
Jérôme Duval
765ae3a785 Applied patch from Mika Lindqvist: This patch implements both strlwr() and strupr() functions in libroot and includes strupr() in kernel build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-02 19:30:46 +00:00
Michael Lotz
b1f4df4a62 Implement heap classes that each have their own range of allocation sizes they
serve, bin sizes and page size. This minimizes the amount of "large"
allocations made in heaps that don't have a bin for the allocation size
(combining multiple pages). This is desirable as such large allocations
are generally pretty inefficient, and also because it separates larger from
smaller allocations better, making the chance of a heap becoming empty higher.
For now there are three heap classes "small", "large" and "huge", with a
predefined set of bin sizes for each. This might need some finetuning later on.
Reduce the grow size to 4MB though as the allocations should now be spread
across heap classes which each grow on their own.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26210 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-01 23:19:35 +00:00
Oliver Ruiz Dorantes
51ac4f530a Patch by Mika Lindqvist
FromString Implementation for the bdaddr utils class 



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-30 21:43:21 +00:00
Axel Dörfler
8531599a27 * KDiskDeviceManager::RescanDiskSystems() now also rescans all partitions with
the newly found disk systems.
* _ScanPartition() now allows to restrict the disk systems to a predefined set.
* _ScanPartition() now even scans partitions that already have a disk system
  assigned; if a better one is found, the existing one is replaced. It will
  ignore mounted or partitions with children, though.
* KPartition now also stores the priority of the disk system assigned to it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26177 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-30 10:36:47 +00:00
François Revol
ff41eb66a3 Fix build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-29 21:08:12 +00:00
François Revol
f41c3a5bcd - Move Atari platform class out to a platform file.
- Use the platform object to determine the platform type in system_info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-29 18:22:34 +00:00
Ingo Weinhold
e1b630c55d * Replaced the global cache pages hash table by an IteratableSplayTree
per cache.
* Changed the strategy vm_cache_acquire_page_cache_ref() uses to ensure
  that the cache isn't deleted while trying to get a reference. Instead
  of the global cache pages hash table lock, it holds the global cache
  list lock now. We acquire + release this lock in delete_cache() after
  removing all pages and just before deleting the object.
* Some small optimizations using the property that the cache's pages are
  ordered, now (vm_cache_resize(), vm_page_write_modified_page_range(),
  vm_page_schedule_write_page_range()).
* Replaced some code counting a cache's pages by simply using
  vm_cache::page_count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26160 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-28 23:42:41 +00:00
Ingo Weinhold
c84d037f75 Added templatized SplayTree class derived from a Java implementation by
D. Sleater. Also added a IteratableSplayTree class that extends
SplayTree, additionally maintaining a singly-linked list, thus allowing
for efficient forward iteration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26159 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-28 23:22:43 +00:00
Rene Gollent
84d75fa444 Rewrote SwapItems() so as to not fail in various cases.
Fixed logic error in CountItemsUnder() that would sometimes 
return the wrong count. This would result in issues such as
Vision's network reordering failing to reorder down due to
retrieving the wrong item based on the count.

This fixes ticket #2447.
 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26149 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-28 03:03:56 +00:00
François Revol
63dff3f9a3 Placeholder for ARM.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-25 22:57:34 +00:00
Salvatore Benedetto
93dd5d6569 * Fix typo. Thanks mjw!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26132 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-25 19:29:03 +00:00
Ingo Weinhold
276aa463ef * Replaced the useless InitCheck() method in {Open,Multi}HashTable (it
always returned B_OK) by a Init() method, which sets the initial size
  and returns an error, if that fails.
* Adjusted code using the classes accordingly. Replaced a few
  InitCheck() methods in the network code by Init().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 22:23:57 +00:00
Axel Dörfler
9c557206db * Rewrote NetKit.h, and added the libnetapi headers.
* This closes bug #2444.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 09:03:44 +00:00
Ingo Weinhold
2965c99fea * Changed the _kern_exec() and _kern_load_image() syscalls. They expect
a flattened argument/environment buffer now. This simplifies the work
  for the kernel a bit, since it can just copy the buffer and check
  whether it looks OK instead of messing around with individual strings.
  The runtime loader also gets a flattened array.
* Set the maximum size of the arguments/environment buffer to 128 KB.
  When more arguments are passed, we fail with a proper error code
  (instead of just truncating the arguments as before).
* On exec*() the first argument was silently replaced by the given path
  name, which is not correct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 03:37:07 +00:00
François Revol
5da61ace79 - 040 mmu descriptors, FIXME
- remove unneeded include to make those usable by bootloader.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 23:15:43 +00:00
François Revol
1fd024be6a - missing ppc stub
- kernel_m68K almost links now, jsut bails out on the linker script...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 03:28:18 +00:00
François Revol
f0c5a3da4b - Add missing globals
- stubbed commpage stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26094 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 01:54:18 +00:00
François Revol
30629f410c - move atari platform subclass to platform/atari_m68k/
- fix exception handling, at least it builds now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-23 00:16:23 +00:00
François Revol
375be9fa40 Add a machine type field. It should hold a platform dependant type. On Atari it's the high word of the _MCH cookie (2=TT,3=Falcon,5=ARAnyM).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26085 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-22 20:57:49 +00:00
François Revol
35471ac53e - add fpu states
- add needed asm_offsets
- start of exception handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-22 01:36:52 +00:00
François Revol
b409283372 Set max cpu count to 1 for ARM. Anyone knows a real SMP platform using it ?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-21 21:48:18 +00:00
Salvatore Benedetto
e65b3b4eac * Let's keep the alphabetical order
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26049 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-20 22:45:33 +00:00
Salvatore Benedetto
242b8e12a3 * Added italian keymap
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-20 22:40:15 +00:00
François Revol
04390361b5 - comment
- fix building arch_debug. Misses many regs still.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-20 02:22:26 +00:00
François Revol
a3dc7ef06c - some cpu and platform fixes.
- we'll just use decimal chip number (68030, ...) to identify cpu, fpu, and mmu for simplicity.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-20 02:11:45 +00:00
Stephan Aßmus
d6b036858b Move the now used boolean to the old place in order to avoid different padding
to happen and therefor changing the object size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-19 14:17:56 +00:00
Stephan Aßmus
eaa6da1ef7 Use a flag in BWindow to store whether an update to a view (Invalidate()) has
been requested. The first call to a BView::Invalidate() will flush the link
so that app_server is notified as soon as possible. It makes no sense for
further calls to Invalidate() to flush also, since Flush() is not cheap. This
trick makes Invalidate() about 3.2 times faster, making it a cheaper operation.
I could not see any negative effects, I tested with apps that invalidate
multiple different parts inside a window in reaction to something. Thanks go to
Ingo who had the idea.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26020 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-19 13:07:44 +00:00
Ingo Weinhold
a2cf1d70ef Removed <syscalls.h>' dependency to <semaphore.h> by giving the sem_t
structure a name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-19 00:05:01 +00:00
Ingo Weinhold
37deb72914 Define INT32_MAX, if not defined.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26014 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-19 00:03:56 +00:00
Oliver Ruiz Dorantes
24f4a20d25 Add UI classes to the build.
Adding some helper methods to the Local and remote devices



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-18 21:01:26 +00:00
Oliver Ruiz Dorantes
b12daa5f08 Add UI classes for handling incoming connections and pincode requests
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26010 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-18 20:57:27 +00:00
Michael Lotz
df7096a4aa * Added malloc_nogrow() function that does allocation without triggering or
waiting for a heap grow.
* Use that nogrow version in the VM code to avoid a deadlock with the address
  space lock when a grow operation would try to create an area while a malloc
  happened from such a function in the VM.
* When waiting for a grow to happen, notify the waiting thread from the grower
  also if it failed to allocate a new heap. Otherwise a thread would just sit
  there and wait until another thread requested growing too and that one
  succeeded (or just forever in the worst case).
* Make the dedicated grow heap growable too. If the current grow heaps run low
  on memory it will instruct the grower to allocate a new grow heap. This
  reduces the likelyhood of running out of memory with no way to grow to a
  minimum. As the growing is done asynchronously it is still possible to
  happen, but it is highly unlikely as the grow heap is solely used to
  allocate memory in the process of creating new heap areas and it will even
  try using normal public memory if the dedicated memory has run out.
* Reduced the dedicated grow heap from 2 to 1MB. As it can now grow itself, it
  doesn't need to last so long.
* Extract heap creation into it's own function that does area creation and heap
  attach and use this function for growing normal and grow heaps.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-18 19:55:51 +00:00
Oliver Ruiz Dorantes
0df89492fb -Wrong header for function,
indenting...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-18 19:17:35 +00:00
Rudolf Cornelissen
6ffc2359d4 removed last G8x defines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-17 19:27:38 +00:00
Rudolf Cornelissen
f433117839 removed all pre-NV40refs, removed all overlay code (no info on the current engine known). Driver cleanup mostly done now I hope.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-17 19:16:40 +00:00
Jérôme Duval
49a0ff0c19 updated freetype to 2.3.6
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-16 20:51:14 +00:00
Axel Dörfler
2d5f339dec Patch by Christopher Plymire, style-reworked by myself:
* first steps of supporting LVDS panels.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-16 18:01:34 +00:00
Maurice Kalinowski
53779f07a4 fix gcc4 warning about wrong argument type.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-15 19:21:00 +00:00
Rene Gollent
0c8bdbafd5 Revamp BList somewhat to further optimize the resizing behavior.
We now keep track of a lower bound as to when the list should scale
itself back down. When increasing the list size, we double the current,
with the lower bound set to 1/4 of the current size, not allowing it to
go any smaller than the block size. These combined allow us to do very
cheap tests to see if an operation requires a resize at all, and minimize
how often the list actually needs to be resized, since the difference in upper
and lower bounds prevents bouncing back and forth between a size in the case
of adding/removing an item while close to a boundary. All in all this should
make BList noticably more scalable when doing large numbers of add/remove
operations.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-12 21:30:28 +00:00
Oliver Ruiz Dorantes
c15ecd98ca - Add some core code for the L2CAP layer (l2cap commands)
- Tailor a bit the main module
- Fix definitions in the main header




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25943 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-12 19:31:29 +00:00
Oliver Ruiz Dorantes
350458a6ba - Add PinCode command replies
- Add CancelInquiry command


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-12 19:18:32 +00:00
Rudolf Cornelissen
730ebb158c removed all pre-NV20 refs, removed all TVout stuff except clearing some flags, re-enabled force_ws option, force_ws is now default true, pgm_panel is now default false.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-11 18:14:15 +00:00
François Revol
9f0d1cf39d Remove PAGE_SIZE define for ppc and m68k from kernel private headers. It's not needed there and should be in public header anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-11 01:16:48 +00:00
Rudolf Cornelissen
8981fa5d54 removed PIO mode acceleration completely.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25908 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-10 17:56:54 +00:00
Rudolf Cornelissen
b11432e092 removed all references to G80 and newer cards.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-10 11:10:52 +00:00
Rudolf Cornelissen
0ddc7716d4 headers for nvidia_gpgpu driver
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25874 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-09 14:53:17 +00:00
Michael Lotz
ca7b0f375e Patch by Olivier Coursiere that removes unneeded special characters.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-08 21:48:23 +00:00
Michael Lotz
cfbfa8bade Add french KDL keymap contributed by Olivier Coursiere, thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-08 00:32:14 +00:00
Stephan Aßmus
3d4b8c879e Added one more define that helps when host headers are included.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-07 12:39:14 +00:00
Stephan Aßmus
896d01df1e Removed trailing white space.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-07 12:38:28 +00:00
Jérôme Duval
75d2085651 fixed listdev and device_manager syscalls
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-06 22:23:25 +00:00
Axel Dörfler
3b2c863f1c The "search.h" header had a couple of issues:
* It was not self containing, as it used size_t without defining it.
* It was not C++ safe.
* It used the restrict keyword that is not recognized in GCC2. This fixes bug
  #2262.
* It did not contain parameter names as demanded by our coding style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25818 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-06 07:42:58 +00:00
Michael Lotz
f5b3a6a796 * Initialize all static mutexes in the kernel through a MUTEX_INITIALIZER()
and remove the then unneeded mutex_init() for them.
* Remove the workaround for allowing uninitialized mutexes on kernel startup.
  As they are all initialized statically through the MUTEX_INITIALIZER() now
  this is not needed anymore.
* An uninitialized mutex will now cause a panic when used to find possibly
  remaining cases.
* Remove now unnecessary driver_settings_init_post_sem() function.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25812 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 23:19:27 +00:00
Michael Lotz
2c19d5ec25 * Add Dvorak keymap contributed by Darian Rackham, thanks!
* Cleanup the license header and add authors
* Sort the available keymaps list in the config file and add 'dv'

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 16:34:30 +00:00
Michael Lotz
01e46bdb18 * Extract the KDL keymap to a separate header and provide a 'sg' swiss german
keymap there too.
* Add a config header where one can select what KDL keymap should be used
  (currently only 'us' and 'sg' are available though).
* Provide a third keymap that is used when the alt modifier is used (the swiss
  german keymap is pretty useless without alt as all the useful keys like
  backslash and curly braces use alt).

Our KDL is so powerful and nice to use, the only thing that bothered me was
that I always had to think about where some of the special keys are located in
the US keymap. So this simple compile-time keymap switching provided to be
helpful for me and might be for others too. Keymaps for other layouts obviously
have to be written before this becomes really useful.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25803 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 17:56:30 +00:00
Axel Dörfler
0dedf9f081 * Removed the now superfluous pnp_devfs.h header.
* There was a leftover in devfs that still needed it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-04 10:38:59 +00:00
Jérôme Duval
a5f249c795 use the typedef
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25798 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 20:13:59 +00:00
Rene Gollent
6cd1b6f737 Fix GCC4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25797 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 19:24:56 +00:00
Axel Dörfler
a2e19c60e2 This should have been part of r25793.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 17:45:54 +00:00
Axel Dörfler
6ec21b4ad3 * Implemented retrieving additional bitmap support flags by the app_server.
* Added B_BITMAPS_SUPPORT_OVERLAY flag to indicate overlay support for the
  color space.
* Rewrote GraphicsDefs.h - the previous one was obvious a copy of the Be header,
  including typos and strange white space. I was a bit lazy with respect to
  the color space details, and mostly trusted the information provided by the
  Be header else.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25793 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 17:44:46 +00:00
Axel Dörfler
d16ddc579c * The boot loader now passes on its EDID info to the kernel, and that will
be put into a boot_item in frame_buffer_console_init().
* The VESA driver now supports gettings the EDID information as well; this
  is necessary now, since the app_server no longer takes over the mode the
  boot loader had chosen.
* Note, we might want to do this via vm86 instead in the future, and remove
  the kernel part again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 15:17:59 +00:00
Stefano Ceccherini
fa827b37fc took the liberty to add this to the buiild and fix compilation :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 05:02:59 +00:00
Stefano Ceccherini
54d9d37f9d Added patch by Dustin Howett: header with HPET definitions and (empty)
file for hpet implementation. Not yet added to the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-03 04:37:18 +00:00
Oliver Ruiz Dorantes
3e24801283 L2CAP, without functionality, for the moment my playground in the netstack
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-02 20:16:00 +00:00
Ingo Weinhold
1c8de8581b * Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
  structure (thus breaking BeOS binary compatibility), containing a
  counter which is incremented whenever a thread has to wait for the
  spinlock.
* Added macros for spinlock initialization and access and changed
  code using spinlocks accordingly. This breaks compilation for BeOS --
  the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
  the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-02 02:04:12 +00:00
Ingo Weinhold
73aa393d73 * Introduced pipes in the kernel debugger. The syntax is similar to
pipes in the shell, though the semantics is a little different: The
  second command is invoked whenever the first command has written a
  complete line. The line is passed as last argument to the second
  command. The new command flag B_KDEBUG_PIPE_FINAL_RERUN causes the
  second command to be invoked again (with NULL argument) after the
  first command is done.
* Added kprintf_unfiltered() and kputs_unfiltered() which bypass the
  pipe mechanism and directly print to the bluescreen/serial output.
* Moved most commands from debug.cpp to the new
  debug_builtin_commands.cpp.
* B_KDEBUG_DONT_PARSE_ARGUMENTS commands don't get an argument anymore,
  if it would consist of white space only.
* Added new debugger command return value B_KDEBUG_ERROR, which
  indicates that executing the command failed. This return code will
  abort a complete pipe.
* Since debugger commands can nest (i.e. one command can invoke another
  one) the setjmp()/longjmp() mechanism to restore the stack after a
  page fault in a command needs more than one jump buffer.
* Added abort_debugger_command(), which longjmp()s out of the currently
  executed command. This will also abort the current pipe.
* When pagination is enabled pressing "a" will abort the running command
  (as opposed to "q" which only disables the blue screen output, but
  lets the command continue).
* Added debugger commands:
  - "grep" which can be used to filter output by pattern. Removed the
    "filter" command and the underlying mechanism that did that before.
  - "head" which prints only the first lines of output of another
    command.
  - "wc" counts lines, words, and characters of another command's
    output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-01 02:25:00 +00:00
Jérôme Duval
4eae685d97 replaced benaphore with mutex
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25742 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-31 19:50:53 +00:00
Axel Dörfler
e67cf5815b * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-31 12:04:09 +00:00
Axel Dörfler
fc128a4c76 * Made block_io.h usable from C++ (which doesn't like "typedef a *a" anymore).
* Renamed scsi_dsk to scsi_disk.
* Joined all scsi_disk sources together to a single scsi_disk.cpp file.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25737 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-31 11:59:02 +00:00
Stephan Aßmus
590c0d667c Darn... should have been part of my last commit:
Export the Read/Write locking strategies from the BPrivate namespace. Fixes
Icon-O-Matic build (RWLocker).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25721 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-30 14:12:04 +00:00
Ingo Weinhold
72e3b6ffd3 Missing prefix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25712 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 20:51:59 +00:00
Axel Dörfler
f20a8750cb * Enlarged the default BLooper port capacity to 200 messages. Since limiting
the message count doesn't really make much sense anyway (as opposed to
  limiting the maximum size of waiting messages), we might still want to
  enlarge this even more.
* This should further help with #2212.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 18:24:19 +00:00
Ingo Weinhold
9101535322 Added new kernel thread "undertaker" which gets rid of dead thread
remains. This replaces the previous mechanism of switching the thread to
a dedicated death stack. We might consider moving more cleanup work to
the undertaker, but that seems a little more involved.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 14:28:31 +00:00
François Revol
ebc5ec193f fix gcc4... and style rules. I won't be the only one paying beers at BeGeistert ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 12:44:18 +00:00
Axel Dörfler
44b6c0f4b6 Oops, this shouldn't have been part of this file, forgot to delete it when
copying from the playground.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25700 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 12:28:13 +00:00
François Revol
5bd8987ff0 fix C++ linkage of global var... it shouldn't be here anyway, but I suppose it's temporary.
This should fix the (gcc4 at least) build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 11:25:33 +00:00
Stephan Aßmus
5ebabf0952 Added new line at end of file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25694 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 08:32:12 +00:00
Ingo Weinhold
2daa4194d4 Added macros for static initialization of mutexes, recursive locks, and
R/W locks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 02:10:10 +00:00
Ingo Weinhold
2b07b8e0f1 * Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 02:08:23 +00:00
Ingo Weinhold
1c18a5df87 Replaced R/W lock implementation. Should have a little less overhead
than a semaphore, and can already be used in the early boot process.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25689 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-29 00:32:06 +00:00
Ingo Weinhold
b0f5179aa5 * Changed recursive_lock to use a mutex instead of a semaphore.
* Adjusted code using recursive locks respectively. The initialization
  cannot fail anymore, and it is possible to use recursive locks in the
  early boot process (even uninitialized, if in BSS), which simplifies
  things a little.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 23:12:36 +00:00
Ingo Weinhold
90ca025688 Removed prototypes for openpty() (which lives in pty.h) and forkpty()
(which we don't implement ATM). Why do we have a header that declares
stuff that is for the most part not supported?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 20:44:47 +00:00
Ingo Weinhold
d46a010c43 Patch by Vasilis Kaoutsis: Added sigpause().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 15:28:49 +00:00
Axel Dörfler
9f16184577 Patch by Jan Klötzke with minor changes by myself:
* Use vm86 mode to call the VESA BIOS to do the actual mode switching by
  providing an ioctl in the vesa driver.
* Fix vm86.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-28 10:48:01 +00:00
Axel Dörfler
9c20d5cb7d * Fixed the byte order definitions.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25671 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-27 12:42:04 +00:00
Axel Dörfler
187c576425 * Added sys/ipc.h header. As the functionality has not yet been implemented,
I added an #error directive, so configure scripts shouldn't be fooled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25663 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:55:57 +00:00
Axel Dörfler
368167ede8 * Integration of the new driver architecture.
* Moved devfs from fs/ to device_manager/, and separated the legacy driver
  support from it.
* Removed fast_log module.
* There are a couple of (temporary) regressions, though:
  - legacy SATA and ISA IDE support is disabled, the drivers haven't been
    ported yet.
  - The not yet used ATA bus manager hasn't been ported yet, either.
  - AHCI changes have not been tested.
  - the listdev command has been removed from the build (as it currently
    doesn't work anymore).
  - device manager generated IDs currently are not freed anymore when a device
    node is removed.
  - generic drivers can't yet use the new driver architecture.
  - simple busses that do not support device types won't work yet.
  - legacy driver publishing/unpublishing (ie. what USB needs) has not been
    tested, and may be broken.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-26 16:52:27 +00:00
François Revol
cb63d44e7a Remove hardcoding of endianness... that'll likely help ppc :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-25 20:12:00 +00:00
Stephan Aßmus
5b30a26b7c Added additional font face flags for "condensed", "light" and "heavy".
Our font has some extra styles and these could be picked up as the
"regular" face by accident, as witnessed by Firefox. Tracked down by
Michael Lotz. Firefox uses the correct font now for it's interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 14:54:18 +00:00
Marcus Overhagen
33e9755153 Small cleanup of ahci driver. Also clear the PCI interrupt disable bit during setup.
Add PCI command ID (interrupt disable) define to PCI.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25634 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-24 13:40:58 +00:00
Axel Dörfler
a411c76cd6 * Added pthread_attr_setscope(), and pthread_attr_getscope(). We only support
PTHREAD_SCOPE_SYSTEM which makes the implementation rather simple.
* This closed ticket #2242.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25628 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 11:24:40 +00:00
François Revol
74be35c78b Some more funny sysconf()...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25627 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 01:38:05 +00:00
François Revol
4b9329efe1 Define PAGE_SIZE and PAGESIZE in limits.h. It should really depend on B_PAGE_SIZE, but I'm not sure we can #include anything in there...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25626 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 01:01:57 +00:00
François Revol
3a17a548da - factored out [f]pathconf().
- *pathconf() now uses statvfs and fs_info data when appropriate. It should also check for file type though, some only apply to directory or others.
- added confstr(_CS_PATH) with a sensible default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-23 00:33:08 +00:00
François Revol
ca974ded95 Some more [f]pathconf() names, not yet handled. filesizebits returns 64 though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 23:22:26 +00:00
Ingo Weinhold
0f448d21e5 * Added vm_page_write_modified_page_range(), which is similar to
vm_page_write_modified_pages(), save that it only writes pages in the
  given range.
* Added vm_page_schedule_write_page_range() which schedules all modified
  pages in the given cache's range for writing by the page writer.
* Added _kern_sync_memory() syscall and the msync() POSIX function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 21:51:12 +00:00
Axel Dörfler
15173df4e9 Last patch of the vm86 patch series from Jan Klötzke - thanks!:
* The new function vm86_do_int(struct vm86_state *state, uint8 vec) provides a
  facility to call BIOS interupt handlers. The function must only be called from
  a user thread context because the lower 1MB of the address space is used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 13:54:28 +00:00
Axel Dörfler
7da0a81c0e Patch by Jan Klötzke (with additional TODO comments):
* Add a "fault_callback" to the thread structure which is called when a
  unhandled page fault happens in user space. A SIGSEGV will only be sent
  if the callback returns "true".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 12:33:30 +00:00
Axel Dörfler
bb107c4e29 Patch by Jan Klötzke:
* In vm86 mode CS will have arbitrary values so we check for both USER_CODE_SEG
  and the VM flag in EFLAGS. This is also done when entering interrupt gates.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:59:47 +00:00
Stephan Aßmus
ae6b38b83e Patch by Andreas Faerber:
* Added "struct" to ancillary_data_container which fixes the build of the
  Bluetooth h2generic driver.
---
* Updated license header.
* Honour 80 char line width.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-22 11:59:26 +00:00
Ingo Weinhold
f3917584f1 Added missing INET_ADDRSTRLEN.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 22:37:42 +00:00
Oliver Ruiz Dorantes
0963754edf Create a parent class for the 2 devices class (RemoteDevice LocalDevice)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 21:56:55 +00:00
Ingo Weinhold
43a4a6bacb Forgot closing parenthesis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 21:08:47 +00:00
Ingo Weinhold
3021393e36 Let's pretend we support POSIX threads.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 00:03:09 +00:00
Ingo Weinhold
9ac19900c4 Added LOG_UPTO() macro. Not part of POSIX, but widely used anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 00:02:26 +00:00
François Revol
e2a938c274 Add define for the kernel area to ppc & m68k. They still don't initialize TLS though.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-20 21:28:32 +00:00
Axel Dörfler
35db13ea5a * Replaced the old s3savage driver with the new s3 driver, both written by
Gerald Zajac. Thanks a lot!
* Also put it on the image by default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-20 21:09:49 +00:00
Ingo Weinhold
a8af2b6dda Some work on pthreads:
* Made the pthread_cond_t internals public. This is necessary to support
  process shared condition variables. Fixed initializer macro.
* Made the pthread_rwlockattr_t structure opaque.
* pthread_t is no longer typedef'ed to int. It's the pointer to the
  internal _pthread_thread structure.
* Removed __get_pthread(). pthread_self() can be used instead.
* No longer tunnel the pthread exit value through Haiku's thread exit
  value. We do have a separate field in the _pthread_thread structure
  for it, now.
* Handle detaching of threads correctly.
* pthread_rwlockattr_{g,s}etpshared() use the
  PTHREAD_PROCESS_{SHARED,PRIVATE} constants, now.
* Commented out yet unsupported structures (barriers, spinlocks).
* Rebuilt APR optional package. The pthread changes weren't binary
  compatible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-20 20:43:28 +00:00
Ingo Weinhold
89d327d66e Added missing spwd::sp_lstchg field.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-19 02:16:12 +00:00
Marcus Overhagen
694c3b75f4 fix bridge control register size
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-18 21:21:39 +00:00
Marcus Overhagen
1eace5fc53 fixed typo again ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-18 20:59:14 +00:00
Marcus Overhagen
be121a1c53 fixed typo
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-18 20:57:49 +00:00
Ingo Weinhold
b3d6c12dbf * Fixed kernel tracing for gcc 4. The ABI changed in a way that isn't
compatible with what our code assumed (pointers to objects of
  TraceEntry and its POD base class trace_entry aren't identical
  anymore).
* Added optional stack traces for ktrace_printf() output in the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-17 18:59:19 +00:00
Ingo Weinhold
fbe0c27a94 axeld + bonefish:
Changed condition variables so that it is allowed to block (e.g. lock
mutexes etc.) between Add() and Wait(). This fixes #2059, since the
block writer used them this way and could thusly fail to wait for a
condition variable, causing a temporary stack object to be used past its
lifetime.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-17 10:21:37 +00:00
Stephan Aßmus
da2a1fefe4 Patch by Vasilis Kaoutsis: Fixed typo in comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-15 12:08:13 +00:00
Ingo Weinhold
07ddcd64cf * Renamed libnetapi to libbnetapi. Create a symlink in the image.
* Extended R5 compatibility check to also consider calls from
  libbnetapi.
* Fixed incorrect R5 compatibility check in BNetEndpoint constructor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25489 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 13:49:48 +00:00
Ingo Weinhold
6e19c86ab0 Fixed potential warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25487 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 12:52:34 +00:00
Ingo Weinhold
6b202f4e3d * Introduced new header directory headers/private/system which is supposed
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
  several kernel headers into a shared part and one that is still kernel
  private. Adjusted all affected Jamfiles and source in the standard x86
  build accordingly. The build for other architectures and for test code
  may be broken.
* Quite a bit of userland code still includes private kernel headers.
  Mostly those are <util/*> headers. The ones that aren't strictly
  kernel-only should be moved to some other place (maybe
  headers/private/shared/util).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 03:55:16 +00:00
Ingo Weinhold
3ca1072d44 * Reimplemented pthread_once. The old one was neither thread-safe nor
particularly efficient.
* pthread_mutex implementation:
  - Removed the pthread_mutex_t indirection (the type was a pointer to
    the actual structure which was allocated on the heap), as it made
    sharing the mutex between processes impossible.
  - Removed the distinction between process shared and non-shared
    mutexes. Benaphores work just as well in shared memory, so we always
    use them.
* Fixed some static initializer macros. PTHREAD_COND_INITIALIZER is
  still broken, since it doesn't work in C code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-13 01:50:54 +00:00
Jérôme Duval
996f75abbb * the Chip field is currently unused in our pci ids list, so we prefer to provide the subsystem name when it is found as a second device description
* adjusted pci device dump


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 16:55:47 +00:00
Ingo Weinhold
370602bff6 Added pthread rwlock support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 13:56:11 +00:00
Ingo Weinhold
b5e3c0a1ea Added new syscalls _kern_block_thread()/_kern_unblock_thread[s]().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 13:53:56 +00:00
Stefano Ceccherini
e2fe7e2fe0 Removed PortQueue since it's not used. Small style (old) changes here
and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25468 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-12 13:27:56 +00:00
Ingo Weinhold
d648afb8d7 * For each userland team the kernel creates an area in the userland
address space that is fully locked and marked B_KERNEL_AREA. It can
  thus be accessed by the kernel without additional checks.
* For each userland thread we do create a user_thread structure in that
  area. The structure is accessible from userland via TLS, using the
  private get_user_thread() function.
* Introduced private userland functions [un]defer_signals(). They can be
  used to cheaply disable/re-enable signal delivery. They use the
  user_thread::defer_signals/pending_signals fields which are
  checked/updated by the kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-11 16:25:35 +00:00
Ingo Weinhold
58148e2e02 Added new private area protection flag B_KERNEL_AREA, which prevents all
changes to the area (delete, resize, clone) from userland.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-11 16:02:13 +00:00
Ingo Weinhold
4d3680aaef Added timeout constant B_ABSOLUTE_REAL_TIME_TIMEOUT which specifies a
timeout relative to the Epoch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 21:34:51 +00:00
Ingo Weinhold
b932012815 Patch by Andreas Faerber:
Replaced single-line comments by multi-line comments for ANSI C
compliance.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 21:30:34 +00:00
Jérôme Duval
ba64d8928a * added B_KATAKANA_HIRAGANA and B_ZENKAKU_HANKAKU (used in Japanese keymap)
* Patch by Shinta: switch between input methods are now not only done with Alt+Space but Alt+Zenkaku/Hankaku.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 12:38:57 +00:00
Axel Dörfler
1da9f5cea5 * Added BDiskSystem::ShortName() and everything needed to get it there.
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
  by short/pretty/module name - since they should all be unique, I put them
  in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
  header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-10 11:44:00 +00:00
Axel Dörfler
aa8bff87ee Followed Ingo's suggestion, and made StackDeleter an AutoDeleter specialization.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 13:08:59 +00:00
Axel Dörfler
359f758bc4 * Added PCI_hd_audio sub-type in the PCI_multimedia base class.
* Fixed some minor typos.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 12:42:33 +00:00
Ingo Weinhold
f7cc12b389 Implemented pthread_attr_{g,s}etstacksize(). Also added commented-out
prototypes for the missing pthread_attr_*() functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25390 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 01:36:49 +00:00
Ingo Weinhold
4c49f2056b * Changed _kern_spawn_thread() and create_thread(): Instead of individual
arguments they get a single thread_creation_attributes structure now.
* Added stack_address and stack_size to thread_creation_attributes,
  which allow to specify the stack size or the stack to be used for the
  new user thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 01:32:36 +00:00
Ingo Weinhold
965aa03f49 Changed all error codes from enum values to macros. This allows for
compile time checks. Incidently those are not totally uncommon in
portable code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 20:54:14 +00:00
Axel Dörfler
56bbbbc9ca * Added Adopt() method that steals the other path's buffer.
* Fixed operator=(): the second argument of SetTo() is a boolean (normalize),
  not the length of the buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 16:45:29 +00:00
Axel Dörfler
b1429e2a05 Added a StackDeleter class that also empties the stack and deletes the items.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 16:43:59 +00:00
Axel Dörfler
02a3b9ef49 * kernel_daemon is now a C++ file, and uses DoublyLinkedList instead of
the C list mechanism which also makes the code nicer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25375 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 15:08:14 +00:00
Ingo Weinhold
f23d0a6242 Implement shm_open() and shm_unlink(). The shared memory objects are
simply created as files in /boot/var/shared_memory/. The Bootscript
clears the directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 13:42:33 +00:00
Ingo Weinhold
3dfe682f55 * Added some padding to the sem_t structure.
* Changed the semantics of unnamed semaphores. Before parent and child
  of a fork() would always share an earlier created semaphore. Now we do
  that only, if the "shared" parameter of sem_init() was true. That's
  still not quite the behavior Linux and Solaris have, but should be
  perfectly fine with how reasonable code would use the API.
* There's a global table for shared unnamed semaphores now. ATM a
  semaphore is leaked when no one explicitly destroys it (just as with
  named sems).
* Enforce per-team and global semaphore number limits.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25362 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 01:39:49 +00:00
Ingo Weinhold
01b1098795 * Fixed some misunderstanding regarding the _POSIX_* macros. They are
not supposed to be passed to pathconf() or sysconf().
* Added POSIX semaphore related macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 01:27:31 +00:00
Axel Dörfler
7cbf8fdd5a First part of the vm86 work by Jan Klötzke:
* Allow userland teams to create areas below 1 MB when requested specifically.
* Note, this is a temporary solution - see the comments in the code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25358 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-07 21:21:43 +00:00
Maurice Kalinowski
8b1e3b1af8 - Implemented MediaExtractor::Copyright, which just calls the instantiated reader
- Implemented BMediaFile::Copyright, which just calls Copyright() of the extractor. So this is just a simple pass through.
- Style cleanup (mostly whitespaces)

Problem is that our readers currently return the copyright of the source code, not the copyright of the MediaFile itself, like the BeBook documents. Thus, we might need to change all readers to return appropiate data or behave differently for Haiku readers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-07 21:09:56 +00:00
Ingo Weinhold
98e6713172 * Moved realtime_sem.{cpp,h} into new posix subdirectory.
* Renamed the old kernel_posix[_arch...].o to kernel_lib_posix...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25336 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 23:16:04 +00:00
Jérôme Duval
7c8ddc9795 added B_SAFEMODE_DISABLE_APM
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25334 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 22:04:25 +00:00
Ingo Weinhold
5142c2ac86 Added support for POSIX semaphores (the ones from the XSI extension
Realtime option group). The implementation should be complete, but is
totally untested yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 03:39:36 +00:00
Ingo Weinhold
3bb3ab83a4 Missing copyright header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 03:30:48 +00:00
Ingo Weinhold
22c6962959 Added atomic_pointer_get().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-06 03:30:25 +00:00
Ingo Weinhold
cb734beeee Added get_open_fd() function which gets the descriptor and also
increments its open count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-05 00:24:14 +00:00
Ingo Weinhold
d29deffa2c Added the Linuxish SO_PEERCRED.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-04 00:28:27 +00:00
Ingo Weinhold
cdc00dadfc * Added optional {send,read}_data_no_buffer() hooks to the protocol
module interface. They directly operate on iovecs and thus allow
  protocols that don't need it to avoid the creation of a net_buffer.
* Adjusted the socket module to support the new hooks. If they are
  present, they will be chosen over the old hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25299 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-03 01:11:21 +00:00
Ingo Weinhold
49e00d1f99 Moved the container management for ancillary data from the net_buffer
module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-02 14:37:16 +00:00
Ingo Weinhold
0c615a01ae * Removed old mutex implementation and renamed cutex to mutex.
* Trivial adjustments of code using mutexes. Mostly removing the
  mutex_init() return value check.
* Added mutex_lock_threads_locked(), which is called with the threads
  spinlock being held. The spinlock is released while waiting, of
  course. This function is useful in cases where the existence of the
  mutex object is ensured by holding the threads spinlock.
* Changed the two instances in the VFS code where an IO context of
  another team needs to be locked to use mutex_lock_threads_locked().
  Before it required a semaphore-based mutex implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-01 22:07:36 +00:00
Ingo Weinhold
ee96aa8f6e * Replaced cutex::release_count by flags field. It is only one thread
that can unlock the mutex, so one bit is sufficient.
* Added cutex_init_etc() which has an additional "flags" parameter.
  The only specifyable flag is CUTEX_FLAG_CLONE_NAME, which causes the
  function to strdup() the given name and free() its copy in
  cutex_destroy().
* cutex_destroy() does now unblock waiting threads.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25280 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-01 18:06:09 +00:00
Ingo Weinhold
184de764fe Replaced the vm_cache mutex by a cutex. This should save quite a few
semaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-01 01:59:09 +00:00
Ingo Weinhold
8562499f44 * Introduced a new locking primitive I called "cutex" (sorry for the
name, couldn't resist :-P). It's semantically equivalent to a mutex,
  but doesn't need a semaphore (it uses thread blocking and a simple
  queue instead). Initialization can't fail. In fact it is ready to use
  without initialization when living in the bss segment, also in the
  early boot process. It's as fast as a benaphore in cases of low lock
  contention, and faster otherwise.  Only disadvantage is the higher
  immediate memory footprint of 16 bytes.
* Changed how the "thread" and "threads" debugger commands list the
  objects they are waiting for. Cutexes are also included.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25276 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-01 01:53:07 +00:00
Ingo Weinhold
514fb1360b * Removed select_sync::lock. The only thread that was still locking was
the selecting thread, which has obviously no effect.
* Changed select_info::events to vint32. It is now updated atomically.
  This removes a race condition when concurrent threads would notify at
  the same time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25273 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-30 16:12:20 +00:00
Ingo Weinhold
2428097297 Removed superfluous uint32 ref parameter from select() FS hook.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-30 00:06:17 +00:00
Axel Dörfler
801591dbde * Added an atomic_pointer_set() template function to util/atomic.h.
* Made the pointers const.
* Changed how the ARP module maintains its arp_entry::request_buffer: it
  now uses the atomic_pointer*() functions to make sure there is no race
  condition, and it's deleted only once.
* Getting an ARP entry would return uninitialized data, if the entry hadn't
  been resolved yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-29 22:03:03 +00:00
Axel Dörfler
b1d749f8f1 * Added an atomic.h header that provides a C++ file with a templatized
64-bit safe version of atomic_test_and_set() for pointers:
  atomic_pointer_test_and_set().
* The VFS is now using this function (it's not used anywhere else in the
  kernel this way).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-29 21:05:05 +00:00
Axel Dörfler
c0b5962cd6 * Removed unused function benaphore_lock_etc(). A timeout is not really a
good idea for a benaphore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-29 20:20:36 +00:00
Ingo Weinhold
0e8836d284 Fixed build for paranoia disabled globally, but enabled for individual
components.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25253 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-29 18:42:31 +00:00
Stephan Aßmus
f466d35d9c Rewrote parts related to drawing the labels. The order of drawing happens as
this (seems to be what R5 BStatusBar does):
* combine the "trailing text" with the "trailing label" and truncate the
  resulting string on the left side according to the width of the entire
  control
* combine the "label" with the "text" and truncate that on the right side
  according to the space left by the right hand text.

-> No more overlaps (theoretically, in practise there are still overlaps
  because our BFont::TruncateString() does not respect the width in some
  situations.)

* Changed _SetTextData() accordingly, it is not used anymore for the
  label and trailing label, and could therefor be simplified a little.
* fixed _BarFrame() to not return fractional coords, which could sometimes
  leave a dirty line of pixels.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25244 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-29 12:42:10 +00:00
Ingo Weinhold
97c0a2b3f1 * Paranoia checks were accidentally globally enabled by default. Object
* cache paranoia was always enabled.
* Changed from paranoia on/off to levels. Adjusted the macros to take a
  level argument.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-27 15:13:31 +00:00
Ingo Weinhold
2b8ae28a15 * Added kernel tracing. Even with optional stack traces.
* Added "mode" parameter to set_paranoia_check(), which specifies
  whether the check is supposed to already exist/not exist yet. This
  allows for, as it turns out, very useful additional tests. Added
  {ADD,UPDATE}_PARANOIA_CHECK macros that imply the used "mode"
  parameter.
* PARANOIA_SLOT_COUNT was accidentally redefined in the source file.
* Fixed remove_paranoia_check(). It didn't remove anything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-27 03:14:36 +00:00
Ingo Weinhold
65f4015279 Support for stack traces in tracing entries:
* Added capture_tracing_stack_trace() which allocates space in the
  tracing buffer and captures the stack trace according to the given
  parameters.
* Added TraceOutput::PrintStackTrace() to print a stack trace thus
  created.
* Added TraceEntry::DumpStackTrace() callback which is supposed to print
  a stack trace for the entry, if it can do that.
* Added "--stacktrace" switch to the "traced" command, which causes the
  stack traces for all entries that have one to be printed as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25205 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-27 03:02:01 +00:00
Ingo Weinhold
4dd0a2c7b6 Added arch_debug_get_stack_trace() that can be used to get a stack trace
(the list of return addresses) for the current stack.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25204 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-27 02:54:27 +00:00
François Revol
d4a5975f50 - some fields needed to build usb_serial
- use the dano version by default
- s/ddraquire/ddaquire/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 23:52:58 +00:00
François Revol
3196359ad2 - some more defines
- the dano version is exposed as v1.1 so drivers can use select with a simple ifdef
- add copyrights from the tty driver as I'll be copying code from it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 21:56:46 +00:00
François Revol
42889352f8 A stubbed tty bus manager.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25198 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 21:20:13 +00:00
Ingo Weinhold
dfa611bb04 Added paranoia checks debug facility. It helps checking that data in
memory haven't changed behind one's back.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 20:25:02 +00:00
Jérôme Duval
e8bc20e263 updated mesa to 7.0.3
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 16:33:15 +00:00
François Revol
807cf76df0 memory barrier functions available for drivers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 15:18:04 +00:00
Jérôme Duval
67ed230831 fix warning
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 15:12:55 +00:00
Jérôme Duval
66cb27d82e patch from JiSheng which fixes firewire build warnings and fix atomic_set_int to use atomic_or
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 15:02:43 +00:00
Stephan Aßmus
03baa14fe9 Style improvements.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-26 09:53:49 +00:00
Ingo Weinhold
123e47de1b Was using __{BEGIN,END}_DECLS without including <sys/cdefs.h>.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-25 20:29:47 +00:00
Ingo Weinhold
0e42d1bcd8 Our sockaddr_storage is only 128 bytes long. Hence invocations of bind()
or connect() that passed sizeof(sockaddr_un) would always fail. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 22:30:54 +00:00
Ingo Weinhold
cc6e7cb347 Added the BSDish openpty().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 21:30:38 +00:00
Ingo Weinhold
fb913b19be Added POSIX functions posix_openpt(), grantpt(), ptsname(), and
unlockpt(), which provide a portable way of opening a pty.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 21:29:13 +00:00
Ingo Weinhold
06b7c7ffe2 * Set reasonable terminal flag defaults. This makes telnetd fully usable
again.
* Publish /dev/ptmx. Opening it will open a fresh pty master. In
  principle /dev/pt/ is obsolete now, but I guess we keep it around for
  compatibility with BeOS. Though there shouldn't be many applications
  opening a pty, that we might be interested in...
* New ioctls B_IOCTL_GET_TTY_INDEX (returns the tty index) and
  B_IOCTL_GRANT_TTY (grants tty slave access rights).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-24 21:26:35 +00:00
Ingo Weinhold
023bf5fcda * Added support for timeouts.
* Added support for non-published condition variables. One has to call
  Init() on those, and add entries directly with the
  ConditionVariable::Add() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-22 21:46:23 +00:00
Ingo Weinhold
f842b6fa57 * Added THREAD_BLOCK_TYPE_OTHER.
* Made the object pointer passed to thread_prepare_to_block() const, so
  that strings can be passed without casting. Passing a string could
  maybe be made a convention for THREAD_BLOCK_TYPE_OTHER.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-22 21:43:54 +00:00
Ingo Weinhold
6cef245eca * Detemplatized ConditionVariable{Entry}. Merged them with their
respective Private* base class.
* Changed sigwait() and sigsuspend() to use thread_block() instead of a
  condition variable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-22 18:32:15 +00:00
Ingo Weinhold
b95f6d4710 * Introduced a set of functions (thread_prepare_to_block(),
thread_block(), thread_unblock(),...) that allow a thread to wait for
  something without needing a semaphore or condition variable. It can
  simply block and another thread can unblock it. Supports timeouts and
  interrupting. Both semaphores and condition variables use this
  common mechanism, now.
* Semaphores:
  - Some simplifications due to the thread blocking mechanism.
  - Changed locking order to sem -> thread. It was the other way around
    before and when introducing the wait_for_objects() support I had
    also introduced a situation where the locking was reverse, which
    could potentially cause a dead lock on SMP systems.
  - Instead of queueing thread structures, a semaphore queues
    queued_thread entries now, which are created on the stack. The
    thread::sem structure could thus be removed.
  - Added sem_entry::net_count, which is sem_entry::count plus the
    acquisition count of all waiting threads. This number is needed in
    remove_thread_from_sem() and instead of computing it there we
    maintain it.
  - Fixed remove_thread_from_sem(). It would not unblock threads, if
    the sem count was <= 0.
  - Made sem::last_acquirer unconditional. It is actually needed for
    sem_info::latest_holder. Fixed fill_sem_info() accordingly.
  - Added some optional tracing output, though only via ktrace_printf().
* Condition variables:
  - Could be simplified significantly through the use of the thread
    blocking mechanism. Removed a good deal of unnecessary code.
  - Moved the ConditionVariableEntry "flags" parameter from Wait() to
    Add(), and adjusted all places where condition variables are used
    accordingly.
* snooze() uses thread_block_with_timeout() instead of a semaphore.
* Simplified thread interrupting in the signal and user debugger code.
  Instead of separate functions for threads waiting on a semaphore or
  condititon variable, we only have a single thread_interrupt(), now.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-22 16:22:42 +00:00
Ingo Weinhold
e01cebeb0a * cancel_timer():
- If the hook of the timer we're cancelling is currently being
    executed, we do now wait till it is finished. This is how the BeBook
    specifies the function to behave.
  - Periodic timers would not be cancelled, if their hook was being
    invoked at the same time, since they weren't in the queue during
    that time.
  - Since we know the CPU on which the timer is scheduled (timer::cpu),
    we don't have to look through any other CPU queue to find it.
  - Fixed the return value. It should report whether the timer had
    already fired, and was not always doing that.
* Added private add_timer() flag B_TIMER_ACQUIRE_THREAD_LOCK. It causes
  the thread spinlock to be acquired before the event hook is called.
  cancel_timer() doesn't wait for timers with the flag set. Instead we
  check in the timer interrupt function after acquiring the thread
  spinlock whether the timer was cancelled in the meantime. Calling
  cancel_timer() with the thread spinlock being held does thus avoid any
  race conditions and won't deadlock, if the event hook needs to acquire
  the thread spinlock, too. This feature proves handy for some kernel
  internal needs.
* The scheduler uses a B_TIMER_ACQUIRE_THREAD_LOCK timer now and
  cancel_timer() instead of the no longer needed
  _local_timer_cancel_event().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-22 15:29:22 +00:00