- Add a flags field to struct pcb. Use this to keep track of wether or
not the pcb has floating point registers saved in it.
- Implement get_mcontext and set_mcontext.
- Rename pcb_fpstate to pcb_ufp (user floating point), and change it to
a simple array of 64 ints.
- Use a critical section when saving floating point state in cpu_fork
instead of sched_lock.
Jeff Roberson [Tue, 1 Apr 2003 03:46:29 +0000 (03:46 +0000)]
- Add libthr but don't hook it up to the regular build yet. This is an
adaptation of libc_r for the thr system call interface. This is beta
quality code.
Jeff Roberson [Tue, 1 Apr 2003 01:26:20 +0000 (01:26 +0000)]
- Borrow the KSE single threading code for exec and exit. We use the check
if (p->p_numthreads > 1) and not a flag because action is only necessary
if there are other threads. The rest of the system has no need to
identify thr threaded processes.
- In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED
is not set.
Jeff Roberson [Tue, 1 Apr 2003 01:10:42 +0000 (01:10 +0000)]
- Add an api for doing smp safe locks in userland.
- umtx_lock() is defined as an inline in umtx.h. It tries to do an
uncontested acquire of a lock which falls back to the _umtx_lock()
system-call if that fails.
- umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
uncontested unlock fails.
- Locks are keyed off of the thr_id_t of the currently running thread which
is currently just the pointer to the 'struct thread' in kernel.
- _umtx_lock() uses the proc pointer to synchronize access to blocked thread
queues which are stored in the first blocked thread.
Jeff Roberson [Tue, 1 Apr 2003 00:30:30 +0000 (00:30 +0000)]
- Add two files to support the thr threading interface.
- sys/thr.h contains the user space visible api that is intended only for
use in threading library packages.
- kern/kern_thr.c contains thr system calls and other thr specific code.
Jeff Roberson [Tue, 1 Apr 2003 00:18:55 +0000 (00:18 +0000)]
- Define a new md function 'casuptr'. This atomically compares and sets
a pointer that is in user space. It will be used as the basic primitive
for a kernel supported user space lock implementation.
- Implement this function in x86's support.s
- Provide stubs that return -1 in all other architectures. Implementations
will follow along shortly.
Jeff Roberson [Tue, 1 Apr 2003 00:16:32 +0000 (00:16 +0000)]
- In npxgetregs() use the td argument to save the fpu state from and not
curthread. Nothing currently depends on this behavior.
- Clean up an extra newline.
Jeff Roberson [Mon, 31 Mar 2003 23:30:41 +0000 (23:30 +0000)]
- Define sigwait, sigtimedwait, and sigwaitinfo in terms of
kern_sigtimedwait() which is capable of supporting all of their semantics.
- These should be POSIX compliant but more careful review is needed before
we announce this.
Thomas Quinot [Mon, 31 Mar 2003 23:26:10 +0000 (23:26 +0000)]
Revert change 1.201 (removing mapping of VAPPEND to VWRITE).
Instead, use the generic vaccess() operation to determine whether
an operation is permitted. This avoids embedding knowledge on
vnode permission bits such as VAPPEND in the NFS client.
Jeff Roberson [Mon, 31 Mar 2003 22:57:01 +0000 (22:57 +0000)]
- The siglist in the proc holds signals that were blocked by all threads
when they were delivered. In signotify() check to see if we have
unblocked any of those signals and post them to the thread.
- Use td_sigmask instead of p_sigmask in all cases.
- In sigpending return both signals pending on the thread and proc.
- Define a function, sigtd(), that finds the appropriate thread to deliver
the signal to if psignal() has been called instead of tdsignal().
- Define a function, tdsignal(), that delivers a signal to a specific thread
or if that thread has the signal blocked it may deliver it to the process
where it will wait for a thread to unblock it.
- Since we are delivering signals to a specific thread we do not need to
abort the sleep of all threads.
- Rename the old tdsignal() to tdsigwakeup().
- Save and restore the old signal mask to and from the thread.
Jeff Roberson [Mon, 31 Mar 2003 22:49:17 +0000 (22:49 +0000)]
- Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c
- signotify() now operates on a thread since unmasked pending signals are
stored in the thread.
- PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
Jeff Roberson [Mon, 31 Mar 2003 22:12:09 +0000 (22:12 +0000)]
- Mark signals which may be delivered to any thread in the process with
SA_PROC. Signals without this flag should be directed to a particular
thread if this is possible.
Jeff Roberson [Mon, 31 Mar 2003 21:40:47 +0000 (21:40 +0000)]
- Use sigexit() instead of twiddling the signal mask, catch, ignore, and
action bits to allow SIGILL to work as expected. This brings this file in
line with other architectures.
Wes Peters [Mon, 31 Mar 2003 21:09:57 +0000 (21:09 +0000)]
Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.
Reviewed by: arch@
Sponsored by: St. Bernard Software
Jake Burkholder [Mon, 31 Mar 2003 19:56:55 +0000 (19:56 +0000)]
- Allow the physical memory size that will be actually used by the kernel to
be overridden by setting hw.physmem.
- Fix a vm_map_find arg, we don't want to find space.
- Add tracing and statistics for off colored pages.
- Detect "stupid" pmap_kenters (same virtual and physical as existing
mapping), and do nothing in that case.
John Baldwin [Mon, 31 Mar 2003 19:24:37 +0000 (19:24 +0000)]
If we fail to find our PCI ID in attach (this should never happen), then
just return ENXIO directly instead of calling tl_detach() since that would
panic since the softc mutex isn't initialized until after this check.
Remove some debugging in the new OAM[*] and add a debug flag for other
parts of it.
[*] I've been asked what "OAM" means: It's an acronym used in the
telecom industry, "Operations And Maintenance", and there it covers
anything from a single unlabeled led on the frontpanel the the full
nightmare of CMIP for SS7.
Nate Lawson [Mon, 31 Mar 2003 17:29:43 +0000 (17:29 +0000)]
Clean up locking and resource management for pci/if_*
- Remove locking of the softc in the attach method, instead depending on
bus_setup_intr being at the end of attach (delaying interrupt enable until
after ether_ifattach is called)
- Call *_detach directly in the error case of attach, depending on checking
in detach to only free resources that were allocated. This puts all
resource freeing in one place, avoiding thinkos that lead to memory leaks.
- Add bus_child_present check to calls to *_stop in the detach method to
be sure hw is present before touching its registers.
- Remove bzero softc calls since device_t should do this for us.
- dc: move interrupt allocation back where it was before. It was unnecessary
to move it. This reverts part of 1.88
- rl: move irq allocation before ether_ifattach. Problems might have been
caused by allocating the irq after enabling interrupts on the card.
- rl: call rl_stop before ether_ifdetach
- sf: call sf_stop before ether_ifdetach
- sis: add missed free of sis_tag
- sis: check errors from tag creation
- sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- sk: remove duplicate initialization of sk_dev
- ste: add missed bus_generic_detach
- ti: call ti_stop before ether_ifdetach
- ti: add missed error setting in ti_rdata alloc failure
- vr: add missed error setting in I/O, memory mapping cases
- xl: add missed error setting in I/O, memory mapping cases
- xl: remove multi-level goto on attach failure
- xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- Calls to free(9) are unconditional because it is valid to call free with a
null pointer.
If an ssh1 client initiated challenge-response authentication but did
not respond to challenge, and later successfully authenticated itself
using another method, the kbdint context would never be released,
leaving the PAM child process behind even after the connection ended.
Fix this by automatically releasing the kbdint context if a packet of
type SSH_CMSG_AUTH_TIS is follwed by anything but a packet of type
SSH_CMSG_AUTH_TIS_RESPONSE.
Ruslan Ermilov [Mon, 31 Mar 2003 13:10:51 +0000 (13:10 +0000)]
Enable cpp(1) warnings in system headers. GCC is oriented on
glibc which is externally maintained, so GCC ships with these
warnings turned off by default. This is also consistent with
the src/contrib/gcc/c-lex.c,v 1.2 change.
Ruslan Ermilov [Mon, 31 Mar 2003 12:58:33 +0000 (12:58 +0000)]
Slightly improve buildworld times by excluding crunchide(1)
and kgzip(8) from the list of cross-tools during the normal,
non-"make release" buildworld.
Also, don't gratuitously build them, btxld(8) and elf2aout(1)
for native architecture builds, since they have no known
boostrapping issues along the supported upgrade path.
Alan Cox [Mon, 31 Mar 2003 06:25:42 +0000 (06:25 +0000)]
Recent changes to uipc_cow.c have eliminated the need for some sf_buf-
related variables to be global. Make them either local to sf_buf_init() or
static.
Jeff Roberson [Mon, 31 Mar 2003 00:32:43 +0000 (00:32 +0000)]
- In npxsetregs don't set the floating point if td == fpcurthread not if
curthread == fpcurthread. This is important when we're saving the fp
state for a thread other than curthread as in from set_mcontext.
Jake Burkholder [Sun, 30 Mar 2003 05:24:52 +0000 (05:24 +0000)]
- Add support for PAE and more than 4 gigs of ram on x86, dependent on the
kernel opition 'options PAE'. This will only work with device drivers which
either use busdma, or are able to handle 64 bit physical addresses.
Thanks to Lanny Baron from FreeBSD Systems for the loan of a test machine
with 6 gigs of ram.
Sponsored by: DARPA, Network Associates Laboratories, FreeBSD Systems
Jeff Roberson [Sun, 30 Mar 2003 02:57:32 +0000 (02:57 +0000)]
- We are not guaranteed that read ahead blocks are not in memory already.
Check for B_DELWRI as well as B_CACHED before issuing io on a buffer. This
is especially important since we are changing the b_iocmd.
Jake Burkholder [Sun, 30 Mar 2003 01:16:19 +0000 (01:16 +0000)]
- Convert all uses of pmap_pte and get_ptbase to pmap_pte_quick. When
accessing an alternate address space this causes 1 page table page at
a time to be mapped in, rather than using the recursive mapping technique
to map in an entire alternate address space. The recursive mapping
technique changes large portions of the address space and requires global
tlb flushes, which seem to cause problems when PAE is enabled. This will
also allow IPIs to be avoided when mapping in new page table pages using
the same technique as is used for pmap_copy_page and pmap_zero_page.