Commit Graph

8239 Commits

Author SHA1 Message Date
bouyer cc56ebe228 on Xen the GDT has to be updated though HYPERVISOR_update_descriptor().
Export i386/i386/gdt.c:update_descriptor() and use it in x86_set_sdbase(),
as a direct write to the GDT will cause a kernel trap.
Fix PR port-xen/41401.
2009-05-17 18:24:23 +00:00
cegger 53537c2dae KNF, same object code generated. 2009-05-16 16:52:03 +00:00
elad d009a1bb6c Add IPKDB options, but commented out as it doesn't build at the moment. 2009-05-10 15:26:23 +00:00
pgoyette b3c79debe6 Initial implementation of sdtemp(4) driver for on-DIMM temp sensor.
(These optional sensors are specified by JEDEC Standard No. 21-C
Section 4-7 and implemented by multiple vendors.  Tested on my
amd64 machine with Kingston KVR1066D3E7S/2G memory which includes
a STMicro STTS424E02 sensor.)
2009-05-09 15:04:25 +00:00
cegger 6a970ea21d device_t/softc split 2009-05-05 09:51:23 +00:00
cegger 463905bb9c struct cfdata * -> cfdata_t 2009-05-04 12:38:51 +00:00
cegger 1a57d635a0 struct device * -> device_t
No functional changes intended.
2009-05-04 12:19:29 +00:00
cegger ad6eeaade5 struct device * -> device_t, use device_private()
No functional changes intended.
2009-05-04 12:15:51 +00:00
cegger a4a2ef3bd3 struct device * -> device_t
No functional changes intended.
2009-05-04 12:14:31 +00:00
cegger 46919b98ad struct device * -> device_t, use device_private 2009-05-04 12:13:19 +00:00
ad 557443fab0 PR kern/41342: BSDi binaries cause panic
XXX Manuel, please have a look as I am not sure what to do for XEN here!
2009-05-04 11:47:29 +00:00
cegger 85834d03a8 add ale(4) 2009-05-01 06:25:50 +00:00
dyoung 82e9f91ec4 Add elansc_shutdown() for turning off the watchdog.
Don't try to unregister the watchdog in elansc_detach() if we are
shutting the system down, because unregistering is designed to fail if
the watchdog is armed.
2009-04-29 23:50:53 +00:00
dyoung 458342a90c Delete dead code. 2009-04-29 23:18:09 +00:00
ad c28dc6f757 A workaround for a bug with some Opteron revisions where locked operations
sometimes do not serve as memory barriers, allowing memory references to
bleed outside of critical sections.  It's possible that this is the
reason for pkgbuild's longstanding crashiness.

This is not complete (atomic ops need some work too).
2009-04-24 17:45:40 +00:00
nonaka e4decce5b3 Add SD/MMC related devices. 2009-04-21 22:47:55 +00:00
elad 78fa90b2d3 Remove extra ')'. 2009-04-21 14:51:49 +00:00
nonaka e0297d1ead Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
2009-04-21 03:00:29 +00:00
cegger 327f4a8c43 add ale(4) 2009-04-20 20:49:21 +00:00
ad 4d8f47ae2f cpuctl:
- Add interrupt shielding (direct hardware interrupts away from the
  specified CPUs). Not documented just yet but will be soon.

- Redo /dev/cpu time_t compat so no kernel changes are needed.

x86:

- Make intr_establish, intr_disestablish safe to use when !cold.

- Distribute hardware interrupts among the CPUs, instead of directing
  everything to the boot CPU.

- Add MD code for interrupt sheilding. This works in most cases but there is
  a bug where delivery is not accepted by an LAPIC after redistribution. It
  also needs re-balancing to make things fair after interrupts are turned
  back on for a CPU.
2009-04-19 14:11:36 +00:00
dyoung c94ffba5d6 Introduce sys/arch/x86/x86/mp.c for common x86 MP configuration code.
mpacpi_scan_pci() and mpbios_scan_pci() are identical code, so replace
them with mp_pci_scan().

Introduce mp_pci_childdetached(), which helps us to detach root PCI
buses that were enumerated either by MP BIOS or by ACPI.

Let us detach and re-attach PCI buses from mainbus0 on i386.  This is
necessarily a work-in-progress, because testing detach and re-attach
is very difficult: to detach and re-attach the entire PCI tree on most
x86 computers that I own is not possible because some essential device
attaches under the PCI subtree: the console, com0, NIC, or storage
controller always attaches in the PCI tree.
2009-04-17 21:07:58 +00:00
rmind 3de18e79b4 - Add macros to handle (some) trapframe registers for common x86 code.
- Merge i386 and amd64 syscall.c into x86.  No functional changes intended.

Proposed on (port-i386 & port-amd64).  Unfortunately, I cannot merge these
lists into the single port-x86. :(
2009-04-16 15:34:23 +00:00
elad 2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
cegger cb572d026d No Execute bit is available in PAE-paging mode.
However to use it, NXE bit in EFER register must be set.
2009-04-15 13:05:47 +00:00
perry 108f1637cb add commented out LOCKDEBUG 2009-04-10 23:00:53 +00:00
perry 10604079d9 Check the size of the offered boot.cfg file. Bail out if it is larger
than 32k.

A bootconf file is normally only a few hundred bytes long. If it is
much bigger than expected, we can't load it into an 8086 real mode
segment anyway.

Much more to the point, in the pxeboot case, someone may have
configured their dhcpd to return the filename for the kernel, not
realizing that the filename is now for boot.cfg which didn't used to
be the case. If we try to load the kernel here, thinking it is
boot.cfg by accident, the boot loader will die ignominiously and
without much of an error message, so we don't want to do that.

This needs to be pulled up to 5.0 if 5.0 has all this machinery
-- I'm not sure whether it does.
2009-04-10 19:41:41 +00:00
sborrill e53eaac0d8 Add missing cpu.h include required by last commit. 2009-04-09 10:56:41 +00:00
dyoung faec2c4d7c Move elanpar0 and elanpex0 attachment out of the #if NGPIO > 0 block in
elansc_attach().

Let us detach gpio0 at elansc0.

Let us re-attach pci0 at elansc0.

Reduce code duplication between elansc_rescan() and elansc_attach():
call _rescan() from _attach() to attach elanpex0, elanpar0, gpio0, and
pci0.
2009-04-08 23:53:10 +00:00
dyoung 9512fa2997 Remove redundant declaration of mainbus_attach(), as pointed out by
Thomas Klausner.

Do not compile in the local variable "mba" in mainbus_rescan unless
NPNPBIOS > 0 || NACPI > 0 || NIPMI > 0 || NMCA > 0.  This fixes the
build on systems such as Soekris where none of those options apply.
2009-04-08 17:08:02 +00:00
dyoung b6889a3f64 Let us re-attach acpi0, ipmi0, pnpbios0, and mca0 at mainbus0.
Extract code from mainbus_attach() to create a rescan hook,
mainbus_rescan().  Call mainbus_rescan(, "acpibus"/"ipmibus"/..., ) from
mainbus_attach() in the precise places where we used to attach acpi0,
ipmi0, pnpbios0, and mca0.  This allows, for example, ipmi0 to detach
and re-attach:

# drvctl -d ipmi0
ipmi0: detached
# drvctl -r -a ipmibus mainbus0
ipmi0 at mainbus0
#

Future work will let us detach & re-attach CPUs and the ISA/PCI/EISA
buses at mainbus0.
2009-04-07 22:01:38 +00:00
dyoung 720a7dca79 Add opt_intrdebug.h for the INTRDEBUG option, and #include it here and
there.  Fixes GENERIC/i386 compilation with 'options INTRDEBUG'.
2009-04-07 18:24:23 +00:00
tsutsui 0f22466110 Use #define<tab> consistently. 2009-04-05 00:57:56 +00:00
tsutsui 47fb91c8ba Remove __HAVE_UFS2_BOOT since it belongs to sysinst for now.
"Feel free to change it" by ad@.
2009-04-05 00:54:21 +00:00
ad 95e4ccac55 +__HAVE_UFS2_BOOT 2009-04-04 10:36:08 +00:00
tsutsui ac465a42e7 Remove obsolete LIBSA_USE_MEMCPY and LIBSA_USE_MEMSET.
They were removed from <lib/libsa/stand.h> on December 2007.
2009-04-03 10:38:12 +00:00
dyoung 0d1ba3e899 During shutdown, detach devices in an orderly fashion.
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
2009-04-02 00:09:32 +00:00
tls d15f48cfe5 Fix probe for VIA C3 and successors -- these are CPU family 6, not 5.
The broken probe was causing the VIA padlock driver to never attach!
Now we can see that its AES appears to be broken -- it makes FAST_IPSEC
ESP not work, on systems where it works fine with cryptosoft.

Rework code to detect and (if necessary) enable VIA crypto and RNG.
Add RNG support to VIA padlock driver.  In the process, have a quick
go at debugging the AES support but no luck thus far.
2009-04-01 03:56:54 +00:00
rmind 44170e3c3a Merge i386 and amd64 ipifuncs.c into x86. No functional changes intended.
XXX: fpu #ifdefs are ugly (should be revisited at some point).
2009-03-30 22:28:39 +00:00
rmind 70456c4d9e Merge i386 and amd64 vm_machdep.c into x86. No functional changes intended.
Note: some #ifdefs will be removed with macros.
2009-03-30 22:20:55 +00:00
rmind 74a033c8eb Merge/move core_machdep.c into x86, no difference between i386 and amd64. 2009-03-30 22:13:42 +00:00
dyoung 1f874fb168 Cosmetic: reduce differences from amd64/amd64/vm_machdep.c by deleting
an empty line.
2009-03-30 17:48:22 +00:00
tsutsui 31f477f9fd Remove extra trailing slash in ${S} path. 2009-03-30 09:22:52 +00:00
mrg dba4444474 delete COMPAT_43 that is now in GENERIC 2009-03-29 17:06:01 +00:00
ad 21caef1598 Unfuck compat some more 2009-03-29 15:45:08 +00:00
ad 09f256f463 Make i386 use banner(). amd64 not converted yet as it seems to trip into
a bug in format_bytes().
2009-03-29 10:58:54 +00:00
ad ead83a47c8 _lwp_setprivate: provide the value to MD code if a hook is present.
This will be used to support TLS. The MD method must match the ELF TLS spec
for that CPU architecture (if there is a spec).

At this time it is only implemented for i386, where it means setting the
per-thread base address for %gs. Please implement this for your platform!
2009-03-29 09:24:52 +00:00
rmind a3e23c67f6 Reduce some differences between i386 and amd64.
Mainly cosmetical changes - no functional changes intended.
2009-03-29 01:10:28 +00:00
rmind 614719fdd8 Add few comments. 2009-03-28 22:46:52 +00:00
rmind 0d4fdf8b96 kvtop: change return type to paddr_t. 2009-03-28 21:34:17 +00:00
mrg 7e57d1b381 put the max_paddr DEBUG message under DUMP_DEBUG option. 2009-03-28 01:45:17 +00:00