Commit Graph

47645 Commits

Author SHA1 Message Date
ad
0cb8674c03 Make the trap stubs preemption safe. 2008-04-28 19:47:36 +00:00
ad
9c1818760e - Make some entry/exit points preemption safe.
- Try to avoid mispredicted bracnhes in Xsyscall.
- Interrupts were being enabled in Xsyscall _after_ checking for ASTs,
  while could have resulted in ugly behaviour like delayed signals or
  context switches. Fix it.
2008-04-28 19:35:56 +00:00
garbled
01fba5909d Add floppy support to prep (the croud goes wild)
Add an additional argument to pnpbus_intr_establish to allow overriding of
the pnp interrupt type, because some devices lie.
Change how the pnpbus match routine works, to avoid attaching it when we
are probing for cpu's.
Fix a few stray printf's in the autoconf output.
2008-04-28 19:01:45 +00:00
ad
50ca4969ff Noisy printf. 2008-04-28 18:49:40 +00:00
ad
25a2492fa0 Make kernel pagefault handling preeemption safe. 2008-04-28 18:32:12 +00:00
ad
6adfffcd49 - Make these preemption safe.
- Try to avoid mispredicted branches.
2008-04-28 18:31:15 +00:00
ad
53368c2808 Noisy printf. 2008-04-28 18:26:57 +00:00
ad
2d7dbb9788 +L_NOPREEMPT, L_DOPREEMPT 2008-04-28 18:20:51 +00:00
ad
d8fdbaf5b4 Make pagefaults in kernel mode preemption safe. 2008-04-28 18:17:40 +00:00
ad
67d2c7edc1 Make FPU handling preemption safe. 2008-04-28 18:15:39 +00:00
ad
64bcc9bd8b Make this preemption safe. 2008-04-28 18:13:58 +00:00
ad
3d504986e5 Stray kpreempt_disable with no matching kpreempt_enable. 2008-04-28 17:18:19 +00:00
ad
a52d138523 cpu_idle: assert ilevel == IPL_NONE. 2008-04-28 13:10:22 +00:00
ad
7c334139cd - mutex_spin_enter: avoid SPL NOT LOWERED... errors when running with
preemption. This could also fix similar errors seen with softints.
- Adjust code slightly to try and avoid mispredicted branches. The branch
  hint prefixes are apparently of little use.
2008-04-28 13:09:00 +00:00
ad
5be927ae20 Make preemption safe. 2008-04-27 22:43:08 +00:00
ad
c76bdbff23 Sprinkle more assertions / preemption paranoia. 2008-04-27 22:41:15 +00:00
ad
a93682b7c8 - Make some entry/exit points preemption safe.
- Avoid mispredicted branches in Xsyscall.
2008-04-27 22:40:09 +00:00
bouyer
0fef0ddf92 xengnt_more_entries(): fix memory leak, noticed by Jean-Yves Migeon 2008-04-27 19:28:45 +00:00
matt
825088eda6 Merge kernel changes in matt-armv6 to HEAD. 2008-04-27 18:58:43 +00:00
skd
8b7bbc0009 Fix pic locking to mirror simple_lock primitives. 2008-04-27 17:47:11 +00:00
tsutsui
02d0296505 Make compile with debug options. 2008-04-27 15:56:37 +00:00
tsutsui
bdc08026eb Fix a botch in rev 1.21. 2008-04-27 15:18:00 +00:00
tsutsui
285b0f56d9 Fix warnings #ifdef DEBUG case. 2008-04-27 14:44:25 +00:00
tsutsui
c070e2d90e - use mutex(9) for uvm_kernel_object
- fix warnings in #ifdef DEBUG
2008-04-27 14:44:04 +00:00
tsutsui
7fbd55774a Use mutex(9) for uvm_kernel_object. From Greg Oster. 2008-04-27 12:34:54 +00:00
ad
27168d9d58 - Rename crit_enter/crit_exit to kpreempt_disable/kpreempt_enable.
DragonflyBSD uses the crit names for something quite different.
- Add a kpreempt_disabled function for diagnostic assertions.
- Add inline versions of kpreempt_enable/kpreempt_disable for primitives.
- Make some more changes for preemption safety to the x86 pmap.
2008-04-27 11:37:48 +00:00
ad
e33af2987c +lcr2 2008-04-27 11:25:27 +00:00
tsutsui
377c9d4dfd Remove obsolete (commented out) options SHMMAXPGS. 2008-04-27 06:26:04 +00:00
tsutsui
03326f4ad8 Shrink ramdisk to 500k again.
The crunched binary with optimized libraries fits it.
2008-04-27 05:59:47 +00:00
isaki
b17ff44212 Make it compile without zstty. 2008-04-27 05:10:33 +00:00
tsutsui
05e60fd761 Remove local -fno-strict-aliasing hack.
sys/conf/Makefile.kern.inc has it for gcc4.
2008-04-27 03:23:13 +00:00
darcy
0669406131 Add a little more detail when verbosity is requested. 2008-04-26 15:13:00 +00:00
drochner
a4edd0fe73 try to update for OHCI device/softc split, untested
(I've asked for testing on Apr 3, w/o success.)
2008-04-26 14:57:44 +00:00
tsutsui
9188a0e30d Shrink install kernels a bit. 2008-04-26 03:08:59 +00:00
tsutsui
080dee1d75 Remove obsolete options SHMMAXPGS. 2008-04-26 02:43:07 +00:00
he
fffa7e0bcb Bump the ramdisk from 500k to 700k to compensate for bloat which
happened while the sun2 kernels were unbuildable.
2008-04-25 23:01:27 +00:00
christos
0527f291b9 minor restructuring. 2008-04-25 17:41:10 +00:00
christos
1a72a1c693 fix signature 2008-04-25 17:39:20 +00:00
ad
52b171cac6 fillw() is no longer used. 2008-04-25 16:34:25 +00:00
ad
1a1d0b7f30 Include null IPI functions if !MULTIPROCESSOR. 2008-04-25 13:26:27 +00:00
skrll
768818c328 Whitespace. 2008-04-25 12:41:50 +00:00
sborrill
e691c35842 Disable splashscreen during autoconf if any of the following is true:
- single user (-s)
- verbose (-v)
- debug messages (-x)
- ask for root (-a)
- userconf (-c)
2008-04-25 08:42:56 +00:00
mjf
24503783b3 device_t/soft_c split 2008-04-25 08:17:52 +00:00
alc
e0ec961f27 add a dummy argument to cpc700_get_irq() to match the function pointer's
prototype in `struct pic_ops'.

fix build of PMPPC

ok garbled@
2008-04-24 23:22:24 +00:00
ad
ba26c51443 Add 64-bit bus_space methods. 2008-04-24 21:01:40 +00:00
cegger
a9291fce0d keep up with x86/x86/cpu.c, rev. 1.33:
Gracefully handle a condition where apic id >= X86_MAXPROCS rather than panicing.
2008-04-24 20:44:02 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
hubertf
71c7af227e Fix RCS Id, pointed out by Slava Semushin in private mail 2008-04-24 17:33:34 +00:00
jmcneill
806f625216 Gracefully handle a condition where apic id >= X86_MAXPROCS rather than
panicing.
2008-04-24 15:59:57 +00:00
ad
6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
ad
30abe39468 - Retire SYCALL_MPSAFE. With the exceptions of darwin and irix emulations,
all system calls are now MPSAFE.
- Remove unneeded acquire/release of kernel_lock.
2008-04-24 11:51:18 +00:00
nonaka
262e51f19f fix typo. 2008-04-24 11:46:30 +00:00
he
157c460048 Need to include <powerpc/psl.h> and <powerpc/frame.h> here to get
PSL_EE and struct intrframe defined.  Fixes build problem for evbppc
EV64260 kernel.
2008-04-24 11:36:51 +00:00
ad
fff5f20c25 - Give ci_want_resched a single cache line, and align. This is for monitor/
mwait. At least one errata sheet from Intel notes that a single line
  should be used.
- Align cc_microtime.
2008-04-24 11:26:52 +00:00
he
f80749c192 This file needs <sys/signal.h> included, so that siginfo_t and
ucontext_t are properly defined before they're used.
2008-04-24 10:03:08 +00:00
he
c2d45b948a This file needs <machine/cpu.h> included, for the ALPHA_PSL_IPL_*
constants it uses.
2008-04-24 10:01:37 +00:00
skrll
0cef8c99e4 Split the DDB trace stuff into its own file. 2008-04-24 07:28:30 +00:00
he
1505dea7e8 Ensure that offsetof() is in scope by including <sys/systm.h>.
Fixes build problem found while building swapnetbsd.o for XEN3_DOM0.
2008-04-23 15:57:38 +00:00
ad
9fc1984c89 Unconditionally acquire kernel_lock for bitrotted darwin emulation. 2008-04-23 14:24:37 +00:00
tsutsui
3b31064c9a Split softc/device_t and misc cleanup for sn(4). 2008-04-23 13:29:44 +00:00
martin
3a3709e6c1 Include psl.h to provide the details of ipl_cookie_t 2008-04-23 13:14:11 +00:00
cegger
68519ac971 amdtemp(4): Driver for AMD CPU Temperature Sensors. Adopted from OpenBSD's kate(4).
Changes beyond OpenBSD's driver:
- Improved support for AMD K8
- Added support for AMD Barcelona, AMD Phenom and AMD Griffin
Tested on various single and multi-socket machines.
Review and OK xtreame
2008-04-22 22:37:12 +00:00
nakayama
913a6487e6 #include "opt_multiprocessor.h"
#include <machine/psl.h>

Make sparc64 kernel build again.
2008-04-22 17:09:25 +00:00
nakayama
7850df81b5 include "opt_multiprocessor.h" 2008-04-22 16:51:30 +00:00
cegger
73d529c226 Make this build again. From Hans Rosenfeld. 2008-04-22 14:02:04 +00:00
tls
822d920956 Commit a quick workaround for the not-power-of-two cache colors problem
pointed out by Simon (Simon's option #3): use the greatest power of two
which is a divisor of the desired number of cache colors.

This code might want to stay even after the cache probing code is fixed.
2008-04-22 02:23:05 +00:00
martin
51905d0a31 Be more precise when matching the boot device - with ata disks and
atapibus cdrom drives both using the same "target/lun" space, we could
confuse cdrom@0,0 for disk@0,0. Now match the complete string (we still
don't care how firmware calls a device, just rely on it being consistent).

Problem noticed by Jonathan A. Kollasch.
2008-04-21 21:00:23 +00:00
cegger
9427277807 add acpitz at acpi 2008-04-21 20:20:12 +00:00
tls
6a70e45954 Work around PR38480 by making it possible to omit options MTRR from
amd64 INSTALL kernels -- and doing so.  At least you can now get an
INSTALL kernel onto a box with this odd MTRR configuration to debug it.
2008-04-21 19:06:42 +00:00
cegger
20161b7289 Access Xen's vcpu info structure per-CPU.
Tested on i386 and amd64 (both dom0 and domU) by me.
Xen2 tested (both dom0 and domU) by bouyer.
OK bouyer
2008-04-21 15:15:33 +00:00
ad
a2249ef75c Make ntp, pmc, reboot, sysarch, time syscalls MPSAFE. 2008-04-21 12:56:30 +00:00
ad
45e89afb6f Unneeded kernel_lock frobbing. 2008-04-21 12:51:37 +00:00
tls
002d314a9b Don't use mtrr functions if not options MTRR. There are many more instances
of this bug, particularly in the COMPAT_FOO32 code.
2008-04-21 00:18:39 +00:00
rafal
e43f18015f Fix detection / attachment of CF / PCMCIA cards present at boot-time. This
was broken by one of the early vmlocking merges, which removed the kthread
that did the initial detection / attachment and instead called the code
directly from the PCMCIA controller attach method.

Submitted in PR port-hpcarm/37227 by Peter Postma; I've tweaked it ever-so-
slightly.
2008-04-20 16:47:52 +00:00
rafal
6583c572da Enlarge the number of L2PTs used for mapping the kernel since our kernels
have gotten fatter with age and even the stock kernels were bigger than the
code could handle.

Thanks to Jason Mitchell for sending me a Jornada 720 so I could actually
test this.
2008-04-20 16:19:46 +00:00
scw
3fd7f57e57 There's really no need to switch VM contexts within cpu_switchto() as
MI code always calls pmap_deactivate/pmap_activate on context switch.

Instead, just record the last active lwp (or NULL if it exited) and
defer switching VM context to pmap_activate(). This saves an additional
function call overhead in cpu_switchto().

While here, g/c unused cpuswitch.S local .Lblock_userspace_access.
2008-04-20 15:42:19 +00:00
chris
6cdf1e4c64 PXA270 uses a 3.25Mhz clock for OS timers, not 3.6864Mhz.
Also while here fix the delay loop used before timers are enabled to
cause a delay, by using a volatile int to do a countdown.  gcc has become
intelligent enough to optimize an empty loop away.

For delay on PXA270 we should use one of the other counters, and a 1Mhz
clock, so that we don't have to computer the counter increment.

XXX: also looks like there's a bug if the counter wraps, as delay doesn't
look like it allows for that.
2008-04-20 10:21:13 +00:00
tsutsui
cd2cdc0b9a No need to check whole alldevs to search a specific dmac unit in dmac3_link(). 2008-04-20 09:26:12 +00:00
tsutsui
76e1faa427 Split device_t/softc, as following its parents zsc(4). Spotted by isaki@. 2008-04-20 02:28:05 +00:00
scw
38ba2c7267 Adapt to the recent i2c_bitbang changes, which provide more hints as to
the SDA/SCL pin direction, by treating the direction as just that; a hint.

Instead, configure the SDA/SCL pins as outputs only when they are to
be driven low (zero). Otherwise configure them as inputs and allow the
pull-up resistors to do their jobs.

Check the SDA direction hint only if DIAGNOSTIC.

Fixes a problem reported by Donald T Hayford on port-arm@ whereby the
kernel failed to read/write the RTC's registers.
2008-04-19 20:49:31 +00:00
simonb
cd6e2e6d8b Use ANSI prototype for cyrix6x86_cpu_setup(). 2008-04-19 14:33:08 +00:00
cegger
781f72a712 Use interrupt biglock wrapper as in x86/x86/intr.c
This change is based on http://mail-index.netbsd.org/port-amd64/2004/02/22/0000.html
OK bouyer
2008-04-19 13:46:12 +00:00
cegger
ed5b592b8e idt_* are not implemented for Xen. So don't provide the prototypes for Xen. 2008-04-19 12:10:08 +00:00
simonb
822574d0ac Reduce differences in dmesg output between i386 and amd64 slightly, both
now print "cpuN: features ....".
2008-04-19 06:29:23 +00:00
nisimura
ada4901876 - make pci.c construct more canonical. PCI bus plumbing groveller
now take a ptr to a function and an opaque data to achieve the
  specific work.
- this file is going to become a general form when brd specific
  params are encapsulated in an instance as struct.
2008-04-19 04:57:55 +00:00
nisimura
0571a09251 porting explanation take 2 after an accidental quit from CVS editor.
- target differences are considered minor and adaptable by heuristics
  in pci/pci_machdep.c and machdep.c.
- kernel expects sane runtime HW settings when it gains control.
  All tweaks should have been completed by bootloader.
- consults stand/ for reference. The implementation will change
  from time to time.

communications to power control satelite processor is to be done by
a kernel thread and sysctl knobs with help of possible user agent
deamon.
2008-04-19 02:01:03 +00:00
nisimura
ce3843236c bootinfo usage and porting guide.
- Kernel expects a ptr to bootinfo structure in arg3.
- The bootinfo definition is in include/bootinfo.h
- CLOCK and CONSOLE designations are important during initial bringup
  efforts.  machdep.c consults memory controller parameters when no
  MEMORY was specified.
- autoconf.c determines ROOTDEVICE and BOOTPATH.
- target differences
2008-04-19 01:22:35 +00:00
cegger
0f42d52a84 Make this build on Xen and MULTIPROCESSOR.
OK bouyer
2008-04-18 15:49:39 +00:00
cegger
e1f7ded34b g/c unused ioapic_bsp_id.
Per discussion with bouyer.
2008-04-18 15:32:46 +00:00
cegger
5db505451b Fix panics at boot and some other misc bugs. From Hans Rosenfeld. 2008-04-18 14:56:40 +00:00
bouyer
ad2fcdc36d Do not set ioapic_bsp_id in cpu_attach_common(). It's already initialized
in cpu_attach(), and doing it here will overwrite the cpu_number of the
physical CPU with the one from the virtual CPU (which is always 0).
XXX is ioapic_bsp_id read somewhere ?
2008-04-17 21:25:00 +00:00
cegger
60fafd3b9b wrap long line. Requested and OK by simonb. 2008-04-17 18:45:08 +00:00
yamt
dc985aec9b cpu_debug_dump: s/curproc/curlwp/ in a message. 2008-04-17 14:01:03 +00:00
cegger
7d2699a931 reduce diff to x86/x86/cpu.c 2008-04-17 12:24:44 +00:00
cegger
a92eb72e37 use aprint_*_dev.
OK simonb
2008-04-17 09:09:54 +00:00
cegger
467fe0c43b Add missing bracket. Fixes build for i386 ALL kernel. 2008-04-17 05:26:11 +00:00
macallan
94959c08d1 first step for X on rev. 4 Sharks - add support for mmap()ing ISA IO,
legacy VGA and SVGA aperture via /dev/ttyE0
Mappings are restricted to root ( hi Elad )
2008-04-17 00:03:36 +00:00
cegger
a0fc30e931 use POSIX integer types 2008-04-16 21:51:02 +00:00
cegger
19a5965092 Use device_xname(). From Manuel Bouyer. 2008-04-16 20:50:27 +00:00
cegger
af33bdeef3 device_t / softc split
reviewed, tested and approved by bouyer
2008-04-16 18:41:48 +00:00