Commit Graph

25621 Commits

Author SHA1 Message Date
Salvatore Benedetto
90b73f5f3f * Applied our coding guidelines
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26883 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-09 08:14:40 +00:00
Salvatore Benedetto
d9409b5cda * Clean up
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 23:27:23 +00:00
Ingo Weinhold
b328324d19 DMAResource::TranslateNext(), in case of given physical vecs:
* segmentCount was potentially set incorrectly. It could be too big,
  since we considered all vecs, not only those remaining.
* The main loop condition was incorrect. This would lead to too few
  DMABuffer vecs (or none at all) for any but the first IOOperation of a
  request. Should fix #2586.
* Correctly offset by vecIndex in debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 23:15:21 +00:00
Salvatore Benedetto
4ef471dec0 Start porting udf
- Cleaning up AllocationDescriptorList in order to follow our coding guidelines
- Moving methods implentation outside the class

I've already ported udf but I'm going to commit it one file at the time
so it's easier to review, plus I still have to clean up the code.

Please review.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 22:53:36 +00:00
Axel Dörfler
8c5620e78f * Reverted last commit - not a good idea to provide untested patches. With the
patch applied, the card didn't work at all anymore.
* Minor 80-column/white space cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26879 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 15:37:43 +00:00
Axel Dörfler
ae9067b364 * Fixed PXE boot loader build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 15:23:44 +00:00
Stephan Aßmus
5ef86fce1f * Rename the private structs to use the same scheme as for classes, which seems
to be the habbit now.
* Improve PathHandler::Quit() to delete the object in case the BMessenger was
  not valid or failed to send the Quit message. This should handle the corner
  case that the PathHandler's looper was already Quit(). There could still be
  a race condition, although I don't know if it affects local message targets
  in Haiku. I added a TODO note for that, but I believe it can be neglected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26877 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:22:00 +00:00
Ingo Weinhold
90cd1b25e1 vm_remove_all_page_mappings(): Decrement the mapped pages count only, if
the page was really mapped before. Fixes bug #2585.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:01:09 +00:00
Ingo Weinhold
e387dd151b "page_stats" does now also print the number of mapped pages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:00:07 +00:00
Axel Dörfler
626599ea23 * scsi_cd/scsi_disk are new drivers, and therefore they need to use a different
rule.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26874 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 11:26:58 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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