Commit Graph

217 Commits

Author SHA1 Message Date
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
dyoung
e265f67bc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:31:32 +00:00
snj
0d31d3264f Remove 3rd and 4th clauses. OK cl@ (copyright holder). 2009-10-23 02:32:33 +00:00
jym
507459d7a0 - printf -> aprint_*
- fix and add comments
- make some panic/error messages more relevant
- remove last '\n' in DPRINTK() macros, not required as it is already part of format string.

No functional changes.
2008-10-24 18:02:58 +00:00
cube
ade3d15dc2 Don't forget to set sc_dev. 2008-03-05 04:58:29 +00:00
cube
521d00a805 Convert the Xen attachment for npx(4), too. 2008-03-04 15:02:52 +00:00
bouyer
26315d042c Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
  pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
  the build will find them via the xen-ma/machine link.
2008-01-11 20:00:13 +00:00
ad
e8532b7138 - Fix a memory order problem with non-interlocked mutex release.
- Give kernel_lock its own cache line.
2008-01-10 20:14:10 +00:00
bouyer
0b075efe67 Move a CLI() after .Lspllower_resume; because on Xen .Lspllower_resume
may be called from Xdoreti via iret, so with interrupts enabled.
2008-01-09 23:45:34 +00:00
yamt
1c6ebd43e5 fix a bug in the previous. (per-cpu tss change)
keep iopl in pcb so that it won't lost.
2008-01-04 16:38:46 +00:00
yamt
35d91ae479 i386:
- make tss per-cpu.  this considerably speeds up context switch for,
	  at least, pentium4, where ltr instruction seems very slow.
i386, xen:
	- kill cpu_maxproc.
kvm86:
	- adapt to per-cpu tss.
	- cleanup and simplify.
	- move kvm86_mp_lock to more meaningful place.
	- disable preemption during a call.
2008-01-04 15:55:28 +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
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
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
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
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
deae4f32c5 Remove support for 80386 level CPUs. PR port-i386/36163. 2007-11-15 19:18:32 +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
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
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +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
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
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
94525f8950 Re-enable interrupts before checking for RAS; pointed out by YAMAMOTO Takashi. 2007-09-05 19:30:01 +00:00
yamt
7f9dc6bf93 compilation fixes. (simple_lock/unlock -> mutex_spin_enter/exit) 2007-09-04 13:50:26 +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
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
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
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