Commit Graph

696 Commits

Author SHA1 Message Date
joerg
02af50dd40 Add assym.h dependency. 2008-01-03 21:17:44 +00:00
joerg
956f82654b Add some missing dependencies on assym.h. 2008-01-02 12:46:23 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
yamt
cfb66876d1 try to detect processor resource sharing topologies. ie. package/core/smt IDs. 2008-01-01 20:32:10 +00:00
yamt
aa3e923c59 add some dependencies on assym.h. 2008-01-01 11:35:33 +00:00
yamt
2cbcb46f49 - share idt entry allocation code among x86.
- introduce a function to reserve an idt entry and use it instead of
  manipulating idt_allocmap directly.
- rename idt to xen_idt for amd64 xen.  add missing #ifdef XEN.
2007-12-26 11:51:10 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
ad
e16a661bf3 - Make __cpu_simple_lock and similar real functions and patch at runtime.
- Remove old x86 atomic ops.
- Drop text alignment back to 16 on i386 (really, this time).
- Minor cleanup.
2007-12-20 23:46:10 +00:00
joerg
870cffb0ab Add new IPI for saving CPU state explicitly, share high-level part of
ACPI wakeup code and teach it how to start the APs again. As a side
effect the CPU_START interface allows choosing between different
bootstrap codes more easily now.
2007-12-18 07:17:08 +00:00
joerg
599a3a8e85 Revert, fixed differently. 2007-12-17 14:11:53 +00:00
jmcneill
381f4068ae Provide a stub acpi_md_sleep_init on xen, pointed out by Paul Goyette
on current-users.
2007-12-15 19:24:17 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
bouyer
ca0831b58a Remove obsolete code and comment. 2007-12-13 21:42:06 +00:00
bouyer
e2b280eabb cleanup the debug event handler to not use the IPL system at all. Fix
debug event storm on XEN2.
2007-12-12 22:16:32 +00:00
bouyer
200e86ecad Initialize ci_idepth in cpu_info_primary, makes LOCKDEBUG kernels boot. 2007-12-12 19:25:38 +00:00
bouyer
9ef60ea019 Make Xen kernels build again. 2007-12-10 13:39:06 +00:00
ad
065b6ba2fb lockmgr -> mutex 2007-12-06 17:00:31 +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
bouyer
eae5f92d0c IOCTL_PRIVCMD_MMAP*: instead of brutally enterring the new entries in
the process page table, properly uvm_unmap1() the VA range and enter a new
uvm_map backed by an object. There is a know race between uvm_unmap1() and
uvm_map(), where another thread could get our VA range; in practice
I think none of the softwares using this interface are multithreaded (or at
last they are single-threaded when using it).
2007-12-02 18:29:54 +00:00
ad
7960b954d7 Don't clear ci_want_resched in MD code; it's done in mi_switch(). 2007-12-02 16:37:58 +00:00
bouyer
e13d04bb9f Use __define__ instead of define, pointed out by christos. 2007-12-01 12:57:09 +00:00
bouyer
e1353de789 Back out previous, majors.amd64 in files.amd64 is inside ifndef xen/endif 2007-12-01 12:52:20 +00:00
dsl
2d7e52ccd2 Don't pull in majors.amd64 here, we get another copy from files.amd64
and config bleats like mad.
2007-11-30 22:56:05 +00:00
ad
a0b58b4601 Remove remaining CPUCLASS_386 tests. 2007-11-28 16:44:46 +00:00
ad
157ae0ddef Use the new atomic ops. 2007-11-28 16:40:40 +00:00
yamt
82d61b9ade - merge {i386,xen}/i386/trap.c.
- add a comment about a hack for xen2.
2007-11-28 14:02:30 +00:00
pooka
f9379f7719 a_l -> curlwp 2007-11-27 11:37:27 +00:00
pooka
61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
bouyer
e6190ce36f Ops, don't forget break in switch statements ... 2007-11-25 23:23:09 +00:00
bouyer
d3cd257630 Add support for the "protocol" entry in xenstore, which really specifies
the ABI used by the front-end (x86 32 or 64 bit). A linux 32bit PAE kernel
can now boot on a NetBSD 64bit dom0 and use the block devices.
2007-11-25 22:44:39 +00:00
bouyer
ec3e8e5c1c xpq_flush_queue(): cast values to u_int64_t and use PRIx64 in printf().
Fix build of i386 Xen kernels, reported by Hisashi T Fujinaka.
2007-11-23 09:54:33 +00:00
bouyer
4e54134323 Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.
2007-11-22 16:16:40 +00:00
yamt
44cbe3d429 remove lock_machdep.c 2007-11-22 07:44:40 +00:00
ad
772ae8c190 G/C the PDP cache generation stuff. When allocating, just check for a valid
entry where nkpde currently points.
2007-11-19 21:46:51 +00:00
ad
dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
bouyer
29d8eba17f Properly setup the IO APIC for ISA and pciide compat interrupts too.
Makes ACPI kernels works again with pciide controllers in compat mode.
2007-11-18 18:44:17 +00:00
ad
deae4f32c5 Remove support for 80386 level CPUs. PR port-i386/36163. 2007-11-15 19:18:32 +00:00
ad
d3cd7e49e7 Remove pccons. 2007-11-14 17:58:50 +00:00
ad
9014362808 - Remove I486_CPU, I586_CPU, I686_CPU options. They buy us nothing and
clutter the code significantly.
- Remove pccons.
2007-11-14 17:54:56 +00:00
ad
6856a132b2 Merge cpu_need_resched() from vmlocking:
- Always do an aston(), even if not sending an IPI. May help with xine.
- Post asts on cpu_onproc, not ci_curlwp.
2007-11-12 19:02:26 +00:00
ad
39a25a40ee Make xen build again. 2007-11-11 01:27:43 +00:00
dogcow
f7e7508b3f HEAD still only has the 10-arg version of vmem_create 2007-11-08 07:50:03 +00:00
ad
d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
ad
f08b04c841 Make it compile. 2007-11-07 15:38:11 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
xtraeme
a2da5d58f1 xen/i386/cpu.c uses i686_mtrr_init_first if MTRR is defined, but
mtrr_i686.c wasn't built...
2007-10-26 22:33:23 +00:00
xtraeme
66ba6aa324 ichlpcib(4) lives in x86/pci these days... 2007-10-26 22:11:45 +00:00
xtraeme
3338a139da - Share pchb(4) between i386 and amd64; one copy is enough for both.
- Move some of the x86 PCI devices into x86/pci/files.pci.
- Add more x86 stuff into x86/conf/files.x86.

ok joerg.
2007-10-26 21:49:50 +00:00
joerg
930e1f6e1d Match delay/DELAY on x86 with delay(9). It takes an unsigned int as
argument. Use this and replace the inline assembly (mul + div using the
64bit intermediate result) with normal 32bit multiplication and
division. The compiler can turn the division into a multiplication and
shift, making it even cheaper then the original assembly. For extreme
long delays, just use 64bit arithmetic.
2007-10-26 13:24:39 +00:00
ad
bccf777b72 Make ras_lookup() lockless. 2007-10-24 14:50:38 +00:00
joerg
d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +00:00
yamt
24a1632cb3 merge yamt-x86pmap branch.
- reduce differences between amd64 and i386.  notably, share pmap.c
  between them.  it makes several i386 pmap improvements available to
  amd64, including tlb shootdown reduction and bug fixes from Stephan Uphoff.
- implement deferred pmap switching for amd64.
- remove LARGEPAGES option.  always use large pages if available.
  also, make it work on amd64.
2007-10-18 15:28:31 +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
9171fa2872 Comment out references to spinlockmgr(). 2007-10-10 17:44:39 +00:00
ad
36a1712707 Merge run time accounting changes from the vmlocking branch. These make
the LWP "start time" per-thread instead of per-CPU.
2007-10-08 20:06:17 +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
ad
2b42802f4e Repair the RAS check. 2007-09-28 17:02:39 +00:00
bouyer
784505d037 Ops, need to properly restore %esp after calling Xspllower(). 2007-09-27 21:14:04 +00:00
bouyer
a3ef51f22f Use the proper label name in cpu_switchto, here is no '2' label in this
function.
2007-09-27 19:39:20 +00:00
ad
9c412e0cbf x86 changes for pcc and LKMs.
- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
2007-09-26 19:48:34 +00:00
ad
26aaa9cb2b cpu_switchto: partial sync with i386. Set curlwp and modify the ras
check slightly.
2007-09-25 21:38:37 +00:00
ad
b684adf6ed ci_astpending is no more. 2007-09-25 17:08:08 +00:00
bouyer
29bd9d9414 %fs has to be initialized before mutexes are used; consinit() may end up
calling mutex_enter(). So call initgdt() ASAP, and consinit() right after
initgdt().
Fix Dom0 crash reported by Mikolaj Golub and others when using the VGA
console.
2007-09-24 18:34:01 +00:00
bouyer
ad1f77f70c cleanup findroot(): remove code to match BIOS disk, as the bootloader
won't pass us this kind of information anyway ...
2007-09-23 21:29:03 +00:00
bouyer
5f0855fadb Ajust for Xen 3.1.0 public headers. From Christoph Egger in private mail. 2007-09-23 16:54:07 +00:00
bouyer
de1e0997f1 Add NetBSD CVS Id. 2007-09-23 16:25:28 +00:00
bouyer
a6669b974a Remove files that should not have been imported. 2007-09-23 16:24:06 +00:00
bouyer
d6d56d2ae7 Merge conflics after import of Xen 3.1.0 public headers 2007-09-23 16:19:36 +00:00
bouyer
9800459946 Import Xen 3.1.0 public headers 2007-09-23 16:13:31 +00:00
bouyer
4b788a8f96 Add NetBSD RCS Id. 2007-09-23 15:57:36 +00:00
bouyer
94525f8950 Re-enable interrupts before checking for RAS; pointed out by YAMAMOTO Takashi. 2007-09-05 19:30:01 +00:00
bouyer
d61110de20 Switch to dynamically-sized grant tables, available since Xen-3.1.0.
This removes a hard limit that would prevent a guest from running with more
than 7 virtual network interface.
If running on a hypervisor that doesn't support GNTTABOP_query_size, fall back
to a 4-pages grant table, so this change is backward-compatible.
2007-09-05 19:15:42 +00:00
bouyer
26281fbd54 Fix build failure when for kernel with options LOCKDEBUG.
Pointed out by Christoph Egger.
2007-09-04 21:19:11 +00:00
yamt
7f9dc6bf93 compilation fixes. (simple_lock/unlock -> mutex_spin_enter/exit) 2007-09-04 13:50:26 +00:00
ad
fbb58ada61 Merge most x86 changes from the vmlocking branch, except the threaded soft
interrupt stuff. This is mostly comprised of changes to the pmap modules to
work on multiprocessor systems without kernel_lock, and changes to speed up
tlb shootdowns.
2007-08-29 23:38:01 +00:00
dyoung
6f7649313f Constify. 2007-08-26 22:28:52 +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
he
ef2c9ff103 Explicitly include <sys/proc.h> for tsleep() prototype. 2007-07-22 20:39:22 +00:00
he
41b06f79ca Explicitly include <sys/proc.h> for tsleep() declaration. 2007-07-22 20:36:13 +00:00
ad
2a051b63b4 +#include <sys/proc.h> 2007-07-22 08:50:26 +00:00
ad
63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
dogcow
1367780514 Looks like this was part of a botched merge; apply he@'s patch to make
everything compile/link again.
2007-07-11 04:07:08 +00:00
he
ff92ad95e2 Protect the initialization of xen_timepush_co with #ifdef DOM0OPS,
like its declaration and other uses.
2007-07-10 16:27:58 +00:00
he
bad1d53b6a Add an IPL_VM argument to comply with the new vmem_create() prototype,
as per hint from ad@.
2007-07-10 16:23:26 +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
bouyer
afc9294f4e Add a bootstatic callback for dom0, which allows to take NFS boot informations
from the command line (nfsroot=, ip=) in the same way domUs did.
While there convert a for (;;) loop to TAILQ_FOREACH().
From Christoph Egger in private mail.

Make all bootstatic callbacks return the new NFS_BOOTSTATIC_NOSTATIC flag
when no nfs boot information is found on command line.
2007-07-08 21:14:14 +00:00
pooka
0bc323f5cd Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
2007-07-08 10:19:21 +00:00
tsutsui
6a8a584d1a Remove leftover netns stuff. 2007-07-07 05:13:14 +00:00
jld
855403caf7 Correct regression in xen3 wall-time reading accidentally committed in r1.35.
(Discussed on port-xen.)
2007-07-02 06:26:35 +00:00
bouyer
69219b1efe copy from the right offset when handling root= on the command line.
Pointed out by Pavel Cahyna.
2007-06-28 20:54:47 +00:00
bouyer
6be5ba1e96 Make sure to check for pending interrupts on the final STI. For this
reorganise the IPL vectors a bit so that they can be used from more
places than splllower and doreti.
Include patch from Kazushi Marukawa (fixed to handle pending interrupts),
which should fix the read_psl() == 0 assertion failure reported by
several users.
2007-06-28 20:50:30 +00:00
alc
c82e20912d - add ichlpcib to XEN2 config file
- few cosmetics

tested with XEN2 and XEN3 kernel
ok bouyer@
2007-06-28 20:07:00 +00:00
bouyer
0bee3ccac3 Remove the __asm("lock") again from softintr(), as ci_ipending is local
to the CPU. Thanks to YAMAMOTO Takashi and Andrew Doran for their comments
on this.
2007-06-26 19:41:11 +00:00
bouyer
1206dd032d Various cleanups in interrupt code, and fix a potential crash in doreti:
if we enter doreti_checkast with only soft interrupt pendings, we would
jump to one of the soft* vector with %esi uninitialized, and the vector
would do a jump *%esi at the end ...
I don't know why nobody ever went into this; I guess in the common case
there's no soft irq pending without a hard irq in this code path ...
2007-06-25 20:09:34 +00:00
bouyer
bf539c16bd Add back a __asm("lock") that got lost in the yamt-idlelwp merge. 2007-06-25 20:02:45 +00:00
bouyer
142ad1ab3e Call p_emul->e_syscall_intern() before sendsig_reset() to match what
i386 does.
2007-06-25 20:01:23 +00:00
bouyer
a7d4fae602 Fix race condition in cpu_idle() on ci_want_resched. From YAMAMOTO Takashi. 2007-06-25 19:57:32 +00:00
dyoung
1ee8f4a418 Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.
2007-06-24 01:43:34 +00:00
bouyer
c9054f7661 Support root= as an alias for bootdev=, for consistency with multiboot
support. Suggested by Pavel Cahyna.
2007-06-18 18:56:23 +00:00
bouyer
e0e73c4e83 Make it build again when IPMI is used (caddr_t issue ?) 2007-06-12 18:55:50 +00:00
bouyer
e4f18e1082 IOCTL_PRIVCMD_MMAP: properly map entries from 0 to (mcmd->num - 1), instead
of mapping mcmd->num times entry 0. xentools < 3.1 probably didn't use this
with more than one entry at a time ...
2007-06-12 18:53:52 +00:00
jld
fc7a27a9ee Add needed locking in xenevt_fpoll; this fixes at least a lost-wakeup bug.
OK'ed by bouyer@.
2007-06-08 22:06: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
jld
51e5b25976 Convert the xen port to use timecounters; ok'ed by bouyer@. 2007-05-12 07:06:54 +00:00
bouyer
1e1bf73d65 IOCTL_PRIVCMD_MMAPBATCH: mimic linux behavior and return no error
even if a pmap_enter_ma() (the underlying hypercall, really) returns one.
The fact that the mapping failed is notified to the called by oring
0xF0000000 to the mfn.  This makes Xen 3.0.4 HVM work.
2007-04-27 22:10:39 +00:00
ad
8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +00:00
macallan
43b2c2b989 include files.wsfb 2007-04-10 02:50:32 +00:00
dogcow
82e011bdfd unb0rk build. 2007-03-14 22:26:02 +00:00
ad
28c7654399 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-13 18:30:57 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
ad
2f3dd41194 Include sys/simplelock.h, not sys/lock.h. 2007-03-12 16:43:11 +00:00
yamt
dedaf26748 fix vcpu after recent cpubus changes. 2007-03-06 12:35:39 +00:00
dogcow
b347627ab1 The recent cpu_attach changes broke the xen build; while this compiles,
I'm far from positive it's the correct fix.
2007-03-05 23:26:40 +00:00
drochner
d880082522 clean up how cpus and ioapics are attached at the mainbus:
Seperate "cpubus" and "ioapicbus" -- while they share a common "address
space" (the apic id), the kernel doesn't use this fact. There are different
data passed to cpus and apics, which caused some ugly polymorphism. This
also saves the special "submatch" functions needed to distingush cpus
and ioapics for autoconf. (And it makes that "apid" locators wired
in the kernel configuration are honored now; this allows one to dumb down
an mp box to singleprocessor by userconfig.)
Print "apid" locators in the buses "print" function "as everyone does",
so the per-port cpu drivers don't need to do it.
Being here, constify "struct cpu_functions" and g/c the unused MP_PICMODE
flag.
2007-03-05 16:50:59 +00:00
dogcow
d2c694ade7 fix more caddr_t -> void * fallout. 2007-03-05 04:03:57 +00:00
dogcow
fc8b4c24ce fix more caddr_t -> void * fallout. 2007-03-05 03:22:06 +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
bouyer
dd27ab284c Properly honnor bus_dma bus address range restriction for Xen3 (the Xen2
interface doesn't allow it), so that .e.g bus_dma_subregion() has a chance
to work. Unfortunably a stock Xen hypervisor won't allow a upper bound less
than 2^31 (2GB) so devices like bce(4) will need a hacked hypervisor to
work properly.
2007-02-24 21:19:25 +00:00
bouyer
0f5ec4e70b Catch up with x86: add _bus_dmatag_subregion() and _bus_dmatag_destroy()
to x86_bus_dma_tag
2007-02-22 21:38:23 +00:00
dogcow
31286c4ea7 add _tag_needs_free members to x86_bus_dma_tag structs 2007-02-22 20:26:40 +00:00
thorpej
ae01c745cb TRUE -> true, FALSE -> false 2007-02-22 06:47:16 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
dsl
5c89b1866e Get config(1) to supply the default values for BEEP_ONHALT. 2007-02-18 18:15:41 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
bouyer
89b7593e6a Xen3 linux guests seems to loan a lot of pages for some disk transfers,
and eventually run out of XENSHM_NPAGES for a single transfers.
Bump XENSHM_NPAGES by 10 for xen3 to avoid deadlocks in such case.
2007-01-20 22:01:06 +00:00
ad
236a8ab694 Update x86_pause() as per i386. 2007-01-14 17:20:32 +00:00
bouyer
4bd6fc948a Fix still possible race condition where xbd_handler could still try to process
an event before the device is ready.
Reported, and tested by anzi at dnainternet net on port-xen.
2007-01-11 19:51:39 +00:00
bouyer
1073d668ed - Add or change memory barrier to reflect the related operation
- In xencons_handler(), update in_cons inside the loop, otherwise,
  we would trigger the xenconscn_getc() workaround wich reset cons and prod
  to their original values, and this creates an infinite loop

Should fix the console hang reported by several users on port-xen@.
2007-01-07 00:02:36 +00:00
bouyer
3fbcd5f774 Don't try to handle xbd interrupts if the device is not yet connected.
Should fix NULL dereference at boot when more than one xbd device is
configured, reported by Juraj Hercek on port-xen@
2007-01-06 22:07:11 +00:00
pavel
104e8925ea remove some leftover msgbuf manipulation from pmap.c, as done for the i386
and amd64 versions before. Inspired by PR port-i386/34186 from Wolfgang
Stukenbrock.
2007-01-06 17:48:52 +00:00
jmcneill
afcfbdad8b On the Xbox, prevent scanning past the first device on bus 1. 2007-01-05 17:53:53 +00:00
yamt
760e1ad563 xbd_handler: call dk_iodone after updating rsp_cons.
otherwise, xbdstart kicked via dk_iodone still sees RING_FULL condition
and just returns.  it makes xbd stall when all requests are acked by
a single xbd_handler.  PR/34005.
2007-01-01 22:54:14 +00:00
yamt
35374d3155 bring in wedge handling code from arch/x86/x86/x86_autoconf.c.
unlike i386, we can't rely on the bootloader.
2007-01-01 02:59:50 +00:00
ad
e96fca7884 Define ipl_t as uint8_t so that it can be packed into a word with a lock
byte. Ok yamt@.
2006-12-26 15:22:44 +00:00
elad
504c71d9fe Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
2006-12-26 10:43:43 +00:00
wiz
3ed1aa9185 Spell "separate" correctly. From Zafer Aydogan. 2006-12-25 18:39:47 +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
gdt
38eac16b69 Use agp_machdep.c from the new location (x86, not i386). 2006-12-18 20:07:36 +00:00
bouyer
8f9ec90387 Remove extra ) causing compile failure when CONS_OVERRIDE is defined.
From Hideo Masuda in PR port-xen/35217.
2006-12-09 10:37:52 +00:00
yamt
98cfc473c8 - pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
2006-12-08 15:05:18 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
yamt
9777cce8d1 include the i386 frameasm.h rather than inlining it. 2006-11-21 07:35:01 +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
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
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
yamt
641f2cc444 xennet_checksum_fill: remove a debug printf. 2006-11-10 11:52:49 +00:00