Commit Graph

180 Commits

Author SHA1 Message Date
tsutsui
a1b485666f NBSG is not used in this file so remove unnecessary comment and include. 2009-12-11 18:45:05 +00:00
tsutsui
1a88b50bca Include pmap.h or pmap3.h instead of param.h for NBSG to handle MMU. 2009-12-11 18:42:05 +00:00
rmind
3f18fe8123 - Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.
- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places.  Reduce sys/user.h inclusions.
2009-11-27 03:23:03 +00:00
snj
febb7cce65 Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder). 2009-10-21 23:12:09 +00:00
rmind
40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
he
3b5f619bfc Use .PATH.S instead of giving a source file with fully qualified path.
This should avoid the sun3 port contaminating its source tree during build
with .d and .o files corresponding to ctrlsp.S.
2009-09-25 11:19:35 +00:00
tsutsui
1b7ed0b13a Switch sun68k standalone programs to using MI libsa and libkern.
Bump version.

Tested bootxx + ufsboot on TME (sun2 and sun3) and 3/80 (sun3x).
2009-03-20 11:42:25 +00:00
tsutsui
18014b1a99 Remove bcmp() from MD libsa.
XXX: These ports should be rewritten to use MI libsa for maintainability.
2009-03-19 10:19:33 +00:00
tsutsui
1440fadbfd Use <bsd.klinks.mk> to create MD include dir symlinks. 2009-03-15 14:08:17 +00:00
he
ecef5ef303 Correct typo in previous: seseconds_t -> saseconds_t. 2009-01-17 12:47:02 +00:00
tsutsui
69cf32a782 Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
 numbers in seconds returned by the machine dependent getsecs() function
 which are used to measure relative time

saseconds_t (currently int):
 numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
2009-01-12 11:32:43 +00:00
tsutsui
fe0dea612e WARNSfy. 2009-01-12 07:00:59 +00:00
tsutsui
4a193f31ac Split device_t/softc with misc cosmetic changes. 2008-07-01 15:15:34 +00:00
tsutsui
5886a7c394 - avoid extra offset calculation in region/multi ops
- fix swapped dist/src in copy_region ops
2008-07-01 15:14:32 +00:00
tsutsui
aecc2565d0 Make cpu_intr_p() inline. 2008-06-22 17:33:41 +00:00
tsutsui
43a0e8e404 Unify splraiseipl(9) implementation among m68k ports as per
suggestion from isaki@ on port-m68k.

For sun68k (sun2, sun3 and sun3x):
- export ipl2psl_table[] and make it uint16_t
- make makeiplcookie(9) inline
- put PSL_S bit into ipl2psl_table[] rather than adding it in makeiplcookie(9)
2008-06-15 07:23:26 +00:00
ad
06c343ac94 vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both. 2008-06-04 12:41:40 +00:00
martin
9c63b7e8cc Move to 2 clause TNF license 2008-05-04 00:18:16 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui
bdc08026eb Fix a botch in rev 1.21. 2008-04-27 15:18:00 +00:00
tsutsui
c3b129605a Use generic atomic_cas_uint() for mutex(9) and rwlock(9), and
remodel old RAS based _lock_cas() implementation for m68010
into genereic atomic_cas_32().
Now sun2 kernel compiles and even works on multiuser. (hehe)

Tested on tme (emulationg 2/120 and 3/150) and (real) 3/80.
2008-04-05 22:47:52 +00:00
joerg
509bb20712 Return NULL if no scsibus was found to fix compilation. 2008-02-18 14:59:52 +00:00
joerg
dd20faf2af Convert to device_find_by_driver_unit. 2008-02-12 19:53:46 +00:00
tsutsui
d0ea2c0ffa Also account idepth in clock interrupt handlers
(which are registered directly by isr_add_custom())
and use the idepth value for CLKF_INTR().
2008-01-26 14:02:54 +00:00
tsutsui
8dcb4a7ea6 Always account idepth for cpu_intr_p(), which is now
mandatory for sys/kern/vfs_bio.c:biodone().

Comments from Andrew Doran, and fixes mutex errors on sun3.
2008-01-11 10:21:26 +00:00
tsutsui
99221a563b Use TAILQ_FIRST(3) and TAILQ_NEXT(3) macro. 2007-12-05 12:31:25 +00:00
tsutsui
2f66d76b2f Adapt sun68k ports to recent interrupt handling changes.
XXX: sun2 (m68010) doesn't have CAS instructions.
2007-12-04 15:12:07 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
tsutsui
6e5ce03f0b - update a comment
- use __func__ to print function names
- some KNF
2007-12-01 11:41:20 +00:00
ad
d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
ad
9c6535a6de Add ci_cpuid where it's missing. 2007-08-04 09:49:51 +00:00
tsutsui
c57c46580b Wrap sanity checks with #ifdef DIAGNOSTIC. 2007-05-21 17:00: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
9e69c7d7d9 Make netintr() static since it's referred only in sun68k/isr.c. 2007-05-21 16:25:14 +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
bd2911249c Adapt sun68k ports to yamt-idlelwp.
Tested on TME (sun2 and sun3) and 3/80 (sun3x).
2007-05-18 10:18:24 +00:00
thorpej
8f326e8290 - Define LOCK_CAS_CHECK() in m68k/frame.h (there because it operates on
a clockframe).
- Call LOCK_CAS_CHECK() in clock_intr() (noted by Izumi Tsutsui).
2007-03-12 02:51:03 +00:00
tsutsui
48c4dc47d3 - use splraise4(), which is defined in psl.h
- use splraise6() rather than spl6() for splzs() and splserial()
2007-03-11 06:25:08 +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
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
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
tsutsui
bd2568487a KNF a bit. 2007-02-18 11:52:18 +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
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
tsutsui
a32a73741e Two fixes to avoid lost softintr (probably caused by some race condition):
- make sh_pending in struct softintr_handler volatile
- activate softintr unconditionally in softintr_schedule()
2007-01-23 16:03:43 +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
tsutsui
88c6f2c305 Clear pending flags before calling handers otherwise possibly some softintr
could be lost.
2006-10-10 13:26:47 +00:00
tsutsui
0b2c7040b5 Make sun3 use common sun68k/sun68k/isr.c, sun68k/include/cpu.h and
sun68k/include/intr.h.

This also means now sun3 has GENERIC_SOFT_INTERRUPTS support,
so also adapt fd.c and zs.c to MI softintr(9) APIs.

(I'll also update related sources in yamt-splraiseipl branch later)
2006-10-05 14:46:11 +00:00