Commit Graph

3728 Commits

Author SHA1 Message Date
cl
b936d40f39 Avoid sneaking past signal delivery in sa_upcall_userret():
generate unblocked upcalls in sa_unblock_userret(), before signal
delivery/p_userret handling in userret().

Also defer getting state for preempted upcalls because on some ports
preemption can happen between sa_unblock_userret() and sa_upcall_userret().
2003-11-01 01:38:46 +00:00
simonb
6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
kleink
bff4c04c64 Make the extended-precision definitions available for _KERNEL (i.e. the
FPU support package), too; reported by Chuck Silvers.
2003-10-28 15:55:09 +00:00
chs
cd23cf5c7c uninitialized variables. 2003-10-28 15:25:27 +00:00
kleink
964d6747b5 Err, rename some members added in previous to make them reflect their
semantics better.
2003-10-27 01:11:46 +00:00
kleink
b37192f049 For convenient use in libc, add unions of the C floating types and their
corresponding structure definitions.
2003-10-26 21:46:46 +00:00
kleink
a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
christos
2454871f57 Sparc64 builds with __HAVE_SIGINFO 2003-10-26 08:08:07 +00:00
lukem
f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
kleink
d7efc4af9e Rip out E80 format definitions which are neither "notyet", nor going to
happen.
2003-10-26 00:36:43 +00:00
pk
48b10bb77d pmap_map_srmmu: use the `map-pages' Forth word to let prom map all pages
at once.
2003-10-24 09:48:08 +00:00
uwe
129cf6259c Catch up with GENERIC (1.148). 2003-10-22 18:24:53 +00:00
kleink
7d9835b758 Don't use NULL in integer-type assignments/comparisons. 2003-10-21 20:59:31 +00:00
pk
7dceb5fbf9 obp_v2_getbootfile: we might as well be complete by also considering the
PROM environment variables `diag-switch?' and `diag-file'.
2003-10-15 11:51:48 +00:00
pk
a2fbe60ed4 sun4m_access_fault: Treat text/data error traps as if they were text/data
exception traps, except that they're logged on the console.
2003-10-15 07:49:41 +00:00
pk
595fb05c30 obp_v2_getbootfile: use the value of the `boot-file' prom environment
variable if we determine that the boot arguments presented to us by the
PROM do not contain a boot file name.

Idea from Greg Woods on port-sparc@netbsd.org.
2003-10-13 17:59:19 +00:00
agc
b2b49933f4 Move Matt Green's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22396 by Joel Baker, the changes
were confirmed to the board by Matt Green.
2003-10-13 14:22:20 +00:00
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
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
lukem
82bd1c0ce3 shell coding tweaks 2003-07-10 04:48:34 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
9dc96360bb More changes for providing lwpid for ktrace (sparc GENERIC built) 2003-06-29 09:56:27 +00:00
darrenr
6147cc4ab2 More changes for providing lwpid for ktrace (sparc GENERIC built) 2003-06-29 09:56:24 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
pk
f22f3adf41 me_alloc()/region_alloc(): return the MMU cookie directly. 2003-06-28 10:17:47 +00:00
pk
338fb7c628 Simplify pmap_extract4_4c(), as suggested by Chuck Silvers in private
communication.
2003-06-28 10:02:13 +00:00
pk
75fe06e6e3 me_free(): it makes no sense to try and update the ref/mod PTE bits here. 2003-06-28 09:51:04 +00:00
uwe
ea10b56931 Trust srt0.S if it has set cputyp to CPU_SUN4M.
It can infer OFW -> sun4m, as only JavaStations have OFW, and it can
detect OFW by the different calling convention.
2003-06-28 01:03:57 +00:00
uwe
5fe7a8a85c Only JavaStations have OFW, so set cpu type to CPU_SUN4M in is_openfirm. 2003-06-28 00:59:09 +00:00
uwe
94e7210074 Drop redundant argument to printf("\n"). Obvious pasto. 2003-06-27 21:27:24 +00:00
pk
9e0e8676f1 Make sure to flush any user register windows when stealing PMEGs in
me_alloc() (and SMEGs in region_alloc()).

Should fix PR#14180.
2003-06-27 16:44:03 +00:00
martin
89955ad8b5 #ifdef _KERNEL_OPT police 2003-06-25 14:38:53 +00:00
pk
dc05fd9fd2 sun4/sun4c: move/add write_user_windows() at the top of pmap_[k]remove() and
pmap_[k]enter().
2003-06-23 15:45:08 +00:00
pk
74806170e3 According to my calculations, the cross-over point for the amount of work
needed to flush an entire segment from the sun4/sun4c caches is at 16 pages.
2003-06-23 13:43:20 +00:00
pk
dc6eeb9b47 Use pre-computed `# of cache lines' where appropriate. 2003-06-23 13:34:28 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
pk
db543774bf pmap_bootstrap4_4c():
* enable caching of message buffer & cpuinfo
	* it ought to be no longer necessary to not write-protect the kernel
	  text in order to support KGDB
2003-06-18 14:24:55 +00:00
pk
f707a950e3 Remove out-dated MP comment. 2003-06-18 09:34:22 +00:00
drochner
1a03e79900 don't #include <sys/dkstat.h> where it is (appearently) unused 2003-06-18 08:58:34 +00:00
thorpej
452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
fvdl
7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
thorpej
0eff671820 Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
2003-06-14 17:01:06 +00:00
thorpej
22a1ce1e9d Add -ffreestanding. 2003-06-01 00:43:47 +00:00
nakayama
c80c657a39 Correct invalid type. 2003-05-20 13:38:00 +00:00
martin
c189434481 Make kernels with options KGDB compile. (Didn't test kgdb though) 2003-05-18 16:45:21 +00:00
nakayama
ca7665c318 Don't traverse here in case of sparc64 32-bit environment. 2003-05-17 02:45:04 +00:00
nakayama
6256a4034a Make sure to remove lib directories. 2003-05-17 02:30:14 +00:00
nakayama
cd35e5f630 Make sure to remove proper link. 2003-05-17 02:26:27 +00:00
kleink
776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
thorpej
e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej
36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
martin
f4e8d9c840 Remove a spurious Debugger() call in a "this should never happen"
(SUN4U only) code path.
2003-05-10 13:26:44 +00:00
thorpej
b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
pk
d44463bc60 GC old FPU code. 2003-05-07 08:25:30 +00:00
pk
c84d68a75a cpu_exit(): keep the MD FPU pointers in a consistent state since the thread
structure will linger for a while on various zombie lists.
2003-05-07 08:24:29 +00:00
pk
c1b72e3dc0 Fixup comment on cpu_exit(). 2003-05-07 08:19:21 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
dsl
d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
pk
5ac72273d9 Restore TLB flushes when removing level 2 & 3 page tables (these went missing
in revision 1.242).
2003-05-01 14:14:46 +00:00
martin
d7259b772a Make this compile with __FULL_SPARC_BUS_SPACE,
from Steve Rumble in PR 21398.
2003-04-30 22:12:34 +00:00
scw
8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
bjh21
4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
ragge
d79e49080c #ifdef around end[]. 2003-04-26 14:12:22 +00:00
ragge
d8c8fa8111 Add pseudo-device ksyms. 2003-04-26 14:10:04 +00:00
ragge
69a66687f8 Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
2003-04-26 11:05:05 +00:00
ragge
766d04f56a Add ksyms device major. 2003-04-25 21:10:46 +00:00
martin
d313e6d92e Add sysmon device. 2003-04-20 16:53:46 +00:00
christos
a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
jdc
7a2abff303 Always include (new) cpuconf.h.
From Christopher SEKIYA in PR port-sparc/21093.
2003-04-11 13:55:24 +00:00
jdc
eacecff6bb Install (new) cpuconf.h.
From Christopher SEKIYA in PR port-sparc/21093.
2003-04-11 13:54:16 +00:00
christos
b9f9db3ca2 Bye Bye UCONSOLE 2003-04-10 22:06:51 +00:00
thorpej
d154229cf2 Don't define PAGE_SIZE, etc. in terms of NBPG, rather use the same
logic as used by <machine/param.h> to define constant PAGE_SIZE if
possible.

Also define the minimum and maximum PAGE_SIZE that might appear in
any given configuration (4K and 8K, respectively).
2003-04-09 16:27:06 +00:00
thorpej
efdd83f440 Move CPU configuration predicates to <machine/cpuconf.h>. 2003-04-09 16:22:33 +00:00
uwe
b0645fe98e Add names for v8 traps (cf page 76, table 7-1).
Fix coprocessor disabled/exception traps that were placed incorrectly:
cp_disabled == 0x24 (0t36) was placed at 0x36, ditto for cp_exception.
2003-04-08 21:56:31 +00:00
uwe
d7080d6b9d In msiiep_attach print \n to terminate its attachment line. 2003-04-08 15:16:14 +00:00
uwe
cb7b4919ec Make v8_*_len symbols local so that they don't get in the way in ddb. 2003-04-08 01:51:46 +00:00
he
b44c5e8370 Track changes introduced when UFS2 was merged, so that this builds again. 2003-04-05 08:58:55 +00:00
christos
14e617d80f try to make this work with ufs1 only. 2003-04-03 22:10:12 +00:00
thorpej
02efafccdc Use PAGE_SIZE rather than NBPG. 2003-04-02 04:35:22 +00:00
pk
a63321f624 pmap_kprotect: use supervisor permissions; don't bother checking for `no
change' case, it's not worth the effort.
2003-03-25 11:33:46 +00:00
hannken
f2746edc5b Explicit cast for netif.
Approved by: Matthias Drochner <drochner@netbsd.org>
2003-03-13 12:02:54 +00:00
jdc
cc782e8a7e Make this compile with only SUN4 defined. 2003-03-12 07:51:00 +00:00
lukem
6107a9b605 crank memory disk from 1360 blocks to 1376 blocks 2003-03-08 00:04:36 +00:00
pk
f26c7b7e7f Note a kernel pmap locking problem in pmap_kenter_pa4m(). 2003-03-03 22:43:58 +00:00
tshiozak
31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
pk
77accc351e Use the new pmap_kprotect() function instead of pmap_changeprot().
The latter is now a pmap internal function; and it wasn't used correctly
in mkclock.c anyway.
2003-03-02 21:42:48 +00:00
pk
22cf03a09f pmap_changeprot() is not a UVM <-> PMAP interface function; make it internal.
Provide pmap_kprotect() for MD code to change protection on a range of
kernel addresses (cuurent users: intr.c and mkclock.c).
2003-03-02 21:37:20 +00:00
pk
1b5340d327 Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
2003-03-01 13:01:55 +00:00
perseant
eab869e1c0 Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
2003-02-27 19:22:36 +00:00
pk
33bdc2efe0 Free page table pages to the same VM map they were allocated from. 2003-02-27 14:19:41 +00:00
pk
4eb3db09d9 Move all `ID prom' stuff into the prom library. 2003-02-26 17:39:05 +00:00
pk
fb425a12ca Re-define `struct memarr' to have the same layout as the V2 ROM memory
property to avoid gratuitous copying in prom_makememarr().

Have prom_makememarr() accept a NULL pointer, in which case it will return
the size of the array needed to store the memory descriptors.
2003-02-26 14:25:20 +00:00
pk
f5831d3d87 Store the physical memory descriptors on top of the kernel instead of
allocating a fixed sized array.
2003-02-26 14:18:24 +00:00
thorpej
3ea6b8be93 Add missing splbio() protecting of bufpool access. Add a clarifying
comment to <sys/buf.h> reminding everyone of the need for splbio().
2003-02-25 21:25:40 +00:00
thorpej
eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
pk
b69aef5f3e * Use fdloadfile() to avoid opening the the underlying device twice.
* Cleanup old stuff.
2003-02-25 08:09:30 +00:00
pk
dd87308a05 Note which network boot protocol we're trying. 2003-02-25 08:06:29 +00:00
pk
a8bd073e6f pv_unlink4m(): don't forget to link in a new PV entry after alias checking. 2003-02-24 15:14:51 +00:00
pk
007c1ca9cf Remove the assumption in the sun4/sun4c bootstrap code that the kernel
is always mapped using PMEGs and SMEGs starting at #0.
2003-02-21 19:07:36 +00:00
pk
b7f550c62d Allow the kernel to be loaded at its link address (aka KERNBASE) by the
boot program.
2003-02-21 19:04:07 +00:00
pk
b8081a591a Change locking prerequisites for the pv_changepte4m() helper function
to avoid locking recursion.
2003-02-20 16:22:49 +00:00
martin
c3ed92df3e Add a few new devices. 2003-02-20 12:02:31 +00:00
pk
b66bce23df Finish PV table locking. Terminology and locking strategy stolen from
the alpha port.
2003-02-19 22:27:08 +00:00
pk
d286e74769 pgt_page_alloc: use uvm_km_kmemalloc() so we can honor the PR_NOWAIT flag
pmap_kenter_pa4m: lock the pmap we're working on.
2003-02-18 22:05:08 +00:00
pk
2b390d41d0 Move makememarr() into promlib.c. 2003-02-18 13:36:51 +00:00
pk
c502753d44 Fix pasto in previous. 2003-02-15 13:30:11 +00:00
pk
84e3fcabb3 Redo part of rev. 1.237; the pages at KERNBASE might not be mapped when the
kernel has just been loaded.
2003-02-15 13:17:41 +00:00
pk
baa98646a0 It's not necessary to complicate the computation of `va2pa_offset': we already
assume that the few leading pages in front of the kernel image are
always present.

Adjust `va2pa_offset' on sun4 and sun4c as well, so that some day we can
have the bootstrap program load the kernel some place else.
2003-02-14 22:24:58 +00:00
pk
d6b6eb78e4 Move the PV list header into the VM page vm_page_md structure.
Also, start using a spin lock to protect PV list operations.
2003-02-13 09:53:20 +00:00
pk
338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
mrg
2a81b2dfea clean up a couple of SMP comments. 2003-01-31 01:26:39 +00:00
hannken
eea2fc320e Fix printf() problem caused by "daddr_t" change. 2003-01-30 16:33:50 +00:00
pk
be1188e00d Provide locking required by the interrupt handlers running at IPL_SERIAL. 2003-01-28 12:35:31 +00:00
kent
cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
pk
bfb9cac2fc Release the kernel lock in upcallret() and startlwp(). 2003-01-26 13:20:12 +00:00
fvdl
a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
pk
f65446d08d When stopping a CPU, clear its bit from cpu_ready_mask. 2003-01-23 22:33:41 +00:00
pk
a6a16741fe Optimize xcall() et.al. further by maintaining a cpuset mask of all CPUs
marked ready. This saves repeated testing for NULL pointers and the
CPUFLG_READY flag.
Also use a separate flag variable to signal xcall completion. This saves a
load and a pipeline stall.
2003-01-23 19:54:35 +00:00
pk
a799bdd88d GC the per-CPU message lock.
Move the level 15 msg area further down the cpuinfo structure, as it's
used infrequently.
2003-01-23 18:49:08 +00:00
pk
39ce68a44b bogusintr: print cpu number. 2003-01-23 14:56:06 +00:00
pk
22acc2a827 Shave some code off xcall(). 2003-01-23 14:54:33 +00:00
pk
40a1653fc2 pmap_kenter_pa4m: like pmap_enk4m(), we can use setpte4m().
ctx_free: fix cache flush context for sun4/sun4c.
2003-01-23 12:48:53 +00:00
pk
698ca6fb6f LWPify cpu_debug_dump(). 2003-01-23 11:50:50 +00:00
pk
9d33cc7115 Set the interrupt target to the current CPU when directly accessing
the chip for console I/O.
2003-01-22 22:00:39 +00:00
pk
53c776f062 Add functions to set & get the interrupt target CPU. 2003-01-22 21:58:28 +00:00
sjg
b3d7df8002 Don't hide bootmid behind MULTIPROCESSOR. 2003-01-21 06:18:41 +00:00
pk
26eedde15b srmmu_cache_flush: when flushing per-page and doing more than one page,
we might be crossing a segment boundary.
2003-01-20 22:15:54 +00:00
pk
d823499ff4 pmap_enter4m: when installing a new PTE we don't need to invoke the elaborate
TLB de-map protocol.  In the relatively infrequent case where this function
must update an existing mapping, do the de-map explicitly before installing
the new PTE value.
2003-01-20 22:03:54 +00:00
pk
ab9a8ae184 Set the system-wide cache aliasing distance according to the largest cache
found on the CPU modules (hypersparc & cypress).

Vikings have a physically indexed cache, so don't bother with computing an
aliasing distance (leaving cache_alias_dist zero disables the BAD_ALIAS macro).
2003-01-20 21:56:34 +00:00
pk
b4a0aebea2 Add SUN4D case for cache alias macros. 2003-01-20 21:43:38 +00:00
pk
353e527861 Remove the restriction that the boot CPU must be the first CPU in the order
as it is presented by the PROM. This is actually amazingly less trivial
than it looks at first, since the finding the Module ID that's currently
executing your code is specific for each module type and/or manufacture.
2003-01-20 20:51:33 +00:00
pk
18f455c44f Replace some more VA2PA(<static_addr>) calls with PMAP_BOOTSTRAP_VA2PA() 2003-01-20 15:45:40 +00:00
pk
5815e88f83 De-couple some MULTIPROCESSOR and SUN4M/SUN4D dependencies. 2003-01-20 12:06:49 +00:00
pk
5be63cb4a3 xcall(): two more printf => printf_nolog 2003-01-20 00:55:52 +00:00
thorpej
c464d72f40 Merge the nathanw_sa branch. 2003-01-18 06:44:56 +00:00
pk
4d7731a177 cpu_switch:
* return `switched to same process' only if that process was actually
  already on a run queue when we entered.
* skip the switch to the idle stack if we can switch immediately
* .. and because of this, don't release the scheduler lock until after
  we've fully switched to the new process's stack.
2003-01-17 14:49:45 +00:00
pk
d352e8ce9c pmap_deactivate(): only update the pmap's cpuset if need to. 2003-01-17 14:15:17 +00:00