Commit Graph

195 Commits

Author SHA1 Message Date
Nate Lawson
3ed1dfa11d Update for acpi_id_probe() 2004-06-29 19:05:20 +00:00
Warner Losh
15442f461b Use APM_UNKNOWN instead of 0xff. Use ~0U instead 0 for the number of
batteries.  This should be -1 to match other code, but since the api
is unsigned ~0U is the same thing.
2004-06-28 02:38:20 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Nate Lawson
591b993b83 s/device_get_handle/acpi_get_handle
Submitted by:	Hiroyuki Aizu
2004-06-15 16:49:20 +00:00
Nate Lawson
f6c8318b0f Catch one more use of acpi_MatchHid and update for new API. 2004-06-15 02:17:23 +00:00
Nate Lawson
7a15653c9c Use the new API for acpi_MatchHid(). The difference between ACPI_HANDLE
and device_t isn't caught by the compiler.
2004-06-14 03:40:56 +00:00
John Baldwin
bad4ce7d91 - Use the correct devclass name ("acpi" vs "ACPI") to detect if acpi0 is
present and thus that the PnPBIOS probe should be skipped instead of
  having ACPI zero out the PnPBIOStable pointer.
- Make the PnPBIOStable pointer static to i386/i386/bios.c now that that is
  the only place it is used.
2004-06-10 20:43:04 +00:00
John Baldwin
a916fdf6ad Completely ignore disabled CPU entries as their APIC IDs tend to be
invalid.
2004-06-10 20:03:46 +00:00
John Baldwin
405747db0b Use the local APIC ID rather than the ACPI Processor ID to index the array
of CPUs since local APIC IDs are bounded but ACPI IDs are not bounded.
2004-06-01 19:49:38 +00:00
Poul-Henning Kamp
77409fe148 Add missing #include <sys/module.h> 2004-05-30 20:34:58 +00:00
John Baldwin
175af5d978 Fixup a few bogons in a comment. 2004-05-11 20:06:32 +00:00
John Baldwin
eb8943b13e Rework the APIC mixed mode support a bit:
- Require the APIC enumerators to explicitly enable mixed mode by calling
  ioapic_enable_mixed_mode().  Calling this function tells the apic driver
  that the PC-AT 8259A PICs are present and routable through the first I/O
  APIC via an ExtINT pin.  The mptable enumerator always calls this
  function for now.  The MADT enumerator only enables mixed mode if the
  PC-AT compatability flag is set in the MADT header.
- Allow mixed mode to be enabled or disabled via a 'hw.apic.mixed_mode'
  tunable.  By default this tunable is set to 1 (true).  The kernel option
  NO_MIXED_MODE changes the default to 0 to preserve existing behavior, but
  adding 'hw.apic.mixed_mode=0' to loader.conf achieves the same effect.
- Only use mixed mode to route IRQ 0 if it is both enabled by the APIC
  enumerator and activated by the loader tunable.  Note that both
  conditions must be true, so if the APIC enumerator does not enable mixed
  mode, then you can't set the tunable to try to override the enumerator.
2004-05-10 18:49:58 +00:00
John Baldwin
0fd166d7da - Change madt_map_table() to verify the checksum of any table it is asked
to map.  If the checksum fails, the table is unmapped and a NULL pointer
  returned.
- For ACPI version >= 2.0, check the extended checksum of the RSDP.
  AcpiOsGetRootPointer() already checks the version 1.0 checksum.
- Remap the full MADT table at the end of madt_probe() so that we verify
  its checksum before saying it is really there.

Requested by:	njl
2004-05-10 18:33:08 +00:00
Nate Lawson
869ec176fc Make unnecessary globals static and remove unused includes.
Pointed out by:	cscout
2004-05-06 02:18:58 +00:00
Nate Lawson
c6c9ee90fb Style cleanups, u_intXX -> uintXX. 2004-05-05 19:51:15 +00:00
John Baldwin
635af77a22 Have ACPI use BUS_CONFIG_INTR() to force the SCI to level trigger and
active low polarity when using the PIC interrupt model.  This should fix
broken SCI interrupts on machines when not using the APIC where the BIOS
doesn't program the ELCR to level trigger for the ACPI SCI.

Requested by:	njl
2004-05-04 21:04:24 +00:00
John Baldwin
c2ce35977e - Change the APIC code to mostly use the recently added intr_trigger
and intr_polarity enums for passing around interrupt trigger modes and
  polarity rather than using the magic numbers 0 for level/low and 1 for
  edge/high.
- Convert the mptable parsing code to use the new ELCR wrapper code rather
  than reading the ELCR directly.  Also, use the ELCR settings to control
  both the trigger and polarity of EISA IRQs instead of just the trigger
  mode.
- Rework the MADT's handling of the ACPI SCI again:
  - If no override entry for the SCI exists at all, use level/low trigger
    instead of the default edge/high used for ISA IRQs.
  - For the ACPI SCI, use level/low values for conforming trigger and
    polarity rather than the edge/high values we use for all other ISA
    IRQs.
  - Rework the tunables available to override the MADT.  The
    hw.acpi.force_sci_lo tunable is no longer supported.  Instead, there
    are now two tunables that can independently override the trigger mode
    and/or polarity of the SCI.  The hw.acpi.sci.trigger tunable can be
    set to either "edge" or "level", and the hw.acpi.sci.polarity tunable
    can be set to either "high" or "low".  To simulate hw.acpi.force_sci_lo,
    set hw.acpi.sci.trigger to "level" and hw.acpi.sci.polarity to "low".
    If you are having problems with ACPI either causing an interrupt storm
    or not working at all (e.g., the power button doesn't turn invoke a
    shutdown -p now), you can try tweaking these two tunables to find the
    combination that works.
2004-05-04 20:39:24 +00:00
Philip Paeps
647e5349ec Enable the led-toggling magic. Compiling files which are in the kernel into
modules is a very nice way to produce hard-to-find panics.  Who would look for
a bug in a Makefile anyway?

Has anyone seen the pointy hat? :-o

Approved by:	njl (mentor)
2004-04-23 17:41:05 +00:00
Philip Paeps
9a1fc77e3a Add the ACPI Asus extras driver. Provides support for cool ACPI-controled
gadgets (hotkeys, lcd, ...) on Asus laptops.  I aim to closely track the
acpi4asus project which implements these features in the Linux kernel.

If this breaks your laptop, please let me know how it does it :-)

Approved by:	njl (mentor)
2004-04-22 21:29:02 +00:00
Nate Lawson
8ec94874b2 Don't check for NULL, device_get_softc() always succeeds. 2004-04-21 02:10:58 +00:00
John Baldwin
f203f177f4 Revert part of the "BIOS brain damage" from rev 1.10. It seems that
different BIOSs use the same exact settings to mean two very different and
incompatible things for the SCI.  Thus, if the SCI is remapped to a PCI
interrupt, we now trust the trigger/polarity that the MADT provides by
default.  However, the SCI can be forced to level/lo as 1.10 did by setting
the tunable "hw.acpi.force_sci_lo" to a non-zero value from the loader.

Thus, if rev 1.10 caused an interrupt storm, it should nwo fix your
machine.  If rev 1.10 fixed an interrupt storm on your machine, you
probably need to set the aforementioned tunable in /boot/loader.conf to
prevent the interrupt storm.

The more general problem of getting the SCI's trigger/polarity programmed
"correctly" (for some value of correctly meaning several workarounds for
broken BIOSs and inconsistent "implementations" of the ACPI standard) is
going to require more work, but this band-aid should improve the current
situation somewhat.

Requested by:	njl
2004-04-16 19:46:30 +00:00
Nate Lawson
96d340f27d Use METHOD_VIDEO instead of the method string itself.
Pointed out by:	Andrew Thompson
2004-04-14 03:32:01 +00:00
Nate Lawson
0287be96bf Add support for video output switching. It appears no systems use HCI to
change the video output but use a separate device with a DSSX method
and a HID of "TOS6201" instead.  We use a pseudo-driver to get the handle
for this object and pass it to the acpi_toshiba driver.

This is untested but seems to match the Linux Toshiba driver.
2004-04-14 00:23:58 +00:00
Dag-Erling Smørgrav
242c1bb631 Use headers from the kernel source tree rather than installed headers.
Submitted by:	ru
2004-04-13 13:43:11 +00:00
Nate Lawson
a4ecd54325 Unify on version 1 to be similar to the rest of the tree. After 5-stable
branches, increment version on any API change visible to other modules.
2004-04-08 16:45:12 +00:00
Tom Rhodes
a122cca953 These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
 - in_cksum.[ch]:
   * use a generic C version instead of the assembly version in the !gcc
     case (ASM code breaks with the optimizations icc does)
     -> no bad checksums with an icc compiled kernel
     Help from:		andre, grehan, das
     Stolen from: 	alpha version via ppc version
     The entire checksum code should IMHO be replaced with the DragonFly
     version (because it isn't guaranteed future revisions of gcc will
     include similar optimizations) as in:
        ---snip---
          Revision  Changes    Path
          1.12      +1 -0      src/sys/conf/files.i386
          1.4       +142 -558  src/sys/i386/i386/in_cksum.c
          1.5       +33 -69    src/sys/i386/include/in_cksum.h
          1.5       +2 -0      src/sys/netinet/igmp.c
          1.6       +0 -1      src/sys/netinet/in.h
          1.6       +2 -0      src/sys/netinet/ip_icmp.c

          1.4       +3 -4      src/contrib/ipfilter/ip_compat.h
          1.3       +1 -2      src/sbin/natd/icmp.c
          1.4       +0 -1      src/sbin/natd/natd.c
          1.48      +1 -0      src/sys/conf/files
          1.2       +0 -1      src/sys/conf/files.amd64
          1.13      +0 -1      src/sys/conf/files.i386
          1.5       +0 -1      src/sys/conf/files.pc98
          1.7       +1 -1      src/sys/contrib/ipfilter/netinet/fil.c
          1.10      +2 -3      src/sys/contrib/ipfilter/netinet/ip_compat.h
          1.10      +1 -1      src/sys/contrib/ipfilter/netinet/ip_fil.c
          1.7       +1 -1      src/sys/dev/netif/txp/if_txp.c
          1.7       +1 -1      src/sys/net/ip_mroute/ip_mroute.c
          1.7       +1 -2      src/sys/net/ipfw/ip_fw2.c
          1.6       +1 -2      src/sys/netinet/igmp.c
          1.4       +158 -116  src/sys/netinet/in_cksum.c
          1.6       +1 -1      src/sys/netinet/ip_gre.c
          1.7       +1 -2      src/sys/netinet/ip_icmp.c
          1.10      +1 -1      src/sys/netinet/ip_input.c
          1.10      +1 -2      src/sys/netinet/ip_output.c
          1.13      +1 -2      src/sys/netinet/tcp_input.c
          1.9       +1 -2      src/sys/netinet/tcp_output.c
          1.10      +1 -1      src/sys/netinet/tcp_subr.c
          1.10      +1 -1      src/sys/netinet/tcp_syncache.c
          1.9       +1 -2      src/sys/netinet/udp_usrreq.c

          1.5       +1 -2      src/sys/netinet6/ipsec.c
          1.5       +1 -2      src/sys/netproto/ipsec/ipsec.c
          1.5       +1 -1      src/sys/netproto/ipsec/ipsec_input.c
          1.4       +1 -2      src/sys/netproto/ipsec/ipsec_output.c

          and finally remove
            sys/i386/i386        in_cksum.c
            sys/i386/include     in_cksum.h
        ---snip---
 - endian.h:
   * DTRT in C++ mode
 - quad.h:
   * we don't use gcc v1 anymore, remove support for it
   Suggested by:	bde (long ago)
 - assym.h:
   * avoid zero-length arrays (remove dependency on a gcc specific
     feature)
     This change changes the contents of the object file, but as it's
     only used to generate some values for a header, and the generator
     knows how to handle this, there's no impact in the gcc case.
   Explained by:	bde
   Submitted by:	Marius Strobl <marius@alchemy.franken.de>
 - aicasm.c:
   * minor change to teach it about the way icc spells "-nostdinc"
   Not approved by:	gibbs (no reply to my mail)
 - bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by:	-arch
Submitted by:	netchild
2004-03-12 21:45:33 +00:00
Nate Lawson
3184cf5a6b Add support for quirks for acpi tables. Key off OEM vendor and revision.
Sort acpi debug values.  Change "disable" to "disabled" to match rest of
the kernel.  Remove debugging from acpi_toshiba since it was only used for
probe/attach.
2004-03-03 03:02:17 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
John Baldwin
afa632035c - Call acpi_Startup() before parsing interrupt-related APIC resources so we
can look at the ACPI tables.  If the startup fails, we panic and tell the
  user to try rebooting with ACPI disabled.  Previously in this case we
  would try to use $PIR interrupt routing which only works for the atpic
  while using the apic to handle interrupts which would result in misrouted
  interrupts and a hang at boot time with no error message.
- Read the SCI out of the FADT instead of hardcoding 9 when checking to see
  if an interrupt override entry is for the SCI.
- Try to work around some BIOS brain damage for the SCI's programming by
  forcing the SCI to be level triggered and active low if it is routed
  to a non-ISA interrupt (greater than 15) or if it is identity mapped with
  edge trigger and active high polarity.  This should fix some of the hangs
  with device apic and ACPI that some people see.

Reviewed by:	njl
2004-01-26 19:34:24 +00:00
Nate Lawson
b9585d5e60 Only remove the handler if we installed it. 2004-01-12 19:35:31 +00:00
Nate Lawson
1114c59266 Clean up the probe message and sort the function table according to
the function order in the file.
2004-01-12 06:55:50 +00:00
Nate Lawson
65c0f49140 Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-11 19:18:39 +00:00
Nate Lawson
0906e0c58f Use <machine/asmacros.h> since <machine/asm.h> is a userland-only header
and gives very wrong macros for ENTRY(), etc. for kernel programs.

PR:
Suggested by:	bde
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-01 22:57:22 +00:00
Nate Lawson
cac6460cfe Use the ACPI-CA definitions for the various APIC tables instead of our
own.
2003-12-09 03:04:19 +00:00
John Baldwin
6afad3b055 - Reorder the APIC enumerator SYSINIT's to register enumeators at
SI_SUB_CPU - 1 and probe enumerators, probe CPUs, and setup the local
  APIC programming all at SI_SUB_CPU / SI_ORDER_FIRST.  This is needed to
  help get the ACPI module working again as it moves the APIC enumeration
  code after SI_SUB_KLD.
- In the MADT parser, use mp_maxid rather than MAXCPU to terminate a loop
  when assigning per-cpu ACPI IDs to avoid a dependency on 'options SMP'.
- Allow the apic device to be disabled via 'hint.apic.0.disabled' from the
  loader.  Note that since this is done in the local APIC code, it works
  for both the ACPI and non-ACPI cases.

Approved by:	re (scott / blanket)
2003-12-03 20:33:18 +00:00
Peter Wemm
ad641f0fd5 Minor source sync with amd64. For %.*s printf formats, pass in an
int rather than a size_t.  cast the ioapicaddress variable via
uintptr_t before going to void *.
2003-11-14 22:26:29 +00:00
John Baldwin
d3c01334ce Some motherboards like to remap the SCI (normally IRQ 9) up to a PCI
interrupt such as IRQ 22 or 19.  However, the ACPI BIOS still routes
interrupts from some PCI devices to the same intpin calling the pin
IRQ 22.  Thus, ACPI expects to address a single interrupt source via two
different names.  To work around this, if the SCI is remapped to a non-ISA
interrupt (i.e., greater than 15), then we use
acpi_OverrideInterruptLevel() function to tell ACPI to use IRQ 22 or 19
rather than IRQ 9 for the SCI.

Previously we would change IRQ 22 or 19's name to IRQ 9 when we encountered
such an Interrupt Source Override entry in the MADT which routed the SCI
properly but left PCI devices mapped to IRQ 22 or 19 w/o a routable
interrupt.

Tested by:	sos
2003-11-11 18:20:10 +00:00
John Baldwin
95020215db Bump APIC ID limits up to 32 since a machine with 16 CPUs will have APIC
IDs for the I/O APICs that are greater than 16.

Reported by:	John Cagle <john.cagle@hp.com>
2003-11-10 19:52:58 +00:00
John Baldwin
8dec768242 Only disable the old pin when doing a remap if it's current vector is still
the old vector.

Reported by:	sam
2003-11-06 14:47:53 +00:00
John Baldwin
f84d8b318a When remapping an ISA interrupt from one intpin to another, disable the
pin that is used by the default identity mapping if it still maps to the
old vector.  The ACPI case might need some tweaking for the SCI interrupt
case since ACPI likes to address the intpin using both the IRQ remapped to
it as well as the previous existing PCI IRQ mapped to it.

Reported by:	kan
2003-11-05 23:15:52 +00:00
Peter Wemm
93c3f67fe7 Make this compile with PAE. 2003-11-04 01:07:04 +00:00
John Baldwin
72e7f9b04a - Update includes.
- Use intr_suspend/resume() callouts to the interrupt code layer which
  suspends and resumes all the known interrupt sources instead of calling
  icu_reinit() directly.
2003-11-03 22:18:57 +00:00
John Baldwin
ab089945d3 Add the ACPI MADT table APIC enumerator. This code uses the ACPI Multiple
APIC Descriptor Table to enumerate both I/O APICs and local APICs.  ACPI
does not embed PCI interrupt routing information in the MADT like the MP
Table does.  Instead, ACPI stores the PCI interrupt routing information
in the _PRT object under each PCI bus device.  The MADT table simply
provides hints about which interrupt vectors map to which I/O APICs.  Thus
when using ACPI, the existing ACPI PCI bridge drivers are sufficient to
route PCI interrupts.
2003-11-03 22:17:44 +00:00
Nate Lawson
00295e7473 Fix the logic to match the new name of the tunable.
Pointed out by:	iwasaki
2003-11-01 01:05:53 +00:00
Nate Lawson
cc65a50cc5 Change the reset video option to be positive (hw.acpi.reset_video).
Requested by:	jhb

Initialize the real mode stack.  This is needed at least for the return
address from the lcall.
Requested by:	takawata

Fix style bugs in acpi_wakecode.S
Requested by:	bde

Remove the kernel option now that we have the tunable.
2003-11-01 00:18:29 +00:00
Mitsuru IWASAKI
fbbdf7c7d2 Add sysctl MIB and loader tunable `hw.acpi.no_reset_video' as
the same effect as ACPI_NO_RESET_VIDEO kernel option.
2003-10-30 16:14:55 +00:00
Mitsuru IWASAKI
92781c3567 Add kernel option ACPI_NO_RESET_VIDEO as workaround for problems
(e.g. LCD white-out after resume) on some machine cased by
re-initialize video BIOS code in acpi_wakecode.
2003-10-29 03:30:45 +00:00
Nate Lawson
450b6ff66f Call the VESA reset BIOS vector on the resume path. This may help displays
after resume.  I have not found it to break anything.
2003-10-27 06:26:51 +00:00
Alan Cox
f3fd831cdd - Eliminate the pte object.
- Use kmem_alloc_nofault() rather than kmem_alloc_pageable() to allocate
   KVA space for the page directory page(s).  Submitted by: tegge
2003-09-25 02:51:06 +00:00
Mitsuru IWASAKI
d099a9d164 Add final adjustment code of battery status based on the battery capacity
rather than returning unknown status.
2003-09-17 08:47:39 +00:00
John Baldwin
a7321ecb19 Finish an earlier commit:
Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.
2003-09-10 05:29:30 +00:00
Nate Lawson
bf10d4f8c4 Don't disable interrupts a second time. Remove an extraneous interrupt
enable (that happens elsewhere).  Clarify the interrupt disabling point
by using ACPI_DISABLE_IRQS().

Tested by:	Kevin Oberman
2003-09-08 06:22:54 +00:00
Nate Lawson
ad1fdf57d2 Use the ACPICA AcpiEnterSleepStateS4bios instead of rolling our own. This
change also disables interrupts around non-S4 suspends whereas before we
did not do this.  Our version of AcpiEnterSleepStateS4bios was almost
identical to the ACPICA version.
2003-08-29 04:02:19 +00:00
Nate Lawson
cacbbaa703 Style cleanups. 2003-08-28 16:26:24 +00:00
Nate Lawson
a7985e4feb Use ACPI_FLUSH_CPU_CACHE() instead of wbinvd(). Verified .o with md5.
Pointed out by:	Mark Santcroos <marks@ripe.net>
2003-07-30 17:20:33 +00:00
Peter Wemm
5d2fc474c5 Commit Ian Dowse's workaround for acpi resume resetting after the
LAZY_SWITCH changes.  He pointed out the acpi code sets up an identity
mapping in the current vmspace and that got messed up by the %cr3 being
out of sync with the current page directory.  As a workaround, restore
%cr3 across the sleep/resume.  A more complete fix would be to undo the
lazy state and clear the pm_active bit from the borrowed pmap, but this
works and people are currently hurting.  I'll clean this up.
This is mostly Ian's patch, plus a PAE tweak from me.
2003-07-21 20:59:27 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
David E. O'Brien
cef2a2e364 Use __FBSDID(). 2003-06-02 06:16:45 +00:00
John Baldwin
dea7cce585 Add some extra #ifdef stubs so that this compiles on 4.8.
Approved by:	re (rwatson/bmah)
2003-05-13 16:59:46 +00:00
Jake Burkholder
227f9a1c58 - Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
  with PAE.
- Use this to represent physical addresses in the MI vm system and in the
  i386 pmap code.  This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
  detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by:	DARPA, Network Associates Laboratories
Discussed with:	re, phk (cdevsw change)
2003-03-25 00:07:06 +00:00
Matthew N. Dodd
b7b5ae3edb Use repo-copied files in sys/i386/bios. 2003-03-24 19:14:46 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Marcel Moolenaar
91c71b46ed Export the physical address of the RSDP to userland by means
of the `machdep.acpi_root' sysctl. This is required on ia64
because the root pointer hardly ever, if at all, lives in the
first MB of memory and also because scanning the first MB of
memory can cause machine checks.
This provides a save and reliable way for ACPI tools to work
with the tables if ACPI support is present in the kernel. On
ia64 ACPI is non-optional.
2002-12-18 08:47:07 +00:00
Alan Cox
a597332c22 Hold the page queues lock around calls to pmap_remove().
Approved by:	re
2002-12-04 18:40:39 +00:00
Mitsuru IWASAKI
87b45ed576 Add `if (!cold)' checkings for functions which is called via SYSINIT.
Loading acpi.ko with kldload is disallowed, however some
functions were executed unexpectedly.

Approved by:	re
2002-11-24 02:27:07 +00:00
John Baldwin
ebff7660a3 *sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IO
macro for use when parsing MADT tables, thus we always tried to set the
interrupt model to APIC.  This proved to be harmful on UP machines with
IO APIC's (or for UP kernels on SMP machines) since the wrong interrupt
routing information would be returned.

Pointy hat to:	jhb
Approved by:	re (rwatson)
2002-11-21 20:55:22 +00:00
John Baldwin
90fa95e81d - curproc may be NULL in 4-stable. In that case use the vmspace from
proc0.
- Remove unused include.

Sponsored by:	The Weather Channel
2002-10-16 17:22:03 +00:00
John Baldwin
42233ad3af Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get the
definition of struct selinfo.

Sponsored by:	The Weather Channel
2002-10-16 17:20:43 +00:00
John Baldwin
6b4d1b08a2 Use d_thread_t for cdevsw functions instead of struct thread * so that it
is easier to share this code with 4-stable.
2002-10-09 20:39:26 +00:00
John Baldwin
31a51bf683 Trash the PnPBIOStable pointer later on when we know that the acpi probe
and attach routines have succeeded so that if they fail we can still use
the PnP BIOS to find ISA on-board devices.  The fact that we do this here
is gross but fixing it properly involves a lot more work.
2002-09-30 18:45:20 +00:00
Mark Murray
c7c7312f2c Wrap GCC-specific asm() code in #ifdef __GNUC__ 2002-09-21 18:19:51 +00:00
John Baldwin
d3b9beba04 If we are using APIC_IO tell ACPI so it can route interrupts properly.
This still doesn't work quite right because of other APIC_IO hacks in
the i386 PCI code.
2002-09-06 17:02:01 +00:00
Archie Cobbs
4a6a94d8d8 Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
Mitsuru IWASAKI
be14b8e7ea Improve stack manipulation code of ACPI wakeup routine.
The new code just override stack top value with saved return address
rather than pop/push operation.

Submitted by:	jhb
2002-08-07 12:48:28 +00:00
Mitsuru IWASAKI
6a7ef08763 Fix a bug about stack manipulation at ACPI wakeup.
This should avoid kernel panic on kernel compiled w/o
NO_CPU_COPTFLAGS.

Suggested by:	optimized code by -mcpu=pentiumpro
2002-08-01 09:48:01 +00:00
Mitsuru IWASAKI
74fc979a09 Resolve conflicts arising from the ACPI CA 20020404 import. 2002-06-30 17:53:12 +00:00
Peter Wemm
b2604e1cf1 Make this compile with gcc-3.1, which objects to the multi-line string. 2002-05-19 06:42:29 +00:00
Peter Wemm
59d72e9d82 Makefile uses genwakecode.sh now. 2002-05-02 22:17:35 +00:00
Peter Wemm
47a45d1b17 Try using genwakecode.sh instead of the perl version. 2002-05-01 21:54:07 +00:00
Peter Wemm
9b4e33b6ba Add a shell script to do what genwakecode.pl does.
Obtained from:	ade
2002-05-01 21:52:34 +00:00
Wes Peters
9539704639 Fix typo in function name.
Reviewed by:	peter@
Obtained from:	mux@sneakerz.org
2002-01-10 03:26:46 +00:00
Takanori Watanabe
89b8315762 Fix S3 breakage.
Now AcpiEnterSleep() is light enough, so flushing cache
before the function is not too early.
2002-01-09 16:00:31 +00:00
Mike Smith
3273b00523 Staticise devclasses and some unnecessarily global variables. 2002-01-08 06:46:01 +00:00
Mitsuru IWASAKI
430f5c92b6 Yet another verbose printing cleanup. Remove debug_wakeup flag and
check common verbose flag instead.
2001-11-18 18:48:31 +00:00
Mitsuru IWASAKI
9c4223b4b6 Add two minor changes.
- clean up wakeup routing fixup code by using macros.
 - allocate pte object temporary for kernel thread to avoid kernel
   panic by events from sleep button or lid switch.
2001-11-11 15:51:30 +00:00
Mitsuru IWASAKI
1611ea8727 Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support.
- Add S4BIOS sleep implementation.  This will works well if MIB
   hw.acpi.s4bios is set (and of course BIOS supports it and hibernation
   is enabled correctly).
 - Add DSDT overriding support which is submitted by takawata originally.
   If loader tunable acpi_dsdt_load="YES" and DSDT file is set to
   acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml),
   ACPI CA core loads DSDT from given file rather than BIOS memory block.
   DSDT file can be generated by iasl in ports/devel/acpicatools/.
 - Add new files so that we can add our proposed additional code to Intel
   ACPI CA into these files temporary.  They will be removed when
   similar code is added into ACPI CA officially.
2001-11-06 15:00:30 +00:00
Mitsuru IWASAKI
f86214b6b8 Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.  The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
 - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
 - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)

Reviewed by:	arch@, audit@ and some guys
2001-10-26 17:43:05 +00:00
Mike Smith
42df599f7b Now that this code is MD, we don't need the i386 ifdefs. 2001-09-07 03:00:30 +00:00
Mitsuru IWASAKI
fbd49a7cfb Add `-I.' option to CFLAGS so that we can compile asm code together
with `-nostdinc' option.
2001-09-04 15:46:32 +00:00
Mitsuru IWASAKI
56d8cb57b9 Don't do sleep state transition if specified sleep state is not
supported by the system.
2001-07-22 19:13:54 +00:00
Mike Smith
bfae45aa43 Convert from acpi_strerror() to AcpiFormatException()
Fix dangling include of the dear departed acpi_ecreg.h
2001-07-21 10:24:37 +00:00
Mike Smith
9d839ea8e4 Update the OSD module to match the ACPI CA 20010717 import.
Submitted by:	"Grover, Andrew" <andrew.grover@intel.com> (OsdHardware.c)
2001-07-21 04:10:01 +00:00
Takanori Watanabe
6161544ca7 Add ACPI S2-S4BIOS Suspend/Resume code.
Some problems may remain.

Reviewed by:iwasaki
2001-07-20 06:07:34 +00:00
Mike Smith
fd660059d9 FreeBSD-specific OSD (operating system dependant) modules for the Intel
ACPICA code.
2000-10-28 06:56:15 +00:00