Commit Graph

47 Commits

Author SHA1 Message Date
deischen
d19e06365b Clean up syscall generation in libc by removing HIDDEN_SYSCALLS
and treating (almost) all system calls the same way:

	__sys_foo - actual syscall
	foo, _foo - weak definitions to __sys_foo

Change PSEUDO syscalls (currently only _exit and _getlogin) to
be __sys_foo (T) and _foo (W).

Add $FreeBSD$ to a few files to satisfy commitprep.

Suggested by:	bde
2001-01-29 03:23:46 +00:00
deischen
c8399e648f Comment only change; s/_thread_sys_/__sys_/ 2001-01-26 02:41:07 +00:00
deischen
dd8c04d769 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
jake
93aa222459 Remove last vestiges of thr_sleep and thr_wakeup from libc. 2000-12-02 05:58:03 +00:00
jhb
fcf0be3f78 Remove duplicate FreeBSD id tags. 2000-08-21 21:05:44 +00:00
peter
1fc82abee8 Take a shot at implementing a functional rfork_thread() for alpha. This
was not fun and I am not entirely certain of the correctness, but it seems
to work.  (in fact, side by side testing of this code vs the x86 version
turned up hidden bugs in the x86 code).
2000-07-29 11:43:21 +00:00
jhb
52ab13c306 Finish moving all IEEE fp types to be the same on all arch's. 2000-05-10 19:41:40 +00:00
obrien
ad56337639 Add FreeBSD Id tags. 2000-05-10 19:04:57 +00:00
obrien
89e3b021b3 fp_except => fp_except_t for consistancy with the i386 and the tradition
C methoid of nameing types.
2000-05-10 19:00:45 +00:00
jasone
576c454894 Take care to avoid having "strong" and "weak" symbols of the same name in
libc_r.
2000-03-16 02:14:41 +00:00
jasone
e8ddbcd7dc Undo the ill-conceived breakage of the previous commit and really fix:
For libc_r renamed syscalls, correct symbol naming from
_thread_sys_foo() <-- _foo() to _thread_sys_foo() <-- _foo() <-- foo().  This
is necessary for system calls which libc_r doesn't define foo().

Some weak symbols such as poll() are defined twice.  From what I understand,
depending on one weak symbol or the other to be used is a bad idea.  All
such weak symbols defined in the libc_r-specific code should therefore be
made strong (non-weak?).

Simplify PSEUDO() to not define any weak symbols, since they aren't ever
needed.

alpha/SYS.h:

Correct reversed usage of WEAK_ALIAS(), which has reversed arguments from
__weak_reference().  Also, fix reversal of symbols, so that syscall foo()
is a weak alias for _foo().

Add WEAK_ALIAS() call to PRSYSCALL(), which unlike the i386 version of
PRSYSCALL(), is not defined in terms of PSYSCALL().

Make PSEUDO() equivalent to the i386 version.
2000-01-29 12:50:47 +00:00
jasone
cd327890c7 For syscalls that are renamed to _thread_sys_foo, create a weak alias
called _foo, not _thread_sys_foo.
2000-01-28 22:47:21 +00:00
jasone
495ec2dee2 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
jasone
210e36a480 Remove unnecessary alternate entry points for *setjmp(). Make the main
entry point the standard name when not compiling libc_r (for example,
longjmp is the main entry point instead of __longjmp).

Suggested by:	bde
2000-01-20 21:58:27 +00:00
jasone
eaa6ee2770 Make minor entry point changes to support libc_r. 2000-01-19 07:01:40 +00:00
bde
908e27521d Fixed corrupted tabs in previous commit. 2000-01-14 15:47:00 +00:00
jasone
18911a1818 Fix unresolved _libc_*() references in libc by creating weak aliases
to the respective system call entry points.
2000-01-13 09:26:50 +00:00
jasone
e200b118e2 Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
jdp
14e728d1e2 In longjmp, call sigreturn instead of osigreturn. The latter isn't
visible from userland any more.

Reviewed by:	luoqi
1999-10-14 01:16:51 +00:00
marcel
7fab124ecf Not needed now the syscall matches the prototype. 1999-10-12 09:38:57 +00:00
dfr
e3a5765da3 Remove old sig* wrappers. 1999-10-09 12:11:31 +00:00
jdp
bf0a5cd1a1 Fix misspelling of the "addq" opcode. 1999-09-29 21:10:25 +00:00
marcel
594e4a63a8 sigset_t change (part 5 of 5)
-----------------------------

Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c

The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.

There are version bumps for the following libraries:
  libdialog
  libreadline
  libc
  libc_r
  libedit
  libftpio
  libss

These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.

NOTE: libncurses already had an version bump and has not been
      given one now.

NOTE: doscmd is a real casualty and has been disconnected for
      the moment. Reconnection will eventually happen after
      doscmd has been fixed. I'm aware that being the last one
      to touch it, I'm automaticly promoted to being maintainer.
      According to good taste this means that I will receive a
      badge which either will be glued or mechanically stapled,
      drilled or otherwise violently forced onto me :-)

NOTE: pcvt/vttest cannot be compiled with -traditional. The
      change cause sys/types to be included along the way which
      contains the const and volatile modifiers. I don't consider
      this a solution, but more a workaround.
1999-09-29 15:18:46 +00:00
peter
e226894fa0 $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
simokawa
db7f2501e9 Just return `curbrk' for sbrk(0) to avoid syscall overhead. 1999-06-26 15:22:33 +00:00
dfr
6dc6b2c4f2 Declare the return address for __divX, __remX so that gdb can step over
calls properly.
1999-05-02 12:05:09 +00:00
dt
b9568a7d64 Add wrappers for pread and pwrite syscalls. 1999-04-04 21:46:24 +00:00
dfr
1f44466061 Rename when building libc_r. 1999-03-25 18:43:17 +00:00
dfr
0c8900b543 [This is a null commit to supply the correct log entry]
Rename 'cerror' to '.cerror' so that programs which have a function or
global variable named 'cerror' don't completely break the syscall error
reporting mechanism.
1998-12-23 11:55:42 +00:00
dfr
82f430f229 Implement fpsetmask() and other fp*() functions. Programs should use
#include <ieeefp.h>

to access these functions instead of the i386 specific

	#include <machine/floatingpoint.h>

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
1998-12-23 11:50:52 +00:00
jb
7756aff94f CALL -> PCALL for sigaltstack for libc_r. 1998-12-10 20:36:24 +00:00
dt
6c8d2b9af4 In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an alias
to fork. It is difficult to do real vfork in libc_r, since almost every
operation with file descriptsor changes _thread_fd_table and friends.

popen(3) works much better with this change.
1998-09-12 22:03:20 +00:00
jb
82c53b9620 Remove support for NetBSD syscalls. 1998-08-17 03:46:10 +00:00
jb
3804c0aaf2 Remove the comment about how to get NetBSD syscalls since there are
now programs built on alpha that _must_ use FreeBSD syscalls to work.
1998-08-17 03:35:09 +00:00
jb
b3f5a66dcb If using FreeBSD syscalls, handle the syscalls that don't require
default asm code the same way as on i386.
1998-08-08 02:25:46 +00:00
jb
e73e3cdd11 Include FreeBSD's syscall.h if not using NetBSD syscalls. 1998-08-08 02:24:03 +00:00
jb
daa1485a0d Allow for the fact that NetBSD syscalls are no longer the default. Call
sigaltstack by default if using FreeBSD syscalls.
1998-08-08 02:20:24 +00:00
jb
15d1e885b4 Make NetBSD compatibility conditional on NETBSD_SYSCALLS being defined.
This is no longer the default.
1998-08-08 02:18:07 +00:00
jb
4509ca137d References to NetBSD syscalls changed to just a comment about what to
add to /etc/make.conf to use FreeBSD's libc with a NetBSD/Alpha kernel.

From now on, FreeBSD/Alpha is just FreeBSD.
1998-08-08 02:14:45 +00:00
jb
149fd6eca0 Remove __NETBSD_SYSCALLS from CFLAGS now that it is set in sys.mk. 1998-06-09 22:59:16 +00:00
jb
2cefa1efbd Rename calls when building libc_r. 1998-06-09 22:57:34 +00:00
jb
41d132df3f Make this thread-safe in both libc as well as libc_r. 1998-06-09 22:56:24 +00:00
jb
09fd5b9594 Rename when building libc_r. 1998-06-09 22:45:39 +00:00
jb
b4d7deb8ae Add rename support for libc_r. 1998-06-09 22:43:34 +00:00
jb
f1a3ae93df Remove a big hack after adding a small one to libc/gen/getcwd.c to
handle the lack of __getcwd syscall in NetBSD.
1998-05-15 12:01:06 +00:00
jb
9b139e6792 Oops, we don't need NetBSD's malloc 'cause we can turn off utrace
in phk's malloc.
1998-03-09 07:03:06 +00:00
jb
85517e8b5f Import sources from NetBSD, tweaked for building in FreeBSD. 1998-03-09 06:34:43 +00:00