Commit Graph

592 Commits

Author SHA1 Message Date
cegger 0839b594ba use device_lookup_private to get softc 2008-06-12 23:22:36 +00:00
tsutsui 6b0322861b Add options COMPAT_40 to files which have options COMPAT_30. 2008-05-30 20:10:01 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
matt 00caca484f Change IPL_LEVELS to NIPL.
current_spl_level is dead.
2008-04-29 17:09:47 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
matt 825088eda6 Merge kernel changes in matt-armv6 to HEAD. 2008-04-27 18:58:43 +00:00
cegger 376411d2dd device_t / softc split. From Hans Rosenfeld. 2008-04-16 09:39:01 +00:00
chris d23686181e Fix device_t/softc split fallout.
A device_t should never be cast with void*.  This fixes reboot on acorn32.
I also suspect it'll fix a panic mjf was seeing due to corruption of the
alldevs list.
2008-04-13 01:14:26 +00:00
chris 2fb78588e4 Ignore size alignment issues, as we're never going to have a case where
copying a three extra bytes will cause an issue.
2008-04-12 16:10:46 +00:00
tsutsui 5147571380 Split devict_t/softc for ncr5380sbc SCSI, and misc cosmetic changes. 2008-04-04 16:00:57 +00:00
cube 76f56e694a Set the device_t back pointer in the softc. 2008-03-18 23:52:16 +00:00
cube 7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
cube 607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
cube cf80f73d17 Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments.  Use device_t accessors, correct types, and ANSIfy when
appropriate.
2008-03-12 14:31:11 +00:00
cube 8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
dyoung e4f3892584 Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine.  Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev().  Use PMF_FN_ARGS, PMF_FN_PROTO.
2008-02-29 07:02:04 +00:00
chris fa96148b7b Misc updates to hopefully improve vidcvideo console usability:
* add virtual consoles by using wsdisplay_vcons
* make use of generic scrollback support for consoles
* enable colour support for vidcvideo consoles
* use the default NetBSD font, rather than picking a sony one
* make kernel output green, so it's obvious.

This was tested at 800x600 in 8bpp on an A7000+ and 2MB VRAM RiscPC.

To actually benefit from these changes wscons=YES needs to be added to
your rc.conf
2008-02-29 00:37:26 +00:00
drochner bb33f35f20 Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
2008-02-20 21:43:33 +00:00
joerg 2fa7e92d02 Missing assym.h dependencies. 2008-02-14 00:35:56 +00:00
joerg 7eb4a6d1de Fix syntax. 2008-02-14 00:25:39 +00:00
joerg e69482d49d Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
2008-02-12 17:30:57 +00:00
chris 08a72f8b45 Further tweaks to Kinetic support. All memory in ths sytem is now used.
Non-Kinetic memory is placed into a seperate freelist so preference is
given to the kinetic memory.
2008-02-09 13:17:32 +00:00
chris 37f9401024 Fix-up boot32 to work on A7000+
Logically the previous code should have worked but didn't.  It appeared to
fail when reading the relocation table from physical memory.

To work-around this issue we now compact the relocation table (it shrinks
from ~800 entries to ~15 on a 2.5MB kernel)  The compacted table is small
enough to copy into the page of memory we use to do the relocations.  The
relocation code can now find the table, and carry out the relocations.

To help with debugging the screen border will change colour:
Red:   Running without the MMU turned on (IE 1-1 physical mapping)
       Note that the border will stay red a while as we're copying the
       kernel over at this point.
Green: We've finished copying the kernel over (unless the code breaks
       this will be rarely seen)
Blue:  We're running on the bootstrap L1 table, and just about to call
       the kernel.

Other tweaks include:
* copy the kernel 32bits at a time, rather than 8 bits at a time.
* assert that the relocations are 32bit aligned (so the above works)
* flush the cache and write buffers before turning off the MMU.

Tested by myself on an A7000+.  Tested by skrll@ on Risc-PC and A7000.
2008-02-03 14:59:16 +00:00
chris 67bda63986 Add an arm/conf/std.arm file which contains common arm options, initially
just options CPU_IN_CKSUM.

Include std.arm in all arm platform std files.

This should reenable the asm in_cksum code for all arm platforms.

Also remove the now unused in_cksum_arm.S.
2008-01-27 12:37:10 +00:00
chris be877f2c8a Add support to support code for Kinetic card. The kernel is loaded into
the Processor local memory, so that should provide a speed up.

Currently DMA won't work, as we only tell the kernel about the kinetic
memory, and exclude the motherboard memory. I'll look at fixing this over
the weekend.

Add support for kernels > 4MiB.  The -current INSTALL kernel has now hit
25KiB over 4MiB and we were only adding L1 mappings for 4MiB.

Also added lots of tracing which I used to work out what boot32 was doing,
and so what the kernel was meant to be doing.  This is disabled by default.

Out of paranoia also become a client of all domains before setting the ttb,
just in case RISC-OS ever decides to use domains.

All of this has been tested on my Kinetic Risc-PC.  I've carried out a full
install onto it, and hope to use it for testing out the interrupt work I've
been doing.
2008-01-26 00:16:57 +00:00
chris f6be197e27 Fix support for kinetic in the bootloader.
With these changes the kinetic dram blocks are correctly identified and
passed into the kernel.

Note that I've a pending kernel change to understand the kinetic blocks
and do something useful with them.
2008-01-26 00:01:54 +00:00
chris 3f1a682126 Leave the SA's clockswitching enabled. It allows the SA to run at full
speed when running things from cache, rather than being in step with the
memory clock.
2008-01-25 23:18:59 +00:00
joerg ce67bf568b Fix dependencies on assym.h. 2008-01-25 18:54:26 +00:00
chris 2c030c103e Zero out the whole of the structure, not just the first 4 bytes. IE use
sizeof(*bconfig) not sizeof(bconfig)

Now a small kernel will boot up on my RISC-PC, an install kernel won't
though, it hangs at the switch from RISC-OS to NetBSD.
2008-01-21 00:41:13 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
chris 131e68c2e1 Remove arm support for IPKDB.
It hasn't worked since arm was broken out from arm32 in Jan 2001, and
no-one has noticed or cared to fix it.
2008-01-19 13:11:09 +00:00
matt e1adc2881b Add IPL_SOFT* defined at IPL_NONE.
Change _ARM32_INTR_H to _ACORN32_INTR_H
2008-01-08 06:30:22 +00:00
matt 306d43c5bf Remove unused variable. 2008-01-08 06:29:39 +00:00
ad a5edcb2c82 Missing arg to cv_timedwait(). 2008-01-05 17:38:50 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
tsutsui 99221a563b Use TAILQ_FIRST(3) and TAILQ_NEXT(3) macro. 2007-12-05 12:31:25 +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
xtraeme 4ba09b41c3 Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
2007-11-04 14:34:19 +00:00
yamt 23005df1e0 defparam PAGER_MAP_SIZE. 2007-10-25 13:03:03 +00:00
yamt ac301375d9 fix warnings. 2007-10-25 12:48: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 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
dyoung 6f7649313f Constify. 2007-08-26 22:28:52 +00:00
tsutsui 320e4f3fc5 Remove all references to spl_mask. Now it isn't used by any sources.
Discussed on port-arm.
2007-08-13 02:04:50 +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
jmmv 3e495310cf Print some debugging information when DEBUG is set, not when TERSE is
unset.  The latter is not a "standard" definition, and was used in very
few places anyway.
2007-07-30 12:25:14 +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 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
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
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
hubertf 7ab6344caa Remove duplicate #include <sys/param.h>, and instead
#include <sys/cdefs.h> for __KERNEL_RCSID()

From: Slava Semushin <php-coder@altlinux.ru>
2007-03-26 22:46:20 +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
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
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
chs 5115829218 feed /dev/null to awk for building modedef.c (for building on solaris). 2006-12-09 22:01:01 +00:00
wiz 6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
jmmv 7a13fe4abf Remove tmpfs's experimental status. OK'ed by core@. 2006-11-11 18:47:08 +00:00
bjh21 b09fd5bdb5 No need for two __KERNEL_RCSIDs. 2006-10-26 22:42:00 +00:00
bjh21 84e47229be parse_mi_bootargs() is declared in <arm/arm32/machdep.h>, so there's no need
to declare it here too.
2006-10-24 21:03:13 +00:00
bjh21 65d685fe36 Use <arm/bootconfig.h>. 2006-10-24 20:39:13 +00:00
bjh21 139ac00676 The sec(4) and ei(4) drivers appear to work on acorn32. Use them in preference
to the MD asc(4) and ie(4) drivers.
2006-10-22 14:15:51 +00:00
bjh21 d6e105789d The correct number of elements to insert into cmd_iohs is WDC_NREG. Using
larger numbers risks a buffer overflow and panic.  Bug spotted by Mike Pumford.
Patch compile-tested only, but it's obviously correct.
2006-10-09 21:12:44 +00:00
chs e8295642bd remove MALLOC_NOINLINE, it doesn't do anything anymore. 2006-10-02 03:28:29 +00:00
manu f309b668fd - Document COMPAT_15 as doing nothing
- Add COMPAT_15 to all the kernel that had COMPAT_14, for the sake of coherency
- Remove the only occurences of #ifdef COMPAT_15 in the tree: for the ARM
ports, COMPAT_15 was always used in conjunction with EXEC_AOUT. Only EXEC_AOUT
matters here.

This address kern/18407
2006-09-27 21:42:04 +00:00
bjh21 e0884dc370 PR 23783: the correct number of elements to insert into cmd_iohs is WDC_NREG,
not DRIVE_REGISTERS_SPACE.  The latter is much bigger and causes a buffer
overrun and panic.  Patch supplied by Mike Pumford.
2006-09-24 23:14:58 +00:00
bjh21 e10108c7f2 Nothing in the kernel now tests __HAVE_NWSCONS, so stop defining it everywhere. 2006-09-03 13:51:23 +00:00
bjh21 09bd451486 Switch acorn32 to MI inittodr() etc. 2006-09-03 12:46:57 +00:00
matt 5322f324e6 Make this console now that vconsole is done and with GCC4. 2006-08-31 05:11:07 +00:00
christos e0df1e4c51 PR/34283: Gene ENonymous: Add IPFILTER_LOOKUP to the default kernel options
Also remove CCITT,NS,NIP
2006-08-26 20:26:43 +00:00
tsutsui 6ff205ce76 Remove obsolete #options VERIFIED_EXEC, found by grep(1). 2006-08-26 07:59:21 +00:00
bjh21 72e11b654e Clean out some of the junk from this file, sepcifically definitions for
an Amiga DMA controller, and #if 0'ed WD33C93 definitions that are duplicated
in sbicreg.h.  uPD71071 definitions can stay for now, since they're not
actually useless even though they're unused.
2006-08-20 19:26:52 +00:00
bjh21 d91f74bef1 Now that boot32 can pass in a useful frame rate, it's reasonable to use the
standard video mode list in our example kernels, rather that a somewhat
random subset.  So do that.
2006-08-19 23:01:23 +00:00
bjh21 da29c632f0 Add support to boot32 for passing a real vsync frequency to NetBSD.
Unfortunately, RISC OS doesn't seem to provide a sensible way to ask what
frame rate it's using so we resort to measuring it ourselves.
2006-08-19 22:44:57 +00:00
bjh21 9dc302fec2 Arrange things so that if MONITOR isn't defined in the kernel configration,
we use the standard mode list from videomode.c rather than one generated
by makemodes.awk.  This is less useful than it might be since without a useful
frame rate from the bootloader we're likely to end up choosing a screen mode
that's either flickery or too fast for the monitor (or DRAM bandwidth).
2006-08-19 13:34:15 +00:00
bjh21 b70c967724 Clean out some cruft left behind by the old console code. 2006-08-16 09:47:26 +00:00
bjh21 2c38f19586 Finally remove the old, pre-wscons, acorn32 console code. This dated back
to RiscBSD and had been lurking in dark corners scaring people (mostly me)
for far too long.  It will be missed, but not much, and I hope we can clear
up any fallout before 5.0.

While I'm in the area, also remove rpckbd(4), since pckbd(4) has
been supported on acorn32 for ages.
2006-08-14 22:04:30 +00:00
skrll 1a3062e81b s/adpater/adapter/
Prompted by PR/34195
2006-08-14 06:22:33 +00:00
christos b300b74469 Disable SYSTRACE by default on all kernels (discussed with core) 2006-08-12 15:29:52 +00:00
bjh21 891d055e7c Nothing in the tree pays any attention to "options NC" any more, so don't set
it.
2006-08-05 23:11:11 +00:00
bjh21 6e83f00384 The Hydra code should probably be removed, but until it is, it may as well
not generate spurious diffs in my tree, so bring it up to my working version.
2006-08-05 23:03:21 +00:00
bjh21 d97d9a1480 Xarm32VIDC has supported pckbd(4) for several releases now, so it's probably
safe to stop using rpckbd(4) in wscons configurations.
2006-08-05 22:33:44 +00:00
bjh21 62d6ab40d3 Support for timecounters on acorn32, supplied by Mike Pumford. Only
compile-tested by me, but he promises it works.
2006-08-03 23:19:06 +00:00
drochner 84f50d1b92 don't install <machine/db_machdep.h>, this is kernel only 2006-07-26 19:54:56 +00:00
bjh21 cf7ce97e4b Silly error: xos_cli() should call XOS_CLI, not OS_CLI. 2006-07-20 23:35:20 +00:00
gdamore 34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
bjh21 642809bdd7 Bump version number for today's changes. 2006-07-13 21:32:12 +00:00
bjh21 0867d7e87d RCS ID header. 2006-07-13 16:48:18 +00:00
bjh21 c5e6021bb2 Pass the argument to OSModule_Free in the correct register. This stops
NBFS leaking memory.
2006-07-13 16:29:46 +00:00
bjh21 99d7b7bca3 Fix error handling in nbfs_close(). 2006-07-13 16:11:41 +00:00
bjh21 723176de91 Handle Service_FSRedeclare correctly. NBFS now works after restarting
FileSwitch.
2006-07-13 16:09:58 +00:00
bjh21 bd0da079fe Add Service_FSRedeclare. 2006-07-13 16:03:23 +00:00
bjh21 a0121cb653 Sensible error handling, with libsa errors being mapped to useful RISC OS
errors.  Also centralise our filing system number (as yet unassigned) in
nbfs.h.
2006-07-13 15:51:54 +00:00
bjh21 6431f3b2de Descend into nbfs -- I think it's useful now. 2006-07-04 23:08:51 +00:00
bjh21 c6bb58fda2 We don't actually use NEWVERSWHAT, but we should still try to make it correct. 2006-07-04 23:08:10 +00:00
bjh21 ac8af88277 Add some definitions necessary for the latest NBFS, plus a couple of
functions that my boot32 hacks are likely to require.
2006-07-04 23:06:51 +00:00
bjh21 6022ed9721 Fix missing newline at end of file. 2006-07-04 22:42:11 +00:00
bjh21 b314f251e2 Add suppport for FSEntry_file 255, loading whole files. Now I can open
/etc/passwd in Zap.
2006-07-04 22:34:54 +00:00