Commit Graph

302 Commits

Author SHA1 Message Date
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
elad 4b316db1d1 Introduce KAUTH_REQ_MACHDEP_{ALPHA,X86}_UNMANAGEDMEM to handle access
to unmanaged memory.

These are the last two securelevel references in the MD code.
2006-11-22 12:12:51 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos eeedf4b2c2 convert variable allocation to constant. 2006-11-10 18:15:12 +00:00
elad eddfaaf54c Move i386/amd64 common code (check_pa_acc()) to x86.
I didn't know what header to put the prototype in, so it's both in
i386/mem.c and amd64/mem.c; probably can be moved later.

Tested on amd64, assumed working on i386. :)

yamt@ okay
2006-10-30 00:41:26 +00:00
hannken a92696acd1 More __unused (NPCPPI == 0 case). 2006-10-13 10:09:36 +00:00
dogcow 64d163c11c de-__Pify, ANSIfy, and add __unused where necessary. 2006-10-12 19:28:47 +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
cube 886e1e7f71 Fix thinko about CPUID(0x80000000). 2006-10-08 15:51:30 +00:00
dogcow 1d235c3fdc add initializers so gcc stops whining. 2006-10-06 03:52:53 +00:00
yamt 199c49bccb handle_wedges: fix a typo. (NOCREAD -> NOCRED) 2006-10-06 02:29:08 +00:00
martin fab4ae4892 I can not test this right now, but the equivalent change was needed on
sparc64 to make root on raid shutdown cleanly: after using opendisk()
and querying wedges, we need to VOP_CLOSE() the resulting vnode.
2006-10-05 22:43:35 +00:00
cube c72f004e7c Rework the way PowerNow! and Cool'n'Quiet features are detected and
displayed, to make the code much simpler and easier to follow.  Also, use
bitmask_printf() to make output consistent with other stuff.  Use
CPUID2FAMILY() where appropriate.
2006-10-04 13:18:10 +00:00
bouyer 020e3d1ae1 Add ipmi(4) driver, from OpenBSD. This requires SMBios support, so add
SMBios detection and mapping to bios32.c, also from OpenBSD (for now this
is only compiled in if ipmi(4) is configured). The sensors and watchdog are
accessible though envsys(4).
Works on i386; some work is needed on amd64 to access the BIOS. It would
eventually work on Xen if the SMBios is accessible (to be tested).
2006-10-01 18:37:54 +00:00
martin ebaf1420c5 If using NLAPIC, we better include lapic.h. Pointed out by Kurt Schreiner
on current-users.
2006-09-29 11:18:44 +00:00
bouyer e2d271e26c - make it possible to have ACPI without IOAPIC and/or LAPIC
- make it possible for machine-specific code to provide custom R/W routines
  in its i82093*.h headers
- always initialize sc->sc_pins[pin], even in the !ioapic_cold case.
No objections on port-i386 and port-amd64.
2006-09-28 18:01:24 +00:00
cube 4a5ad09e72 This is again that time of the millenium where we have to crank up a few
static limits to meet modern bloat requirements.

VM_PHYSSEG_MAX needs it to run on Intel's D946GZIS motherboard, as reported
by rix on #NetBSD-code on freenode.  This has a consequence on the initial
number of possible extent allocations for iomem_ex, so increase that value
too.

While there, clarify the action to be taken when VM_PHYSSEG_MAX is maxed
out.

Do that on both amd64 and i386 because the causes, the effects and the code
are mostly the same.
2006-09-27 17:10:34 +00:00
xtraeme 6308f92920 Protect opt_powernow_k7.h with ifdef i386, I forget that it's only
available on i386...
2006-09-23 18:43:56 +00:00
fvdl 807fde634b While the low-level trigger and polarity values are the same for
ACPI and MPS, the ACPICA values are different. Convert them,
so that we get the right values into the ioapic.
2006-09-23 17:16:38 +00:00
fvdl 437e91d597 Check for the bad irq0 override quirk. 2006-09-23 17:08:43 +00:00
xtraeme 5e0b4be127 Do not use the TSC in POWERNOW_K[78] case (same behaviour than
enhanced speedstep), closes PR port-amd64/34550.
2006-09-23 16:18:06 +00:00
gdamore 229365fda3 Use common todr_settime_ymdhms/gettime_ymdhms.
While here, fix an incorrect test for timeset (that's in kern_todr already),
and an incorrect to time_second (instead of using the date passed in).
2006-09-07 00:18:50 +00:00
gdamore a37acb1b52 Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
2006-09-04 23:45:30 +00:00
perry e2420ca184 Undo static declaration on gettick -- lapic.c uses it.
Pointed out by Geoff Wing (mason at primenet.com.au)
2006-09-04 03:07:52 +00:00
perry 225449e795 switch to a common clock.c 2006-09-04 02:16:03 +00:00
christos 0b7c79ac7b add missing initializers 2006-09-03 07:00:48 +00:00
xtraeme 7658c6d89f Update the enhanced speedstep driver and sync the code with OpenBSD:
est.c:

* Use a quintuplet (vendor, MHz_hi, mV_hi, MHz_lo, mV_lo } to match
  CPUs more correctly than parsing the brand string.
* Add support for a bunch of models.
* Create a fake table on the fly if the CPU is unknown (there's no
  table for it) with the current/highest/lowest frequency.

specialreg.h:

* Add some MSRs needed to get the bus clock value.

identcpu.c:

* Add functions specific to Pentium III, Pentium M and Pentium 4 to
  get the bus clock value.

Note that the new fake table code from Simon Burge is not included on
this commit.

Ok'ed by simonb and dogcow.
2006-09-03 06:49:57 +00:00
christos d5d864694f avoid empty else. 2006-09-03 04:55:30 +00:00
xtraeme 1d143cb5ae - Remove k8pnow_read_pending_wait() and use a macro that _always_
will wait for the bit pending wait to be cleared. When this bit is
  cleared the CPU is ready to enter to new processor state. [1]
- Remove useless comments.
- Sync boot messages with est.c

[1] Macro taken from FreeBSD.

And new changes tested by elad.
2006-09-02 11:00:52 +00:00
christos 25097e66ef Add missing initializers 2006-09-02 07:16:41 +00:00
bouyer aeeb0b33ca Some bus_dma(9) fixes for Xen:
- Attempt to gracefully recover from a failed decrease_reservation or
  increase_reservation, by avoiding physical memory loss.
- always store a machine address in ds_addr; this avoids some mistakes
  where machine address would in some case be freed at physical address, or
  mapped as physical address.
2006-08-28 19:58:56 +00:00
christos 67e07ec558 Add missing initializers 2006-08-28 00:20:47 +00:00
xtraeme ca450bca52 Update powernow module with POWERNOW_K7 and POWERNOW_K8 support.
Works fine on amd64 cpus running in 32-bit mode.

Tested by Joel Carnat.
2006-08-27 10:10:55 +00:00
christos bcecf5d797 Fix previous thinko. 2006-08-27 04:31:55 +00:00
christos fddb23d3e2 Fix reversed test 2006-08-27 04:16:33 +00:00
christos 5bb209df43 Wedges don't have partitions. 2006-08-27 04:11:45 +00:00
xtraeme 18199bb695 Be a little less agressive in declaring the change pending bit stuck,
increase the number of retries by two orders of magnitude wont affect
most systems but will make transitions smoother on marginal ones.

From gwk@openbsd.
2006-08-26 10:10:00 +00:00
cube d4c4e962c9 Display XD for Intel processors (Execution Disable bit support). 2006-08-24 12:55:46 +00:00
xtraeme 9af57310fe - Move k7_powernow_* prototypes from i386/include/cpu.h to
x86/include/powernow.h
- Protect k[78]_powernow_init() functions with #ifdef POWERNOW_K[78] to
  make it build without these options.

This fixes the problem reported by hubertf.
2006-08-23 22:59:45 +00:00
jmcneill ac96fed0c2 No longer try to attach unichromefb as an initial console device. 2006-08-13 20:22:27 +00:00
christos 5afff5edf4 Fix missing initialization of tmpvn; thanks gcc. 2006-08-13 00:56:37 +00:00
christos cf1ddb6596 - Check if a disk has wedges, and use the wedge device corresponding to the
root partition, instead of punting. This makes booting work
  with traditional disklabel disks and wedge autoconfiguration.
- factor out disk opening code.
2006-08-12 21:45:22 +00:00
christos e43176da19 add dk. 2006-08-12 19:55:42 +00:00
christos f96e7c6a82 Revert previous borken change. 2006-08-12 19:15:19 +00:00
fvdl 3a0f71ac74 Make sure to override the trigger variable with IST_LEVEL, as well
as the ioapic flags, in the case of an ACPI interrupt without
override.
2006-08-12 16:20:58 +00:00
fvdl 9558563497 Record the ACPI global int in the interrupt structure for ISA interrupt
overrided (e.g. the SCI interrupt), so that it may be found correctly by
the ACPI interrupt establish function, should the number be different
from the original source.
2006-08-12 16:19:13 +00:00
xtraeme f0c9466074 Update license. I've been talking with Martin Vegiard (original author)
and he wanted to move his license to TNF, make it so.
2006-08-10 17:24:10 +00:00
xtraeme c822683a97 Attach the "available" node under "frequency". Thanks to Robert Swindells. 2006-08-08 20:13:27 +00:00
cube f48480c398 files.x86 isn't included by Xen kernels, so opt_powernow_k8.h never gets
created by config(1), and thus it's not safe to use it in cpuvar.h.

Simply declare the prototype for k8_powernow_init in powernow.h.  No need
to #ifdef protect a prototype, after all, only its users.

Un-breaks build of Xen kernels.
2006-08-08 16:34:34 +00:00
xtraeme a4a1d218d3 * Do not change struct powernow_pst_s (I added another member in my
previous patch) and this MUST be of that size, otherwise the tables
  won't be found.

* powernow_k8.c moved into x86/x86, it should work both i386 and amd64.

* Added more DPRINTFs needed to found the first problem.

* Create "machdep.powernow.frequency" again, I can't remember why I
  removed frequency... it should work with estd now.

* Do not try to call k[78]_powernow_init() if cpu is not AMD (thanks
  to christos).

And more things I can't remember, but this time it will work in
Athlon 64 cpus and it won't crash in EM64T cpus.
2006-08-07 20:58:23 +00:00