Commit Graph

3496 Commits

Author SHA1 Message Date
Michael Lotz
b7204bd774 Make the swap hash lock into a rw_lock to reduce lock contention a bit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33622 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 17:24:59 +00:00
François Revol
6c21b53416 This should fix m68k build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33619 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 16:01:10 +00:00
François Revol
c9f536d7b1 Fix ARM build, thx Axel :P
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 15:26:58 +00:00
Axel Dörfler
e0d8627a73 * When you pressed ctrl-alt-del during the boot process, interrupts are disabled
when you enter arch_cpu_shutdown(), so you must not try to load the ACPI
  module to reboot. DaaT, that should fix the problem you showed me.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33617 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 14:59:26 +00:00
François Revol
8be612127e When debugging interrupt handlers is enabled, keep count of handled irq for each handler, to ease tracking which driver is unfriendly to others for shared irqs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-17 12:05:02 +00:00
Axel Dörfler
ec2719329c * Fixed timezones directory path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-16 08:26:56 +00:00
Axel Dörfler
3e236885ab * Replaced C with C++ files, should fix BOM's build problem, but will likely
introduce new ones I currently cannot check.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33602 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 15:10:01 +00:00
Axel Dörfler
358b93352e * Moved SIGABRT to the signals that kill the process. Not sure if it's a good
idea to always send SIGKILL to the main thread, though. I'm not really getting
  more insight by reading the POSIX specs.
* Anyway, in the mean time, this fixes bug #4784.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 11:53:19 +00:00
Axel Dörfler
f1488adbf7 * While r33037 fixed the alignment of areas put into reserved areas, it actually
broke their placement at the end of the reserved area, which was the main
  reason #4778 happened so often (it would have been more hidden else).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 11:35:31 +00:00
Axel Dörfler
4124f4801b * Reserved areas would also be created in existing reserved areas in case the
space was becoming tight. This actually fixes #4778.
* Fixed overflow problem in find_reserved_area().
* Cleaned up the test app, added license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 11:23:38 +00:00
Axel Dörfler
3066f3dbf8 * Reverted r33547, this closes bug #4782 - this is obviously a regression in
GCC4.
* Adapted code accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-15 07:48:31 +00:00
Axel Dörfler
d5a396a60b * r33037 broke the handling of reserved areas, more specifically, it ignored
the RESERVED_AVOID_BASE flag of those, and introduced a way to fill them
  from the start. This caused #4778.
* Turned IS_VALID_SPOT() macro into an inline function.
* Removed already resolved TODO comment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-14 07:53:45 +00:00
Axel Dörfler
ea95b4d03e * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-14 07:50:53 +00:00
Axel Dörfler
273dbd0916 * The network syscalls now check if you try to pass a non-userland address to
them (which you previously could use to easily crash/take over Haiku).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-13 07:19:18 +00:00
Axel Dörfler
361f5cdfaf * Build fix for the boot loader (it's now using the new utility functions as
well). Sorry!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 19:42:50 +00:00
Axel Dörfler
b74a098352 * Got rid of the duplicated functionalities provided by RWLocker.cpp, and
Locker.cpp.
* The services are now using recursive_locks, and rw_locks instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 14:29:05 +00:00
Michael Lotz
3bb69a8235 * Use mutex and rw_lock and the proper AutoLockers as in the kernel version, as
these interfaces are now available.
* Don't be quite so paranoid by default, the checks that are on by default
  should be enough to detect most memory corruptions.

This makes the debug heap way more usable, so much that you can even use it as
your normal everyday heap without noticing much performance impact (it has quite 
a bit of additional memory overhead though).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 11:29:25 +00:00
Michael Lotz
93b63126e1 Adding mutex and rw_lock with the same interface as the kernel versions to
libroot. The mutex is a simple benaphore, the rw_lock is pretty much the same
as the one from libkernelland_emu but uses a mutex per lock instead of emulating
a global thread lock. Also added MutexLocking and RWLock{Read|Write}Locking and
AutoLockers based on them. It's cased with __cplusplus so the locks are also
usable from C. Everything's currently exposed in shared/private/locks.h but I
think we should make these locking primitves public.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-12 11:19:33 +00:00
François Revol
dc33329747 First attempt at an Amiga boot sector, not yet working.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 20:28:44 +00:00
Bruno G. Albuquerque
891a50b2ae - Fix typo that broke the GCC4 build but not the GCC2 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 17:31:00 +00:00
Michael Lotz
7ebd7cfc40 Add a vm_page_allocate_page_run_no_base. It bases its search on the pages found
in the free and/or clear queue. This performs better in the case where only few
pages are free/clear but performs worse in the case where there are a lot of
usable pages. It's not used anywhere but it might come in handy one time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33527 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:55:21 +00:00
Michael Lotz
7a4d60459e Implement combining scattered physical pages using seperate iovecs in
PageWriteTransfer. This makes the transfer accept virtually contiguous pages,
where the offset is contiguous on either end of the current transfer, but where
the pages aren't physically contiguous. It will then add seperate iovecs for
these pages (32 at max right now). This reduces the number of IO requests
generated and allows for optimizations down the IO path (like in the physical to
virtual mapping case for example).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:52:19 +00:00
Michael Lotz
303727515e Virtualize the buffers using IOBuffer::GetNextVirtualVec(). This removes the
need for the IO -> InternalIO indirection as it is always fed virtual buffers,
which simplifies things a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:50:50 +00:00
Michael Lotz
32e2b6a118 Provide a way to directly request virtual vecs from an IOBuffer. If the buffer
is virtual already it just returns the vecs directly, if it is physical it takes
over the task of virtualizing the vecs either using vm_map_physical_memory_vecs,
if there are multiple vecs or more than one page, or falls back to page wise
mapping if mapping fails or is not needed. In the best case, scattered physical
pages are mapped into one linear virtual buffer so that subsystems operating on
virtual memory only get a single vector and can then burst read/write.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33524 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:49:44 +00:00
Michael Lotz
44778a8a28 Introduce vm_map_physical_memory_vecs. It is like vm_map_physical_memory but
takes a list of iovecs describing the physical pages to be mapped. With it one
can map a set of physically disjoint pages into one linear virtual range. This
is a private API right now, but we might want to make it public as
map_physical_memory_vecs alongside map_physical_memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33523 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-11 16:48:03 +00:00
Michael Lotz
1af7d11504 * Rework page writing to combine page writes where possible. For now the pages
are required to be physically contiguos, which should be reworked to put them
  into seperate iovecs. Still this manages to combine a great deal of page
  writes into larger bursts already. Reduces the amount of IO requests being
  scheduled (and greatly benefits media where page wise writes are slow when
  they are accessed through a non-IOScheduler path, i.e. USB mass storage until
  that is properly implemented).
* Abstracted per page page writing tasks into a PageWriteWrapper class.
* Abstracted per transfer page writing tasks into PageWriteTransfer class which
  formerly was the PageWriterCallback.
* Use both classes from the PageWriterRun and from
  vm_page_write_modified_page_range to remove code duplication.
* Adjusted synchronous VMAnonymousCache::Write() to cope correctly with larger
  iovecs and more than one iovec. It assumed that there was exactly one page per
  vector previously.
* Introduced MaxPagesPerWrite() and MaxPagesPerAsyncWrite() to VMCache to allow
  a cache to specify restricitions. VMAnonymousCache does restrict the max pages
  to 1 for WriteAsync right now as I didn't feel like reworking that one to cope
  with non single page writes just yet.
* Pulled out PageWriteTransfer methods for better readability.
* Some typo fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33507 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-10 22:37:26 +00:00
Michael Lotz
f3bd145c09 When the need for physical to virtual mapping arises because of emulating IO
reads or writes for old style drivers, map the physical memory at once. Since
USB is pretty much the only one affected and there small reads/writes are
exponentially slower, the performance gain of the burst transfer far outweighs
the additional overhead of the mapping. Still this could be further optimized
and will eventually be superseeded by also providing a physical memory API in
USB. For now it should bring back USB reads to an acceptable level. Writes are
still page wise though because of how writing back memory works in general.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-10 19:55:13 +00:00
Ingo Weinhold
aa6f54aa24 Amended the {user,debug}_strlcpy() fix: Due to the strlcpy() semantics to
always return the source string length, we can't really prevent an overflow
of the source address.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33489 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-09 03:07:11 +00:00
Michael Lotz
0b4d87da22 Add missing word in comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-07 13:29:19 +00:00
Axel Dörfler
ab7516c8f3 * Fixed a dead lock when drivers were scanned: we must not hold the devfs lock
when scanning for drivers, as that reverts the standard locking order with
  locks like the device manager lock. There is now a dedicated scan_lock for
  each directory.
* get_device_name() now locks itself which also adds a missing lock in the
  B_GET_PATH_FOR_DEVICE ioctl().
* Minor refactoring; the directory init code was duplicated over several places
  in the source file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 12:56:21 +00:00
Axel Dörfler
c0f44af061 * Fixed PXE boot loader build again (hey mmu_man!).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-06 09:25:35 +00:00
Ingo Weinhold
8a71915a9d Made the {debug,user}_{mem,strl}cpy() and user_memset() functions deal with
address overflows. Apparently at least the x86 string instructions generate
a general protection fault instead of a page fault, and we only use the fault
handler in the latter case (maybe we should change that, too). Fixes #4714.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33436 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-05 09:54:40 +00:00
Ingo Weinhold
8ad4a2e971 Improved comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33392 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 09:31:20 +00:00
Ingo Weinhold
d815bfef61 Fixed build with tracing enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 09:30:46 +00:00
Ingo Weinhold
37e6de5d4c Don't destroy tracing entries. This is not necessary and even harmful, if the
code is no longer loaded, e.g. when the module has been unloaded or the tracing
buffer was reattached from a previous session.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 04:38:19 +00:00
Ingo Weinhold
d6778355ee * <DiskDeviceTypes.h>: Removed kPartitionTypeIntel{Primary,Logical} constants.
* Added new header headers/private/system/disk_device_types.h, which defines
  the <DiskDeviceTypes.h> constants as macros and which can be used where the
  constants cannot be used. The constants are defined using the macros, so now
  there's only one place where the string literals should be specified.
* Use the macros in the partitioning systems. I was too lazy to also adjust the
  file systems -- most of them seem to hard-code the string literal yet.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:07:42 +00:00
Ingo Weinhold
a9689e8492 * VFS:
- Fixed vfs_get_vnode_from_fd() return type.
  - Added vfs_open_vnode().
  - Added a "bool traverseLeafLink" parameter to vfs_get_fs_node_from_path().
    It was always resolving symlinks.
* device manager/devfs:
  - devfs: get_node_for_path() no longer resolves leaf symlinks. That still
    doesn't help with file disk devices, as creating partition wouldn't work
    anyway.
  - Pulled the module-related implementation part of BaseDevice into new class
    AbstractModuleDevice and made all methods of BaseDevice virtual. Small
    adjustments to devfs to be happy with the new BaseDevice interface.
  - Added BaseDevice subclass FileDevice, which maps the interface to a file's
    file descriptor. Still got a few TODOs, but should basically work.
  - Use FileDevice for publishing file disk devices in devfs. Now those do
    actually work, though there's some BFS trouble with one of the images I
    tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:06:34 +00:00
Ingo Weinhold
3c4721f516 The B_DISK_DEVICE_IS_FILE flag is cleared by KDiskDevice and needs to be reset.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:04:32 +00:00
Ingo Weinhold
80ea5e3508 Fixed incorrect return value of _user_get_file_disk_device_path().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33382 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:03:56 +00:00
Ingo Weinhold
c51d6579e4 Fixed incorrect uses of user_{strl,mem}cpy() in the kernel debugger. This could
break stack traces.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:03:16 +00:00
Ingo Weinhold
be51dd0f4c Added debug_strlcpy() for use in the kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33380 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-10-01 03:02:34 +00:00
Ingo Weinhold
268335a069 After creating a userland thread we didn't set up the breakpoints for it.
Fixes #4665.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33369 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-30 08:40:55 +00:00
Stefano Ceccherini
fee1bc8eed Back to timer 2, since timer 0 doesn't work at all.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33368 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-30 06:34:15 +00:00
François Revol
858a20cab8 Patch by Vincent Duvert:
Remove the 4 cores limit at boot, and fix the allocator to handle 8 cores.
There are still performance problems, but this allows booting with 8 cores.
WARNING: since this changes x86 platform kernel args, you really don't want to update haiku_loader and kernel_x86 separately!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-29 13:07:10 +00:00
Stefano Ceccherini
ea40a61a84 Some big changes, still not working on my laptop, since hpet interrupts
aren't routed correctly over the 8259, it seems.
- Removed passing the hpet_regs around, since there's a static variable.
- Added lots of debug dprintfs.
- Fixed setting the timer interrupt to edge
- Timer is initialized once.
- Use the timer 0 instead of 2.
- Renamed register definitions to be more readable
- Use 64 bits registers and unions where applicable.
- Other things I don't remember


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-29 08:36:36 +00:00
Stefano Ceccherini
8593bcad87 Use the hpet defines in the source.
Also shortened some defines using "TN" instead of "TIMER". It's also
the same scheme used in the specs


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33334 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-28 13:14:16 +00:00
Stefano Ceccherini
1d958a301e Moved the "disable APIC" menu(s) to smp.cpp.
Also only enable them if there's an APIC.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33333 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-28 09:42:59 +00:00
Ingo Weinhold
ac106be534 Inherit the disable_debugger() flag to a fork()ed child. load_image() doesn't
-- I'm undecided whether it should, too. Fixes #4642.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-28 02:54:38 +00:00
Stefano Ceccherini
6dc4fd11a2 Uncommented the hpet timer from the timers list.
Lowered its priority of hpet timer so it doesn't get picked up first
(yet)
Changed the debug output to be conditional.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 10:48:37 +00:00
Stefano Ceccherini
6d92e80531 - Moved timer conversion to a method, and added LL to the conversion
factor to avoid compiler issues.
- Removed some useless and commented debug stuff.
- Now prints also the global HPET configuration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 10:36:39 +00:00
Stefano Ceccherini
4687d95b68 Renamed x86_hpet.c to x86_hpet.cpp and fixed the compile errors.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 09:50:32 +00:00
Stefano Ceccherini
8626c1aa5f the HPET timers resolution is REALLY high. The time conversion was off by
1000. XenServer boots correctly and in reasonable time,
now (meaning hpet timers work). I guess on real hw the bios doesn't
correctly program the hpet timers, so we'll need a bit more work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 09:49:02 +00:00
Stefano Ceccherini
9ea40f7802 Cosmetics.
XenServer actually boots (but slow as hell) with hpet timers enabled, real hardware does
not.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 08:29:42 +00:00
Stefano Ceccherini
dd9b76727d Enable hpet_init() in the boot loader. All it does is searching the hpet
table and mapping it if needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 07:06:58 +00:00
Stefano Ceccherini
d54e62b2c8 Added dumping the timer configuration, and the possibility to use any of
the hpet timer, not just the first 3.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-25 05:08:22 +00:00
Stefano Ceccherini
b1c4413c56 Turns out the selection sort algorithm was broken for more than... 2 entries,
if they were not already ordered. Or, to say id differently, it was completely
broken.
Luckily no one noticed....
Also disabled again printing the timers, since it could print not available ones.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-22 19:58:40 +00:00
Stefano Ceccherini
7ddaf32ecc Second (or third) try at getting the timers ordered by priority, in
r33218 I had ordered the timers in the wrong order.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 14:44:11 +00:00
Stefano Ceccherini
ca7ba3eb23 pretty much reverted r33218.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 13:16:13 +00:00
Stefano Ceccherini
77a9df0a47 Disable tracing.
Wow! 4 commits for a simple thing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33223 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 10:21:57 +00:00
Stefano Ceccherini
249346009f Fix for the fix. The previous commit actually broke initalizing timers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33222 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 10:21:00 +00:00
Stefano Ceccherini
9091ba579c Don't print an error if the initialization actually succeeded.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33221 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 10:18:56 +00:00
Stefano Ceccherini
cb35a69347 Introduce the PIT commands as defines and used them in the pit timer
module. They should be used also in the bootloader.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33220 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 10:14:15 +00:00
Stefano Ceccherini
bf7902cb4b Fix build with tracing enabled
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 09:50:30 +00:00
Stefano Ceccherini
bed1c0d42e Sort timers by priority before initializing them, so we avoid initializing
timers which we will never use.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-21 09:49:41 +00:00
Stefano Ceccherini
e5f7219f3a Fixed typo for real. Also disabled tracing for HPET
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33157 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-16 20:23:06 +00:00
Stefano Ceccherini
1412a38e9b Fixed build with tracing enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33153 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-16 12:20:27 +00:00
Stefano Ceccherini
483651906f Fix typo
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-16 10:40:12 +00:00
Stefano Ceccherini
e08bb3e0f2 Removed leftover
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33151 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-16 10:16:35 +00:00
Stefano Ceccherini
1d5026909d Basically reverted previous commit, since at that point we haven't yet
checked the existence of the apics.
Moved the code to disable the local apic from arch_timer.c to arch_int.cpp, so
we also avoid installing the interrupt handler for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33149 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-15 20:22:04 +00:00
Stefano Ceccherini
44f6eb85bd removed the 'smp' part from apic_smp_init_timer(), since it's used also without smp (I guess this was a leftover)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33148 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-15 20:00:57 +00:00
Stefano Ceccherini
24ca62447c Only show the "Disable APIC" option if an APIC is found.
Same for the IOAPIC, but commented out the code, since we're not using the
IOAPIC yet.
Also renamed the option to "Disable LOCAL APIC", since it's more correct.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-15 17:43:30 +00:00
Jérôme Duval
40d6120c3b Patch from Vincent Duvert (edited by myself): Implement reboot via ACPI (#4459)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-14 17:37:53 +00:00
Stefano Ceccherini
da11bb8dcb Use TRACE() instead of dprintf()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-14 11:54:48 +00:00
Stefano Ceccherini
4f5ca99156 Added dprintf() to be able to see which driver hangs on load
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33133 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-14 11:47:16 +00:00
Stefano Ceccherini
f0bf38026a Add safemode option to disable the use of APIC timers
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33132 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-14 09:02:15 +00:00
Michael Lotz
1bcca32a9e * Also take into account that the alignment due to B_ANY_KERNEL_BLOCK_ADDRESS
can cause overflows.
* Added a generic IS_VALID_SPOT() macro that checks for overflows and checks if
  the area will fit with the given constraints.
* Use the macro to simplify the places where these checks are necessary.
* Use the provided "end" limit instead of the address space end. It currently
  doesn't matter but makes more sense.
* Rename newBase variables to alignedBase as that's what they are.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33061 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-11 07:29:36 +00:00
Michael Lotz
e717a35b6f * Change the way we check for enough available space when searching for spots
to insert areas so we don't overflow.
* Consequently use the area end (base + size - 1) where appropriate which
  prevents overflows in a few places.
* Properly check for reaching the address space end.
* If we've already found a spot we don't need to recheck if we've found one.
* Simplify the B_EXACT_ADDRESS checks down to a simpler single if statement
  instead of the four seperate ones.
* Properly calculate the search end for B_EXACT_ADDRESS as well, it's also
  base + size - 1.
* Block the full last page now that this actually works without overflowing.
* Some style changes and added spacing.

This should now really fix #2550. Previously the overflow protection didn't
actually work because on allocation we overflowed and completely missed the
protecting area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 17:58:19 +00:00
Michael Lotz
5332eb402b Style fix. I really tried hard, but still failed...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33034 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 02:11:40 +00:00
Michael Lotz
65b5e4d7ed Make use of the address range blocking to guarantee that accessing 0xdeadbeef
and 0xcccccccc (and 64 pages thereafter) in any way will always lead to a crash.
Before it could happen that these ranges were allocated for an area and then
accessing these would not be as evident anymore. Only enabled when the
corresponding paranoid setting is enabled (which it currently is).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 02:09:16 +00:00
Michael Lotz
9aff7f1593 Block the very last page of kernel address space. The problem here is that non
of the VM functions handling areas are overflow safe. If an area is created that
spans across the last page many places will run into an integer overflow. This
mostly concerns the area allocation path in find_and_insert_area_slot() and also
vm_create_anonymous_area() where the loop for mapping pages for B_FULL_LOCK
areas overflows and runs more times than it should leading to #2550.
This could be seen as a workaround. The real fix would be to make everything
overflow safe. The thing is that this does also concern the user of the area
which could easily have forgotten to check for overflows as well, so I am a bit
uneasy with handing out areas that could easily lead to such hard to debug
problems. Since this is really an edge case and this single step safes quite a
bit of extra checks I'd actually be OK with keeping it that way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33032 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 02:03:31 +00:00
Michael Lotz
3794518c2d Also check for read-protection of an area. Adjusted naming from read-only to
write-protected and read-protected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 01:47:22 +00:00
Michael Lotz
0f4242de40 Implement a vm_block_address_range() function which creates an area with no
mapped pages and a non-read and non-write protection to block a certain address
range from being used by anything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33030 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-10 01:40:46 +00:00
Oliver Tappe
425cb3d716 * revert r32999 and adjusted each filesystem to return B_NOT_A_DIRECTORY in
its open_dir() implementation instead (as suggested by Ingo).
-alphabranch (it's only a cleanup)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33025 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-09 13:45:12 +00:00
Michael Lotz
1a053eedc0 Revert r32994 and add a comment to explain the intention. Thanks Ingo for the
clarification.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-08 16:24:43 +00:00
Oliver Tappe
be628a94e2 * opendir() is supposed to return ENOTDIR if the given path is not
a directory, we returned EINVAL instead, which caused Perl's internal
  glob() implementation to fail prematurely
+alphabranch (will do that myself in a minute)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-08 15:59:51 +00:00
Michael Lotz
fbcf5f3f92 Don't know what this was supposed to do, but with the VADDR_TO_PDENT() it would
end up as 0 again in any case. It certainly looks correct without it, removing
so it doesn't confuse the next one reading over it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32994 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-08 03:51:17 +00:00
Michael Lotz
257f000bd2 * When reserving pages and there aren't yet enough free pages, only steal as
many pages as are actually missing, not the full count.
* Take into account that free_page_queue_count() can be less than sReservedPages
  (when some of the reserved pages have been allocated already) in
  vm_page_num_unused_pages(). Before it could return negative and therefore
  wrapped numbers.
* Simplify the page scrubber loop by continuing early. Also avoids a needless
  interrupt spin lock acquisition when there's nothing to do.
* Some minor coding style cleanup.
* Fix a typo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-07 02:08:09 +00:00
Michael Lotz
1dd6345561 If the boot volume is BFS and read-only mount it with the write_overlay. This
allows for BFS based LiveCDs. Still this whole name matching feels hacky.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 23:15:23 +00:00
Michael Lotz
aad5c04223 Add valloc() and posix_memalign() to malloc debug heap.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32954 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 05:13:01 +00:00
Michael Lotz
a712373138 Apply fix of r32951 to malloc debug heap as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32953 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 05:11:48 +00:00
Michael Lotz
da3412492a When we actually delete the area, we can obviously not access the next pointer
stored in there anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-06 05:04:55 +00:00
Michael Lotz
c39414002f Give an IORequest user the possibility to suppress child finish notifications.
This allows for synchronous uses where subrequests are forked off and waited on.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-05 01:16:56 +00:00
Michael Lotz
c24f6c7b06 When deleting all subrequests the pending children count should probably be
reset as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32935 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-05 00:26:29 +00:00
Michael Lotz
230153f133 Reset the error variable to B_OK in case we want to continue after allocating
only some sub requests worked. Previously we would have simply canceled all
of the subrequests in the loop because we cancel after the first error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-03 05:40:06 +00:00
Michael Lotz
b2350565ba Fix two problems in devfs_io:
* An off by one error prevented the very last block of a device to be accessed
  through IO.
* In case of error the request wasn't notified causing anyone (the page writer
  for example) to wait forever for the request to complete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-03 05:36:23 +00:00
Michael Lotz
185fd1c5d2 Ported over the kernel heap to libroot to make use of it's validation
capabilities to aid in debugging memory corruption issues.

It does:
* Initialize memory to 0xcc to help turn up use of uninitialized memory
* Set freed memory to 0xdeadbeef to help find accesses of freed memory
* Use the paranoid heap validation to turn up many cases of memory corruption
* Use a simplistic wall check to turn up memory overwrites past allocations
* Take extra steps to validate freed addresses to turn up misaligned frees

It has an interface to en-/disable paranoid validation and to start/stop regular
wall checking. Both are currently just enabled. At a later stage a debug version
of libroot could be used by an application and the checks enabled at will. Note
that due to the paranoid validation and the suboptimal locking this allocator
will perform horribly. Still to find memory corruption issues in the system or
also in your applications it can be helpful to build your installation with it
turned on. To enable it you currently need to edit the Jamfile to sub-include
the malloc_debug instead of the malloc directory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 18:15:30 +00:00
Axel Dörfler
7945b22962 * Quick fix to send notifications on mount/unmount/initialize.
* This closes #2081.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 13:59:36 +00:00
Axel Dörfler
a2bb341447 * Cleanup, no functional change.
+ alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 13:23:05 +00:00
Michael Lotz
419f2d6f3e Fix errors in maintaining the area list due to assumptions that are only true
for the page list but not the area one. Since multiple pages can be allocated
at once, even an area that is not at the top of the list can become empty. In
such a case the area list would previously have lost entries. Also because
we can remove more than one page from any area, not just the top one, we may
need to move forward in the list so that it stays ordered by free pages.
+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32880 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 08:46:39 +00:00
Michael Lotz
5bfffb9d94 The block size wasn't initialized, causing usages of an IOScheduler without
a DMAResource not to work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32879 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-01 03:37:20 +00:00
Axel Dörfler
9cca7d50e9 * Backported r32851 from the r1alpha branch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-31 14:50:38 +00:00
Stephan Aßmus
9e15ae596c Added TODO about solving the renaming /boot problem differently as discussed
with Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32856 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-31 13:16:40 +00:00
Marcus Overhagen
a26bf7958f truncate strings to allow building the debug version
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32837 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-30 15:04:04 +00:00
Rene Gollent
92e143c14a Fix regression introduced in r32526: registering the device watcher for node monitoring needs to happen synchronously, otherwise a race condition occurs: unless you're very lucky, the event for creating the raw device would happen before the async thread had a change to add the node monitor, and as such the listener would miss it, and never trigger a filesystem/partition scan. As a result, whether or not adding a USB stick would actually show a volume was essentially russian roulette. Fixes ticket #4345.
+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 21:49:59 +00:00
Ingo Weinhold
adbf8b25f8 * Added fdopendir() (POSIX).
* Got rid of <dirent_private.h> -- the __DIR structure is private to dirent.c,
  now. The attribute directory, index directory, and query functions use the
  the public POSIX API, so does the kernel module code. Those components were
  not initializing the structure correctly anymore since the introduction of
  telldir()/seekdir().

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32819 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 20:25:24 +00:00
Axel Dörfler
6a9eee5845 * We support the timespec stat times, so why not allowing the user to set
the times with higher resolution as well?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 15:53:15 +00:00
Michael Lotz
d18b04298a Cleanup, remove needless line-break and trailing space. Also switched that "& "
to " &" as really the whole rest of the file uses that style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32813 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 15:35:11 +00:00
Stephan Aßmus
8c5ad61d4b * Prevent the /boot entry from ever being renamed. You couldn't even try to
switch /boot to a different volume in two operations, unless you have first
  linked /system/lib into /bin. This patch assumes that / will always have the
  ID 1. Don't know if that is proper. Note that I also thought about solving
  this in the VFS, since perhaps it isn't the job of root-fs to know about
  /boot, but that would of course introduce another check for every rename
  operation, which I decided against.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-29 10:43:51 +00:00
Axel Dörfler
e09d819b6c * Since the Media/Translation Kit errors are now in Errors.h as well, we don't
need to include those two anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32781 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 13:01:33 +00:00
Stefano Ceccherini
11dbc6cf7a Reverted r28531 since we have working wcrtomb() and mbrtowc().
Seems like we didn't remember to change it back, even
with the #warning. :-)
I tested ftp and it works fine. This also closes ticket #4176.
+alphabranch 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32766 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 20:33:18 +00:00
Stefano Ceccherini
1c2a5ae241 Fixed gcc4 warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32764 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 20:26:31 +00:00
Axel Dörfler
89294b5084 * Added option for enabling serial debug output.
* Moved device_manager/settings.cpp to debug/safemode_settings.cpp.
* Removed the somewhat hacky concatenation of kernel settings and safemode
  settings in the boot loader. Instead, get_safemode_option() will now fall
  back to the kernel settings, if it couldn't spot a setting in the safemode
  settings. This allows for more control, and also makes enabling serial
  debug output actually work (ie. overriding the kernel settings via safemode
  options).
* Adjusted debug_init_post_vm(), and smp_init_other_cpus() to use
  get_safemode_boolean().
* Therefore, I added safemode_settings.cpp to the boot loader as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 08:47:54 +00:00
Axel Dörfler
e17f8de82d * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 08:27:54 +00:00
Axel Dörfler
f8ebd1a328 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 08:05:22 +00:00
Ingo Weinhold
2fb48fb46b Added missing ENOATTR text.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 01:01:43 +00:00
Ingo Weinhold
b02c147c05 Implemented seekdir() and telldir(). They were declared in <dirent.h> already.
So either +alphabranch or remove the declarations from <dirent.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-25 22:16:40 +00:00
Jonas Sundström
9fbc65a94d Modified *jmp stubs for arch mipsel. Removed PowerPC asm.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-23 03:17:13 +00:00
Jonas Sundström
893988af82 Added and modified kernel stubs and headers for arch mipsel. Correctness not included.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-23 02:52:09 +00:00
Michael Lotz
f1a7a3752f * Use the locked version of inherit_parent_user_and_group() by moving the call
into the scope of the lock. Saves an InterruptsSpinLocker.
* Use an InterruptsSpinLocker() as in other places.
* When creating/forking a team fails because the kernel thread cannot be spawned
  balance the already sent TEAM_ADDED notification by sending a TEAM_REMOVED one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-22 03:07:11 +00:00
Jonas Sundström
8e8130d1f0 Adding routerboard_mipsel platform stubs and linker script.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-22 01:48:18 +00:00
Rene Gollent
c3350a57ff Squashed a TODO: When delivering signals, check if a) any threads were in fact enqueued, and b) if the scheduler's preemption hint indicates that a reschedule is desired. This prevents unnecessarily invoking the scheduler every single time a signal is delivered, regardless of result.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-21 23:48:42 +00:00
Michael Lotz
29bd9bfd7d Remove SMP_MSG_RESCHEDULE_IF_IDLE as it is not used anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-21 16:14:18 +00:00
Michael Lotz
861b223cf2 * Strip down scheduler_simple. Anything related to multiple CPU handling has
been removed. That includes CPU disabling and thread pinning, as that becomes
  pointless with only one CPU.
* Return a proper reschedule hint on enqueing a thread, based on the priority
  of the current thread vs. the enqueued one.
* Enable dynamic scheduler selection. With one CPU the simple scheduler will
  be used, otherwise affine is selected.
* Removed the scheduler type define as we now always auto-select it.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-21 16:10:27 +00:00
Rene Gollent
009ccc2962 anevilyak+mmlr:
* scheduler_enqueue_in_runqueue() now allows the scheduler to return a hint as to whether a reschedule is desirable or not. This is used in a few other places in order to relegate scheduling decisions entirely to the scheduler rather than the priority hacks previously used. There are probably other places in the kernel that could now make use of that information to more intelligently call reschedule() though.
* Switch over the default scheduler to scheduler_affine().



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-21 04:11:40 +00:00
Rene Gollent
66dde0a85d Fix build with TRACE_SMP enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32550 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-20 23:39:22 +00:00
Axel Dörfler
6d908f83f3 * Must be careful which functions to call in the notifications handler, or else
you can easily produce a dead lock. This should fix the system hang
  experienced as part of bug #4223.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-19 17:09:33 +00:00
Michael Lotz
152132f08a mmlr+anevilyak:
* Keep track of the currently running threads.
* Make use of that info to decide if a thread that becomes ready should preempt
  the running thread.
* If we should preempt we send the target CPU a reschedule message.
* This preemption strategy makes keeping track of idle CPUs by means of a bitmap
  superflous and it is therefore removed.
* Right now only other CPUs are preempted though, not the current one.
* Add missing initialization of the quantum tracking code.
* Do not extend the quantum of the idle thread based quantum tracking as we want
  it to not run longer than necessary. Once the preemption works completely
  adding a quantum timer for the idle thread will become unnecessary though.
* Fix thread stealing code, it did missed the last thread in the run queue.
* When stealing, try to steal the highest priority thread that is currently
  waiting by taking priorities into account when finding the target run queue.
* Simplify stealing code a bit as well.
* Minor cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32503 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-19 03:19:17 +00:00
Jonas Sundström
fe3763173c Add jamfile to build generic memcpy and memset for arch mipsel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32497 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-18 15:34:23 +00:00
Michael Lotz
100487755f We explicitly remove the thread from the (priority sorted) run queue to
re-insert it at a new place, but by only setting the priority and not the
next_priority field, the thread would actually be enqueued at the same priority
level as before. Didn't cause any real damage, guess it was just an oversight.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-18 13:19:12 +00:00
Rene Gollent
f940f1e99c Initialize variable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 23:28:58 +00:00
Rene Gollent
494fe97976 Cleanups and some changes to avoid looping to compute the quantum average as suggested by Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 23:26:22 +00:00
Michael Lotz
65411f56b7 We can return directly as we use handy locker objects. Adjusted and added
comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 22:51:01 +00:00
Jonas Sundström
a245e6b444 Removing Axel's copyright. Permission given here: https://lists.berlios.de/pipermail/haiku-commits/2009-August/019513.html
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 22:26:09 +00:00
Jonas Sundström
c175f2a63e Adding placeholder machine dependent kernel code for arch mipsel. Copied from src/system/kernel/arch/arm and gutted.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 20:01:11 +00:00
François Revol
541dd9330e I'm obviously not that old. Not officially at least.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 19:22:44 +00:00
Michael Lotz
73c035dc11 * Set freed memory to 0xdeadbeef before returning it to page. This allows us to
not hold the bin lock while setting and only protect the actual freeing. May
  reduce bin lock contention a little bit.
* Tiny optimization for force-clearing 0xdeadbeef. Do it after setting to 0xcc,
  so that it's less likely we have to do it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32473 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 17:25:24 +00:00
Jonas Sundström
ac5f5cdf01 Define IEEE-endianness for arch mipsel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 14:59:19 +00:00
Michael Lotz
699bf40942 Add scheduling notifications to scheduler_affine.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 14:51:07 +00:00
Jonas Sundström
31a36e3021 mipsel wip
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-17 14:49:04 +00:00
Ingo Weinhold
4e4ff20294 common_poll():
* Always select POLLNVAL. We wouldn't get notified, if the FD was closed while
  waiting.
* Skip negative FDs (as per POSIX standard).
* When encountering an invalid FD, we must not wait. Previously we did that as
  long as any FD was valid.
* The return count must consider all FDs with non-null revents, including
  invalid ones (revents is POLLNVAL then).

common_poll()/common_wait_for_objects():
* Don't bail out early, when no FDs/objects have been selected. We always want
  to wait.

_user_poll()/_user_wait_for_objects():
* Copy the array back to userland even if common_*() returned an error. The
  functions do now always fill in the resulting events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32418 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 16:42:18 +00:00
Ingo Weinhold
57dc0e2a53 Changed the FD selection/deselection handling a bit:
* B_EVENT_INVALID is no longer passed to the FD's select()/deselect() hooks.
* Now we always attach the select info to the I/O context, even if no event has
  been selected. The reasoning is that B_EVENT_INVALID is always automatically
  selected and handled by the VFS, so we need the handle to notify on close().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 16:28:15 +00:00
François Revol
5ce6cb5c32 [GSoC] [ARM] Patch by Johannes Wischert.
Some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 14:31:14 +00:00
François Revol
4b953dec79 [GSoC] [ARM] Patch by Johannes Wischert.
Do call mmu_init_for_kernel() here.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 14:29:20 +00:00
François Revol
d10d43315b [GSoC] [ARM] Patch by Johannes Wischert.
Fix arch_int_are_interrupts_enabled().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32414 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 14:28:00 +00:00
François Revol
33a3c23a00 [GSoC] [ARM] Patch by Johannes Wischert.
- cleanup,
- implement atomic_set() for PXA and other pre-arm6.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 14:22:53 +00:00
François Revol
f6e18219c3 [GSoC] [ARM] Patch by Johannes Wischert.
Add assembler code to actually jump to the kernel.
The terminal now says:

kernel entry at 80048228
PANIC: acquire_spinlock: attempt to acquire lock 0x8012a59c with interrupts enabled
Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
kdebug>



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 02:16:23 +00:00
François Revol
d20ab0b9af [GSoC] [ARM] Patch by Johannes Wischert.
Add missing kernel stub.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 02:14:51 +00:00
François Revol
12f64a3b27 [GSoC] [ARM] Patch by Johannes Wischert.
- don't panic on missing page table, just add it,
- less debug output,
- include PXA LCD regs in hw memory map.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 02:13:39 +00:00
François Revol
bb7479a182 [GSoC] [ARM] Patch by Johannes Wischert.
Turn off interrupts at loader entryn and make sure the mmu is disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 02:11:07 +00:00
François Revol
639b8a4905 [GSoC] [ARM] Patch by Johannes Wischert.
This seems to work around the dynamic segment having a huge file size in headers, it must also be in the data segment...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 01:15:18 +00:00
François Revol
98a3545295 [ARM]
Add support for boot splash, only for PXA.
Disabled for now as it forces the framebuffer onto some useful data.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 22:14:07 +00:00
François Revol
477d2636d8 Return B_OK on success.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 21:04:29 +00:00
François Revol
7db9fbfe80 Factor out the splash image display logic too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 20:51:29 +00:00
Ingo Weinhold
7435db9ff0 * _user_read_dir(): Allocate a temporary heap buffer passed into the kernel
instead of using the user buffer. This frees the VFS and FS implementations
  from handling user buffers.
* Adjusted fix_dirent() accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 18:31:35 +00:00
François Revol
0573d397e1 Factor out the RLE and blitting functions from bios_ia32 to platform/generic/ so it can be reused by other platforms.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 18:15:44 +00:00
Axel Dörfler
55be27517f * Also print the capabilities on boot up.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 14:31:38 +00:00
François Revol
3f6f17cf36 [ARM]
Start of framebuffer initialization for the Verdex board.
For now it points to the data section as framebuffer for testing and shows an RGB pattern.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32352 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 12:40:16 +00:00
Axel Dörfler
bb693d7764 * Added VESA capabilities field to the kernel args.
* The vesa driver no longer uses VGA programming if the chip does not support
  VGA compatibility.
* The VESA driver now tries to set the DAC to 8 bits per color gun.
* In VESA modes, the driver no longer tries to use VGA programming; introduced
  the new vesa_set_indexed_colors() that is now used for palette programming.
  This should fix wrong colors of 8 bit BWindowScreen users with VESA on real
  hardware (emulators usually didn't mind either way).
* Note that the app_server needs to maintain a palette per 8 bit screen, as
  right now, the colors are garbled after a workspace switch. Stefano, are you
  looking into that already?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32347 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 09:49:28 +00:00
François Revol
3f366cdc39 [ARM]
Don't forget the ELF header else we end up loading at 0x7fff8000...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 01:10:19 +00:00
François Revol
d9c434dc91 [ARM]
Use the same trick as for m68k (r26536) to get separate text & data segments for the kernel, though this should really not be needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32340 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 00:18:25 +00:00
François Revol
7ac9833646 [GSoC] [ARM] Patch by Johannes Wischert.
Update the memory map to account for passed tgz mapping. It's still hardcoded for now though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 00:10:59 +00:00
François Revol
f5ad74ca68 [ARM]
Actually enable mmu_init() since it works for verdex now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32338 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-14 00:10:03 +00:00
François Revol
89fd3a7d20 [ARM]
move checking for the tgz after debug init, and print something when found.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32337 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 23:43:56 +00:00
François Revol
78db3ad125 [GSoC] [ARM] Patch by Johannes Wischert.
Fix wrong string comparison.
(btw the coding style police will inspect this, beware :p)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32336 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 23:41:40 +00:00
François Revol
d8417ee73b [ARM]
- cleanup,
- fix getimg().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32335 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 23:35:02 +00:00
François Revol
715a9925f1 [ARM]
Move ARM MMU definitions to a separate header file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32332 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 21:09:48 +00:00
François Revol
38ec40dcbe [GSoC] [ARM] Patch by Johannes Wischert.
Partial implementation of mmu support for the bootloader, with lot of debugging output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32330 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 20:30:20 +00:00
François Revol
c2662f0d22 [GSoC] [ARM] Patch by Johannes Wischert.
- empty u-boot specific platform code for the kernel,
- add various objects needed by the kernel from libroot or the generic C implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32328 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 18:48:21 +00:00
François Revol
23eafdaf31 [GSoC] [ARM] Patch by Johannes Wischert.
- stubbed out many arch kernel functions (borrowed from other archs),
- partially implement ELF relocations code, enough to load the kernel,
- move uart.c to kernel sources and use the same one for the loader,
- default implementation for gensyscalls,
- assembler code functions for interrupt masking (enable/disable/restore/query).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32327 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 18:34:15 +00:00
Artur Wyszynski
818ef0e501 Fixed wrong check
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32326 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 17:46:39 +00:00
François Revol
79cf966c2c [ARM]
Add unwind symbols to the kernel too... not sure it goes here though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32325 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 17:36:42 +00:00
François Revol
a2577dbfd1 [ARM]
Stubbed out config_manager and pci bus_manager arch code.
Now really use the boot floppy tgz for the netbsd uimage as it all builds, but with other kernel arch code not yet commited.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 17:29:46 +00:00
Axel Dörfler
368fc35adf * Also have the uppper limit check in the assert.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 16:49:53 +00:00
François Revol
b927aacaf9 [GSoC] [ARM] Patch by Johannes Wischert.
Add UART initialization for OMAP. uncomment polling wait loops.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 14:56:40 +00:00
Axel Dörfler
48cb56d8ef * We also shouldn't try to copy if the dirent is too large, obviously.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 14:21:18 +00:00
François Revol
0f282bc263 Use a more logical and native error here.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 14:03:43 +00:00
François Revol
0e20032995 [ARM]
Move the unwind data out of the bss section, it broke bss init which ended up erasing real data and making dprintf do weird things...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 12:48:33 +00:00
Axel Dörfler
f9ba5c92e3 * Let fix_dirent() handle invalid reclen's gracefully.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 12:05:20 +00:00
Bryce Groff
6f0f2e9ecd * Cleaned up pointer style
* Added new line that was missing from previous commit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32298 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 08:38:58 +00:00
François Revol
01c8294cc7 [ARM]
- don't clobber the parameter regs in the entry point,
- fix entry point address for netbsd loader emulation,
- added a gUImage global to point to the uimage blob with the tgz,
- added tgz info to platform stage2 args,
- add simple uimage support, just dumps the header and gets the nth blob in the image, (seems we have a bug in the math code, some infos don't print),
- made devices.cpp use them to publish the MemoryDisk,
- add an haiku_loader_nbsd.ub target which puts both the loader and kernel_arm for now (need to replace with the tgz).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 05:28:30 +00:00
François Revol
f4e0ad68b3 [ARM]
- fixed copyright,
- added a naive armv5 implementation for __swap_int{16,32}.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 04:32:05 +00:00
Michael Lotz
68b6dce107 We already panic to indicate that something's wrong, no real need to crash
afterwards instead of returning gracefully.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 02:00:49 +00:00
François Revol
1e33c1136e [ARM]
- cleanup,
- moved the startup asm code to u-boot/arch/arm/shell.S
- added netbsd loader entry point,
- store the invocation type (0: standalone, 1: netbsd),
- store the global data in a variable,
- added some debug code to see what U-Boot gives us.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-13 01:15:21 +00:00
François Revol
cd5d972ea0 [ARM]
Name the FAT; no need to list the contents.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 22:06:14 +00:00
François Revol
2807c5413f fix PXE build with multiboot. GRUB supports netboot btw, could be interesting to explore... but the pxe shell doesn't check for the info yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 20:30:03 +00:00
Axel Dörfler
b5cc4c1958 * Disabled multiboot for now, as it breaks the PXE build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 17:48:18 +00:00
François Revol
e4b608db5b [ARM]
Missed this one in previous commit: remove board.ld include as we now give LD the address directly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 16:25:02 +00:00
François Revol
feb750d331 [ARM]
- consolidate board specific definitions into build/jam/board/*/BoardSetup to avoid duplicating address values everywhere,
	- add various addresses, boot script, custom C/C++ flags and SD card definition,
	- not sure BoardSetup is included at the best place though,
	- replaced board-specific ldscript with passing the loader address directly to LD from BoardSetup,
- added haiku.mmc target which generates an mmc/SD card image with a FAT partition with the files needed to boot for the board, should later be integrated with haiku.image with the BFS partition offset passed to bfs_shell, requires apt:sfdisk,mtools on GNU/Linux,
- added some more rules, one to build a script for the SD image,
- fake a NetBSD loader for now, U-Boot doesn't know haiku, and we'll need a way to pass the tgz image and RAM size, we'll either use standlone way (usual C argv[]) or the NetBSD args,
- style fixes,
- 80 cols, /me pets Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32284 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 16:12:35 +00:00
Axel Dörfler
30f4c392a4 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 14:39:37 +00:00
François Revol
43da1b4f11 [ARM]
Condition the exclusive ops to >= armv6 instead of specific version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 14:17:05 +00:00
Axel Dörfler
9e90c30ebd * Fixed warnings.
* Removed FAT support from the boot loader for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32276 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-12 14:12:09 +00:00
Axel Dörfler
a068dcb15a * cdda_read_dir() could copy too many bytes into the provided buffer (worst
case was an unterminated string, though).
* fix_dirent() did not copy the trailing null-byte.
* Not yet entirely sure why, but this caused #4214.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32254 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 15:46:07 +00:00
François Revol
166983b771 [ARM]
Stub out swap funcs for pre armv6 which lack REV/REV16. WRITEME.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32240 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 03:24:22 +00:00
François Revol
e3db8e35e3 [ARM]
Temporary (?) solution to linking the loader: generate symbols needed by the unwinding code, which should actually not be used since we disable exceptions...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-11 03:21:29 +00:00
Bryce Groff
1987b05aa0 * Added open_partition to disk_device_manager
* Rewrote PartitionMapWriter
* Updated style to match current style guide for the intel partitioning system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32235 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-10 22:28:47 +00:00
Michael Lotz
60a5ced394 Adding a disabled debug helper.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-09 19:54:41 +00:00
Michael Lotz
50d22f83ef The reference of the currently active translation map shouldn't be released
until the data it protects isn't in active use anymore. Previously it would
release the translation map and therefore the page directory reference while
the page dir was still set on the CPU, as only the actual call to
i386_context_switch() will replace the page directory in the control register.
This didn't cause any harm though, as during the context switch interrupts are
disabled and therefore the page directory would only be deferred_delete()ed and
not directly freed/overwritten. Still this is logically more correct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32216 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-09 17:39:05 +00:00
François Revol
ac15f9dd16 [ARM]
Add rule to handle uimage, and board-specific stuff to handle load addresses. Need to fix them, u-boot doesn't like loading the file with the header where the header says it should go, must copy to a different address.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-09 16:40:17 +00:00
François Revol
71c5ee196b [ARM]
Remove debug leftover.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32208 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 16:12:02 +00:00
François Revol
e60a2810f6 [ARM]
Include board-specific file from the u-boot ldscript, to allow linking to different load addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 16:02:34 +00:00
François Revol
0693778cee [ARM]
Move uart.c to arch/arm/ where it belongs, it has nothing u-boot specific.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 02:38:44 +00:00
François Revol
f875744d56 [ARM]
Remove duplicate header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32202 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 02:26:01 +00:00
François Revol
658d387ad5 [ARM]
- cleanup,
- add an uart_debug_port() to avoid using the #define in serial.cpp,
- use board_config defines in uart.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 02:23:22 +00:00
François Revol
67a0108c3b [ARM]
- add board specific headers to includes,
- some unused flash image targets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32199 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 02:01:59 +00:00
François Revol
541e58f98f Seems r31815 got MIA due to r31919+r31925...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32196 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-08 00:18:59 +00:00
Axel Dörfler
f7a6506e0f * Replaced all "status < B_OK" with != B_OK - this should make the VFS layer
more robust against broken (userland) file systems.
* 80 character column cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-07 12:29:17 +00:00
Axel Dörfler
f7be7fea76 * Setting the depth to 1 for VGA mode in frame_buffer_console_init() was not
a good idea; it didn't have any consequences in there, but actually broke
  the app_server's support for the VGA mode.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-07 11:07:14 +00:00
Axel Dörfler
86766d6aca * handle_driver_events() kept the sDriversListLock locked over the whole
time. But since this is also locked from within the driver/directory watcher
  (with the node monitor lock held), and handle_driver_events() could cause
  node monitoring updates, the locking order could be reverted, causing a
  deadlock (I just ran into).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-06 08:24:23 +00:00
Axel Dörfler
13247f3a8c * This fixes VGA mode frame buffer use, no idea when this got broken. It might
be broken in the app_server now, but I haven't checked yet.
* Fixed typo in vesa.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32141 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 17:24:23 +00:00
Axel Dörfler
45ed4939f9 * area_for() now also returns the area ID for kernel areas if they are
accessible to the userland - this fixes #2405 (ie. MediaPlayer overlay now
  works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 15:04:45 +00:00
Axel Dörfler
cfd22919f2 * FileMap::Translate() did not choke on negative offsets, and _Cache() does not
necessarily return an error in this case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32129 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 13:05:58 +00:00
Ingo Weinhold
af31cb589c Added comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 02:31:00 +00:00
Michael Lotz
ee280b59e9 Prevent the user TLB invalidation function from being preempted by turning off
interrupts when invoking it. The user TLB invalidation function essentially only
reads and writes back control register 3 (cr3) which holds the physical address
of the current page directory. Still a preemption between the read and the write
can cause problems when the last thread of a team dies and therefore the team
is deleted. The context switch on preemption would decrement the refcount of the
object that holds the page directory. Then the team address space is deleted
causing the context switch returning to that thread to not re-acquire a
reference to the object. At that point the page directory as set in cr3 is the
one of the previously run thread (which is fine, as all share the kernel space
mappings we need). Now when the preempted thread continues though, it would
overwrite cr3 with the physical page directory address from before the context
switch still stored in eax, therefore setting the page directory to the one of
the dying thread that now doesn't have the corresponding reference. Further
progressing the thread would release the last reference causing the deletion
of the object and freeing of the, now active again, page directory. The memory
getting overwritten (by deadbeef) now completely corrupts the page directory
causing basically any memory access to fault, in the end resulting in a
triplefault. This should fix bug #3399.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-04 23:15:05 +00:00
François Revol
f676f30b36 Remove those antique misleading leftovers, the good ones are at headers/private/kernel/boot/images.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-04 18:50:08 +00:00
François Revol
f335531bbc Remove file map disk support by default, it's not used anyway, and we'll use layers for CD anyway. Doesn't spare that many bytes though...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-04 09:00:10 +00:00
François Revol
98977abc9b Fix m68k build, still unimplemented.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 21:17:03 +00:00
François Revol
af9475fd3d Initialize args.arguments on ARM too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32100 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 19:53:17 +00:00
Ingo Weinhold
1d099cad03 Patch by Bryce Groff: Allow passing an ID of any partition contained in the
disk device to the locking functions, not only the ID of the disk device
itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32094 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 19:01:20 +00:00
François Revol
696e647c0f Implemented getting bootargs from OF. Untested.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32081 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 15:12:24 +00:00
François Revol
56c6c0fefb - introduced an "argumetns" field in stage2_args to hold command line args from chaining loader,
- added some multiboot support code:
	- dump some of the passed info,
	- parse command line (skip the 'kernel' name and pass the rest to stage2_args.arguments),
- added an add_stage2_driver_settings() function which takes stage2_args.arguments and translates it into safe mode driver settings, a bit dumb for now.
This allows using qemu -kernel haiku_loader -append 'debug_screen true' and get debug output without having to enter the menu (once multiboot info is used to determine the boot device too).
The idea is to allow passing driver settings and using them to pass extra stuff (like 'force_keymap fr' and other stuff for demo), and to help automate tests ('run_test /bin/sometest').
This should answer Axel's question :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 14:39:41 +00:00
Michael Lotz
255c9104e5 * Rework the heap locking strategy. Use a read-write lock for the area lock to
allow for more parallelism. Also introduce seperate locks for the bins and
  for page allocation. This greatly reduces lock contention and reduces the
  duration the locks are held due to them overall protecting less code. Now only
  allocations of the same size hitting the same allocator or allocating larger
  chunks of memory should block. Previously, basically any allocation and also
  free would be mutually exclusive, making it scale pretty badely.
* Added memalign_nogrow(). As it uses heap_memalign() anyway, there's no real
  reason not to allow for an alignment.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32074 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 13:59:45 +00:00
Ingo Weinhold
ea2abd110b * Renamed the ROUNDOWN macro to ROUNDDOWN. Also changed the implementation of
ROUNDUP to use '*' and '/' -- the compiler will optimize that for powers of
  two anyway and this implementation works for other numbers as well.
* The thread::fault_handler use in C[++] code was broken with gcc 4. At least
  when other functions were invoked. Trying to trick the compiler wasn't a
  particularly good idea anyway, since the next compiler version could break
  the trick again. So the general policy is to use the fault handlers only in
  assembly code where we have full control. Changed that for x86 (save for the
  vm86 mode, which has a similar mechanism), but not for the other
  architectures.
* Introduced fault_handler, fault_handler_stack_pointer, and fault_jump_buffer
  fields in the cpu_ent structure, which must be used instead of
  thread::fault_handler in the kernel debugger. Consequently user_memcpy() must
  not be used in the kernel debugger either. Introduced a debug_memcpy()
  instead.
* Introduced debug_call_with_fault_handler() function which calls a function
  in a setjmp() and fault handler context. The architecture specific backend
  arch_debug_call_with_fault_handler() has only been implemented for x86 yet.
* Introduced debug_is_kernel_memory_accessible() for use in the kernel
  debugger. It determines whether a range of memory can be accessed in the
  way specified. The architecture specific back end
  arch_vm_translation_map_is_kernel_page_accessible() has only been implemented
  for x86 yet.
* Added arch_debug_unset_current_thread() (only implemented for x86) to unset
  the current thread pointer in the kernel debugger. When entering the kernel
  debugger we do some basic sanity checks of the currently set thread structure
  and unset it, if they fail. This allows certain commands (most importantly
  the stack trace command) to avoid accessing the thread structure.
* x86: When handling a double fault, we do now install a special handler for
  page faults. This allows us to gracefully catch faulting commands, even if
  e.g. the thread structure is toast.

We are now in much better shape to deal with double faults. Hopefully avoiding
the triple faults that some people have been experiencing on their hardware
and ideally even allowing to use the kernel debugger normally.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 12:39:56 +00:00
Ingo Weinhold
16357dea6b Don't lock when the debugger is running.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 11:54:25 +00:00
Ingo Weinhold
885b7b4a85 Removed unsupported architectures.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 11:32:08 +00:00
François Revol
4b8d0e6856 Some ppc fixes for #4115, patch by kallisti5 (without the #ifdef _BOOT_MODE):
- stubbed out arch_cpu_init_percpu(),
- make atomic ops declarations extern "C",
- move calls to [i]sync inside the asm code that needs it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-03 10:10:22 +00:00
François Revol
91517f4f12 Minimal definition of the MultiBoot Info struct, should be enough for now.
We use official names for defines & struct members.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-01 12:32:18 +00:00
François Revol
a9c45a68ef Add MultiBoot support.
Based on a patch from Dustin Howett, reworked, and help from Vladimir 'phcoder' Serbinenko.
- used defines for clarity, the rest of teh code could make use of them too...
- added a gMultiBootInfo pointer to the passed args, to let C code handle it instead of faking the boot drive ID,
- conditionalized the copy back, maybe we can get rid of it when QEMU handles our default load address correctly,
- added video mode info to ask for 1024x768 but QEMU ignores it anyway, and we might need to show the menu, so it's disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-01 12:03:22 +00:00
Ingo Weinhold
671a2442d9 More work towards making our double fault handler less triple fault prone:
* SMP:
  - Added smp_send_broadcast_ici_interrupts_disabled(), which is basically
    equivalent to smp_send_broadcast_ici(), but is only called with interrupts
    disabled and gets the CPU index, so it doesn't have to use
    smp_get_current_cpu() (which dereferences the current thread).
  - Added cpu index parameter to smp_intercpu_int_handler().
* x86:
  - arch_int.c -> arch_int.cpp
  - Set up an IDT per CPU. We were using a single IDT for all CPUs, but that
    can't work, since we need different tasks for the double fault interrupt
    vector.
  - Set the per CPU double fault task gates correctly.
  - Renamed set_intr_gate() to set_interrupt_gate and set_system_gate() to
    set_trap_gate() and documented them a bit.
  - Renamed double_fault_exception() x86_double_fault_exception() and fixed
    it not to use smp_get_current_cpu(). Instead we have the new
    x86_double_fault_get_cpu() that deducts the CPU index from the used stack.
  - Fixed the double_fault interrupt handler: It no longer calls int_bottom to
    avoid accessing the current thread.
* debug.cpp:
  - Introduced explicit debug_double_fault() to enter the kernel debugger from
    a double fault handler.
  - Avoid using smp_get_current_cpu().
  - Don't use kprintf() before sDebuggerOnCPU is set. Otherwise
    acquire_spinlock() is invoked by arch_debug_serial_puts().

Things look a bit better when the current thread pointer is broken -- we run
into kernel_debugger_loop() and successfully print the "Welcome to KDL"
message -- but we still dereference the thread pointer afterwards, so that we
don't get a usable kernel debugger yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32050 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-01 01:53:54 +00:00
Ingo Weinhold
1af695be01 Automatic whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-01 01:18:39 +00:00
Ingo Weinhold
cc77aba101 * Allocate a separate double fault stack for each CPU.
* Added x86_double_fault_get_cpu(), a save way to get the CPU index when in
  the double fault handler. smp_get_current_cpu() requires at least a somewhat
  intact thread structure, so we rather want to avoid it when handling a double
  fault. There are a lot more of those dependencies in the KDL entry code.
  Working on it...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32028 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 16:14:18 +00:00
Axel Dörfler
61b6f38cfc * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 14:11:12 +00:00
Axel Dörfler
061d2ed1a2 * Creating a symlink now fails with B_NOT_SUPPORTED instead of
B_READ_ONLY_DEVICE if it has a write hook.
* This fixes bug #4141.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 00:40:52 +00:00
Axel Dörfler
c32499b4f7 * Since the file_map reports its chunk with a file system specific alignment, we
cannot assume that the file is that long - we need to check for the actual
  file size specifically, and then clear the extraneous bytes based on that one.
* This fixes seeing old file left-overs in the space beyond the file size in
  mmapped file. Thanks to Oliver who provided me with a nice test program to
  reproduce this problem (this should also fix gcc's fix_includes app (although
  I wonder what it does if a file actually ends on a page boundary).
* Also fixed a bug in precaching that would cause the last page of the cache
  to be discarded, causing it to be re-read later on.
* Moved partial page clearing into its own function
  read_pages_and_clear_partial(), even though it's currently only used once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 23:12:12 +00:00
Ingo Weinhold
ce50cdc3ed When recovering a tracing buffer from a previous session we do now check the
tracing buffer entry list at least. Eventually we should check the entries
themselves, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 22:00:16 +00:00
Ingo Weinhold
3fccf0679f C++ified the code. Introduced new trace entry flags, which will eventually be
used to mark entries after recovering a tracing log from a previous session.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 19:50:50 +00:00
Ingo Weinhold
57a25014b0 Statically initialize sTracingMetaData to sDummyTracingMetaData. This causes
tracing use before real initialization to be ignored gracefully again. Fixes
#4158.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31973 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 15:12:21 +00:00
Ingo Weinhold
213d2d8f9d Added syscall _kern_kernel_debugger() to enter the kernel debugger.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31965 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 12:35:42 +00:00
Axel Dörfler
ca39f8d89f * Use parse_expression() instead of strtoul().
* "owner count" contained an extra tab.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31951 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 23:01:27 +00:00
Ingo Weinhold
d829579dc0 mmlr + bonefish:
Moved the static variables for managing the tracing buffer into a separate
area. The area is mapped at one of a few possible physical addresses and can
be found again when rebooting. This allows us to resurrect the tracing buffer
from the previous session, which could help tremendously when tracking certain
bugs (like triple faults). There's very little checking done yet, so it is
probably not as robust as we would wish it to be.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 21:34:51 +00:00
Ingo Weinhold
d3b44ccb14 Added explicit physical address parameter to vm_create_anonymous_area() and
create_area_etc(). 0 for the default behavior.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 21:30:35 +00:00
Ingo Weinhold
069b477dd7 * Introduced CREATE_AREA_DONT_CLEAR create_area_etc() flag, which allows the
call to fetch non-clear pages.
* B_PHYSICAL_BASE_ADDRESS does now imply B_CONTIGUOUS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31932 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 18:57:21 +00:00
Ingo Weinhold
00e22bae44 Use B_SYSTEM_TEAM instead of the hard-coded 1.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31931 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 18:53:38 +00:00
Oliver Tappe
a50f9555a8 * re-added the broken bsd-version of strtod.c, as our kernel depends on strtod,
too, and I do not dare to add a glibc-based source to our kernel.
  This means that our kernel will have to live with strod() yielding
  inaccurate results, but since the only use I have found was for fs-queries,
  I think we can cope for now.
* added a comment to the top of strtod.c that explains the current state.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31925 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 17:07:00 +00:00
Oliver Tappe
8c359d8eb4 * small cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 16:22:00 +00:00
Oliver Tappe
4f86db4973 * replaced broken bsd-inherited implementation of strtod() with the glibc
version that lives in our repo, too, and actually works as intended
* removed the broken strtod() implementation from the repo
This fixes all floating-point test regressions reported in #3308.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 16:03:14 +00:00
Axel Dörfler
4cb7d2e55d * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 15:46:21 +00:00
Oliver Tappe
c11fb6fd9f * removed a TODO that no longer applies
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 15:45:14 +00:00
Axel Dörfler
533cba7eff bonefish + axeld:
* Reverted r31809 as it introduced a race condition; if the I/O request had been
  notified, it could already been deleted at that point.
* Instead, we need to notify the request in each file system/driver that uses
  it. Added new notify_io_request() function that does that exactly.
* Added a TODO comment to the userlandfs where the request notification needs
  a bit more thought.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 12:16:15 +00:00
Axel Dörfler
8ae594ffd4 * Introduced dedicated syscalls for the deprecated BeOS fs_attr API. Before,
each attribute access needed 3 syscalls, now only one as it should.
* Renamed the new Haiku call fs_open_attr() to fs_fopen_attr(), and added a new
  function fs_open_attr() that takes a path (same semantics as the
  fs_[f]open_attr_dir() functions already present in BeOS).
* Merged former _kern_open_attr(), and _kern_create_attr() into one syscall.
* Cleaned up vfs.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-29 00:34:44 +00:00
Axel Dörfler
0a5bfde225 * Added stack traced to the Abort tracing output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-28 21:50:42 +00:00