Commit Graph

4178 Commits

Author SHA1 Message Date
Simon L. B. Nielsen
c9ae54eebb * Merge index(3) and rindex(3) to index(3) since the two functions are
almost identical.
* Merge strchr(3) and strrchr(3) to strchr(3) since the two functions
  are almost identical.
* Make the wording of index(3) and strchr(3) more similar.
* mdoc(7) cleanup.

Submitted by:	SUZUKI Koichi <metal@gc5.so-net.ne.jp>, keramida, myself
PR:		docs/32054
Reviewed by:	ru
Approved by:	ceri (mentor)
2003-07-28 22:50:42 +00:00
David Xu
4160fed551 Set mc_len to sizeof(mcontext_t), otherwise it is an invalid context. 2003-07-26 12:58:28 +00:00
Marcel Moolenaar
938b878e45 Revert previous commit. We don't use setjmp()/longjmp() for context
switching anymore, so there's no need to save and restore GP. This
change breaks threaded applications linked against libc_r. Pull the
tier 2 card again: relink. This will link against libthr instead.
2003-07-25 22:36:48 +00:00
Maxime Henrion
434252892a An u_int8_t can never be bigger than 255, so remove a useless check.
Spotted by:	GCC
2003-07-25 12:23:25 +00:00
Robert Watson
82fefada64 Print group name in getfacl output when calculating an effective
permission set based on a more restrictive mask.

Submitted by:	Glen Gibb <grg@ridley.unimelb.edu.au>
2003-07-24 23:33:25 +00:00
Diomidis Spinellis
55e24f6e77 Document an additional error return value. The connect(2) call can also
return EACCES on non-Unix domain sockets as demonstrated by the
following program:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int
main(int argc, char *argv[])
{
	struct sockaddr_in rem_addr;
	int sock;

	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
		perror("socket");
		exit(1);
	}

	bzero((char *)&rem_addr, sizeof(rem_addr));
	rem_addr.sin_family = AF_INET;
	rem_addr.sin_addr.s_addr = INADDR_NONE;
	rem_addr.sin_port = htons(10000);

	if (connect(sock, (struct sockaddr *)&rem_addr,
sizeof(rem_addr)) < 0) {
		perror("connect");
		exit(1);
	}
}

The call chain returning this value is probably:

kern/uipc_syscalls.c:connect
kern/uipc_socket.c:soconnect
netinet/tcp_usrreq.c:tcp_usr_connect
netinet/tcp_output.c:tcp_output
netinet/ip_output.c:ip_output

Reviewed by:	schweikh (mentor)
MFC after:	2 weeks
2003-07-23 22:00:08 +00:00
Peter Wemm
a1f8a9b1e8 Instantiate explicit callable versions of the machine/ieeefp.h inlines
for the use of non-GCC compilers and C++ code.
2003-07-22 06:46:17 +00:00
Peter Wemm
58452af3e5 Turn off the libc/quad functions since they are not needed for amd64
and just cause lots of warnings.
2003-07-22 06:34:57 +00:00
David Xu
5e27d6ab96 Make raise and _raise as weak symbols, so they can be overriden by
thread library.

Reviewed by: deischen
2003-07-19 05:22:56 +00:00
Daniel Eischen
4adc354c34 Add amd64 versions of makecontext() and signalcontext() needed
for libkse (makecontext() is also needed for libthr).
These probably will need some tweaking.
2003-07-19 04:41:08 +00:00
Garrett Wollman
157c8e69d7 Rewrite to reflect slight change in semantics for C99, and note a bug
in the standard.  Defer to gettimeofday(2) for error indications.
2003-07-19 03:19:59 +00:00
Garrett Wollman
d09b896215 C99 compliance: time() always sets its return value in both places
(if present), even on error.

Pointed out by: Wojtek Lerch, on the Austin Group mailing-list
2003-07-19 02:53:46 +00:00
Bill Paul
0287aa1cee Revert to using yp_order() to probe for master.paswd.by* maps and
don't probe the server at all for passwd.by* maps. This fixes
interoperability with the Services For UNIX NIS server (which is
really a front end to Captive^WActiveDirectory). This server
incorrectly returns success for all YPPROC_MASTER requests,
even for maps that don't exist, which makes it impossible to
(ab)use it to probe for the existence of the master.passwd.by*
maps.

This is a little kludgey, but basically restores the original
behavior of getpwent.c as it is in -stable, and works around both
the lack of YPPROC_ORDER on NIS+ servers as well as the broken
YPPROC_MASTER on Services For UNIX servers.
2003-07-18 23:51:15 +00:00
Garrett Wollman
def6489df6 Whitespace after keywords per style(9). 2003-07-18 16:04:32 +00:00
Ceri Davies
513e86421d Back out revision 1.22.
Requested by:	bde
2003-07-15 12:23:12 +00:00
Ceri Davies
03606a211f ioctl macros and defines are now present in ioccom.h, not ioctl.h.
Update the manpage to reflect this.

PR:		docs/54235
Submitted by:	Karen Thode <thode12@msn.com>
2003-07-13 21:02:48 +00:00
Andrey A. Chernov
8b2749e901 Add const to __setrunelocale prototype 2003-07-06 04:01:09 +00:00
Andrey A. Chernov
68d429c3fc Reorganize wrapper around setrunelocale() to mark it as deprecated
in FreeBSD 6
2003-07-06 02:03:37 +00:00
Tim J. Robbins
8954a5c85a Add more useful cross-references to the SEE ALSO section. 2003-07-05 07:55:34 +00:00
Tim J. Robbins
759f7dc308 Catch up with recent FP-related changes to scanf.3 and vfwscanf.c. 2003-07-05 07:47:55 +00:00
Tim J. Robbins
4ea76cb195 Fix two incorrect uses of sizeof: we need to divide the size of the buffer
by sizeof(wchar_t) to get the number of wide characters it contains.
Remove the !hardway micro-optimisation from the CT_INT case to avoid
having to fix it for wide characters.
2003-07-05 03:39:23 +00:00
Tim J. Robbins
b5c3fe0098 Merge recent floating point conversion changes from vfscanf.c. 2003-07-05 02:35:06 +00:00
Ruslan Ermilov
b6f8b339d3 With the latest mdoc(7), we can now fix the synopsis like this.
Desired by:	bde
2003-07-03 18:14:39 +00:00
Jordan K. Hubbard
b0a06af596 When size is 1 should just null terminate the string. The dummy variable
is made an array of two, to explicitly avoid stack corruption due to
null-terminating (which is doesn't actually happen due to stack alignment
padding).

Submitted by: Ed Moy <emoy@apple.com>
Obtained from: Apple Computer, Inc.
2003-07-02 07:08:44 +00:00
Ian Dowse
318f2fb4bf Add a new mount flag MNT_BYFSID that can be used to unmount a file
system by specifying the file system ID instead of a path. Use this
by default in umount(8). This avoids the need to perform any vnode
operations to look up the mount point, so it makes it possible to
unmount a file system whose root vnode cannot be looked up (e.g.
due to a dead NFS server, or a file system that has become detached
from the hierarchy because an underlying file system was unmounted).
It also provides an unambiguous way to specify which file system is
to be unmunted.

Since the ability to unmount using a path name is retained only for
compatibility, that case now just uses a simple string comparison
of the supplied path against f_mntonname of each mounted file system.

Discussed on:	freebsd-arch
mdoc help from:	ru
2003-07-01 17:40:23 +00:00
Maxim Konovalov
8473e4cfc2 o strmode(3) returns void not 0.
PR:		docs/53488
Submitted by:	Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
MFC after:	1 week
2003-07-01 15:28:05 +00:00
Ruslan Ermilov
0b3cbc5c38 Axe AINC.
Submitted by:	bde
2003-07-01 15:07:01 +00:00
Bruce Evans
270f6e44db Fixed some style bugs. 2003-07-01 12:30:03 +00:00
Alfred Perlstein
9470460d7a Don't segfault if setproctitle(3) is called with NULL initially.
The old buffer was not being initialized and a later str*() op on
it would cause a crash if it wasn't initialized by a previous
call to setproctitle(3) with an actual string.

Noticed by: Ashley Penney <ashp@unloved.org>
2003-07-01 09:45:35 +00:00
Ian Dowse
ff1db98495 Separate the description of the flags for mount(2) and unmount(2)
to clarify which system call accepts which arguments. Previously
the manual page gave the impression that calling unmount() with
flags of (MNT_FORCE | MNT_UPDATE | MNT_RDONLY) would downgrade a
read-write mount to read-only, which is clearly untrue; to do that,
these flags should be passed to mount() instead.
2003-06-30 22:22:12 +00:00
Gordon Tetlow
09f49aab84 Add a libc function execvP that takes the search path as an arguement.
Change execvp to be a wrapper around execvP. This is necessary for some
of the /rescue pieces. It may also be more generally applicable as well.

Submitted by:	Tim Kientzle <kientzle@acm.org>
Approved by:	Silence on arch@
2003-06-29 17:33:34 +00:00
David Schultz
ec045e41d9 Teach fmtcheck(3) about the flags a, A, F, G, t, and z. 2003-06-29 01:11:31 +00:00
Ruslan Ermilov
f5913c9736 mdoc(7) fix: Use the normal AT&T macro (.At) rather than its
internal string in the macro context.
2003-06-28 22:12:30 +00:00
David Schultz
b6b7fb3782 Update to reflect changes in vfscanf.c,v 1.32. Remove bogus
documentation for %a, and document it correctly instead.
s/one of aefg/one of a, e, f, or g/

Reviewed by:	standards@
2003-06-28 09:03:25 +00:00
David Schultz
370077c7a6 Revamp scanf's floating-point-parsing algorithm to support
[+|-]Inf, [+|-]NaN, nan(...), and hexidecimal FP constants.
While here, add %a and %A, which are aliases for %e, and
add support for long doubles.

Reviewed by:	standards@
2003-06-28 09:03:05 +00:00
Yaroslav Tykhiy
b712059588 Correct a misspelled name of time_hi_and_version. 2003-06-27 13:41:29 +00:00
John W. De Boskey
788940b418 fix NIS+ YP compat mode
PR:		bin/52792
Submitted by:	TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
2003-06-27 03:37:44 +00:00
Alexey Zelkin
683fe11379 . style(9)
. fix/add comments (to cover changes done thru last 20 months)
. extend monetary testcase to cover int_* values
2003-06-26 10:46:16 +00:00
Alexey Zelkin
fca2738d67 Reduce code duplication by separating _PathLocle detection code into
internal helper function.
2003-06-25 22:42:33 +00:00
Alexey Zelkin
93c847344b Move _PathLocale declaration to more logical place (setlocale.c) 2003-06-25 22:34:13 +00:00
Alexey Zelkin
d8d4841398 Catch up with _PATH_LOCALE move from rune.h to paths.h 2003-06-25 22:31:42 +00:00
David E. O'Brien
ea5a1812ba mdoc police 2003-06-25 21:31:43 +00:00
David E. O'Brien
4c861aeb86 Be more specific in BUGS.
Submitted by:	ru

Add history.
2003-06-25 19:18:44 +00:00
David E. O'Brien
0ab6a0c787 Push the alloca #error warning farther down to play nicer with some out of
tree local translator.

Requested by:	 jmallett
2003-06-25 19:06:40 +00:00
Andrey A. Chernov
ba10c47105 Don't statically initialize buf to _PATH_DEV, _PATH_DEV always copied to
it in any case.
2003-06-24 22:20:06 +00:00
Yaroslav Tykhiy
9530d06766 Unify cross-references between sigpending(2), sigprocmask(2),
and sigsuspend(2), all three of which operate or depend on the
process signal mask.

Add a missing xref to sigsetops(3), without which the above three
syscalls would be useless.
2003-06-24 15:41:19 +00:00
Yaroslav Tykhiy
f8193a054c Supplement the cross-references section with those to sigpending(2)
and sigprocmask(2).  These two syscalls are likely to be accompanied
by a few sigsetops(3) in a typical piece of code.
2003-06-24 15:27:31 +00:00
Marcel Moolenaar
ec5f6d191d Implement signalcontext(). Needed by libpthread (aka libkse). 2003-06-24 05:06:42 +00:00
Warner Losh
f1fe8d5bac Add clarifications about the information that ntp_gettime returns.
TAI is a timescale, just like UTC.  The tai field returns the offset
between the two, and isn't really used for precision time keeping.
Explain in brief what a positive and a negative leap seconds are.  Add
some URLs to very useful web pages about time and time keeping for
more information on using this API.

Reviewed by: phk
2003-06-21 20:27:54 +00:00
David Schultz
d086ded323 Userland spinlocks bad. Sleep locks good.
Use the latter for gdtoa.

Requested by:	deischen (far too long ago)
2003-06-21 08:20:14 +00:00
Poul-Henning Kamp
97679e71b0 ttyname(3) must return absolute pathnames.
Noticed by:	kris
2003-06-21 08:16:12 +00:00
Poul-Henning Kamp
e7acddfdef Use devname(3) to do the task.
Reviewed by:	imp
2003-06-20 22:45:53 +00:00
Garrett Wollman
4f85c6dd30 Explain the relationship to POSIX. 2003-06-20 22:41:00 +00:00
Warner Losh
795b332691 ntp_adjtime returns the current state of the clock (TIME_*) on success
or -1 on failure.  The manual used to say it returned 0 or -1.  Both
examination of the kernel sources, and ntpd show that this is the case.

MFC After: 3 days
2003-06-20 21:14:59 +00:00
Poul-Henning Kamp
529ac58781 Add devname_r(3) which takes a buffer as argument. 2003-06-20 09:52:27 +00:00
Kris Kennaway
97cbd1c728 Remove bogus non-reentrant "temporary" implementation of gethostbyaddr_r()
that has been here for 6 years and 9 months.

Reviewed by:	deischen
MFC After:	1 week
2003-06-19 07:57:11 +00:00
Ruslan Ermilov
19c2ee9e5f Make the execle() synopsis look (again) like a normal C prototype.
Also fixed the rest of ell (list) functions prototypes to include
a (commented out) terminating null pointer.

Pointed out by:	bde
Obtained from:	POSIX.1-2001
Glanced at by:	imp
2003-06-18 15:24:21 +00:00
Maxim Sobolev
e2ff474cac Xref policy: exit(2) -> _exit(2). 2003-06-17 09:36:47 +00:00
Poul-Henning Kamp
bbaba031a5 Fix the execle(3) synopsis to include the environment pointer.
Confused:	anordby
2003-06-17 08:57:37 +00:00
Martin Blapp
b77aeb1292 Kill prototype for __msgwrite too. It is not needed anymore. 2003-06-15 10:55:39 +00:00
Martin Blapp
ce9bc43cb3 Replace the old SCM_CREDS cred procedures. They can now be
replaced just fine with getpeereid() and the whole code
gets a lot simpler. We don't break the ABI, since all server
programms use __rpc_get_local_uid(), and we just change library
internals.

Reviewed by:	des
2003-06-15 10:32:01 +00:00
David E. O'Brien
5c784c8f4b Only use this with a non-GCC compiler. 2003-06-14 06:04:23 +00:00
Tom Rhodes
720f2e44a3 Document ENOSPC.
PR:		52612
Submitted by:	Marc Olzheim <marcolz@ilse.nl>
2003-06-13 22:41:12 +00:00
Peter Wemm
70de0c73a5 This is unusable on amd64. Remove it before it causes more confusion.
It is only possible to do this on an ABI that has a compulsory frame
pointer, which the amd64 ABI does not.  Thus, it is only possible to
implement this as a compiler builtin.
2003-06-13 21:56:30 +00:00
Tim J. Robbins
77156cb782 Mark the following interfaces as OBSOLETE_IN_6:
fgetrune(), fputrune(), fungetrune(), mbrune(), mbrrune(), mbmb(),
    setinvalidrune(), UTF2 encoding method.
These have been marked as being deprecated in their manual pages since 5.0,
and their use causes a linker warning.
2003-06-13 07:13:54 +00:00
Jordan K. Hubbard
3dfdc427f1 Fixes to locale code to properly use indirect pointers in order to prevent
memory leaks (fixes bugs earlier purported to be fixed).
Submitted by:	Ed Moy <emoy@apple.com>
Obtained from:	Apple Computer, Inc.
MFC after:	2 weeks
2003-06-13 00:14:07 +00:00
David E. O'Brien
11f0fab4fa Use C99 compatible ASM statements.
(untested, but existing state breaks
http://triangle.rtp.freebsd.org/~des/tinderbox-CURRENT-amd64-amd64.brief)
2003-06-10 21:17:55 +00:00
Andrey A. Chernov
0c7fbc6c40 Remove transition period hack 2003-06-10 01:26:04 +00:00
John Baldwin
dff6f51034 Remove stale reference to the deprecated USER_LDT option. The associated
code is always compiled into the kernel now.

Submitted by:	Hubert Tournier <hubert@frbsd.org>
PR:		docs/53068
2003-06-09 11:46:22 +00:00
Philippe Charnier
ab165955de The .Fn function 2003-06-08 10:13:50 +00:00
Philippe Charnier
7712c6658b .Xr p1003_1b moved to .St -p1003.1b-93 2003-06-08 10:11:13 +00:00
Philippe Charnier
fe71ab1cf4 .Xr -> .Lb for librairy. There is no manual page corresponding to .Xr. 2003-06-08 10:07:14 +00:00
Philippe Charnier
0d511e328f Add or correct section number in .Xr. Use .Vt or .Fn
instead of .Xr when needed
2003-06-08 10:01:52 +00:00
Poul-Henning Kamp
c6dd496cd9 Recognize the magic NODEV value.
Format other unknown devices consistently in hex.
2003-06-05 21:55:57 +00:00
Robert Watson
44f5ca2f16 Document the new explicit listing API for extended attributes; note
that the old API (passing "" as the attribute name to the _get_
interface) is now deprecated (and was probably a bad idea).

Pointed out by:	Dominic Giampaolo <dbg@apple.com>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-06-04 04:00:26 +00:00
Hiten Pandya
8e9a665fde Document that kldload(2) can also return EEXIST.
Approved by: des (mentor)
2003-06-03 12:29:34 +00:00
Peter Wemm
3191d840e0 Cosmetic; record offsets used within jmpbuf 2003-06-02 22:37:53 +00:00
Peter Wemm
b8f8813c6e Fix sigsetjmp(). It helps if we do not try to save the old signal mask
to a random memory location.  Perl works a lot better with this.
2003-06-02 21:59:13 +00:00
David E. O'Brien
e683295e39 Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
Marcel Moolenaar
75fa7db991 o Fix a cut-n-paste bug. We were clobbering rp with gp...
o  Make sure the arguments to ctx_wrapper() are loaded from the
   backing store by forcing an underflow. Do this by making all
   registers in the register frame local.
2003-06-02 00:16:39 +00:00
Juli Mallett
d7ea49283c Match style of source and headers.
Submitted by:	bde
2003-06-01 21:35:27 +00:00
Ruslan Ermilov
0e35e492fc Assorted mdoc(7) fixes. 2003-06-01 19:19:59 +00:00
Andrey A. Chernov
9d793e98ec Add GBK encoding
PR:             51504
Submitted by:   Statue <statue@freebsd.sinica.edu.tw>
2003-06-01 15:30:56 +00:00
Poul-Henning Kamp
b600adca79 Clarify the code a bit.
Submitted by:	Nadav Eiron <nadav@TheEirons.org>
2003-06-01 09:16:50 +00:00
Juli Mallett
283d23cbba Make prototype match code with regard to constness of args to the
function pointer passed in.
2003-06-01 06:43:39 +00:00
Jens Schweikhardt
f8f6970098 Fix grammar bogons.
MFC after:	3 days
2003-05-31 21:14:41 +00:00
Marcel Moolenaar
fae3c3b7eb Rough implement of makecontext() needed to support libthr.
o  Up to 8 arguments are allowed. This is the number of arguments
   passed in registers. Subsequent registers are passed on the stack.
   Trying to deal with this is not easy in C and likely forces us to
   use assembly code. Let's avoid that for now. There's no indication
   that more than 8 arguments is a strong requirement (Linux also has
   an 8 argument limit).
o  We expect that the stack base is 16-byte aligned and the stack
   size is a multiple of 16-byte. We bomb out if this is not the case.
   We probably want to be less strict by enforcing it ourselves. For
   now it's better to not hide gross alignment bogons by silently
   correcting it.
2003-05-31 19:42:51 +00:00
Thomas Moestl
6bc615b0a1 Fix a sizeof error in __bt_put: when writing they key and data sizes
to a buffer in the big key/data case, memmove() was used on pointers
to size_ts, but only sizeof(u_int32_t) bytes where copied. This broke
on big_endian architectures where sizeof(size_t) > sizeof(u_int32_t).

This bug broke portupgrade (by way of ruby_bdb1) on sparc64.

Approved by:	re (rwatson)
2003-05-30 11:05:08 +00:00
Alexander Kabaev
8c22e2f77b Add an stub for _rtld_thread_init. This is a part I missed in
my last commit.

Approved by:	re (scottl)
2003-05-30 00:58:37 +00:00
Martin Blapp
65d06145a2 Don't return -1 and abort if msg.msg_controllen is 0. For
some strange reason recvmsg() never sets errno to EAGAIN
on a non-blocking socket and just returns 0.

Reviewed by:	jhb
Approved by:	re
2003-05-29 22:06:06 +00:00
Martin Blapp
e5cd12556d Fix a problem introduced in the last commit. sa and cm
are not initialized at this place. Move the initializing
before the non-blocking check.

Submitted by:	Marius Strobl <marius@alchemy.franken.de>
Reviewed by:	jhb
Approved by:	re
2003-05-29 19:43:22 +00:00
Martin Blapp
aee2eba2d1 If AF_LOCAL is used, we need to use __msgread_withcred() instead of
just read() in non-blocking mode too. The reason is obvious. NetBSD
uses a complete different way to get the credentials so this patch
only applies to FreeBSD.

Reviewed by:	rwatson
Approved by:	re
2003-05-28 09:16:35 +00:00
Martin Blapp
22e4d31a81 Fix amd(8) clients, if a FreeBSD mountd(8) server is used.
Remove the special treatment of non-blocking mode in
the "look ahead function" xdrrec_eof(). It currently
assumes that the last read() in a row of several reads
does not have zero lenght. If this is the case, svc_vc_stat()
does return XPRT_MOREREQS, and the RPC-request aborts because
there is no data to read anymore.

To fix this, go back to the original version of the code
for non-blocking mode until NetBSD comes up with another
possible fix like this one in xdrrec_eof()

	if (rstrm->last_frag && rstrm->in_finger == rstrm->in_boundry) {
		return TRUE;
	}

Return always FALSE in set_input_fragment() for non-blocking
mode. Since this was not used in FreeBSD, I omitted it at the
first time. Now we use this function and we should always
return FALSE for it.

Reviewed by:	rwatson
Approved by:	re
2003-05-28 09:13:09 +00:00
Max Khon
f4203da86c Fix stripping last path component when only one path component left.
PR:		52686
MFC after:	1 day
2003-05-28 08:23:01 +00:00
Ruslan Ermilov
734ac3b543 mdoc(7) fixes.
Approved by:	re (blanket)
2003-05-24 19:53:08 +00:00
Peter Wemm
b3aa27a531 Repair PIC mode. It seems I was a bit too excited about the
implications of native PC relative addressing.
2003-05-24 17:35:23 +00:00
Ruslan Ermilov
3a5146d9e2 Assorted mdoc(7) fixes.
Approved by:	re (blanket)
2003-05-22 13:02:28 +00:00
Ruslan Ermilov
aba60fa66b Fixed troff(1) and mdoc(7) warnings.
Approved by:	re (blanket)
2003-05-18 21:05:22 +00:00
Martin Blapp
f8af072548 Fix a simple bug that prevents svc_tli_create to bind to the address
specified by caller.

NetBSD rev. 1.6

Reviewed by:	rwatson
Approved by:	rwatson (re)
Obtained from:	NetBSD
2003-05-18 15:07:25 +00:00
Marcel Moolenaar
f2c49dd248 Revamp of the syscall path, exception and context handling. The
prime objectives are:
o  Implement a syscall path based on the epc inststruction (see
   sys/ia64/ia64/syscall.s).
o  Revisit the places were we need to save and restore registers
   and define those contexts in terms of the register sets (see
   sys/ia64/include/_regset.h).

Secundairy objectives:
o  Remove the requirement to use contigmalloc for kernel stacks.
o  Better handling of the high FP registers for SMP systems.
o  Switch to the new cpu_switch() and cpu_throw() semantics.
o  Add a good unwinder to reconstruct contexts for the rare
   cases we need to (see sys/contrib/ia64/libuwx)

Many files are affected by this change. Functionally it boils
down to:
o  The EPC syscall doesn't preserve registers it does not need
   to preserve and places the arguments differently on the stack.
   This affects libc and truss.
o  The address of the kernel page directory (kptdir) had to
   be unstaticized for use by the nested TLB fault handler.
   The name has been changed to ia64_kptdir to avoid conflicts.
   The renaming affects libkvm.
o  The trapframe only contains the special registers and the
   scratch registers. For syscalls using the EPC syscall path
   no scratch registers are saved. This affects all places where
   the trapframe is accessed. Most notably the unaligned access
   handler, the signal delivery code and the debugger.
o  Context switching only partly saves the special registers
   and the preserved registers. This affects cpu_switch() and
   triggered the move to the new semantics, which additionally
   affects cpu_throw().
o  The high FP registers are either in the PCB or on some
   CPU. context switching for them is done lazily. This affects
   trap().
o  The mcontext has room for all registers, but not all of them
   have to be defined in all cases. This mostly affects signal
   delivery code now. The *context syscalls are as of yet still
   unimplemented.

Many details went into the removal of the requirement to use
contigmalloc for kernel stacks. The details are mostly CPU
specific and limited to exception_save() and exception_restore().
The few places where we create, destroy or switch stacks were
mostly simplified by not having to construct physical addresses
and additionally saving the virtual addresses for later use.

Besides more efficient context saving and restoring, which of
course yields a noticable speedup, this also fixes the dreaded
SMP bootup problem as a side-effect. The details of which are
still not fully understood.

This change includes all the necessary backward compatibility
code to have it handle older userland binaries that use the
break instruction for syscalls. Support for break-based syscalls
has been pessimized in favor of a clean implementation. Due to
the overall better performance of the kernel, this will still
be notived as an improvement if it's noticed at all.

Approved by: re@ (jhb)
2003-05-16 21:26:42 +00:00