Commit Graph

513 Commits

Author SHA1 Message Date
Julian Elischer
696058c3c5 Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storage
during the context switch. Rearrange thread cleanups
to avoid problems with Giant. Clean threads when freed or
when recycled.

Approved by:	re (jhb)
2002-12-10 02:33:45 +00:00
Maxime Henrion
b19d9defef Under certain circumstances, we were calling kmem_free() from
i386 cpu_thread_exit().  This resulted in a panic with WITNESS
since we need to hold Giant to call kmem_free(), and we weren't
helding it anymore in cpu_thread_exit().  We now do this from a
new MD function, cpu_thread_dtor(), called by thread_dtor().

Approved by:	re@
Suggested by:	jhb
2002-11-22 23:57:02 +00:00
Daniel Eischen
2be05b70c9 Add getcontext, setcontext, and swapcontext as system calls.
Previously these were libc functions but were requested to
be made into system calls for atomicity and to coalesce what
might be two entrances into the kernel (signal mask setting
and floating point trap) into one.

A few style nits and comments from bde are also included.

Tested on alpha by: gallatin
2002-11-16 06:35:53 +00:00
Alan Cox
eea85e9bb6 Move pmap_collect() out of the machine-dependent code, rename it
to reflect its new location, and add page queue and flag locking.

Notes: (1) alpha, i386, and ia64 had identical implementations
of pmap_collect() in terms of machine-independent interfaces;
(2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
2002-11-13 05:39:58 +00:00
Dag-Erling Smørgrav
97b67f3141 Print real / avail memory in megabytes rather than kilobytes. 2002-11-09 16:19:14 +00:00
Thomas Moestl
0fca57b8b8 Move the definitions of the hw.physmem, hw.usermem and hw.availpages
sysctls to MI code; this reduces code duplication and makes all of them
available on sparc64, and the latter two on powerpc.
The semantics by the i386 and pc98 hw.availpages is slightly changed:
previously, holes between ranges of available pages would be included,
while they are excluded now. The new behaviour should be more correct
and brings i386 in line with the other architectures.

Move physmem to vm/vm_init.c, where this variable is used in MI code.
2002-11-07 23:57:17 +00:00
Juli Mallett
751d91aabd Remove what was a temporary bogus assignment of bits of siginfo_t, as it does
not look like the prerequisites to fill it in properly will be in the tree
for the upcoming release, but it's mostly done, so there is no need for these
to stay around to remind us.
2002-11-06 14:53:35 +00:00
Peter Wemm
23eeeff7be Split 4.x and 5.x signal handling so that we can keep 4.x signal
handling clean and functional as 5.x evolves.  This allows some of the
nasty bandaids in the 5.x codepaths to be unwound.

Encapsulate 4.x signal handling under COMPAT_FREEBSD4 (there is an
anti-foot-shooting measure in place, 5.x folks need this for a while) and
finish encapsulating the older stuff under COMPAT_43.  Since the ancient
stuff is required on alpha (longjmp(3) passes a 'struct osigcontext *'
to the current sigreturn(2), instead of the 'ucontext_t *' that sigreturn
is supposed to take), add a compile time check to prevent foot shooting
there too.  Add uniform COMPAT_43 stubs for ia64/sparc64/powerpc.

Tested on: i386, alpha, ia64.  Compiled on sparc64 (a few days ago).
Approved by: re
2002-10-25 19:10:58 +00:00
Peter Grehan
f86c114f3d Add the USER_SR segment register to pcb state. Initialize correctly,
and save/restore during a context switch.

The USER_SR could be overwritten when the current thread was switched
out with a faulting copyin/copyout.

Approved by: Benno
2002-10-21 05:27:41 +00:00
Marcel Moolenaar
1aeb23cdfa Add two hooks to signal module load and module unload to MD code.
The primary reason for this is to allow MD code to process machine
specific attributes, segments or sections in the ELF file and
update machine specific state accordingly. An immediate use of this
is in the ia64 port where unwind information is updated to allow
debugging and tracing in/across modules. Note that this commit
does not add the functionality to the ia64 port. See revision 1.9
of ia64/ia64/elf_machdep.c.

Validated on: alpha, i386, ia64
2002-10-19 19:16:03 +00:00
Robert Watson
c7063e5913 Permits UFS ACLs to be used with the GENERIC kernel. Due to recent
ACL configuration changes, this shouldn't result in different code paths
for file systems not explicitly configured for ACLs by the system
administrator.  For UFS1, administrators must still recompile their
kernel to add support for extended attributes; for UFS2, it's sufficient
to enable ACLs using tunefs or at mount-time (tunefs preferred for
reliability reasons).  UFS2, for a variety of reasons, including
performance and reliability, is the preferred file system for use with
ACLs.

Approved by:	re
2002-10-19 16:54:15 +00:00
Peter Wemm
af3f249f3a The a.out md_coredump stuff isn't referenced anywhere anymore, and
hasn't been filled in for ages..  Nuked.
2002-10-15 00:02:50 +00:00
Mike Barcroft
4275e0d98d Remove the P1003_1B kernel option; it is no longer used. 2002-10-13 16:29:17 +00:00
Mike Barcroft
7a77412855 Add standards visibility conditionals. Change any uses of sigset_t to
struct __sigset to avoid depending on objects from <sys/signal.h>.
2002-10-13 00:31:46 +00:00
Mike Barcroft
ddb056b7d4 Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
Mike Barcroft
0b058e3cbd o Add conditionals to allow va_list to be defined in other headers.
o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes.
o Restrict the definition of va_copy() to C99 environments.
2002-10-06 22:01:07 +00:00
Peter Grehan
726a1868a6 Roll back to previous version, no need for NO_GEOM when GEOM is
standard.
2002-10-06 12:13:12 +00:00
Poul-Henning Kamp
3bd6561289 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
Mike Barcroft
e61d3b10d7 Fix namespace issues by using visibility conditionals from
<sys/cdefs.h>.
2002-10-05 05:47:56 +00:00
Juli Mallett
e6abe47dbf Define _MACHINE. 2002-10-05 02:56:49 +00:00
Mike Barcroft
085f8416a2 style(9) <machine/setjmp.h> headers so they look mostly the same. 2002-10-04 22:10:06 +00:00
Peter Grehan
d13782ef14 Clean up ddb warnings/errors and enable in GENERIC
Approved by: benno
Motivated by: gallatin
2002-10-04 01:19:18 +00:00
Peter Grehan
24a4e806f2 - fix zero-sized stack alloc from previous commit. a default is now
selected ala sparc64
- KSEIII routines implemented (taken from i386/sparc64)

Approved by: Benno
2002-10-04 01:13:34 +00:00
Scott Long
316ec49abd Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb
2002-10-02 07:44:29 +00:00
Peter Wemm
1a8ec9c55a PIC_GOTOFF is OBE. 2002-09-23 07:27:45 +00:00
Mike Barcroft
c0d4804d67 Be careful not to define GCC-specific optimizations in the non-GCC
case.
2002-09-23 04:32:17 +00:00
Benno Rice
be0e6bfc0b It's Apple GMAC, not HMAC.
Approved by:	jake (for sparc64)
2002-09-22 01:18:06 +00:00
John Baldwin
c79408a059 Implement db_print_backtrace() if DDB is compiled into the kernel. This
MD function is just a wrapper around db_stack_trace_cmd() that prints out
a backtrace of curthread.  Currently, this function is only implemented
on i386 and alpha (and the alpha version isn't quite tested yet, will do
that in a bit).  Other changes:

- For i386, fix a bug in the raw frame address case.  The eip we extract
  from the passed in frame address does not match the frame we received.
  Thus, instead of printing a bogus frame with the wrong eip, go ahead
  and advance frame down to the same frame as the eip we are using.
- For alpha, attempt to add a way of doing a raw trace for alpha.  Instead
  of passing a frame address in 'addr', pass in a pointer to a structure
  containing PC and KSP and use those to start the backtrace.  The alpha
  db_print_backtrace() uses asm to read in the current PC and KSP values
  into such a request.

Tested on:	i386
Requested by:	many
2002-09-19 18:46:29 +00:00
Peter Grehan
26eed6e9a2 Updated to somewhat match sparc64/conf/GENERIC
Approved by: benno
2002-09-19 11:20:13 +00:00
Peter Grehan
8860e8c607 Support files and a h/w tree description for the PSIM ppc simulator
Approved by: benno
2002-09-19 04:57:10 +00:00
Peter Grehan
11b370b1bb Driver for the macio south bridge, and ATA cell contained within.
Approved by: benno
2002-09-19 04:52:07 +00:00
Peter Grehan
51478d84b7 softc and register defs for the UniNorth chip
Approved by: benno
2002-09-19 04:50:30 +00:00
Peter Grehan
d48bbef30d - probe the UniNorth chip in addition to the PCI bridges
- enable GEM ethernet cell if present
 - allow sparse address mapping for devices

Approved by: benno
2002-09-19 04:49:58 +00:00
Peter Grehan
d889f46119 Removed osigframe. No need for COMPAT_43 signal bin-compat in PPC.
Approved by: benno
2002-09-19 04:46:36 +00:00
Peter Grehan
c94c0cf8de psim device support
Approved by: benno
2002-09-19 04:45:58 +00:00
Peter Grehan
a379a1422d <machine/types.> -> <sys/types.h>
Approved by: benno
2002-09-19 04:45:32 +00:00
Peter Grehan
50122aa981 Fix clearing of recoverable exception MSR bit when disabling
interrupts

Approved by: benno
2002-09-19 04:45:06 +00:00
Peter Grehan
663a6cc057 Additional machdep sysctl constants needed for userland utils
Approved by: benno
2002-09-19 04:44:35 +00:00
Peter Grehan
6dfada4cca Added sparse address support, required by the macio ATA device
Approved by: benno
2002-09-19 04:44:04 +00:00
Peter Grehan
6e1073f023 Fixed branch labels
Approved by: benno
2002-09-19 04:39:59 +00:00
Peter Grehan
4eae112d86 - bring vm_mapbuf/unmapbuf in line with other archs
- update for recent KSE changes

Approved by: benno
2002-09-19 04:39:28 +00:00
Peter Grehan
07f8023285 - make sure recoverable interrupts are re-enabled in the trap handler
- turn on ast() loop to enable signal delivery

Approved by: benno
2002-09-19 04:39:04 +00:00
Peter Grehan
44b14a299f - worked around 32-bit big-endian syscall return value problem
- syscall register spills weren't copied in correctly
 - removed VM_PROT_READ from the fault type on write protect faults

Approved by: benno
2002-09-19 04:38:35 +00:00
Peter Grehan
f57e8a452b Add sync before isync for G4 cpus
Obtained from: NetBSD
Approved by: benno
2002-09-19 04:37:39 +00:00
Peter Grehan
89eccf4647 - use symbol for user-context offset
- fix szsigcode size declaration

Approved by: benno
2002-09-19 04:36:44 +00:00
Peter Grehan
32bc78460d - use BAT registers to map device space and physical memory
- remove test in pmap_activate that prevented vmspace sharing (v/rfork)
 - always sync icache in pmap_enter until problems are sorted
 - fix incorrect use of regions in pmap_kenter
 - bring in pmap_release from NetBSD
 - fix overwrite of bootstrap flag in pmap_pvo_enter

Approved by: benno
2002-09-19 04:36:20 +00:00
Peter Grehan
6f1808faf4 - psim device support
- comment out re-enabling of interrupts until problems are sorted

Approved by: benno
2002-09-19 04:32:25 +00:00
Peter Grehan
1ce0c6b147 Clear on-demand BAT entries to properly restore OpenFirmware's
address space

Approved by: benno
2002-09-19 04:31:39 +00:00
Peter Grehan
d6ce71e50a psim device support
Approved by: benno
2002-09-19 04:31:04 +00:00
Peter Grehan
81a6d01d1c - implemented sendsig/sigreturn
- sysctl for cacheline size, required by libc/rtld
 - init'd more exception vectors
 - fixed problem with register overwrite in exec_setregs
 - removed redundant NetBSD code

Approved by: benno
2002-09-19 04:30:43 +00:00