Commit Graph

506 Commits

Author SHA1 Message Date
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
Peter Grehan
3f3331903d - moved intrcnt/intrnames to locore.s to fix sysctl -a panic
Approved by: benno
2002-09-19 04:29:59 +00:00
Peter Grehan
ae3ad2c6c0 - rationalised includes
- added sigframe offset

Approved by: benno
2002-09-19 04:29:07 +00:00
Peter Grehan
d3dce63c13 - removed unnecessary includes
- converted inline asm to C for int enable
 - shifted clearing of 'cold' to end of routine

Approved by: benno
2002-09-19 04:28:45 +00:00
Mike Barcroft
86954511d2 Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
Peter Wemm
66422f5b7a 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.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
Julian Elischer
4f0db5e08c 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.
2002-09-15 23:52:25 +00:00
Jun Kuriyama
b37a9be231 Use "options " rather than "options<tab>". 2002-09-09 02:40:59 +00:00