Commit Graph

1736 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
he a4d164aaef Same change as -r1.133 of src/sys/arch/amiga/amiga/pmap.c:
As per hint from ad@, change uvm.kernel_object to uvm_kernel_object,
  to adapt to the recent uvm changes.
2007-07-23 23:13:04 +00:00
macallan a1457f5905 change pmap_phys_address()s parameter to paddr_t since that's what it gets
fed from mmap*() anyway
approved by gimpy
2007-07-16 23:48:03 +00:00
he 3bb4d9ddb8 Regenerate configurations after adding COMPAT_40 to GENERIC.in. 2007-07-16 06:35:53 +00:00
he 13a06ef4a8 The COMPAT_AOUT_M68K option now requies COMPAT_40 after the changes
to mount(), so define COMPAT_40 too.
2007-07-16 06:26:54 +00:00
ad 63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
he 150caa6d8c Adapt to new signature for callout_init(). 2007-07-11 19:13:23 +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
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 7003cf1903 regen 2007-06-06 08:21:08 +00:00
martin 400bdf5863 Add pseudo-device agr 2007-06-06 08:20:26 +00:00
mhitch 719ec3a2b9 From pmap_motorols,c:
Allow pmap_enter_ptpage to fail, sometimes. Pass WAIT/NOWAIT flags and
fix some obvious locking problems. This allows us to run a LOCKDEBUG
ernel now.
2007-05-22 05:05:32 +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
tsutsui c6262d2d8d Remove obsolete decralations of switch_exit() and switch_lwp_ext(). 2007-05-21 15:34:22 +00:00
tsutsui f06d68f845 curlwp can't be NULL so no need to check it. 2007-05-21 15:22:21 +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
isaki 8bd92b6261 indent fix. 2007-05-20 02:54:11 +00:00
he 57451082bc Adapt to the merge of the yamt-idlelwp branch.
curcpu()->ci_want_resched is now required, so get rid of the
want_resched global.  Also, cpu_need_resched() now takes two arguments.
The l_next and l_back fields in struct lwp no longer exists, so delete
references to it from genassym.cf.
Also, m68k/m68k/proc_subr.s is no longer used, says mhitch, so remove its use.

This brings the atari BOOT kernel back to a buildable state.
2007-05-18 22:58:51 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
macallan d4ddadbf9d include files.wsfb 2007-04-10 02:19:03 +00:00
tsutsui 298a18f6e7 Apply MI softintr(9) patch before it becomes rotten. Untested.
See also:
http://mail-index.netbsd.org/port-atari/2007/03/07/0000.html
2007-03-21 10:56:26 +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
tsutsui f343bfa8eb Treat bus_space_handle_t as opaque, and use bus_space_vaddr(9) to
get device address.

XXX: This driver should be rewritten to use bus_space(9) more properly.
2007-03-06 14:45:31 +00:00
tsutsui d5aef94bf1 Change bus_space_handle_t from void * (formerly caddr_t) to u_long
to make things easier.
2007-03-06 14:42:44 +00:00
tsutsui 35788e9981 - remove volatile from *regkva member in struct grfabs_et_priv
and use temporary variables on register accesses
- also remove volatile from *memkva member in struct grfabs_et_priv
  because it isn't used to refer memory
XXX: I'm not sure if bm->plane should be volatile or not
     but I don't think previous code treats it as volatile anyway.
     (though I'm not sure how compiler handled "volatile caddr_t")
2007-03-06 14:40:25 +00:00
tsutsui 7bad4d945e - change pointers which actually required caddr_t to calculate address
from (void *) to (char *)
- add (char *) cast to appease -Wpointer-arith
2007-03-06 14:15:13 +00:00
tsutsui 46cc919e1f Make TX buffer (uint8_t *) and remove an unnecessary cast. 2007-03-06 14:13:02 +00:00
tsutsui a977b2956f Pass (char *) to mtod(9) on pointer arith. 2007-03-06 14:12:10 +00:00
tsutsui 1f79355c9b Add (char *) cast to appease -Wpointer-arith. 2007-03-06 14:10:07 +00:00
tsutsui bc4a41fd8b Make req_addr (char *) rather than adding an extra cast
since it's used only in this function to calculate buffer address.
2007-03-06 14:07:15 +00:00
tsutsui d319901154 Make io_data (char *) rather than adding an extra cast
since it's used only in this file to calculate buffer address.
2007-03-06 14:03:07 +00:00
he 582dc91458 More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
2007-03-06 13:54:44 +00:00
tsutsui 7474a23441 Add a missed '*'. 2007-03-06 13:53:59 +00:00
tsutsui 57eb9123e8 Remove an unnecessary cast. 2007-03-06 13:53:32 +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
thorpej ab87c6666d TRUE -> true, FALSE -> false 2007-02-22 05:14:04 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
mrg 4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +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
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
jdc 06da305240 We don't need the cpu_startup() prototype here. It is already provided by
sys/systm.h.  Pointed out by skrll@.
2006-12-22 18:00:19 +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
he 25e5748c32 Add -Os to CFLAGS, so that the boot code fits within the constraints
again.  Sorry, I've not traced why this fit in the past, or what
changed to make it not fit anymore.
2006-12-01 13:52:46 +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 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00