Commit Graph

3561 Commits

Author SHA1 Message Date
pk 46166f9be5 Simplify fpu_cleanup() by having it return a code to indicate that a SIGFPE
is to be posted; let trap() deal with constructing the siginfo structure.
2003-10-12 19:48:52 +00:00
pk 75da020979 sendsig: we must copy out the `ksi_info' field. 2003-10-12 17:08:08 +00:00
pk 42e535f6f6 sendsig: don't copy out the ucontext_t padding bytes onto the user stack. 2003-10-12 16:12:20 +00:00
pk 179cafcae3 There's no point in having two separate sets of padding; add the local
__filler bytes to _UC_MACHINE_PAD.
2003-10-12 16:01:35 +00:00
pk c2e604a45c Simplify struct sigframe. 2003-10-12 14:36:19 +00:00
pk 8169a404f6 mem_access_fault_*: call KSI_INIT_TRAP() before filling in the siginfo fields. 2003-10-12 14:34:31 +00:00
pk 44510064ca Define SIGTRAMP_VALID. 2003-10-11 22:15:18 +00:00
jdolecek ef5bb330f5 reassing majors for crypto and pf to use the newly defined MI major
range
2003-10-10 22:42:39 +00:00
jdolecek 4e915c9ccd update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
2003-10-10 21:21:25 +00:00
thorpej 901da40cf9 Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
  special handling on some platforms).
2003-10-08 22:43:01 +00:00
thorpej 68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
tron ebbe253d6d Add COMPAT_16. 2003-10-07 09:43:58 +00:00
pk 3de506eaf1 No need for SVR4/SunOS5 FPE_* codes as these are compatible with ours. 2003-10-06 07:10:41 +00:00
pk a9b14e04b8 sparc kernel support for SA_SIGINFO. 2003-10-05 21:13:23 +00:00
jdolecek e6286b949a Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
2003-10-05 08:04:24 +00:00
hannken 2d5deed228 Make it compile (again) with DEBUG enabled. With SUN4 defined, segfixmask
was an u_long while whithout SUN4 it was an int.

Approved by: Paul Kranenburg <pk@netbsd.org>
2003-10-02 16:02:09 +00:00
nathanw 4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
simonb 550b4bef88 Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
2003-09-26 12:02:55 +00:00
cl 4ba5ca7f2f fix copy-paste oversight in MD part of SA/pthread pagefault handling 2003-09-16 19:02:51 +00:00
cl 8c7a07f686 add MD part of SA/pthread pagefault handling on sparc 2003-09-16 13:59:59 +00:00
uwe 9f598eb5ba DOH, sparc was not doing p_userret processing in userret()!
Adding it helps SA a great deal.   E.g. ogg123 actually works now.
2003-09-07 20:41:05 +00:00
uwe edee4547b6 Define 'nil' as long and remove the cast in the *only* place it's used.
Makes gcc3 happy as well.
2003-09-07 00:52:01 +00:00
uwe f8a341efaa Drop bogus ## to make gcc3 happy. 2003-09-07 00:30:40 +00:00
itojun fc918f8713 add rnd(4) device to installation media.
necessary for many purposes, including password seeding, tcp sequence number,
and more.  see tech-security
2003-09-06 03:25:23 +00:00
pk 721f0d1591 Fix DEBUG code in me_alloc(). 2003-08-29 08:26:21 +00:00
mrg 9e599bdb11 change PROM_getprop() from taking a "void **" for the storage, to a
"void *", and do the extra de-reference directly in the function.  this
avoids having to cast dozens of different types to "void **", which sets
of GCC3's strict-aliasing.  testing by martin@
2003-08-27 15:59:49 +00:00
uwe 3a942f1015 cc_callout does not belong to struct cons_channel, as it's only used
by sparc for PROM console input channel.  Demote it to kd.c as a
static variable.

While there, use callout_schedule instead of callout_reset to
reschedule the PROM polling callout, and init prom_cons_channel
statically.
2003-08-27 01:37:38 +00:00
uwe 68f362b713 Kill __P(). 2003-08-27 00:23:32 +00:00
uwe 5efaa48bea Framebuffer code common to sparc and sparc64 was merged and moved to
dev/sun 3 years ago.  Remove these redundant and out-of-date copies.
All code now uses dev/sun/fbvar.h
2003-08-25 19:24:49 +00:00
uwe bb09aff859 Undo previous as it broke things.
There are some scattered implicit RASTERCONSOLE dependencies,
so there should be a better way.
2003-08-25 17:50:22 +00:00
chs 14ee4005a1 make sp_tlb_flush() work for profiling kernels:
when we're profiling, the compiler creates a stack frame for us,
so doing a "retl" isn't so good in that case.
2003-08-24 18:10:31 +00:00
chs 939df36e55 add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default.  the changes
fall into two basic catagories:

 - pmap and trap-handler changes.  these are all MD:
   = alpha: we already track per-page execute permission with the (software)
	PG_EXEC bit, so just have the trap handler pay attention to it.
   = i386: use a new GDT segment for %cs for processes that have no
	executable mappings above a certain threshold (currently the
	bottom of the stack).  track per-page execute permission with
	the last unused PTE bit.
   = powerpc/ibm4xx: just use the hardware exec bit.
   = powerpc/oea: we already track per-page exec bits, but the hardware only
	implements non-exec mappings at the segment level.  so track the
	number of executable mappings in each segment and turn on the no-exec
	segment bit iff the count is 0.  adjust the trap handler to deal.
   = sparc (sun4m): fix our use of the hardware protection bits.
	fix the trap handler to recognize text faults.
   = sparc64: split the existing unified TSB into data and instruction TSBs,
	and only load TTEs into the appropriate TSB(s) for the permissions.
	fix the trap handler to check for execute permission.
   = not yet implemented: amd64, hppa, sh5

 - changes in all the emulations that put a signal trampoline on the stack.
   instead, we now put the trampoline into a uvm_aobj and map that into
   the process separately.

originally from openbsd, adapted for netbsd by me.
2003-08-24 17:52:28 +00:00
uwe 65aeb1d742 #include "opt_rcons.h" 2003-08-24 17:31:59 +00:00
mrg b5076a98db 64 bit number literals need a "ULL" suffix 2003-08-24 00:41:43 +00:00
itojun 4440262659 create /dev/crypto 2003-08-22 05:06:22 +00:00
pk 84ab67f557 sun4/sun4c DIAGNOSTIC: fix tally of locked down pmegs.
pmap_page_protect: DIAGNOSTIC: show `pg' argument in panic.
pmap_unwire: for now, only used for sun4/sun4c MMUs.
2003-08-21 09:36:28 +00:00
pk dd51ebce3f sun4/sun4c MMU: keep `wired' status per page, implemented by defining a bit
in the PTE word that is not used by the hardware. Use it to unlock a `pmeg'
if the wired count in a segment drops to zero.
2003-08-17 18:00:51 +00:00
pk fda797e0a4 sun4/sun4c MMU: keep `wired' status per page, implemented by defining a bit
in the PTE word that is not used by the hardware. Use it to unlock a `pmeg'
if the wired count in a segment drops to zero.
2003-08-16 19:21:21 +00:00
hannken 58f4f18578 Fix a typo: sm->sg_npte -> sp->sg_npte 2003-08-14 11:00:02 +00:00
pk 87d5e88b94 sun4/sun4 mem_fault(): on kernel faults we now need to try to page in a
a `pmeg' too. See also sparc/pmap.c, rev 1.265.
2003-08-12 15:34:32 +00:00
pk 98d3a23993 Extensive rewrite of the sun4/sun4c pmap code to allow non-wired kernel
mappings to use the pre-emptable pool of `PMEG' MMU resources.
2003-08-12 15:31:56 +00:00
pk fe30a2e6c1 Use pmap_remove_all() to flush the cache by context and set a flag to
avoid subsequent user space cache flushes by page or segment in pmap_remove().
2003-08-12 15:13:11 +00:00
martin 7406b873ca Replace strict-alias bug prone pointer magic with (IMHO clearer)
shift/mask arithmetic.
2003-08-10 15:14:02 +00:00
martin c26dc73c1d Remove unecessary intermediate (void*) casts. 2003-08-10 14:53:12 +00:00
martin 7a1600bb14 Remove unecessary intermediate (void*) casts. 2003-08-10 14:50:09 +00:00
pk f18213d166 Simplify the definitions of VA_VPG() and VA_OFF(). 2003-08-09 09:30:04 +00:00
rafal fc27d910c0 To make keeping these two in sync easier, add commented-out entries for
device-majors used on the other port to each of the sparc{,64} majors
files.
2003-08-08 17:03:14 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
bsh fbf0aea004 add __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS to machine/types.h for
following ports:

	acorn26, amiga, hpcarm, sparc, sparc64

This was proposed by Martin Husemann at teck-kern@ in May to properly
test whether softintr can be established for all IPL, or only for
IPL_SOFT*.  OKed by acorn26, hpcarm and sparc port masters.
2003-08-06 00:43:53 +00:00
pk 0ac4b6aae4 On small sun4c machines trim the buffer cache to reduce the demand for
kernel virtual memory. This leaves more of the precious PMEG resources
available for user space VM which speeds up things considerably, since
a reasonable PMEG working set can be maintained.
2003-08-02 08:10:44 +00:00