Commit Graph

2645 Commits

Author SHA1 Message Date
Jérôme Duval
bb97148298 added more posix functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 14:31:28 +00:00
François Revol
af18effb0e No need to report an error on modules that aren't modules...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 00:57:24 +00:00
Jérôme Duval
2eb280d3a8 added a few more math functions, rearranged some functions in math.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-05 23:21:33 +00:00
Jérôme Duval
aaec7603ab added matherr, lroundl and roundl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-05 20:58:03 +00:00
Salvatore Benedetto
b6cd7771e7 * Fix cast in user_memcpy
* Fix comparison

send and receive simple message seems to work now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27331 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 22:14:59 +00:00
Salvatore Benedetto
d9bf715495 * Implemented msgrcv and msgsnd. Not complete yet.
* Reworked the way IDs are geneterad in the same way they are in xsi semaphores


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 19:45:02 +00:00
Karsten Heimrich
89cfd54279 * revert r27322 and apply the patch provided by Salvatore
Thanks you!  :)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 17:00:01 +00:00
Karsten Heimrich
754b706519 * calling receive_data with NULL as first argument(thread_id)
failed on Haiku, this makes e.g. painting in ArtPaint work

  Don't know if this is the best place to fix it though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27322 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 16:07:11 +00:00
Salvatore Benedetto
c0c7a73dbe * split Wait() method into Enqueue() - BlockAndUnlock() - Deque() in order to
remove a race condition pointed out by Ingo, hopefully in a clean way. The
  set is now unlocked right before blocking
* Reworked the way ID were assgned: the current time is now used as ID. This
  lower quite a lot the probability of having an ID reused.
* Introduced a sequence number field in the set class as a second ID, as
  suggested by Ingo. It is used on wake up in order not to confuse a no more
  existing set with a new one with the same ID
* Removed a now unnecessary UnsetID() method
* Increased the arbitraty limit of max sempahore allowed in the system, and
  introduced a new one for the total number of set.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27320 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 12:34:26 +00:00
Ingo Weinhold
537d081817 release_sem_etc(): Reschedule only when a thread with a priority greater
than that of the current thread has been woken up. I didn't see the
reason why the thread should otherwise relinquish the rest of its
quantum. I noticed for instance that client and app server window
threads were ping-ponging more than seemed necessary. In most cases
when the client sent a port message it would be unscheduled although it
had run only for a few microseconds and had still stuff to do.
I measured a relatively Terminal-heavy "find /boot" (second run), which
does now take 5-10% less time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 00:32:12 +00:00
Ingo Weinhold
e032a7f50e Scheduling analysis: Also record the number of times a thread waits on a
locking primitive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-04 00:07:11 +00:00
Jérôme Duval
04e088c3a9 I forgot that m68k build doesn't include long double versions of functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 18:59:12 +00:00
Ingo Weinhold
020ac56840 * Fixed bug in the "scheduler" command: The check when a thread was
unscheduled was incorrect.
* Introduced _kern_analyze_scheduling() syscall. It requires scheduler
  kernel tracing to be enabled. It uses the tracing entries for a given
  period of time to do a similar analysis the "scheduler" debugger
  command does (i.e. number of runs, run time, latencies, preemption
  times) for each thread. Additionally the analysis includes for each
  thread how long the thread waited on each locking primitive in total.
* Added kernel tracing for the creation of semaphores and initialization
  of condition variables, mutexes, and rw locks. The enabling macro is
  SCHEDULING_ANALYSIS_TRACING. The only purpose is to provide
  _kern_analyze_scheduling() with more info on the locking primitives
  (the name in particular).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27304 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 15:10:44 +00:00
Ingo Weinhold
aa1a64f35a Added [un]lock_tracing_buffer(). This allows other components to analyze
tracing buffer entries even when not in the kernel debugger.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27302 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:51:00 +00:00
Ingo Weinhold
dd1c278d4b Added elf_get_image_info_for_address() to get an image info for a kernel
image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27300 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 14:47:26 +00:00
Salvatore Benedetto
25d466ba72 * Start implementing _kern_xsi_msgsnd().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-03 09:00:27 +00:00
Jérôme Duval
27c3792d1e added random_r.c
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27278 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 20:26:40 +00:00
Jérôme Duval
59e23729f5 added towctrans
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 20:18:49 +00:00
Jérôme Duval
8a34e3d4de added getwchar and iofgetws
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27275 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 20:05:35 +00:00
Jérôme Duval
0ac2fa30a5 added gammal_r and lgammal_r private functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27274 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 19:54:55 +00:00
Jérôme Duval
9c91170f95 added fpclassifyl
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27272 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 19:37:23 +00:00
Salvatore Benedetto
dc0cdfb2f0 * Fix a potential race condition when deleting a semaphore set: previously only
the ipc hash table lock along with the semaphore set hash table lock were
  hold, thinking (wrongly) that the semaphore set lock itself was not needed.
  What could happen was that another process on semop could have gained the lock
  of the set itself, and then release the semaphore set hash table lock.
  This would make it think that the set was still valid, while it could have
  actually been deleted right after it release the semaphore set hash table lock.
  Same would have happened for any other processes waiting on the semaphore set
  mutex queue. By calling the lock on the mutex when deleting the set, it
  *should be* safe to assume that there is no one else waiting on its queue,
  since the list of waiters is handled in a FIFO way.

As far as I can see from the mutex_destroy code, it looks safe to hold the lock
when calling this function. Please confirm.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27268 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 16:16:03 +00:00
Salvatore Benedetto
842f1dfab5 * Start implementing _kern_msgctl() syscall
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-01 13:13:03 +00:00
Jérôme Duval
88e8ee78db added s_signbitf.c for x86
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 22:52:54 +00:00
Salvatore Benedetto
6d3973a54a * Removed unecessary HasMessageQueue method
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 16:01:19 +00:00
Salvatore Benedetto
f273b13ddb * Renamed xsi_ipc_init() to xsi_sem_init() as there will be a xsi_msg_init()
for message queue
* Removed unnecessary header Vector.h
* Removed HasSemaphoreSet method: since there will be an IPC table for each
  subsystem, if a key exist, it already has a semaphore set associated
  with it


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:59:32 +00:00
Salvatore Benedetto
9309ec8635 Start implementing POSIX message queue IPC
* Implemented _kern_msgget()

Work in progress, some stuff may be removed.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 15:31:08 +00:00
Ingo Weinhold
ce2a6a4bed Don't release the semaphore, if no one is waiting on the condition
variable. pthread_cond_broadcast() incorrectly returned an error
when no one was waiting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27253 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 13:41:52 +00:00
Salvatore Benedetto
29fd670a1b * Updated license
* Removed extraneous tabs
* Implemented lldiv (#2688)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 10:40:58 +00:00
Ingo Weinhold
841b6cd749 * Also add the creating thread to an IORequest and let child requests
inherit it.
* IOScheduler::ScheduleRequest() uses the request's thread and team now
  instead of the current one. Otherwise for requests processed
  iteratively this would always be the I/O scheduler's notifier thread.
* Also get the thread's I/O priority now. It's still ignored later,
  though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27248 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 00:43:46 +00:00
Ingo Weinhold
3b3e3805f8 Added thread::io_priority field and functions to get/set it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-31 00:37:02 +00:00
Ingo Weinhold
4612433715 * Added parameter "size_t align" to file_map_translate(). If > 1, the
vector at the end of the file will be aligned to the given value.
* BFS uses an alignment of 512 bytes (should be block size of the
  underlying device or BFS block size, whatever is less), which should
  be fine, since file data are only stored in BFS blocks. This totally
  avoids any partial operations at the I/O scheduler level, thus saving
  disk operations. Not that I could measure any performance difference.
  Theoretically it should help a lot though, particularly when dealing
  with lots of small files, since we avoid using bounce buffers, which
  are (a) limited in number and (b) require copying of the data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27246 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 23:06:28 +00:00
Ingo Weinhold
fd49e6b35a Print some more interesting timing info for the page writer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27245 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-30 22:50:44 +00:00
Ingo Weinhold
aa868cf6c1 Adding/removing swap files:
* swap_file_add() open()s the swap file now with O_NOCACHE and
  swap_file_delete() closes it. This squashes a TODO (the file cache
  wasn't kept disabled for the swap file before).
* swap_file_add() only adds swap files that can actually be used (i.e.
  non 0-sized ones).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27232 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 13:45:08 +00:00
Ingo Weinhold
d277d9f2f8 Don't always commit memory in VMAnonymousCache::Fault() for
overcommitting caches. If the page in question was just not mapped or
swapped out, we would increase the committment unnecessarily
(potentially even beyond the size of the cache).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 00:49:09 +00:00
Ingo Weinhold
ae21ddaf58 steal_pages() was leaking a cache reference since r26572, i.e caches
locked there would be leaked eventually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-29 00:44:12 +00:00
Stephan Aßmus
ec56835f51 Patch by David Powell:
* Implement color palette generation for the boot splash images in the
  generate_boot_screen build tool. Only 4-bit screen support is missing now.
* Adopted images.h with the new results from generate_boot_screen.

This should fix black boot screens for graphics cards that don't support
true color modes for the native resolution. I've tried to find the ticket,
#2177 almost looks like the one, but it looks more like the mode is out
of range if I understand the ticket right.

Thanks a lot, David, and sorry it took so very long to apply your patch!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 16:59:34 +00:00
Ingo Weinhold
96b6a162a1 Increased the number of pages the page writer tries to write per run.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 01:49:59 +00:00
Ingo Weinhold
0316483f0a * DMAResource::TranslateNext(): Added parameter to limit the maximum
operation length.
* IORequest: Added owner (IORequestOwner). Also added a SetUnfinished()
  method, which is invoked by the I/O scheduler after all operations of
  the request have been finished, but the request isn't done yet.
* Added debugger commands "io_request_owner" and "io_scheduler" printing
  information for a IORequestOwner and IOScheduler object respectively.
* Implemented an actual I/O scheduling algorithm. It's a simple round
  robin strategy (a queue per thread) with a unidirectional elevator
  serializing the operations. ATM priorities are ignored, the bandwidth
  isn't adjusted to the device, and there are TODOs all over the place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27216 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 01:49:18 +00:00
Ingo Weinhold
953cb30447 Re-added support for kernel breakpoints. This feature is just way to
handy in certain situations to not have it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27213 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-27 12:52:23 +00:00
Ingo Weinhold
ddeb7bfaf1 Changes by Zhao Shuai and myself:
* The VMAnonymousCache destructor was unreserving too much physical
  memory.
* Addressed TODO in _SwapBlockBuild(): When the swap block couldn't be
  allocated we wait and loop until it can.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27202 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-25 22:04:17 +00:00
Ingo Weinhold
b9f431f1df Extended debugger language: Dereferenced addresses are now supported as
left hand side of assignments. IOW it is possible to modify memory, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-25 00:24:06 +00:00
Ingo Weinhold
18f2a9c17d Added support for architecture specific debug variables, e.g. for
referencing iframe registers. Their prefix is "$". E.g. "$eax" refers to
the eax register of the current iframe. The features cooperates with the
"in_context" command, i.e. "in_context 92 $eip = 0" will set the eip
register of thread 92 to 0 (thus sealing its fate ;-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 23:01:43 +00:00
Ingo Weinhold
1b20a9a58e arch_debug_get_interrupt_pc() does now also support the currently
debugged thread, if set. This makes "dis" without specified address work
when used with "in_context".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27190 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 21:46:10 +00:00
Jérôme Duval
2aa5367afb extended debug check for FS_CALL() to others FS_CALL() versions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27189 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 19:52:10 +00:00
Jérôme Duval
8cf7754bc7 added a check in FS_CALL() for null hooks in KDEBUG mode
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 19:26:51 +00:00
Ingo Weinhold
de5fcb8ab4 * The IOScheduler does not create as many operations as it can before
executing them. Doesn't really make any difference ATM.
* Handle B_BUSY returned by DMAResource::TranslateNext() correctly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 17:00:42 +00:00
Ingo Weinhold
025f7c3289 A DMABuffer doesn't have a fixed bounce buffer assigned anymore. We do
dynamically assign one when needed. Under the assumption that in most
cases a bounce buffer isn't needed, we can thus prepare a lot more
operations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27185 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-24 16:57:31 +00:00
Ingo Weinhold
ded820241d Added optional debug facility (can be enabled by defining
TRACK_PAGE_USAGE_STATS): The page daemon tracks the distribution of page
usage counts. Can be printed using the "page_usage" command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27182 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 23:41:44 +00:00
Ingo Weinhold
aacb158ca2 * The LIMIT_AVAILABLE_MEMORY macro can be defined to limit the amount of
RAM Haiku uses (for debugging purposes).
* "page_stats" prints some more infos now.
* page_writer():
  - Moved the low_resource_state() invocation out of the inner loop.
    Reduces lock contention on the sLowResourceLock recursive lock.
  - Additional debug output: Every 1024 written pages the page writer
    prints a message.
* steal_pages(): Addressed the TODO: When there should be pages to
  steal, but we can't get them ATM, we now timeout on the free pages
  condition variable instead of snoozing unconditionally, so that we
  wake up earlier when someone frees pages in the meantime.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 23:38:59 +00:00
Ingo Weinhold
ed43619500 * vm_page: Swapped members usage_count and wired_count. We lost 4 bytes
due to alignment padding before.
* Reorganized merging of caches a bit. Renamed MergeStore() to Merge()
  and moved some more functionality into it. The method also moves the
  pages from source to consumer, now. This is necessary, since
  VMAnonymousCache needs to consider both physical pages and swap pages
  at the same time. Before we first moved the physical pages and the
  swap pages later, which was broken for two reasons: (1) A swap page in
  the consumer cache shadows a physical page of the source cache, which
  we ignored. (2) A source cache's physical page that also had a swap
  page would lose the latter in the process when moved to the consumer
  cache, i.e. if the page was not marked modified, it could be stolen
  and its data would be lost.

These changes improve the situation when building Haiku with 256 MB RAM
in that jam doesn't crash anymore, but in my test the system became
totally unusable after about an hour or 7000 targets (GUI froze). For
some reason it didn't manage to free pages anymore although swapping
heavily.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 19:01:01 +00:00
Ingo Weinhold
fa2fa606af Added kernel tracing for the swap support.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27178 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 14:54:28 +00:00
Ingo Weinhold
79b5db483c Enhanced scheduler tracing. The reschedule tracing entry does now record
more information of the unscheduled thread, namely its new state and, if
waiting, also the object it is going to wait on. When scheduler tracing
level 2 is enabled, additionally the address where the thread was
preempted is recorded. The latter could be interesting for analyzing
race condition bugs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 00:12:27 +00:00
Ingo Weinhold
982413718d Improved the "ls" command:
* It can now also lookup userland symbols.
* By respecting the currently debugged thread it smoothly cooperates
  with the "in_context" command. IOW it can lookup symbols in any team.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27167 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-23 00:05:16 +00:00
Ingo Weinhold
0739b87ee9 * Added arch_debug_get_interrupt_pc(), which is supposed to return the
PC of the innermost iframe.
* The "in_context" command does now set the currently debugged thread
  respectively.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27166 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:59:21 +00:00
Ingo Weinhold
ec16be9366 Added i386_get_current_iframe(), returning the innermost iframe, if any.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:55:43 +00:00
Ingo Weinhold
290e3dd228 Introduced the notion of a currently debugged thread in the kernel
debugger and added respective getter/setter methods
debug_{get,set}_debugged_thread(). By default the currently debugged
thread is the thread that dropped into the kernel debugger, but commands
like "in_context" can change it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:54:49 +00:00
Ingo Weinhold
07569b03c9 * Added kernel private thread_state_to_text() which just calls
state_to_text().
* state_to_text() can now deal with a NULL thread argument.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 23:51:22 +00:00
Ingo Weinhold
757f253a2d Added "in_context" debugger command. It takes a thread ID and a command
line and executes the command line in the context of the specified
thread. E.g. "in_context <thread> db <addr>" allows to read memory from
a team that is not active ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27156 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 15:42:27 +00:00
Ingo Weinhold
0deddbe36c Added function parse_next_debug_command_argument(), which parses the
first command line argument of a given command line string.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 15:38:57 +00:00
Ingo Weinhold
16cfc87748 * Added option "-s" to the "thread" command, which prints the info in
short form (like "threads").
* "thread" allows to specify more than one thread now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 14:29:00 +00:00
Axel Dörfler
23f09d5a66 * unload_module_image() was never called with image == NULL, so I just removed
that possibility.
* It now has a "remove" argument instead, that decides whether or not the
  image has to be removed from the hash still.
* Moved locking to put_module_image(), ie. both, {load|unload}_module_image()
  need to be called with the sModulesLock held now.
* module_init_post_boot_device() needs to remove the image from the hash itself,
  or else it messes up its hash iterator.
* check_module_image() could call unload_module_image() under certain
  conditions - but this was completely wrong, and could have caused crashes.
* search_module()/check_module_image() now keep a reference to the module
  image on success, thus a caller doesn't need to call get_module_image()
  again afterwards - this also fixes another round of potential module
  unloading to happen.
* That reference is leaked for built-in modules in get_module(), but it doesn't
  matter for them, anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27140 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 10:19:29 +00:00
Axel Dörfler
5a123e3591 * Added a post boot device module init function that unloads all unused modules,
as they aren't unloaded when there is no boot device yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27136 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 09:41:10 +00:00
Stefano Ceccherini
dcd8c085ed The actual implementation of HPET timers (not used yet, as it seems not to work correctly), by Dustin Howett (GSOC)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 09:34:19 +00:00
Axel Dörfler
29336cb02b * Most modules were never unloaded due to a bug in put_module().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:35:22 +00:00
Stefano Ceccherini
0fce483f9c fix the build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27132 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:22:13 +00:00
Stefano Ceccherini
17d39c90b1 code for initializing hpet in the bootloader. Moved around some hpet definitions. HPET initialization is commented out, at the moment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:15:14 +00:00
Axel Dörfler
2fd4fdcf3b * Changed the way fix_dirent() copies the entry: it will now copy the complete
dirent without the name first, and will then check if the d_reclen member
  is valid before copying the name.
* This shows the problem with the FAT file system that was revealed by r26859.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 08:02:38 +00:00
Stefano Ceccherini
521a945c90 (part of) a patch by Dustin Howett (GSOC) which implements HPET timers. I'm committing this work split in small patches, since HPET timers aren't working correctly yet, and I won't commit the parts which don't work.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 07:57:50 +00:00
Ingo Weinhold
5540989032 Squashed a TODO: The global swap hash table is no longer resized
synchronously; we use the resource resizer instead. This avoids another
potential deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27123 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 01:15:18 +00:00
Ingo Weinhold
77b93362c2 * Refactored the kernel daemon code into a class.
* Added a second kernel daemon service, resource resizer, which is
  mainly supposed to be used for resizing allocations asynchrounously.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 01:13:18 +00:00
Ingo Weinhold
7ce72b986c * Implement CACHE_DONT_SLEEP partially. At least for small object caches
without object depot it should be complete. For the other stuff
  internal_alloc() would need to pass the flag on to block_alloc(), but
  that isn't possible yet.
* Adjusted the low memory handler to respect the minimum object reserve
  of the object caches.

The swap_test_heap test does seem to pass reliably with 128 MB RAM and
128 MB allocation, now. It's quite slow, though. Particularly while the
allocation is filled, the system is completely unusable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 23:02:08 +00:00
Ingo Weinhold
1e90630527 * Added a "flags" parameter to vm_create_anonymous_area() and
create_area_etc().
* When the new flag CREATE_AREA_DONT_WAIT is specified, the functions
  don't wait for memory or pages to become available. They fail
  immediately instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 22:50:11 +00:00
Ingo Weinhold
2e8e6c9c6e Introduced vm_page_try_reserve_pages(), which fails when not enough
pages are free ATM.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 22:43:52 +00:00
Axel Dörfler
729e189a48 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 20:31:18 +00:00
Ingo Weinhold
6cc522252e Patch by Zhao Shuai with some changes by myself: Some optimization of
_SwapBlockBuild() and _SwapBlockFree().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27107 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 13:52:42 +00:00
Ingo Weinhold
4f2d40ec1b * The callback object created in WriteAsync() was never deleted. Thus
eventually the VIP heap would be exhausted.
* WriteAsync() didn't call the provided callback when an error occurred
  before invoking vfs_asynchronous_write_pages(). The page writer would
  get stuck in those cases.
* The object cache used for the swap blocks does now use the
  asynchronous resizing feature to avoid deadlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27101 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:28:35 +00:00
Ingo Weinhold
1cda5944ad Added object_cache_set_minimum_reserve() which sets the minimal number
of free objects an object cache should try to have ready. If the number
of free objects drops below the threshold, a new urgent priority thread
is asked to asynchronously resize the object cache (pretty similar to
the heap grower thread). Such a mechanism is necessary for code paths
that are supposed to free pages, but may need memory themselves (like
the swap support).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:21:37 +00:00
Ingo Weinhold
17331a1768 * IOBuffer::Delete(): Check for NULL pointer. The IORequest destructor
calls the method unchecked, and the buffer can actually be NULL, if
  Init() failed.
* panic() when running out of VIP memory, at least when KDEBUG is
  set.
* Use heap_set_get_caller() for the VIP heap, so the heap leak checking
  produces useful caller addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:11:47 +00:00
Ingo Weinhold
4a40451dd9 The "symbol" command does now set its return value to the symbol
address, so it can be used in expressions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27098 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:05:26 +00:00
Ingo Weinhold
9e637a6a84 * Added heap_set_get_caller() which can be used when heap leak checking
is enabled to set a per-heap get_caller() function.
* Added "-h <heap>" option to the "allocations_per_caller" command. If
  given only the allocation for the specified heap are considered.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27097 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-21 03:04:12 +00:00
Axel Dörfler
2a1a5a296f * Turned off debug output of the FileMapDisk stuff.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27091 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-20 20:44:29 +00:00
Axel Dörfler
8b7a165ad3 * We still lose information, so I enlarged this buffer a bit more.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27090 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-20 20:43:03 +00:00
Axel Dörfler
7a253cf5fe * Since the file cache can access any kind of data (and not just file data),
we must use {read|write}_pages() instead of {read|write}().
* This should fix accessing other file systems than BFS (ie. those that doesn't
  have an io() function) like ext3 and FAT.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27088 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-20 20:22:06 +00:00
Ingo Weinhold
aab58d8730 Implemented (a simple) WriteAsync(), i.e. swap pages are now written
asynchronously, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27077 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-20 11:44:23 +00:00
Axel Dörfler
4bfeb6f37a * Changed the way how a cache is destructed: now, it is removed from the
global cache list before locking it. This allows to get rid of the
  block_cache::deleting field, as well as simplifies some code.
* This also fixes a possible deadlock I recently introduced (on destruction,
  the locking order was wrong).
* Now uses an anonymous condition variable instead.
* Moved the block_cache initialization code into a dedicated method that will
  now also fail in case the low resource handler couldn't be registered (as
  pointed out by Salvatore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-20 08:09:18 +00:00
Ingo Weinhold
c9b064de56 * Added "swap" debugger command printing some info on the swap space.
* Fixed lock leak in Write().
* Fixed bug in _Commit(): swap_space_reserve() was fed with the wrong
  value (could even be negative).
* swap_free_page_swap_space(): Removed incrementing of sAvailSwapSpace.
  The function is only supposed to deallocate swap space, not to
  unreserve it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 23:43:41 +00:00
Ingo Weinhold
5c8d420b7c * Added "bool wait" parameter to _GetOperation(). If false and no unused
operation is available ATM, it will return NULL.
* _Finisher() does now re-schedule a request, if all of its operations
  finished successfully, but there are still remaining bytes.
* _Scheduler() does now operate in two passes. First it creates as many
  operations for a given request as possible, then it executes the
  operations. This fixes bug #2644. The problem was that by creating and
  executing the operations in a single loop, an operation could be
  finished before the next one was added. The request would thus be
  considered finished and the request owner be notified. This would
  usually lead to the destruction of the request while it was still in
  use.
* _Scheduler(): In case we don't have a DMA resource also advance the
  request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27070 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 21:37:16 +00:00
Ingo Weinhold
16d07755e4 * IOBuffer does now track whether its memory is locked.
* Moved memory unlocking from IORequest::OperationFinished() to
  IORequest::NotifyFinished(). This way we can reschedule a request,
  e.g. if we didn't have enough unused IOOperations at hand the first
  time.
* Added some more debug output and asserts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 21:17:36 +00:00
Axel Dörfler
60642f8781 * The EDID info is now only dumped if TRACE_VIDEO is defined (currently the
default).
* Enlarged the serial buffer that is handed over to the kernel to 8192 bytes.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 18:37:30 +00:00
Axel Dörfler
a1f34e7e89 * Only remove the block cache from the list, and its low resource handler when
this is actually needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 11:30:14 +00:00
Axel Dörfler
1d136d5a76 * Fixed bug #2631 based on a patch by Salvatore: the block cache was put into
a global list before it was fully initialized.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 08:40:55 +00:00
Ingo Weinhold
7fd3b44794 Patch by Zhao Shuai with small changes by myself:
* Some renaming: A location in a swap file where a page can be stored is
  now called "slot" instead of "page" or "swap page".
* swap_slot_alloc(): Update the hint more correctly after allocating
  slots at the hint.
* swap_space_reserve(): When less than the requested space could be
  reserved, it always returned 0 and leaked the remaining pages.
* swap_file_delete(): sSwapFileListLock wasn't unlocked in error cases.
  Use MutexLocker now.
* swap_free_page_swap_space(): sAvailSwapSpace wasn't updated.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27057 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 00:32:54 +00:00
Ingo Weinhold
2a79a7686f * VMCache::Write(): Added "uint32 flags" argument which is supposed to
be passed on to the IORequest. Most relevantly physical pages can now
  be written directly by passing B_PHYSICAL_IO_REQUEST.
* Added VMCache::WriteAsync() which is supposed to write pages
  asynchronously. The base class version version falls back to the
  synchronous Write(). Only VMVnodeCache implements WriteAsync() ATM,
  VMAnonymousCache (swap support) still has to be adjusted accordingly.
* write_page() doesn't need to map the page anymore as it can write the
  physical page directly.
* Modified the page writer to write pages asynchronously. This shouldn't
  have any noticeable effect yet. It will though as soon as the I/O
  scheduler reorders I/O operations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 23:28:34 +00:00
Ingo Weinhold
663948966c Added method vfs_asynchronous_write_pages(), which, unsurprisingly,
writes the given page iovecs asynchronously. The new class
AsyncIOCallback is used to inform the caller when the request has been
finished.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 23:09:10 +00:00
Ingo Weinhold
80048d7de3 * Added B_DELETE_IO_REQUEST flag, which causes the IORequest to be
deleted automatically when it's finished.
* Added IORequest::Create() for creating a IORequest on the heap
  (respectively the VIP heap).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27054 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 22:59:56 +00:00
Axel Dörfler
5bfb703b6f * Try to create unknown devices before failing in RegisterDevice(), and
RegisterPartition().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 17:57:03 +00:00
Ingo Weinhold
ff388d5189 DMAResource::TranslateNext(): Fixed several bugs that could cause too
many bytes to be read/written, which, among other things, could trigger
an assert in the IORequest code:
* In case of a partial (i.e. non-block-aligned) begin, transferLeft was
  not adjusted correctly.
* The main loop was lacking a transferLeft check.
* Main loop: When finally using a bounce buffer, the unrestricted vec
  length was used as base length for the bounce buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 15:32:11 +00:00
Axel Dörfler
f15da085fb * Greatly simplified republish_driver(); it doesn't need to use the path_entry
stuff at all, anymore.
* Removed now unused get_device_for_path().
* unpublish_driver() now only deletes the device if unpublishing actually
  worked out okay.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27038 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 12:36:27 +00:00
Axel Dörfler
8ec35e364a * Forgot to set the BaseDevice inode ID; devfs_unpublish_device() now works
as intended.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 12:34:47 +00:00
Axel Dörfler
c35ab0c38d * Added new devfs_unpublish_device() that gets a BaseDevice instead of a path.
* Added inode ID member to BaseDevice to make this possible.
* Removed unused and unmaintained legacy_driver::devices_published field.
* Implemented legacy driver's unpublish_driver().
* Reenabled legacy driver reloading on changes.
* Renamed devfs_driver_{added|removed}() to driver_{added|removed}(), and
  made them private.
* Simplified deletion of device_node lists (no need to use an iterator here),
  added device unpublishing.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:07:47 +00:00
Axel Dörfler
320bd2bd5a * More specific error message when relocating fails.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-18 11:03:50 +00:00
Axel Dörfler
8b97187793 * Adds the _kunlock_node_() syscall obviously used by p4. This should fix
ticket #2626.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 20:35:05 +00:00
François Revol
a4de1ff695 Fix style, ok now ?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27009 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 18:01:32 +00:00
Axel Dörfler
de4daffba0 * Fixed bug #2616, preparseDate() would clear the elements array beyond its
maximal size.
* Turned off debug output accidently enabled with the last commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27006 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 15:00:25 +00:00
Axel Dörfler
e6a9c269be * Style cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27005 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 14:58:36 +00:00
François Revol
f4bf90f7ce We're actually using serial input for KDL for now...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 02:11:32 +00:00
François Revol
038a21940d Fix building with TRACE on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 23:47:20 +00:00
François Revol
2a1458104d Avoid mounting images inside images (inside images (inside images...)).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 22:23:10 +00:00
Salvatore Benedetto
6ae7f6879f * Reworked the way sem_undo requests are processed by following
Ingo suggestions: instead of having one global sem_undo list,
  we now have two local list, one per semaphore set and one per team
  which is held in its xsi_sem_context structure, along with a mutex.
  A mutex has also been added to the semaphore set class in order to
  protect the local list, but also in order to (hopefully) improve
  concurrency.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 18:20:54 +00:00
Michael Lotz
ee8d227588 * Update the size of the safemode settings "file" when concatenating it with
the kernel settings. Settings that were checked in the kernel (like on-screen
  debug output) didn't work anymore, because when handing the settings over to
  the kernel it would have copied only the old size part of the safemode file.
* Add a newline when the kernel and safemode settings are combined. Otherwise
  the first safemode and last kernel setting would get lost if the kernel
  settings file didn't end with a newline.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26992 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 18:06:52 +00:00
Axel Dörfler
63c96ae5a5 * Added find directory constants B_{BEOS|COMMON|USER}_DATA_DIRECTORY, which
currently points to /etc for the system, and dedicated "data" directories
  for common/user (the system directory should get a dedicated "data", too,
  though).
* Added B_USER_CACHE_DIRECTORY (in config/cache).
* These additions were discussed some years ago, but I just had a good reason
  to use them :-)
* Coding style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-16 11:05:59 +00:00
Axel Dörfler
6dc27eba0c * As requested by POSIX, we now have PTHREAD_STACK_MIN, and PTHREAD_KEYS_MAX
defined in limits.h.
* This closes ticket #2559.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26982 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-15 15:00:26 +00:00
Ingo Weinhold
4431edd453 Patch by Zhao Shuai with minor changes by myself:
* Moved the static functions to the beginning of the file.
* Renamed several variables for more clarity, particularly
  offset/cacheOffset to index/pageIndex in case where the unit is pages.
* _SwapBlock{Build,Free}() can deal with a range of pages now, which
  should be more efficient.
* Additional checks/panics in swap_page_alloc().
* swap_file_add(): Wrong byte count was used when allocating and
  clearing the bitmap.
* swap_page_alloc(): Fixed off-by-one check. The last page of the swap
  file could not be used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 20:46:12 +00:00
Axel Dörfler
70e2d4ac43 * Replaced the B_BLOCK_DEVICE_* defines with B_DMA_* defines that better match
our dma_restrictions structure (but we're using blocks instead of bytes,
  since unlike the block size, the restrictions attributes are constant).
* We might want to use blocks for the dma_restrictions structure as well in
  the future...
* Fixed another bug in the device_node variant of DMAResource::Init(): the max
  segment size was specified in blocks as well.
* Removed the "hardcode" block_io module and header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 15:08:16 +00:00
Axel Dörfler
61b1a536e8 * Fixed the mix of bufferCount vs. max_segment_count with regards to
B_BLOCK_DEVICE_MAX_SG_BLOCKS as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 14:28:20 +00:00
François Revol
6a5919034d This makes the FileMapDisk code work. zbeos can now locate an haiku.image embedded within another one as BEOS/IMAGE.BE (that's just for testing, it will be used with FAT or ISO9660 later on). It starts to boot the kernel but crashes later, it will need an fmap driver anyway.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26970 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 02:10:31 +00:00
Ingo Weinhold
4141741265 * Added new(vip_io_alloc) operators allocating memory from the VIP I/O
heap.
* Allocate IOBuffers, IORequests, and cookies on the VIP I/O heap, if
  necessary.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 01:38:08 +00:00
Ingo Weinhold
749facf1eb Extended the "heap" debugger command to allow specifying the address of
the heap to print infos about.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26968 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 01:35:31 +00:00
Ingo Weinhold
d88a145e9e Added an allocator providing memory associated with VIP (i.e. page
writer) I/O requests. Not used yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 00:44:05 +00:00
Ingo Weinhold
f3e82cfe42 * Instead of a heap class index heap_create_allocator() gets an actual
heap_class object now. Removed unused heap_allocator::heap_class.
* Made heap_class, heap_create_allocator(), heap_memalign(), heap_free()
  public, so that a specialized allocator can be used elsewhere in the
  kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-14 00:40:40 +00:00
Axel Dörfler
6776de960b * Made the relocation more robust against incorrectly built images.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-13 23:20:18 +00:00
Ingo Weinhold
c91868ae1d * Introduced common base class SchedulerTraceEntry for the scheduler
tracing entry classes.
* Added new "scheduler" command, available when scheduler tracing is
  enabled. It analyzes the tracing entries for a given thread and prints
  scheduling statistics for that thread. Should hopefully help to
  understand the poor scheduling latencies in certain cases.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26956 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 21:23:16 +00:00
Ingo Weinhold
ef7102fa29 * Made TraceEntryIterator available in the kernel.
* Fixed TraceEntryIterator::Current(): If fEntry was NULL, it would
  return 0x4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26955 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 21:16:15 +00:00
Ingo Weinhold
46ec230162 When in the kernel debugger we do now record the relevant information
(fault address, pc, read/write) when a page fault occurs, and print them
in case this caused the termination of a debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26949 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:09:42 +00:00
Ingo Weinhold
3b99126c1e Fixed table columns alignment in the "threads" command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 17:03:43 +00:00
Rene Gollent
fb6d782320 Fix some style issues pointed out by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 12:41:10 +00:00
Ingo Weinhold
dce8d473d5 When freeing the swap space associated with a page, the page must be
marked modified again, so that we don't lose its data when someone
decides to steal it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26939 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-12 00:08:33 +00:00
Ingo Weinhold
95accc28f8 Patch by Zhao Shuai with small changes by myself: The page daemon does
now also free swap space assigned to pages that are rather active.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26938 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 23:55:30 +00:00
Rene Gollent
3734bee77d When the boot loader goes to load its settings files, it will now also prepend the "kernel" settings file to the safe mode settings if it exists. This allows settings from kernel/drivers/kernel to be respected early in the boot process as well, which allows us to do things like disable_smp permanently instead of having to pick from the safe mode menu every single boot. Review welcome.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 23:03:36 +00:00
Axel Dörfler
3d3fe5a58c * Added tracing support to our scheduler to be able to do better diagnosis
with scheduling problems.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 10:20:16 +00:00
Ingo Weinhold
5409ef46f6 Squashed TODO: Clone the image list on fork().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-11 00:30:00 +00:00
Ingo Weinhold
77acd7fece Patch by Zhao Shuai with some changes by myself:
* Added functions swap_free_page_swap_space(), swap_available_pages(),
  and swap_total_swap_pages(). They will be used by the page daemon
  code.
* Free allocated swap space in the VMAnonymousCache destructor.
* Write(): First free swap space assigned to the pages to be written
  (was leaked before) and update fAllocatedSwapSize upfront. Both is now
  done with the cache locked, as it should be.
* Fixes several instance where the cache offset in bytes was used
  instead of in pages.
* Print the correct error when _kern_write_stat() fails.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 23:46:00 +00:00
François Revol
0bdaf02821 Start of a file map disk driver for the bootloader.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 01:24:01 +00:00
Ingo Weinhold
2fc2b436d2 Another hard code (DMAResource::TranslateNext()) fix: In the write case
if after the main loop the transfer is already block aligned, we still
have to check whether the last vec is a bounce buffer that is shorter
than a complete block, but exceeds the original end of the request. If
so, we have to cut back to the previous block and add a block-sized
bounce buffer instead. Actually that's almost the same case as when the
transfer length is not yet block aligned, and thus we let the same code
handle it. Fixes bug #2584.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26910 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 00:44:30 +00:00
Ingo Weinhold
a3afb5ee0d Handy on-demand debug tracing, I've used a few times already. So I leave
it commented out in the code for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-10 00:23:35 +00:00
Axel Dörfler
ed0303d19d * When creating the physical vector array, we did not advance "base" in the
loop.
* This is probably the cause for file corruptions as well as bug #2595; will
  have another look tomorrow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-09 21:27:24 +00:00
Ingo Weinhold
b328324d19 DMAResource::TranslateNext(), in case of given physical vecs:
* segmentCount was potentially set incorrectly. It could be too big,
  since we considered all vecs, not only those remaining.
* The main loop condition was incorrect. This would lead to too few
  DMABuffer vecs (or none at all) for any but the first IOOperation of a
  request. Should fix #2586.
* Correctly offset by vecIndex in debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 23:15:21 +00:00
Axel Dörfler
ae9067b364 * Fixed PXE boot loader build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 15:23:44 +00:00
Ingo Weinhold
90cd1b25e1 vm_remove_all_page_mappings(): Decrement the mapped pages count only, if
the page was really mapped before. Fixes bug #2585.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:01:09 +00:00
Ingo Weinhold
e387dd151b "page_stats" does now also print the number of mapped pages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-08 14:00:07 +00:00
Ingo Weinhold
a9d7be0708 * Implemented mprotect(). A vm_area does now have an optional array
specifying the protection of each page (4 bits per page).
* Added no-op implementation of posix_madvise().
* Replaced a few "addr_t size" parameters by "size_t size".


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


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-07 14:23:44 +00:00
Ingo Weinhold
3394ebd3c2 * Improved some output and coding style.
* If a segment violation occurs, we do now check whether the thread in
  question has a handler for SIGSEGV. If so, we just send it the signal.
  Otherwise we notify the debugger as before.


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


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26838 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 08:01:07 +00:00
Ingo Weinhold
8d12bd1370 * Moved the incrementing/decrementing of vm_page::wired_count into
dedicated functions.
* Introduced gMappedPagesCount variable which counts the total number of
  physical pages that are mapped.
* Added vm_page_get_stats() which fills in the memory related part of
  the system_info structure. Used and cached pages are computed
  differently, now. The "available" (== not committed) memory is no
  longer used for the computation as it doesn't say anything about the
  actually used/free pages (with swap support enabled it is even
  less meaningful, since we first commit swap space when possible).
  We do also consider the memory used by the block cache as cached
  pages, now. All in all these changes should fix the memory statistics
  reported by get_system_info(), IOW bug #2574.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:28:28 +00:00
Ingo Weinhold
c79e66abb7 Added block_cache_used_memory() that returns the memory allocated by all
block caches for the block cache buffers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:09:31 +00:00
Ingo Weinhold
5db876653b Added object_cache_get_usage() function that returns the memory
allocated by an object cache.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-06 00:07:55 +00:00
Jérôme Duval
43619079f8 sManagedEnviron is already checked for NULL value in free_variables()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 22:06:21 +00:00
Axel Dörfler
39b5c37418 * Added a DMAResource::Init() method that gets a device node - for now, it will
reuse the block_io attributes in the node to build the dma_restrictions.
* DMAResource::Init() now dumps the dma_resources (should be done with the
  TRACE() macro later).
* Turned off IOScheduler debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 21:00:02 +00:00
Axel Dörfler
8169e6b4e6 * Patch by Andreas that adds sched.h, and sched_yield() to Haiku.
* This closes ticket #2568.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:54:14 +00:00
Ingo Weinhold
57f2b5a013 * Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not
include the guard pages. Adjusted the kernel and boot loader code
  accordingly -- the guard pages size is added/not removed respectively.
  The stack size passed to _kern_spawn_thread() is now the actually usable
  size, and it is no longer possible to specify a size smaller than or
  equal to the guard pages size.
* vm_create_anonymous_area(): Precommit two pages maximum -- a stack with
  only one page usable size obviously doesn't need two pages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:19:46 +00:00
Axel Dörfler
afa9fe8958 * Patch by Andreas: we did not store ebp in vregs::ebp, and we did not store
ebx at all.
* This fixes bug #2569.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26818 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 17:13:06 +00:00
Axel Dörfler
c569fd76b4 * Coding style cleanup, pointed out by Andreas.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 13:57:14 +00:00
Salvatore Benedetto
79f556e5a6 * Check for wake ups on Revert()
* Fix TRACE() output
* Check for IPC_CREAT in xsi_semget when IPC does not yet exist
* Fix bound checking
* Fix setpid call



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-05 09:44:36 +00:00
Ingo Weinhold
3f075fe6b5 We must not do any kernel exit work when we originally didn't come from
userland. E.g. preparing a signal handler would terribly go wrong, since
we don't have a userland iframe. This fixes bug #2562 and maybe also
#2522.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26810 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 21:53:10 +00:00
Ingo Weinhold
2a24bab833 arch_setup_signal_frame(): panic() if we don't have a user iframe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 21:49:11 +00:00
Ingo Weinhold
5ccf1db34d * Also print whether an iframe is a userland or kernel iframe.
* In case of a kernel iframe the iframe is shorter -- fixed the output
  accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 21:47:37 +00:00
Axel Dörfler
4468706ca3 * Now uses _kern_write_stat() directly in order to resize the swap file
without filling it with zeros (ie. make use of B_STAT_SIZE_INSECURE).
* Added TODO that closing the file descriptor in swap_init_post_modules()
  (that should probably renamed to swap_init_post_boot_device()) is not really
  a good idea.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26797 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 16:10:25 +00:00
Axel Dörfler
423fcd43ae * Shuffled initializers around: the team, ELF, and module initializers come
now a lot earlier.
* That makes it now possible to use modules pretty early in the kernel (like
  before timer_init(), or int_init_post_vm()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26790 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 13:26:13 +00:00
Axel Dörfler
cc0b310748 * We're now using an anonymous condition variable for the team's dead children
instead of publishing it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26789 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 13:09:40 +00:00
Axel Dörfler
3c1a3047a4 * Added file_cache_is_enabled() function.
* Added file_map_set_mode() function that you can use to keep a whole file
  cached. This is needed for the swap file support: FILE_MAP_CACHE_ALL will
  not only precache all file_io_vecs when called, but it will also cause all
  file_map_translate() calls to fail that would require further caching (ie.
  if the file size had changed).
* Updated the fs_shell file map code to the latest one (with several bug fixes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 08:28:17 +00:00
Ingo Weinhold
355604212d Patch by Zhao Shuai with changes by myself:
* Keep track of the stack space actually allocated for the cache and let
  Write() fail when we've already allocated as much as reserved.
* Added second phase of swap initialization (swap_init_post_modules())
  which reads the virtual memory driver settings and creates/resizes a
  swap file. ATM truncate() is used to resize the swap file, but that is
  a bit slow. We should probably introduce a VFS function to use BFS's
  fast method.

This should make swap support work somewhat, but since swap space is
never freed ATM this would be a relatively short pleasure. Still
disabled by default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:28:46 +00:00
Ingo Weinhold
8eabecf603 Use kprintf() instead of dprintf() in debugger commands.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:19:54 +00:00
Ingo Weinhold
7491000f20 Added functions file_cache_{disable,enable}(). They allow to disable
actual caching in the file cache, i.e. all reads and writes go directly
to the underlying device. The implementation is not quite complete,
since the VM can still add pages to the cache when the file is mmap()ed,
which can lead to inconsistencies.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:15:50 +00:00
Ingo Weinhold
40d9ff3ae4 Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26777 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 03:02:25 +00:00
Ingo Weinhold
be87a4934e do_iterative_fd_io():
* When do_iterative_fd_io_iterate() fails, we must not invoke the
  supplied finished hook explicitly, since it is invoked indirectly by
  request->SetStatusAndNotify() anyway. Should fix #2557.
* We must detach the descriptor putter as soon as we have adjusted the
  request's finished callback, since that will put the descriptor.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26776 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:57:03 +00:00
Ingo Weinhold
bca3215f8a * Introduced x86_get_double_fault_stack(), which returns the address
and size of the double fault stack.
* is_kernel_stack_address() does now also check whether the given
  address is on the double fault stack. This fixes stack traces on
  double faults, which were broken (i.e. went only to the double fault
  iframe) since we started checking whether the addresses are on the
  kernel stack at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26775 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:51:38 +00:00
Ingo Weinhold
39ec9b48bd vm_page_fault(): Only put the address space, if we actually got one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:46:07 +00:00
Ingo Weinhold
1a617f516a More informative panic().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26773 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:45:06 +00:00
Ingo Weinhold
d3e2a6d7cc Fixed build with tracing enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26772 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 02:43:48 +00:00
François Revol
d3e9ddff8a - fix arch_debug_get_caller()
- implemented arch_debug_get_stack_trace(), should allow building with TRACING enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26771 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-04 01:30:33 +00:00
François Revol
eec73aabb7 - fix page dir index
- fix comment
- mode debug output
- don't lookup unmapped pages in early_query


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26770 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 19:53:09 +00:00
François Revol
d06c88d37d Just go for 256MB for transparent translation at boot, 32MB is not enough anyway yet, the kernel wants 16MB just for the heap.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26768 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 19:18:56 +00:00
François Revol
39eb52d83b Implemented keyboard input for KDL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26758 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 15:57:03 +00:00
François Revol
7b22dac921 Handle new semantics on map_max_pages_need.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 12:09:23 +00:00
Ingo Weinhold
5054db1859 * Use vfs_vnode_io() to schedule subrequests instead of calling the FS's
io() hook directly (it might not even have one).
* Fixed incorrect check in synchronous_io() which would cause requests
  with more than one vec to finish early. Fixes bug #2558.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 01:55:25 +00:00
Ingo Weinhold
58306fecd6 * Added tracing for vfs_{read,write}_pages).
* {read,write}_pages() use vfs_{read,write}_pages() now, instead of
  invoking the FS {read,write}_pages() hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 01:48:10 +00:00
François Revol
e07a1266f0 Start of boot video mode support. Not finished.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-03 01:40:57 +00:00
Ingo Weinhold
70ce6a9ade Don't allow the kernel team to be passed to
elf_debug_lookup_user_symbol_address().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26747 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 23:56:26 +00:00
Ingo Weinhold
a9d458d8db Also init kernel_stack_top for the idle threads. It was NULL before,
which caused stack traces in those threads to crash.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 23:50:14 +00:00
Ingo Weinhold
771491bec8 The command line args can easily exceed the maximal tracing buffer
allocation size, which caused the Exec traced entry to crash when
printed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 23:48:29 +00:00
Ingo Weinhold
7cc9a52df8 IORequests leaked their IOBuffers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26742 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 20:51:59 +00:00
Ingo Weinhold
c421c138b6 vm_create_anonymous_area():
* Moved reservation of memory for the "locked" cases upfront.
  Particularly if the would-be area is a kernel area, we don't want the
  address space to be write locked while doing that, since that would
  block the low memory handler.
* For full lock areas the pages are reserved upfront, too. The reasoning
  is similar. Reserve the pages needed by the translation map backend for
  mapping the area pages there too.
* Moved the cache locking/unlocking out of the individual cases. All
  want to have the cache locked the whole time, now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26741 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 20:24:41 +00:00
Ingo Weinhold
802d18a970 Small semantical change of map_max_pages_need(): If given a 0 start
address, it is supposed to consider the worst case address range of the
given size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26740 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 20:11:11 +00:00
Axel Dörfler
0d6a27ae0a * thread_preboot_init_percpu() sets the current thread pointer with a mostly
empty thread structure. This causes the thread::team pointer to be NULL
  during the early boot process, but our kernel debugger didn't like that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26735 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 16:25:16 +00:00
Axel Dörfler
c0275e9556 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26734 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 16:23:22 +00:00
Axel Dörfler
011d716270 * Removed the feature_string from the cpu_ent structure.
* Dumping the features as string is now a one time thing, that only happens
  when DUMP_FEATURE_STRING is defined to 1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26733 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 15:50:50 +00:00
Axel Dörfler
6bf26da228 * Renamed sem_spinlock to sSemsSpinlock.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26732 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 15:04:47 +00:00
Axel Dörfler
272457553e * Renamed kernel_startup to gKernelStartup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 15:03:03 +00:00
Axel Dörfler
15374c5dbd * Renamed thread_spinlock and team_spinlock to gThreadSpinlock and
gTeamSpinlock.
* Renamed the static global variables in smp.c to match our style guide.
* Minor other cleanup.
* Removed superfluous white space.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 14:55:53 +00:00
Axel Dörfler
11790544cd Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 14:52:18 +00:00
Salvatore Benedetto
51daeb7147 - Fixed warnings
- Fixed deadlock in xsi_sem_undo - RecordUndo
- Fixed issue in xsi_sem_undo: if the semaphore set does not exist
anymore, ignore the request but do remove the process from the sUndoList,
which wasn't previously done.
- free() in ClearUndos was called with interrupts disabled
- when a semaphore set ends to exist, remove all it's sem_undo request as it's ID
will be reused in the future.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 11:30:55 +00:00
François Revol
64ea0b9f74 - fix early_map
- iospace should now be initialized correctly, at least the kernel goes much further.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26726 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:39:31 +00:00
François Revol
2fc21d4fad Use a bool to check if an irq was acknowledged by the MFP, else we don't call the handler.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26725 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:36:33 +00:00
François Revol
150b5ae01f - don't movem a7, it's the stack pointer. the cpu saves it for us before processing exceptions.
- push the address of the iframe before calling the C handler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:34:40 +00:00
François Revol
b061bf2471 cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-02 00:31:19 +00:00