Commit Graph

174 Commits

Author SHA1 Message Date
Stephan Aßmus
181593ba0b * Properly document why fs_write_attr() does what it does.
* As even the author of fs_attr.c was trying to use fs_write_attr() in an
  unsupported way in the cp copy_attributes() implementation, try to be
  more forgiving and support writing attributes at an offset. The method is
  required to behave inconsistent in that replacing bytes at offset 0 is
  not supported as replacing bytes at any other offset. Writing at offset 0
  will clobber the existing attribute to stay compatible with BeOS.

NOTE: BFS itself still does not support writing attributes at an offset which
are withing the "small data section". To work around this problem, programs
which copy attributes in a loop must make sure that their buffer is large
enough that such "small data section" attributes require only one loop
iteration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-29 09:08:43 +00:00
Ingo Weinhold
58e784dfe6 Don't build compatibility.c for non-gcc2 anymore.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-14 11:10:36 +00:00
Oliver Tappe
78176019e6 * squashed a TODO in parsedate() about missing timezones - now both textual
(3-letter) and numerical timezones (e.g. -0700) are supported
This means that the workaround in mail_util.cpp of the mail kit could be
removed, but since I do not know if that should still support other versions
of BeOS, I have chosen to leave it alone.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-26 15:11:05 +00:00
Jonas Sundström
cb8f3e2698 More mipsel
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30621 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-05-03 22:41:38 +00:00
Ingo Weinhold
9073b0dccc Made _debuggerAssert()'s "message" parameter const. Fixes building with gcc4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-30 12:21:20 +00:00
Axel Dörfler
317bd7dda3 * Changed directory structure as suggested on the mailing list.
* Made the TimeZoneView less error prone, and also actually use Haiku code (the
  previous check didn't work since it used #if, not #ifdef).
* Also took the liberty to rename our boot loader to haiku_loader, since I had
  to update the nasm binary anyway. Updated the assembly sources to nasm 2.0.
* I haven't found where the synth location in the MIDI code is specified,
  though.
* Also, NetBootArchive, and FloppyBootImage haven't been updated yet. Will do
  so next.
* Some optional packages still put their license to beos/etc/licenses. I didn't
  update them yet, as we'll probably do so anyway at some point. Also, I think
  we might want to introduce a common/data/licenses instead for those.
* If you encounter any problems, please tell!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29876 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-03 09:02:44 +00:00
Michael Lotz
3e37362327 At least if we hit the boot volume override the hardcoded check for BFS. This
makes the Desktop work when booted from an iso only CD, but I agree with the
TODO to move those into the filesystem API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29518 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-14 15:29:49 +00:00
Ingo Weinhold
80ece78534 Added private get_image_symbol_etc() that can recursively search for a symbol
(similar to how dlsym() works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-28 18:50:40 +00:00
Axel Dörfler
78e1849576 * atomic_test_and_set() did actually not test if the lock was lost, and
would therefore not always work correctly.
* Minor cleanup, added return register for completeness.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-21 11:28:50 +00:00
Ingo Weinhold
0c85bd054e * Reworked undefined symbol resolution in the runtime loader. Got rid of
the per-root-image breadth-first sorted image array. Instead we have a
  per-image hook function to resolve the symbols. The default function
  uses the sLoadedImages list directly, which is breadth-first sorted
  anyway. There's also a BeOS function for old-style symbol resolution
  and one for add-ons, which lacks a proper implementation yet (just
  uses old-style ATM).
* Made the dl*() functions POSIX compliant:
  - dlopen() does no longer use load_add_on(), but loads the object as a
    library. It also properly supports a NULL name, now -- the previous
    "_APP_" work-around did only work, if this soname was set on the
    program (unlikely for programs using this API).
  - Implemented RTLD_{GLOBAL,LOCAL}.
  - dlsym() looks up symbols properly now, i.e. not just in the given
    image, but breadth-first for an actual image or in load order for
    the global scope. It also supports the not-quite POSIX RTLD_DEFAULT
    and RTLD_NEXT extensions. Our RTLD_NEXT finds more symbols than in
    Linux (also in later dlopen()ed libraries), but that should be fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-08 22:40:56 +00:00
Ingo Weinhold
e10b4cace5 Added __arch_get_caller(). Correctly implemented for x86 only.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28567 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-08 22:09:28 +00:00
Ingo Weinhold
19d40f9eb7 Moved the rld_export structure from <user_runtime.h> to
<runtime_loader.h>, since it isn't a kernel <-> userland interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 03:43:01 +00:00
Ingo Weinhold
2ef4a8b524 Moved the variable cv_factor from the text to the bss section.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-02 02:58:38 +00:00
François Revol
d4dcbf95f6 - Fix build.
- make system_time() return something sensible until platform code works.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28271 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 21:23:55 +00:00
Michael Lotz
39e9e0e43b Fix typo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 08:08:31 +00:00
Michael Lotz
c2b295654c Initialize the parameters to NULL so that a later reload doesn't try to free
uninitialized memory. Fixes a crash on boot with a preloaded settings file
present that wasn't used before the boot device was available (like the vm
settings file).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 08:06:30 +00:00
Axel Dörfler
25174582be Fixed two problems recently introduced by korli and found by aldeck:
* When invalidating unused settings, we should remove the handle from the list
  before freeing it, or else the settings list will be corrupted.
* We should protect the safemode settings against being removed, or else they
  won't be availabe anymore after we mounted the boot device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28033 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 13:38:01 +00:00
François Revol
9f5e12b6b3 - use asm_def.h and FUNCTION_END
- remove some dead ppc code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28023 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 09:25:13 +00:00
Jérôme Duval
3c4a3ce31c * correctly init ref_count on driver settings handles
* unload settings when ref_count is zero and boot device is available


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 14:58:12 +00:00
Ingo Weinhold
f711e9dc45 Use esi instead of ebp. The latter usually is the stack frame pointer --
using it for something else screws stack traces while being in such a
function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27772 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-29 00:37:35 +00:00
Ingo Weinhold
8cc146385f Use the new <asm_defs.h> header in x86 assembly files. Particularly
added FUNCTION_END() calls for a good deal of functions. The respective
ELF symbols do now have a correct size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27718 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-23 22:50:30 +00:00
Axel Dörfler
ca7cb625b9 * Implemented a (private for now) get_system_info_etc() call, that can retrieve
various system information.
* Implemented retrieving some VM stats via this call.
* The VM now maintains a page fault counter, and sets system_info::page_faults
  accordingly.
* Added a (pretty simple) "vmstat" command line app.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-17 16:27:17 +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
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
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
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
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
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
9c5c79ad86 * Made DIR definition private, and moved it into the new dirent_private.h
header.
* Added fields necessary to make it possible to retrieve more than one
  dirent from the underlying file system.
* Unless some app creates a DIR on its own to it to feed readdir(), this
  change should be binary compatible. If we find an application misbehaving,
  we can still make it a GCC4 only thing.
* fs_attr/fs_index/fs_query now all use readdir() directly (as that one
  contains the logic to iterate through a number of dirents in userspace).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26339 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-09 11:16:00 +00:00
François Revol
27fc711986 Fix gcc4 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 16:10:57 +00:00
Ingo Weinhold
2965c99fea * Changed the _kern_exec() and _kern_load_image() syscalls. They expect
a flattened argument/environment buffer now. This simplifies the work
  for the kernel a bit, since it can just copy the buffer and check
  whether it looks OK instead of messing around with individual strings.
  The runtime loader also gets a flattened array.
* Set the maximum size of the arguments/environment buffer to 128 KB.
  When more arguments are passed, we fail with a proper error code
  (instead of just truncating the arguments as before).
* On exec*() the first argument was silently replaced by the given path
  name, which is not correct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 03:37:07 +00:00
Jérôme Duval
9f3408f86f build fix
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-08 20:34:49 +00:00
Michael Lotz
f5b3a6a796 * Initialize all static mutexes in the kernel through a MUTEX_INITIALIZER()
and remove the then unneeded mutex_init() for them.
* Remove the workaround for allowing uninitialized mutexes on kernel startup.
  As they are all initialized statically through the MUTEX_INITIALIZER() now
  this is not needed anymore.
* An uninitialized mutex will now cause a panic when used to find possibly
  remaining cases.
* Remove now unnecessary driver_settings_init_post_sem() function.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25812 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-05 23:19:27 +00:00
Jérôme Duval
269dbbdc5c fix ppc libroot build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-21 20:45:09 +00:00
Ingo Weinhold
6b202f4e3d * Introduced new header directory headers/private/system which is supposed
to contain headers shared by kernel and userland (mainly libroot).
* Moved quite a few private kernel headers to the new location. Split
  several kernel headers into a shared part and one that is still kernel
  private. Adjusted all affected Jamfiles and source in the standard x86
  build accordingly. The build for other architectures and for test code
  may be broken.
* Quite a bit of userland code still includes private kernel headers.
  Mostly those are <util/*> headers. The ones that aren't strictly
  kernel-only should be moved to some other place (maybe
  headers/private/shared/util).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-14 03:55:16 +00:00
Ingo Weinhold
4c49f2056b * Changed _kern_spawn_thread() and create_thread(): Instead of individual
arguments they get a single thread_creation_attributes structure now.
* Added stack_address and stack_size to thread_creation_attributes,
  which allow to specify the stack size or the stack to be used for the
  new user thread.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25389 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-09 01:32:36 +00:00
Axel Dörfler
2239c25b29 Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-02 12:39:17 +00:00
Ingo Weinhold
0c615a01ae * Removed old mutex implementation and renamed cutex to mutex.
* Trivial adjustments of code using mutexes. Mostly removing the
  mutex_init() return value check.
* Added mutex_lock_threads_locked(), which is called with the threads
  spinlock being held. The spinlock is released while waiting, of
  course. This function is useful in cases where the existence of the
  mutex object is ensured by holding the threads spinlock.
* Changed the two instances in the VFS code where an IO context of
  another team needs to be locked to use mutex_lock_threads_locked().
  Before it required a semaphore-based mutex implementation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-01 22:07:36 +00:00
Ingo Weinhold
f694f63e2b * Moved private passwd/group/shadow passwd limit constants from
<libroot_private.h> to <user_group.h>.
* Added support in the registrar for adding and modifying users.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-19 00:10:51 +00:00
Ingo Weinhold
7727e08e5f Added experimental public API get_port_message_info_etc(). It is similar
to port_buffer_size_etc(), but returns the info through a structure,
which also identifies the sender (uid, gid, team ID) of the message.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25003 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-17 17:46:02 +00:00
Ingo Weinhold
b9f23a3497 Moved KMessage from libbe to libroot.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-16 17:55:55 +00:00
Ingo Weinhold
0931d2f309 Use the thread-safe getpwuid_r() instead of getpwuid().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-04-02 15:09:50 +00:00
Ingo Weinhold
8560d1885b * The runtime_loader's test_executable() no longer analyzes the
executable permissions of the file by hand. We use _kern_access()
  instead, which also handles the root case correctly.
* The user and group arguments of test_executable() aren't needed any
  longer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-20 01:45:00 +00:00
Axel Dörfler
d401b8f030 * _rtDebugFlag is supposed to default to true (is usually only used when
DEBUG is defined, anyway). This fixes bug #1892.
* _debugPrintf() and _sPrintf() are supposed to be silent when _rtDebugFlag
  is false.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-05 19:41:05 +00:00
Ingo Weinhold
7539ff87da As already commented in #1824 this is incorrect.
Running scripts with load_image() works again.


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-26 00:03:51 +00:00
Ingo Weinhold
392ad2822d axeld + bonefish:
BeOS R5's glue code incorrectly calls _thread_do_exit_notification()
when main() returns, while Haiku does that in exit(). Therefore when
terminating this way the exit hooks were called twice for executables
built under BeOS R5. This caused e.g. NetPositive or the R5 svn to
crash on exit (our network code actually uses those hooks).
Fixes bug #1742.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23975 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-17 14:12:02 +00:00
Ingo Weinhold
01335789e4 axeld + bonefish:
Removed the "config" subdirectory in the /boot/common directory
structure.


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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23686 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-21 15:10:05 +00:00
Jérôme Duval
9ce320179c __m68k_get_time_base instead of __m68k_time_base
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-19 19:27:35 +00:00
François Revol
d296c4e1f9 Fixed swapping functions.
BFS now validates the superblock and the boot menu now lists the image if I force checking for kernel_x86. \o/


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

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



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 00:36:44 +00:00
Stefano Ceccherini
5945644720 Implemented _debuggerAssert().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-20 16:15:27 +00:00
François Revol
05c6416eba Add macros for syscalls with 11 to 13 args.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22933 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-15 22:59:35 +00:00
Jérôme Duval
f87a6142a4 SYSCALL20 is needed on x64-64
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22808 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-02 19:18:01 +00:00
Jérôme Duval
7d2666b85a added a few more syscalls arguments for _kern_create_child_partition()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22793 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 19:36:34 +00:00
François Revol
1b6ddd3492 Optimized 64bit atomics:
- use movem
- fix return value: the convention is to return in d0:d1 (MSB:LSB)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-11-01 03:43:08 +00:00
François Revol
b82ae48b36 Note on use of TAS,CAS and CAS2 on Amiga.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 22:27:31 +00:00
François Revol
fac9743e5c s/ppc/m68k/
Lure the preprocessor to not replace #n by "123" for syscalls...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22739 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-26 17:09:08 +00:00
François Revol
2bbf13b7a5 Add syscalls.
Fix CAS2 usage, only supports (An) addressing mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22727 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 18:45:34 +00:00
Axel Dörfler
fcfbb8aa6c libprefs.so uses the private _klock_node_() syscall, and even loops until it
returns success - since this stub always returned failure, this prevented all
apps using that library (like Gobe Productive) from running.
It now calls the Haiku equivalent _kern_lock_node(), and Gobe now runs fine!
This closes bug #562.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22724 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 17:04:10 +00:00
François Revol
00c8f3104c Add a warning about CAS2: 060 doesn't have it, we'll loose 64bit atomics :^)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22704 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-25 00:39:27 +00:00
François Revol
51238e6bd3 Missing Jamfile.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-23 23:38:34 +00:00
François Revol
cb44673606 Naive swap_float/double. Not sure sizeof(double) is 8 on m68k...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22664 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 15:50:27 +00:00
François Revol
1609107a45 - some swap asm.
- 64bit atomic ops.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-22 00:48:01 +00:00
François Revol
188b43270e m68k arch files for libroot.
Mostly ppc from r22648. Some atomic_* done.


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



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-02 19:47:31 +00:00
Michael Pfeiffer
1384a3a81f Make C compiler happy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 17:09:46 +00:00
Michael Pfeiffer
fc069a2ace * Updated copyright header.
* Initial implementation of suggest_thread_priority. It behaves like version from BeOS R5. 
* TODO take arguments 'period', 'jitter', and 'length' into account as well . 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21825 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 16:35:19 +00:00
Stephan Aßmus
c68e76bc26 * if there is any app actually using suggest_thread_priority() it won't
no longer use idle priority, even if an actual implementation is still
  missing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21820 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-04 11:19:56 +00:00
Axel Dörfler
74c0424a43 * Added a mechanism to retrieve a BMessage with eventual error descriptions
for _kern_load_image().
* Added KMessage to the runtime_loader (a bit hacky, though) - it will use
  it to deliver the above mentioned functionality.
* load_dependencies() did return the wrong status code in case a library
  was missing; now it returns B_MISSING_LIBRARY.
* load_dependencies() will now try to load all dependencies when a report
  message is requested; therefore, all missing libraries are listed.
* Renamed uspace_program_args to user_space_program_args.
* The kernel filled in various members of the user_space_program_args structure
  unsafely, ie. was not using user_memcpy().
* Renamed some local variables in team.c to better fit our style guide (ie.
  uargs to userArgs).
* Changed Tracker to use the new _kern_load_image() variant on Haiku to retrieve
  and report all missing libraries. This fixes bug #1324.
* Adapted kernel_cpp.cpp to the runtime loader as well; the latter will now
  compile with _LOADER_MODE defined.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21715 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-27 02:32:19 +00:00
Axel Dörfler
88c66c0dfb * I broke create_path() with r21194; unlike strncpy(), strlcpy() needs enough space for
the terminating null byte as well. This fixes bug #1239.
* Using strlcpy() makes clearing the path buffer superfluous.
* Some more cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-25 11:06:25 +00:00
Axel Dörfler
261fd618fe * Now uses find_directory() when used inside the kernel.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-22 13:06:51 +00:00
Axel Dörfler
7be2dafba9 fs_write_attr() is supposed to remove an existing attribute value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21202 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-22 09:24:19 +00:00
Axel Dörfler
6430c89618 * Added find_directory() to the kernel - it currently may not work as good as the
userland version, tbough.
* Small style cleanup in find_directory.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21194 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-05-21 22:28:02 +00:00
Ingo Weinhold
44b5d72b5a Added new functions to the debugger API:
{set,clear}_debugger_{break,watch}point(), allowing to set/clear break
and watchpoints for the calling team. When a break/watchpoint is hit,
the team enters the debugger. Handy in situations when the program in
question can't really be started in a debugger (or it would be
complicated to do so). The functions work only as long as no debugger is
installed for the team.

We clear the arch specific team and thread debug infos now, when a new
debugger is installed, thus clearing break- and watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-20 16:20:13 +00:00
Jérôme Duval
d4d9831990 merge both commpage.h into the private header
Travis, I hope this fits your needs :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20173 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-20 00:21:45 +00:00
François Revol
c8d3c6f470 Implemented get/setrlimit(RLIMIT_NOVMON). Note the kernel calls don't set errno... but they're called by user versions. Might want to split them if needed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-19 15:48:02 +00:00
Travis Geiselbrecht
1cbf8f4b3c initial support for a commpage, which is a chunk of memory in high kernel space with user readonly permissions.
The first use is to let the kernel decide what the preferred syscall mechanism is at boot time and copy the
appropriate user space code there. Can be used for routines the kernel can decide best how to use (memcpy, some
timing routines, etc).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-19 00:32:44 +00:00
Travis Geiselbrecht
ea4ff0f689 is_computer_on() lives again as a true syscall.
Replaced the _kern_null syscall with _kern_is_computer_on.
is_computer_on_fire is a bit harder, since it returns a float from kernelland, which
at the moment isn't supported in haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20069 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-04 21:08:35 +00:00
Axel Dörfler
a9d09fc255 Added _kstatfs_() for binary compatibility with some BeOS apps (most notably, SoftwareValet).
We might want to remove it again once we have a replacement for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19929 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-23 21:01:18 +00:00
Axel Dörfler
7f4e6824df Added a private call to get the dependencies of a loaded image. This will be used
to determine linkage of libnet.so vs. libsocket.so/libbind.so in the libnetwork.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19008 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-10-06 11:40:20 +00:00
Axel Dörfler
48096634af Enabled private BeOS syscalls for the build with GCC 4 as well for now, until
this issue has been solved in the code that needs them (which is the same as
the PPC version also does at this time).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-22 20:48:12 +00:00
Axel Dörfler
05c0dde554 Uh, the reason why ping did only work once, was because set_alarm() did not call
the existing syscall...
The second ping now ends in a kernel panic, though 8-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-26 13:19:52 +00:00
Bruno G. Albuquerque
bcf475ec65 Made our version of is_computer_on_fire() behave like the BeOS one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18259 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-25 00:26:03 +00:00
Axel Dörfler
9f53e3dccf Fixed build for non-Haiku targets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-16 14:32:05 +00:00
Axel Dörfler
2da9a41214 When calling debugger(), it will now (temporarily) dump a message to serial output
as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17760 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-07 15:11:39 +00:00
François Revol
c2be814ab5 added an Haiku-specific RLIMIT (NumOpenVnodeMONitors) (UNIMPLEMENTED yet) (we might want to renumber it),
and used that one and NOFILE to implement R5 private calls _kset_[fd|mon]_limit_()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17545 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-22 19:37:40 +00:00
Axel Dörfler
e2793c5db4 Fixed warning.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17512 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-19 13:05:56 +00:00
Jérôme Duval
ad34885a2b actually set timezone in the kernel, and in the settings
should help on bug #583, and even fix it
minor change in localtime


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-13 15:52:32 +00:00
Axel Dörfler
805cb76ed8 * Added several R4.5 compatibility exports - they are now only compiled when GCC
2.95 is used.
* Added empty _klock_node_() syscall for compatibility - all R5 syscalls are now
  also only compiled with GCC 2.95.
* This should fix bug #403.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17011 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-05 10:48:47 +00:00
Jérôme Duval
5a2ad00cab fix a TODO in _user_mount : added an argsLength parameter
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-20 18:04:27 +00:00
Axel Dörfler
df213cedbc * CPUs can now be disabled - that is, they will keep idling.
* Added syscalls _kern_set_cpu_enabled() and _kern_cpu_enabled().
* scheduler.c::sRunQueue::tail was not maintained at all; changed sRunQueue to
  be a simple thread pointer instead of a struct thread_queue.
* Turns out we're monitoring CPU activity incorrectly when we've got more
  than one CPU.
* Renamed the global CPU array from "cpu" to gCPU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16186 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-01 16:09:05 +00:00
Ingo Weinhold
15af38b288 Removed pointless comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-08 04:54:47 +00:00
Ingo Weinhold
262e0a636b We use the same strategy for computing the system time as on x86 now.
The time base conversion factor is the 32 bit value
  2^32 * 1000000 / time base frequency,
so the system time can be computed by
  system time = time base * conversion factor / 2^32.
The expression in system_time() looks more complicated now, but is
actually much faster (factor 2.5 on my Mac mini). I'm positively
surprised, how good the assembly looks, that GCC 4 generates. There's
not that much potential for optimization by hand-coding the function.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-07 23:05:56 +00:00
Ingo Weinhold
b264ddab5d Corrected copyright. :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-07 20:27:13 +00:00
Stephan Aßmus
34a9556215 Made our glue code compatible to BeOS again. IOW executables compiled for Haiku will
now run under BeOS as well (as long as they don't use any functions that are not
available under R5).
The solution is a bit messy, but we have to live with it :-)
The runtime loader now patches the __gRuntimeLoader symbol in libroot.so to point
to its exported structure instead of passing it to the init functions as an
argument.
(Hax0red by axeld and bonefish on stippi's assimilated machine -- resistence is futile)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15848 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-06 03:48:11 +00:00
Jérôme Duval
8f9f676b46 we don't use atomic_get64 to read a read-only area, not authorized and throw a VM fault
this fix #83 partially


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15845 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-05 15:09:50 +00:00