Commit Graph

5709 Commits

Author SHA1 Message Date
Ingo Weinhold cfefeee3f8 * Changed arch_debug_save_registers() to take an arch-specific structure
arch_debug_registers instead.
* Call arch_debug_save_registers() on all CPUs when entering the kernel
  debugger.
* Added debug_get_debug_registers() to return a specified CPU's saved
  registers.
* x86:
  - Replaced the previous arch_debug_save_registers() implementation. Disabled
    getting the registers via the gdb interface for the time being.
  - Fixed the "sc", "call", and "calling" commands to also work for threads
    running on another CPU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-18 17:20:06 +00:00
Stephan Aßmus 76ab3f88df Basically, this changeset implements BShape::ArcTo(). In more detail:
* Added BShape::ArcTo() and BShapeIterator::IterateArcTo(), using a previously
   unused virtual slot. (Added the symbols for binary compatibility for GCC2
   and GCC4.)
 * Added operator=(), operator==() and operator!=() to BShape.
 * Added BShape::BezierTo() version taking three points, which is sometimes
   more convenient.
 * Added the four new shape data ops OP_LARGE_ARC_TO_CW, OP_LARGE_ARC_TO_CCW,
   OP_SMALL_ARC_TO_CW and OP_SMALL_ARC_TO_CCW. For a single arc, provided the
   radius is large enough, there are four possibilities to draw the arc, these
   are controlled by the two boolean flags to ArcTo() and mapped to the new
   commands accordingly.
 * Some style cleanup in Shape.cpp (sorry for mixing it up, but it gets
   worse below...)
 * Added ShapeTest to src/tests/servers/app.
 * Changed the way BShapes are transformed from view to screen space in the
   app_server. For arcs, it would be nontrivial to apply a proper transformation,
   it's much easier to let AGG take care of it. This affects ServerPicture as
   well.
 * Wrapped iterating the BShape into try/catch blocks in ShapeIterator. But
   I really don't understand the purpose of the class in the first place.
   Maybe it can now be dropped, since coordinates don't have to be transformed
   in place anymore.
 * Refactored copy&paste shape iteration code in Painter. The transformation
   to screen space happens there.
 * Since RemoteDrawingEngine needed to be adopted anyway, I also updated
   it for the new DrawString() with offsets version. But the client still needs
   to be adapted.
 * Style cleanup in Painter.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-18 16:58:19 +00:00
Ingo Weinhold fe0963a835 Added commands to the page access debugging panic()s.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-18 16:19:13 +00:00
Stephan Aßmus bbba047c2d * Added copy constructors.
* Let the AddHours(), Add*() return itself, so that they can be chained.
 * Made the previous *Name() methods static and added non-static versions that
   take the day/month of the object.
 * Make BDateTime::Date/Time() return references (const or non-const).
 * Fixed the BDateTime comparison operators.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-17 18:51:41 +00:00
Ingo Weinhold 085cf27b40 * Added Directory::CreateFile() which can be implemented by file systems to
support file creation.
* Extended open() and open_from() to support O_CREAT to create files.
  open_from() has got an optional "permissions" parameter for that purpose.
* Fixed errno. It would crash when being used. Also changed the POSIX functions
  to return their error code via errno as expected.
* Added writev().
* FAT file system:
  - Added support for reading long file names.
  - Added support for creating files (8.3 name only) and writing to them.
  - Enabled scanning partitions with it.
* Boot loader menu:
  - Enabled the "Reboot" menu item unconditionally.
  - Added "Save syslog from previous session" menu item to the debug menu.
    Currently saving the syslog to FAT32 volumes is supported.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35882 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-16 17:29:58 +00:00
Ingo Weinhold fac2ce3d92 Added ring_buffer_get_vecs() that returns iovecs describing the contents of
the buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-16 17:07:40 +00:00
Stephan Aßmus a9daf3d911 Improved the DrawString() method that takes offsets per glyph by making the
client provide the array size. Added version that doesn't take a string length
for convenience.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35866 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-15 15:08:07 +00:00
Stephan Aßmus 77e5acc0d9 * Extended the BView drawing API by a DrawString() version that takes an array
of locations, one for each glyph.
 * Added a test for the new functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-15 13:59:14 +00:00
Jérôme Duval e842ee1933 * moved tiff public headers to headers/libs/tiff
* build shared and static libraries for libtiff, cleaned libtiff sources
* TIFFTranslator now uses this library
I used 3.8 as library version as it seems the API didn't change since then


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35857 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-14 14:13:12 +00:00
Jérôme Duval 6793fc9a17 updated libpng to 1.4.1
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35846 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-13 18:30:53 +00:00
Stephan Aßmus 2318b47802 Indentation update.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35841 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-13 17:55:17 +00:00
Ingo Weinhold 7778bccf93 sigsuspend() would previously wake up correctly when a matching signal was
received, but if the signal was in the thread's signal block mask, it would
not be handled. Added thread::sig_temp_enabled, an additional mask of not
blocked signals, which is set by sigsuspend() and evaluated and reset by
handle_signals(). Fixes #5567.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-13 13:17:40 +00:00
Ingo Weinhold f795376ec6 remove_addr_range() is actually called remove_address_range().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-12 16:55:42 +00:00
Ingo Weinhold 28a2172c3f kernel:
* The kernel syslog ring buffer is no longer emptied by the syslog sender
  thread. Instead we only drop the oldest data from the buffer when we're
  writing to it and there's not enough free space in it.
  Advantages: We drop old data rather than the most recent data when the buffer
  is full. The "syslog" KDL command has more data available now. So the odds
  are that kernel syslog messages not written to disk yet are at least still
  in the kernel buffer.
* Changed dprintf_no_syslog() semantics: Now it writes to the syslog, but
  doesn't notify the syslog sender thread.

boot loader:
* Added the ring_buffer implementation and a dummy user_memcpy().
* bios_x86: Moved the syslog stuff from serial.{cpp,h} to debug.{cpp.h}.
* Moved the debug options from the "Select safe mode options" menu to a new
  "Select debug options" menu.
* Added option "Enable debug syslog" to the new menu (ATM available on x86
  only). It allocates a 1 MB in-memory buffer for the syslog for this session
  in such a way that it can be accessed by the boot loader after a reset.
* Added item "Display syslog from previous session" to the new menu, doing
  what its name suggests.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-11 17:46:36 +00:00
Ingo Weinhold 546f4e5e05 * Added create_ring_buffer_etc() which allows to re-create a ring buffer from
a given flat buffer.
* Added ring_buffer_peek() for random position reading from the ring buffer
  without changing its state.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-11 17:12:21 +00:00
Philippe Houdoin b19902ae4e Made BGLView by default freely resizable by layout manager. I'm not sure I didn't break binary compatibility, please review.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-10 23:03:03 +00:00
Ingo Weinhold 73a72c42e2 Added get_free_address_range() to get a free range in a given range array.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-10 18:36:44 +00:00
Stephan Aßmus e59dc33e21 * Added BCursorID enumeration in App Kit's Cursor.h and new constructor which
takes such an id.
 * Reused the existing mechanism to to have hardcoded tokens for the system
   cursors, i.e. removed cursor_which enumeration from ServerProtocol.h and
   used BCursorID where cursor_which was previously used.
 * Reworked CursorManager.h and CursorSet.h accordingly and removed some methods
   that where intended to replace system cursors with client cursors, since
   those would break the reference counting and forget to maintain the cursor
   list.
 * Replaced the cursors in CursorData.h/cpp with the new ones I just designed.
 * Removed HaikuSystemCursor.h and HaikuLogo.h from the source, as those are/were
   no longer used.

I hope I will not get too much beating for this one... :-) I know the new
default cursor is slightly larger, but I believe the old one was just too small.
Also I noticed that the cursor may be slightly too dark, at least the old one
seems noticeably brighter when compared side by side (the new one has a slight
gradient). That is something I may correct at least. Otherwise I hope nothing
is broken, I've tested in QEMU and so far everything works as intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-07 23:12:34 +00:00
Stephan Aßmus a070cf5306 * Indentation update in DateTime.h
* Extended BTime, BDate and BDateTime with archiving functionality.
 * Adjusted code which uses these classes, since including DateTime.h
   already imports the classes from the BPrivate namespace.
 * Moved DateTime.h into Support Kit. It is still in the BPrivate namespace,
   as I am uncertain what to do with time_type and diff_type. I'd favor
   moving the constants into the classes itself. Possibly removing the B_
   prefix from them. Feedback welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35772 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-07 12:08:47 +00:00
Ingo Weinhold d40a935560 Boot loader (x86 mmu.cpp):
* Made the page table allocation more flexible. Got rid of sMaxVirtualAddress
  and added new virtual_end address to the architecture specific kernel args.
* Increased the virtual space we reserve for the kernel to 16 MB. That
  should suffice for quite a while. The previous 2 MB were too tight when
  building the kernel with debug info.
* mmu_init(): The way we were translating the BIOS' extended memory map to
  our physical ranges arrays was broken. Small gaps between usable memory
  ranges would be ignored and instead marked allocated. This worked fine for
  the boot loader and during the early kernel initialization, but after the
  VM has been fully set up it frees all physical ranges that have not been
  claimed otherwise. So those ranges could be entered into the free pages
  list and would be used later. This could possibly cause all kinds of weird
  problems, probably including ACPI issues. Now we add only the actually
  usable ranges to our list.

Kernel:
* vm_page_init(): The pages of the ranges between the usable physical memory
  ranges are now marked PAGE_STATE_UNUSED, the allocated ranges
  PAGE_STATE_WIRED.
* unmap_and_free_physical_pages(): Don't free pages marked as unused.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-02 18:13:06 +00:00
Rene Gollent 4f85bc9f18 Cleanup of previous work: whether or not we're talking to app_server is already determined at time of port assignment. As such we don't need to cache or care about that, but rather just cache the target team instead of looking it up from the port info every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35682 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-28 23:25:23 +00:00
Rene Gollent 099f9551c7 Cache the app_server port lazily so we don't have to look it up every time.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-28 22:55:43 +00:00
Ingo Weinhold 8b3d3d8a15 Correctly handle cases when a thread single-steps into the kernel as it can
happen on syscalls or "int" instructions. The debug exception handler sets
the thread debug flags B_THREAD_DEBUG_STOP and
B_THREAD_DEBUG_NOTIFY_SINGLE_STEP (new) and lets the thread continue. Before
leaving the kernel the thread is stopped and a single-step notification is
sent. Fixes #3487.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35620 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-25 20:20:16 +00:00
Ingo Weinhold 464d9f1252 Changed object_depot_store() return value to void. It is now always takes
over ownership of the object. Fixes double free introduced in r35605.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35608 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-24 19:04:41 +00:00
Axel Dörfler ff59ce680d * The low resource handler now empties the cache depot's magazines; before,
they were never freed unless the cache was destroyed (I just wondered why
  my system would bury >1G in the magazines).
* Made the magazine capacity variable per cache, ie. for larger objects, it's
  not a good idea to have 64*CPU buffers lying around in the worst case.
* Furthermore, the create_object_cache_etc()/object_depot_init() now have
  arguments for the magazine capacity as well as the maximum number of full
  unused magazines.
* By default, you might want to initialize both to zero, as then some hopefully
  usable defaults are computed. Otherwise (the only current example is the
  vm_page_mapping cache) you can just put in the values you'd want there.
  The page mapping cache uses larger values, as its objects are usually
  allocated and deleted in larger chunks.
* Beware, though, I couldn't test these changes yet as Qemu didn't like to run
  today. I'll test these changes on another machine now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-24 14:43:20 +00:00
Stephan Aßmus b2e1893c6e Added SetBorder() virtual method and feature. Could also be used by the Terminal
now to polish the tabbed look.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-21 20:15:21 +00:00
Jérôme Duval dd4974484f merged freetype 2.3.12
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-21 20:08:50 +00:00
Ingo Weinhold bd7645a12a * Made vm_page::state private and added accessor methods.
* Added kernel tracing for page state transitions.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-20 15:57:44 +00:00
Ingo Weinhold 8b522fcfe6 Changed ASSERT_[ALWAYS_]PRINT() to add the additional output to the panic()
message instead of printing it before calling panic().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-20 14:19:52 +00:00
Ingo Weinhold d36b9aef3e Added vm_page::IsMapped() for convenience.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-20 12:29:42 +00:00
Axel Dörfler b9fa1de995 * Fixed incomplete cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-19 21:31:59 +00:00
Axel Dörfler 63b69bec3c * Applied patch by Andreas Färber as part of #5319.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35522 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-19 16:44:55 +00:00
Ingo Weinhold dac21d8bfe * map_physical_memory() does now always set a memory type. If none is given (it
needs to be or'ed to the address specification), "uncached" is assumed.
* Set the memory type for the "BIOS" and "DMA" areas to write-back. Not sure, if
  that's correct, but that's what was effectively used on my machines before.
* Changed x86_set_mtrrs() and the CPU module hook to also set the default memory
  type.
* Rewrote the MTRR computation once more:
  - Now we know all used memory ranges, so we are free to extend used ranges
    into unused ones in order to simplify them for MTRR setup.
  - Leverage the subtractive properties of uncached and write-through ranges to
    simplify ranges of any other respectively write-back type.
  - Set the default memory type to write-back, so we don't need MTRRs for the
    RAM ranges.
  - If a new range intersects with an existing one, we no longer just fail.
    Instead we use the strictest requirements implied by the ranges. This fixes
    #5383.

Overall the new algorithm should be sufficient with far less MTRRs than before
(on my desktop machine 4 are used at maximum, while 8 didn't quite suffice
before). A drawback of the current implementation is that it doesn't deal with
the case of running out of MTRRs at all, which might result in some ranges
having weaker caching/memory ordering properties than requested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35515 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-18 13:52:43 +00:00
Adrien Destugues 33eead339b * Improve the test for TimeFormat (style and error checking)
* Fix the TimeFormat API, there was a double free. Make it work as expected : you send it a number of seconds and it will format it properly in days, hours, minutes, seconds with proper plural.
 * Cleanup other parts of the Format API from useless things. They may get reintroduced later if we feel the need to do so.
 * AboutSystem now use TimeFormat to display the uptime in properly localized way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 15:35:28 +00:00
Rene Gollent 202a4e9c1e Fix gcc4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 00:46:43 +00:00
Adrien Destugues b2c385c072 -Added new TimeFormat API for formatting and localizing a time (uptime, copy duration, ...)
-Added a very simple test that shows the API is corrupting memory and ends up crashing
-Fixed build of other locale tests


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-17 00:02:50 +00:00
Ingo Weinhold 4bb4f79355 Added assert.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35497 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-16 16:49:52 +00:00
Michael Lotz ac653a30df Add heap_debug_set_debugger_calls() which allows to disable debugger calls for
the heap debug panics. Instead syslog output is generated if turned off.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-15 21:35:07 +00:00
Michael Lotz c1502cf1b8 Add heap_debug_get_allocation_info() to retrieve the size of the allocation as
well as the thread allocating it. Can for example be used to verify that an
object or buffer is as large as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-15 20:57:52 +00:00
Michael Lotz 081ff2db28 * Add heap_debug_set_memory_reuse() which allows to disable memory reuse,
keeping all returned heap memory in the 0xdeadbeef state (including the
  first sizeof(void *) bytes otherwise for the free list). While wasting a lot
  of memory it allows you to rely on 0xdeadbeef being always present as no
  future allocation will reuse the freed memory block.
* Also added heap_debug_malloc_with_guard_page() which is intended to allocate
  a memory block so it is aligned that the start of invalid memory past the
  allocation is in an unmapped guard page. However the kernel backend that would
  guarantee this is not yet implemented, so right now this works only by chance
  if no other area happens to be allocated exactly past the created one. With a
  very specifc suspicion you can put that one allocation you get to good use
  though. It causes a crash when accessing memory past the allocation size so
  you actually get a backtrace from where the access happened instead of only
  after freeing/wall checking.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35478 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-15 20:28:15 +00:00
Axel Dörfler 755a1de8c1 * BReference no longer uses the deprecated API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-14 22:22:17 +00:00
Siarzhuk Zharski 408a0aa2f1 Identification for "Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz" added.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-11 06:41:13 +00:00
Artur Wyszynski 38ecc1a764 Added FreeBSD fenv implementation - tested with dmd port, seems that it works
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-09 06:09:28 +00:00
Artur Wyszynski cee04e8074 Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-08 22:50:38 +00:00
Michael Lotz f6a6245c89 * Adding malloc_debug.h that exposes the malloc_debug API.
* Moving some functions around, removing and adding others for the public API.

I've written a blog post at haiku-os.org to go as documentation for this
introducing the API and the other helpful bits.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-08 01:27:21 +00:00
Stephan Aßmus a487da80ba * Make a BStatusBar comfortable to use without any text labels.
* In SetBarHeight(), use InvalidateLayout() when used with layout management.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35418 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-06 09:48:37 +00:00
Axel Dörfler a28ad48075 * Added _SIZEOF_ADDR_IFREQ() macro as existing on FreeBSD.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-04 20:40:35 +00:00
Ingo Weinhold 40bb94819e * Removed useless return parameter from vm_remove_all_page_mappings().
* Added vm_clear_page_mapping_accessed_flags() and
  vm_remove_all_page_mappings_if_unaccessed(), which combine the functionality
  of vm_test_map_activation(), vm_clear_map_flags(), and
  vm_remove_all_page_mappings(), thus saving lots of calls to translation map
  methods. The backend is the new method
  VMTranslationMap::ClearAccessedAndModified().
* Started to make use of the cached page queue and changed the meaning of the
  other non-free queues slightly:
  - Active queue: Contains mapped pages that have been used recently.
  - Inactive queue: Contains mapped pages that have not been used recently. Also
    contains unmapped temporary pages.
  - Modified queue: Contains unmapped modified pages.
  - Cached queue: Contains unmapped unmodified pages (LRU sorted).
  Unless we're actually low on memory and actively do paging, modified and
  cached queues only contain non-temporary pages. Cached pages are considered
  quasi free. They still belong to a cache, but since they are unmodified and
  unmapped, they can be freed immediately. And this is what
  vm_page_[try_]reserve_pages() do now when there are no more actually free
  pages at hand. Essentially this means that pages storing cached file data,
  unless mmap()ped, no longer are considered used and don't contribute to page
  pressure. Paging will not happen as long there are enough free + cached pages
  available.
* Reimplemented the page daemon. It no longer scans all pages, but instead works
  the page queues. As long as the free pages situation is harmless, it only
  iterates through the active queue and deactivates pages that have not been
  used recently. When paging occurs it additionally scans the inactive queue and
  frees pages that have not been used recently.
* Changed the page reservation/allocation interface:
  vm_page_[try_]reserve_pages(), vm_page_unreserve_pages(), and
  vm_page_allocate_page() now take a vm_page_reservation structure pointer.
  The reservation functions initialize the structure -- currently consisting
  only of a count member for the number of still reserved pages.
  vm_page_allocate_page() decrements the count and vm_page_unreserve_pages()
  unreserves the remaining pages (if any). Advantages are that reservation/
  unreservation mismatches cannot occur anymore, that vm_page_allocate_page()
  can verify that the caller has indeed a reserved page left, and that there's
  no unnecessary pressure on the free page pool anymore. The only disadvantage
  is that the vm_page_reservation object needs to be passed around a bit.
* Reworked the page reservation implementation:
  - Got rid of sSystemReservedPages and sPageDeficit. Instead
    sUnreservedFreePages now actually contains the number of free pages that
    have not yet been reserved (it cannot become negative anymore) and the new
    sUnsatisfiedPageReservations contains the number of pages that are still
    needed for reservation.
  - Threads waiting for reservations do now add themselves to a waiter queue,
    which is ordered by descending priority (VM priority and thread priority).
    High priority waiters are served first when pages become available.
  Fixes #5328.
* cache_prefetch_vnode(): Would reserve one less page than allocated later, if
  the size wasn't page aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-03 18:53:52 +00:00
Ingo Weinhold 2735cad982 Added missing include.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-03 18:47:07 +00:00
Ingo Weinhold cf99b9ab60 Added VMCache::CacheRef() accessor.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-03 18:46:29 +00:00
Michael Lotz 5bc9fb9d24 * Replace the truncate_string() helper function with a new, simplified version.
* Remove no longer necessary support functions.
* The new version uses a single BString as input/output parameter and only
  modifies that one by removing non-fitting chars and inserting the ellipsis
  where appropriate, so avoids copying around bytes/chars/strings in a few
  places. It uses the new Chars functions of BString so also no need for manual
  multibyte handling.
* Adjusted the BFont and ServerFont usage of truncate_string() which are both
  simplified by using the single BString. It avoids a lot of temprary
  allocations and string copying. The char * version of BFont
  GetTruncatedStrings() now uses the BString version and not the other way
  around anymore which requires us to allocate temporary BString objects, it's
  not worse than before though.
* This fixes a bunch of problems with the previous functions like always
  prepending the ellipsis for B_TRUNCATE_BEGINNING, crashing on short enough
  widths, violating the width in the B_TRUNCATE_END case when the width was
  short enough, non-optimal truncation in a few cases and sometimes truncation
  where none would've been needed. Also fixes #4128 which was a symptom of the
  broken B_TRUNCATE_BEGINNING.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 18:43:03 +00:00
Ingo Weinhold c2629ccc6a Patch by "Grey": Small optimization of arch_int_disable_interrupts_inline()
and arch_int_restore_interrupts_inline().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35377 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 08:55:44 +00:00
Michael Lotz a5b7cbe331 Adding utf-8 aware version of most functions to BString. They are named after
the corresponding normal functions but have a "Chars" in the name like
"MoveCharsInto" or "AppendChars". Also added CountBytes() and CharAt().
This should make everyday string handling with multibyte strings a bit easier.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 04:20:01 +00:00
Adrien Destugues 859d808fb7 Also forgot this.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-31 21:22:25 +00:00
Ingo Weinhold e65c400299 * Replaced the vm_page_allocate_page*() "pageState" parameter by a more
general "flags" parameter. It encodes the target state of the page -- so
  that the page isn't unnecessarily put in the wrong page queue first -- a
  flag whether the page should be cleared, and one to indicate whether the
  page should be marked busy.
* Added page state PAGE_STATE_CACHED. Not used yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35333 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-29 15:54:40 +00:00
Ingo Weinhold 72382fa629 * Removed the page state PAGE_STATE_BUSY and instead introduced a vm_page::busy
flag. The obvious advantage is that one can still see what state a page is in
  and even move it between states while being marked busy.
* Removed the vm_page::is_dummy flag. Instead we mark marker pages busy, which
  in all cases has the same effect. Introduced a vm_page_is_dummy() that can
  still check whether a given page is a dummy page.
* vm_page_unreserve_pages(): Before adding to the system reserve make sure
  sUnreservedFreePages is non-negative. Otherwise we'd make nonexisting pages
  available for allocation. steal_pages() still has the same problem and it
  can't be solved that easily.
* map_page(): No longer changes the page state/mark the page unbusy. That's the
  caller's responsibility.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35331 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-29 10:00:45 +00:00
Axel Dörfler e054bfbf08 * Added missing IPv6 defines and in6addr_any, in6addr_loopback exports.
* This should get most IPv6 applications to link (they just can't open IPv6
  sockets yet, as the protocol is missing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-28 09:55:41 +00:00
Ingo Weinhold deee8524b7 * Introduced {malloc,memalign,free}_etc() which take an additional "flags"
argument. They replace the previous special-purpose allocation functions
  (malloc_nogrow(), vip_io_request_malloc()).
* Moved the I/O VIP heap to heap.cpp accordingly.
* Added quite a bit of passing around of allocation flags in the VM,
  particularly in the VM*AddressSpace classes.
* Fixed IOBuffer::GetNextVirtualVec(): It was ignoring the VIP flag and always
  allocated on the normal heap.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35316 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-27 12:45:53 +00:00
Jérôme Duval 7fd580914a * updated libjpeg to version 8, as the previous version on trunk didn't look like version 7, the merge wasn't usable. I modified jpeglib.h to have the JPEGTranslator built.
* added libjpeg to AboutSystem
* JPEGTranslator now uses the shared library libjpeg.so


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-27 01:57:51 +00:00
Ingo Weinhold cff6e9e406 * The system now holds back a small reserve of committable memory and pages. The
memory and page reservation functions have a new "priority" parameter that
  indicates how deep the function may tap into that reserve. The currently
  existing priority levels are "user", "system", and "VIP". The idea is that
  user programs should never be able to cause a state that gets the kernel into
  trouble due to heavy battling for memory. The "VIP" level (not really used
  yet) is intended for allocations that are required to free memory eventually
  (in the page writer). More levels are thinkable in the future, like "user real
  time" or "user system server".
* Added "priority" parameters to several VMCache methods.
* Replaced the map_backing_store() "unmapAddressRange" parameter by a "flags"
  parameter.
* Added area creation flag CREATE_AREA_PRIORITY_VIP and slab allocator flag
  CACHE_PRIORITY_VIP indicating the importance of the request.
* Changed most code to pass the right priorities/flags.

These changes already significantly improve the behavior in low memory
situations. I've tested a bit with 64 MB (virtual) RAM and, while not
particularly fast and responsive, the system remains at least usable under high
memory pressure.
As a side effect the slab allocator can now be used as general memory allocator.
Not done by default yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-26 14:44:58 +00:00
Stephan Aßmus 7f2f2fa041 Remove the ucontext.h header again, until the whole SA_SIGINFO backend is
implemented fully in order not to fool ported software into believing this
API can be used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-25 23:16:06 +00:00
Stephan Aßmus 1518a682f9 Patch by Andreas Faerber: Adding ucontext.h POSIX header. mcontext_h can be
typedef'd to the existing vregs type. Applies #5324. Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-25 18:06:50 +00:00
Ingo Weinhold b4e5e49823 MemoryManager:
* Added support to do larger raw allocations (up to one large chunk (128 pages))
  in the slab areas. For an even larger allocation an area is created (haven't
  seen that happen yet, though).
* Added kernel tracing (SLAB_MEMORY_MANAGER_TRACING).
* _FreeArea(): Copy and paste bug: The meta chunks of the to be freed area
  would be added to the free lists instead of being removed from them. This
  would corrupt the lists and also lead to all kinds of misuse of meta chunks.

object caches:
* Implemented CACHE_ALIGN_ON_SIZE. It is no longer set for all small object
  caches, but the block allocator sets it on all power of two size caches.
* object_cache_reserve_internal(): Detect recursion and don't wait in such a
  case. The function could deadlock itself, since
  HashedObjectCache::CreateSlab() does allocate memory, thus potentially
  reentering.
* object_cache_low_memory():
  - I missed some returns when reworking that one in r35254, so the function
    might stop early and also leave the cache in maintenance mode, which would
    cause it to be ignored by object cache resizer and low memory handler from
    that point on.
  - Since ReturnSlab() potentially unlocks, the conditions weren't quite correct
    and too many slabs could be freed.
  - Simplified things a bit.
* object_cache_alloc(): Since object_cache_reserve_internal() does potentially
  unlock the cache, the situation might have changed and their might not be an
  empty slab available, but a partial one. The function would crash.
* Renamed the object cache tracing variable to SLAB_OBJECT_CACHE_TRACING.
* Renamed debugger command "cache_info" to "slab_cache" to avoid confusion with
  the VMCache commands.
* ObjectCache::usage was not maintained anymore since I introduced the
  MemoryManager. object_cache_get_usage() would thus always return 0 and the
  block cache would not be considered cached memory. This was only of
  informational relevance, though.

slab allocator misc.:
* Disable the object depots of block allocator caches for object sizes > 2 KB.
  Allocations of those sizes aren't so common that the object depots yield any
  benefit.
* The slab allocator is now fully self-sufficient. It allocates its bootstrap
  memory from the MemoryManager, and the hash tables for HashedObjectCaches use
  the block allocator instead of the heap, now.
* Added option to use the slab allocator for malloc() and friends
  (USE_SLAB_ALLOCATOR_FOR_MALLOC). Currently disabled. Works in principle and
  has virtually no lock contention. Handling for low memory situations is yet
  missing, though.
* Improved the output of some debugger commands.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-25 13:46:58 +00:00
Ingo Weinhold 71f65beeb3 Marked CACHE_UNLOCKED_PAGES as unsupported.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-25 12:22:36 +00:00
Ingo Weinhold b20de45ebd * Added optional allocator template parameter.
* Added optional parameter "void** oldTable" to Resize(). If given the old
  allocation for the table is returned instead of freeing it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35278 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-25 12:18:20 +00:00
Clemens Zeidler ef0f557c65 As suggested by Axel use addr_t and size_t.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35267 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-23 16:40:36 +00:00
Stephan Aßmus c4e211feb6 * Refactored a method to draw a label when the location is already known.
(This one takes care of setting up the correct color.)
 * Added TODO about using either B_CONTROL_TEXT_COLOR, or elliminating that
   constant (which I am in favor of...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35260 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-23 12:48:18 +00:00
Ingo Weinhold 8d1316fd23 Replaced CACHE_DONT_SLEEP by two new flags CACHE_DONT_WAIT_FOR_MEMORY and
CACHE_DONT_LOCK_KERNEL_SPACE. If the former is given, the slab memory manager
does not wait when reserving memory or pages. The latter prevents area
operations. The new flags add a bit of flexibility. E.g. when allocating page
mapping objects for userland areas CACHE_DONT_WAIT_FOR_MEMORY is sufficient,
i.e. the allocation will succeed as long as pages are available.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-22 21:19:23 +00:00
Ingo Weinhold 86c794e5c1 slab allocator:
* Implemented a more elaborated raw memory allocation backend (MemoryManager).
  We allocate 8 MB areas whose pages we allocate and map when needed. An area is
  divided into equally-sized chunks which form the basic units of allocation. We
  have areas with three possible chunk sizes (small, medium, large), which is
  basically what the ObjectCache implementations were using anyway.
* Added "uint32 flags" parameter to several of the slab allocator's object
  cache and object depot functions. E.g. object_depot_store() potentially wants
  to allocate memory for a magazine. But also in pure freeing functions it
  might eventually become useful to have those flags, since they could end up
  deleting an area, which might not be allowable in all situations. We should
  introduce specific flags to indicate that.
* Reworked the block allocator. Since the MemoryManager allocates block-aligned
  areas, maintains a hash table for lookup, and maps chunks to object caches,
  we can quickly find out which object cache a to be freed allocation belongs
  to and thus don't need the boundary tags anymore.
* Reworked the slab boot strap process. We allocate from the initial area only
  when really necessary, i.e. when the object cache for the respective
  allocation size has not been created yet. A single page is thus sufficient.

other:
* vm_allocate_early(): Added boolean "blockAlign" parameter. If true, the
  semantics is the same as for B_ANY_KERNEL_BLOCK_ADDRESS.
* Use an object cache for page mappings. This significantly reduces the
  contention on the heap bin locks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-21 23:10:52 +00:00
Ingo Weinhold 5f679d1cd3 Resize(): Added boolean "force" parameter that allows to force setting the
new memory, even if it isn't needed at that time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-21 22:16:03 +00:00
Adrien Destugues 5570fd11c0 - Locale kit : made the language class live. It now uses ICU as a backend as expected
- Some changes in the locale roster to allow instanciating a language
- Locale preflet : use this new API instead of directly calling ICU
Side effect : all languages in Locale window are now displayed in the current locale. It makes more sense as otherwise the list would be unsortable. However it can get annoying if you mistakenly set a strange language as default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35210 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-20 22:44:34 +00:00
Ingo Weinhold 453a2bdd18 Replaced the locking strategy (formerly a recursive lock for the depot and
one for each per CPU store):
* The depot is now protected by a R/W lock combined with a spinlock. It is
  required to either hold read lock + spinlock or just the write lock.
* When accessing the per CPU stores we only need to acquire the read lock
  and disable interrupts. When switching magazines with the depot we
  additionally get the spinlock.
* When allocating a new magazine we do completely unlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35200 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-20 13:00:57 +00:00
Ingo Weinhold 5662ae4585 Changed the team shutdown process a bit:
* The threads beside the main thread are killed earlier now (in the new
  team_shutdown_team()), before removing the team from the team hash and from
  its process group. This fixes #5296.
* Use a condition variable instead of a semaphore to wait for the non-main
  threads to die. We notify the condition right after a thread has left the
  team. The semaphore was released by the undertaker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-20 09:34:53 +00:00
Ingo Weinhold 7dcd388aa6 Coding style fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 20:36:29 +00:00
Ingo Weinhold 825566f82f * Split the slab allocator code into separate source files and C++-ified
things a bit.
* Some style cleanup.
* The object depot does now have a cookie that will be passed to the return
  hook.
* Fixed object_cache_return_object_wrapper() using the new cookie.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35174 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 19:13:25 +00:00
Ingo Weinhold 0fc052b47d Moved the definition of the CACHE_ALIGN_ON_SIZE flag to the header and fixed
its value.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 10:17:16 +00:00
Ingo Weinhold a8806e5e0d * Renamed headers/private/kernel/slab/Depot.h to ObjectDepot.h.
* Moved the object depot code to its own source file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 10:12:48 +00:00
Ingo Weinhold 6379e53e2d vm_page no longer points directly to its containing cache, but rather to a
VMCacheRef object which points to the cache. This allows to optimize
VMCache::MoveAllPages(), since it no longer needs to iterate over all pages
to adjust their cache pointer. It can simple swap the cache refs of the two
caches instead.

Reduces the total -j8 Haiku image build time only marginally. The kernel time
drops almost 10%, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 08:34:14 +00:00
Ingo Weinhold 3632eeedb9 * VMCache: Added a UserData attribute which can be used by the lock holder.
* Added "bool consumerLocked" parameter to VMCache::Unlock() and
  ReleaseRefAndUnlock(). Since Unlock() may cause the cache to be merged with
  a consumer cache, the flag is needed to prevent a deadlock in case the
  caller still holds a lock to the consumer. Hasn't been a problem yet, since
  that situation never occurred.
* VMCacheChainLocker: Reversed unlocking order to bottom-up. The other
  direction could cause a deadlock in case caches would be merged, since the
  locking order would be reversed. The way VMCacheChainLocker was used this
  didn't happen, though.
* fault_get_page(): While copying a page from a lower cache to the top cache,
  we do now unlock all caches but the top one, so we don't unnecessarily
  kill concurrency.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35153 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-19 03:02:11 +00:00
Jérôme Duval 6aee58a4cb * Revert the reverse the addons iteration of r35121.
* The media_addon_server before unloading addons need to be sure the nodes are deleted.
For instance, applications could keep references on global nodes, thus preventing deletion.
To release all references, the media_addon server uses a new method BMediaRosterEx::ReleaseNodeAll().
* Quit the MediaRoster looper when quitting media_addon server before unloading addons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-17 20:05:01 +00:00
Rene Gollent 782fbf00a7 Overlooked this with my previous Trash-related changes: updated NavMenu to be
behaviorally in sync - it now hides the root volume Trash dir like PoseView,
and adds the Trash entry as needed when navigating down the Desktop.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-17 17:35:06 +00:00
Oliver Ruiz Dorantes 9760dcae20 - Move bluetooth net_device module to a independent module HCI, remake API interfaces
- Move functionality for assembling ACL/events packets of the driver to this module
- Move h2generic driver to c++ (not style)
- Pass checkstyle.py to all commited files.
Fixes:
- Wrong condition for finishing l2cap packet segmentation.
- Place NetBuffersPrependers in a inner scope to avoid Sycing twice in destructor.
- Avoid keeping trace of l2cap responses of any other kind of thread.
- Do not free net_buffers of for Frame containers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-17 15:46:36 +00:00
Jérôme Duval 66204ee8cf forgot to add prototypes for pthread_getschedparam and pthread_setschedparam(), sorry.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-16 19:33:34 +00:00
Ingo Weinhold f082f7f019 * Added vm_page::accessed flag. Works analogously to vm_page::modified.
* Reorganized the code for [un]mapping pages:
  - Added new VMTranslationMap::Unmap{Area,Page[s]}() which essentially do what
    vm_unmap_page[s]() did before, just in the architecture specific code, which
    allows for specific optimizations. UnmapArea() is for the special case that
    the complete area is unmapped. Particularly in case the address space is
    deleted, some work can be saved. Several TODOs could be slain.
  - Since they are only used within vm.cpp vm_map_page() and vm_unmap_page[s]()
    are now static and have lost their prefix (and the "preserveModified"
    parameter).
* Added VMTranslationMap::Protect{Page,Area}(). They are just inline wrappers
  for Protect().
* X86VMTranslationMap::Protect(): Make sure not to accidentally clear the
  accessed/dirty flags.
* X86VMTranslationMap::Unmap()/Protect(): Make page table skipping actually
  work. It was only skipping to the next page.
* Adjusted the PPC code to at least compile.

No measurable effect for the -j8 Haiku image build time, though the kernel time
drops minimally.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-15 22:32:51 +00:00
Stephan Aßmus 9d3442dff1 Haiku defines B_BEOS_VERSION_5, so the code didn't work as intended. On Haiku,
we want to define closesocket() as close().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35079 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 21:50:50 +00:00
Stephan Aßmus 41777edb47 Make more defined classes visible outside the BPrivate namespace when including
this header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 21:49:53 +00:00
Stephan Aßmus edb41bfb71 Added HashSet class based on the (OpenTracker) OpenHashTable code. This is
currently similar to HashMap, which is also based on that version. The kernel
has OpenHashTable by Hugo Santos, which is a bit nicer, but I didn't want to
change too much code, although HashMap and HashSet exist for this as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35077 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 21:49:16 +00:00
Ingo Weinhold c6aa013564 Changed VMTranslationMap::Lock()/Unlock() return types to the usual.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 20:44:29 +00:00
Axel Dörfler d9c5ba808b * Added missing HOST_NAME_MAX, and _POSIX_HOST_NAME_MAX.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35070 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 15:23:28 +00:00
Ingo Weinhold bcc2c157a1 Refactored vm_translation_map:
* Pulled the physical page mapping functions out of vm_translation_map into
  a new interface VMPhysicalPageMapper.
* Renamed vm_translation_map to VMTranslationMap and made it a proper C++
  class. The functions in the operations vector have become methods.
* Added class GenericVMPhysicalPageMapper implementing VMPhysicalPageMapper
  as far as possible (without actually writing new code).
* Adjusted the x86 and the PPC specifics accordingly (untested for the
  latter). For the other architectures the build is, I'm afraid, seriously
  broken.

The next steps will modify and extend the VMTranslationMap interface, so that
it will be possible to fix the bugs in vm_unmap_page[s]() and employ
architecture specific optimizations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-14 03:26:12 +00:00
Ingo Weinhold 946325051b * Added boolean "alreadyWired" parameter to vm_map_physical_memory().
* ioapic_init(): map_physical_memory() was called for already mapped
  addresses. This worked fine, but only because the x86 page mapping code
  didn't mind.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-13 22:02:21 +00:00
Stephan Aßmus 9563f44bfd Patch by Humdinger:
Changed strings to sentence case in various places. This is the
case-misc.diff part of ticket #5169.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-13 10:49:58 +00:00
Stephan Aßmus 0b6ac0b7a8 * White space cleanup
* Added myself to copyrights, since I added some stuff to MediaExtractor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-12 20:24:10 +00:00
Ingo Weinhold 3b8c056da0 Should have been part of r35023: Introduction of the vm_page::modified flag.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35024 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-12 01:24:40 +00:00
Ingo Weinhold 3fb2a94dfb * Inline {acquire,release}_spinlock(), when spinlock debugging is disabled.
* Use atomic_{and,or}() instead of atomic_set(), as there are no built-ins
  for the latter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-11 22:13:11 +00:00
Ingo Weinhold 4f7b2c67b0 * gcc 4 features built-ins for atomic operations. If the macro
B_USE_BUILTIN_ATOMIC_FUNCTIONS is defined most atomic_*() functions are
  redefined as macros using the built-ins directly.
* Enabled that feature for the x86 build. Might work on other platforms as
  well, but that needs to be tested.

No significant speedup for the -j8 Haiku image build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-11 21:38:07 +00:00
Ingo Weinhold 451ca8b4b4 PAGE_TYPE_GUARD was unused and for the other two types a simple one bit flag
suffices. Therefore replaced vm_page::type by vm_page::is_dummy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-11 19:13:14 +00:00
Ingo Weinhold d7455de2f6 allocate_page_run(): Use temporary lists to store the pages we're allocating.
This makes appending the pages to the active queue more efficient and we
don't need the vm_page::is_cleared bit anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-11 16:36:31 +00:00
Oliver Ruiz Dorantes ee01456254 - Add macros to distingish between requests and responses
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-10 23:02:21 +00:00
Ingo Weinhold 509f1174ce * Added Size() method.
* Added Debug{First,Next}() methods to allow easy iteration through the
  address spaces in kernel debugger commands.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-09 20:21:43 +00:00