Commit Graph

597 Commits

Author SHA1 Message Date
martin
719a906ef5 As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
2008-11-30 18:21:31 +00:00
ad
6ba528b5bc Remove softdep, pass 1. We are focused on improving journalling.
Proposed on tech-kern@.
2008-11-24 11:41:07 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung
94d985722a It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled.  So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks().  Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown().  No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown().  I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that.  Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
2008-11-11 06:46:40 +00:00
tsutsui
1ad310ac6d - fix (commented out) SBLive! driver name; it's emuxki, not sbl
- add commented out audio* at audiobus? line
2008-10-30 16:27:15 +00:00
tsutsui
04ac2a66fd Enable smbfs, tested by several people on port-cobalt. 2008-10-30 00:03:07 +00:00
tsutsui
f6a3248825 Our ever glowing kernel reaches the firmware limit,
so disable several options to shrink the INSTALL kernel that will
be used as an emergency kernel loaded by the firmware directly.
2008-10-30 00:02:16 +00:00
apb
f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
tsutsui
8659ab3851 Add sequencer and vcoda. 2008-10-12 04:36:36 +00:00
tsutsui
1c80af48f5 Now the cobalt kernel can detect boot device properly by boot strings
passed from the firmware, so change root file system type from
explicit nfs to generic '?' so that the INSTALL kernel can also be used
as a rescue kernel on localdisk.
2008-10-11 16:54:48 +00:00
tsutsui
71c4496216 Add audio and midi devices, per report from Mike Hebel on port-cobalt. 2008-10-10 16:44:23 +00:00
uebayasi
08912a35bf Typo in a comment. 2008-10-01 02:44:14 +00:00
tsutsui
28c30d59ac - enable dhclient(8) in RAMDISK kernel
- bump mdroot size
2008-09-13 07:36:30 +00:00
tls
fca9d633b9 Add accept filters to GENERIC kernels where they exist. 2008-08-10 15:31:20 +00:00
simonb
0751ba4bff Add "options WAPBL" to standard GENERIC/INSTALL type configs. 2008-07-31 07:40:59 +00:00
ad
b94f79f0e8 Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@. 2008-07-02 17:28:54 +00:00
tsutsui
1c6ef0f169 Add device nodes for usb devices. 2008-06-08 04:05:58 +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
ad
48ced055d4 pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
2008-05-30 19:26:35 +00:00
tsutsui
8578fbdffa - also put a boot failure message to LCD
- fix botched (and unused) macro
- use struct lcd_message consistently
2008-05-29 14:25:00 +00:00
tsutsui
07c5a11f73 Include files.bluetooth. 2008-05-28 14:05:14 +00:00
tsutsui
0e88f65e18 Print boot banner and a loading kernel name onto LCD,
for users who don't have serial console.  Bump version.
2008-05-28 14:04:07 +00:00
tsutsui
40f5425d58 Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
2008-05-26 15:59:29 +00:00
tsutsui
b87210fa51 Normalize my licenses. 2008-05-14 13:29:27 +00:00
tsutsui
269bbddf81 Remove complete items (multi function PCI interrupts, zs on Qube2700). 2008-05-13 15:06:40 +00:00
tsutsui
e04f8f6085 On netboot specify only FS_OPS(nfs) explicitly for file_system[] fs_ops.
Trying block device fs_ops like ext2fs on netboot could be problematic
on some conditions since not all libsa functions handle errors properly.
2008-05-13 14:26:20 +00:00
tsutsui
416b7a7683 Remove an unused extern declaration. 2008-05-13 14:20:58 +00:00
tsutsui
f519863871 Split softc/device_t, with misc related changes. 2008-05-09 10:59:55 +00:00
tsutsui
1a8652c79c - reorganize com console code
- remove unused functions
2008-04-29 15:24:50 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui
02cb47cab2 Split softc and device_t for zsc(4) and its children.
XXX we should restructure MI APIs and make it really machine independent.
2008-03-29 19:15:34 +00:00
tsutsui
4090172b20 Don't forget to initialize sc_dev. 2008-03-29 05:42:45 +00:00
tsutsui
048fb884fc Split device_t and softc for MI mc146818 clock,
and other related misc cosmetics.
2008-03-28 19:05:49 +00:00
tsutsui
dde8b66a5c Add zsc(4) and zstty(4) for Qube 2700. 2008-03-27 15:24:35 +00:00
tsutsui
fc21b00873 Add kernel support for optional Z85C30 serial console on Cobalt Qube 2700.
There is some interrupt related issue (in MI z8530tty driver?) on heavy load,
but useful enough for debugging.
2008-03-27 15:21:46 +00:00
tsutsui
4f64b6719d Use macro defined in <machine/cpu.h> for cobalt_id and device addresses etc.
since <machine/leds.h> has been removed.
Also remove redundant address definitions in Makefile and local headers.
Pointed out by dieter roelants.
2008-03-23 17:19:57 +00:00
tsutsui
18573edb9c Use C99 initializer. 2008-03-22 18:46:49 +00:00
tsutsui
38e83cc130 Reorganize interrupt handling on cobalt and allow multiple interrupts on
each icu irq to support multi function PCI devices in the Qube's PCI slot:

- split out interrupt stuff from machdep.c into new interrupt.c
- prepare struct *_intrhead to handle cpu and icu interrupts
- use LIST and malloc(9) to handle multiple interrupts per icu irq
  (mostly taken from algor/pci/pcib.c and evbmips/malta/pci/pcib.c)
- move evcnt(9) stuff into *_intrhead from cobalt_intrhand
  (i.e. make it per interrupt rather than per handler)
- in pci_intr_map(9) handle CPU interrupt separately and add a sanity check
- fixup interrupt lines for devices on the PCI slot in pci_conf_interrupt(9)
- move some device address definitions into <machine/cpu.h> and
  remove <machine/leds.h>
- misc cosmetics

No objection on port-cobalt for three weeks.
2008-03-22 18:32:20 +00:00
tsutsui
f9697db4a0 Fix botched spl(9) bug I introduced back in 3.99.18 (rev 1.64):
Don't enable unhandled interrupts before all interrupts are processed.

Should fix "long download, network frozen" problems reported on
port-cobalt by several people.
2008-03-18 15:02:12 +00:00
tsutsui
49576266b9 Add support for optional Z85C30 serial console on Cobalt Qube 2700.
Bump version.
2008-03-16 10:10:43 +00:00
tsutsui
c828b4e601 Add more wait after sending a setup packet since
21041 on Qube 2700 seems to require more setup time.
2008-03-16 09:38:17 +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
tsutsui
50698ab6af Print "NetBSD/cobalt Starting up... " to LCD panel on boot, and also
print "NetBSD/cobalt Shutting donw..." on halt via shutdown hook.
This would be useful for users who don't have serial console.

No objection on port-cobalt.
2008-03-04 14:40:16 +00:00
tsutsui
a9ae1f2955 Use xlat_mbr_fstype() so that we can mount FAT removable media properly. 2008-03-03 15:22:01 +00:00
tsutsui
590ed564a8 WARNSfy 2008-03-02 06:17:41 +00:00
tsutsui
069af26195 Misc fixes to support 21041 on Qube2700:
- prepare two TX descriptors to avoid race and also use chaind mode
- use a recently added pcicfgread() function to get tulip I/O address
- use cobalt model id to see if we have 21041 or 21143
  (XXX maybe it's better to see PCI product ID)
- add code to reset SIA on 21041
- prepare and send filter setup packet on init
- reduce delay in RX polling
- bump version again

Now netboot works fine on Qube 2700 (even without console). Yay.
2008-03-01 20:39:25 +00:00
tsutsui
7c2a00cd44 Rename some variables to sync with original sandpoint's one. 2008-03-01 20:24:25 +00:00
tsutsui
8b1c40bc08 Split out a PCI configuration space read function into a separate file
so that we could use it in other sources.
2008-03-01 18:13:02 +00:00
tsutsui
c85e5be217 - print cobalt model names in boot banner
- bump version.
2008-03-01 17:45:11 +00:00
rmind
c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
tsutsui
ec4fe570ec Enable bpfilter, which is required by dhclient(8). 2008-03-01 05:40:38 +00:00
tsutsui
cb6802dea9 Comment out some PCIIDE devices which wouldn't be available for a PCI slot. 2008-03-01 05:37:33 +00:00
tsutsui
b2335fbf0b Enable puc at pci and com at puc, which might be useful Qube2700. 2008-03-01 05:28:28 +00:00
tsutsui
06c8e3f473 cnscan() should return -1 (no input) if there is no console device.
Now wd boot works on Qube2700 (which doesn't have serial console).
2008-03-01 05:15:31 +00:00
tsutsui
c98271f989 Add options COMPAT_40. 2008-02-28 17:01:51 +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
tsutsui
1d1faf7fbf Done sysinst. 2008-02-02 15:28:07 +00:00
tsutsui
f9ba3a6676 Add RAMDISK config, which has GENERIC + mdroot stuff. 2008-02-02 09:19:44 +00:00
tsutsui
636d4f1ae2 Account bi_size properly. 2008-01-31 17:38:56 +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
tsutsui
db09bcc34f Move todr_attach(9) calls from each MD attachment to MI mc146818_attach(). 2008-01-10 15:17:39 +00:00
wiz
35023be713 Fix typo in macro name and comments. 2008-01-09 20:38:34 +00:00
ad
87a9501131 Fix includes. 2008-01-04 22:54:46 +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
9e4e6d48cb In icu_intr_establish(), don't panic if the specified irq
is already in use and just return NULL instead.

Such situation could happen with devices which have
unconfigured PCI interrupt pins (because firmware
doesn't configure multiple function devices) and
each driver could handle the return value properly.
2007-12-22 14:42:21 +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
71921eec1b Use __arraycount(). 2007-12-02 05:36:46 +00:00
tsutsui
59777a7842 Add ext2fs support. 2007-12-01 18:13:16 +00:00
tsutsui
a65243be7c Include both ffsv1 and ffsv2 supports. 2007-12-01 17:05:11 +00:00
tsutsui
b069af69e5 Remove complete items and a non cobalt specific one. 2007-11-18 07:14:57 +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
tsutsui
a0220d0607 - use chaned mode for RX descs and allocate only one desc per each cacheline
to avoid possible race condition between CPU writeback vs DMA write
- remove unnecessary FS and LS bits from RxD->xd0
  (sys/dev/ic/tulipvar.h sets them but maybe they are ignored?)
2007-10-31 13:30:46 +00:00
tsutsui
4501e92c93 Fix my stupid bug in cache flush code and remove one kludge for it. 2007-10-30 16:38:54 +00:00
tsutsui
33b1553ffb Add support for netboot via tlp0 with standalone tlp(4) driver
taken from arch/sandpoint/stand/netboot.
There are still some kludge but it just works on RaQ and RaQ2.
2007-10-30 15:07:07 +00:00
tsutsui
7eee2a15d6 Use PCI bus/dev/function numbers rather than device unit
to check first tlp in device_register().
2007-10-27 17:23:37 +00:00
tsutsui
3d88d4ee08 Assume netboot if "nfsroot=/path" is specified in bootstring. 2007-10-27 15:12:09 +00:00
tsutsui
683d044ea4 In device_register(), check booted devices more properly:
- check "tlp" name on netboot
- use ata channel and drive numbers to check wd unit
2007-10-27 14:47:04 +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
tsutsui
6c44f1b32b Parse "root=/dev/hdXN" args passed from the firmware and
set default boot device accordingly.
Requested and okay'ed by cyber@.
2007-08-13 02:09:01 +00:00
tsutsui
26ba3dff65 More style nits. 2007-08-10 17:44:18 +00:00
tsutsui
2c1e4e89f3 Some style nits. 2007-08-10 16:59:41 +00:00
tsutsui
69819deda6 Lookup boothowto flags in bootinfo. 2007-08-10 16:48:24 +00:00
tsutsui
17c3dbc6c5 Parse boot_flags specified on boot prompt and
pass decoded boothowto value to kernel via bootinfo.
2007-08-10 16:47:06 +00:00
tsutsui
51b5e07bf9 Misc KNF and cosmetics. 2007-08-03 13:15:56 +00:00
tsutsui
e4daee28e3 Add support for booting off raidframe RAID1 mirrors.
Should close PR port-cobalt/36639, but with a different way
(which is similar with pmax) from a patch in the PR.
2007-08-03 12:57:38 +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
tsutsui
49773e5f60 Flush all cache data at the beginning of the bootloader.
Fixes silent hangs after loading 4.0_BETA2 GENERIC kernel
on Qube2 (and RaQ2) with 256MB RAM, reported and tested
by James Hartley on port-cobalt.

Obviously this should be pulled up to netbsd-4.
2007-07-25 14:11:06 +00:00
ad
63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +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
b3b62c0dff Don't clear BSS even if ksyms(4) is not configured. 2007-07-03 10:31:57 +00:00
tsutsui
73b3a64df4 Move declaretions of _spl*() and _{clr,set}softintr() functions
(which are in mips/locore.S) into <mips/locore.h>
from various MD files.
2007-06-17 06:04:27 +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
2fc470a315 Reorder IPL_SOFTSERIAL and IPL_SOFTCLOCK properly. 2007-05-27 14:22:36 +00:00
tsutsui
cd02a491e7 - Don't clear BSS in mach_init() if a kernel is loaded
by our native bootloader.
- Restore lwp0.l_cpu (which is required for curcpu()) and
  cpu_info_store.ci_curlwp after clearing BSS in case
  a kernel is loaded by the firmware directly since these
  values are in BSS and initilized before mach_init() is called.
  (actually they are restored in mips_machdep.c:mips_vector_init()
   but we use curcpu() earlier than that point)

Fixes silent hang right after boot on cobalt.
2007-05-27 14:10:49 +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
macallan
cd8fb15721 include files.wsfb 2007-04-10 02:29:42 +00:00
tsutsui
40b782670f Use char * where pointer arithmetics are required. 2007-03-17 11:45:21 +00:00
he
15e52c3822 Cast to char* before doing pointer arithmetic. 2007-03-06 17:32:05 +00:00