Commit Graph

3546 Commits

Author SHA1 Message Date
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
pk 21a55ba7c3 Fix initialisation of the module_viking_sun4d structure. 2003-08-01 12:29:30 +00:00
pk d08520ecd9 mainbus_attach: declare appropriate variables for SUN4D too. 2003-08-01 12:25:45 +00:00
pk 6dafe11ede Correct some `defined(SUN*)' inconsistencies. 2003-08-01 12:19:50 +00:00
mrg 8a8d2aa063 sprinkle some: libkern.h, some -ffreestanding and some cast-y goodness,
all for the pleasure of the gcc 3 :-)
2003-07-30 15:58:36 +00:00
pk a2bec8caf7 As pointed out by Jason, the protection bits in pmap_enter()'s `flags' field
are valid (though the sparc implementation currently ignores them), so restore
revision 1.34.
2003-07-28 07:05:56 +00:00
itojun 3f14c71f75 reserve cdev major # for PF. ok'ed by technical-exec 2003-07-27 14:17:57 +00:00
thorpej 063033a023 Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
2003-07-27 01:17:37 +00:00
pk 62250de8ad Remove protection bits from flags arg in pmap_enter() call. 2003-07-25 07:25:31 +00:00
pk b73c3ad58a viking_getmid(): don't try to read MXCC registers on non-MXCC machines.
cpu_attach(): if `bootmid' could not be determined early set it to the MID
of the first attaching CPU.
2003-07-16 08:08:22 +00:00
lukem a418360342 __KERNEL_RCSID() 2003-07-15 00:04:39 +00:00
pk 40643e2443 The source register field was missing from the `i_loadstore' format.
From Jason Wright (openbsd) in private communication.
2003-07-14 06:53:44 +00:00
pk c7a9b61e64 Deal with disk change notification. 2003-07-11 12:09:12 +00:00
lukem 001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
pk f9dc3a73e0 compat mode:
* print warning if kernel image is too large.
	* adjust `required space' computation to be more compatible to
	  what it was before.
	* since there's still no code to recognise `old kernels', provide
	  a way to turn on `compatmode' manually, using the `-C' boot option.
2003-07-10 09:06:52 +00:00
pk 95ca576fc1 pmap_map(): round up size to compute # of pages. 2003-07-10 09:00:33 +00:00