Commit Graph

2027 Commits

Author SHA1 Message Date
mhitch 9b0f085da1 68030 and 68040 processors consider the read portion of a read-modify-write
transfer as a write to ensure the memory is writable before starting any
transfer.  The fault status information does not reflect this in the 'read'
status bit (i.e. it shows up as a read access), so faults with a RMW access
to non-writable memory was not getting the correct protection.  The page would
be read-only and the instruction would fault over and over.

A specific example is when a process forks, and the child process attempts
to execute a RMW access to a data page, which is read-only because it's CoP
Copy-On-Write.

When checking if the page needs to be writablek, also check the locked transfer
and treat any locked transfer as a write.

68060 already handled this correctly, since it has separate read and write
fault bits, and both are set on a RMW access and the trap code was checking
the write status bit.

Fixes PR#36848.
2007-09-01 21:31:55 +00:00
adrianp 475217d719 Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
2007-08-06 21:26:53 +00:00
ad 9c6535a6de Add ci_cpuid where it's missing. 2007-08-04 09:49:51 +00:00
ad 66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
ad 63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
he c73835c125 Adapt to the new signature of callout_init(). 2007-07-12 20:39:01 +00:00
he a82c668826 Adapt to new signature for callout_init(). 2007-07-12 20:33:02 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
tsutsui 12f2307a5f Add options COMPAT_40. 2007-06-25 13:22:45 +00:00
mhitch d2eac2f631 Pass a frame pointer to trap() rather than the 'entire frame' trick. Gcc4
was optimizing away modifications to the frame contents (it's not nice to
trick gcc).  Pass the pointer as the first argument to reduce the number
of places that would be changed otherwise.  Fixes the getcwd regression
test on most m68k ports.
2007-06-12 03:34:28 +00:00
martin c2534a819b Add pseudo-device agr to all GENERIC kernels where it might make sense
(commented out in some).
2007-06-04 08:55:18 +00:00
tsutsui 1a72ef0dec Wrap a sanity check with #ifdef DIAGNOSTIC. 2007-05-21 16:57:18 +00:00
tsutsui 32b0b73c06 Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
2007-05-21 16:37:03 +00:00
mhitch 9385473585 Add missing call to lwp_startup() in lwp_trampoline() (which was renamed
from proc_trampoline to match the other ports).

A DIAGNOSTIC kernel will now boot and run.  LOCKDEBUG still doesn't work yet.
Also, my amiga no longer loses time.
2007-05-20 04:29:47 +00:00
tsutsui 570ffc1b5b Update comments to sync yamt-km merge (Sysmap has been moved).
See also:
http://mail-index.netbsd.org/source-changes/2005/02/23/0004.html
2007-05-18 10:45:58 +00:00
tsutsui ed39f92a7f Adapt hp300 to yamt-idlelwp. Tested on 9000/382. 2007-05-18 10:15:08 +00:00
tsutsui 2ab13d3a78 Use vaddr_t casts rather than pointer arithmetic (in #ifdef DIAGNOSTIC). 2007-03-12 12:09:34 +00:00
thorpej 32a8b62d33 - Shrink ipl_cookie_t from 32-bits to 16-bits (large enough to hold
an SR value or an IPL_* constant).
- Take advange of the smaller ipl_cookie_t to shrink kmutex_t from
  16 bytes to 8 bytes by overlapping storage where possible.
- Implement a RAS-based _lock_cas() for mc68010 systems (Sun2).  See
  sun68k/sun68k/isr.c.

Tested on various m68k platforms, but NOT Sun2.  In any case, at least
Sun2 compiles now.
2007-03-11 05:22:24 +00:00
he 331a9e6c5c Fix an instance of "void *v, x;" and cast to char* before doing
pointer arithmetic.
2007-03-07 09:10:16 +00:00
tsutsui d5a5c6095d Allocate msgbufaddr in pmap_bootstrap.c where it's initilized,
and move its declaration into <m68k/pmap_motorola.h>.
2007-03-05 12:50:15 +00:00
tsutsui 29c9f71f20 Use (char *) cast on pointer arith. 2007-03-04 12:06:16 +00:00
tsutsui daeb14ee82 - add missed '*'
- vmmap is declared as (char *) in <m68k/pmap_motorola.h>
2007-03-04 12:03:48 +00:00
tsutsui d5d72a7a81 Use appropriate casts. 2007-03-04 12:02:02 +00:00
tsutsui 2d4d66df69 Use appropriate temporary variables to handle pointer passed via (void *). 2007-03-04 11:55:04 +00:00
tsutsui aa03d48a2b - use (uint8_t *) for framebuffer address
- remove unneeded casts
- misc cosmetics
2007-03-04 11:53:21 +00:00
tsutsui 5726cfb524 - add missed '*'
- move extiobase decl into <machine/cpu.h>
2007-03-04 11:23:25 +00:00
tsutsui 2f5e95ec66 Merge #ifdef _KERNEL stuff into one place. 2007-03-04 10:02:42 +00:00
tsutsui e06ffd4f4e Remove #ifdef _KERNEL since this file is no longer exported. 2007-03-04 09:59:10 +00:00
tsutsui f6b24c6d1c Stop installing <machine/intr.h> on hp300. Suggested by simonb. 2007-03-04 09:57:43 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
tsutsui 1b20cebad5 Hide #include <m68k/softintr.h> inside #ifdef _KERNEL in <machine/intr.h>
to avoid exporting unnecessary files to userland.
Should fix build.sh failure, which was pointed out by isaki@.

XXX: which userland program would require contents of <machine/intr.h>?
2007-03-04 05:28:38 +00:00
tsutsui a3be972973 Make hp300 use common m68k/softintr.c. 2007-03-04 01:57:21 +00:00
tsutsui 5ad868e1e0 - use todr_[gs]ettime_ymdhms
- use bool
- some KNF
2007-02-22 14:04:01 +00:00
thorpej 16ed6645b5 TRUE -> true, FALSE -> false 2007-02-22 05:31:52 +00:00
ad 2d62904bd2 More spllowersoftclock() fallout. 2007-02-16 14:00:17 +00:00
ad 3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
reinoud 43061c75ae Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
2007-02-15 18:33:26 +00:00
tsutsui 6f2a774e58 IPL_NSOFT -> SI_NQUEUES (missed in the previous. Umm) 2007-02-15 12:43:17 +00:00
tsutsui 032ce3bba4 Fix an indent in the previous. 2007-02-15 12:22:04 +00:00
ad 1727553fe8 Make a couple more updates for signal handling. 2007-02-10 10:16:33 +00:00
tsutsui b501f9bf07 Rename _IPL_SOFT* macro to SI_SOFT* to sync with other m68k ports. 2007-02-10 03:30:13 +00:00
tsutsui 18f2cde2bd Make COMPAT_HPUX compile by mechanical replacements.
XXX1: not sure if it still works even before newlock2 merge
XXX2: some more mutex locks might be required
2007-02-10 02:42:30 +00:00
tsutsui 3e828b086d Apply changes for newslock2, taken from other m68k ports. 2007-02-10 02:38:34 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf 142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
scw e07faf8a74 Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
2006-11-25 11:59:55 +00:00
wiz 6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
jmmv 7a13fe4abf Remove tmpfs's experimental status. OK'ed by core@. 2006-11-11 18:47:08 +00:00