Juli Mallett [Tue, 17 Sep 2002 02:52:44 +0000 (02:52 +0000)]
Conglomerate printing of ps_pgtok'd data into a PLONG type. I couldn't think
of a better name, except PINT, but I decided to go with assuming LONG to
be safe, rather than assuming INT.
David E. O'Brien [Tue, 17 Sep 2002 01:54:56 +0000 (01:54 +0000)]
BANG! BANG! BANG! Put these bits out of their misery.
Murdered by members of: a.out.die.die.die
ELF is the 1 true path now. So make good on the src/Makefile threat that
building a.out will not be supported post 4.x. These bits should either
resurface as a port, or a new port using the latest Binutils bits. The
later will not support our SunOS-style shared a.out libs; but we shouldn't
need such support by this point in time.
Peter Wemm [Tue, 17 Sep 2002 01:49:00 +0000 (01:49 +0000)]
Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.
Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.
Bill Fenner [Mon, 16 Sep 2002 21:45:37 +0000 (21:45 +0000)]
Fix documentation of clnt_control()'s CL{GET|SET}_{VERS|XID} to
reflect that they actually require a u_int32_t *, which is not
necessarily the same as an unsigned long *.
Juli Mallett [Mon, 16 Sep 2002 20:19:51 +0000 (20:19 +0000)]
Perform keyword.c:1.27 properly, implement -orss in the New World Order of
ps(1) formatting, using pgtok() to get the value in K, rather than printing
it in pages. This is consistent with behaviour before keyword.c:1.26 (et al)
which exists in STABLE today, and which uses the same metric as VSZ.
Jonathan Mini [Mon, 16 Sep 2002 19:28:01 +0000 (19:28 +0000)]
Add kernel support needed for the KSE-aware libpthread:
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Save and restore FPU state properly in ucontext_t's.
- Deliver signals to KSE-aware processes via upcall.
- Rename kse mailbox structure fields to be more BSD-like.
- Store the UTS's stack in struct proc in a stack_t.
Jonathan Mini [Mon, 16 Sep 2002 19:26:48 +0000 (19:26 +0000)]
Add kernel support needed for the KSE-aware libpthread:
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Deliver signals to KSE-aware processes via upcall.
- Rename kse mailbox structure fields to be more BSD-like.
- Store the UTS's stack in struct proc in a stack_t.
Jonathan Mini [Mon, 16 Sep 2002 19:25:08 +0000 (19:25 +0000)]
Add kernel support needed for the KSE-aware libpthread:
- Maintain fpu state across signals.
- Use ucontext_t's to store KSE thread state.
- Synthesize state for the UTS upon each upcall, rather than
saving and copying a trapframe.
- Save and restore FPU state properly in ucontext_t's.
Jonathan Mini [Mon, 16 Sep 2002 08:45:36 +0000 (08:45 +0000)]
Make the changes needed for libpthread to compile in its new home.
The new libpthread will provide POSIX threading support using KSE.
These files were previously repo-copied from src/lib/libc_r.
Bruce Evans [Mon, 16 Sep 2002 08:22:57 +0000 (08:22 +0000)]
Fixed messes involving $FreeBSD$ starting with one left in the copyright
after adding __FBSDID().
Garbage-collected kvm_readswap(). This was once used by kvm_uread(), but
kvm_uread() now just reads /proc/<pid>/mem and procfs hopefully handles
swapped out pages.
Thomas Moestl [Mon, 16 Sep 2002 01:05:15 +0000 (01:05 +0000)]
fcntl(..., F_SETLKW, ...) takes a pointer to a struct flock just like
F_SETLK does, so it also needs this structure copied in in fnctl() before
calling kern_fcntl().
Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)
While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.
Bruce Evans [Sun, 15 Sep 2002 22:17:40 +0000 (22:17 +0000)]
Don't use the ELF symbol type to summarily reject symbols in
X_db_search_symbol(). Otherwise we don't see important symbols in
non-verbosely written assembler code.
NetBSD already has this. The kld version already has a stronger form
of it without really trying -- linker_ddb_search_symbol() doesn't
support ddb's symbol search strategy parameter, so the kld
X_db_search_symbol() doesn't pass the parameter to linker_ddb...() and
linker_ddb...() doesn't make distinctions based on the symbol type.
db_elf.c now works better than db_kld.c when it works (which is essentially
when there are no modules except the kernel). It works after booting
with -d. db_kld.c doesn't work until lots of SYSINIT()s have run.
Bruce Evans [Sun, 15 Sep 2002 21:49:13 +0000 (21:49 +0000)]
Made this work on i386's at least. It wants ELF section headers for
symbol table sections. Reconstruct the necessary section headers from
(ksym_start, ksym_end). This was much easier than converting to use
module metadata, and just works for static symbols, unlike db_kld when
there is no module metadata. Initialize (ksym_start, ksym_end) from
bootinfo on i386's only.
The boot loader should load section headers for all sections that it
loads, and apparently did this for at least the symbol table sections
when this file last worked under FreeBSD (on alphas only) and always
did this under NetBSD (where this file was obtained from). At least
on i386's, boot2 discards the section headers (except for converting
them to (bootinfo.bi_symtab, bootinfo.bi_esymtab), and as far as I can
tell, loader(8) discards them apart from converting them to the bootinfo
values and module metadata.
Bruce Evans [Sun, 15 Sep 2002 20:48:08 +0000 (20:48 +0000)]
Made this compile (but not work). This involved mainly const poisoning
and renaming ALIGNED_POINTER() to _ALIGNED_POINTER() plus the following
hacks for i386's:
- define _ALIGNED_POINTER() if it is not already defined. Most non-i386
arches define it <machine/param.h> define it in <machine/param.h>,
although none actually used it in the kernel.
- define ksym_start and ksym_end. Most non-i386 arches still define and
initialize these in machdep.c although they didn't used them. Here is
a better place to define them but not to initialize them.
Allocate 64K recieve buffer for DNS responses.
KAME did the modification only to _dns_getaddrinfo(). However,
it is not sufficient, and res_queryN() should be modified, too.
So, I did same modification to res_queryN().
Bruce Evans [Sun, 15 Sep 2002 17:45:10 +0000 (17:45 +0000)]
Removed unused includes. Sorted includes. This is part of removing
includes of <sys/user.h> for its pollution only. <sys/user.h> wasn't
even used for its pollution here.
Bruce Evans [Sun, 15 Sep 2002 16:48:25 +0000 (16:48 +0000)]
Removed most namespace pollution in this header: don't include <vm/uma.h>;
include <sys/_mutex.h> and its prerequisites instead of <sys/mutex.h> and
its prerequisite.
David Malone [Sun, 15 Sep 2002 15:07:55 +0000 (15:07 +0000)]
Some BIOSs are using MTRR values that are only documented under NDA
to control the mapping of things like the ACPI and APM into memory.
The problem is that starting X changes these values, so if something
was using the bits of BIOS mapped into memory (say ACPI or APM),
then next time they access this memory the machine would hang.
This patch refuse to change MTRR values it doesn't understand,
unless a new "force" option is given. This means X doesn't change
them by accident but someone can override that if they really want
to.
PR: 28418
Tested by: Christopher Masto <chris@netmonger.net>,
David Bushong <david@bushong.net>,
Santos <casd@myrealbox.com>
MFC after: 1 week
Bruce Evans [Sun, 15 Sep 2002 14:17:29 +0000 (14:17 +0000)]
Define __LONG_LONG_SUPPORTED if the compiler claims to support C99.
Don't set __LONG_LONG_SUPPORTED for gcc-1. I didn't check exactly
when gcc started to support long long, but it was in the version
of gcc in FreeBSD-1.0 (gcc-2.4.5).
Other C99 features should be ifdefed similarly, but the ifdefs for
old versions of gcc will be more complicated since the features
weren't in all versions of gcc-2.
Tim J. Robbins [Sun, 15 Sep 2002 08:38:51 +0000 (08:38 +0000)]
Add wcstod() as a wrapper around strtod(). It does not handle any characters
that strtod() does not (alternate digit characters, etc. are not handled).
Bruce Evans [Sun, 15 Sep 2002 08:21:14 +0000 (08:21 +0000)]
Fixed breakage from removing the used include of <sys/buf.h> in the
previous commit:
Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/buf.h>. Only do this in the
__FreeBSD_version > 500000 case although the __FreeBSD_version < 500000
case has already rotted.
Tim J. Robbins [Sun, 15 Sep 2002 08:06:17 +0000 (08:06 +0000)]
Use the heap instead of the stack to store temporary multibyte string
buffers; this is slower but safer for threaded programs where threads
often have relatively low stack size limits.
Juli Mallett [Sun, 15 Sep 2002 04:45:56 +0000 (04:45 +0000)]
Make a comment reflect less of a lie, NOCPU is used to generally mean that we
are not on a specific CPU in a distributed system, certainly not just for
<struct proc>.p_oncpu, which is of course now <struct kse>.ke_oncpu.
Warner Losh [Sat, 14 Sep 2002 19:15:12 +0000 (19:15 +0000)]
Add additional information returned to userland by the device querying
functions. We add pnpinfo, locationinfo, devflags (the newbus flags
on the device), flags (the flags that device_get_flags returns) and
state to the list of things we return.
pnpinfo and locationinfo are place holders at the moment that will be
filled in by the device's parent (optionally). Userland programs will
likely use this information from time to time and take appropriate
actions.