Commit Graph

2828 Commits

Author SHA1 Message Date
Oliver Ruiz Dorantes
660030cbe7 ADD kit<->server Messages ids
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24253 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-05 23:32:16 +00:00
Rene Gollent
676308a602 App Server now saves/restores ui_color settings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-04 01:19:04 +00:00
Michael Lotz
87df690150 * Replaced the UTF8ToCharCode function with one that handles invalid chars
correctly (or at all...)
* Use the common 0xfffd character as a substitute for invalid characters
* Corrected comment

This function is used by the app_server to convert the UTF8 strings to char
codes to feed FreeType. Using a non space substitute character at least for
now, as it makes it more obvious where invalid characters are present.
I tested this change with some UTF8 test files and it seems to work well.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24175 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 23:04:47 +00:00
Axel Dörfler
d273d00822 * Fixed previous version of UTF8CountBytes() and put it in again: it was
breaking out of the loop too early, and would therefore miss the last
  character.
* Replaced UTF8CountChars() with a short and safe version as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 19:17:33 +00:00
Stephan Aßmus
ccf6ad1d8b Reverted to the previous version. Axel, your change completely broke all kinds
of stuff. I think the trouble is that you keep decrementing charCount while
still inside the same UTF8 glyph. I cannot really tell, I am hoping you don't
mind me reverting to the old version, since the new one is only three lines,
so it should be easy to correct and re-commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24172 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 15:56:31 +00:00
Axel Dörfler
b5a5aebc90 * Added a set_to_defaults() function to the address module: it can be used
to retrieve the default settings for the netmask/broadcast depending on the
  specified address/netmask.
* interface_protocol_control() now uses this to reset the broadcast/netmask
  to their default values on SIOCSIFADDR resp. the former only on
  SIOCSIFNETMASK.
* This fixes bug #1861.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 15:43:27 +00:00
Axel Dörfler
326dce3ae0 * Simplified UTF8CountBytes() a bit, made it faster, and less error-prone
against malformed UTF-8.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-28 10:45:57 +00:00
Axel Dörfler
a77ed12b25 * Removed obsolete "ident" parameter from devfs_publish_device().
* driver_entry::api_version now stores the actual version instead of a
  pointer to it.
* Renamed node_path_entry to path_entry and reused it for driver 
  reloading: handle_driver_events() will now also check for drivers to
  add in the sDriversToAdd list.
* Added new devfs_driver_added(), and devfs_driver_removed() functions
  that trigger certain driver actions.
* Implemented notifying devfs on B_ENTRY_CREATED, B_ENTRY_REMOVED, and
  B_ENTRY_MOVED events in probe.cpp. The watched directory inode numbers
  are now stored in a hash for B_ENTRY_MOVED.
* unpublish_driver() did not actually delete the node, it only marked
  it removable since we never get/put the node. We now do, and so the
  node is actually removed as intended.
* Added "devfs_driver" KDL command.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-27 16:55:59 +00:00
Axel Dörfler
4f26630d82 * Factored a vfs_entry_ref_to_path() out of _user_entry_ref_to_path()
and made it public (within the kernel).
* _user_entry_ref_to_path() is now using that function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24151 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-27 16:39:32 +00:00
Jérôme Duval
30cce27770 Patch from kaliber: use path of executable instead of the command. Thanks!
this fixes bug #1773 and #1824. I tested only #1773.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-26 00:03:51 +00:00
Axel Dörfler
49499c1707 Forgot to commit these; this fixes building the fs_shell, thanks Jerome!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24115 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-25 14:08:59 +00:00
Axel Dörfler
f9bbab8848 * First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
  view - note though, that you must not remove a view before closing or
  hiding its window for now (and that you still need to set the 
  kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
  managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the 
  specified flags set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 11:18:52 +00:00
Ingo Weinhold
7dc065bdb0 * syscall_restart_handle_timeout_pre(uint32&, bigtime_t&): A huge
negative relative timeout would be converted to B_INFINITE_TIMEOUT.
  For some reason the ScreenSaver preflet is snooze()ing with such
  a value.
* Some more comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24080 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-23 15:56:56 +00:00
Ingo Weinhold
bc2001bb39 We have to update the pending signals thread flag when restoring the
signal block mask when returning from a signal handler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-22 14:54:03 +00:00
Axel Dörfler
ea9d4cd0f7 Slightly increased the default key repeat rate to make it at least
bearable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-22 10:53:27 +00:00
François Revol
7f3937521f Add debugger module hooks to implement alternative io (I need laplink debugging...)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24052 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 22:41:49 +00:00
Axel Dörfler
0dd3108ca0 * Added SIGNAL_FLAG_DONT_RESTART_SYSCALL for send_signal_etc() which
utilizes the THREAD_FLAG_DONT_RESTART_SYSCALL (but only in SIGCONT
  for now).
* resume_thread() is now using that flag to be compatible with BeOS.
* This fixes the Terminal hanging on close.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24045 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 13:19:54 +00:00
Ingo Weinhold
562e2f204a * Removed unused team::pending_signals.
* Added team::flags. Currently only used for setting a flag when a team
  has exec()ed.
* Some improvements of _user_setpgid():
  - It failed incorrectly when the target process was a process group
    leader. According to the standard it shall fail when the process is
    a session leader. Moving a process group leader to another process
    group is fine, even if that leaves the group leaderless.
  - Fixed race conditions. We need to recheck the error conditions when
    we hold the team spinlock. Otherwise the situation could change
    while we allocated the new process group. This was one of the
    reasons for bug #1799 -- after the shell fork()'s both parent and
    child invoke setpgid() for the child.
  - Fixed behavior for pid == pgid. It doesn't necessarily mean that a
    new group has to be created.
  - Fixed update of target process group orphaned state.
  - Squashed TODO: setpgid() on a child is supposed to fail after the
    child has exec()ed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-21 00:46:22 +00:00
Axel Dörfler
9448bb6e0b Added add_node_listener() and remove_node_listener() kernel private functions
to watch a node.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-20 16:48:16 +00:00
Michael Lotz
cf46897b4c Use a dedicated heap to allocate everything that is needed during heap growth.
This eliminates the edge case where the grow thread would not be able to create
a new area because no memory could be allocated for the allocation of the area.
As this case cannot happen anymore, it is also not possible to deadlock in
memalign. Therefore the timeout (which would only have prevented the deadlock
but wouldn't have solved the edge case anyway) has been removed too.
Add options to dump the dedicated grow heap and to only print the current heap
count to the "heap" debugger command.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-18 01:04:19 +00:00
Ingo Weinhold
c72d22a5e8 Converting relative timeouts into absolute ones is fine in principle,
but there's a special handling for 0 us relative timeouts. Syscalls
usually return B_WOULD_BLOCK instead of B_TIMED_OUT in this case, and
callers might explicitely check for it. Hence we don't convert 0 us
timeouts anymore. gdb works again.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23989 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 18:05:49 +00:00
Ingo Weinhold
058494285a axeld + bonefish:
* Added syscall restart support for connect(), accept(), send(), recv(),
  which are implemented via ioctl()s. The actual restart support is done
  in the net stack driver's ioctl() hook. Lower layers need to correctly
  deal with socket timeouts, though, for which the stack module provides
  support functions.
* TCPEndpoint::_WaitForEstablished() does abort now when an error
  occurred earlier, so that trying to connect to an unused port fails
  immediately, as it should.
* Fixed and refactored TCP connection reset handling. The new
  TCPEndpoint::_HandleReset() does the job. Got rid of
  TCPEndpoint::fError.
* Fixed sequence numbers for SYNC/FINI packets.
* The former two fix the problem that connections wouldn't be closed
  correctly and could even be reused when trying to connect again (as
  was reproducible with svnserve + svn).
* Some style cleanup in CPEndpoint.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 16:25:07 +00:00
Ingo Weinhold
4048494ce4 axeld + bonefish:
* Implemented automatic syscall restarts:
  - A syscall can indicate that it has been interrupted and can be
    restarted by setting a respective bit in thread::flags. It can
    store parameters it wants to be preserved for the restart in
    thread::syscall_restart::parameters. Another thread::flags bit
    indicates whether it has been restarted.
  - handle_signals() clears the restart flag, if the handled signal
    has a handler function installed and SA_RESTART is not set. Another
    thread flag (THREAD_FLAGS_DONT_RESTART_SYSCALL) can prevent syscalls
    from being restarted, even if they could be (not used yet, but we
    might want to use it in resume_thread(), so that we stay
    behaviorally compatible with BeOS).
  - The architecture specific syscall handler restarts the syscall, if
    the restart flag is set. Implemented for x86 only.
  - Added some support functions in the private <syscall_restart.h> to
    simplify the syscall restart code in the syscalls.
  - Adjusted all syscalls that can potentially be restarted accordingly.
  - _user_ioctl() sets new thread flag THREAD_FLAGS_IOCTL_SYSCALL while
    calling the underlying FS's/driver's hook, so that syscall restarts
    can also be supported there.
* thread_at_kernel_exit() invokes handle_signals() in a loop now, as
  long as the latter indicates that the thread shall be suspended, so
  that after waking up signals received in the meantime will be handled
  before the thread returns to userland. Adjusted handle_signals()
  accordingly -- when encountering a suspending signal we don't check
  for further signals.
* Fixed sigsuspend(): Suspending the thread and rescheduling doesn't
  result in the correct behavior. Instead we employ a temporary
  condition variable and interruptably wait on it. The POSIX test
  suite test passes, now.
* Made the switch_sem[_etc]() behavior on interruption consistent.
  Depending on when the signal arrived (before the call or when already
  waiting) the first semaphore would or wouldn't be released. Now we
  consistently release it.
* Refactored _user_{read,write}[v]() syscalls. Use a common function for
  either pair. The iovec version doesn't fail anymore, if anything could
  be read/written at all. It also checks whether a complete vector
  could be read/written, so that we won't skip data, if the underlying
  FS/driver couldn't read/write more ATM.
* Some refactoring in the x86 syscall handler: The int 99 and sysenter
  handlers use a common subroutine to avoid code duplication.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 15:48:30 +00:00
Michael Lotz
4af6cd5f38 Adding two debug features to the new heap implementation:
* Tracing of allocations, reallocations and frees
* Leak checking infrastructure to dump allocations

The leak checking code records the team and thread id when an allocation is
made as well as stores the originally requested size. It also adds the
"allocations" debugger command that can dump all current allocations (usually
a huge list) or filter by either a team or thread id. This way it's easily
possible to find leftover allocations of no more active teams/threads.
Combined with the tracing support one might be able to track down the time and
reason of an allocation and possibly find the corresponding leak if it is one.
Note that kernel heap leak checking has to be enabled manually by setting the
KERNEL_HEAP_LEAK_CHECK define to 1.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-12 20:20:35 +00:00
Michael Lotz
5c4d1c5e21 Complete rework of the heap implementation. Freelists are now part of the pages
and pages are now kept in lists as well. This allows to return free pages once
a bin does not need them anymore. Partially filled pages are kept in a sorted
linked list so that allocation will always happen on the fullest page - this
favours having full pages and makes it more likely lightly used pages will get
completely empty so they can be returned. Generally this now goes more in the
direction of a slab allocator.
The allocation logic has been extracted, so a heap is now simply attachable to
a region of memory. This allows for multiple heaps and for dynamic growing. In
case the allocator runs out of free pages, an asynchronous growing thread is
notified to create a new area and attach a new heap to it.
By default the kernel heap is now set to 16MB and grows by 8MB each time all
heaps run full.
This should solve quite a few issues, like certain bins just claiming all pages
so that even if there is free space nothing can be allocated. Also it obviously
does aways with filling the heap page by page until it overgrows.
I think this is now a well performing and scalable allocator we can live with
for quite some time. It is well tested under emulation and real hardware and
performs as expected. If problems come up there is an extensive sanity checker
that can be enabled by PARANOID_VALIDATION that covers most aspects of the
allocator. For normal operation this is not necessary though and is therefore
disabled by default.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-10 21:00:13 +00:00
Ingo Weinhold
2c986936df Added new syscall _kern_normalize_path() to normalize a path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 03:06:14 +00:00
Ithamar R. Adema
eb5a25ca41 Slight rework of my previous commit... now ports can be asked too ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 02:00:08 +00:00
Ithamar R. Adema
62cb58a8ef Make print_server track Transport addons too. This is because some of the NewTransportAddOns(tm) can also autodetect devices, e.g. USB printers. For this, the print_server needs to keep those transport addons loaded at all times. This code now also enables dynamic Transport discovery for the Printer prefs, e.g. 'hey print_server GET Transport 0' or 'hey print_server GET Transport 'USB Port'' will now work too ;)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-08 00:34:53 +00:00
Ingo Weinhold
7486b72dd1 Added some kernel tracing to the runtime loader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23921 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 19:22:39 +00:00
Ingo Weinhold
ed854de770 Also include info about the syscall return type in the
extended_syscall_info structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 16:03:00 +00:00
Axel Dörfler
6f58064f10 * Added flags field in net_protocol_module_info; there is currently a single
defined flag: NET_PROTOCOL_ATOMIC_MESSAGES.
* socket_send() now honours NET_PROTOCOL_ATOMIC_MESSAGES and returns either
  EMSGSIZE if the data to be send is larger than net_socket::send::buffer_size,
  or divides the data in appropriately sized chunks.
* This fixes sending >=64K over a TCP socket at once (TCP would just have
  returned an error in that case).
* TCP now overrides the default send buffer size (to 32768 for now).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 15:09:19 +00:00
Ingo Weinhold
9835c090a6 Added a boolean "force" parameter to thread_yield(). When true, the
function has the old behavior. When false, it just calls the scheduler
without any priority adjustment or other stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-07 11:40:31 +00:00
Ingo Weinhold
350b6dbc3a * Removed AbstractTraceEntry::sPrintTeamID and added a flags field to
TraceOutput for output options instead.
* Added "traced" option --difftime. Instead of the absolute system time
  it prints the difference time to the previously printed entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-04 17:54:40 +00:00
Axel Dörfler
a32a4683ff * Implemented flock() semantics to the advisory locking backend. Not tested
(must also compare to BSD; I've looked at their sources, but I might have
  missed something).
* Added sys/file.h and the flock() system call.
* common_fcntl() could forget to put back the file descriptor on some error
  conditions (I guess we should introduce and use a DescriptorGetter class).
* Cleaned up fcntl.h, moved the BSD extensions S_IREAD and S_IWRITE to
  sys/stat.h where they belong, and added the missing S_IEXEC to them.
* Added some more comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 15:37:31 +00:00
François Revol
82610ec8eb * get rid of ppc stuff
* possible types of exception frames


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23833 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-03 11:39:28 +00:00
Stephan Aßmus
96418817f9 * added a PrintToStream() method
* added optional tracing for the main operations
* fixed bad pointer arithmetic when reallocating/moving the object's data
* it was impossible to remove the very first space via _RemoveSpaces()
* added a little more variaty to error return codes for some
  functions to make them a little more helpful

-> This fixes the bogus space values in DriveSetup (#1737)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:38:15 +00:00
Axel Dörfler
45b17b80d1 * Temporarily switched to a recursive lock for the depot.
* While this is not a really good idea for a lock with supposedly little
  contention, but it'll fix bug #1731. I haven't tested it yet, but will
  do so in a minute :-)
* I will need to rework the slab anyway so that it's possible to use it
  as a replacement for our heap, and then I'll switch back to a benaphore
  again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23822 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:12:54 +00:00
Bruno G. Albuquerque
ea2fe1498f It is a good idea to return a value. :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 23:24:10 +00:00
Axel Dörfler
5ccd99565d Benaphores are nice and fast, but they aren't useful for debugging at
all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 23:05:26 +00:00
Oliver Ruiz Dorantes
9b67804dce Add private bluetooth headers being used in the kit and the future server
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 20:59:14 +00:00
Ingo Weinhold
90e3bbf0cb Added optional kernel tracing for sending BMessages. Currently only the
destination of the message and it's "what" field are stored. It might be
nice to also get some info about its fields -- maybe as an additional
option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-01 12:35:00 +00:00
Axel Dörfler
78fa3affbc * Overlay on the G33 does not work anymore in the secondary ring buffer;
we now always only use the primary ring buffer.
* Removed secondary ring buffer allocation and member fields.
* Increased size of the primary ring buffer to 65536 bytes.
* The bytes per row register is computed differently for 9xx chips.
* On G33, the overlay does not need a physical address anymore, so we
  don't pass B_APERTURE_NEED_PHYSICAL to the allocation anymore for that
  device.
* intel_free_memory() accidently added the aperture base to the allocation
  and would therefore never free any memory.
* INTEL_RING_BUFFER_SIZE_MASK was shifted one bit to the right, didn't
  cause any harm with our buffer sizes, yet, though.
* With these changes, the driver runs stable on a G33 chipset (I have not
  yet tested the hardware cursor, though, it might need some work, too).
  The only known issue left is that overlay flickers a bit if its buffer
  is partially backed up by reserved and allocated memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23798 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 18:28:48 +00:00
Axel Dörfler
103d05f3c2 * Renamed GART's deallocate_memory() to free_memory().
* Removed "physical" parameter of GART's bind_aperture() - I don't think this
  be of use to anyone.
* Fixed binding/unbinding pages in the Intel GART driver; I accidently shifted
  the page offset twice.
* Actually forgot handling of allocated memory in Aperture::BindMemory().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23796 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 17:54:23 +00:00
Axel Dörfler
3cec75dc33 * Debugger modules now have two methods: enter_debugger() and exit_debugger().
* The kernel now opens up to 8 debugger modules (and puts them into an array;
  maybe we'll want to switch to a doubly linked list when there is the need).
* Implemented an example debugger module that prints a stack trace of the
  current thread when the kernel debugger is entered (not included in the
  image).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-31 12:25:43 +00:00
Axel Dörfler
1c34b9b1f5 Work in progress (might not work for you yet):
* Now uses the AGP GART module for memory management. This greatly simplifies
  the memory handling, and memory is now actually allocated on demand,
  instead of a fixed size (stolen memory is not freed, though).
* The Intel GART module should now also work with older chipsets.
* No longer remove the GTT size from the stolen memory; this appears to have
  been a mistake in the X driver. Not sure about the BIOS popup yet.
* The AGP module (in combination with the Intel GART module) is now mandatory
  to use the Intel driver.
* Removed now superfluous settings (like memory size). Only enabling/disabling
  the hardware cursor is still supported.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-29 08:55:36 +00:00
Axel Dörfler
3adccb1935 * More or less completely rewrote the AGP bus manager.
* It now also serves as a generic GART manager and accepts bus modules as well
  as custom modules of graphics drivers if they want to (could be used for the
  Radeon PCI GART stuff, for example).
* Implemented GART support module for Intel i965 and G33 chipsets (the other
  Intel chips will come later).
* Renamed agp bus manager to agp_gart to reflect its new functionality (even
  though the AGP functionality is already outdated (due to PCIe), the GART
  stuff remains current).
* Adapted existing users of the AGP bus manager to the API changes.
* Not very well tested yet...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-26 22:18:52 +00:00
Axel Dörfler
d75c88206e * Simplified usage of the INTEL_TYPE_xxx constants.
* Added some defines needed when playing with the bridge controller.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-26 21:59:02 +00:00
Axel Dörfler
4dfa9e425f Some work in progress:
* set_gtt_entry() used the wrong index to fill the GTT - this could have never
  worked correctly when you specified more memory than the amount of stolen
  memory.
* Implementing maintaining resources for emulating overlay using the 3D engine
  on i965. I don't yet commit the actual overlay code, as that is a) ugly, and
  b) does not work yet.
* Moved AreaKeeper into its own header.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-23 17:50:27 +00:00
Ingo Weinhold
325b88a661 * Introduced debugger command flag B_KDEBUG_DONT_PARSE_ARGUMENTS.
For commands with this flag set, the parser won't parse the
  arguments provided (it will only check for matching parentheses and
  brackets), but will pass the unparsed argument list string to the
  command instead.
* Set the new flag for the "expr" command, so one doesn't have to quote
  the expression to evaluate anymore (or put it in parentheses).
* Fixed tokenizing of quoted and unquoted strings in expression mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 23:25:34 +00:00
Axel Dörfler
4a67038e56 * Added a new function hash_insert_grow() that grows the hash table when needed.
* Removed the public hash_grow() function again (at least for now, it's only
  private).
* Removed the newSize argument from hash_grow(); it will compute the new size
  automatically.
* The block cache is now using hash_insert_grow() instead of hash_insert()
  which should make hash lookups much faster with some 10 thousand blocks,
  also increased the initial table size from 32 to 1024...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 19:57:40 +00:00
Ingo Weinhold
b4f58d8758 Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:29:00 +00:00
Ingo Weinhold
a54c125e37 Added experimental ktrace_[v]printf() functions to libroot. Their output
is recorded in a kernel trace entry (if tracing is enabled).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:10:05 +00:00
Ingo Weinhold
64fe37ee89 * AbstractTraceEntry records the team ID too, now.
* Added "printteam" switch to "traced" command, enabling the printing of
  the team ID.
* Added "team" filter to the "traced" command expression language.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 13:31:27 +00:00
Ingo Weinhold
6d36996620 * Fixed my fix for make_space() wrapping. It's always a good idea to
write code aligned to what one has written in the comment (or the
  other way around).
* Made trace_entry structure doubly linked, by introducing a
  previous_size member. By using bit fields, shrinking the flags field
  to 4 bits, and not saving the lower two bits of size and previous_size
  (which are always 0 due to alignment), the structure remains 4 byte
  sized and can still address the same entry size.
* kBufferSize is no longer one less than it could be.
* "traced" command:
  - Use static variable for the iteration state rather then cluttering
    the temporary debug variable name space.
  - The <count> parameter can now be negative, in which case the entries
    before (and including) <start> are printed.
  - Added a new optional parameter, specifying the maximal number of
    entries to be filtered. Filtered iteration is beautifully
    comfortable now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23678 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 00:41:45 +00:00
Ingo Weinhold
902425896d Made kputs() available in the kernel and used it for printing debugger
command usage texts, which can be too long for kprintf().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 00:15:33 +00:00
François Revol
1778540a37 Cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 22:01:33 +00:00
François Revol
93b4dee849 * Add NeXT platform.
* Add platform methods for timer as it is platform dependent.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 21:30:59 +00:00
Jérôme Duval
3d239d7451 added missing include
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 17:21:01 +00:00
Ingo Weinhold
4c4b14c3bb The "traced" command can now be passed a filter expression consisting of
boolean operators ("not", "and", "or") and filters matching thread IDs
or contained strings.
I'm still not fully happy with the command. It should be possible to
define a filter and then comfortably scroll through the matching
entries. Currently having to specify an index range of the unfiltered
entries is rather unhandy in combination with filtering.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23658 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-20 00:34:37 +00:00
Ingo Weinhold
f7a5d9c583 Changed TraceEntry::Dump() to take a TraceOutput& and removed
AbstractTraceEntry::AddDump(char*, size_t).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23655 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 22:23:32 +00:00
Jérôme Duval
ec1315c2ea added arch_commpage.h for the m68k arch (copied on x86)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 18:16:45 +00:00
Ingo Weinhold
ab23dfa7f7 Moved tracing macro definitions into separate tracing_config.h header.
So now there's a central place to enable tracing in general and for
individual components.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23645 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 17:24:34 +00:00
Ingo Weinhold
2477bce504 Added support for userland symbol lookup in "sc" and "call". Having
used it for an hour or so, I really wonder how we could live without it.
:-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 16:33:03 +00:00
Jérôme Duval
907f26dbb5 added a arch_commpage.h header for ppc, dunno if it needs to be changed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 15:43:45 +00:00
Jérôme Duval
8164606d77 fix a warning
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23632 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 14:26:59 +00:00
Ingo Weinhold
f1047a1c3e Introduced helper class TraceOutput that represents an output buffer
and added AbstractTraceEntry::AddDump(TraceOutput&) method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 22:15:30 +00:00
Ingo Weinhold
19101ba0f4 Generate a kernel array kSyscallParametersInfos containing information
about syscall parameters. Particularly interesting is a type_code field
for each parameter. The mechanism isn't very accurate, but we can
classify everything in string, pointer, and integer types.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 19:25:28 +00:00
Axel Dörfler
5d0afa4e4e * cache_detach_sub_transaction() didn't really work: it did not put all needed
blocks into the new transaction, but it would set that transaction on all
  blocks of the old transaction, too. Also, it did not correctly update the
  num_blocks/sub_num_blocks fields of the old transaction. Even worse, it did
  return B_OK instead of the ID of the new transaction...
* get_writable_cached_block() did not correctly maintain the number of blocks
  in the sub transaction.
* write_cached_block() did not free the original_data of a block when it wrote
  it back as part of a previous transaction.
* Changed "cookie" for cache_next_block_in_transaction() to "long", so it will
  be 64 bits when needed.
* Improved the API for detaching sub transactions: you can now get the blocks
  of only the main (parent) transaction as well, added new
  cache_block_in_main_transaction() function.
* BFS now flushes the log when there is no space left for the current
  transaction.
* _WriteTransactionToLog() allocated a "vecs" array, but never freed it.
* _WriteTransactionToLog() now also supports detaching the current sub
  transaction if the whole thing is getting too large (it will now also panic
  if that doesn't work out).
* Removed a useless optimization: making the blocks available in the cache
  isn't really needed, as all blocks in a transaction are locked into the
  cache, anyway.
* Implemented Transaction::WriteBlocks().
* Minor cleanup, removed some dead code, fixed warnings in the fs_shell's
  block_cache when compiled with debug output on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-18 17:07:18 +00:00
Ingo Weinhold
bd0689e668 Added usage message to "cvar" and "cvars" debugger commands and define
temporary variables.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-17 23:22:29 +00:00
Ingo Weinhold
0b60583fec Added convenience functions alloc_tracing_buffer_{memcpy,strcpy}().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-17 01:58:08 +00:00
Ingo Weinhold
8a90d12e26 * Added add_debugger_command_etc() which is similar to
add_debugger_command(), but additionally takes parameters "usage"
  and "flags".
* Added add_debugger_command_alias() which creates another name for an
  existing command.
* Added print_debugger_command_usage() to print a command's usage.
* invoke_debugger_command() intercepts invocations with "--help" and
  prints the command's usage text, if it is known. If unknown, the
  command will be called normally.
* Made use of the new functions in debug.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 23:41:20 +00:00
Ingo Weinhold
06f78e9fb7 * Changed the way temporary variables work. They won't be unset before
a command is executed anymore. Instead the least recently used
  temporary variable is overwritten, if there's no free slot for a new
  temporary variable.
* Removed the special handling for the command result variable ("_"). It
  just works like any other temporary variable, now.
* Individual temporary variables can be removed (e.g. using the "unset"
  command).
* Added unset_all_debug_variables() and "unset_all" command to unset
  all persistent and temporary variables.
* Removed remove_all_temporary_debug_variables and renamed
  remove_debug_variable() to unset_debug_variable().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 21:50:59 +00:00
Axel Dörfler
c6ee79ce38 * vm_create_anonymous_area() now accepts B_ANY_KERNEL_BLOCK_ADDRESS.
* As a temporary work-around for the current slab allocator's area usage,
  I added the CACHE_LARGE_SLAB flag, which will force the allocator to 
  use larger areas.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 20:30:16 +00:00
Ingo Weinhold
3b4fa1664e * Implemented parse_expression(). The back-end is an expression parser
that is a little more powerful than BeOS'. It features:
  - Persistent and temporary uint64 variables. The former kind is set
    only by the user. The latter (those prefixed "_") can be set
    automatically by commands, thus e.g. making it easier to access
    members of a dumped structure. They are unset when the next command
    is invoked. The special temporary variable "_" is defined as a
    command's return value.
  - Expressions can contain nested command invocations using brackets
    ("[ ... ]").
  - Command lines are parsed by the expression parser, too. They can
    contain command invocations (in brackets) and expressions (in
    parentheses).
* Added debugger commands:
  - expr: Evaluates the given expression and prints the result.
  - unset: Undefines a variable.
  - vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-16 00:01:20 +00:00
François Revol
82062f804c Works much better when actually allocating the TLS entry...
Now the backend works, Login can list users.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23509 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-14 02:03:34 +00:00
Axel Dörfler
4fc4f2c8ae * Added a transaction listener mechanism to be notified when a
transaction ends or has been aborted.
* BFS now listens for transactions when it created an inode to see if 
  the transaction will be aborted without freeing the inode (in which 
  case it will panic for now).
* Started implementing tracing support, but it's not working yet.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23492 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 17:18:29 +00:00
Michael Lotz
8c2a9d7433 bonefish+mmlr:
As (our) gcc unfortunately uses atexit() to clean up lazily initialized static
variables inside functions we have to ensure that we do the right thing with
unloadable shared objects. In case a shared object was unloaded that installed
an atexit() hook the application would crash on exit. We now implement a
callback into libroot that is used to call all the atexit() hooks of a
component that is to be unloaded. Most prominently this fixes the media_server
crash at shutdown.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 12:08:34 +00:00
Axel Dörfler
8e43ece8b8 Some more work on the tracing API:
* Added function to allocate space in the buffer.
* Dump() now fills a buffer instead of printing its data directly.
* This allows the new "#pattern" argument of the "traced" command to 
  work. When you're using that, the index of the trace entry is printed
  out, too, so that you can then get a full dump around the hits.
* Added an AddDump() method to the AbstractTraceEntry class so that 
  there is no need to call the inherited function anymore.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-13 02:50:32 +00:00
Axel Dörfler
416458e9c4 * Added nothrow to the new operator because otherwise the C++ compiler
will not accept if the allocator returns NULL and crashes instead
  (ie. not compiling in tracing would have crashed if some module tried
  to use it).
* Added total entries count to the KDL command output.
* Fixed computing the start index of the KDL command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 23:55:53 +00:00
François Revol
884c36167c Flag for LPSTOP availability.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 23:55:53 +00:00
Axel Dörfler
aa5d2a2df2 bonefish+axeld:
* Implemented an optional tracing layer that can be used in the kernel.
  Nice to use if you don't have serial output or need something that doesn't
  slow down the system as much.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-12 18:41:35 +00:00
Michael Lotz
f82c11c079 bonefish+mmlr:
* Move most of MIME database support out of libbe and into registrar
* Use the (async) MessageDeliverer instead of a synchronous SendMessage in _SendMonitorUpdate

This fixes a deadlock when the message port of a MIME database watching
application gets full as documented in bug #1311.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 22:45:06 +00:00
Ingo Weinhold
34b3b26b3b Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
  it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
  the assembly handler which now uses a jump table to call C functions
  handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
  interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
  rare events (signals, user debug enabling/disabling) on the
  common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
  retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
  the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
  common functions (currently memcpy() only). They are used in the
  kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
  member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
  (caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 00:36:44 +00:00
Axel Dörfler
3e5b9076f9 * Fixed (or rather, worked around) a deadlock in the VM: when a file was
resized but still had dirty pages to be written back, 
  vm_cache_resize() (which is called with the inode lock being held)
  deadlocked with the page writer.
* Now, I reintroduced busy_writing: it'll be set by everything that
  writes back pages (vm_page_write_modified(), and the page writer),
  and will be checked for in vm_cache_resize() - other functions are not
  affected for now, AFAICT.
* vm_cache_resize() will clear that flag, and the writer will check it
  again after it wrote back the page (which will fail when it's outside
  the file bounds), and if it's cleared, it will get rid of the page
  (if the file has been resized again in the mean time, writing it will
  succeed then, and we'll keep the page around).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23334 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-09 22:25:21 +00:00
Axel Dörfler
bcb71f00e8 * My last change to vm_page.cpp made an existing bug much more likely to
appear: when freeing a modified page, it wouldn't have a cache
  anymore, but set_page_state_nolock() depended on it.
* To work around this, I added a vm_page_free() function, which the
  caches that free modified pages have to call (but others may, too).
  It will correctly maintain the sModifiedTemporaryPages counter in case
  the cache has already been removed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23318 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-09 18:15:28 +00:00
François Revol
1dc0bb774c Avoid empty struct
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-06 00:40:17 +00:00
Stefano Ceccherini
9e64a7ed1b Fixed problem with some popup menus (check ticket #1679)
Moved GetMouse() calls near the check for exit conditions.
Reorganized a bit the code, and hopefully simplified it in some places.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-03 07:30:05 +00:00
Axel Dörfler
c88e5e410c * Added support for the G33 line of chips: mode setting and acceleration is working fine AFAICT.
* Implemented mapping the GTT area for i9xx chips other than the i965. This should also fix the
  driver working with these chips at all.
* The memory used by the driver now take the GTT area into account - before the GTT could be
  overwritten theoretically...
* Added fix for some i965 quirks from the X driver.
* Added some overlay definitions for the i965.
* Started support for G33 overlay (not complete yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-02 18:44:39 +00:00
Marcus Overhagen
70eb0da7e0 Mask io-space bit in promise_tx2 driver, the driver was broken after recent ide-adapter changes.
Replaced IDE_ADAPTER_IS_PRIMARY by IDE_ADAPTER_CHANNEL_INDEX to support more than 2 bus master channels,
and made ide_adapter aware of 3rd and 4th channel when calculating bus master dma address.
Fixed bus master DMA support in legacy_sata driver for tertiary and quaternary channel, channel 3 and 4
were using the DMA engine of primary and secondary channels (that might have destroyed your data).
Use PCI_address_io_mask instead of ~PCI_address_space (no functional change).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-01 20:31:14 +00:00
Michael Pfeiffer
9ffc1f4105 Checked in too soon.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23195 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-30 10:33:31 +00:00
Michael Pfeiffer
5d632c2aba - Fixed HW cursor issues:
- in order to set cursor position SVGA_CURSOR_ON_SHOW has to be written to register SVGA_REG_CURSOR_ON. 
  - do not use alpha cursor because it does not support inverting of source pixels.
- Fixed wrong usage of if-statement inside switch-statement
- Sync at end of SCREEN_TO_SCREEN_BLIT so that app_server does not write to frame buffer while accelerated operation is still running.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-30 10:06:46 +00:00
François Revol
a78864975b Move mmu definitions to a header so the bootloader can also use them.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 14:44:47 +00:00
François Revol
171a03646d Some more fields that helps compiling, but I'll have to sort that out later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 13:01:14 +00:00
François Revol
5eeaf46777 Minimal headers for atari_m68k
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-29 12:58:32 +00:00
Marcus Overhagen
882123356b Added more debugging code. The partition code appears to be using objects that have been destroyed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-26 22:26:08 +00:00
Axel Dörfler
8818c50507 * Made QueueCommands::Write() and MakeSpace() public.
* Implemented MakeSpace() (not yet tested).
* Changed intel_wait_engine_idle() to spin() between reads and to timeout
  after 1 second of waiting (could probably be done way earlier).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-13 14:56:28 +00:00
Michael Lotz
fd0986401e Ignore disabled local APICs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-12 18:39:41 +00:00
Michael Lotz
f108445b5e * Initial support for ACPI tables to detect multiprocessor configurations
* ACPI is evaluated first as it also handles things like multi core or hyper threading setups
* Removed other (disabled) hyper threading code per the notes in the corresponding ToDo
* Limit the detected CPU count to 2 for now as I wasn't able to get it working in either emulation nor real hardware with more than 2 CPUs
* Added a reserved byte to the mp_config_table struct, it worked only by luck as the compiler did padding there to get to the same size

I can now boot my Core 2 Quad with two out of four processors active :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-09 21:01:55 +00:00
Axel Dörfler
21885de266 * BFS now always writes back the whole block when it writes the super block.
* Therefore, I've added an I/O control that let's it update the boot block
  part of this block, so that makebootable can use it on a mounted volume
  (this will probably be moved into a disk system API later).
* Added user_memcpy() to the fs_shell.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-08 14:23:35 +00:00
Michael Lotz
dfa4dfe033 Something else that has been laying around for some time. Implemented hash_grow() that can grow a hash table to a new table size. Automatic growing is commented out in hash_insert() since there needs to be a way to disallow growing in certain cases (i.e. where no allocations can be made). This is detailed in the ToDo at the top of the file.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-06 21:58:06 +00:00
Michael Lotz
bbea21a256 Forgot the header change in the last commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-12-06 21:41:08 +00:00
Ingo Weinhold
92ab20b3a4 Added a list of death_entry's to the teams structure. It stores the
exit status of (non-main) threads of a team. Fixes bug #1644.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-28 00:07:32 +00:00
Axel Dörfler
5845b6ecc5 * The boot loader now remembers the bytes per row as told by the graphics card, and
passes that information on to the kernel. This should fix wrong bytes per row with
  certain resolutions and graphics cards.
* The boot loader now recognizes 15 bit modes that are advertised as 16 bit modes.
  This should fix wrong colors in 16 bit modes on some cards.
* Reenabled setting MTRR for VESA mode - don't remember why I disabled it, but it
  works fine on my test machines.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-27 16:33:19 +00:00
Axel Dörfler
3ae3b04bce * The boot loader (bios_ia32 only) now duplicates everything that goes to the
serial output, and puts it into the new kernel_args::debug_output field.
* syslog_init() will now check if there is anything in kernel_args::debug_output
  and will put that into the syslog buffer.
* dump_block() now also prints an offset.
* Fixed warning in mmu.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-27 12:59:34 +00:00
François Revol
7579aad575 Fix extra token at end of #endif
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22974 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-21 22:57:33 +00:00
Jérôme Duval
c6f1a3bfbb this macro is preferred
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22960 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-19 19:50:38 +00:00
Axel Dörfler
7301a7fbdb bonefish+axeld:
* The debug_server now sends the registrar messages whenever the debug alert
  is shown, and also, if the user wants to debug the team.
* In the latter case, the registrar will now cancel a shutdown process.
* Also, it will now wait with the shutdown process until the user has
  acknowledged the debugger alert.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-14 01:28:47 +00:00
Axel Dörfler
7333992516 On a media change, the KDiskDevice must do a bit more than it did:
* it now updates the partition data,
* the flags,
* and the disk geometry - and that now allows the session add-on to actually
  detect a newly inserted CD.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 12:18:06 +00:00
Axel Dörfler
4a31d30e84 * The file map needs to know the actual file size to be able to know if it has
the complete extent info or not.
* file_map_translate() now cuts down the request to the file bounds.
* Adjusted BFS and FAT to the API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-13 10:34:48 +00:00
Axel Dörfler
88ef411154 * Added an UninitializeMedia() method to KDiskDevice that also resets the
device geometry.
* If SetTo() reports no media, and GetGeometry() fails, the device geometry
  is now reset as well.
* KDiskDeviceManager::_ScanPartition() no longer unmarks the partition busy;
  this is now done by the caller, and done independently from the outcome of
  _ScanPartition(). This also fixes the problem that devices with no media
  were never marked unbusy (and thus were ignored subsequently).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 23:20:33 +00:00
Ingo Weinhold
6e122bd99e axeld + bonefish: Missed those changes in the previous commit:
* Added vfs_unmount(), which allows unmounting by dev_t (used by the DDM).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 20:54:17 +00:00
Ingo Weinhold
b3a5629b9e axeld + bonefish:
* Unmount when uninitializing a partition.
* Finished the media checker implementation, i.e. we rescan when a media
  was inserted and uninitialize when ejected.
* Turned the disk device media checker from a kernel daemon into a thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22909 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-12 18:41:36 +00:00
Axel Dörfler
3d268eda3d * Extracted file_map API out of the file cache - it's now an optional service
that can be used by file systems.
* Changed the way the file cache works: instead of reading/writing to the
  underlying device directly, it can now be used for any data source, ie.
  also network file systems.
* As a result, the former pages_io() moved to the VFS layer, and can now be
  called by a file system via {read|write}_file_io_vec_pages() (naming
  suggestions are always welcomed :-)). It now gets an FD, and uses that to
  communicate with the device (via its fs_{read|write}_pages() hooks).
* The file_cache_{read|write}() functions must now be called without holding
  an I/O relevant file system lock. That allows the file cache to prepare the
  pages without colliding with the page writer, IOW the "mayBlock" flag can
  go into the attic again (yay!).
* This also results in a much better performance when the system does I/O and
  is low on memory, as the page writer can now finally write back some pages,
  and that even without maxing out the CPU :)
* The API changes put slightly more burden on the fs_{read|write}_pages()
  hooks, but in combination with the file_map it's still pretty straight
  forward. It just will have to dispatch the call to the underlying device
  directly, usually it will just call its fs_{read|write}_pages() hooks
  via the above mentioned calls.
* Ported BFS and FAT to the new API, the latter has not been tested, though.
* Also ported the API changes to the fs_shell. I also completely removed its
  file cache level page handling - the downside is that device access is no
  longer cached (ie. depends on the host OS now), the upside is that the code
  is greatly simplified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22886 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-10 21:19:52 +00:00
Ingo Weinhold
c9830ce0f5 * KDiskDeviceManager::{Find,Load}DiskSystem() can also find the disk
system by pretty name (not only module name) now.
* _user_initialize_partition() loads the disk system by pretty name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-10 20:30:22 +00:00
Axel Dörfler
6405549873 No wonder no one noticed that the silicon_image_3112 driver was broken; I
actually forgot to commit the changes I made to the ide_adapter...
* the IDE bus master command/status stuff is now used via flags; it's no
  bitfield anymore.
* Changed a few constants to upper case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22842 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-06 02:26:44 +00:00
Ingo Weinhold
7b45b55be1 * Added back and partially reimplemented the
K{Disk,File,Partitioning}System writing methods. It is now required
  that the caller has marked the concerned partitions busy, hence we can
  (read-)access them without needing a lock. The module interfaces will
  will be changed to take advantage of the fact as well. The methods take a
  disk_job_id instead of a KDiskDeviceJob* now, though I haven't quite
  decided, whether we need it at all or just want to add a special
  handling in the cases where notifications during the operation make
  sense.
* Reimplemented the disk device write support syscalls (save
  _user_move_partition() for which other module hooks are needed). They
  call the KDiskSystem methods, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22832 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-05 00:42:47 +00:00
Ingo Weinhold
2128ea4f31 Added IsBusy(bool) version, which optionally also checks the
descendants.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22831 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-05 00:30:14 +00:00
François Revol
1a8a803ee1 WIP
Abstracted cpu and mmu version dependant stuff (compatibility where are you) into ops like func arrays.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22821 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-03 21:02:03 +00:00
Ingo Weinhold
53715fe060 * Got rid of the B_PARTITION_DESCENDANT_BUSY flag.
* Added CheckAndMarkBusy() and UnmarkBusy() methods to KPartition.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22801 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-02 00:29:46 +00:00
Ingo Weinhold
8354dac78e Folded KPhysicalPartition into KPartition. Removed the notion of shadow
partitions from the disk device manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 23:36:21 +00:00
Ingo Weinhold
327887959e * Moved partition scanning back to KDiskDeviceManager. ATM only
synchronous scanning is supported.
* Removed the disk device job support from the disk device manager.
* K{Disk,File,Partitioning}System:
  - Remove querying and validation methods.
  - Commented out the modification methods until their fate is decided.
* Removed obsolete _user_get_partitionable_spaces().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22799 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 22:41:22 +00:00
Ingo Weinhold
300868ce27 * Removed no longer needed disk device related syscalls
(_kern_{supports,validate}_*(), etc.).
* Adjusted the prototypes of the disk device modification syscalls.
  Commented out their implementations for the time -- they'll mostly
  have to be rewritten completely.
* Implemented the userland disk device jobs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 21:16:22 +00:00
Axel Dörfler
61291964c3 The intel_extreme driver now finally works with the i965 chipset;
acceleration works fine, but overlay doesn't - that's next on my list.
Turns out the i965 differentiates between RGB-32 and RGB-32-alpha, and 
didn't like trying to use the latter as display mode (the i865 didn't 
care at all)... finding that took me *way* too long, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 19:23:59 +00:00
Ingo Weinhold
3ca9267ce3 * The BMutablePartition setters adjust the change flags accordingly.
* PartitionDelegate::Uninitialize() uninitializes the mutable partition. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-31 17:02:52 +00:00
Ingo Weinhold
25ab0d1a4a * Fixed typos in the disk device job constants.
* Added missing job classes (they don't do anything yet, though) and
  completed the implementation of the job generator.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22767 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-29 23:51:02 +00:00
François Revol
a790413138 More regs in m68k iframe.
Removed DOS CR.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 14:28:54 +00:00
François Revol
829748d89d Fix flushing the ATC, add flushing icache.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 02:24:38 +00:00
François Revol
ee75f8527b This should handle TLB flushing on m68k (it's called ATC though).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22706 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 00:45:01 +00:00
François Revol
8848d5972f Fix cast.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22705 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 00:44:09 +00:00
François Revol
d40bcaab8e m68k code.
We will use SRP (supervisor root pointer) register to hold the current thread pointer.
Its use by the pmmu is optional and I don't plan on using it.
There are 32 other bits left.
Wonder if weshouldn't use it for system_time() instead... will see, but there are no other usable regs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-23 23:48:02 +00:00
Axel Dörfler
c76695a275 * The C "struct list" and the C++ DoublyLinkedList implementations had mixed
next/prev link order - that messed up the DoublyLinkedListCLink adapter.
* Since it's more likely that someone messes with the C version, the C++ version
  now uses the same order than that one.
* This fixes a bug when TCP's BufferQueue tried to iterate over a list, messing
  up its integrity.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-23 10:37:41 +00:00
Stefano Ceccherini
37b83b1a2d The system palette was defined in two files. Moved to a private header,
included by the two.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 13:44:37 +00:00
François Revol
d09c112c3e - Yes we will have 64bit atomic funcs! Watch this PPC! :P
- m68k ELF reloc names.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22656 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 00:43:22 +00:00
François Revol
0b2adc3d8e Headers (unfinished) for an m68k port (yes I do know it's useless, it's just for the l33t factor).
Based on ppc/x86 headers from r22648.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-21 23:42:09 +00:00
Axel Dörfler
23128566a4 Slab.h no longer includes Depot.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22647 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-21 20:56:34 +00:00
Axel Dörfler
b623d277fa Moved Base.h into Slab.h, and removed Base.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-21 20:44:19 +00:00
Axel Dörfler
15ab0bcf01 * int32_t, uint32_t are now of type "int", and no longer of type "long".
This should help to reduce the number of warnings imported code will throw
  during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
  that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-21 20:10:43 +00:00
Stephan Aßmus
359f014e4e * part of libbe_test build fix... why is the _IMPEXP stuff there in the
first place? Is it even needed?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22636 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-21 15:19:25 +00:00
Axel Dörfler
e544dd5915 * Fixed a possible dead lock between the kernel daemon and the DDM; the media
status checker now only tries to lock the manager, it won't wait anymore.
* Added MediaChanged() and UpdateMediaStatusIfNeeded() methods to KDiskDevice.
* KDiskDeviceManager::_CheckMediaStatus() now uses these new methods; it should
  no longer detect removed media more than once :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-19 15:20:36 +00:00
Axel Dörfler
d73d20e85c Fixed warning when compiling the PS/2 bus manager.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-18 17:23:14 +00:00
Ingo Weinhold
9417631f64 * Made _CountDescendants() public.
* Added private _ChildAt() and _CountChildren(), which don't ask the
  delegate, thus reflecting the hierarchy as it was before changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22610 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-18 03:42:30 +00:00
Ingo Weinhold
013e7894b7 We need flags to track what properties of the partition change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-18 03:39:50 +00:00
Ingo Weinhold
1573b62671 * Removed the BDiskDeviceJob class. Jobs won't be generated and executed
in the kernel anymore. The respective functionality will be moved into
  the userland. Depending on how we want the API user to interface with
  it, we may want to reintroduce a similar class later.
* Cleared remaining references to shadow partitions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 22:56:23 +00:00
Ingo Weinhold
27d7c36659 * Reimplemented BDiskDevice::IsModified()/
{Prepare,Commit,Cancel}Modifications() using the userland add-on
  backend. IsModified() and CommitModifications() are little more than
  stubs ATM.
* Made BPartition::VisitEachChild()/VisitEachDescendant() const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22602 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 21:50:20 +00:00
Ingo Weinhold
46b93b2cfd Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 20:51:10 +00:00
Axel Dörfler
8047441723 The disk device manager now periodically checks for media changes - all it does
is dump its findings, but it's an (untested) start.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 17:05:48 +00:00
Ingo Weinhold
c9518b6240 Removed some now obsolete methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 01:04:53 +00:00
Ingo Weinhold
fe6bd3b5b7 * Moved GetNextSupportedType() and IsSubSystemFor() from
BDiskSystem to BPartition and reimplemented them using the userland
  add-on backend instead of syscalls. As a side effect this solves the
  TODO I recently added in GetNextSupportedType().
* Reimplemented BDiskSystem::GetTypeForContentType() using the userland
  add-on backend instead of a syscall.
* Moved GetTypeForContentType() and IsSubSystemFor() from
  BPartitionHandle to BDiskSystemAddOn. They were misplaced.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-17 01:01:49 +00:00
Axel Dörfler
e7e325508b Allocating additional memory should now work on the i965 as well (but bad things
will happen on earlier i9xx chips for now...). Not yet tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-16 16:52:34 +00:00
Ingo Weinhold
b62085b975 Coding style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-16 00:32:41 +00:00
Axel Dörfler
f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Axel Dörfler
332d5f437e Some cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 14:09:14 +00:00
Axel Dörfler
c278448653 * Introduced a monitor_info structure and means to let it be filled by the
accelerant (or the app_server via EDID info). It's still experimental
  API, and opinions are welcome.
* Moved BPrivateScreen into the BPrivate namespace.
* Rewrote Screen.h.
* Introduced a BScreen::GetMonitorInfo() method, and implemented it in the
  app server as well (ie. AS_GET_MONITOR_INFO).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 11:41:47 +00:00
Ingo Weinhold
28541deac2 Beginning of the integration with the new userland disk system add-on
based code. Small API changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 00:41:18 +00:00
Axel Dörfler
6a0f39da22 Applied patch by Julun: time computations based on an algorithm by Fliegel,
and van Flandern (1968), instead of those inefficient loops we had before.
Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-14 17:27:44 +00:00
Axel Dörfler
53d781f439 * Now uses the new create_display_modes() function.
* Now supports the new B_GET_EDID_INFO hook under Haiku.
* Fixed build under BeOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-14 12:31:51 +00:00
Ingo Weinhold
08baf63a9f Decided that BPartition::ImmutableDelegate would basically be a big
collection of no-op methods, which could as well be implemented in
BPartition itself. This makes the Delegate hierarchy unnecessary:
MutableDelegate becomes Delegate, and we save a few casts as a side
effect.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-14 00:07:03 +00:00
Ingo Weinhold
350043e707 * Initialization of BPartition::Delegate is now two-phased. The first phase
builds the object hierarchy, the second will (in case of MutableDelegate)
  let the disk systems do their initialization. This way the disk systems
  already find a fully functional object hierarchy they can work with.
* Child creation also takes a partition name as a parameter, now.
* Implemented BMutablePartition child creation/deletion.
* The BDiskSystemAddOn/BPartitionHandle::Validate*() methods return a
  status_t instead of a bool, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22540 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:29:33 +00:00
Ingo Weinhold
103ca6a3ad The info about partitionable space will be provided by the userland disk
system add-ons. First work to make this class usable for them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22539 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:17:26 +00:00
Ingo Weinhold
b3e7c4a4b9 * Added fDelegate member.
* Removed private AutoDeleter class. The shared ArrayDeleter is used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-13 21:13:02 +00:00
Karsten Heimrich
98148bd6c5 * this should fix the build on gcc4
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 22:47:42 +00:00
Axel Dörfler
7bdf92f3f7 Started a create_display_modes() function that should be used by accelerants
to create their mode list. Once it's done, it should cover all possible cases,
and allow the base mode list to reside in the app_server (under Haiku, at least),
so that all drivers will benefit from an updated list.
Right now, it might already work to a degree, but it's not yet tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22517 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 15:59:50 +00:00
Axel Dörfler
13a81299f1 Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22516 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-12 15:56:08 +00:00
Stefano Ceccherini
65e63b987d PaletteConverter now exports a static InitializeDefault() method, which
can be used (and is, by _init_interface_kit()) to initialize the ... 
er... default instance of 
PaletteConverter using the system color map, thus avoid building the 
list of colors, which takes some time. Fixes bug #505.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-11 13:30:56 +00:00
Axel Dörfler
f8941839c3 * Reworked stealing pages: the page thief thread is gone now,
vm_page_reserve_pages() and vm_page_allocate_page() will now steal pages from
  the inactive queue as needed.
* We currently never steal active pages anymore, but this might need to be
  revised later (therefore, the page scanner never waits anymore, but uses
  mutex_trylock() to lock a cache).
* The page scanner and writer now both run at normal priority - let's see how
  that will work out.
* Introduced an inactive queue.
* Instead of shuffling pages around in the queue (and therefore destroying LRU)
  the page stealing mechanism now uses a marker page to be able to release the
  page lock without losing its position in the queue.
* The page writer now always grabs the whole release count of the semaphore, so
  that there won't be a huge backlog to catch up with. 
* vm_page_num_free_pages() now also includes the inactive queue as well as the
  reserved pages (they are no longer regarded as free pages).
* Added a insert_page_after() function that inserts a page after another one,
  needed by the marker code.
* clear_page() now gets a vm_page instead of a physical address which simplified
  some code.
* Removed superfluous initialization of the queues (if those aren't zeroed on
  start, we would have serious problems, anyway).
* Removed old and unimplemented dump_free_page_table() ("free_pages") KDL
  command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22506 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-11 08:01:18 +00:00
Ingo Weinhold
15ed7c71d6 More fleshing out the disk system add-on interface and related classes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-10 21:35:22 +00:00
Ingo Weinhold
67c578e73f Added global lock that can be used for lazy initializations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-10 21:30:51 +00:00
Axel Dörfler
477c9d1dc0 * vm_set_area_protection() would remap the whole area instead of just the page
it intended to. That resulted in more writable pages where you wouldn't want
  them (ie. allowing the area to change pages in lower caches).
* We were losing modified pages: vm_unmap_pages() sometimes has to preserve
  the modified flag (eg. when called from page fault).
* Both of these were responsible that stealing active pages would crash
  applications - even if less likely, this could also have happened when
  stealing inactive pages. Therefore, I've activated stealing active pages
  again.
* The page writer now pushes the pages of busy vnodes to the end of the queue,
  so that it won't pick them up again too soon (the vnode destruction would
  be in the process of writing those pages back, anyway).
* The page thief now triggers the page writer to run once it has to steal
  active pages. This might be a bit too aggressive, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22495 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-09 11:05:50 +00:00
Axel Dörfler
0710d59c1c * Added a "canWait" argument to vfs_get_vnode() - you can use this to ignore
busy vnodes.
* dir_create_entry_ref() used get_vnode() incorrectly (and could therefore
  potentially prevent a file system from doing proper locking when called
  from the kernel).
* The vnode_store now uses this for its acquire_unreferenced_ref()
  implementation (and therefore for the page writer).
* read_into_cache() and write_to_cache() were still marked inline.
* The system will now wait 10 secs for a busy vnode before returning an error.
* It will also no longer panic in that case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-08 16:06:32 +00:00
Ingo Weinhold
98b97f9603 First draft of the userland disk system add-on interface. A good deal of
functionality of the kernel add-ons will be moved into userland, which
will simplify the kernel-side significantly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-08 01:33:46 +00:00
Ingo Weinhold
bf95c9aee6 * The shadow_changed() FS and partitioning system hooks take an
additional partition_data* child parameter now.
* _user_get_partitionable_spaces() doesn't need to copy the buffer into
  the kernel, since it is no input parameter. It also copies back the
  actual partitionable spaces count on error, now -- B_BUFFER_OVERFLOW
  is returned when the buffer was too small, but then the count must be
  returned too.
* Fixed several instances of syscall implementations that unloaded a disk
  system, although they didn't load it in the first place. This screwed
  up the load count with undesirable consequences.
* _user_create_child_partition() would set the size to the supplied
  offset.
* Fixed broken loop in KPhysicalPartition::CreateShadowPartition().
* KPartition::RemoveChild() notified the listeners about the wrong
  event.
* Intel partitioning module:
  - The *_get_partitionable_spaces() correctly return B_BUFFER_OVERFLOW
    now, if the supplied buffer is too small.
  - Implemented a part of pm_shadow_changed(), which creates and updates
    the PartitionMap, so that the validate_*() hooks have a chance to
    work at all.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 15:39:35 +00:00
Ingo Weinhold
a68ceab8df Fixed comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 15:17:38 +00:00
Ingo Weinhold
04adb291a6 Clear the user_partition_data::user_data fields before updating the
BPartition structure with the data retrieved from the kernel. For new
partitions the field is not set in the next step and later code would
use an initialized pointer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 14:56:26 +00:00
Ingo Weinhold
7ede8e4494 Added [Content]Parameters() getters.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-07 14:52:54 +00:00
Axel Dörfler
c950f17a51 * Added a acquire_unreferenced_ref() to vm_store
* his has to be used by the page writer to make sure the vnode is still valid.
* This should have been the final nail on the Luposian bug - I haven't tested
  it yet, but we'll certainly see :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-06 15:35:38 +00:00
Axel Dörfler
80f5469291 * struct vnode is an opaque type now, removed void* where it was used incorrectly.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-06 15:33:12 +00:00
Axel Dörfler
0e18334057 * Mapping a page might actually need memory - since we usually have locks that
interfere with the page thief, we always need to have reserved a page for
  this upfront. I introduced a function to the vm_translation_map layer that
  estimates how much pages a mapping might need at maximum. All functions that
  map a page now call this and reserve the needed pages upfront.
  It might not be a nice solution, but it works.
* The page thief could run into a panic when trying to call vm_cache_release_ref()
  on a non-existing (NULL) cache.
* Also, it will now ignore wired active pages.
* There is still a race condition between the page writer and the vnode
  destruction - writing a page back needs a valid vnode, but that might just
  have been deleted.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-06 11:18:21 +00:00
Ingo Weinhold
0cf4ed1de6 MoveFrom() was broken. Fixes bug #1534.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-05 16:56:48 +00:00
Ingo Weinhold
db5c68ca46 * Added the partition size as parameter to the file and partitioning
system initialize() hooks. It's often the only info about the
  partition one needs and thus locking the partition just to get it is
  no longer necessary.
* intel partitioning system:
  - Removed passing around block sizes. We require 512 byte sectors
    anyway. In fact using the parent partition's block size was even
    wrong.
  - Simplified writing the partition map sector.
  - Simplified and corrected the partition map initialization.
  - We don't fail identifying a partition anymore, if the partition map
    contains no partitions. We would never identify a freshly
    initialized partition map before.
  - Made pm_identify() more intelligent: It determines the priority to
    return depending on whether the partition is the device itself and
    whether we have recognized child partitions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 23:48:18 +00:00
Ingo Weinhold
6748659272 Added an identify_file_system() hook to the FS modules. The boot loader
does no longer give partitioning systems precedence over file systems.
The one with the greater identification priority wins. ATM, if a file
system wins, we still mount the first file system that recognized the
partition at all, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 23:16:31 +00:00
Ingo Weinhold
8c8f8c8420 Added scan_partition() function which can be used by disk systems (e.g.
in *_initialize()) to save some work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 18:03:24 +00:00
Axel Dörfler
9d8c209014 * vm_remove_all_page_mappings() now returns an accumulation of the flags of
the unmapped page.
* This is needed by everyone who calls this to make sure modifications to a
  page aren't ignored. Namely, the page scanner and the page thief were
  affected.
* Cleaned up locking the page's cache a bit in page_thief(); there is now
  a helper class that takes care of everything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 16:36:35 +00:00
Axel Dörfler
3e9513aa4a * fs_{write|read}_pages() now has an additional argument "mayBlock".
* the page writer don't allow to block, while all other writers do. This fixes
  bug #1509. The reason the page writer needs this is because it marks several
  pages from different caches as busy.
* Fixed a warning about ASSERT being defined already in BFS, since
  util/DoublyLinkedList.h now includes debug.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-04 12:45:15 +00:00
Ingo Weinhold
45f9d60c9f Some KDEBUG enabled sanity checks.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 22:22:21 +00:00
Ingo Weinhold
76ab7bdcf8 Added function dprintf_no_syslog(). It is basically equivalent to
dprintf() with the exception that it doesn't write anything to the
syslog. The reason is that syslog_write() releases a semaphore and can
therefore not be invoked when the thread spinlock is held.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-03 22:14:53 +00:00
Ingo Weinhold
636bfc08ae * Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
  private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
  work pretty much like poll(), but also for semaphores, ports, and
  threads.
* Removed the "ref" parameter from notify_select_events() and the
  select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
  is no longer needed. The FS interface select() hook still has it,
  though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
  pair, now. Added respective functions for semaphores, ports, and
  threads.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:47:31 +00:00
Ingo Weinhold
d0c2af7713 Addressed a deadlock race condition: Acquiration of condition variable
and thread spinlock was reverse in Wait() and Notify(). The thread lock
is now the outer lock -- this way it is still possible to call Notify()
with the thread lock being held.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 22:24:42 +00:00
Ingo Weinhold
1221a4f200 Allow derived classes to access the member variables.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 18:39:02 +00:00
Ingo Weinhold
66c03dc3a9 * fd.c -> fd.cpp
* Reworked the select support:
  - The io_context additionally stores a table of lists of select_infos,
    which enables it to deselect events of a pending select() when
    closing a FD. This prevents a race condition potentially causing a
    write to stale memory.
  - The opaque selectsync* passed to FSs is now actually a select_info*.
    This was necessary, since the FDs deselect() hook (unlike the
    select() hook) doesn't take a "ref" argument and deselecting a
    single info (e.g. caused by a premature close()) was not possible.
    The select() hook's "ref" argument has become superfluous.
  - It should now be relatively easy to implement a poll_on_steroids()
    that can also wait for objects other than FDs (e.g. semaphores,
    ports, threads etc.). 
* Set/reset the signal mask in common_select(). This makes pselect()
  work as required.
* Reorganized vfs_resize_fd_table().



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-01 01:37:28 +00:00
Axel Dörfler
b062823d81 * register_low_memory_handler() was called too early by several kernel
components - now, we divide the initialization of that service into two parts
  which allows this (before, most handlers were gone after boot).
* Added debugger command that dumps the low memory handlers.
* The slab allocator now registers its low memory handler with a higher
  priority, so that it'll run before the potentially heavier ones.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-29 15:46:40 +00:00
Ingo Weinhold
eee9e86c6b Set default template argument to void, so that one doesn't need to
bother.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22358 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 21:40:25 +00:00
Marcus Overhagen
ece77b379a renamed SCSI_OP_TUR into SCSI_OP_TEST_UNIT_READY
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 21:30:53 +00:00
Axel Dörfler
a6778735f9 bonefish+axeld:
* We now have a page writer that takes some pages from the modified queue
  and writes it back every few seconds. It can be triggered by the page
  scanner to do that more often, though. That mechanism can be greatly
  improved once we have our I/O scheduler working.
* Removed vm_page_write_modified_page() again - it was all "eaten up" by
  the page writer.
* Reworked vm_page_write_modified_pages() a bit: it now uses
  vm_test_map_modification() and vm_clear_map_flags() instead of the
  iterating over all areas which wouldn't even work correctly.
  The code is much simpler now, too.
* You usually put something to the tail of a queue, and remove the contents
  from the head, not vice versa - changed queue implementation to reflect this.
* Additionally, there is now a enqueue_page_to_head() if you actually want the
  opposite.
* vm_page_requeue() allows you to move a page in a queue to the head or tail.
* Replaced vm_clear_map_activation() with vm_clear_map_flags() which allows
  you to clear other flags than PAGE_ACCESSED.
* The page scanner dumps now some arguments with each run.
* Removed the old disabled pageout_daemon() from NewOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 15:50:26 +00:00
Marcus Overhagen
8ce98e44cc convert files to new include file locations
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22347 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:53:42 +00:00
Marcus Overhagen
1e2722379a splitting the file
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22344 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:19:08 +00:00
Marcus Overhagen
641e015e6e this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:08:52 +00:00
Marcus Overhagen
178bce195a this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:07:23 +00:00
Marcus Overhagen
4ecfa05eb3 this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:06:24 +00:00
Marcus Overhagen
5451eb688b this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:05:55 +00:00
Marcus Overhagen
7d4093aa23 this header should be private
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-09-28 14:04:05 +00:00