Commit Graph

1472 Commits

Author SHA1 Message Date
cegger
c71642a72c remove extra blank.
before:
nxp0:  reported by CPUID; using exception 16

now:
npx0: reported by CPUID; using exception 16
2008-04-11 20:42:34 +00:00
cegger
320e553f24 use aprint_*_dev and device_xname
OK joerg
2008-04-04 22:05:39 +00:00
cube
0e763ef11c Split device_t and softc for npx(4). 2008-03-04 14:53:38 +00:00
christos
c7312b8578 The probe function hijacks 2 idt vectors and then restores them back. There
is no reason to permanently allocate idtvec[0x2d], which could be used
by compat_svr4 as the system call gate.
2008-02-08 18:10:40 +00:00
dyoung
f21e6a3c1a Do not reserve ISA bus space for npx@isa unless we hook IRQ 13,
which we ought to never do.  If we have not hooked IRQ 13, we do
not need any resources in npx_softc to handle numeric coprocessor
exceptions, so let npx@isa detach.
2008-01-20 21:49:57 +00:00
ad
da388edb64 Make it compile. 2008-01-15 18:46:23 +00:00
joerg
0c3d816871 Introduce optional cpu_offline_md to execute MD actions at the end of
cpu_offline. Use this on amd64/i386 to force a FPU save. As this was
triggered by npxsave_cpu/fpusave_cpu not working for a different CPU,
remove the cpu_info argument and adjust npxsave_*/fpusave_* to use bool
for the save.

OK ad@
2008-01-15 14:50:07 +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
dyoung
03f1738ff9 Use device_t, device_private(). Join some lines. 2008-01-02 21:05:51 +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
lukem
ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
ad
8fa4c02554 pccons was removed. 2007-11-19 18:29:25 +00:00
ad
a91a28dac6 - Don't test for I686_CPU.
- splipi -> splhigh
- Remove some pointless ifdefs.
2007-11-14 17:51:36 +00:00
ad
0f8b0df960 Call ttyflush() with tty_lock held. 2007-11-10 18:29:36 +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
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
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
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
thorpej
f00c540051 TRUE -> true, FALSE -> false 2007-03-07 21:43:43 +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
dyoung
56db732551 Add cmos(4) for reading/writing CMOS RAM on x86 boxes. This driver
comes from Takahiro Kambe, with some mods by me.
2007-02-06 07:28:59 +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
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +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
christos
0e5129986f fix print formatting. 2006-10-29 19:05:36 +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
dogcow
44603cac1f more unused variable fallout. 2006-10-13 18:28:06 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
elad
3bd66d639f Fix typos (tty -> tp), pointed out by Matt Fleming, thanks! 2006-10-01 16:50:11 +00:00
elad
b8a339347f Implement the "device" scope.
It uses an authorization wrapper per device class on the system to
ensure type-safety.

For now, it supports only terminal (TTY) devices, and has two actions
for them: "open terminal" and "privileged set". Sample usage has been
added to i386 and hp300 code for reference.

Update documentation.
2006-09-30 20:05:57 +00:00
perry
225449e795 switch to a common clock.c 2006-09-04 02:16:03 +00:00
perry
a8054af60a The i386 and amd64 versions are now identical. They'll get moved to
arch/x86 soon. Ultimately the functionality should be split
into different files for i8254, mc146818 and pcppi.
2006-09-04 01:40:19 +00:00
perry
a82c8b386d The amd64 and i386 versions of this file both got some variables
renamed to avoid shadowing. The amd64 names are a bit easier to
understand, so switch to them here.
2006-09-04 01:06:01 +00:00
perry
fa4b595579 Fix static function declarations. 2006-09-04 00:56:08 +00:00
perry
611f860676 remove the "clkintr_pending" stuff.
The variable was used but never set. Kardel says it is a remnant from
the freebsd code he ported, and may be safely discarded.
2006-09-03 20:49:21 +00:00
perry
61af090394 add an #ifndef __x86_64__ around #include "mca.h"
reduces diffs with the amd64 port
We'll soon merge these entirely
2006-09-03 20:46:23 +00:00
perry
8a4431f0b8 fix declaration of tickle_tc() -> tickle_tc(void) 2006-09-03 20:38:32 +00:00
christos
5cbefe6615 make this compile again (thanks gdamore) 2006-09-03 06:03:51 +00:00
gdamore
4c30050f13 Convert i386 to use common TODR code. Not tested, but Christos says he'll
test it for me right now. :-)
2006-09-03 05:26:11 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
christos
d957913795 Fix a bit of debugging code (from Arnaud Lacombe) 2006-07-09 21:31:40 +00:00
kardel
09b51ec920 convert to timecounters (from branch simonb-timecounters) 2006-06-07 22:37:14 +00:00
elad
8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
christos
19e3773ffa Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
2006-04-19 17:19:48 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
kleink
31930d4de5 Provide BCD<->binary conversion in libkern and turn <dev/clock_subr.h>'s
FROMBCD()/TOBCD() macros into wrappers around it, resulting in both
smaller code footprint and elimination of possible issues due to
multiple evaluation of macro arguments.

Suggested by Simon Burge and Anders Gavare on tech-kern.
2006-03-11 15:40:07 +00:00
thorpej
a9beff9534 Use aprint_*(). 2006-02-19 14:59:22 +00:00
perry
68da44823c u_intN_t -> uintN_t 2005-12-26 19:23:59 +00:00
perry
5f1c88d70d Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:06:46 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
kleink
aece7a90fd Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges.  Noted by David Holland in PR kern/31126.
2005-09-06 21:40:37 +00:00
christos
4c0c764bc7 minor nits. 2005-06-02 13:04:05 +00:00
martin
9d33dc306b Fix qualify/shadow warnings. 2005-06-02 08:03:50 +00:00
christos
efc217b18f avoid variable shadowing. 2005-05-29 21:58:41 +00:00
drochner
0717077eea The joystick driver is using mi timing code for many months.
Noone complained, so we can remove the unused md versions.
2005-02-18 15:39:17 +00:00
perry
449436c385 move a prototype back inside an #ifdef -- my GENERIC kernels worked
fine with it in the new place, but compiling another kernel found that
it wasn't a good idea.
2005-02-03 21:54:49 +00:00
perry
32a519cece de-__P, partially ANSIfy 2005-02-03 21:08:57 +00:00
drochner
1134c44162 adapt to ISA "unknown address" namespace separation 2004-09-14 20:25:05 +00:00
mycroft
1e3cb7e7ec Back out part of the changes in rev 1.86. Remove npxdna_notset(), and instead
have the DNA trap handler point to npxdna_empty() by default.  This way, if
there are no npx devices found and MATH_EMULATE is not configured, we go back
to the old behavior of issuing a SIGKILL and printing:
pid XXX killed due to lack of floating point
rather than panicking.
2004-07-06 01:30:08 +00:00
yamt
eb3fe82f73 i8254_initclocks: fix an integer overflow problem in rev.1.83.
a patch provided by FUKAUMI Naoki.  PR/26152.
2004-07-03 18:24:37 +00:00
yamt
38cdafcad1 {i8254,lapic}_initclocks: try to be more precise using fixtick. 2004-07-01 13:00:39 +00:00
yamt
9a1474eb02 remove a prototype for a function which doesn't exist. (npxdna) 2004-06-23 12:24:01 +00:00
yamt
6b9fd4bdc5 npxsave_lwp: issue pause in a busy loop. 2004-05-13 12:13:20 +00:00
minoura
d75fa2749f Move misplaced debug code.
This should make it compile w/o pcppi and w/ CLOCKDEBUG.
2004-04-24 13:38:36 +00:00
simonb
84b7d801ac Only initialise ksi if we use it. 2004-03-21 10:56:24 +00:00
bjh21
dff5222d3a Abstract the interface between pckbc(4), and the pckbd(4) and pms(4)
drivers that attach to it.  This allows for other host interface chips
that use the same keyboards and mice, such as the ones in the ARM
IOMD20, ARM7500, and SA-1111.  The PC-compatible driver is still
called pckbc(4), and the new abstraction layer is "pckbport", so the
child devices have moved from sys/dev/pckbc to sys/dev/pckbport, which
also contains some code shared between all host controllers.  To avoid
incompatibility, pckbdreg.h is still installed in
/usr/include/dev/pckbc.

In theory, this shouldn't cause any behavioural changes in the drivers
concerned.  Thy just use rather more function pointers than before.  Tested
on i386 and (with a new host driver) acorn32.  Compiled on several other
affected architectures.
2004-03-13 17:31:33 +00:00
wiz
d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
yamt
2a93afdfd5 rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
2004-01-28 10:48:55 +00:00
scw
43cdf5ffb6 __splbarrier() is deprecated in favour of the MI __insn_barrier(). 2004-01-26 19:43:25 +00:00
jdolecek
cbff3c76c3 fix IPRINTF() code to compile if the printf()s are enabled; also print
lwp pointers rather than proc pointer
2003-12-05 21:24:57 +00:00
keihan
8476e6755a NetBSD.ORG -> NetBSD.org
Now all "NetBSD.ORG" are gone from src/sys.
2003-12-04 12:42:54 +00:00
cl
ed9c2d7075 don't uvm_swapout LWPs which are LSONPROC on another cpu.
uvm_swapout_threads will swapout LWPs which are running on another CPU:
- uvm_swapout_threads considers LWPs running on another CPU for swapout
  if their l_swtime is high
- uvm_swapout_threads considers LWPs on the runqueue for swapout if their
  l_swtime is high but these LWPs might be running by the time uvm_swapout
  is called

symptoms of failure: panic in setrunqueue

fixes PR kern/23095
2003-10-19 17:45:35 +00:00
thorpej
55452b8f35 Use KSI_INIT_TRAP(). 2003-10-08 19:10:30 +00:00
skd
6347eb786e Support for proper siginfo FP codes. Also, set si_trap to fp status word.
Approved by fvdl.
2003-10-07 14:35:37 +00:00
christos
d5f61bb017 SA_SIGINFO changes 2003-09-06 23:15:35 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
dsl
7452c78152 Fix botched nathanw_sa_merge change
fixes port-i386/21603
2003-05-17 10:34:39 +00:00
wiz
ee6d7b94d4 Remove last traces of obsolete olms and omms drivers.
Ok'd by drochner and fvdl.
2003-05-15 13:13:21 +00:00
drochner
1927ae6a7e -remove opms attachment stuff which is pointless after
opms itself was removed
-do the bus_space reservation in any case
-extend a compile-time check: pccons and ega can't coexist either
2003-05-14 12:10:04 +00:00
drochner
00b4e62a0a fix "unintialized variable" warning 2003-05-14 11:27:39 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
fvdl
6886cf85b0 Initialize name and dma tag. 2003-04-20 16:54:23 +00:00
fvdl
4d6d3fb37b Call ahc_softc_init in attach function. 2003-04-20 15:48:25 +00:00
fvdl
349233c2db Adapt to new backend. Needs testing. 2003-04-19 19:36:20 +00:00
taca
e7e88128f7 Fix compile error with struct consdev change. 2003-03-06 23:47:35 +00:00
fvdl
5d9be5f0db The IDT only contains gate descriptors, so define it as such. 2003-03-03 22:14:15 +00:00
fvdl
2c7dd6813f Moved to x86/isa. 2003-02-27 00:27:54 +00:00
fvdl
ab4edb55ec Adapt for i386/x86 change. 2003-02-26 22:21:19 +00:00
gson
d3fce65758 Reserve the I/O ports used by the CRT controller to keep them from
being allocated for other purposes such as PCMCIA I/O space.  Fixes
port-i386/5177.
2003-02-19 04:07:56 +00:00
nakayama
64eb1178ab Share i386/tsc_microtime.c with alpha and sparc64 as kern_microtime.c.
(approved by martin)
2003-02-05 12:18:01 +00:00
thorpej
5819507df3 Merge the nathanw_sa branch. 2003-01-19 16:30:13 +00:00
thorpej
a50e3bc1cb Merge the nathanw_sa branch. 2003-01-17 22:58:53 +00:00
perry
c2afe21c94 Change from a hardcoded sanity check date that has to be updated by
hand every few years to code that uses the automatically generated
time value from config_time.h
Fixes an ancient XXX in the code.
2002-12-10 23:24:33 +00:00
fvdl
5c45b70587 Don't use delay() in the IPI wait loop. Use an empty one instead, with
a counter check in the DIAGNOSTIC case.
2002-12-04 01:36:10 +00:00
kenh
25c20430c3 The day-of-week register in the MC146818 has the value 1-7, but
clock_secs_to_ymdhms() returns dt_wday with a range of 0-6.  Make sure
the DOW register has the correct range.
2002-12-03 16:11:11 +00:00
christos
729ccbc9cd si_ -> sel_ 2002-11-26 19:49:00 +00:00
fvdl
ae4b76c8d3 New interrupt code. The basic idea behind it is to hide the differences
in interrupt controllers in struct pic, and try to keep as much
common code as possible. At the lowest (asm) level, this is done
with CPP macros.

The main structure is now struct intrsource, describing an established
interrupt line, of any kind (soft/hard local apic/legacy apic/IO apic).
For quick masking, there may be a maximum of 32 sources per CPU.
Sources can be assigned to any CPU in the MP case, though currently they
all go to the boot CPU.
2002-11-22 15:23:35 +00:00
fvdl
fe506424c6 Removed in the new intr world. 2002-11-22 14:53:05 +00:00