Commit Graph

44076 Commits

Author SHA1 Message Date
dsl 1423b45db9 remove KERNFS it isn;t in any of the other install kernels, and mount_kernfs
isn't in the ramdisk images.
2006-11-18 16:52:57 +00:00
tsutsui 9cdb8836f5 Fix wrong prototype declarations of _spl*() functions.
Pointed out by Havard Eidnes.
XXX: should these decls be in <mips/intr.h> or <mips/locore.h>?

While here, remove "extern" keyword from function declarations.
2006-11-18 16:40:21 +00:00
tsutsui 655bb5e6f1 Remove options SOSEND_NO_LOAN. Now it's handled in mips/pmap.c. 2006-11-18 14:28:55 +00:00
tsutsui 7cb169d2dd Disable sosend_loan() in sys/kern/uipc_socket.c temporarily on CPUs
which have virtual address indexed cache and whose pmaps don't always
allow normal shared mappings even for read only pages.

In future, these pmaps should be rewritten to handle such read only
shared mappings properly like ARM pmap, but currently we just disable
sosend_loan() to avoid unnecessary uncached mappings and cache flushes
on MIPS3 CPUs, or map/unmap thrashing on SH4.

Discussed with thorpej a while ago.
2006-11-18 14:25:39 +00:00
tsutsui fbed9c84db COPTS should have -O2 otherwise we'll get no generic optimization.
XXX: I prefer CPUFLAGS, but there isn't any conclusion yet.
2006-11-17 22:18:22 +00:00
tsutsui 44e83481b7 Defer _spl0() or _splnone() calls (which enable hardware interrupts)
from cpu_configure(9) to cpu_initclocks(9) on mips ports which use
mips3_clockintr.c:mips3_clockintr() (i.e. CPU INT5 clock) to avoid
hardclock(9) before softclock interrupt is initialized in initclocks().
This should be harmless because initclocks() is a part of configure()
in these days and there is no MI function which expects hardware
interrupts between cpu_configure(9) and cpu_initclocks(9).

Disccussed on tech-kern and port-mips.
2006-11-17 21:01:03 +00:00
macallan aa4a0d1a02 add RADEONFB_MMAP_BARS 2006-11-17 17:01:47 +00:00
uwe 20e7821e8a Enforce correct userspace bounds in copy{in,out}str().
From Miod Vallat <miod@openbsd.org>.
2006-11-16 23:12:23 +00:00
uwe 4fb9f81ff9 Sync with sys/endian.h: s/const/__const__/ in __attribute__ 2006-11-16 23:01:16 +00:00
uwe bd3c9477fb Bring back __unused (sed cannot tell if it's in an argument list or not). 2006-11-16 22:55:25 +00:00
oster d4240170d8 xen_shm_errintvl is only used in the DEBUG case. Fixes build for non-DEBUG. 2006-11-16 22:38:18 +00:00
yamt 730ba489f6 xen_shm: make some variables static. 2006-11-16 05:43:47 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
drochner 1a7611ad20 since these stupid codenames are mentioned everywhere, do so for Core2
as well
2006-11-15 19:18:33 +00:00
jdolecek 7ab2ff0691 Model 15 is the 'Core 2', so let's use that instead of the default 2006-11-15 17:48:56 +00:00
uwe 13117244bf Recompile. Important fixes since the previous version (according to
my archive of commit mail):

Take DST into account when computing bi.timezone offset, so that
NetBSD gets correct time when booted in the summer.

Fix framebuffer address for Jornada 7xx machines, so that you can boot
with layouts other than "Japanese" (which happened to have the
framebuffer address in its entry).

Fix a bug where ksyms were not loaded correctly, which also caused the
kernel to not recognize detached miniroot.

Kludge required memory size calculations to compensate for partially
filled tagged pages, or kernel with certain segment sizes wouldn't
load.

[hpcarm have picked up some of these fixes in hpcboot v14 that was
compiled/committed in the meanwhile, for hpcarm only].
2006-11-14 23:20:18 +00:00
bouyer 70aa8a0541 vn_lock() the vnode we got from bdevvp(), otherwise if something else uses
this device in userland (e.g. qemu-dm when running a HVM guest), we'll reuse
the existing vnode and we'll panic in VOP_UNLOCK(). We don't have this issue
most of the time because when xbdback is the only user, we get a specfs
vnode for which locking operation are NOPs.

Thanks to Antti Kantee for spotting the missing vn_lock() in sources and
giving details about vnode locking.
2006-11-14 22:14:56 +00:00
drochner 58cf8a6614 as on i386, don't use ":=" assignments with .OBJDIR 2006-11-14 14:09:54 +00:00
drochner ff2890767a use "=" instead of ":=" where .OBJDIR is used because it might change
later in <bsd.obj.mk>, thanks to Alan Barrett for the hint
2006-11-14 14:03:12 +00:00
he 0b108ad573 Adapt to the wsmouse_input() change where we now require the 'w' axis. 2006-11-13 09:35:34 +00:00
dyoung fabb7d3379 Improve the tags target for i386:
Update the Atheros HAL directories.

	Don't compute tags for nonexistent assembly-language sources
	in sys/arch/i386/isa/.

	Don't echo the rm -f step.
2006-11-12 22:44:00 +00:00
plunky 57c0199dcf Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
2006-11-12 19:00:42 +00:00
jmmv d4e479987d Regen. Per bernd@'s instructions. 2006-11-12 09:14:32 +00:00
he cb4c2207ba Add a netbsd-sd0 kernel, so that the corresponding gzimg can be built. 2006-11-11 23:50:54 +00:00
jld bd403112d6 Under Xen2, timestamp updates should happen every 10ms, and a timer
event should be raised every 10ms if we're runnable.  Unfortunately,
there seems to be an intermittent bug in the hypervisor such that,
for about 1<<32 ns (~4.3s) after it manifests, every running domain
continues to run but not get its timer events and new timestamps (nor
is it preempted in favor of other domains on that CPU).  This can cause
strange behavior from our timekeeping; for example, hardclock() is never
called during this interval.

So here's a workaround: if timestamp is allegedly up to date but is more
than 40ms old (this is semi-arbitrary), the domain sets its timer to a
time in the past, which causes it to become immediately pending, and also
results in the publication of a new timestamp.
2006-11-11 23:33:12 +00:00
bouyer a897b56088 Simplify XEN3 domU kernel config by including the XEN2 domU configs and
adding only XEN3 specific options/devices.
2006-11-11 20:00:39 +00:00
bouyer b8f3db3eea Follow GENERIC and enable TMPFS 2006-11-11 19:34:54 +00:00
jmmv fb3e66fdb3 Enable TMPFS by default. OK'ed by core@.
I'm leaving those platforms with few users and those whose machines are
not very powerful untouched per uwe@'s suggestion.  The port masters or
the real users of those ports are better suited to make the decision of
enabling it.
2006-11-11 19:00:16 +00:00
jmmv 7a13fe4abf Remove tmpfs's experimental status. OK'ed by core@. 2006-11-11 18:47:08 +00:00
bjh21 7acb866d02 All of the older COMPAT_?? options imply COMPAT_13, so there's no need to
check each one individually.
2006-11-11 16:58:04 +00:00
christos eeedf4b2c2 convert variable allocation to constant. 2006-11-10 18:15:12 +00:00
yamt 641f2cc444 xennet_checksum_fill: remove a debug printf. 2006-11-10 11:52:49 +00:00
tsutsui 36fcb0cbe4 Add rgephy at mii and rlphy at mii.
Tested on Ultra5 with RTL8139C (not plus) and RTL8169S.
2006-11-09 15:23:42 +00:00
tsutsui 2ae6e40c03 More cleanup of sparc64 clock stuff:
- split mkclock attachment from sparc64/clock.c into dev/mkclock.c
  (now clock.s only contains clock interrupt and timecounter stuff)
- rename match/attach functions of rtc at ebus to match the device name
- update some comments around clock devices in GENERIC

No objection on port-sparc64 for a month.
2006-11-09 15:08:04 +00:00
scw 814254d821 Add an install kernel for CP3100. 2006-11-09 00:28:37 +00:00
scw 5bfa580df1 Add support for the Certance CP-3100.
"The Certance CP3100 product family provides high-end disk-to-disk-to-tape
(D2D2T) functionality for small-to-medium businesses."

To software, the unit is very similar to the IQ80321 and IQ31244 eval
boards from Intel. As such, we share almost all of their code.

Onboard hardware:
 - IOP321 XScale CPU. Core clock is 600MHz.
 - 256MB SDRAM (not sure if that's true for all)
 - Four-port Intel i31244 SATA controller. One port is connected to the
   internal disk. The remaining three are available on the back-panel.
 - Dual GigE ports on the back panel, using an Intel i82546EB controller.
 - Two Symbios Logic 53c1010 SCSI controllers, one in host mode the other
   in target mode. Both SCSI busses are available on the back panel.
   Note that NetBSD does not support SCSI target mode.
 - 8MB of NOR Flash, containing a fairly vanilla Redboot together with
   a minimal compressed Linux image.
 - Some front-panel LEDS (not supported).
 - Serial console.

Contributed by Wasabi Systems, Inc.
2006-11-08 23:49:02 +00:00
scw d3089a454e If I80321_HPI_ENABLED is defined, add support for handling interrupts from
devices hooked up to the HPI pin.

HPIs cannot be masked at the interrupt controller; they can only be masked
by disabling IRQs in the XScale core. To deal with this, we tweak the
interrupt frame so that IRQs are disabled when the interrupt dispatcher
returns due to a masked HPI interrupt. IRQs will be re-enabled by a
subsequent splx(9).

Fortunately the only instance where HPI is used is for the console UART
on a couple of boards, so this hack does not adversely affect performance.

Contributed by Wasabi Systems.
2006-11-08 23:45:41 +00:00
rpaulo 4081961b95 Backout half of previous by popular demand. 2006-11-08 21:18:13 +00:00
rpaulo a70745bf73 Remove MATH_EMULATE.
Add DEBUG and LOCKDEBUG. This kernel config is suited for development.
2006-11-08 16:01:50 +00:00
macallan a6f7fc75a8 enable accelerated wsdisplay drivers 2006-11-08 05:48:43 +00:00
macallan 65d4544efe add control codes for virtual console switching
looks like I forgot to commit this ages ago...
2006-11-08 03:27:29 +00:00
macallan 4f70466a7c split ofb into one part that attaches right on kernel startup and one that
attaches to pci so we can build kernels with - say - machfb but without
ofb at pci.
2006-11-08 01:25:10 +00:00
mrg 72a7dfed29 fix another uninitialised variable picked up by the gcc -O3 optimiser. 2006-11-07 10:31:31 +00:00
macallan 0bb8ed626b allow IDE DMA on Heathrow again 2006-11-07 02:23:27 +00:00
jmmv c3429f8083 Pass a simple ELF header to ksyms_init_explicit with the minimum contents
required to initialize ksyms_hdr.  Otherwise LKMs do not work when using
ksyms_init_explicit instead of ksyms_init, as is the case of booting an
i386 kernel using Multiboot.
2006-11-06 13:35:35 +00:00
elad 66e42f0f77 XXX: use KAUTH_DEVICE_RAWIO_PASSTHRU for direct disk access here. 2006-11-05 23:00:54 +00:00
jld e973fa550e If the timestamp is/becomes stale when computing the current system_time,
obviously shadow_system_time will need to be reread as well.
2006-11-05 10:11:55 +00:00
yamt 0f0ac5fba9 vmapbuf: don't try to modify non-lvalue. 2006-11-05 08:04:55 +00:00
jld 9253e28032 Ensure that the timestamp we use in get_tsc_offset_ns remains valid
until after we do the rdtsc; since Xen3 dynamically adjusts its idea of
the clock frequency, this is important.  (Linux and FreeBSD both do this.)
2006-11-03 12:09:46 +00:00
jld f566d2017b "static volatile", not "volatile static". 2006-11-03 09:16:13 +00:00
tsutsui 57a0051fe5 - no need to scan zsc units in zshard(), just use passed one
- call zsc_intr_soft() directly on softintr and remove zssoft()
  (no need spltty() since it should be done in each MD handler)
2006-11-03 03:04:53 +00:00
jld 2d61afc3e7 Recycle old buffers into new rx requests when their number reaches half of
those not tied up in active mbufs, rather than half of the total number.

(Or, to more literally translate the C, when there are at least as
many buffers waiting to be reused as outstanding rx requests.)

This prevents us from dropping off the network for a while when more
than 128 of the 256 buffers are in use by mbufs, which might not be
freed for an arbitrarily long time; the remaining buffers would stack up
on the free list but not be reclaimed until enough mbufs were eventually
freed, leaving the interface unable to receive packets until then.
2006-11-03 03:03:32 +00:00
tsutsui 23c5e05646 Remove a function declaration of zssoft() which was
inside #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS.
2006-11-02 20:43:30 +00:00
tsutsui ce97c50f55 Pass zsc_softc to zshard() directly rather than searching it in zshard().
Checking all zsc units in zshard() is efficient only on ports
which share one interrupt among all zsc units, like sparc or sun3.
On such ports, zshard() is established as a handler only once.

XXX1: more other MD zs drivers should be fixed similarly.
XXX2: zsc on macppc has independent interrupts for channel A and B,
      but MI z8530sc can't handle such configuration.
2006-11-02 20:05:04 +00:00
tsutsui 5e4ac42c65 macppc always defines __HAVE_GENERIC_SOFT_INTERRUPTS,
so remove #ifdef/#ifndefs against it.
2006-11-02 19:41:34 +00:00
martin 0a67366540 Make the syscall "code" variable unsigned - we don't test for negative
values when range checking.
2006-11-01 22:37:35 +00:00
tls bd4d319d4b Change GENERIC, GENERIC.MP, GENERIC.MPACPI, GENERIC_LAPTOP, INSTALL,
INSTALL.MP, INSTALL_LAPTOP, and DISKLESS kernels so that they are
smaller and faster by removing support for actual i386 CPUs (which
lack write protection in supervisor mode, which requires a costly
workaround) and math coprocessor emulation.  Coprocessor emulation
is retained in the LAPTOP kernels, but not in the others.  Where
it is known that a configuration cannot be run with particular CPUs
(i486 in *MP kernels) remove that support as well.  Compile all
kernels with appropriate architecture and tuning flags (reduces
size, makes things faster).  Those requiring support for machines
with i386 CPU or lacking coprocessor can use the *SMALL or *TINY
kernels.
2006-11-01 19:33:41 +00:00
xtraeme fae505266c Use __arraycount from <sys/cdefs.h>. 2006-11-01 08:49:50 +00:00
joerg fc0bc19fc7 Add rum(4) for newer USB Ralink devices. Obtained from OpenBSD.
Special thanks to Sepherosa Ziehau for helping debugging USB issues.
Hook up rum(4) for i386 config files.
2006-10-31 22:21:16 +00:00
thorpej f347528e49 In the pcn driver:
- Remove the PCN_NO_PROM option.  Instead, query the am79c970-no-eeprom
  property, and read the MAC address from the CSRs if that property is TRUE.

In the ibmnws port:
- Implement device_register().
- In device_register(), set the am79c970-no-eeprom property for the
  built-in Ethernet.
2006-10-31 14:04:29 +00:00
perry 0623ef4ad5 one more time. sigh. 2006-10-31 00:23:20 +00:00
perry 8d9a6af4cd reddo the last space/tab fix *correctly* 2006-10-31 00:20:29 +00:00
perry a3ed824965 another space tab fix 2006-10-31 00:18:12 +00:00
hauke 9d2e5c6d9c The {GENERIC,INSTALL}SBC kernel configurations are out of sync with
the vanilla ones. They are supposed to be identical to
{GENERIC,INSTALL}, apart from the different ncr5380 driver.
Instead of re-sync'ing, use a new feature of configure and just disable
the ncrscsi driver.

(Approved by Allen Briggs)
2006-10-30 19:40:47 +00:00
garbled 54ded9290c Make these files compile with -Wextra -Wno-unused 2006-10-30 17:54:29 +00:00
garbled 9d0e6979a5 Make these files compile with -Wextra -Wno-unused. 2006-10-30 17:52:12 +00:00
skrll e231c02e1c KASSERT that the pmap_extract works in _bus_dmamap_load_buffer 2006-10-30 16:22:42 +00:00
skrll 140ca90ce5 pmap_kenter_pa the kernel and it's data structures including the kernel
stack.

Fixes the "booting from disk memory corruption bug" which was a result
of pmap_extract silently failing against a scsipi_xfer data area allocat-
ed on kernel stack in _bus_dmamap_load_buffer
2006-10-30 16:04:10 +00:00
perry 671b3fbc73 note about UFS_DIRHASH from i386, and a couple of space tab fixes 2006-10-30 12:34:22 +00:00
skrll 4663c12d85 Add some debug code. 2006-10-30 08:41:27 +00:00
skrll c6dcde599c Whitespace fixes. 2006-10-30 08:39:04 +00:00
skrll 92df06c2d1 G/C pages_per_vm_page 2006-10-30 08:30:01 +00:00
elad eddfaaf54c Move i386/amd64 common code (check_pa_acc()) to x86.
I didn't know what header to put the prototype in, so it's both in
i386/mem.c and amd64/mem.c; probably can be moved later.

Tested on amd64, assumed working on i386. :)

yamt@ okay
2006-10-30 00:41:26 +00:00
christos 0e5129986f fix print formatting. 2006-10-29 19:05:36 +00:00
christos 7379f78872 handle NPX_CPUID 2006-10-29 18:00:10 +00:00
christos 1fb46e1531 handle NPX_CPUID. reported by Takahiro Kambe 2006-10-29 16:11:54 +00:00
he 19b3e362f5 Work around the propagation of volatile-ness from struct to struct members.
OK'ed by nsmrtks.
2006-10-29 16:05:15 +00:00
minskim ff7273278a Correct spelling. 2006-10-29 09:34:35 +00:00
dogcow f7bd540aee cargo-cult copy changes from npx_isa.c so that GENERIC.MPACPI builds again.
(hi, christos!)
2006-10-29 09:24:47 +00:00
uwe ba0408a7f5 Lift extern shb_cd declaration to the top level.
Make all routines static.
2006-10-29 02:10:12 +00:00
christos 238d204377 Make npx work on the AMD Geode LX-800 processor by short-circuiting
the npx detection code. Since exception reporting is broken,  check the
CPUID_FPU feature. This is what FreeBSD does.
2006-10-28 21:24:45 +00:00
bjh21 1aeaeb0efa When setting the FIFO preload, chose an entirely safe value rather than
using a completely bogus heuristic to guess at one.  This might cause FIFO
underruns in particularly exciting video modes, but it also makes more
boring ones work correctly.
2006-10-28 17:39:59 +00:00
garbled 3dc1c33272 Add the crypto swcrypto and veriexec psuedo devices. Also add FILEASSOC
and VERIEXEC, following elad's lead.
2006-10-27 20:37:17 +00:00
garbled e5bff3e418 A few changes so pnpbus devices can do isadma. Note that isadma still
does not seem to work properly on prep.
2006-10-27 19:52:51 +00:00
garbled 8685914d8f Change an instance of curaddr to PHYS_TO_BUS_MEM(t, curaddr) in
_bus_dmamap_load_buffer, otherwise when attempting to DMA a buffer larger
than PAGE_SIZE on an arch where PHYS != BUS it will allways fail.
2006-10-27 19:36:15 +00:00
perry 360359b671 fix a bit of trailing whitespace, and do the space tab dance for a
couple of options so that they work well when commented out
2006-10-27 17:37:44 +00:00
uwe 523122cd3e Nuke GPROF cargo-cult I've been cut-n-pasting around in my drivers. 2006-10-27 00:08:32 +00:00
uwe 2909b42808 Fix __mcount to use bsrf to call _mcount. We know it's in the same
module (in the same file even), so we know the offset at link time and
don't need a reloc.  This kills the last text relocation in the sh3
libc.so.

While here, tweak the code slightly to put delay slots into use.
2006-10-26 23:54:28 +00:00
simonb c7f58e7f3e Make mcount static.
Same problem as described in port-alpha/10582 by ITOH Yasufumi.
pc532 problem pointed out by Valeriy Ushakov.
2006-10-26 23:53:27 +00:00
bjh21 ed5db5831e boot_file is not used by generic NetBSD/arm code, and its type varies by
MACHINE.  Thus, move it out of <arm/bootconfig.h> and put it into
<machine/bootconfig.h> on those MACHINEs (cats, hpcarm, and shark) where
it's used outside the file in which it's defined.
2006-10-26 23:31:47 +00:00
bjh21 3191d2a481 Change the type of initarm() on OFW-based ARM systems to match other non-hpcarm
ports.  This seems sensible since all of them call it from the same locore.S.
This makes NetBSD/shark GENERIC compile.
2006-10-26 22:49:36 +00:00
bjh21 b09fd5bdb5 No need for two __KERNEL_RCSIDs. 2006-10-26 22:42:00 +00:00
elad d70e6d1b25 Compile in Veriexec by default on some popular archs (amd64, i386, sparc64)
so it's more accessible and less of a hassle to put to use. Also enable
fileassoc(9) by default as a result, which for itself may open the door for
a lot of cool stuff. (stay tuned. :)

I recommend port masters of other archs to consider doing the same.
Personally I don't know which ports are considered more of a legacy than
in-production, so I'm leaving it for someone else for now...

No objections on tech-kern.
2006-10-26 11:48:38 +00:00
macallan 4c4d8037a9 Take into accout that SCSI controllers may attach to other things than
pci or sbus, like esp at dma.
So now my U1 can find its boot device again.
2006-10-26 00:19:44 +00:00
he af0b64f490 Bump SYMTAB_SPACE so that it fits again. 2006-10-25 20:46:48 +00:00
he b773aa1b24 Bump SYMTAB_SPACE so that it fits again.
Hm, this port doesn't error out the build if it doesn't...
2006-10-25 20:44:57 +00:00
jmmv 3ecc718811 Mark MULTIBOOT_SYMTAB_SPACE obsolete instead of silently removing it.
Per cube@'s suggestion.
2006-10-25 15:52:28 +00:00
jmmv 8d30a46449 Remove the usage of Multiboot's "a.out kludge" to tell the boot loader to
reserve some more space for the BSS section than the binary says.  This
trick was used to leave room after the kernel's image to copy the symbol
table following the format required by ksyms_init.  (It was also used to
workaround a bug in the physical address fields of the binary, but this has
been long fixed.)  Yes, the MULTIBOOT_SYMTAB_SPACE option goes away; yay!

Instead, copy the required data after the kernel in a way that avoids having
to reserve space and use the new ksyms_init_explicit function to avoid the
need to construct a minimal ELF image.

Fixes ksyms when using an "unpatched" GRUB (one that does not contain the
fix to honour the "a.out kludge" for ELF images, even when present) -- i.e.
ddb and lkms.  As a side effect, the new code is much clearer to read and
digest.

Closes PR port-i386/32865.
2006-10-25 13:56:15 +00:00
mrg 66365a4f3c - note that __idle_u should go away but doing so breaks things
- fix several comments to reality
- clean up the #ifdef NO_VCACHE code slightly
- use call instead of set/jmpl
- remove a couple of unnecessary stores to curlwp
2006-10-25 11:56:56 +00:00
elad eae258eadf Use kauth(9) (device scope tty open). 2006-10-25 11:30:45 +00:00
skrll 2ec9405f64 Fix the code to deal with new gcc propagating const-ness from structs to
members. All fixups of the mcontext are done in the trapframe.
2006-10-25 11:06:02 +00:00
skrll da3d10d5b0 Whitespace fixes. 2006-10-25 07:07:48 +00:00
he 87a71ab54f Propagate const, prompted by new gcc. 2006-10-25 07:04:13 +00:00
christos 12be2d1032 remove a bit of code and a label and explain why in a comment; no code size
change.
2006-10-24 23:41:01 +00:00
martin f559eee297 In the INTSTACK and KSTACK_VA special case treatment in pmap_exctract,
do not add the offset to the result - the calculated PA is the right
value - not the start of the page as in the other cases.
This fixes DMA to kernel stack, and avoids "fabricating a geometry"
warnings.
2006-10-24 21:11:58 +00:00
bjh21 695ea57fe2 parse_mi_bootargs() is declared in <arm/arm32/machdep.h>, so there's no need
to declare it here too.
2006-10-24 21:09:03 +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 b4dff5b189 ANSIfy, KNF, remove unnecessary includes. 2006-10-24 20:25:52 +00:00
he 9ed827d944 The new gcc propagates const-ness from structs to members, so
make local variable const as well.  Avoid writing to the now-const
variable, instead do the masking before in the trapframe register
assignment.

OK'ed by thorpej and nathanw.
2006-10-24 16:53:01 +00:00
oster 7f33898207 Fix a logic bug in the bootblock code.
OK'ed by christos@
2006-10-24 15:56:55 +00:00
mrg 4b539e3eec move a label such that it is only visible in the scopes it is used in. 2006-10-24 02:47:40 +00:00
uwe 07dcd59f52 __pmap_kpte_lookup: verify that ptp is not NULL. 2006-10-24 01:56:33 +00:00
skrll e90404b342 - mbus_dmamap_create: remove a redundant local.
- mbus_dmamap_sync: restructure/simplify code and add our our version of
  sync_caches that does sync; syncdma; sync. This is now smaller as a
  result.
2006-10-23 21:58:52 +00:00
christos d0545a9b43 nuke $DBG, since it contains -O2; suggested by uwe. 2006-10-23 21:57:46 +00:00
christos 3380fe7daf shrink further. 2006-10-23 21:36:47 +00:00
uwe d8092bae40 Kill get_ascii and its alternative format, it's not very useful. We'd
better use it for something else later.  I'm also thinking of g/c'ing
the temp buffer and emit disassembly with db_printf direcly, and
get_ascii gets in the way.
2006-10-23 21:13:00 +00:00
peter 4c87aba921 Enable MI todr(9) and timecounter on hpcarm. 2006-10-23 21:12:42 +00:00
he 8a7e351ffd Constify, since the new gcc propagates constness to struct members. 2006-10-23 19:49:47 +00:00
uwe 9287c88e77 Const-poision. While here, rename the argument s/code/pc/. 2006-10-23 19:28:07 +00:00
he 8d51656fd4 Const-ness is now (by the new gcc) propagated from structs to
members, so constify so as to not lose qualification.
2006-10-23 18:58:24 +00:00
uwe 351eae3599 Be careful when fetching instruction to disassemble. Check for
unalinged address, refuse to disassemble P4 area (on-chip i/o regs),
use fusword/kcopy to fetch the instruction.
2006-10-23 18:33:56 +00:00
gson 3b3814b873 const correctness 2006-10-23 18:10:44 +00:00
uwe a34468ef57 fu* function should read bytes/shorts as unsigned, so s/exts/extu/ 2006-10-23 16:28:51 +00:00
yamt 3342bd892a cpu_dumpconf: oops, redo the previous correctly. 2006-10-23 15:15:52 +00:00
yamt 7eadca1ca8 fix parenthesis mismatch in 1.197. (hi mrg) 2006-10-23 15:08:20 +00:00
skrll 21f8bf16fc KNF and comment update. 2006-10-23 14:15:09 +00:00
pooka 9739aee84d apply const where necessary 2006-10-23 12:11:47 +00:00
kiyohara 6920dbe4f2 Define BASE_ISA macro for ISA window base address (where pckbc, com, lpt live)
instead of hardcoding the constant or (even before) using BASE_COM.
2006-10-23 06:49:17 +00:00
christos 896545c86a shave 32 bytes. 2006-10-22 21:57:55 +00:00
jmmv f584c9cef6 Forgot to remove non-applicable *VERBOSE options. 2006-10-22 21:08:48 +00:00
jmmv 2bce77b498 Kernel configuration file for the QEMU virtual machine. This is based on
GENERIC and keeps all MI stuff untouched but removes all MD devices that
are not supported by QEMU.  Inspired by the recently added PARALLELS file.
2006-10-22 18:49:24 +00:00
bouyer 146b18fc4b Don't add ikphy twice; pointed out by Patrick Welche 2006-10-22 16:26:27 +00:00
peter 8f247a77de add const 2006-10-22 15:31:26 +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
pooka 362b187ff0 constify in cpu_setmcontext() 2006-10-22 13:59:14 +00:00
pooka c0402602d9 constipate 2006-10-22 13:29:13 +00:00
scw 321742a838 Stick with unsigned long for _BSD_SIZE_T_ regardless of LP64/ILP32. 2006-10-22 11:20:44 +00:00
mrg 592435f965 don't drop const in cpu_setmcontext32(). 2006-10-22 10:50:44 +00:00
yamt 6a98028817 use vmem for xen_shm. 2006-10-22 09:44:55 +00:00
uwe f8b92ef629 Instead of referring *code repeatedly, fetch it once into a local variable.
Identical object code for f_* is produced with -O.
2006-10-22 03:58:36 +00:00
uwe d62bc05de1 Whitespace cosmetics in declarations of local variables. 2006-10-22 03:50:10 +00:00
uwe e10806aaa8 Rename get_opcode argument for consistency. 2006-10-22 03:37:04 +00:00
uwe 6ac2d0e699 Revert previous that apparently has been committed by mistake.
It actually contained just some debugging printfs, and *wrong*
debugging printfs at that (hi, jared :)
2006-10-22 00:33:14 +00:00
mrg 1b262f1cb0 correct a debug statement. 2006-10-22 00:24:23 +00:00
mrg 9631418f8f remove "struct cacheline" and the "cacheline" variable. (it was only set
in cpu_attach(), overwritten by multiple cpus, and only one member of the
12 or more were ever used again.)  add an ecache_min_line_size to replace
this functionality.

clean up some non-SMP friendly code from cpu_attach():
	- only reset the fpu state on the boot cpu
	- don't bother printing "FPU version 0" always
	- don't call getver() and ignore the result
	- print the UPA id on the first cpu0: line

only print mp_tramp address #ifdef DEBUG.

reset the fpu state in cpu_hatch(), like cpu_attach() does for the boot cpu.


cpu_attach() is now free of SMP-unfriendly code.
2006-10-21 23:49:29 +00:00
bjh21 f62548abf5 Interpret the argument to iomdkbc_set_poll() correctly. Quite how we
got this far with it the wrong way around is beyond me.
2006-10-21 22:45:03 +00:00
bjh21 983692f3d5 Program the IOMD flyback size register correctly, or at least the same way
we did before we started using struct videomode.  This seems to unbreak
systems with VRAM at least a little.
2006-10-21 17:08:22 +00:00
bjh21 d726ea385c Remove cruft left over from when this code was copied from some TURBOchannel
framebuffer or other.
2006-10-21 14:24:46 +00:00
bouyer 154d613f0b Add support for the Intel 80003 Gigabit Ethernet controller (found e.g. in
newer server chipsets) to wm(4), from the FreeBSD em(4) driver.
While there, add a few other Intel Ethernet controller that should work as
is.
Properly update the RX error and TX collision counters.
Add ikphy(4), a driver for the Intel i82563 Kumeran 10/100/1000 Ethernet PHYs
2006-10-21 14:10:32 +00:00
skrll c837287aab s/out/bad/ in cpu_dumpconf so this compiles. 2006-10-21 08:11:49 +00:00
mrg 065b4dbdca fix errors in the previous changes. 2006-10-21 08:09:58 +00:00
skrll 3d92eb6b84 De-__P() 2006-10-21 07:24:20 +00:00
skrll b560533af2 Pass the cookie (not the function address) to bus_space_alloc.
From OpenBSD.
2006-10-21 07:22:48 +00:00
mrg 648bbec934 in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev.  this occurs when we try to set the dumpdev to a device
with no driver loaded.  this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf().  (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
2006-10-21 05:54:31 +00:00
mrg 877957f469 add a "mach sir" command to call sir instruction ('software initiated
reset').  this is a much more drastic way to do "mach prom", but it
works when used from cpu>0, which "mach prom" currently does not.
2006-10-21 03:16:05 +00:00
mrg e54ce8ca38 avoid yet another GCC uninitialised warning at -O3. 2006-10-20 22:12:57 +00:00
martin d55cb18cdc A few -Wextra nits 2006-10-20 18:26:26 +00:00
tsutsui 7245fafc22 Add re at pci and rgephy at mii. 2006-10-20 15:48:37 +00:00
gdamore e8ac1cad77 This commit provides substantial fixes and functionality for SPI flash.
Specifically, the SPI flash now operates as a nearly fully functional block
device (other than lacking disklabel support).  It does some basic translation
stuff, so that if you attempt to write a block, the underlying flash sectors
(usually 64k in size) will be read, erased and rewritten.

To minize thrashing, the spiflash strategy routine attempts to gather writes
to the same sector together, so that in the typical case you will not have to
repeatedly erase/rewrite the sector.  It also attempts to check and verify
whether an erase cycle is truly needed.  There are still access patterns that
will cause multiple erases to occur, and so I heartily discourage the use
of these flash devices for storing anything other than small configuration
data, or write-once images.  If you want to do more than that, then someone
should try to write a real flash translation layer.

The drivers attempt to provide some level of asynchronous operation, so that
while you are erasing or writing to the flash, other things can reasonably
take place.

Note that spiflash does not do bad block remapping.  It also doesn't detect
when a device is in read-only mode, or if some sectors are read-only.  It
only supports uniform sectored NOR flash.  It lacks any code to deal with
disklabels, and does not offer any disk related ioctls.

These limitations aside, it would not be terribly hard, I think, to break
out the code I've done to create a generic "norflash" driver, backed by
a "common" spiflash module.  Then other flash drivers (e.g. athflash, etc.)
could benefit from the ability to use this as a block device.  I've tried
to architect it to support that, if someone else wants to do the work.
(Hi Jared!)

The primary reason that I've not added code to deal with disklabels is that
I had a difficult time figuring out which framework (disklabels or wedges)
to use, and which bits of code were necessary to implement.  In the case of
the flash devices I'm working with, a parser to deal with redboot FIS images
(partitions) would need to be added.  I was prepared to do this, but gave
up owing to the complete and total lack of any API or design documentation
pertaining to the requirements for disk drivers and disklabel management or
wedges.   I would strongly encourage someone who knows something about
wedges or disklabels to write a simple document (or even a dummy driver)
showing which interfaces should be provided in new mass storage drivers.

This work was funded by the Champaign-Urbana Community Wireless Network
Project.
2006-10-20 06:41:46 +00:00
martin 06f6d1ebf7 Sync (commented out) kgdb options with reality.
(Not that it works at all - the locore.s support is not done yet)
2006-10-19 22:01:18 +00:00
martin 6caa94ff4b kgdb support for sabtty 2006-10-19 21:52:12 +00:00
martin 860142f506 Remove unsued file 2006-10-19 21:44:51 +00:00
martin 8c154addc5 Remove obsolete (and partially accidently commited) kgdb parts 2006-10-19 21:09:46 +00:00
he e1fda29be8 Convert to using hexadecimal literals for the type limits.
Also, add a trailing 'U' to the unsigned limits.
2006-10-19 20:20:43 +00:00
drochner 06e33f371b remove relicts of COMPAT_AOUT, fixes compilation problems with old
kernel config files reported by Patrick Welche on current-users
2006-10-19 16:55:37 +00:00
tsutsui 881db3b0de Defer enabling hardware interrupts until all timecounter(9)s are initialized
in cpu_initclocks(9), and then remove "if (cold)" check in decr_intr().

Fixes long delay during config_process_deferred() for interrupt_config_queue,
OK'ed by macallan.
2006-10-19 14:25:29 +00:00
simonb e8ff7d18f3 Use "U" suffixes for largest unsigned type values.
Pointed out by Nick Hudson.
2006-10-19 12:05:26 +00:00
uwe a619033d94 SH_RCR2_BITS for bitmask_snprintf. 2006-10-19 03:26:10 +00:00
uwe 5e3c689570 Oops, don't stop rtc when enabling rtc oscillator - we would stall it
until rtc(4) attaches and starts the clock (that caused my Jornada to
lose about 12 secs during boot).
2006-10-19 00:25:18 +00:00
jklos 89009eb679 Fix for PR 33667. Note that putting bmac_mediachange where thorpej
suggested doesn't fix this issue. Not a perfect fix, but much better than
leaving it as it was. Tested on several iMacs and a blue & white G3.
2006-10-18 21:37:48 +00:00
martin ab081bc491 Ooops, array initialization for the page size map differs in DEBUG and
other kernels - hide details in a macro.
Pointed out by Matthias Scheler.
2006-10-18 15:28:39 +00:00
skrll 22acc290fb Fix symbol loading for the common(?) case - boot from disk. 2006-10-18 14:00:31 +00:00
martin 27bbd80a3d Initializers 2006-10-18 09:18:22 +00:00
uwe 95f76b747d Clean more files generated by eVC3. 2006-10-18 02:18:27 +00:00
rjs ddc28f5427 Clean up some comments. Cosmetic change to use correct structure
offset names.

Optimize out two instructions from sparc64_ipi_save_fpstate and
sparc64_ipi_drop_fpstate.
2006-10-18 01:41:38 +00:00
uwe 4a0ed35f45 The real libkern.h now uses "long long" that eVC has no clue about.
Instead of polluting libkern.h with ifdefs introduce our own private
copy.  Since AFAICT we only need it for libsa/ufs.c which only
includes it for the strlen() prototype, trim it to provide just that
for now.

We cannot just #include <string.h> (the WinCE one) here, as that pulls
in a lot of unrelated stuff, e.g. defines for limits that collide with
machine/limits.h
2006-10-18 01:39:01 +00:00
mrg d7ad3f5fab allocate 128KB (as opposed to 64KB) per-cpu, and place the interrupt
stack, cpu_info structure, panicstack, idle uarea and normal kernel
stack in here.  the idle uarea and kernel stack are in the 2nd 64KB
page.  the interrupt stack and cpu_info structure are as the same
place in the 1st 64KB page, and the panicstack grows down from the
top of this page.  update comments in param.h to suit (XXX: a lot
of these constants should move to a header file that will not pollute
the name space so much.)  map these pages identically between
cpu_initialise() and cpu_mp_startup(), and deal with the two 64KB
pages in pmap_extract().  keep an unmapped 64KB page between them.

don't initialise the unused "ci_eintstack" member of the cpu_info
structure

use constants to initialise many addresses in the cpu_info structure,
consolidating these assignments from cpu0 and cpu>0

delete u0/estack0/panicstack from locore.s

clean up some wrong comments in locore.s

fix a 32bit-only bug in cpu_mp_startup().

delete 'u0' entirely.


this fixes recent random lossage seen on port-sparc64: processes
stuck in RUN state, data faults, and hangs.
2006-10-17 22:26:05 +00:00
bouyer f3366866dc Change BSD_SYMTAB to BSD_SYMTAB=yes. Xen-3.0.2 wants it, and xen-3.0.3
doesn't care.
2006-10-17 22:16:20 +00:00
bouyer abd9ea51ce XEN_NO_HYPERCALLPAGE is redundant with XEN_COMPAT_030001; make
XEN_COMPAT_030001 disable the hypercall page too and remove
XEN_NO_HYPERCALLPAGE
2006-10-17 19:57:24 +00:00
bouyer 754514a443 Add ELF_PADDR_OFFSET and VIRT_ENTRY strings to __xen_guest ELF section,
so that our kernels works with newer xen-3 hypervisors; and correct the value
of VIRT_BASE for dom0.
Now that we can embed the values of KERNBASE and KERNTEXTOFF in the binary
for Xen, make the domU memory layout the same as dom0 for Xen3 (making
it the other way round doens't work; probably because of alignement
constraints in the hypervisor). The old domU layout is used if options
XEN_COMPAT_030001 is present in the kernel config file. Enable this the
domU kernel config files for now, in case someone wants to run a NetBSD
domU on an older Xen3 installation.
2006-10-17 18:53:03 +00:00
dogcow 372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
kiyohara 29ee4e3d02 Add $NetBSD$. 2006-10-17 17:06:22 +00:00
kiyohara ec59b85f32 Comment out slhci* at pcmcia, because testing now. 2006-10-17 16:57:55 +00:00
martin 05a4f3ccd9 Remove obsolet kgdb parts 2006-10-16 22:21:52 +00:00
martin 25af9d05c1 Remove obsolete kgdb prototypes. 2006-10-16 22:07:11 +00:00
martin 6b3bb75f5c Initializers 2006-10-16 21:57:10 +00:00
martin e4354c85e7 Initializers 2006-10-16 20:31:45 +00:00
martin 5c0b67304d Missing initializer 2006-10-16 20:27:40 +00:00
martin 7549c09e6a do not test unsigned values for < 0 2006-10-16 20:23:24 +00:00
martin 387e642293 Debugger() is only available if we compile with DDB 2006-10-16 20:21:46 +00:00
kiyohara e95a66da33 * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
2006-10-16 18:14:38 +00:00
kiyohara d7e6f0e206 * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
* ibm405gp UART0 used to be linear mapped. The VA happens to be inside kernel
  segment, giving us the possibility of multiple VA matches in the TLB. This
  is considered "programming error" by 405 core and results in "undefined
  behaviour". We now avoid mapping peripherals in kernel segment.
* Some boards used to map hardwired RAM size. We now use the real size as
  passed in by boot firmware.
2006-10-16 18:14:37 +00:00
kiyohara 471efec80f * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
* ibm405gp UART0 used to be linear mapped. The VA happens to be inside kernel
  segment, giving us the possibility of multiple VA matches in the TLB. This
  is considered "programming error" by 405 core and results in "undefined
  behaviour". We now avoid mapping peripherals in kernel segment.
* Some boards used to map hardwired RAM size. We now use the real size as
  passed in by boot firmware.
* TLB_NRESERVED is (finally) gone.
2006-10-16 18:14:36 +00:00
kiyohara c38c755c41 do bus_space_map() to get bus space handle in emacs_attach() 2006-10-16 18:14:35 +00:00
kiyohara cf2d4adfc0 * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
* ibm405gp UART0 used to be linear mapped. The VA happens to be inside kernel
  segment, giving us the possibility of multiple VA matches in the TLB. This
  is considered "programming error" by 405 core and results in "undefined
  behaviour". We now avoid mapping peripherals in kernel segment.
* Some boards used to map hardwired RAM size. We now use the real size as
  passed in by boot firmware.
* don't call consinit() in obs2{00,66}_machdep.c because consinit() is already
  called in ibm4xx_init() (but I'm not sure which place is good)
2006-10-16 18:14:34 +00:00
kiyohara 60e982e820 Add initial support for the PXA255-based gumstix board. 2006-10-16 16:40:14 +00:00
bouyer 593919aafc Don't rely on the /dev entry in the xenstore to get the handle; extract
it from the xenstore path. /dev will have whatever is in the guest's config
file disk entry, and this may not be a number (in the case of HVM guests
it's a string starting with 'ioemu').
2006-10-15 21:34:48 +00:00
macallan 84da46d4d5 ansify 2006-10-15 21:23:19 +00:00
macallan e57fef0a3e report button clicks when tapping a trackpad
Tested on a PB3400c and an iBook G4
2006-10-15 21:15:21 +00:00