25611 Commits

Author SHA1 Message Date
Stephan Aßmus
95d27b2afd Applied patch by "anxiety":
* Tracked down the problem[1] to the wrong offset being read from the pci config.
  Now matches Realtek's Linux driver. I couldn't find why it worked before as
  the value hasn't changed since the original version added to the repository.
  This is only verified with my own 8168 but I found no special logic in other
  drivers for 8167 or 8169.
[1] See #1853, "RTL8168 recognized but not working"
I don't have the hardware myself to test.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26873 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26873
2008-08-08 10:43:08 +00:00
Ingo Weinhold
3521e43f97 Small test for mprotect().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26872 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26872
2008-08-08 01:00:40 +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
hrev26871
2008-08-08 01:00:06 +00:00
Stephan Aßmus
f72ed717b4 The previous loop to remove all the BHandlers in the destructor was really quite
inefficient. And while it did check if the handler was not NULL, it would have
resulted in an endless loop if it was. I think we can safely assume we have no
NULL BHandlers in that list though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26870 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26870
2008-08-07 21:42:02 +00:00
Stephan Aßmus
39c564f1e7 * Turn the debug output for node monitoring optional tracing.
* Output something if the node monitor message does not contain the expected
  fields (Haiku node monitoring is soo much easier...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26869 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26869
2008-08-07 21:37:32 +00:00
Stephan Aßmus
5c1147db87 * Apply the same trick to the acceleration value, too.
* When reading the settings, get smoother values also.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26868 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26868
2008-08-07 19:03:06 +00:00
Jérôme Duval
8715a6ad9c * style cleanup
* avoid using read/write and block flags for mapping register memory


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26867 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26867
2008-08-07 18:59:07 +00:00
Stephan Aßmus
6ee854cbde Patch by Alexandro D. Almeida:
* Cast the slider value to double before dividing by 1000 in order to apply
  a smooth speed value. Fixes #1470. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26866 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26866
2008-08-07 18:58:38 +00:00
Axel Dörfler
e6679f9d0d * Since we're using ASSERT macros, still lock/unlock the nodes when
initializing the file system.
* This fixes bug #2580.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26865 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26865
2008-08-07 17:37:07 +00:00
Axel Dörfler
f93c785026 * FlushAndRemoveAllPages() cannot call WriteModified(), as it must be called
with the VMCache lock held, and WriteModified() locks itself.
* Added an assertion that the lock is held when calling that method.
* This fixes a KDL as soon as you would have used O_NOCACHE with a file that
  had already some pages read in.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26864 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26864
2008-08-07 17:36:01 +00:00
Bruno G. Albuquerque
7c7dc861e8 Work in progress while trying to fix ticket #2227:
- Ooops. Copy and paste bug.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26863 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26863
2008-08-07 17:05:12 +00:00
Bruno G. Albuquerque
2f1be5703c Work in progress while trying to fix ticket #2227:
- Added skeleton code for setting device mode.
- Next, figure out which bits to set!



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26862 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26862
2008-08-07 16:09:45 +00:00
Axel Dörfler
df6394aee1 * cdda_read_dir() did not correctly report the number of entries put into
the dirent buffer. This fixes Rene's comment about "ls" entering an endless
  loop.
* It also didn't access the buffer passed in correctly if it came from userland.
* It now also fills in as many entries in the buffer as fit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26861 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26861
2008-08-07 14:29:12 +00:00
Axel Dörfler
ed7c4a3e9a * Added simple test app for readdir() to see how it fills out the dirent
and the private DIR parts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26860 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26860
2008-08-07 14:25:06 +00:00
Axel Dörfler
49a7b6198d * fix_dirent() now correctly handles buffers from userland.
* dir_read() now takes into account that we may have read more than one dir
  entry, and calls fix_dirent() for each of them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26859 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26859
2008-08-07 14:23:44 +00:00
Axel Dörfler
b0884f0cb8 * Fixed a ton of wrong usages of B_CONTIGUOUS + B_FULL_LOCK.
* The use of B_{READ|WRITE}_AREA throughout the drivers is surely alarming.
  Defining these flags means that *every user* application can access these
  buffers read/write, it becomes visible in userspace like any other memory
  (just shared among all apps). I would like to ask each driver maintainer
  to see if that is really wished here. If you only need one app to be able
  to access it, cloning the area would be more appropriate.
* I came across the use of B_ANY_KERNEL_BLOCK_ADDRESS a number of times. This
  is almost completely useless for most usages, as it tries to align the
  virtual to a multiple of the size of the area. It just makes the allocation
  more likely to fail. Please only use where appropriate, and please review
  your code.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26858 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26858
2008-08-07 13:00:36 +00:00
Axel Dörfler
9372d6969b * White space cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26857 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26857
2008-08-07 12:29:32 +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
hrev26856
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
hrev26855
2008-08-07 08:14:09 +00:00
Salvatore Benedetto
cefb069022 * Adding xsi semaphore test unit
* Moving common functions and macros used in realtime_sem_test1
  to a shared header as they are probably going to be used for other test unit



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26854 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26854
2008-08-07 08:09:56 +00:00
Axel Dörfler
a89962b923 * read_cdda_data() needs to know the last frame of the track, so that it can
cut down the buffer size on the last request. This fixes bug #2565.
* cdda_read() did report an incorrect number of bytes read. This fixes bug
  #2511, and also that you couldn't copy tracks via "cp".
* cdda_read_stat() did not include the WAV header in its reported size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26853 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26853
2008-08-07 07:29:29 +00:00
Axel Dörfler
72ebbe4244 * Forgot to allocate the dma_resource before using it. Now scsi_cd works again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26852 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26852
2008-08-07 06:41:15 +00:00
Ingo Weinhold
3394ebd3c2 * Improved some output and coding style.
* If a segment violation occurs, we do now check whether the thread in
  question has a handler for SIGSEGV. If so, we just send it the signal.
  Otherwise we notify the debugger as before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26851 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26851
2008-08-07 01:18:04 +00:00
Ingo Weinhold
309922b652 Copy and paste bug. Fixes #2576.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26850 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26850
2008-08-07 00:19:44 +00:00
Ingo Weinhold
993a8b776f VMCache::RemoveArea(): Don't release the store reference while having
the cache locked, since it enters the VFS and might reenter VMCache,
thus causing deadlocks. Fixes bug #2577.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26849 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26849
2008-08-06 23:02:59 +00:00
Stephan Aßmus
a5b8a7dfc9 Handle removed files.
* On Haiku, this will make them disappear from the results list.
* On BeOS, it will only work around the problem that we don't know
  which file was removed from the node monitoring message...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26848 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26848
2008-08-06 20:22:50 +00:00
Jérôme Duval
1708513ca8 * added an ALIGN macro for easing readability and use it for 128 alignments
* use HDAC_STREAM_POSITION register value to check the current buffer cycle in interrupt handler
* added B_FULL_LOCK flags for area allocation, not sure it's handled but at least more correct
* buffer descriptors now use a low and high address fields
* applied a byte mask on format
* enabled PCI bus mastering if not yet done
* the PCI space register TCSEL (Traffic Class Select Register, which sets PCI express QOS) is now reset to TC0 (clear 0-2 bits) as needed on some boards like mine to 
ensure good playback

Playback is finally working correctly here on ICH8 HDA!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26847 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26847
2008-08-06 20:04:51 +00:00
Stephan Aßmus
28fd262f0e Stop node monitoring when the model changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26846 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26846
2008-08-06 19:55:19 +00:00
Stephan Aßmus
c891bf220e Fix compilation for BeOS compatible targets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26845 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26845
2008-08-06 19:41:00 +00:00
Bruno G. Albuquerque
c93ffc4a03 Work in progress while trying to fix ticket #2227:
- Removed most of the currently fixup code as, at least on my machine, 
  it was messing stuff up. This makes the PATA controller work in IDE 
  mode!
- Added comments to clarify things and TODOs about what is still missing 
  (specially getting AHCI mode working).

Marcus, please review.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26844 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26844
2008-08-06 18:57:56 +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
hrev26843
2008-08-06 16:56:24 +00:00
Bruno G. Albuquerque
20a8524cc9 Work in progress while trying to fix ticket #2227:
- Better adhere to style guide.
- Remove superfluous check for device function before setting IRQ.
- Added comment about setting IRQ for device with function 1.
- This fixes nothing yet, in case you are wondering. :)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26842 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26842
2008-08-06 16:39:56 +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
hrev26841
2008-08-06 10:01:53 +00:00
Axel Dörfler
a8b77fe01e * Reenabled the ASSERT() in ata_request_set_status(), the problem has been
fixed. Not sure why the 6 to 10-byte command translation was triggered,
  though.
* Minor coding style changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26840 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26840
2008-08-06 08:57:23 +00:00
Axel Dörfler
6568215497 * scsi_read_write_6() was incorrectly translating 6-byte requests with a length
of 0 (as this means 256 blocks).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26839 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26839
2008-08-06 08:54:49 +00:00
Axel Dörfler
f8a59924e5 * Added Dump() method to IORequest, IOOperation, IOBuffer, and DMABuffer.
* Added KDL commands "io_request", "io_operation", "io_buffer", and
  "dma_buffer".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26838 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26838
2008-08-06 08:01:07 +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
hrev26837
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
hrev26836
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
hrev26835
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
hrev26831
2008-08-05 22:12:24 +00:00
Jérôme Duval
43619079f8 sManagedEnviron is already checked for NULL value in free_variables()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26830 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26830
2008-08-05 22:06:21 +00:00
Axel Dörfler
65f1e8eceb * Ported scsi_cd, too, still untested.
* This should have been part of r26828, although it did not break the build :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26829 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26829
2008-08-05 21:15:28 +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
hrev26828
2008-08-05 21:11:51 +00:00
Maurice Kalinowski
34faa5f214 * In case we do not have any frames to convert we'll need to break,
otherwise we end up in an endless loop. This only happened when
   the remaining raw data provided did not contain enough content.
   In this particular case there were only 2 bytes remaining though
   the decoder needed 4 bytes to handle at least 1 frame. Seems like
   the audio file only provided data for one channel in the end, which
   did not lead to a B_LAST_BUFFER_ERROR yet as it has been read properly.
 * This fixes bug 1708 and most probably 1275 as well (someone check and
   close please)

Didn't we just have a discussion about Media handling killing the system
:P

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26827 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26827
2008-08-05 21:09:12 +00:00
Maurice Kalinowski
2b273dbc5d whitespace cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26826 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26826
2008-08-05 21:09:01 +00:00
Axel Dörfler
39b5c37418 * Added a DMAResource::Init() method that gets a device node - for now, it will
reuse the block_io attributes in the node to build the dma_restrictions.
* DMAResource::Init() now dumps the dma_resources (should be done with the
  TRACE() macro later).
* Turned off IOScheduler debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26825 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26825
2008-08-05 21:00:02 +00:00
Karsten Heimrich
9e8c301a39 * fix of by one error, makes printing of ranges work properly
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26824 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26824
2008-08-05 20:42:34 +00:00
Karsten Heimrich
14ea5e5e98 * whitespace cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26823 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26823
2008-08-05 20:41:31 +00:00
Karsten Heimrich
1a74e75248 * replace some whitespaces
* return error in case we could not get all values from JobConfig



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26822 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26822
2008-08-05 20:40:49 +00:00
Karsten Heimrich
1c08970124 * make use of libprint inbuild Preview class
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26821 a95241bf-73f2-0310-859d-f6bbb57e9c96
hrev26821
2008-08-05 20:39:11 +00:00