bitkeeper revision 1.1398 (427ba39bqKEbkdkvXR-PGTXrS0ed7w)

Merge http://xen.bkbits.net:8080/xeno-unstable.bk
into gandalf.hpl.hp.com:/var/bk/xeno-unstable.bk
This commit is contained in:
xenbk@gandalf.hpl.hp.com committed 2005-05-06 17:04:27 +00:00
commit 07f5335fa3
87 files changed
+7172 -20395

No files matched your search

+8 -28
View File
@@ -220,6 +220,9 @@
40f56237Mta0yHNaMS_qtM2rge0qYA linux-2.6.11-xen-sparse/arch/xen/i386/Kconfig
40f56238u2CJdXNpjsZgHBxeVyY-2g linux-2.6.11-xen-sparse/arch/xen/i386/Makefile
40f56238eczveJ86k_4hNxCLRQIF-g linux-2.6.11-xen-sparse/arch/xen/i386/kernel/Makefile
42778a68_kGyflDnRbar9WAmb4CKYw linux-2.6.11-xen-sparse/arch/xen/i386/kernel/acpi/Makefile
42778a68_2OruSz7lwFPBiGhl3y-FA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/acpi/boot.c
42778a69h76S5SCnDonnxnIt9nDGFQ linux-2.6.11-xen-sparse/arch/xen/i386/kernel/apic.c
40f56238rXVTJQKbBuXXLH52qEArcg linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/Makefile
40f562385s4lr6Zg92gExe7UQ4A76Q linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c
41ab440bnpxZdWShZrGgM9pPaz5rmA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/Makefile
@@ -227,10 +230,12 @@
40f56238XDtHSijkAFlbv1PT8Bhw_Q linux-2.6.11-xen-sparse/arch/xen/i386/kernel/entry.S
40f56238bnvciAuyzAiMkdzGErYt1A linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S
40f58a0d31M2EkuPbG94ns_nOi0PVA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c
42778a69_lodTzZVlojib1-pZF030g linux-2.6.11-xen-sparse/arch/xen/i386/kernel/io_apic.c
40faa751_zbZlAmLyQgCXdYekVFdWA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ioport.c
41d00d82zN8IfLBRxc7G_i7lbwT3cQ linux-2.6.11-xen-sparse/arch/xen/i386/kernel/irq.c
40f56238ue3YRsK52HG7iccNzP1AwQ linux-2.6.11-xen-sparse/arch/xen/i386/kernel/ldt.c
41d54a76YMCA67S8J-TBT3J62Wx6yA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/microcode.c
42778a69obEqvR75wSKCWPk9QnHo-w linux-2.6.11-xen-sparse/arch/xen/i386/kernel/mpparse.c
4107adf1cNtsuOxOB4T6paAoY2R2PA linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c
40f56238a8iOVDEoostsbun_sy2i4g linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c
40f56238YQIJoYG2ehDGEcdTgLmGbg linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c
@@ -251,7 +256,6 @@
41062ab7CjxC1UBaFhOMWWdhHkIUyg linux-2.6.11-xen-sparse/arch/xen/i386/mm/ioremap.c
40f5623906UYHv1rsVUeRc0tFT0dWw linux-2.6.11-xen-sparse/arch/xen/i386/mm/pgtable.c
4107adf12ndy94MidCaivDibJ3pPAg linux-2.6.11-xen-sparse/arch/xen/i386/pci/Makefile
4107adf1WcCgkhsdLTRGX52cOG1vJg linux-2.6.11-xen-sparse/arch/xen/i386/pci/direct.c
4107adf1s5u6249DNPUViX1YNagbUQ linux-2.6.11-xen-sparse/arch/xen/i386/pci/irq.c
40f56239zOksGg_H4XD4ye6iZNtoZA linux-2.6.11-xen-sparse/arch/xen/kernel/Makefile
40f56239bvOjuuuViZ0XMlNiREFC0A linux-2.6.11-xen-sparse/arch/xen/kernel/ctrl_if.c
@@ -296,6 +300,7 @@
424efaa629XgfZi3vvTAuQmhCqmvIA linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile
424efaa64SRL9FZhtQovFJAVh9sZlQ linux-2.6.11-xen-sparse/arch/xen/x86_64/pci/Makefile-BUS
41261688yS8eAyy-7kzG4KBs0xbYCA linux-2.6.11-xen-sparse/drivers/Makefile
42778a69QJ93x9p93ALrTV5QELHF-Q linux-2.6.11-xen-sparse/drivers/acpi/tables.c
4108f5c1WfTIrs0HZFeV39sttekCTw linux-2.6.11-xen-sparse/drivers/char/mem.c
4111308bZAIzwf_Kzu6x1TZYZ3E0_Q linux-2.6.11-xen-sparse/drivers/char/tty_io.c
40f56239Dp_vMTgz8TEbvo1hjHGc3w linux-2.6.11-xen-sparse/drivers/xen/Makefile
@@ -1227,10 +1232,7 @@
41aaf567a36esU-rUK7twPiv-yTFyw xen/arch/x86/mtrr/mtrr.h
41aaf567DcTL6pqVtLZJI5cSryyA1A xen/arch/x86/mtrr/state.c
3f12cff65EV3qOG2j37Qm0ShgvXGRw xen/arch/x86/nmi.c
3ddb79bdHe6_Uij4-glW91vInNtBYQ xen/arch/x86/pci-irq.c
3ddb79bcZ_2FxINljqNSkqa17ISyJw xen/arch/x86/pci-pc.c
3ddb79bdeJ7_86z03yTAPIeeywOg3Q xen/arch/x86/pci-x86.c
3ddb79bdIKgipvGoqExEQ7jawfVowA xen/arch/x86/pci-x86.h
4051bcecFeq4DE70p4zGO5setf47CA xen/arch/x86/physdev.c
3ddb79bc7KxGCEJsgBnkDX7XjD_ZEQ xen/arch/x86/rwlock.c
3ddb79bcrD6Z_rUvSDgrvjyb4846Eg xen/arch/x86/setup.c
405b8599xI_PoEr3zZoJ2on-jdn7iw xen/arch/x86/shadow.c
@@ -1274,7 +1276,6 @@
41a61536SZbR6cj1ukWTb0DYU-vz9w xen/common/multicall.c
3ddb79bdD4SLmmdMD7yLW5HcUWucXw xen/common/page_alloc.c
3e54c38dkHAev597bPr71-hGzTdocg xen/common/perfc.c
4051bcecFeq4DE70p4zGO5setf47CA xen/common/physdev.c
3ddb79bdHqdQpATqC0rmUZNbsb6L6A xen/common/resource.c
40589968dD2D1aejwSOvrROg7fOvGQ xen/common/sched_bvt.c
3e397e6619PgAfBbw2XFbXkewvUWgw xen/common/schedule.c
@@ -1285,50 +1286,29 @@
4203fb92Qcy7mGpauBdq09J-WAqfoA xen/common/xmalloc.c
3ddb79c0ppNeJtjC4va8j41ADCnchA xen/drivers/Makefile
40715b2bi9gU43-cYzlmPDgreYQchw xen/drivers/acpi/Makefile
40715b2bDxNCz5LFV8FAXihmYJZFUQ xen/drivers/acpi/acpi_ksyms.c
40715b2cNVOegtvyft_AHFKJYRprfA xen/drivers/acpi/tables.c
3e4a8cb7alzQCDKS7MlioPoHBKYkdQ xen/drivers/char/Makefile
4049e6bfNSIq7s7OV-Bd69QD0RpR2Q xen/drivers/char/console.c
3e4a8cb7nMChlro4wvOBo76n__iCFA xen/drivers/char/serial.c
3ddb79beUWngyIhMHgyPtuTem4o4JA xen/drivers/pci/Makefile
3ddb79beU9td0Mnm0VUMklerBa37qQ xen/drivers/pci/compat.c
3ddb79beHkGQE58z5t5gyUCYiwOxvw xen/drivers/pci/gen-devlist.c
3ddb79bfoQcFKLf5P6wZlDl36alWdQ xen/drivers/pci/names.c
3ddb79bfyX7-pD6XdxY_mdNrJR20iw xen/drivers/pci/pci.c
3ddb79bf2AS7YBGwooE_Kbv7XgUqNQ xen/drivers/pci/pci.ids
3ddb79bf7sTn85WtP_8Nc2YEmmVExQ xen/drivers/pci/quirks.c
3ddb79bfJaf0bkE1Y67bnll8-kjEPg xen/drivers/pci/setup-res.c
40715b2cFpte_UNWnBZW0Du7z9AhTQ xen/include/acpi/acconfig.h
40715b2cEQWX-PaxEH30qI48K1krnQ xen/include/acpi/acdebug.h
40715b2c_7j-oy3ZNAuqE3IFNPzArg xen/include/acpi/acdisasm.h
40715b2cFdcPx-2FHGM1Q-M-592xYQ xen/include/acpi/acdispat.h
40715b2cKqD_Lihnlmvnyl4AAl3EFw xen/include/acpi/acevents.h
40715b2ctNvVZ058w8eM8DR9hOat_A xen/include/acpi/acexcep.h
40715b2com8I01qcHcAw47e93XsCqQ xen/include/acpi/acglobal.h
40715b2cS1t4uI3sMsu-c0M4qqAIrw xen/include/acpi/achware.h
40715b2chSz545A4Tq-y3WAtanzPMQ xen/include/acpi/acinterp.h
40715b2cGf23lRI58NphiaDQl698-w xen/include/acpi/aclocal.h
40715b2cdG7tCF2NMk0j1RCQQPzPXg xen/include/acpi/acmacros.h
40715b2ckP2XZZDkSTehu6riuMogDA xen/include/acpi/acnamesp.h
40715b2c4AvHYn2-2YIyt3mx-Mm5tw xen/include/acpi/acobject.h
40715b2cPUXsHzmchvXx7QHAfW0nMw xen/include/acpi/acoutput.h
40715b2cNbYpt9CHmCHg3RG7fBdACA xen/include/acpi/acparser.h
40715b2cWM_6zR14U9Tp0s_q8D002A xen/include/acpi/acpi.h
40715b2dcJDTiROgyMk9swD_veWktA xen/include/acpi/acpi_bus.h
40715b2dRFlZK6apnH7WkUCBdyFXWA xen/include/acpi/acpi_drivers.h
40715b2dtgZhNGAzlyBMe3kqve3mqw xen/include/acpi/acpiosxf.h
40715b2dpW5TY7n5rzCufsDhJVWuMQ xen/include/acpi/acpixf.h
40715b2dp9-_D9LTjcvtf-Yopih5mQ xen/include/acpi/acresrc.h
40715b2djvd97KbIpt4wyJgxwqCqmg xen/include/acpi/acstruct.h
40715b2dRIU9cQgmTjtCRNleIJDAYg xen/include/acpi/actables.h
40715b2dy8ECRkSo9x0tRRueAjPx1g xen/include/acpi/actbl.h
40715b2ds4J-XWn9Ix-lgBiJffNgxw xen/include/acpi/actbl1.h
40715b2d_aMKMjKKNImJR4km52KRHA xen/include/acpi/actbl2.h
40715b2dxC03aemijgL-iDH_-BkKRw xen/include/acpi/actbl71.h
40715b2d0oQUijKwEw6SDJ4LhD8c4g xen/include/acpi/actypes.h
40715b2dBByvcAtRpN5mafyEYLcBWA xen/include/acpi/acutils.h
40715b2d_iPcZ0uUVGblPvjsHOwE5Q xen/include/acpi/amlcode.h
40715b2d3CdS6dIpZDTiCJRlDG3LCA xen/include/acpi/amlresrc.h
40715b2dKRW7A71SNaeV6zfrEzYxPw xen/include/acpi/platform/acenv.h
40715b2d8fYydJMcODFrV1ocLklGDg xen/include/acpi/platform/acgcc.h
40715b2d1yZkqyAt0kgx2xEwsatuuA xen/include/acpi/platform/aclinux.h
@@ -1390,6 +1370,7 @@
41a61536MFhNalgbVmYGXAhQsPTZNw xen/include/asm-x86/multicall.h
3ddb79c3xjYnrv5t3VqYlR4tNEOl4Q xen/include/asm-x86/page.h
3ddb79c3ysKUbxZuwKBRK3WXU2TlEg xen/include/asm-x86/pci.h
42422fb0FVX-TJkSvAXnbfwMf19XFA xen/include/asm-x86/physdev.h
3ddb79c2QF5-pZGzuX4QukPCDAl59A xen/include/asm-x86/processor.h
40cf1596bim9F9DNdV75klgRSZ6Y2A xen/include/asm-x86/regs.h
3ddb79c2plf7ciNgoNjU-RsbUzawsw xen/include/asm-x86/rwlock.h
@@ -1472,7 +1453,6 @@
3ddb79c0MOVXq8qZDQRGb6z64_xAwg xen/include/xen/pci_ids.h
3e54c38dlSCVdyVM4PKcrSfzLLxWUQ xen/include/xen/perfc.h
3e54c38de9SUSYSAwxDf_DwkpAnQFA xen/include/xen/perfc_defn.h
42422fb0FVX-TJkSvAXnbfwMf19XFA xen/include/xen/physdev.h
3ddb79c04nQVR3EYM5L4zxDV_MCo1g xen/include/xen/prefetch.h
3e4540ccU1sgCx8seIMGlahmMfv7yQ xen/include/xen/reboot.h
40589969nPq3DMzv24RDb5LXE9brHw xen/include/xen/sched-if.h
+1
View File
@@ -99,3 +99,4 @@ vh249@airwolf.cl.cam.ac.uk
vh249@arcadians.cl.cam.ac.uk
xen-ia64.adm@bkbits.net
xenbk@gandalf.hpl.hp.com
ydroneaud@mandriva.com
+1 -2
View File
@@ -66,7 +66,7 @@ relative_lndir ()
(
cd $i
pref=`echo $i | sed -e 's#/[^/]*#../#g' -e 's#^\.##'`
for j in `find . -type f -o -type l -maxdepth 1`; do
for j in `find . -maxdepth 1 -type f -o -type l`; do
ln -sf ${pref}${REAL_DIR}/$i/$j ${SYMLINK_DIR}/$i/$j
done
)
@@ -232,7 +232,6 @@ ln -sf ../../../${LINUX_26}/arch/xen/kernel/fixup.c
ln -sf ../../../${LINUX_26}/arch/xen/kernel/gnttab.c
ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c
ln -sf ../../../${LINUX_26}/arch/xen/kernel/skbuff.c
ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c
cd ${AD}/arch/xen/lib
ln -sf ../../i386/lib/checksum.S
+6
View File
@@ -181,6 +181,12 @@ endmenu
source "arch/xen/Kconfig.drivers"
if XEN_PRIVILEGED_GUEST
menu "Power management options"
source "drivers/acpi/Kconfig"
endmenu
endif
source "fs/Kconfig"
source "security/Kconfig"
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-xen0
# Wed Apr 6 09:19:05 2005
# Wed May 4 17:11:56 2005
#
CONFIG_XEN=y
CONFIG_ARCH_XEN=y
@@ -133,12 +133,23 @@ CONFIG_NOHIGHMEM=y
CONFIG_MTRR=y
CONFIG_HAVE_DEC_LOCK=y
# CONFIG_REGPARM is not set
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
#
# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
#
CONFIG_X86_UP_APIC=y
CONFIG_X86_UP_IOAPIC=y
CONFIG_PCI=y
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GOMMCONFIG is not set
# CONFIG_PCI_GODIRECT is not set
CONFIG_PCI_GOANY=y
# CONFIG_PCI_BIOS is not set
CONFIG_PCI_DIRECT=y
# CONFIG_PCIEPORTBUS is not set
# CONFIG_PCI_MSI is not set
CONFIG_PCI_LEGACY_PROC=y
# CONFIG_PCI_NAMES is not set
CONFIG_ISA=y
@@ -165,17 +176,25 @@ CONFIG_PCMCIA_PROBE=y
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_FRAME_POINTER is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_KPROBES is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_FRAME_POINTER is not set
# CONFIG_4KSTACKS is not set
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_X86_BIOS_REBOOT=y
@@ -230,6 +249,7 @@ CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
@@ -841,6 +861,7 @@ CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_HPET is not set
# CONFIG_HANGCHECK_TIMER is not set
#
@@ -889,13 +910,107 @@ CONFIG_DUMMY_CONSOLE=y
#
# USB support
#
# CONFIG_USB is not set
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set
#
# Miscellaneous USB options
#
# CONFIG_USB_DEVICEFS is not set
# CONFIG_USB_BANDWIDTH is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_OTG is not set
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
#
# USB Host Controller Drivers
#
# CONFIG_USB_EHCI_HCD is not set
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
# CONFIG_USB_SL811_HCD is not set
#
# USB Device Class drivers
#
# CONFIG_USB_BLUETOOTH_TTY is not set
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
#
# CONFIG_USB_STORAGE is not set
#
# USB Input Devices
#
CONFIG_USB_HID=y
CONFIG_USB_HIDINPUT=y
# CONFIG_HID_FF is not set
# CONFIG_USB_HIDDEV is not set
# CONFIG_USB_AIPTEK is not set
# CONFIG_USB_WACOM is not set
# CONFIG_USB_KBTAB is not set
# CONFIG_USB_POWERMATE is not set
# CONFIG_USB_MTOUCH is not set
# CONFIG_USB_EGALAX is not set
# CONFIG_USB_XPAD is not set
# CONFIG_USB_ATI_REMOTE is not set
#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set
#
# USB Multimedia devices
#
# CONFIG_USB_DABUSB is not set
#
# Video4Linux support is needed for USB Multimedia device support
#
#
# USB Network Adapters
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET is not set
#
# USB port drivers
#
#
# USB Serial Converter support
#
# CONFIG_USB_SERIAL is not set
#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_PHIDGETKIT is not set
# CONFIG_USB_PHIDGETSERVO is not set
# CONFIG_USB_IDMOUSE is not set
#
# USB ATM/DSL drivers
#
#
# USB Gadget Support
@@ -912,6 +1027,37 @@ CONFIG_USB_ARCH_HAS_OHCI=y
#
# CONFIG_INFINIBAND is not set
#
# Power management options
#
#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_AC=m
CONFIG_ACPI_BATTERY=m
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_VIDEO=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_THERMAL=m
CONFIG_ACPI_ASUS=m
CONFIG_ACPI_IBM=m
CONFIG_ACPI_TOSHIBA=m
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_BUS=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_X86_PM_TIMER is not set
# CONFIG_ACPI_CONTAINER is not set
#
# File systems
#
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.11-xenU
# Wed Apr 6 09:20:09 2005
# Wed May 4 17:14:10 2005
#
CONFIG_XEN=y
CONFIG_ARCH_XEN=y
@@ -132,16 +132,22 @@ CONFIG_HAVE_DEC_LOCK=y
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_FRAME_POINTER is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_KPROBES is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_FRAME_POINTER is not set
# CONFIG_4KSTACKS is not set
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
+96 -173
View File
@@ -12,6 +12,11 @@ config XENARCH
config X86
bool
default y
help
This is Linux's home port. Linux was originally native to the Intel
386, and runs on all the later x86 processors including the Intel
486, 586, Pentiums, and various instruction-set-compatible chips by
AMD, Cyrix, and others.
config MMU
bool
@@ -662,11 +667,15 @@ config REGPARM
generate incorrect output with certain kernel constructs when
-mregparm=3 is used.
config X86_LOCAL_APIC
bool
depends on (X86_VISWS || SMP) && !X86_VOYAGER
default n
depends on !SMP && X86_UP_APIC
default y
config X86_IO_APIC
bool
depends on !SMP && X86_UP_IOAPIC
default y
if XEN_PHYSDEV_ACCESS
@@ -677,10 +686,45 @@ config X86_VISWS_APIC
depends on X86_VISWS
default y
#config X86_IO_APIC
# bool
# depends on SMP && !(X86_VISWS || X86_VOYAGER)
# default y
config X86_LOCAL_APIC
bool
depends on (X86_VISWS || SMP) && !X86_VOYAGER
default y
config X86_UP_APIC
bool "Local APIC support on uniprocessors" if !SMP
depends on !(X86_VISWS || X86_VOYAGER)
---help---
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-CPU
system which has a processor with a local APIC, you can say Y here to
enable and use it. If you say Y here even though your machine doesn't
have a local APIC, then the kernel will still run with no slowdown at
all. The local APIC supports CPU-generated self-interrupts (timer,
performance counters), and the NMI watchdog which detects hard
lockups.
If you have a system with several CPUs, you do not need to say Y
here: the local APIC will be used automatically.
config X86_UP_IOAPIC
bool "IO-APIC support on uniprocessors"
depends on !SMP && X86_UP_APIC
help
An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
SMP-capable replacement for PC-style interrupt controllers. Most
SMP systems and a small number of uniprocessor systems have one.
If you have a single-CPU system with an IO-APIC, you can say Y here
to use it. If you say Y here even though your machine doesn't have
an IO-APIC, then the kernel will still run with no slowdown at all.
If you have a system with several CPUs, you do not need to say Y
here: the IO-APIC will be used automatically.
config X86_IO_APIC
bool
depends on SMP && !(X86_VISWS || X86_VOYAGER)
default y
config PCI
bool "PCI support" if !X86_VISWS
@@ -697,52 +741,53 @@ config PCI
information about which PCI hardware does work under Linux and which
doesn't.
#choice
# prompt "PCI access mode"
# depends on PCI && !X86_VISWS
# default PCI_GOANY
# ---help---
# On PCI systems, the BIOS can be used to detect the PCI devices and
# determine their configuration. However, some old PCI motherboards
# have BIOS bugs and may crash if this is done. Also, some embedded
# PCI-based systems don't have any BIOS at all. Linux can also try to
# detect the PCI hardware directly without using the BIOS.
#
# With this option, you can specify how Linux should detect the
# PCI devices. If you choose "BIOS", the BIOS will be used,
# if you choose "Direct", the BIOS won't be used, and if you
# choose "MMConfig", then PCI Express MMCONFIG will be used.
# If you choose "Any", the kernel will try MMCONFIG, then the
# direct access method and falls back to the BIOS if that doesn't
# work. If unsure, go with the default, which is "Any".
#
#config PCI_GOBIOS
# bool "BIOS"
#
#config PCI_GOMMCONFIG
# bool "MMConfig"
#
#config PCI_GODIRECT
# bool "Direct"
#
#config PCI_GOANY
# bool "Any"
#
#endchoice
#
#config PCI_BIOS
# bool
# depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
# default y
#
#config PCI_DIRECT
# bool
# depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
# default y
choice
prompt "PCI access mode"
depends on PCI && !X86_VISWS
default PCI_GOANY
---help---
On PCI systems, the BIOS can be used to detect the PCI devices and
determine their configuration. However, some old PCI motherboards
have BIOS bugs and may crash if this is done. Also, some embedded
PCI-based systems don't have any BIOS at all. Linux can also try to
detect the PCI hardware directly without using the BIOS.
With this option, you can specify how Linux should detect the
PCI devices. If you choose "BIOS", the BIOS will be used,
if you choose "Direct", the BIOS won't be used, and if you
choose "MMConfig", then PCI Express MMCONFIG will be used.
If you choose "Any", the kernel will try MMCONFIG, then the
direct access method and falls back to the BIOS if that doesn't
work. If unsure, go with the default, which is "Any".
config PCI_GOBIOS
bool "BIOS"
config PCI_GOMMCONFIG
bool "MMConfig"
config PCI_GODIRECT
bool "Direct"
config PCI_GOANY
bool "Any"
endchoice
config PCI_BIOS
bool
depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
default y
config PCI_DIRECT
bool
depends on PCI
depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
default y
config PCI_MMCONFIG
bool
depends on PCI && (PCI_GOMMCONFIG || (PCI_GOANY && ACPI))
select ACPI_BOOT
default y
source "drivers/pci/pcie/Kconfig"
@@ -812,129 +857,7 @@ endmenu
endif
menu "Kernel hacking"
config DEBUG_KERNEL
bool "Kernel debugging"
help
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
config EARLY_PRINTK
bool "Early printk" if EMBEDDED
default y
help
Write kernel log output directly into the VGA buffer or to a serial
port.
This is useful for kernel debugging when your machine crashes very
early before the console code is initialized. For normal operation
it is not recommended because it looks ugly and doesn't cooperate
with klogd/syslogd or the X server. You should normally N here,
unless you want to debug such a crash.
config DEBUG_STACKOVERFLOW
bool "Check for stack overflows"
depends on DEBUG_KERNEL
config DEBUG_STACK_USAGE
bool "Stack utilization instrumentation"
depends on DEBUG_KERNEL
help
Enables the display of the minimum amount of free stack which each
task has ever had available in the sysrq-T and sysrq-P debug output.
This option will slow down process creation somewhat.
config DEBUG_SLAB
bool "Debug memory allocations"
depends on DEBUG_KERNEL
help
Say Y here to have the kernel do limited verification on memory
allocation as well as poisoning memory on free to catch use of freed
memory.
config MAGIC_SYSRQ
bool "Magic SysRq key"
depends on DEBUG_KERNEL
help
If you say Y here, you will have some control over the system even
if the system crashes for example during kernel debugging (e.g., you
will be able to flush the buffer cache to disk, reboot the system
immediately or dump some status information). This is accomplished
by pressing various keys while holding SysRq (Alt+PrintScreen). It
also works on a serial console (on PC hardware at least), if you
send a BREAK and then within 5 seconds a command keypress. The
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does.
config DEBUG_SPINLOCK
bool "Spinlock debugging"
depends on DEBUG_KERNEL
help
Say Y here and build SMP to catch missing spinlock initialization
and certain other kinds of spinlock errors commonly made. This is
best used in conjunction with the NMI watchdog so that spinlock
deadlocks are also debuggable.
config DEBUG_PAGEALLOC
bool "Page alloc debugging"
depends on DEBUG_KERNEL
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
of memory corruptions.
config DEBUG_HIGHMEM
bool "Highmem debugging"
depends on DEBUG_KERNEL && HIGHMEM
help
This options enables addition error checking for high memory systems.
Disable for production systems.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config DEBUG_SPINLOCK_SLEEP
bool "Sleep-inside-spinlock checking"
help
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
config FRAME_POINTER
bool "Compile the kernel with frame pointers"
help
If you say Y here the resulting kernel image will be slightly larger
and slower, but it will give very useful debugging information.
If you don't debug the kernel, you can say N, but we may not be able
to solve problems without frame pointers.
config 4KSTACKS
bool "Use 4Kb for kernel stacks instead of 8Kb"
help
If you say Y here the kernel will use a 4Kb stacksize for the
kernel stack attached to each process/thread. This facilitates
running more threads on a system and also reduces the pressure
on the VM subsystem for higher order allocations. This option
will also use IRQ stacks to compensate for the reduced stackspace.
config X86_FIND_SMP_CONFIG
bool
depends on X86_LOCAL_APIC || X86_VOYAGER
default y
config X86_MPPARSE
bool
depends on X86_LOCAL_APIC && !X86_VISWS
default y
endmenu
source "arch/i386/Kconfig.debug"
#
# Use the generic interrupt handling code in kernel/irq/:
@@ -20,7 +20,7 @@ s-obj-y :=
obj-y += cpu/
obj-y += timers/
c-obj-$(CONFIG_ACPI_BOOT) += acpi/
obj-$(CONFIG_ACPI_BOOT) += acpi/
#c-obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
c-obj-$(CONFIG_MCA) += mca.o
c-obj-$(CONFIG_X86_MSR) += msr.o
@@ -29,10 +29,10 @@ obj-$(CONFIG_MICROCODE) += microcode.o
c-obj-$(CONFIG_APM) += apm.o
obj-$(CONFIG_X86_SMP) += smp.o smpboot.o
#obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
c-obj-$(CONFIG_X86_MPPARSE) += mpparse.o
#obj-$(CONFIG_X86_LOCAL_APIC) += apic.o
obj-$(CONFIG_X86_MPPARSE) += mpparse.o
obj-$(CONFIG_X86_LOCAL_APIC) += apic.o
c-obj-$(CONFIG_X86_LOCAL_APIC) += nmi.o
c-obj-$(CONFIG_X86_IO_APIC) += io_apic.o
obj-$(CONFIG_X86_IO_APIC) += io_apic.o
c-obj-$(CONFIG_X86_NUMAQ) += numaq.o
c-obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
c-obj-$(CONFIG_MODULES) += module.o
@@ -0,0 +1,13 @@
obj-$(CONFIG_ACPI_BOOT) := boot.o
c-obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
c-obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
c-link :=
$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
@ln -fsn $(srctree)/arch/i386/kernel/acpi/$(notdir $@) $@
obj-y += $(c-obj-y) $(s-obj-y)
clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
clean-files += $(patsubst %.o,%.S,$(s-obj-y) $(s-obj-) $(s-link))
@@ -0,0 +1,921 @@
/*
* boot.c - Architecture-Specific Low-Level ACPI Boot Support
*
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
* Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/init.h>
#include <linux/config.h>
#include <linux/acpi.h>
#include <linux/efi.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <asm/pgtable.h>
#include <asm/io_apic.h>
#include <asm/apic.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/mpspec.h>
#ifdef CONFIG_XEN
#include <asm/fixmap.h>
#endif
void (*pm_power_off)(void) = NULL;
#ifdef CONFIG_X86_64
static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
extern void __init clustered_apic_check(void);
static inline int ioapic_setup_disabled(void) { return 0; }
#include <asm/proto.h>
#else /* X86 */
#ifdef CONFIG_X86_LOCAL_APIC
#include <mach_apic.h>
#include <mach_mpparse.h>
#endif /* CONFIG_X86_LOCAL_APIC */
#endif /* X86 */
#define BAD_MADT_ENTRY(entry, end) ( \
(!entry) || (unsigned long)entry + sizeof(*entry) > end || \
((acpi_table_entry_header *)entry)->length != sizeof(*entry))
#define PREFIX "ACPI: "
#ifdef CONFIG_ACPI_PCI
int acpi_noirq __initdata; /* skip ACPI IRQ initialization */
int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */
#else
int acpi_noirq __initdata = 1;
int acpi_pci_disabled __initdata = 1;
#endif
int acpi_ht __initdata = 1; /* enable HT */
int acpi_lapic;
int acpi_ioapic;
int acpi_strict;
EXPORT_SYMBOL(acpi_strict);
acpi_interrupt_flags acpi_sci_flags __initdata;
int acpi_sci_override_gsi __initdata;
int acpi_skip_timer_override __initdata;
#ifdef CONFIG_X86_LOCAL_APIC
static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
#endif
#ifndef __HAVE_ARCH_CMPXCHG
#warning ACPI uses CMPXCHG, i486 and later hardware
#endif
#define MAX_MADT_ENTRIES 256
u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
{ [0 ... MAX_MADT_ENTRIES-1] = 0xff };
EXPORT_SYMBOL(x86_acpiid_to_apicid);
/* --------------------------------------------------------------------------
Boot-time Configuration
-------------------------------------------------------------------------- */
/*
* The default interrupt routing model is PIC (8259). This gets
* overriden if IOAPICs are enumerated (below).
*/
enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
#ifdef CONFIG_XEN
char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
{
unsigned int i,j;
j = PAGE_ALIGN(size) >> PAGE_SHIFT;
for (i = 0; (i < FIX_ACPI_PAGES) && j ; i++, j--) {
set_fixmap(FIX_ACPI_END - i,
(phys_addr & PAGE_MASK) + (i << PAGE_SHIFT));
}
return (char *) __fix_to_virt(FIX_ACPI_END) + (phys_addr & ~PAGE_MASK);
}
#else
#ifdef CONFIG_X86_64
/* rely on all ACPI tables being in the direct mapping */
char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
{
if (!phys_addr || !size)
return NULL;
if (phys_addr < (end_pfn_map << PAGE_SHIFT))
return __va(phys_addr);
return NULL;
}
#else
/*
* Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
* to map the target physical address. The problem is that set_fixmap()
* provides a single page, and it is possible that the page is not
* sufficient.
* By using this area, we can map up to MAX_IO_APICS pages temporarily,
* i.e. until the next __va_range() call.
*
* Important Safety Note: The fixed I/O APIC page numbers are *subtracted*
* from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and
* count idx down while incrementing the phys address.
*/
char *__acpi_map_table(unsigned long phys, unsigned long size)
{
unsigned long base, offset, mapped_size;
int idx;
if (phys + size < 8*1024*1024)
return __va(phys);
offset = phys & (PAGE_SIZE - 1);
mapped_size = PAGE_SIZE - offset;
set_fixmap(FIX_ACPI_END, phys);
base = fix_to_virt(FIX_ACPI_END);
/*
* Most cases can be covered by the below.
*/
idx = FIX_ACPI_END;
while (mapped_size < size) {
if (--idx < FIX_ACPI_BEGIN)
return NULL; /* cannot handle this */
phys += PAGE_SIZE;
set_fixmap(idx, phys);
mapped_size += PAGE_SIZE;
}
return ((unsigned char *) base + offset);
}
#endif
#endif /* CONFIG_XEN */
#ifdef CONFIG_PCI_MMCONFIG
static int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
{
struct acpi_table_mcfg *mcfg;
if (!phys_addr || !size)
return -EINVAL;
mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size);
if (!mcfg) {
printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
return -ENODEV;
}
if (mcfg->base_reserved) {
printk(KERN_ERR PREFIX "MMCONFIG not in low 4GB of memory\n");
return -ENODEV;
}
pci_mmcfg_base_addr = mcfg->base_address;
return 0;
}
#else
#define acpi_parse_mcfg NULL
#endif /* !CONFIG_PCI_MMCONFIG */
#ifdef CONFIG_X86_LOCAL_APIC
static int __init
acpi_parse_madt (
unsigned long phys_addr,
unsigned long size)
{
struct acpi_table_madt *madt = NULL;
if (!phys_addr || !size)
return -EINVAL;
madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size);
if (!madt) {
printk(KERN_WARNING PREFIX "Unable to map MADT\n");
return -ENODEV;
}
if (madt->lapic_address) {
acpi_lapic_addr = (u64) madt->lapic_address;
printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
madt->lapic_address);
}
acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
return 0;
}
static int __init
acpi_parse_lapic (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_lapic *processor = NULL;
processor = (struct acpi_table_lapic*) header;
if (BAD_MADT_ENTRY(processor, end))
return -EINVAL;
acpi_table_print_madt_entry(header);
/* no utility in registering a disabled processor */
if (processor->flags.enabled == 0)
return 0;
x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
mp_register_lapic (
processor->id, /* APIC ID */
processor->flags.enabled); /* Enabled? */
return 0;
}
static int __init
acpi_parse_lapic_addr_ovr (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header;
if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
return -EINVAL;
acpi_lapic_addr = lapic_addr_ovr->address;
return 0;
}
static int __init
acpi_parse_lapic_nmi (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_lapic_nmi *lapic_nmi = NULL;
lapic_nmi = (struct acpi_table_lapic_nmi*) header;
if (BAD_MADT_ENTRY(lapic_nmi, end))
return -EINVAL;
acpi_table_print_madt_entry(header);
if (lapic_nmi->lint != 1)
printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n");
return 0;
}
#endif /*CONFIG_X86_LOCAL_APIC*/
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
static int __init
acpi_parse_ioapic (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_ioapic *ioapic = NULL;
ioapic = (struct acpi_table_ioapic*) header;
if (BAD_MADT_ENTRY(ioapic, end))
return -EINVAL;
acpi_table_print_madt_entry(header);
mp_register_ioapic (
ioapic->id,
ioapic->address,
ioapic->global_irq_base);
return 0;
}
/*
* Parse Interrupt Source Override for the ACPI SCI
*/
static void
acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
{
if (trigger == 0) /* compatible SCI trigger is level */
trigger = 3;
if (polarity == 0) /* compatible SCI polarity is low */
polarity = 3;
/* Command-line over-ride via acpi_sci= */
if (acpi_sci_flags.trigger)
trigger = acpi_sci_flags.trigger;
if (acpi_sci_flags.polarity)
polarity = acpi_sci_flags.polarity;
/*
* mp_config_acpi_legacy_irqs() already setup IRQs < 16
* If GSI is < 16, this will update its flags,
* else it will create a new mp_irqs[] entry.
*/
mp_override_legacy_irq(gsi, polarity, trigger, gsi);
/*
* stash over-ride to indicate we've been here
* and for later update of acpi_fadt
*/
acpi_sci_override_gsi = gsi;
return;
}
static int __init
acpi_parse_int_src_ovr (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_int_src_ovr *intsrc = NULL;
intsrc = (struct acpi_table_int_src_ovr*) header;
if (BAD_MADT_ENTRY(intsrc, end))
return -EINVAL;
acpi_table_print_madt_entry(header);
if (intsrc->bus_irq == acpi_fadt.sci_int) {
acpi_sci_ioapic_setup(intsrc->global_irq,
intsrc->flags.polarity, intsrc->flags.trigger);
return 0;
}
if (acpi_skip_timer_override &&
intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
return 0;
}
mp_override_legacy_irq (
intsrc->bus_irq,
intsrc->flags.polarity,
intsrc->flags.trigger,
intsrc->global_irq);
return 0;
}
static int __init
acpi_parse_nmi_src (
acpi_table_entry_header *header, const unsigned long end)
{
struct acpi_table_nmi_src *nmi_src = NULL;
nmi_src = (struct acpi_table_nmi_src*) header;
if (BAD_MADT_ENTRY(nmi_src, end))
return -EINVAL;
acpi_table_print_madt_entry(header);
/* TBD: Support nimsrc entries? */
return 0;
}
#endif /* CONFIG_X86_IO_APIC */
#ifdef CONFIG_ACPI_BUS
/*
* acpi_pic_sci_set_trigger()
*
* use ELCR to set PIC-mode trigger type for SCI
*
* If a PIC-mode SCI is not recognized or gives spurious IRQ7's
* it may require Edge Trigger -- use "acpi_sci=edge"
*
* Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
* for the 8259 PIC. bit[n] = 1 means irq[n] is Level, otherwise Edge.
* ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
* ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
*/
void __init
acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
{
unsigned int mask = 1 << irq;
unsigned int old, new;
/* Real old ELCR mask */
old = inb(0x4d0) | (inb(0x4d1) << 8);
/*
* If we use ACPI to set PCI irq's, then we should clear ELCR
* since we will set it correctly as we enable the PCI irq
* routing.
*/
new = acpi_noirq ? old : 0;
/*
* Update SCI information in the ELCR, it isn't in the PCI
* routing tables..
*/
switch (trigger) {
case 1: /* Edge - clear */
new &= ~mask;
break;
case 3: /* Level - set */
new |= mask;
break;
}
if (old == new)
return;
printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old);
outb(new, 0x4d0);
outb(new >> 8, 0x4d1);
}
#endif /* CONFIG_ACPI_BUS */
int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
{
#ifdef CONFIG_X86_IO_APIC
if (use_pci_vector() && !platform_legacy_irq(gsi))
*irq = IO_APIC_VECTOR(gsi);
else
#endif
*irq = gsi;
return 0;
}
unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
{
unsigned int irq;
unsigned int plat_gsi = gsi;
#ifdef CONFIG_X86_IO_APIC
if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
plat_gsi = mp_register_gsi(gsi, edge_level, active_high_low);
}
#endif
acpi_gsi_to_irq(plat_gsi, &irq);
return irq;
}
EXPORT_SYMBOL(acpi_register_gsi);
/*
* ACPI based hotplug support for CPU
*/
#ifdef CONFIG_ACPI_HOTPLUG_CPU
int
acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
/* TBD */
return -EINVAL;
}
EXPORT_SYMBOL(acpi_map_lsapic);
int
acpi_unmap_lsapic(int cpu)
{
/* TBD */
return -EINVAL;
}
EXPORT_SYMBOL(acpi_unmap_lsapic);
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
static unsigned long __init
acpi_scan_rsdp (
unsigned long start,
unsigned long length)
{
unsigned long offset = 0;
unsigned long sig_len = sizeof("RSD PTR ") - 1;
unsigned long vstart = (unsigned long)isa_bus_to_virt(start);
/*
* Scan all 16-byte boundaries of the physical memory region for the
* RSDP signature.
*/
for (offset = 0; offset < length; offset += 16) {
if (strncmp((char *) (vstart + offset), "RSD PTR ", sig_len))
continue;
return (start + offset);
}
return 0;
}
static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
{
struct acpi_table_sbf *sb;
if (!phys_addr || !size)
return -EINVAL;
sb = (struct acpi_table_sbf *) __acpi_map_table(phys_addr, size);
if (!sb) {
printk(KERN_WARNING PREFIX "Unable to map SBF\n");
return -ENODEV;
}
sbf_port = sb->sbf_cmos; /* Save CMOS port */
return 0;
}
#ifdef CONFIG_HPET_TIMER
static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
{
struct acpi_table_hpet *hpet_tbl;
if (!phys || !size)
return -EINVAL;
hpet_tbl = (struct acpi_table_hpet *) __acpi_map_table(phys, size);
if (!hpet_tbl) {
printk(KERN_WARNING PREFIX "Unable to map HPET\n");
return -ENODEV;
}
if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
printk(KERN_WARNING PREFIX "HPET timers must be located in "
"memory.\n");
return -1;
}
#ifdef CONFIG_X86_64
vxtime.hpet_address = hpet_tbl->addr.addrl |
((long) hpet_tbl->addr.addrh << 32);
printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
hpet_tbl->id, vxtime.hpet_address);
#else /* X86 */
{
extern unsigned long hpet_address;
hpet_address = hpet_tbl->addr.addrl;
printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
hpet_tbl->id, hpet_address);
}
#endif /* X86 */
return 0;
}
#else
#define acpi_parse_hpet NULL
#endif
#ifdef CONFIG_X86_PM_TIMER
extern u32 pmtmr_ioport;
#endif
static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
{
struct fadt_descriptor_rev2 *fadt = NULL;
fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
if(!fadt) {
printk(KERN_WARNING PREFIX "Unable to map FADT\n");
return 0;
}
#ifdef CONFIG_ACPI_INTERPRETER
/* initialize sci_int early for INT_SRC_OVR MADT parsing */
acpi_fadt.sci_int = fadt->sci_int;
#endif
#ifdef CONFIG_X86_PM_TIMER
/* detect the location of the ACPI PM Timer */
if (fadt->revision >= FADT2_REVISION_ID) {
/* FADT rev. 2 */
if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
return 0;
pmtmr_ioport = fadt->xpm_tmr_blk.address;
} else {
/* FADT rev. 1 */
pmtmr_ioport = fadt->V1_pm_tmr_blk;
}
if (pmtmr_ioport)
printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
#endif
return 0;
}
unsigned long __init
acpi_find_rsdp (void)
{
unsigned long rsdp_phys = 0;
if (efi_enabled) {
if (efi.acpi20)
return __pa(efi.acpi20);
else if (efi.acpi)
return __pa(efi.acpi);
}
/*
* Scan memory looking for the RSDP signature. First search EBDA (low
* memory) paragraphs and then search upper memory (E0000-FFFFF).
*/
rsdp_phys = acpi_scan_rsdp (0, 0x400);
if (!rsdp_phys)
rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
set_fixmap(FIX_ACPI_RSDP_PAGE, rsdp_phys);
return rsdp_phys;
}
#ifdef CONFIG_X86_LOCAL_APIC
/*
* Parse LAPIC entries in MADT
* returns 0 on success, < 0 on error
*/
static int __init
acpi_parse_madt_lapic_entries(void)
{
int count;
/*
* Note that the LAPIC address is obtained from the MADT (32-bit value)
* and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
*/
count = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
return count;
}
mp_register_lapic_address(acpi_lapic_addr);
count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
MAX_APICS);
if (!count) {
printk(KERN_ERR PREFIX "No LAPIC entries present\n");
/* TBD: Cleanup to allow fallback to MPS */
return -ENODEV;
}
else if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
/* TBD: Cleanup to allow fallback to MPS */
return count;
}
count = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
/* TBD: Cleanup to allow fallback to MPS */
return count;
}
return 0;
}
#endif /* CONFIG_X86_LOCAL_APIC */
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
/*
* Parse IOAPIC related entries in MADT
* returns 0 on success, < 0 on error
*/
static int __init
acpi_parse_madt_ioapic_entries(void)
{
int count;
/*
* ACPI interpreter is required to complete interrupt setup,
* so if it is off, don't enumerate the io-apics with ACPI.
* If MPS is present, it will handle them,
* otherwise the system will stay in PIC mode
*/
if (acpi_disabled || acpi_noirq) {
return -ENODEV;
}
/*
* if "noapic" boot option, don't look for IO-APICs
*/
if (skip_ioapic_setup) {
printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
"due to 'noapic' option.\n");
return -ENODEV;
}
count = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
if (!count) {
printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
return -ENODEV;
}
else if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
return count;
}
count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
/* TBD: Cleanup to allow fallback to MPS */
return count;
}
/*
* If BIOS did not supply an INT_SRC_OVR for the SCI
* pretend we got one so we can set the SCI flags.
*/
if (!acpi_sci_override_gsi)
acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
/* Fill in identity legacy mapings where no override */
mp_config_acpi_legacy_irqs();
count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
/* TBD: Cleanup to allow fallback to MPS */
return count;
}
return 0;
}
#else
static inline int acpi_parse_madt_ioapic_entries(void)
{
return -1;
}
#endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */
static void __init
acpi_process_madt(void)
{
#ifdef CONFIG_X86_LOCAL_APIC
int count, error;
count = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
if (count >= 1) {
/*
* Parse MADT LAPIC entries
*/
error = acpi_parse_madt_lapic_entries();
if (!error) {
acpi_lapic = 1;
/*
* Parse MADT IO-APIC entries
*/
error = acpi_parse_madt_ioapic_entries();
if (!error) {
acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
acpi_irq_balance_set(NULL);
acpi_ioapic = 1;
smp_found_config = 1;
clustered_apic_check();
}
}
if (error == -EINVAL) {
/*
* Dell Precision Workstation 410, 610 come here.
*/
printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n");
disable_acpi();
}
}
#endif
return;
}
/*
* acpi_boot_table_init() and acpi_boot_init()
* called from setup_arch(), always.
* 1. checksums all tables
* 2. enumerates lapics
* 3. enumerates io-apics
*
* acpi_table_init() is separate to allow reading SRAT without
* other side effects.
*
* side effects of acpi_boot_init:
* acpi_lapic = 1 if LAPIC found
* acpi_ioapic = 1 if IOAPIC found
* if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
* if acpi_blacklisted() acpi_disabled = 1;
* acpi_irq_model=...
* ...
*
* return value: (currently ignored)
* 0: success
* !0: failure
*/
int __init
acpi_boot_table_init(void)
{
int error;
/*
* If acpi_disabled, bail out
* One exception: acpi=ht continues far enough to enumerate LAPICs
*/
if (acpi_disabled && !acpi_ht)
return 1;
/*
* Initialize the ACPI boot-time table parser.
*/
error = acpi_table_init();
if (error) {
disable_acpi();
return error;
}
#ifdef __i386__
check_acpi_pci();
#endif
acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
/*
* blacklist may disable ACPI entirely
*/
error = acpi_blacklisted();
if (error) {
extern int acpi_force;
if (acpi_force) {
printk(KERN_WARNING PREFIX "acpi=force override\n");
} else {
printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
disable_acpi();
return error;
}
}
return 0;
}
int __init acpi_boot_init(void)
{
/*
* If acpi_disabled, bail out
* One exception: acpi=ht continues far enough to enumerate LAPICs
*/
if (acpi_disabled && !acpi_ht)
return 1;
acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
/*
* set sci_int and PM timer address
*/
acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
/*
* Process the Multiple APIC Description Table (MADT), if present
*/
acpi_process_madt();
acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
return 0;
}
@@ -0,0 +1,83 @@
/*
* Local APIC handling, local APIC timers
*
* (c) 1999, 2000 Ingo Molnar <mingo@redhat.com>
*
* Fixes
* Maciej W. Rozycki : Bits for genuine 82489DX APICs;
* thanks to Eric Gilmore
* and Rolf G. Tews
* for testing these extensively.
* Maciej W. Rozycki : Various updates and fixes.
* Mikael Pettersson : Power Management for UP-APIC.
* Pavel Machek and
* Mikael Pettersson : PM converted to driver model.
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/bootmem.h>
#include <linux/smp_lock.h>
#include <linux/interrupt.h>
#include <linux/mc146818rtc.h>
#include <linux/kernel_stat.h>
#include <linux/sysdev.h>
#include <asm/atomic.h>
#include <asm/smp.h>
#include <asm/mtrr.h>
#include <asm/mpspec.h>
#include <asm/desc.h>
#include <asm/arch_hooks.h>
#include <asm/hpet.h>
#include <mach_apic.h>
#include "io_ports.h"
/*
* Debug level
*/
int apic_verbosity;
int get_physical_broadcast(void)
{
return 0xff;
}
/*
* 'what should we do if we get a hw irq event on an illegal vector'.
* each architecture has to answer this themselves.
*/
void ack_bad_irq(unsigned int irq)
{
printk("unexpected IRQ trap at vector %02x\n", irq);
/*
* Currently unexpected vectors happen only on SMP and APIC.
* We _must_ ack these because every local APIC has only N
* irq slots per priority level, and a 'hanging, unacked' IRQ
* holds up an irq slot - in excessive cases (when multiple
* unexpected vectors occur) that might lock up the APIC
* completely.
*/
ack_APIC_irq();
}
/*
* This initializes the IO-APIC and APIC hardware if this is
* a UP kernel.
*/
int __init APIC_init_uniprocessor (void)
{
#ifdef CONFIG_X86_IO_APIC
if (smp_found_config)
if (!skip_ioapic_setup && nr_ioapics)
setup_IO_APIC();
#endif
return 0;
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -779,7 +779,7 @@ static void __init parse_cmdline_early (char ** cmdline_p)
noexec_setup(from + 7);
#ifdef CONFIG_X86_SMP
#ifdef CONFIG_X86_MPPARSE
/*
* If the BIOS enumerates physical processors before logical,
* maxcpus=N at enumeration-time can be used to disable HT.
@@ -1133,12 +1133,6 @@ static unsigned long __init setup_memory(void)
*/
acpi_reserve_bootmem();
#endif
#ifdef CONFIG_X86_FIND_SMP_CONFIG
/*
* Find and reserve possible boot-time SMP configuration:
*/
find_smp_config();
#endif
#ifdef CONFIG_BLK_DEV_INITRD
if (xen_start_info.mod_start) {
@@ -1503,6 +1497,13 @@ void __init setup_arch(char **cmdline_p)
#endif
paging_init();
#ifdef CONFIG_X86_FIND_SMP_CONFIG
/*
* Find and reserve possible boot-time SMP configuration:
*/
find_smp_config();
#endif
/* Make sure we have a correctly sized P->M table. */
if (max_pfn != xen_start_info.nr_pages) {
phys_to_machine_mapping = alloc_bootmem_low_pages(
@@ -1566,6 +1567,10 @@ void __init setup_arch(char **cmdline_p)
if (efi_enabled)
efi_map_memmap();
op.cmd = PHYSDEVOP_SET_IOPL;
op.u.set_iopl.iopl = current->thread.io_pl = 1;
HYPERVISOR_physdev_op(&op);
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
@@ -1583,10 +1588,6 @@ void __init setup_arch(char **cmdline_p)
register_memory();
op.cmd = PHYSDEVOP_SET_IOPL;
op.u.set_iopl.iopl = current->thread.io_pl = 1;
HYPERVISOR_physdev_op(&op);
if (xen_start_info.flags & SIF_INITDOMAIN) {
if (!(xen_start_info.flags & SIF_PRIVILEGED))
panic("Xen granted us console access "
@@ -562,7 +562,7 @@ void __init paging_init(void)
zone_sizes_init();
/* Switch to the real shared_info page, and clear the dummy page. */
set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info);
HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
memset(empty_zero_page, 0, sizeof(empty_zero_page));
@@ -570,10 +570,11 @@ void __init paging_init(void)
/* Setup mapping of lower 1st MB */
for (i = 0; i < NR_FIX_ISAMAPS; i++)
if (xen_start_info.flags & SIF_PRIVILEGED)
set_fixmap_ma(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
else
set_fixmap_ma_ro(FIX_ISAMAP_BEGIN - i,
virt_to_machine(empty_zero_page));
__set_fixmap(FIX_ISAMAP_BEGIN - i,
virt_to_machine(empty_zero_page),
PAGE_KERNEL_RO);
#endif
}
@@ -256,7 +256,7 @@ void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
*/
idx = FIX_BTMAP_BEGIN;
while (nrpages > 0) {
set_fixmap_ma(idx, phys_addr);
set_fixmap(idx, phys_addr);
phys_addr += PAGE_SIZE;
--idx;
--nrpages;
@@ -176,18 +176,18 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
BUG();
return;
}
set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
}
void __set_fixmap_ma (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
{
unsigned long address = __fix_to_virt(idx);
if (idx >= __end_of_fixed_addresses) {
BUG();
return;
switch (idx) {
case FIX_WP_TEST:
case FIX_VSYSCALL:
#ifdef CONFIG_X86_F00F_BUG
case FIX_F00F_IDT:
#endif
set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
break;
default:
set_pte_pfn_ma(address, phys >> PAGE_SHIFT, flags);
break;
}
set_pte_pfn_ma(address, phys >> PAGE_SHIFT, flags);
}
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
@@ -6,12 +6,13 @@ c-obj-y := i386.o
c-obj-$(CONFIG_PCI_BIOS) += pcbios.o
c-obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o
obj-$(CONFIG_PCI_DIRECT) += direct.o
c-obj-$(CONFIG_PCI_DIRECT) += direct.o
c-pci-y := fixup.o
c-pci-$(CONFIG_ACPI_PCI) += acpi.o
c-pci-y += legacy.o
pci-y += irq.o
# Make sure irq.o gets linked in after legacy.o
l-pci-y += irq.o
c-pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
pci-$(CONFIG_X86_VISWS) :=
@@ -26,6 +27,6 @@ c-link :=
$(patsubst %.o,$(obj)/%.c,$(c-obj-y) $(c-link)):
@ln -fsn $(srctree)/arch/i386/pci/$(notdir $@) $@
obj-y += $(c-obj-y)
obj-y += $(c-obj-y) $(l-pci-y)
clean-files += $(patsubst %.o,%.c,$(c-obj-y) $(c-obj-) $(c-link))
@@ -1,81 +0,0 @@
/*
* direct.c - Low-level direct PCI config space access
*/
#include <linux/pci.h>
#include <linux/init.h>
#include "pci.h"
#include <asm-xen/xen-public/xen.h>
#include <asm-xen/xen-public/physdev.h>
/*
* Functions for accessing PCI configuration space with type xen accesses
*/
static int pci_conf_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
{
unsigned long flags;
physdev_op_t op;
int ret;
if (!value || (bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
op.cmd = PHYSDEVOP_PCI_CFGREG_READ;
op.u.pci_cfgreg_read.bus = bus;
op.u.pci_cfgreg_read.dev = (devfn & ~0x7) >> 3;
op.u.pci_cfgreg_read.func = devfn & 0x7;
op.u.pci_cfgreg_read.reg = reg;
op.u.pci_cfgreg_read.len = len;
ret = HYPERVISOR_physdev_op(&op);
if (ret == 0)
*value = op.u.pci_cfgreg_read.value;
spin_unlock_irqrestore(&pci_config_lock, flags);
return ret;
}
static int pci_conf_write (int seg, int bus, int devfn, int reg, int len, u32 value)
{
unsigned long flags;
physdev_op_t op;
int ret;
if ((bus > 255) || (devfn > 255) || (reg > 255))
return -EINVAL;
spin_lock_irqsave(&pci_config_lock, flags);
op.cmd = PHYSDEVOP_PCI_CFGREG_WRITE;
op.u.pci_cfgreg_write.bus = bus;
op.u.pci_cfgreg_write.dev = (devfn & ~0x7) >> 3;
op.u.pci_cfgreg_write.func = devfn & 0x7;
op.u.pci_cfgreg_write.reg = reg;
op.u.pci_cfgreg_write.len = len;
op.u.pci_cfgreg_write.value = value;
ret = HYPERVISOR_physdev_op(&op);
spin_unlock_irqrestore(&pci_config_lock, flags);
return ret;
}
struct pci_raw_ops pci_direct_xen = {
.read = pci_conf_read,
.write = pci_conf_write,
};
static int __init pci_direct_init(void)
{
printk(KERN_INFO "PCI: Using configuration type Xen\n");
raw_pci_ops = &pci_direct_xen;
return 0;
}
arch_initcall(pci_direct_init);
File diff suppressed because it is too large. Load diff
@@ -20,10 +20,6 @@
#include <asm-xen/linux-public/privcmd.h>
#include <asm-xen/gnttab.h>
#ifndef set_fixmap_ma
#define set_fixmap_ma set_fixmap
#endif
#if 1
#define ASSERT(_p) \
if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
@@ -339,7 +335,7 @@ int gnttab_resume(void)
BUG_ON(setup.status != 0);
for ( i = 0; i < NR_GRANT_FRAMES; i++ )
set_fixmap_ma(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
return 0;
}
@@ -129,11 +129,7 @@ static void __do_suspend(void)
memcpy(&xen_start_info, &suspend_record->resume_info,
sizeof(xen_start_info));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
#else
set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info);
#endif
HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
@@ -4,9 +4,6 @@
#include <linux/kernel.h>
#include <linux/threads.h>
unsigned int __initdata maxcpus = NR_CPUS;
/*
* the frequency of the profiling timer can be changed
* by writing a multiplier value into /proc/profile.
@@ -363,8 +363,6 @@ menu "Power management options"
source kernel/power/Kconfig
source "drivers/acpi/Kconfig"
source "arch/x86_64/kernel/cpufreq/Kconfig"
endmenu
@@ -361,7 +361,14 @@ void __set_fixmap (enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
printk("Invalid __set_fixmap\n");
return;
}
set_pte_phys(address, phys, prot, SET_FIXMAP_KERNEL);
switch (idx) {
case VSYSCALL_FIRST_PAGE:
set_pte_phys(address, phys, prot, SET_FIXMAP_KERNEL);
break;
default:
set_pte_phys_ma(address, phys, prot);
break;
}
}
@@ -414,18 +421,6 @@ void __set_fixmap_user (enum fixed_addresses idx, unsigned long phys, pgprot_t p
}
void __set_fixmap_ma (enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
{
unsigned long address = __fix_to_virt(idx);
if (idx >= __end_of_fixed_addresses) {
printk("Invalid __set_fixmap\n");
return;
}
set_pte_phys_ma(address, phys, prot);
}
unsigned long __initdata table_start, table_end, tables_reserved;
#if 0
@@ -632,8 +627,7 @@ void __init paging_init(void)
free_area_init(zones_size);
}
__set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info,
__pgprot(_KERNPG_TABLE));
set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info);
HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
memset(empty_zero_page, 0, sizeof(empty_zero_page));
@@ -642,11 +636,11 @@ void __init paging_init(void)
/* Setup mapping of lower 1st MB */
for (i = 0; i < NR_FIX_ISAMAPS; i++)
if (xen_start_info.flags & SIF_PRIVILEGED)
__set_fixmap_ma(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE,
__pgprot(_KERNPG_TABLE));
set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
else
set_fixmap_ma_ro(FIX_ISAMAP_BEGIN - i,
virt_to_machine(empty_zero_page));
__set_fixmap(FIX_ISAMAP_BEGIN - i,
virt_to_machine(empty_zero_page),
PAGE_KERNEL_RO);
#endif
}
@@ -273,7 +273,7 @@ void __init *bt_ioremap(unsigned long phys_addr, unsigned long size)
*/
idx = FIX_BTMAP_BEGIN;
while (nrpages > 0) {
set_fixmap_ma(idx, phys_addr);
set_fixmap(idx, phys_addr);
phys_addr += PAGE_SIZE;
--idx;
--nrpages;
@@ -0,0 +1,610 @@
/*
* acpi_tables.c - ACPI Boot-Time Table Parsing
*
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/irq.h>
#include <linux/errno.h>
#include <linux/acpi.h>
#include <linux/bootmem.h>
#define PREFIX "ACPI: "
#define ACPI_MAX_TABLES 256
static char *acpi_table_signatures[ACPI_TABLE_COUNT] = {
[ACPI_TABLE_UNKNOWN] = "????",
[ACPI_APIC] = "APIC",
[ACPI_BOOT] = "BOOT",
[ACPI_DBGP] = "DBGP",
[ACPI_DSDT] = "DSDT",
[ACPI_ECDT] = "ECDT",
[ACPI_ETDT] = "ETDT",
[ACPI_FADT] = "FACP",
[ACPI_FACS] = "FACS",
[ACPI_OEMX] = "OEM",
[ACPI_PSDT] = "PSDT",
[ACPI_SBST] = "SBST",
[ACPI_SLIT] = "SLIT",
[ACPI_SPCR] = "SPCR",
[ACPI_SRAT] = "SRAT",
[ACPI_SSDT] = "SSDT",
[ACPI_SPMI] = "SPMI",
[ACPI_HPET] = "HPET",
[ACPI_MCFG] = "MCFG",
};
static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" };
static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
/* System Description Table (RSDT/XSDT) */
struct acpi_table_sdt {
unsigned long pa;
enum acpi_table_id id;
unsigned long size;
} __attribute__ ((packed));
static unsigned long sdt_pa; /* Physical Address */
static unsigned long sdt_count; /* Table count */
static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES];
void
acpi_table_print (
struct acpi_table_header *header,
unsigned long phys_addr)
{
char *name = NULL;
if (!header)
return;
/* Some table signatures aren't good table names */
if (!strncmp((char *) &header->signature,
acpi_table_signatures[ACPI_APIC],
sizeof(header->signature))) {
name = "MADT";
}
else if (!strncmp((char *) &header->signature,
acpi_table_signatures[ACPI_FADT],
sizeof(header->signature))) {
name = "FADT";
}
else
name = header->signature;
printk(KERN_DEBUG PREFIX "%.4s (v%3.3d %6.6s %8.8s 0x%08x %.4s 0x%08x) @ 0x%p\n",
name, header->revision, header->oem_id,
header->oem_table_id, header->oem_revision,
header->asl_compiler_id, header->asl_compiler_revision,
(void *) phys_addr);
}
void
acpi_table_print_madt_entry (
acpi_table_entry_header *header)
{
if (!header)
return;
switch (header->type) {
case ACPI_MADT_LAPIC:
{
struct acpi_table_lapic *p =
(struct acpi_table_lapic*) header;
printk(KERN_INFO PREFIX "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
p->acpi_id, p->id, p->flags.enabled?"enabled":"disabled");
}
break;
case ACPI_MADT_IOAPIC:
{
struct acpi_table_ioapic *p =
(struct acpi_table_ioapic*) header;
printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n",
p->id, p->address, p->global_irq_base);
}
break;
case ACPI_MADT_INT_SRC_OVR:
{
struct acpi_table_int_src_ovr *p =
(struct acpi_table_int_src_ovr*) header;
printk(KERN_INFO PREFIX "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
p->bus, p->bus_irq, p->global_irq,
mps_inti_flags_polarity[p->flags.polarity],
mps_inti_flags_trigger[p->flags.trigger]);
if(p->flags.reserved)
printk(KERN_INFO PREFIX "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
p->flags.reserved);
}
break;
case ACPI_MADT_NMI_SRC:
{
struct acpi_table_nmi_src *p =
(struct acpi_table_nmi_src*) header;
printk(KERN_INFO PREFIX "NMI_SRC (%s %s global_irq %d)\n",
mps_inti_flags_polarity[p->flags.polarity],
mps_inti_flags_trigger[p->flags.trigger], p->global_irq);
}
break;
case ACPI_MADT_LAPIC_NMI:
{
struct acpi_table_lapic_nmi *p =
(struct acpi_table_lapic_nmi*) header;
printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
p->acpi_id,
mps_inti_flags_polarity[p->flags.polarity],
mps_inti_flags_trigger[p->flags.trigger], p->lint);
}
break;
case ACPI_MADT_LAPIC_ADDR_OVR:
{
struct acpi_table_lapic_addr_ovr *p =
(struct acpi_table_lapic_addr_ovr*) header;
printk(KERN_INFO PREFIX "LAPIC_ADDR_OVR (address[%p])\n",
(void *) (unsigned long) p->address);
}
break;
case ACPI_MADT_IOSAPIC:
{
struct acpi_table_iosapic *p =
(struct acpi_table_iosapic*) header;
printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
p->id, (void *) (unsigned long) p->address, p->global_irq_base);
}
break;
case ACPI_MADT_LSAPIC:
{
struct acpi_table_lsapic *p =
(struct acpi_table_lsapic*) header;
printk(KERN_INFO PREFIX "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n",
p->acpi_id, p->id, p->eid, p->flags.enabled?"enabled":"disabled");
}
break;
case ACPI_MADT_PLAT_INT_SRC:
{
struct acpi_table_plat_int_src *p =
(struct acpi_table_plat_int_src*) header;
printk(KERN_INFO PREFIX "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
mps_inti_flags_polarity[p->flags.polarity],
mps_inti_flags_trigger[p->flags.trigger],
p->type, p->id, p->eid, p->iosapic_vector, p->global_irq);
}
break;
default:
printk(KERN_WARNING PREFIX "Found unsupported MADT entry (type = 0x%x)\n",
header->type);
break;
}
}
static int
acpi_table_compute_checksum (
void *table_pointer,
unsigned long length)
{
u8 *p = (u8 *) table_pointer;
unsigned long remains = length;
unsigned long sum = 0;
if (!p || !length)
return -EINVAL;
while (remains--)
sum += *p++;
return (sum & 0xFF);
}
/*
* acpi_get_table_header_early()
* for acpi_blacklisted(), acpi_table_get_sdt()
*/
int __init
acpi_get_table_header_early (
enum acpi_table_id id,
struct acpi_table_header **header)
{
unsigned int i;
enum acpi_table_id temp_id;
/* DSDT is different from the rest */
if (id == ACPI_DSDT)
temp_id = ACPI_FADT;
else
temp_id = id;
/* Locate the table. */
for (i = 0; i < sdt_count; i++) {
if (sdt_entry[i].id != temp_id)
continue;
*header = (void *)
__acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size);
if (!*header) {
printk(KERN_WARNING PREFIX "Unable to map %s\n",
acpi_table_signatures[temp_id]);
return -ENODEV;
}
break;
}
if (!*header) {
printk(KERN_WARNING PREFIX "%s not present\n",
acpi_table_signatures[id]);
return -ENODEV;
}
/* Map the DSDT header via the pointer in the FADT */
if (id == ACPI_DSDT) {
struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header;
if (fadt->revision == 3 && fadt->Xdsdt) {
*header = (void *) __acpi_map_table(fadt->Xdsdt,
sizeof(struct acpi_table_header));
} else if (fadt->V1_dsdt) {
*header = (void *) __acpi_map_table(fadt->V1_dsdt,
sizeof(struct acpi_table_header));
} else
*header = NULL;
if (!*header) {
printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
return -ENODEV;
}
}
return 0;
}
int __init
acpi_table_parse_madt_family (
enum acpi_table_id id,
unsigned long madt_size,
int entry_id,
acpi_madt_entry_handler handler,
unsigned int max_entries)
{
void *madt = NULL;
acpi_table_entry_header *entry;
unsigned int count = 0;
unsigned long madt_end;
unsigned int i;
if (!handler)
return -EINVAL;
/* Locate the MADT (if exists). There should only be one. */
for (i = 0; i < sdt_count; i++) {
if (sdt_entry[i].id != id)
continue;
madt = (void *)
__acpi_map_table(sdt_entry[i].pa, sdt_entry[i].size);
if (!madt) {
printk(KERN_WARNING PREFIX "Unable to map %s\n",
acpi_table_signatures[id]);
return -ENODEV;
}
break;
}
if (!madt) {
printk(KERN_WARNING PREFIX "%s not present\n",
acpi_table_signatures[id]);
return -ENODEV;
}
madt_end = (unsigned long) madt + sdt_entry[i].size;
/* Parse all entries looking for a match. */
entry = (acpi_table_entry_header *)
((unsigned long) madt + madt_size);
while (((unsigned long) entry) + sizeof(acpi_table_entry_header) < madt_end) {
if (entry->type == entry_id &&
(!max_entries || count++ < max_entries))
if (handler(entry, madt_end))
return -EINVAL;
entry = (acpi_table_entry_header *)
((unsigned long) entry + entry->length);
}
if (max_entries && count > max_entries) {
printk(KERN_WARNING PREFIX "[%s:0x%02x] ignored %i entries of "
"%i found\n", acpi_table_signatures[id], entry_id,
count - max_entries, count);
}
return count;
}
int __init
acpi_table_parse_madt (
enum acpi_madt_entry_id id,
acpi_madt_entry_handler handler,
unsigned int max_entries)
{
return acpi_table_parse_madt_family(ACPI_APIC, sizeof(struct acpi_table_madt),
id, handler, max_entries);
}
int __init
acpi_table_parse (
enum acpi_table_id id,
acpi_table_handler handler)
{
int count = 0;
unsigned int i = 0;
if (!handler)
return -EINVAL;
for (i = 0; i < sdt_count; i++) {
if (sdt_entry[i].id != id)
continue;
count++;
if (count == 1)
handler(sdt_entry[i].pa, sdt_entry[i].size);
else
printk(KERN_WARNING PREFIX "%d duplicate %s table ignored.\n",
count, acpi_table_signatures[id]);
}
return count;
}
static int __init
acpi_table_get_sdt (
struct acpi_table_rsdp *rsdp)
{
struct acpi_table_header *header = NULL;
unsigned int i, id = 0;
if (!rsdp)
return -EINVAL;
/* First check XSDT (but only on ACPI 2.0-compatible systems) */
if ((rsdp->revision >= 2) &&
(((struct acpi20_table_rsdp*)rsdp)->xsdt_address)) {
struct acpi_table_xsdt *mapped_xsdt = NULL;
sdt_pa = ((struct acpi20_table_rsdp*)rsdp)->xsdt_address;
/* map in just the header */
header = (struct acpi_table_header *)
__acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
if (!header) {
printk(KERN_WARNING PREFIX "Unable to map XSDT header\n");
return -ENODEV;
}
/* remap in the entire table before processing */
mapped_xsdt = (struct acpi_table_xsdt *)
__acpi_map_table(sdt_pa, header->length);
if (!mapped_xsdt) {
printk(KERN_WARNING PREFIX "Unable to map XSDT\n");
return -ENODEV;
}
header = &mapped_xsdt->header;
if (strncmp(header->signature, "XSDT", 4)) {
printk(KERN_WARNING PREFIX "XSDT signature incorrect\n");
return -ENODEV;
}
if (acpi_table_compute_checksum(header, header->length)) {
printk(KERN_WARNING PREFIX "Invalid XSDT checksum\n");
return -ENODEV;
}
sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 3;
if (sdt_count > ACPI_MAX_TABLES) {
printk(KERN_WARNING PREFIX "Truncated %lu XSDT entries\n",
(sdt_count - ACPI_MAX_TABLES));
sdt_count = ACPI_MAX_TABLES;
}
for (i = 0; i < sdt_count; i++)
sdt_entry[i].pa = (unsigned long) mapped_xsdt->entry[i];
}
/* Then check RSDT */
else if (rsdp->rsdt_address) {
struct acpi_table_rsdt *mapped_rsdt = NULL;
sdt_pa = rsdp->rsdt_address;
/* map in just the header */
header = (struct acpi_table_header *)
__acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
if (!header) {
printk(KERN_WARNING PREFIX "Unable to map RSDT header\n");
return -ENODEV;
}
/* remap in the entire table before processing */
mapped_rsdt = (struct acpi_table_rsdt *)
__acpi_map_table(sdt_pa, header->length);
if (!mapped_rsdt) {
printk(KERN_WARNING PREFIX "Unable to map RSDT\n");
return -ENODEV;
}
header = &mapped_rsdt->header;
if (strncmp(header->signature, "RSDT", 4)) {
printk(KERN_WARNING PREFIX "RSDT signature incorrect\n");
return -ENODEV;
}
if (acpi_table_compute_checksum(header, header->length)) {
printk(KERN_WARNING PREFIX "Invalid RSDT checksum\n");
return -ENODEV;
}
sdt_count = (header->length - sizeof(struct acpi_table_header)) >> 2;
if (sdt_count > ACPI_MAX_TABLES) {
printk(KERN_WARNING PREFIX "Truncated %lu RSDT entries\n",
(sdt_count - ACPI_MAX_TABLES));
sdt_count = ACPI_MAX_TABLES;
}
for (i = 0; i < sdt_count; i++)
sdt_entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
}
else {
printk(KERN_WARNING PREFIX "No System Description Table (RSDT/XSDT) specified in RSDP\n");
return -ENODEV;
}
acpi_table_print(header, sdt_pa);
for (i = 0; i < sdt_count; i++) {
/* map in just the header */
header = (struct acpi_table_header *)
__acpi_map_table(sdt_entry[i].pa,
sizeof(struct acpi_table_header));
if (!header)
continue;
/* remap in the entire table before processing */
header = (struct acpi_table_header *)
__acpi_map_table(sdt_entry[i].pa,
header->length);
if (!header)
continue;
acpi_table_print(header, sdt_entry[i].pa);
if (acpi_table_compute_checksum(header, header->length)) {
printk(KERN_WARNING " >>> ERROR: Invalid checksum\n");
continue;
}
sdt_entry[i].size = header->length;
for (id = 0; id < ACPI_TABLE_COUNT; id++) {
if (!strncmp((char *) &header->signature,
acpi_table_signatures[id],
sizeof(header->signature))) {
sdt_entry[i].id = id;
}
}
}
/*
* The DSDT is *not* in the RSDT (why not? no idea.) but we want
* to print its info, because this is what people usually blacklist
* against. Unfortunately, we don't know the phys_addr, so just
* print 0. Maybe no one will notice.
*/
if(!acpi_get_table_header_early(ACPI_DSDT, &header))
acpi_table_print(header, 0);
return 0;
}
/*
* acpi_table_init()
*
* find RSDP, find and checksum SDT/XSDT.
* checksum all tables, print SDT/XSDT
*
* result: sdt_entry[] is initialized
*/
int __init
acpi_table_init (void)
{
struct acpi_table_rsdp *rsdp = NULL;
unsigned long rsdp_phys = 0;
int result = 0;
/* Locate and map the Root System Description Table (RSDP) */
rsdp_phys = acpi_find_rsdp();
if (!rsdp_phys) {
printk(KERN_ERR PREFIX "Unable to locate RSDP\n");
return -ENODEV;
}
rsdp = (struct acpi_table_rsdp *) (__fix_to_virt(FIX_ACPI_RSDP_PAGE) +
(rsdp_phys & ~PAGE_MASK));
if (!rsdp) {
printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
return -ENODEV;
}
printk(KERN_DEBUG PREFIX "RSDP (v%3.3d %6.6s ) @ 0x%p\n",
rsdp->revision, rsdp->oem_id, (void *) rsdp_phys);
if (rsdp->revision < 2)
result = acpi_table_compute_checksum(rsdp, sizeof(struct acpi_table_rsdp));
else
result = acpi_table_compute_checksum(rsdp, ((struct acpi20_table_rsdp *)rsdp)->length);
if (result) {
printk(KERN_WARNING " >>> ERROR: Invalid checksum\n");
return -ENODEV;
}
/* Locate and map the System Description table (RSDT/XSDT) */
if (acpi_table_get_sdt(rsdp))
return -ENODEV;
return 0;
}
+1 -1
View File
@@ -3,8 +3,8 @@
obj-y += console/
obj-y += evtchn/
obj-y += balloon/
obj-y += privcmd/
obj-$(CONFIG_XEN_PRIVILEGED_GUEST) += privcmd/
obj-$(CONFIG_XEN_BLKDEV_BACKEND) += blkback/
obj-$(CONFIG_XEN_NETDEV_BACKEND) += netback/
obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += blkfront/
@@ -39,6 +39,7 @@
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/proc_fs.h>
#include <net/sock.h>
#include <net/pkt_sched.h>
#include <net/arp.h>
@@ -49,6 +50,7 @@
#include <asm-xen/xen-public/io/netif.h>
#include <asm-xen/balloon.h>
#include <asm/page.h>
#include <asm/uaccess.h>
#ifndef __GFP_NOWARN
#define __GFP_NOWARN 0
@@ -85,6 +87,16 @@ static unsigned long rx_pfn_array[NETIF_RX_RING_SIZE];
static multicall_entry_t rx_mcl[NETIF_RX_RING_SIZE+1];
static mmu_update_t rx_mmu[NETIF_RX_RING_SIZE];
#ifdef CONFIG_PROC_FS
static int xennet_proc_init(void);
static int xennet_proc_addif(struct net_device *dev);
static void xennet_proc_delif(struct net_device *dev);
#else
#define xennet_proc_init() (0)
#define xennet_proc_addif(d) (0)
#define xennet_proc_delif(d) ((void)0)
#endif
static struct list_head dev_list;
struct net_private
@@ -120,7 +132,7 @@ struct net_private
/* Receive-ring batched refills. */
#define RX_MIN_TARGET 8
#define RX_MAX_TARGET NETIF_RX_RING_SIZE
int rx_target;
int rx_min_target, rx_max_target, rx_target;
struct sk_buff_head rx_batch;
/*
@@ -413,8 +425,8 @@ static void network_alloc_rx_buffers(struct net_device *dev)
/* Adjust our floating fill target if we risked running out of buffers. */
if (((req_prod - np->rx->resp_prod) < (np->rx_target / 4)) &&
((np->rx_target *= 2) > RX_MAX_TARGET))
np->rx_target = RX_MAX_TARGET;
((np->rx_target *= 2) > np->rx_max_target))
np->rx_target = np->rx_max_target;
}
@@ -646,8 +658,8 @@ static int netif_poll(struct net_device *dev, int *pbudget)
/* If we get a callback with very few responses, reduce fill target. */
/* NB. Note exponential increase, linear decrease. */
if (((np->rx->req_prod - np->rx->resp_prod) > ((3*np->rx_target) / 4)) &&
(--np->rx_target < RX_MIN_TARGET))
np->rx_target = RX_MIN_TARGET;
(--np->rx_target < np->rx_min_target))
np->rx_target = np->rx_min_target;
network_alloc_rx_buffers(dev);
@@ -938,7 +950,9 @@ static int create_netdev(int handle, struct net_device **val)
spin_lock_init(&np->rx_lock);
skb_queue_head_init(&np->rx_batch);
np->rx_target = RX_MIN_TARGET;
np->rx_target = RX_MIN_TARGET;
np->rx_min_target = RX_MIN_TARGET;
np->rx_max_target = RX_MAX_TARGET;
/* Initialise {tx,rx}_skbs to be a free chain containing every entry. */
for (i = 0; i <= NETIF_TX_RING_SIZE; i++)
@@ -957,11 +971,17 @@ static int create_netdev(int handle, struct net_device **val)
printk(KERN_WARNING "%s> register_netdev err=%d\n", __FUNCTION__, err);
goto exit;
}
if ((err = xennet_proc_addif(dev)) != 0) {
unregister_netdev(dev);
goto exit;
}
np->dev = dev;
list_add(&np->list, &dev_list);
exit:
if ((err != 0) && (dev != NULL ))
if ((err != 0) && (dev != NULL))
kfree(dev);
else if (val != NULL)
*val = dev;
@@ -1238,6 +1258,9 @@ static int __init netif_init(void)
if (xen_start_info.flags & SIF_INITDOMAIN)
return 0;
if ((err = xennet_proc_init()) != 0)
return err;
IPRINTK("Initialising virtual ethernet driver.\n");
INIT_LIST_HEAD(&dev_list);
(void)register_inetaddr_notifier(&notifier_inetdev);
@@ -1295,6 +1318,153 @@ void netif_resume(void)
}
}
#ifdef CONFIG_PROC_FS
#define TARGET_MIN 0UL
#define TARGET_MAX 1UL
#define TARGET_CUR 2UL
static int xennet_proc_read(
char *page, char **start, off_t off, int count, int *eof, void *data)
{
struct net_device *dev = (struct net_device *)((unsigned long)data & ~3UL);
struct net_private *np = netdev_priv(dev);
int len = 0, which_target = (int)data & 3;
switch (which_target)
{
case TARGET_MIN:
len = sprintf(page, "%d\n", np->rx_min_target);
break;
case TARGET_MAX:
len = sprintf(page, "%d\n", np->rx_max_target);
break;
case TARGET_CUR:
len = sprintf(page, "%d\n", np->rx_target);
break;
}
*eof = 1;
return len;
}
static int xennet_proc_write(
struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
struct net_device *dev = (struct net_device *)((unsigned long)data & ~3UL);
struct net_private *np = netdev_priv(dev);
int which_target = (int)data & 3;
char string[64];
long target;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (count <= 1)
return -EBADMSG; /* runt */
if (count > sizeof(string))
return -EFBIG; /* too long */
if (copy_from_user(string, buffer, count))
return -EFAULT;
string[sizeof(string)-1] = '\0';
target = simple_strtol(string, NULL, 10);
if (target < RX_MIN_TARGET)
target = RX_MIN_TARGET;
if (target > RX_MAX_TARGET)
target = RX_MAX_TARGET;
spin_lock(&np->rx_lock);
switch (which_target)
{
case TARGET_MIN:
if (target > np->rx_max_target)
np->rx_max_target = target;
np->rx_min_target = target;
if (target > np->rx_target)
np->rx_target = target;
break;
case TARGET_MAX:
if (target < np->rx_min_target)
np->rx_min_target = target;
np->rx_max_target = target;
if (target < np->rx_target)
np->rx_target = target;
break;
case TARGET_CUR:
break;
}
network_alloc_rx_buffers(dev);
spin_unlock(&np->rx_lock);
return count;
}
static int xennet_proc_init(void)
{
if (proc_mkdir("xen/net", NULL) == NULL)
return -ENOMEM;
return 0;
}
static int xennet_proc_addif(struct net_device *dev)
{
struct proc_dir_entry *dir, *min, *max, *cur;
char name[30];
sprintf(name, "xen/net/%s", dev->name);
dir = proc_mkdir(name, NULL);
if (!dir)
goto nomem;
min = create_proc_entry("rxbuf_min", 0644, dir);
max = create_proc_entry("rxbuf_max", 0644, dir);
cur = create_proc_entry("rxbuf_cur", 0444, dir);
if (!min || !max || !cur)
goto nomem;
min->read_proc = xennet_proc_read;
min->write_proc = xennet_proc_write;
min->data = (void *)((unsigned long)dev | TARGET_MIN);
max->read_proc = xennet_proc_read;
max->write_proc = xennet_proc_write;
max->data = (void *)((unsigned long)dev | TARGET_MAX);
cur->read_proc = xennet_proc_read;
cur->write_proc = xennet_proc_write;
cur->data = (void *)((unsigned long)dev | TARGET_CUR);
return 0;
nomem:
xennet_proc_delif(dev);
return -ENOMEM;
}
static void xennet_proc_delif(struct net_device *dev)
{
char name[30];
sprintf(name, "xen/net/%s/rxbuf_min", dev->name);
remove_proc_entry(name, NULL);
sprintf(name, "xen/net/%s/rxbuf_max", dev->name);
remove_proc_entry(name, NULL);
sprintf(name, "xen/net/%s/rxbuf_cur", dev->name);
remove_proc_entry(name, NULL);
sprintf(name, "xen/net/%s", dev->name);
remove_proc_entry(name, NULL);
}
#endif
module_init(netif_init);
@@ -219,9 +219,6 @@ static struct file_operations privcmd_file_ops = {
static int __init privcmd_init(void)
{
if ( !(xen_start_info.flags & SIF_PRIVILEGED) )
return 0;
privcmd_intf = create_xen_proc_entry("privcmd", 0400);
if ( privcmd_intf != NULL )
privcmd_intf->proc_fops = &privcmd_file_ops;
@@ -80,6 +80,7 @@ enum fixed_addresses {
#ifdef CONFIG_ACPI_BOOT
FIX_ACPI_BEGIN,
FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
FIX_ACPI_RSDP_PAGE,
#endif
#ifdef CONFIG_PCI_MMCONFIG
FIX_PCIE_MCFG,
@@ -103,15 +104,9 @@ enum fixed_addresses {
extern void __set_fixmap (enum fixed_addresses idx,
unsigned long phys, pgprot_t flags);
extern void __set_fixmap_ma (enum fixed_addresses idx,
unsigned long mach, pgprot_t flags);
#define set_fixmap(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL)
#define set_fixmap_ma(idx, phys) \
__set_fixmap_ma(idx, phys, PAGE_KERNEL)
#define set_fixmap_ma_ro(idx, phys) \
__set_fixmap_ma(idx, phys, PAGE_KERNEL_RO)
/*
* Some hardware wants to get fixmapped without caching.
*/
@@ -59,6 +59,9 @@
#define LOCAL_TIMER_VECTOR 0xef
#endif
#define SPURIOUS_APIC_VECTOR 0xff
#define ERROR_APIC_VECTOR 0xfe
/*
* First APIC vector available to drivers: (vectors 0x30-0xee)
* we start at 0x31 to spread out vectors evenly between priority
@@ -60,17 +60,8 @@ enum fixed_addresses {
extern void __set_fixmap (enum fixed_addresses idx,
unsigned long phys, pgprot_t flags);
extern void __set_fixmap_ma (enum fixed_addresses idx,
unsigned long mach, pgprot_t flags);
#define set_fixmap(idx, phys) \
__set_fixmap(idx, phys, PAGE_KERNEL)
#define set_fixmap_ma(idx, phys) \
__set_fixmap_ma(idx, phys, PAGE_KERNEL)
#define set_fixmap_ma_ro(idx, phys) \
__set_fixmap_ma(idx, phys, PAGE_KERNEL_RO)
/*
* Some hardware wants to get fixmapped without caching.
*/
+1 -1
View File
@@ -66,7 +66,7 @@ relative_lndir ()
(
cd $i
pref=`echo $i | sed -e 's#/[^/]*#../#g' -e 's#^\.##'`
for j in `find . -type f -o -type l -maxdepth 1`; do
for j in `find . -maxdepth 1 -type f -o -type l`; do
ln -sf ${pref}${REAL_DIR}/$i/$j ${SYMLINK_DIR}/$i/$j
done
)
+5 -2
View File
@@ -43,7 +43,7 @@ int xc_domain_create(int xc_handle,
goto fail;
}
return err;
return 0;
fail:
errno_saved = errno;
@@ -103,6 +103,7 @@ int xc_domain_getinfo(int xc_handle,
unsigned int nr_doms;
u32 next_domid = first_domid;
dom0_op_t op;
int rc = 0;
for ( nr_doms = 0; nr_doms < max_doms; nr_doms++ )
{
@@ -110,7 +111,7 @@ int xc_domain_getinfo(int xc_handle,
op.u.getdomaininfo.domain = (domid_t)next_domid;
op.u.getdomaininfo.exec_domain = 0; // FIX ME?!?
op.u.getdomaininfo.ctxt = NULL; /* no exec context info, thanks. */
if ( do_dom0_op(xc_handle, &op) < 0 )
if ( (rc = do_dom0_op(xc_handle, &op)) < 0 )
break;
info->domid = (u16)op.u.getdomaininfo.domain;
@@ -137,6 +138,8 @@ int xc_domain_getinfo(int xc_handle,
info++;
}
if(!nr_doms) return rc;
return nr_doms;
}
+2 -10
View File
@@ -16,14 +16,6 @@ int xc_physdev_pci_access_modify(int xc_handle,
int func,
int enable)
{
dom0_op_t op;
op.cmd = DOM0_PCIDEV_ACCESS;
op.u.pcidev_access.domain = (domid_t)domid;
op.u.pcidev_access.bus = bus;
op.u.pcidev_access.dev = dev;
op.u.pcidev_access.func = func;
op.u.pcidev_access.enable = enable;
return do_dom0_op(xc_handle, &op);
errno = ENOSYS;
return -1;
}
-1
View File
@@ -28,7 +28,6 @@ OBJS += $(patsubst %.c,%.o,$(C_SRCS))
ALL_OBJS := $(BASEDIR)/common/common.o
ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o
ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
-8
View File
@@ -621,8 +621,6 @@ int construct_dom0(struct domain *d,
unsigned long pkern_entry;
unsigned long pkern_end;
extern void physdev_init_dom0(struct domain *);
//printf("construct_dom0: starting\n");
/* Sanity! */
#ifndef CLONE_DOMAIN0
@@ -755,12 +753,6 @@ int construct_dom0(struct domain *d,
#endif
console_endboot(strstr(cmdline, "tty0") != NULL);
/* DOM0 gets access to everything. */
#ifdef CLONE_DOMAIN0
if (d == dom0)
#endif
physdev_init_dom0(d);
set_bit(DF_CONSTRUCTED, &d->d_flags);
new_thread(ed, pkern_entry, 0, 0);
-94
View File
@@ -132,73 +132,6 @@ void free_page_type(struct pfn_info *page, unsigned int type)
dummy();
}
///////////////////////////////
// from arch/x86/pci.c
///////////////////////////////
int
pcibios_prep_mwi (struct pci_dev *dev)
{
dummy();
}
///////////////////////////////
// from arch/x86/pci-irq.c
///////////////////////////////
void pcibios_enable_irq(struct pci_dev *dev)
{
dummy();
}
///////////////////////////////
// from arch/ia64/pci-pc.c
///////////////////////////////
#include <xen/pci.h>
int pcibios_enable_device(struct pci_dev *dev, int mask)
{
dummy();
return 0;
}
int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value) = NULL;
int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value) = NULL;
//struct pci_fixup pcibios_fixups[] = { { 0 } };
struct pci_fixup pcibios_fixups[] = { { 0 } };
void
pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align)
{
dummy();
}
void
pcibios_update_resource(struct pci_dev *dev, struct resource *root,
struct resource *res, int resource)
{
dummy();
}
void __devinit pcibios_fixup_bus(struct pci_bus *b)
{
dummy();
}
void __init pcibios_init(void)
{
dummy();
}
char * __devinit pcibios_setup(char *str)
{
dummy();
return 0;
}
///////////////////////////////
// from arch/ia64/traps.c
///////////////////////////////
@@ -216,33 +149,6 @@ void dump_pageframe_info(struct domain *d)
printk("dump_pageframe_info not implemented\n");
}
///////////////////////////////
// from common/physdev.c
///////////////////////////////
void
physdev_init_dom0(struct domain *d)
{
}
int
physdev_pci_access_modify(domid_t id, int bus, int dev, int func, int enable)
{
return -EINVAL;
}
void physdev_modify_ioport_access_range(struct domain *d, int enable,
int port, int num)
{
printk("physdev_modify_ioport_access_range not implemented\n");
dummy();
}
void physdev_destroy_state(struct domain *d)
{
printk("physdev_destroy_state not implemented\n");
dummy();
}
///////////////////////////////
// called from arch/ia64/head.S
///////////////////////////////
-3
View File
@@ -69,9 +69,6 @@ unsigned char opt_pdb[10] = "none";
unsigned int opt_tbuf_size = 10;
/* opt_sched: scheduler - default to Borrowed Virtual Time */
char opt_sched[10] = "bvt";
/* opt_physdev_dom0_hide: list of PCI slots to hide from domain 0. */
/* Format is '(%02x:%02x.%1x)(%02x:%02x.%1x)' and so on. */
char opt_physdev_dom0_hide[200] = "";
/* opt_leveltrigger, opt_edgetrigger: Force an IO-APIC-routed IRQ to be */
/* level- or edge-triggered. */
/* Example: 'leveltrigger=4,5,6,20 edgetrigger=21'. */
+10 -2
View File
@@ -189,7 +189,7 @@ acpi_parse_lapic_nmi (
#endif /*CONFIG_X86_LOCAL_APIC*/
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
#if defined(CONFIG_X86_IO_APIC) /*&& defined(CONFIG_ACPI_INTERPRETER)*/
static int __init
acpi_parse_ioapic (
@@ -211,6 +211,7 @@ acpi_parse_ioapic (
return 0;
}
#ifdef CONFIG_ACPI_INTERPRETER
/*
* Parse Interrupt Source Override for the ACPI SCI
*/
@@ -244,6 +245,7 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
acpi_sci_override_gsi = gsi;
return;
}
#endif
static int __init
acpi_parse_fadt(unsigned long phys, unsigned long size)
@@ -277,11 +279,13 @@ acpi_parse_int_src_ovr (
acpi_table_print_madt_entry(header);
#ifdef CONFIG_ACPI_INTERPRETER
if (intsrc->bus_irq == acpi_fadt.sci_int) {
acpi_sci_ioapic_setup(intsrc->global_irq,
intsrc->flags.polarity, intsrc->flags.trigger);
return 0;
}
#endif
mp_override_legacy_irq (
intsrc->bus_irq,
@@ -460,13 +464,14 @@ acpi_boot_init (void)
#endif /*CONFIG_X86_LOCAL_APIC*/
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
#if defined(CONFIG_X86_IO_APIC) /*&& defined(CONFIG_ACPI_INTERPRETER)*/
/*
* I/O APIC
* --------
*/
#if 0
/*
* ACPI interpreter is required to complete interrupt setup,
* so if it is off, don't enumerate the io-apics with ACPI.
@@ -476,6 +481,7 @@ acpi_boot_init (void)
if (acpi_disabled || acpi_noirq) {
return 1;
}
#endif
/*
* if "noapic" boot option, don't look for IO-APICs
@@ -510,12 +516,14 @@ acpi_boot_init (void)
return result;
}
#ifdef CONFIG_ACPI_INTERPRETER
/*
* If BIOS did not supply an INT_SRC_OVR for the SCI
* pretend we got one so we can set the SCI flags.
*/
if (!acpi_sci_override_gsi)
acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
#endif
result = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src);
if (result < 0) {
+3
View File
@@ -37,6 +37,7 @@
#include <asm/vmx.h>
#include <asm/vmx_vmcs.h>
#include <asm/msr.h>
#include <asm/physdev.h>
#include <xen/kernel.h>
#include <public/io/ioreq.h>
#include <xen/multicall.h>
@@ -968,6 +969,8 @@ void domain_relinquish_resources(struct domain *d)
BUG_ON(d->cpuset != 0);
physdev_destroy_state(d);
ptwr_destroy(d);
/* Release device mappings of other domains */
+95 -48
View File
@@ -313,46 +313,6 @@ static int __init find_isa_irq_pin(int irq, int type)
*/
static int pin_2_irq(int idx, int apic, int pin);
int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
{
int apic, i, best_guess = -1;
Dprintk("querying PCI -> IRQ mapping bus:%d, slot:%d, pin:%d.\n",
bus, slot, pin);
if ((mp_bus_id_to_pci_bus==NULL) || (mp_bus_id_to_pci_bus[bus] == -1)) {
printk(KERN_WARNING "PCI BIOS passed nonexistent PCI bus %d!\n", bus);
return -1;
}
for (i = 0; i < mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
for (apic = 0; apic < nr_ioapics; apic++)
if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic ||
mp_irqs[i].mpc_dstapic == MP_APIC_ALL)
break;
if ((mp_bus_id_to_type[lbus] == MP_BUS_PCI) &&
!mp_irqs[i].mpc_irqtype &&
(bus == lbus) &&
(slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) {
int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq);
if (!(apic || IO_APIC_IRQ(irq)))
continue;
if (pin == (mp_irqs[i].mpc_srcbusirq & 3))
return irq;
/*
* Use the first all-but-pin matching entry as a
* best-guess fuzzy result for broken mptables.
*/
if (best_guess < 0)
best_guess = irq;
}
}
return best_guess;
}
/*
* EISA Edge/Level control register, ELCR
*/
@@ -615,11 +575,9 @@ static inline int IO_APIC_irq_trigger(int irq)
int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 };
#ifdef CONFIG_VMX
int vector_irq[256];
#endif
static int __init assign_irq_vector(int irq)
int assign_irq_vector(int irq)
{
static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
if (IO_APIC_VECTOR(irq) > 0)
@@ -641,10 +599,9 @@ next:
panic("ran out of interrupt sources!");
IO_APIC_VECTOR(irq) = current_vector;
#ifdef CONFIG_VMX
vector_irq[current_vector] = irq;
printk("vector_irq[%x] = %d\n", current_vector, irq);
#endif
return current_vector;
}
@@ -1627,6 +1584,16 @@ static inline void check_timer(void)
panic("IO-APIC + timer doesn't work! pester mingo@redhat.com");
}
#define NR_IOAPIC_BIOSIDS 256
static u8 ioapic_biosid_to_apic_enum[NR_IOAPIC_BIOSIDS];
static void store_ioapic_biosid_mapping(void)
{
u8 apic;
memset(ioapic_biosid_to_apic_enum, ~0, NR_IOAPIC_BIOSIDS);
for ( apic = 0; apic < nr_ioapics; apic++ )
ioapic_biosid_to_apic_enum[mp_ioapics[apic].mpc_apicid] = apic;
}
/*
*
* IRQ's that are handled by the old PIC in all cases:
@@ -1646,6 +1613,8 @@ static inline void check_timer(void)
void __init setup_IO_APIC(void)
{
store_ioapic_biosid_mapping();
enable_IO_APIC();
io_apic_irqs = ~PIC_IRQS;
@@ -1660,8 +1629,7 @@ void __init setup_IO_APIC(void)
setup_IO_APIC_irqs();
init_IO_APIC_traps();
check_timer();
if (!acpi_ioapic)
print_IO_APIC();
print_IO_APIC();
}
#endif /* CONFIG_X86_IO_APIC */
@@ -1949,3 +1917,82 @@ static int __init ioapic_trigger_setup(void)
}
__initcall(ioapic_trigger_setup);
int ioapic_guest_read(int apicid, int address, u32 *pval)
{
u32 val;
int apicenum;
struct IO_APIC_reg_00 reg_00;
unsigned long flags;
if ( (apicid >= NR_IOAPIC_BIOSIDS) ||
((apicenum = ioapic_biosid_to_apic_enum[apicid]) >= nr_ioapics) )
return -EINVAL;
spin_lock_irqsave(&ioapic_lock, flags);
val = io_apic_read(apicenum, address);
spin_unlock_irqrestore(&ioapic_lock, flags);
/* Rewrite APIC ID to what the BIOS originally specified. */
if ( address == 0 )
{
*(int *)&reg_00 = val;
reg_00.ID = apicid;
val = *(u32 *)&reg_00;
}
*pval = val;
return 0;
}
int ioapic_guest_write(int apicid, int address, u32 val)
{
int apicenum, pin, irq;
struct IO_APIC_route_entry rte = { 0 };
struct irq_pin_list *entry;
unsigned long flags;
if ( (apicid >= NR_IOAPIC_BIOSIDS) ||
((apicenum = ioapic_biosid_to_apic_enum[apicid]) >= nr_ioapics) )
return -EINVAL;
/* Only write to the first half of a route entry. */
if ( (address < 0x10) || (address & 1) )
return 0;
pin = (address - 0x10) >> 1;
rte.dest.logical.logical_dest = target_cpus();
*(int *)&rte = val;
if ( rte.vector >= FIRST_DEVICE_VECTOR )
{
/* Is there a valid irq mapped to this vector? */
irq = vector_irq[rte.vector];
if ( !IO_APIC_IRQ(irq) )
return 0;
/* Set the correct irq-handling type. */
irq_desc[irq].handler = rte.trigger ?
&ioapic_level_irq_type: &ioapic_edge_irq_type;
/* Record the pin<->irq mapping. */
for ( entry = &irq_2_pin[irq]; ; entry = &irq_2_pin[entry->next] )
{
if ( (entry->apic == apicenum) && (entry->pin == pin) )
break;
if ( !entry->next )
{
add_pin_to_irq(irq, apicenum, pin);
break;
}
}
}
spin_lock_irqsave(&ioapic_lock, flags);
io_apic_write(apicenum, 0x10 + 2 * pin, *(((int *)&rte) + 0));
io_apic_write(apicenum, 0x11 + 2 * pin, *(((int *)&rte) + 1));
spin_unlock_irqrestore(&ioapic_lock, flags);
return 0;
}
+2 -2
View File
@@ -1017,7 +1017,7 @@ void __init mp_register_lapic (
MP_processor_info(&processor);
}
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
#if defined(CONFIG_X86_IO_APIC) /*&& defined(CONFIG_ACPI_INTERPRETER)*/
#define MP_ISA_BUS 0
#define MP_MAX_IOAPIC_PIN 127
@@ -1085,7 +1085,7 @@ void __init mp_register_ioapic (
mp_ioapic_routing[idx].irq_end = irq_base +
io_apic_get_redir_entries(idx);
printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%lx, "
printk("IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
"IRQ %d-%d\n", idx, mp_ioapics[idx].mpc_apicid,
mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr,
mp_ioapic_routing[idx].irq_start,
+1 -1
View File
@@ -1,8 +1,8 @@
/* This only handles 32bit MTRR on 32bit hosts. This is strictly wrong
because MTRRs can span upto 40 bits (36bits on most modern x86) */
#include <xen/init.h>
#include <xen/slab.h>
#include <xen/mm.h>
#include <xen/slab.h>
#include <asm/io.h>
#include <asm/mtrr.h>
#include <asm/msr.h>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-402
View File
@@ -1,402 +0,0 @@
/*
* Low-Level PCI Access for i386 machines
*
* Copyright 1993, 1994 Drew Eckhardt
* Visionary Computing
* (Unix and Linux consulting and custom programming)
* Drew@Colorado.EDU
* +1 (303) 786-7975
*
* Drew's work was sponsored by:
* iX Multiuser Multitasking Magazine
* Hannover, Germany
* hm@ix.de
*
* Copyright 1997--2000 Martin Mares <mj@ucw.cz>
*
* For more information, please consult the following manuals (look at
* http://www.pcisig.com/ for how to get them):
*
* PCI BIOS Specification
* PCI Local Bus Specification
* PCI to PCI Bridge Specification
* PCI System Design Guide
*
*
* CHANGELOG :
* Jun 17, 1994 : Modified to accommodate the broken pre-PCI BIOS SPECIFICATION
* Revision 2.0 present on <thys@dennis.ee.up.ac.za>'s ASUS mainboard.
*
* Jan 5, 1995 : Modified to probe PCI hardware at boot time by Frederic
* Potter, potter@cao-vlsi.ibp.fr
*
* Jan 10, 1995 : Modified to store the information about configured pci
* devices into a list, which can be accessed via /proc/pci by
* Curtis Varner, cvarner@cs.ucr.edu
*
* Jan 12, 1995 : CPU-PCI bridge optimization support by Frederic Potter.
* Alpha version. Intel & UMC chipset support only.
*
* Apr 16, 1995 : Source merge with the DEC Alpha PCI support. Most of the code
* moved to drivers/pci/pci.c.
*
* Dec 7, 1996 : Added support for direct configuration access of boards
* with Intel compatible access schemes (tsbogend@alpha.franken.de)
*
* Feb 3, 1997 : Set internal functions to static, save/restore flags
* avoid dead locks reading broken PCI BIOS, werner@suse.de
*
* Apr 26, 1997 : Fixed case when there is BIOS32, but not PCI BIOS
* (mj@atrey.karlin.mff.cuni.cz)
*
* May 7, 1997 : Added some missing cli()'s. [mj]
*
* Jun 20, 1997 : Corrected problems in "conf1" type accesses.
* (paubert@iram.es)
*
* Aug 2, 1997 : Split to PCI BIOS handling and direct PCI access parts
* and cleaned it up... Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*
* Feb 6, 1998 : No longer using BIOS to find devices and device classes. [mj]
*
* May 1, 1998 : Support for peer host bridges. [mj]
*
* Jun 19, 1998 : Changed to use spinlocks, so that PCI configuration space
* can be accessed from interrupts even on SMP systems. [mj]
*
* August 1998 : Better support for peer host bridges and more paranoid
* checks for direct hardware access. Ugh, this file starts to look as
* a large gallery of common hardware bug workarounds (watch the comments)
* -- the PCI specs themselves are sane, but most implementors should be
* hit hard with \hammer scaled \magstep5. [mj]
*
* Jan 23, 1999 : More improvements to peer host bridge logic. i450NX fixup. [mj]
*
* Feb 8, 1999 : Added UM8886BF I/O address fixup. [mj]
*
* August 1999 : New resource management and configuration access stuff. [mj]
*
* Sep 19, 1999 : Use PCI IRQ routing tables for detection of peer host bridges.
* Based on ideas by Chris Frantz and David Hinds. [mj]
*
* Sep 28, 1999 : Handle unreported/unassigned IRQs. Thanks to Shuu Yamaguchi
* for a lot of patience during testing. [mj]
*
* Oct 8, 1999 : Split to pci-i386.c, pci-pc.c and pci-visws.c. [mj]
*/
#include <xen/types.h>
#include <xen/lib.h>
#include <xen/pci.h>
#include <xen/init.h>
#include <xen/ioport.h>
#include <xen/errno.h>
#include "pci-x86.h"
void
pcibios_update_resource(struct pci_dev *dev, struct resource *root,
struct resource *res, int resource)
{
u32 new, check;
int reg;
new = res->start | (res->flags & PCI_REGION_FLAG_MASK);
if (resource < 6) {
reg = PCI_BASE_ADDRESS_0 + 4*resource;
} else if (resource == PCI_ROM_RESOURCE) {
res->flags |= PCI_ROM_ADDRESS_ENABLE;
new |= PCI_ROM_ADDRESS_ENABLE;
reg = dev->rom_base_reg;
} else {
/* Somebody might have asked allocation of a non-standard resource */
return;
}
pci_write_config_dword(dev, reg, new);
pci_read_config_dword(dev, reg, &check);
if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {
printk(KERN_ERR "PCI: Error while updating region "
"%s/%d (%08x != %08x)\n", dev->slot_name, resource,
new, check);
}
}
/*
* We need to avoid collisions with `mirrored' VGA ports
* and other strange ISA hardware, so we always want the
* addresses to be allocated in the 0x000-0x0ff region
* modulo 0x400.
*
* Why? Because some silly external IO cards only decode
* the low 10 bits of the IO address. The 0x00-0xff region
* is reserved for motherboard devices that decode all 16
* bits, so it's ok to allocate at, say, 0x2800-0x28ff,
* but we want to try to avoid allocating at 0x2900-0x2bff
* which might have be mirrored at 0x0100-0x03ff..
*/
void
pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align)
{
if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start;
if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
res->start = start;
}
}
}
/*
* Handle resources of PCI devices. If the world were perfect, we could
* just allocate all the resource regions and do nothing more. It isn't.
* On the other hand, we cannot just re-allocate all devices, as it would
* require us to know lots of host bridge internals. So we attempt to
* keep as much of the original configuration as possible, but tweak it
* when it's found to be wrong.
*
* Known BIOS problems we have to work around:
* - I/O or memory regions not configured
* - regions configured, but not enabled in the command register
* - bogus I/O addresses above 64K used
* - expansion ROMs left enabled (this may sound harmless, but given
* the fact the PCI specs explicitly allow address decoders to be
* shared between expansion ROMs and other resource regions, it's
* at least dangerous)
*
* Our solution:
* (1) Allocate resources for all buses behind PCI-to-PCI bridges.
* This gives us fixed barriers on where we can allocate.
* (2) Allocate resources for all enabled devices. If there is
* a collision, just mark the resource as unallocated. Also
* disable expansion ROMs during this step.
* (3) Try to allocate resources for disabled devices. If the
* resources were assigned correctly, everything goes well,
* if they weren't, they won't disturb allocation of other
* resources.
* (4) Assign new addresses to resources which were either
* not configured at all or misconfigured. If explicitly
* requested by the user, configure expansion ROM address
* as well.
*/
static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
{
struct list_head *ln;
struct pci_bus *bus;
struct pci_dev *dev;
int idx;
struct resource *r, *pr;
/* Depth-First Search on bus tree */
for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
bus = pci_bus_b(ln);
if ((dev = bus->self)) {
for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
r = &dev->resource[idx];
if (!r->start)
continue;
pr = pci_find_parent_resource(dev, r);
if (!pr || request_resource(pr, r) < 0)
printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, dev->slot_name);
}
}
pcibios_allocate_bus_resources(&bus->children);
}
}
static void __init pcibios_allocate_resources(int pass)
{
struct pci_dev *dev;
int idx, disabled;
u16 command;
struct resource *r, *pr;
pci_for_each_dev(dev) {
pci_read_config_word(dev, PCI_COMMAND, &command);
for(idx = 0; idx < 6; idx++) {
r = &dev->resource[idx];
if (r->parent) /* Already allocated */
continue;
if (!r->start) /* Address not assigned at all */
continue;
if (r->flags & IORESOURCE_IO)
disabled = !(command & PCI_COMMAND_IO);
else
disabled = !(command & PCI_COMMAND_MEMORY);
if (pass == disabled) {
DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
r->start, r->end, r->flags, disabled, pass);
pr = pci_find_parent_resource(dev, r);
if (!pr || request_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, dev->slot_name);
/* We'll assign a new address later */
r->end -= r->start;
r->start = 0;
}
}
}
if (!pass) {
r = &dev->resource[PCI_ROM_RESOURCE];
if (r->flags & PCI_ROM_ADDRESS_ENABLE) {
/* Turn the ROM off, leave the resource region, but keep it unregistered. */
u32 reg;
DBG("PCI: Switching off ROM of %s\n", dev->slot_name);
r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
pci_read_config_dword(dev, dev->rom_base_reg, &reg);
pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE);
}
}
}
}
static void __init pcibios_assign_resources(void)
{
struct pci_dev *dev;
int idx;
struct resource *r;
pci_for_each_dev(dev) {
int class = dev->class >> 8;
/* Don't touch classless devices and host bridges */
if (!class || class == PCI_CLASS_BRIDGE_HOST)
continue;
for(idx=0; idx<6; idx++) {
r = &dev->resource[idx];
/*
* Don't touch IDE controllers and I/O ports of video cards!
*/
if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||
(class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))
continue;
/*
* We shall assign a new address to this resource, either because
* the BIOS forgot to do so or because we have decided the old
* address was unusable for some reason.
*/
if (!r->start && r->end)
pci_assign_resource(dev, idx);
}
if (pci_probe & PCI_ASSIGN_ROMS) {
r = &dev->resource[PCI_ROM_RESOURCE];
r->end -= r->start;
r->start = 0;
if (r->end)
pci_assign_resource(dev, PCI_ROM_RESOURCE);
}
}
}
void __init pcibios_set_cacheline_size(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
pci_cache_line_size = 32 >> 2;
if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)
pci_cache_line_size = 64 >> 2; /* K7 & K8 */
else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL)
pci_cache_line_size = 128 >> 2; /* P4 */
}
void __init pcibios_resource_survey(void)
{
DBG("PCI: Allocating resources\n");
pcibios_allocate_bus_resources(&pci_root_buses);
pcibios_allocate_resources(0);
pcibios_allocate_resources(1);
pcibios_assign_resources();
}
int pcibios_enable_resources(struct pci_dev *dev, int mask)
{
u16 cmd, old_cmd;
int idx;
struct resource *r;
pci_read_config_word(dev, PCI_COMMAND, &cmd);
old_cmd = cmd;
for(idx=0; idx<6; idx++) {
/* Only set up the requested stuff */
if (!(mask & (1<<idx)))
continue;
r = &dev->resource[idx];
if (!r->start && r->end) {
printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
return -EINVAL;
}
if (r->flags & IORESOURCE_IO)
cmd |= PCI_COMMAND_IO;
if (r->flags & IORESOURCE_MEM)
cmd |= PCI_COMMAND_MEMORY;
}
if (dev->resource[PCI_ROM_RESOURCE].start)
cmd |= PCI_COMMAND_MEMORY;
if (cmd != old_cmd) {
printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd);
pci_write_config_word(dev, PCI_COMMAND, cmd);
}
return 0;
}
/*
* If we set up a device for bus mastering, we need to check the latency
* timer as certain crappy BIOSes forget to set it properly.
*/
unsigned int pcibios_max_latency = 255;
void pcibios_set_master(struct pci_dev *dev)
{
u8 lat;
pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
if (lat < 16)
lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
else if (lat > pcibios_max_latency)
lat = pcibios_max_latency;
else
return;
printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", dev->slot_name, lat);
pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
}
#if 0
int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine)
{
unsigned long prot;
/* I/O space cannot be accessed via normal processor loads and
* stores on this platform.
*/
if (mmap_state == pci_mmap_io)
return -EINVAL;
/* Leave vm_pgoff as-is, the PCI space address is the physical
* address on this platform.
*/
vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);
prot = pgprot_val(vma->vm_page_prot);
if (boot_cpu_data.x86 > 3)
prot |= _PAGE_PCD | _PAGE_PWT;
vma->vm_page_prot = __pgprot(prot);
/* Write-combine setting is ignored, it is changed via the mtrr
* interfaces on this platform.
*/
if (remap_page_range(vma->vm_start, vma->vm_pgoff << PAGE_SHIFT,
vma->vm_end - vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;
return 0;
}
#endif
-71
View File
@@ -1,71 +0,0 @@
/*
* Low-Level PCI Access for i386 machines.
*
* (c) 1999 Martin Mares <mj@ucw.cz>
*/
#undef DEBUG
#ifdef DEBUG
#define DBG(x...) printk(x)
#else
#define DBG(x...)
#endif
#define PCI_PROBE_BIOS 0x0001
#define PCI_PROBE_CONF1 0x0002
#define PCI_PROBE_CONF2 0x0004
#define PCI_NO_SORT 0x0100
#define PCI_BIOS_SORT 0x0200
#define PCI_NO_CHECKS 0x0400
#define PCI_ASSIGN_ROMS 0x1000
#define PCI_BIOS_IRQ_SCAN 0x2000
#define PCI_ASSIGN_ALL_BUSSES 0x4000
extern unsigned int pci_probe;
/* pci-i386.c */
extern unsigned int pcibios_max_latency;
extern u8 pci_cache_line_size;
void pcibios_resource_survey(void);
void pcibios_set_cacheline_size(void);
int pcibios_enable_resources(struct pci_dev *, int);
/* pci-pc.c */
extern int pcibios_last_bus;
extern struct pci_bus *pci_root_bus;
extern struct pci_ops *pci_root_ops;
/* pci-irq.c */
struct irq_info {
u8 bus, devfn; /* Bus, device and function */
struct {
u8 link; /* IRQ line ID, chipset dependent, 0=not routed */
u16 bitmap; /* Available IRQs */
} __attribute__((packed)) irq[4];
u8 slot; /* Slot number, 0=onboard */
u8 rfu;
} __attribute__((packed));
struct irq_routing_table {
u32 signature; /* PIRQ_SIGNATURE should be here */
u16 version; /* PIRQ_VERSION */
u16 size; /* Table size in bytes */
u8 rtr_bus, rtr_devfn; /* Where the interrupt router lies */
u16 exclusive_irqs; /* IRQs devoted exclusively to PCI usage */
u16 rtr_vendor, rtr_device; /* Vendor and device ID of interrupt router */
u32 miniport_data; /* Crap */
u8 rfu[11];
u8 checksum; /* Modulo 256 checksum must give zero */
struct irq_info slots[0];
} __attribute__((packed));
extern unsigned int pcibios_irq_mask;
void pcibios_irq_init(void);
void pcibios_fixup_irqs(void);
void pcibios_enable_irq(struct pci_dev *dev);
+145
View File
@@ -0,0 +1,145 @@
#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/types.h>
#include <xen/sched.h>
#include <xen/irq.h>
#include <xen/event.h>
#include <asm/smpboot.h>
#include <public/xen.h>
#include <public/physdev.h>
extern void (*interrupt[])(void);
extern int ioapic_guest_read(int apicid, int address, u32 *pval);
extern int ioapic_guest_write(int apicid, int address, u32 pval);
void physdev_modify_ioport_access_range(
struct domain *d, int enable, int port, int num)
{
int i;
for ( i = port; i < (port + num); i++ )
(enable ? clear_bit : set_bit)(i, d->arch.iobmp_mask);
}
void physdev_destroy_state(struct domain *d)
{
xfree(d->arch.iobmp_mask);
d->arch.iobmp_mask = NULL;
}
/* Check if a domain controls a device with IO memory within frame @pfn.
* Returns: 1 if the domain should be allowed to map @pfn, 0 otherwise. */
int domain_iomem_in_pfn(struct domain *p, unsigned long pfn)
{
return 0;
}
/*
* Demuxing hypercall.
*/
long do_physdev_op(physdev_op_t *uop)
{
physdev_op_t op;
long ret;
int irq;
if ( unlikely(copy_from_user(&op, uop, sizeof(op)) != 0) )
return -EFAULT;
switch ( op.cmd )
{
case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
ret = pirq_guest_unmask(current->domain);
break;
case PHYSDEVOP_IRQ_STATUS_QUERY:
irq = op.u.irq_status_query.irq;
ret = -EINVAL;
if ( (irq < 0) || (irq >= NR_IRQS) )
break;
op.u.irq_status_query.flags = 0;
/* Edge-triggered interrupts don't need an explicit unmask downcall. */
if ( strstr(irq_desc[irq].handler->typename, "edge") == NULL )
op.u.irq_status_query.flags |= PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY;
ret = 0;
break;
case PHYSDEVOP_APIC_READ:
ret = -EPERM;
if ( !IS_PRIV(current->domain) )
break;
ret = ioapic_guest_read(
op.u.apic_op.apic, op.u.apic_op.offset, &op.u.apic_op.value);
break;
case PHYSDEVOP_APIC_WRITE:
ret = -EPERM;
if ( !IS_PRIV(current->domain) )
break;
ret = ioapic_guest_write(
op.u.apic_op.apic, op.u.apic_op.offset, op.u.apic_op.value);
break;
case PHYSDEVOP_ASSIGN_VECTOR:
if ( !IS_PRIV(current->domain) )
return -EPERM;
if ( (irq = op.u.irq_op.irq) >= NR_IRQS )
return -EINVAL;
op.u.irq_op.vector = assign_irq_vector(irq);
set_intr_gate(op.u.irq_op.vector, interrupt[irq]);
ret = 0;
break;
case PHYSDEVOP_SET_IOPL:
ret = -EINVAL;
if ( op.u.set_iopl.iopl > 3 )
break;
ret = 0;
current->arch.iopl = op.u.set_iopl.iopl;
break;
case PHYSDEVOP_SET_IOBITMAP:
ret = -EINVAL;
if ( !access_ok(op.u.set_iobitmap.bitmap, IOBMP_BYTES) ||
(op.u.set_iobitmap.nr_ports > 65536) )
break;
ret = 0;
current->arch.iobmp = (u8 *)op.u.set_iobitmap.bitmap;
current->arch.iobmp_limit = op.u.set_iobitmap.nr_ports;
break;
default:
ret = -EINVAL;
break;
}
if ( copy_to_user(uop, &op, sizeof(op)) )
ret = -EFAULT;
return ret;
}
/* Domain 0 has read access to all devices. */
void physdev_init_dom0(struct domain *d)
{
/* Access to all I/O ports. */
d->arch.iobmp_mask = xmalloc_array(u8, IOBMP_BYTES);
BUG_ON(d->arch.iobmp_mask == NULL);
memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
set_bit(DF_PHYSDEV, &d->d_flags);
}
/*
* Local variables:
* mode: C
* c-set-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
-1
View File
@@ -4,7 +4,6 @@ include $(BASEDIR)/Rules.mk
ifeq ($(TARGET_ARCH),ia64)
OBJS := $(subst dom_mem_ops.o,,$(OBJS))
OBJS := $(subst grant_table.o,,$(OBJS))
OBJS := $(subst physdev.o,,$(OBJS))
endif
ifneq ($(perfc),y)
-11
View File
@@ -16,7 +16,6 @@
#include <asm/domain_page.h>
#include <xen/trace.h>
#include <xen/console.h>
#include <xen/physdev.h>
#include <public/sched_ctl.h>
extern long arch_do_dom0_op(dom0_op_t *op, dom0_op_t *u_dom0_op);
@@ -385,16 +384,6 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
}
break;
case DOM0_PCIDEV_ACCESS:
{
ret = physdev_pci_access_modify(op->u.pcidev_access.domain,
op->u.pcidev_access.bus,
op->u.pcidev_access.dev,
op->u.pcidev_access.func,
op->u.pcidev_access.enable);
}
break;
case DOM0_SCHED_ID:
{
op->u.sched_id.sched_id = sched_id();
-11
View File
@@ -50,10 +50,6 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
INIT_LIST_HEAD(&d->page_list);
INIT_LIST_HEAD(&d->xenpage_list);
/* Per-domain PCI-device list. */
spin_lock_init(&d->pcidev_lock);
INIT_LIST_HEAD(&d->pcidev_list);
if ( (d->id != IDLE_DOMAIN_ID) &&
((init_event_channels(d) != 0) || (grant_table_create(d) != 0)) )
{
@@ -106,12 +102,6 @@ struct domain *find_domain_by_id(domid_t dom)
}
#ifndef CONFIG_IA64
extern void physdev_destroy_state(struct domain *d);
#else
#define physdev_destroy_state(_d) ((void)0)
#endif
void domain_kill(struct domain *d)
{
struct exec_domain *ed;
@@ -122,7 +112,6 @@ void domain_kill(struct domain *d)
for_each_exec_domain(d, ed)
sched_rem_domain(ed);
domain_relinquish_resources(d);
physdev_destroy_state(d);
put_domain(d);
}
}
-793
View File
@@ -1,793 +0,0 @@
/****************************************************************************
* (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
* (c) 2004 - Keir Fraser - University of Cambridge
****************************************************************************
*
* Description: allows a domain to access devices on the PCI bus
*
* A guest OS may be given access to particular devices on the PCI bus.
* For each domain a list of PCI devices is maintained, describing the
* access mode for the domain.
*
* Guests can figure out the virtualised PCI space through normal PCI config
* register access. Some of the accesses, in particular write accesses, are
* faked. For example the sequence for detecting the IO regions, which requires
* writes to determine the size of the region, is faked out by a very simple
* state machine, preventing direct writes to the PCI config registers by a
* guest.
*/
#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/types.h>
#include <xen/sched.h>
#include <xen/pci.h>
#include <xen/irq.h>
#include <xen/event.h>
#include <asm/pci.h>
#include <public/xen.h>
#include <public/physdev.h>
/* Called by PHYSDEV_PCI_INITIALISE_DEVICE to finalise IRQ routing. */
extern void pcibios_enable_irq(struct pci_dev *dev);
#if 0
#define VERBOSE_INFO(_f, _a...) printk( _f , ## _a )
#else
#define VERBOSE_INFO(_f, _a...) ((void)0)
#endif
#ifdef VERBOSE
#define INFO(_f, _a...) printk( _f, ## _a )
#else
#define INFO(_f, _a...) ((void)0)
#endif
#define SLOPPY_CHECKING
#define ACC_READ 1
#define ACC_WRITE 2
/* Upper bounds for PCI-device addressing. */
#define PCI_BUSMAX 255
#define PCI_DEVMAX 31
#define PCI_FUNCMAX 7
#define PCI_REGMAX 255
/* Bit offsets into state. */
#define ST_BASE_ADDRESS 0 /* bits 0-5: are for base address access */
#define ST_ROM_ADDRESS 6 /* bit 6: is for rom address access */
typedef struct _phys_dev_st {
int flags; /* flags for access etc */
struct pci_dev *dev; /* the device */
struct list_head node; /* link to the list */
struct domain *owner; /* 'owner of this device' */
int state; /* state for various checks */
} phys_dev_t;
/* Find a device on a per-domain device list. */
static phys_dev_t *find_pdev(struct domain *d, struct pci_dev *dev)
{
phys_dev_t *t;
list_for_each_entry ( t, &d->pcidev_list, node )
if ( dev == t->dev )
return t;
return NULL;
}
static int setup_ioport_memory_access(struct domain *d, struct pci_dev *pdev)
{
struct resource *r;
int i, j;
if ( d->arch.iobmp_mask == NULL )
{
if ( (d->arch.iobmp_mask = xmalloc_array(u8, IOBMP_BYTES)) == NULL )
return -ENOMEM;
memset(d->arch.iobmp_mask, 0xFF, IOBMP_BYTES);
}
for ( i = 0; i < DEVICE_COUNT_RESOURCE; i++ )
{
r = &pdev->resource[i];
if ( r->flags & IORESOURCE_IO )
{
INFO("Giving domain %u IO resources (%lx - %lx) "
"for device %s\n", d->id, r->start, r->end, pdev->slot_name);
for ( j = r->start; j < r->end + 1; j++ )
clear_bit(j, d->arch.iobmp_mask);
}
}
return 0;
}
void physdev_modify_ioport_access_range(
struct domain *d, int enable, int port, int num)
{
int i;
for ( i = port; i < (port + num); i++ )
(enable ? clear_bit : set_bit)(i, d->arch.iobmp_mask);
}
/* Add a device to a per-domain device-access list. */
static int add_dev_to_task(struct domain *d, struct pci_dev *dev, int acc)
{
phys_dev_t *physdev;
int rc;
if ( (physdev = xmalloc(phys_dev_t)) == NULL )
{
INFO("Error allocating pdev structure.\n");
return -ENOMEM;
}
if ( (rc = setup_ioport_memory_access(d, dev)) < 0 )
{
xfree(physdev);
return rc;
}
physdev->dev = dev;
physdev->flags = acc;
physdev->state = 0;
list_add(&physdev->node, &d->pcidev_list);
if ( acc == ACC_WRITE )
physdev->owner = d;
return 0;
}
void physdev_destroy_state(struct domain *d)
{
struct list_head *ent;
xfree(d->arch.iobmp_mask);
d->arch.iobmp_mask = NULL;
while ( (ent = d->pcidev_list.next) != &d->pcidev_list )
{
list_del(ent);
xfree(list_entry(ent, phys_dev_t, node));
}
}
/*
* physdev_pci_access_modify:
* Allow/disallow access to a specific PCI device. Guests should not be
* allowed to see bridge devices as it needlessly complicates things (one
* possible exception to this is the AGP bridge).
*/
int physdev_pci_access_modify(domid_t dom, int bus, int dev, int func,
int enable)
{
struct domain *p;
struct pci_dev *pdev;
phys_dev_t *physdev;
int rc = 0;
int oldacc = -1;
BUG_ON(!IS_PRIV(current->domain));
if ( (bus > PCI_BUSMAX) || (dev > PCI_DEVMAX) || (func > PCI_FUNCMAX) )
return -EINVAL;
if ( !enable )
{
INFO("Disallowing access is not yet supported.\n");
return -EINVAL;
}
INFO("physdev_pci_access_modify: %02x:%02x:%02x\n", bus, dev, func);
if ( (p = find_domain_by_id(dom)) == NULL )
return -ESRCH;
/* Make the domain privileged. */
set_bit(DF_PHYSDEV, &p->d_flags);
/* FIXME: MAW for now make the domain REALLY privileged so that it
* can run a backend driver (hw access should work OK otherwise) */
set_bit(DF_PRIVILEGED, &p->d_flags);
/* Grant write access to the specified device. */
if ( (pdev = pci_find_slot(bus, PCI_DEVFN(dev, func))) == NULL )
{
INFO(" dev does not exist\n");
rc = -ENODEV;
goto out;
}
INFO(" add RW %02x:%02x:%02x\n", pdev->bus->number,
PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
if ( (physdev = find_pdev(p, pdev)) != NULL )
{
oldacc = physdev->flags;
physdev->flags = ACC_WRITE;
}
else
{
rc = add_dev_to_task(p, pdev, ACC_WRITE);
}
out:
put_domain(p);
return rc;
}
/* Check if a domain controls a device with IO memory within frame @pfn.
* Returns: 1 if the domain should be allowed to map @pfn, 0 otherwise. */
int domain_iomem_in_pfn(struct domain *p, unsigned long pfn)
{
int ret = 0;
phys_dev_t *phys_dev;
VERBOSE_INFO("Checking if physdev-capable domain %u needs access to "
"pfn %p\n", p->id, pfn);
spin_lock(&p->pcidev_lock);
list_for_each_entry ( phys_dev, &p->pcidev_list, node )
{
int i;
struct pci_dev *pci_dev = phys_dev->dev;
for ( i = 0; (i < DEVICE_COUNT_RESOURCE) && (ret == 0); i++ )
{
struct resource *r = &pci_dev->resource[i];
if ( r->flags & IORESOURCE_MEM )
if ( (r->start >> PAGE_SHIFT) == pfn
|| (r->end >> PAGE_SHIFT) == pfn
|| ((r->start >> PAGE_SHIFT < pfn)
&& (r->end >> PAGE_SHIFT > pfn)) )
ret = 1;
}
if ( ret != 0 ) break;
}
spin_unlock(&p->pcidev_lock);
VERBOSE_INFO("Domain %u %s mapping of pfn %p\n",
p->id, ret ? "allowed" : "disallowed", pfn);
return ret;
}
/* check if a domain has general access to a device */
static inline int check_dev_acc(
struct domain *d, int bus, int dev, int func, phys_dev_t **pdev)
{
struct pci_dev *target_dev;
phys_dev_t *target_pdev;
unsigned int target_devfn;
*pdev = NULL;
if ( !IS_CAPABLE_PHYSDEV(d) )
return -EPERM;
if ( (bus > PCI_BUSMAX) || (dev > PCI_DEVMAX) || (func > PCI_FUNCMAX) )
return -EINVAL;
VERBOSE_INFO("b=%x d=%x f=%x ", bus, dev, func);
/* check target device */
target_devfn = PCI_DEVFN(dev, func);
target_dev = pci_find_slot(bus, target_devfn);
if ( !target_dev )
{
VERBOSE_INFO("target does not exist\n");
return -ENODEV;
}
/* check access */
target_pdev = find_pdev(d, target_dev);
if ( !target_pdev )
{
VERBOSE_INFO("dom has no access to target\n");
return -EPERM;
}
*pdev = target_pdev;
return 0;
}
#ifndef SLOPPY_CHECKING
/*
* Base address registers contain the base address for IO regions.
* The length can be determined by writing all 1s to the register and
* reading the value again. The device will zero the lower unused bits.
*
* to work out the length of the io region a device probe typically does:
* 1) a = read_base_addr_reg()
* 2) write_base_addr_reg(0xffffffff)
* 3) b = read_base_addr_reg() [device zeros lower bits]
* 4) write_base_addr_reg(a) [restore original value]
* this function fakes out step 2-4. *no* writes are made to the device.
*
* phys_dev_t contains a bit field (a bit for each base address register).
* if the bit for a register is set the guest had writen all 1s to the
* register and subsequent read request need to fake out the b.
* if the guest restores the original value (step 4 above) the bit is
* cleared again. If the guest attempts to "restores" a wrong value an
* error is flagged.
*/
static int do_base_address_access(phys_dev_t *pdev, int acc, int idx,
int len, u32 *val)
{
int st_bit, reg = PCI_BASE_ADDRESS_0 + (idx*4), ret = -EINVAL;
struct pci_dev *dev = pdev->dev;
u32 orig_val, sz;
struct resource *res;
if ( len != sizeof(u32) )
{
/* This isn't illegal, but there doesn't seem to be a very good reason
* to do it for normal devices (bridges are another matter). Since it
* would complicate the code below, we don't support this for now. */
/* We could set *val to some value but the guest may well be in trouble
* anyway if this write fails. Hopefully the printk will give us a
* clue what went wrong. */
INFO("Guest %u attempting sub-dword %s to BASE_ADDRESS %d\n",
pdev->owner->id, (acc == ACC_READ) ? "read" : "write", idx);
return -EPERM;
}
st_bit = idx + ST_BASE_ADDRESS;
res = &(pdev->dev->resource[idx]);
if ( acc == ACC_WRITE )
{
if ( (*val == 0xffffffff) ||
((res->flags & IORESOURCE_IO) && (*val == 0xffff)) )
{
/* Set bit and return. */
set_bit(st_bit, &pdev->state);
ret = 0;
}
else
{
/* Assume guest wants to set the base address. */
clear_bit(st_bit, &pdev->state);
/* check if guest tries to restore orig value */
ret = pci_read_config_dword(dev, reg, &orig_val);
if ( (ret == 0) && (*val != orig_val) )
{
INFO("Guest attempting update to BASE_ADDRESS %d\n", idx);
ret = -EPERM;
}
}
VERBOSE_INFO("fixed pci write: %02x:%02x:%02x reg=0x%02x len=0x%02x"
" val=0x%08x %x\n",
dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), reg, len, *val, pdev->state);
}
else if ( acc == ACC_READ )
{
ret = pci_read_config_dword(dev, reg, val);
if ( (ret == 0) && test_bit(st_bit, &pdev->state) )
{
/* Cook the value. */
sz = res->end - res->start;
if ( res->flags & IORESOURCE_MEM )
{
/* this is written out explicitly for clarity */
*val = 0xffffffff;
/* bit 0 = 0 */
/* bit 21 = memory type */
/* bit 3 = prefetchable */
/* bit 4-31 width */
sz = sz >> 4; /* size in blocks of 16 byte */
sz = ~sz; /* invert */
*val = *val & (sz << 4); /* and in the size */
/* use read values for low 4 bits */
*val = *val | (orig_val & 0xf);
}
else if ( res->flags & IORESOURCE_IO )
{
*val = 0x0000ffff;
/* bit 10 = 01 */
/* bit 2-31 width */
sz = sz >> 2; /* size in dwords */
sz = ~sz & 0x0000ffff;
*val = *val & (sz << 2);
*val = *val | 0x1;
}
}
VERBOSE_INFO("fixed pci read: %02x:%02x:%02x reg=0x%02x len=0x%02x"
" val=0x%08x %x\n",
dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), reg, len, *val, pdev->state);
}
return ret;
}
static int do_rom_address_access(phys_dev_t *pdev, int acc, int len, u32 *val)
{
int st_bit, ret = -EINVAL;
struct pci_dev *dev = pdev->dev;
u32 orig_val, sz;
struct resource *res;
if ( len != sizeof(u32) )
{
INFO("Guest attempting sub-dword %s to ROM_ADDRESS\n",
(acc == ACC_READ) ? "read" : "write");
return -EPERM;
}
st_bit = ST_ROM_ADDRESS;
res = &(pdev->dev->resource[PCI_ROM_RESOURCE]);
if ( acc == ACC_WRITE )
{
if ( (*val == 0xffffffff) || (*val == 0xfffffffe) )
{
/* NB. 0xffffffff would be unusual, but we trap it anyway. */
set_bit(st_bit, &pdev->state);
ret = 0;
}
else
{
/* Assume guest wants simply to set the base address. */
clear_bit(st_bit, &pdev->state);
/* Check if guest tries to restore the original value. */
ret = pci_read_config_dword(dev, PCI_ROM_ADDRESS, &orig_val);
if ( (ret == 0) && (*val != orig_val) )
{
if ( (*val != 0x00000000) )
{
INFO("caution: guest tried to change rom address.\n");
ret = -EPERM;
}
else
{
INFO("guest disabled rom access for %02x:%02x:%02x\n",
dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn));
}
}
}
VERBOSE_INFO("fixed pci write: %02x:%02x:%02x reg=0x%02x len=0x%02x"
" val=0x%08x %x\n",
dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), PCI_ROM_ADDRESS, len, *val, pdev->state);
}
else if ( acc == ACC_READ )
{
ret = pci_read_config_dword(dev, PCI_ROM_ADDRESS, val);
if ( (ret == 0) && test_bit(st_bit, &pdev->state) )
{
/* Cook the value. */
sz = res->end - res->start;
*val = 0xffffffff;
/* leave bit 0 untouched */
/* bit 1-10 reserved, harwired to 0 */
sz = sz >> 11; /* size is in 2KB blocks */
sz = ~sz;
*val = *val & (sz << 11);
*val = *val | (orig_val & 0x1);
}
VERBOSE_INFO("fixed pci read: %02x:%02x:%02x reg=0x%02x len=0x%02x"
" val=0x%08x %x\n",
dev->bus->number, PCI_SLOT(dev->devfn),
PCI_FUNC(dev->devfn), PCI_ROM_ADDRESS, len, *val, pdev->state);
}
return ret;
}
#endif /* SLOPPY_CHECKING */
/*
* Handle a PCI config space read access if the domain has access privileges.
*/
static long pci_cfgreg_read(int bus, int dev, int func, int reg,
int len, u32 *val)
{
int ret;
phys_dev_t *pdev;
if ( (ret = check_dev_acc(current->domain, bus, dev, func, &pdev)) != 0 )
{
/* PCI spec states that reads from non-existent devices should return
* all 1s. In this case the domain has no read access, which should
* also look like the device is non-existent. */
*val = 0xFFFFFFFF;
return ret;
}
/* Fake out read requests for some registers. */
switch ( reg )
{
#ifndef SLOPPY_CHECKING
case PCI_BASE_ADDRESS_0:
ret = do_base_address_access(pdev, ACC_READ, 0, len, val);
break;
case PCI_BASE_ADDRESS_1:
ret = do_base_address_access(pdev, ACC_READ, 1, len, val);
break;
case PCI_BASE_ADDRESS_2:
ret = do_base_address_access(pdev, ACC_READ, 2, len, val);
break;
case PCI_BASE_ADDRESS_3:
ret = do_base_address_access(pdev, ACC_READ, 3, len, val);
break;
case PCI_BASE_ADDRESS_4:
ret = do_base_address_access(pdev, ACC_READ, 4, len, val);
break;
case PCI_BASE_ADDRESS_5:
ret = do_base_address_access(pdev, ACC_READ, 5, len, val);
break;
case PCI_ROM_ADDRESS:
ret = do_rom_address_access(pdev, ACC_READ, len, val);
break;
#endif
case PCI_INTERRUPT_LINE:
*val = pdev->dev->irq;
ret = 0;
break;
default:
ret = pci_config_read(0, bus, dev, func, reg, len, val);
VERBOSE_INFO("pci read : %02x:%02x:%02x reg=0x%02x len=0x%02x "
"val=0x%08x\n", bus, dev, func, reg, len, *val);
break;
}
return ret;
}
/*
* Handle a PCI config space write access if the domain has access privileges.
*/
static long pci_cfgreg_write(int bus, int dev, int func, int reg,
int len, u32 val)
{
int ret;
phys_dev_t *pdev;
if ( (ret = check_dev_acc(current->domain, bus, dev, func, &pdev)) != 0 )
return ret;
/* special treatment for some registers */
switch (reg)
{
#ifndef SLOPPY_CHECKING
case PCI_BASE_ADDRESS_0:
ret = do_base_address_access(pdev, ACC_WRITE, 0, len, &val);
break;
case PCI_BASE_ADDRESS_1:
ret = do_base_address_access(pdev, ACC_WRITE, 1, len, &val);
break;
case PCI_BASE_ADDRESS_2:
ret = do_base_address_access(pdev, ACC_WRITE, 2, len, &val);
break;
case PCI_BASE_ADDRESS_3:
ret = do_base_address_access(pdev, ACC_WRITE, 3, len, &val);
break;
case PCI_BASE_ADDRESS_4:
ret = do_base_address_access(pdev, ACC_WRITE, 4, len, &val);
break;
case PCI_BASE_ADDRESS_5:
ret = do_base_address_access(pdev, ACC_WRITE, 5, len, &val);
break;
case PCI_ROM_ADDRESS:
ret = do_rom_address_access(pdev, ACC_WRITE, len, &val);
break;
#endif
default:
if ( pdev->flags != ACC_WRITE )
{
INFO("pci write not allowed %02x:%02x:%02x: "
"reg=0x%02x len=0x%02x val=0x%08x\n",
bus, dev, func, reg, len, val);
ret = -EPERM;
}
else
{
ret = pci_config_write(0, bus, dev, func, reg, len, val);
VERBOSE_INFO("pci write: %02x:%02x:%02x reg=0x%02x len=0x%02x "
"val=0x%08x\n", bus, dev, func, reg, len, val);
}
break;
}
return ret;
}
static long pci_probe_root_buses(u32 *busmask)
{
phys_dev_t *pdev;
memset(busmask, 0, 256/8);
list_for_each_entry ( pdev, &current->domain->pcidev_list, node )
set_bit(pdev->dev->bus->number, busmask);
return 0;
}
/*
* Demuxing hypercall.
*/
long do_physdev_op(physdev_op_t *uop)
{
phys_dev_t *pdev;
physdev_op_t op;
long ret;
int irq;
if ( unlikely(copy_from_user(&op, uop, sizeof(op)) != 0) )
return -EFAULT;
switch ( op.cmd )
{
case PHYSDEVOP_PCI_CFGREG_READ:
ret = pci_cfgreg_read(op.u.pci_cfgreg_read.bus,
op.u.pci_cfgreg_read.dev,
op.u.pci_cfgreg_read.func,
op.u.pci_cfgreg_read.reg,
op.u.pci_cfgreg_read.len,
&op.u.pci_cfgreg_read.value);
break;
case PHYSDEVOP_PCI_CFGREG_WRITE:
ret = pci_cfgreg_write(op.u.pci_cfgreg_write.bus,
op.u.pci_cfgreg_write.dev,
op.u.pci_cfgreg_write.func,
op.u.pci_cfgreg_write.reg,
op.u.pci_cfgreg_write.len,
op.u.pci_cfgreg_write.value);
break;
case PHYSDEVOP_PCI_INITIALISE_DEVICE:
if ( (ret = check_dev_acc(current->domain,
op.u.pci_initialise_device.bus,
op.u.pci_initialise_device.dev,
op.u.pci_initialise_device.func,
&pdev)) == 0 )
pcibios_enable_irq(pdev->dev);
break;
case PHYSDEVOP_PCI_PROBE_ROOT_BUSES:
ret = pci_probe_root_buses(op.u.pci_probe_root_buses.busmask);
break;
case PHYSDEVOP_IRQ_UNMASK_NOTIFY:
ret = pirq_guest_unmask(current->domain);
break;
case PHYSDEVOP_IRQ_STATUS_QUERY:
irq = op.u.irq_status_query.irq;
ret = -EINVAL;
if ( (irq < 0) || (irq >= NR_IRQS) )
break;
op.u.irq_status_query.flags = 0;
/* Edge-triggered interrupts don't need an explicit unmask downcall. */
if ( strstr(irq_desc[irq].handler->typename, "edge") == NULL )
op.u.irq_status_query.flags |= PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY;
ret = 0;
break;
case PHYSDEVOP_SET_IOPL:
ret = -EINVAL;
if ( op.u.set_iopl.iopl > 3 )
break;
ret = 0;
current->arch.iopl = op.u.set_iopl.iopl;
break;
case PHYSDEVOP_SET_IOBITMAP:
ret = -EINVAL;
if ( !access_ok(op.u.set_iobitmap.bitmap, IOBMP_BYTES) ||
(op.u.set_iobitmap.nr_ports > 65536) )
break;
ret = 0;
current->arch.iobmp = (u8 *)op.u.set_iobitmap.bitmap;
current->arch.iobmp_limit = op.u.set_iobitmap.nr_ports;
break;
default:
ret = -EINVAL;
break;
}
if (copy_to_user(uop, &op, sizeof(op)))
ret = -EFAULT;
return ret;
}
/* opt_physdev_dom0_hide: list of PCI slots to hide from domain 0. */
/* Format is '(%02x:%02x.%1x)(%02x:%02x.%1x)' and so on. */
static char opt_physdev_dom0_hide[200] = "";
string_param("physdev_dom0_hide", opt_physdev_dom0_hide);
/* Test if boot params specify this device should NOT be visible to DOM0
* (e.g. so that another domain can control it instead) */
static int pcidev_dom0_hidden(struct pci_dev *dev)
{
char cmp[10] = "(.......)";
strncpy(&cmp[1], dev->slot_name, 7);
if ( strstr(opt_physdev_dom0_hide, dev->slot_name) == NULL )
return 0;
return 1;
}
/* Domain 0 has read access to all devices. */
void physdev_init_dom0(struct domain *d)
{
struct pci_dev *dev;
phys_dev_t *pdev;
/* Access to all I/O ports. */
d->arch.iobmp_mask = xmalloc_array(u8, IOBMP_BYTES);
BUG_ON(d->arch.iobmp_mask == NULL);
memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
/* Access to all PCI devices. */
pci_for_each_dev(dev)
{
if ( pcidev_dom0_hidden(dev) )
{
printk("Hiding PCI device %s from DOM0\n", dev->slot_name);
continue;
}
pdev = xmalloc(phys_dev_t);
BUG_ON(pdev == NULL);
pdev->dev = dev;
pdev->flags = ACC_WRITE;
pdev->state = 0;
pdev->owner = d;
list_add(&pdev->node, &d->pcidev_list);
}
set_bit(DF_PHYSDEV, &d->d_flags);
}
/*
* Local variables:
* mode: C
* c-set-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
-2
View File
@@ -2,9 +2,7 @@
default:
$(MAKE) -C char
$(MAKE) -C acpi
$(MAKE) -C pci
clean:
$(MAKE) -C char clean
$(MAKE) -C acpi clean
$(MAKE) -C pci clean
+1 -54
View File
@@ -1,10 +1,7 @@
#
# Makefile for the Linux ACPI interpreter
#
include $(BASEDIR)/Rules.mk
OBJS := acpi_ksyms.o tables.o
OBJS := tables.o
default: driver.o
driver.o: $(OBJS)
@@ -12,53 +9,3 @@ driver.o: $(OBJS)
clean:
rm -f *.o *~ core
#export ACPI_CFLAGS
#
#ACPI_CFLAGS := -Os
#
#ifdef CONFIG_ACPI_DEBUG
# ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT
#endif
#
#EXTRA_CFLAGS += $(ACPI_CFLAGS)
#
#export-objs := acpi_ksyms.o processor.o
#
#obj-$(CONFIG_ACPI) := acpi_ksyms.o
#
#
# ACPI Boot-Time Table Parsing
#
#obj-$(CONFIG_ACPI_BOOT) += tables.o
#obj-$(CONFIG_ACPI_INTERPRETER) += blacklist.o
#
#
# ACPI Core Subsystem (Interpreter)
#
#ifeq ($(CONFIG_ACPI_INTERPRETER),y)
# obj-y += osl.o utils.o
# subdir-y += dispatcher events executer hardware namespace parser \
# resources tables utilities
# obj-y += $(foreach dir,$(subdir-y),$(dir)/$(dir).o)
#endif
#
#
# ACPI Bus and Device Drivers
#
#ifeq ($(CONFIG_ACPI_BUS),y)
# obj-y += bus.o
# obj-$(CONFIG_ACPI_AC) += ac.o
# obj-$(CONFIG_ACPI_BATTERY) += battery.o
# obj-$(CONFIG_ACPI_BUTTON) += button.o
# obj-$(CONFIG_ACPI_EC) += ec.o
# obj-$(CONFIG_ACPI_FAN) += fan.o
# obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o
# obj-$(CONFIG_ACPI_POWER) += power.o
# obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
# obj-$(CONFIG_ACPI_THERMAL) += thermal.o
# obj-$(CONFIG_ACPI_SYSTEM) += system.o
# obj-$(CONFIG_ACPI_NUMA) += numa.o
# obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o
# obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
#endif
-157
View File
@@ -1,157 +0,0 @@
/*
* acpi_ksyms.c - ACPI Kernel Symbols ($Revision: 15 $)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <xen/config.h>
#include <xen/acpi.h>
#ifdef CONFIG_ACPI_INTERPRETER
/* ACPI Debugger */
#ifdef ENABLE_DEBUGGER
extern int acpi_in_debugger;
EXPORT_SYMBOL(acpi_in_debugger);
EXPORT_SYMBOL(acpi_db_user_commands);
#endif /* ENABLE_DEBUGGER */
/* ACPI Core Subsystem */
#ifdef ACPI_DEBUG_OUTPUT
EXPORT_SYMBOL(acpi_dbg_layer);
EXPORT_SYMBOL(acpi_dbg_level);
EXPORT_SYMBOL(acpi_ut_debug_print_raw);
EXPORT_SYMBOL(acpi_ut_debug_print);
EXPORT_SYMBOL(acpi_ut_status_exit);
EXPORT_SYMBOL(acpi_ut_value_exit);
EXPORT_SYMBOL(acpi_ut_exit);
EXPORT_SYMBOL(acpi_ut_trace);
#endif /*ACPI_DEBUG_OUTPUT*/
EXPORT_SYMBOL(acpi_get_handle);
EXPORT_SYMBOL(acpi_get_parent);
EXPORT_SYMBOL(acpi_get_type);
EXPORT_SYMBOL(acpi_get_name);
EXPORT_SYMBOL(acpi_get_object_info);
EXPORT_SYMBOL(acpi_get_next_object);
EXPORT_SYMBOL(acpi_evaluate_object);
EXPORT_SYMBOL(acpi_get_table);
EXPORT_SYMBOL(acpi_get_firmware_table);
EXPORT_SYMBOL(acpi_install_notify_handler);
EXPORT_SYMBOL(acpi_remove_notify_handler);
EXPORT_SYMBOL(acpi_install_gpe_handler);
EXPORT_SYMBOL(acpi_remove_gpe_handler);
EXPORT_SYMBOL(acpi_install_address_space_handler);
EXPORT_SYMBOL(acpi_remove_address_space_handler);
EXPORT_SYMBOL(acpi_install_fixed_event_handler);
EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
EXPORT_SYMBOL(acpi_acquire_global_lock);
EXPORT_SYMBOL(acpi_release_global_lock);
EXPORT_SYMBOL(acpi_install_gpe_block);
EXPORT_SYMBOL(acpi_remove_gpe_block);
EXPORT_SYMBOL(acpi_get_current_resources);
EXPORT_SYMBOL(acpi_get_possible_resources);
EXPORT_SYMBOL(acpi_walk_resources);
EXPORT_SYMBOL(acpi_set_current_resources);
EXPORT_SYMBOL(acpi_enable_event);
EXPORT_SYMBOL(acpi_disable_event);
EXPORT_SYMBOL(acpi_clear_event);
EXPORT_SYMBOL(acpi_get_timer_duration);
EXPORT_SYMBOL(acpi_get_timer);
EXPORT_SYMBOL(acpi_get_sleep_type_data);
EXPORT_SYMBOL(acpi_get_register);
EXPORT_SYMBOL(acpi_set_register);
EXPORT_SYMBOL(acpi_enter_sleep_state);
EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios);
EXPORT_SYMBOL(acpi_get_system_info);
EXPORT_SYMBOL(acpi_get_devices);
/* ACPI OS Services Layer (acpi_osl.c) */
EXPORT_SYMBOL(acpi_os_free);
EXPORT_SYMBOL(acpi_os_printf);
EXPORT_SYMBOL(acpi_os_sleep);
EXPORT_SYMBOL(acpi_os_stall);
EXPORT_SYMBOL(acpi_os_signal);
EXPORT_SYMBOL(acpi_os_queue_for_execution);
EXPORT_SYMBOL(acpi_os_signal_semaphore);
EXPORT_SYMBOL(acpi_os_create_semaphore);
EXPORT_SYMBOL(acpi_os_delete_semaphore);
EXPORT_SYMBOL(acpi_os_wait_semaphore);
EXPORT_SYMBOL(acpi_os_read_pci_configuration);
/* ACPI Utilities (acpi_utils.c) */
EXPORT_SYMBOL(acpi_extract_package);
EXPORT_SYMBOL(acpi_evaluate_integer);
EXPORT_SYMBOL(acpi_evaluate_reference);
#endif /*CONFIG_ACPI_INTERPRETER*/
/* ACPI Bus Driver (acpi_bus.c) */
#ifdef CONFIG_ACPI_BUS
EXPORT_SYMBOL(acpi_fadt);
EXPORT_SYMBOL(acpi_walk_namespace);
EXPORT_SYMBOL(acpi_root_dir);
EXPORT_SYMBOL(acpi_bus_get_device);
EXPORT_SYMBOL(acpi_bus_get_status);
EXPORT_SYMBOL(acpi_bus_get_power);
EXPORT_SYMBOL(acpi_bus_set_power);
EXPORT_SYMBOL(acpi_bus_generate_event);
EXPORT_SYMBOL(acpi_bus_receive_event);
EXPORT_SYMBOL(acpi_bus_register_driver);
EXPORT_SYMBOL(acpi_bus_unregister_driver);
EXPORT_SYMBOL(acpi_bus_scan);
EXPORT_SYMBOL(acpi_init);
#endif /*CONFIG_ACPI_BUS*/
/* ACPI PCI Driver (pci_irq.c) */
#ifdef CONFIG_ACPI_PCI
#include <xen/pci.h>
extern int acpi_pci_irq_enable(struct pci_dev *dev);
EXPORT_SYMBOL(acpi_pci_irq_enable);
extern int acpi_pci_irq_lookup (int segment, int bus, int device, int pin);
EXPORT_SYMBOL(acpi_pci_irq_lookup);
EXPORT_SYMBOL(acpi_pci_register_driver);
EXPORT_SYMBOL(acpi_pci_unregister_driver);
#endif /*CONFIG_ACPI_PCI */
#ifdef CONFIG_ACPI_EC
/* ACPI EC driver (ec.c) */
EXPORT_SYMBOL(ec_read);
EXPORT_SYMBOL(ec_write);
#endif
-8
View File
@@ -637,14 +637,6 @@ void panic(const char *fmt, ...)
machine_restart(0);
}
void __out_of_line_bug(int line)
{
printk("kernel BUG in header file at line %d\n", line);
BUG();
for ( ; ; ) ;
}
/*
* Local variables:
* mode: C
+6 -1
View File
@@ -15,9 +15,12 @@
#include <xen/reboot.h>
#include <xen/sched.h>
#include <xen/serial.h>
#include <xen/physdev.h>
#include <asm/io.h>
#ifdef CONFIG_X86
#include <asm/physdev.h>
#endif
/* Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
static char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR;
string_param("com1", opt_com1);
@@ -482,10 +485,12 @@ void serial_force_unlock(int handle)
void serial_endboot(void)
{
#ifdef CONFIG_X86
int i;
for ( i = 0; i < ARRAY_SIZE(com); i++ )
if ( UART_ENABLED(&com[i]) )
physdev_modify_ioport_access_range(dom0, 0, com[i].io_base, 8);
#endif
}
/*
-45
View File
@@ -1,45 +0,0 @@
#
# Makefile for the PCI bus specific drivers.
#
include $(BASEDIR)/Rules.mk
OBJS := pci.o quirks.o names.o setup-res.o
#obj-$(CONFIG_PCI) += pci.o quirks.o compat.o names.o
#obj-$(CONFIG_PROC_FS) += proc.o
#ifndef CONFIG_SPARC64
#obj-$(CONFIG_PCI) += setup-res.o
#endif
#
# Some architectures use the generic PCI setup functions
#
#obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o
#obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o
#obj-$(CONFIG_PARISC) += setup-bus.o
#obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o
#obj-$(CONFIG_ALL_PPC) += setup-bus.o
#obj-$(CONFIG_DDB5476) += setup-bus.o
#obj-$(CONFIG_SGI_IP27) += setup-irq.o
#ifndef CONFIG_X86
#obj-y += syscall.o
#endif
default: driver.o
driver.o: $(OBJS)
$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
clean:
rm -f *.o *~ core gen-devlist classlist.h devlist.h
names.o: names.c devlist.h classlist.h
devlist.h classlist.h: pci.ids gen-devlist
./gen-devlist <pci.ids
gen-devlist: gen-devlist.c
$(HOSTCC) $(HOSTCFLAGS) -o gen-devlist gen-devlist.c
View File
Whitespace-only changes.
-130
View File
@@ -1,130 +0,0 @@
/*
* Generate devlist.h and classlist.h from the PCI ID file.
*
* (c) 1999--2002 Martin Mares <mj@ucw.cz>
*/
#include <stdio.h>
#include <string.h>
#define MAX_NAME_SIZE 79
static void
pq(FILE *f, const char *c)
{
while (*c) {
if (*c == '"')
fprintf(f, "\\\"");
else {
fputc(*c, f);
if (*c == '?' && c[1] == '?') {
/* Avoid trigraphs */
fprintf(f, "\" \"");
}
}
c++;
}
}
int
main(void)
{
char line[1024], *c, *bra, vend[8];
int vendors = 0;
int mode = 0;
int lino = 0;
int vendor_len = 0;
FILE *devf, *clsf;
devf = fopen("devlist.h", "w");
clsf = fopen("classlist.h", "w");
if (!devf || !clsf) {
fprintf(stderr, "Cannot create output file!\n");
return 1;
}
while (fgets(line, sizeof(line)-1, stdin)) {
lino++;
if ((c = strchr(line, '\n')))
*c = 0;
if (!line[0] || line[0] == '#')
continue;
if (line[1] == ' ') {
if (line[0] == 'C' && strlen(line) > 4 && line[4] == ' ') {
vend[0] = line[2];
vend[1] = line[3];
vend[2] = 0;
mode = 2;
} else goto err;
}
else if (line[0] == '\t') {
if (line[1] == '\t')
continue;
switch (mode) {
case 1:
if (strlen(line) > 5 && line[5] == ' ') {
c = line + 5;
while (*c == ' ')
*c++ = 0;
if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
/* Too long, try cutting off long description */
bra = strchr(c, '[');
if (bra && bra > c && bra[-1] == ' ')
bra[-1] = 0;
if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
fprintf(stderr, "Line %d: Device name too long\n", lino);
fprintf(stderr, "%s\n", c);
return 1;
}
}
fprintf(devf, "\tDEVICE(%s,%s,\"", vend, line+1);
pq(devf, c);
fputs("\")\n", devf);
} else goto err;
break;
case 2:
if (strlen(line) > 3 && line[3] == ' ') {
c = line + 3;
while (*c == ' ')
*c++ = 0;
fprintf(clsf, "CLASS(%s%s, \"%s\")\n", vend, line+1, c);
} else goto err;
break;
default:
goto err;
}
} else if (strlen(line) > 4 && line[4] == ' ') {
c = line + 4;
while (*c == ' ')
*c++ = 0;
if (vendors)
fputs("ENDVENDOR()\n\n", devf);
vendors++;
strcpy(vend, line);
vendor_len = strlen(c);
if (vendor_len + 24 > MAX_NAME_SIZE) {
fprintf(stderr, "Line %d: Vendor name too long\n", lino);
return 1;
}
fprintf(devf, "VENDOR(%s,\"", vend);
pq(devf, c);
fputs("\")\n", devf);
mode = 1;
} else {
err:
fprintf(stderr, "Line %d: Syntax error in mode %d: %s\n", lino, mode, line);
return 1;
}
}
fputs("ENDVENDOR()\n\
\n\
#undef VENDOR\n\
#undef DEVICE\n\
#undef ENDVENDOR\n", devf);
fputs("\n#undef CLASS\n", clsf);
fclose(devf);
fclose(clsf);
return 0;
}
-135
View File
@@ -1,135 +0,0 @@
/*
* PCI Class and Device Name Tables
*
* Copyright 1993--1999 Drew Eckhardt, Frederic Potter,
* David Mosberger-Tang, Martin Mares
*/
#include <xen/config.h>
#include <xen/types.h>
/*#include <xen/kernel.h>*/
#include <xen/pci.h>
#include <xen/init.h>
#ifdef CONFIG_PCI_NAMES
struct pci_device_info {
unsigned short device;
unsigned short seen;
const char *name;
};
struct pci_vendor_info {
unsigned short vendor;
unsigned short nr;
const char *name;
struct pci_device_info *devices;
};
/*
* This is ridiculous, but we want the strings in
* the .init section so that they don't take up
* real memory.. Parse the same file multiple times
* to get all the info.
*/
#define VENDOR( vendor, name ) static char __vendorstr_##vendor[] __devinitdata = name;
#define ENDVENDOR()
#define DEVICE( vendor, device, name ) static char __devicestr_##vendor##device[] __devinitdata = name;
#include "devlist.h"
#define VENDOR( vendor, name ) static struct pci_device_info __devices_##vendor[] __devinitdata = {
#define ENDVENDOR() };
#define DEVICE( vendor, device, name ) { 0x##device, 0, __devicestr_##vendor##device },
#include "devlist.h"
static struct pci_vendor_info __devinitdata pci_vendor_list[] = {
#define VENDOR( vendor, name ) { 0x##vendor, sizeof(__devices_##vendor) / sizeof(struct pci_device_info), __vendorstr_##vendor, __devices_##vendor },
#define ENDVENDOR()
#define DEVICE( vendor, device, name )
#include "devlist.h"
};
#define VENDORS (sizeof(pci_vendor_list)/sizeof(struct pci_vendor_info))
void __devinit pci_name_device(struct pci_dev *dev)
{
const struct pci_vendor_info *vendor_p = pci_vendor_list;
int i = VENDORS;
char *name = dev->name;
do {
if (vendor_p->vendor == dev->vendor)
goto match_vendor;
vendor_p++;
} while (--i);
/* Couldn't find either the vendor nor the device */
sprintf(name, "PCI device %04x:%04x", dev->vendor, dev->device);
return;
match_vendor: {
struct pci_device_info *device_p = vendor_p->devices;
int i = vendor_p->nr;
while (i > 0) {
if (device_p->device == dev->device)
goto match_device;
device_p++;
i--;
}
/* Ok, found the vendor, but unknown device */
sprintf(name, "PCI device %04x:%04x (%s)", dev->vendor, dev->device, vendor_p->name);
return;
/* Full match */
match_device: {
char *n = name + sprintf(name, "%s %s", vendor_p->name, device_p->name);
int nr = device_p->seen + 1;
device_p->seen = nr;
if (nr > 1)
sprintf(n, " (#%d)", nr);
}
}
}
/*
* Class names. Not in .init section as they are needed in runtime.
*/
static u16 pci_class_numbers[] = {
#define CLASS(x,y) 0x##x,
#include "classlist.h"
};
static char *pci_class_names[] = {
#define CLASS(x,y) y,
#include "classlist.h"
};
char *
pci_class_name(u32 class)
{
int i;
for(i=0; i<sizeof(pci_class_numbers)/sizeof(pci_class_numbers[0]); i++)
if (pci_class_numbers[i] == class)
return pci_class_names[i];
return NULL;
}
#else
void __devinit pci_name_device(struct pci_dev *dev)
{
}
char *
pci_class_name(u32 class)
{
return NULL;
}
#endif /* CONFIG_PCI_NAMES */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-835
View File
@@ -1,835 +0,0 @@
/*
* $Id: quirks.c,v 1.5 1998/05/02 19:24:14 mj Exp $
*
* This file contains work-arounds for many known PCI hardware
* bugs. Devices present only on certain architectures (host
* bridges et cetera) should be handled in arch-specific code.
*
* Copyright (c) 1999 Martin Mares <mj@ucw.cz>
*
* The bridge optimization stuff has been removed. If you really
* have a silly BIOS which is unable to set your host bridge right,
* use the PowerTweak utility (see http://powertweak.sourceforge.net).
*/
#include <xen/config.h>
#include <xen/types.h>
#include <xen/kernel.h>
#include <xen/pci.h>
#include <xen/init.h>
#include <xen/delay.h>
#undef DEBUG
/* Deal with broken BIOS'es that neglect to enable passive release,
which can cause problems in combination with the 82441FX/PPro MTRRs */
static void __init quirk_passive_release(struct pci_dev *dev)
{
struct pci_dev *d = NULL;
unsigned char dlc;
/* We have to make sure a particular bit is set in the PIIX3
ISA bridge, so we have to go out and find it. */
while ((d = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) {
pci_read_config_byte(d, 0x82, &dlc);
if (!(dlc & 1<<1)) {
printk(KERN_ERR "PCI: PIIX3: Enabling Passive Release on %s\n", d->slot_name);
dlc |= 1<<1;
pci_write_config_byte(d, 0x82, dlc);
}
}
}
/* The VIA VP2/VP3/MVP3 seem to have some 'features'. There may be a workaround
but VIA don't answer queries. If you happen to have good contacts at VIA
ask them for me please -- Alan
This appears to be BIOS not version dependent. So presumably there is a
chipset level fix */
int isa_dma_bridge_buggy; /* Exported */
static void __init quirk_isa_dma_hangs(struct pci_dev *dev)
{
if (!isa_dma_bridge_buggy) {
isa_dma_bridge_buggy=1;
printk(KERN_INFO "Activating ISA DMA hang workarounds.\n");
}
}
int pci_pci_problems;
/*
* Chipsets where PCI->PCI transfers vanish or hang
*/
static void __init quirk_nopcipci(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_FAIL)==0)
{
printk(KERN_INFO "Disabling direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_FAIL;
}
}
/*
* Triton requires workarounds to be used by the drivers
*/
static void __init quirk_triton(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_TRITON)==0)
{
printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_TRITON;
}
}
/*
* VIA Apollo KT133 needs PCI latency patch
* Made according to a windows driver based patch by George E. Breese
* see PCI Latency Adjust on http://www.viahardware.com/download/viatweak.shtm
* Also see http://www.au-ja.org/review-kt133a-1-en.phtml for the info on which
* Mr Breese based his work.
*
* Updated based on further information from the site and also on
* information provided by VIA
*/
static void __init quirk_vialatency(struct pci_dev *dev)
{
struct pci_dev *p;
u8 rev;
u8 busarb;
/* Ok we have a potential problem chipset here. Now see if we have
a buggy southbridge */
p=pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, NULL);
if(p!=NULL)
{
pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
/* 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; thanks Dan Hollis */
/* Check for buggy part revisions */
if (rev < 0x40 || rev > 0x42)
return;
}
else
{
p = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
if(p==NULL) /* No problem parts */
return;
pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
/* Check for buggy part revisions */
if (rev < 0x10 || rev > 0x12)
return;
}
/*
* Ok we have the problem. Now set the PCI master grant to
* occur every master grant. The apparent bug is that under high
* PCI load (quite common in Linux of course) you can get data
* loss when the CPU is held off the bus for 3 bus master requests
* This happens to include the IDE controllers....
*
* VIA only apply this fix when an SB Live! is present but under
* both Linux and Windows this isnt enough, and we have seen
* corruption without SB Live! but with things like 3 UDMA IDE
* controllers. So we ignore that bit of the VIA recommendation..
*/
pci_read_config_byte(dev, 0x76, &busarb);
/* Set bit 4 and bi 5 of byte 76 to 0x01
"Master priority rotation on every PCI master grant */
busarb &= ~(1<<5);
busarb |= (1<<4);
pci_write_config_byte(dev, 0x76, busarb);
printk(KERN_INFO "Applying VIA southbridge workaround.\n");
}
/*
* VIA Apollo VP3 needs ETBF on BT848/878
*/
static void __init quirk_viaetbf(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_VIAETBF)==0)
{
printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_VIAETBF;
}
}
static void __init quirk_vsfx(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_VSFX)==0)
{
printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_VSFX;
}
}
/*
* Ali Magik requires workarounds to be used by the drivers
* that DMA to AGP space. Latency must be set to 0xA and triton
* workaround applied too
* [Info kindly provided by ALi]
*/
static void __init quirk_alimagik(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_ALIMAGIK)==0)
{
printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_ALIMAGIK|PCIPCI_TRITON;
}
}
/*
* Natoma has some interesting boundary conditions with Zoran stuff
* at least
*/
static void __init quirk_natoma(struct pci_dev *dev)
{
if((pci_pci_problems&PCIPCI_NATOMA)==0)
{
printk(KERN_INFO "Limiting direct PCI/PCI transfers.\n");
pci_pci_problems|=PCIPCI_NATOMA;
}
}
/*
* S3 868 and 968 chips report region size equal to 32M, but they decode 64M.
* If it's needed, re-allocate the region.
*/
static void __init quirk_s3_64M(struct pci_dev *dev)
{
struct resource *r = &dev->resource[0];
if ((r->start & 0x3ffffff) || r->end != r->start + 0x3ffffff) {
r->start = 0;
r->end = 0x3ffffff;
}
}
static void __init quirk_io_region(struct pci_dev *dev, unsigned region, unsigned size, int nr)
{
region &= ~(size-1);
if (region) {
struct resource *res = dev->resource + nr;
res->name = dev->name;
res->start = region;
res->end = region + size - 1;
res->flags = IORESOURCE_IO;
pci_claim_resource(dev, nr);
}
}
/*
* ATI Northbridge setups MCE the processor if you even
* read somewhere between 0x3b0->0x3bb or read 0x3d3
*/
static void __devinit quirk_ati_exploding_mce(struct pci_dev *dev)
{
printk(KERN_INFO "ATI Northbridge, reserving I/O ports 0x3b0 to 0x3bb.\n");
request_region(0x3b0, 0x0C, "RadeonIGP");
request_region(0x3d3, 0x01, "RadeonIGP");
}
/*
* Let's make the southbridge information explicit instead
* of having to worry about people probing the ACPI areas,
* for example.. (Yes, it happens, and if you read the wrong
* ACPI register it will put the machine to sleep with no
* way of waking it up again. Bummer).
*
* ALI M7101: Two IO regions pointed to by words at
* 0xE0 (64 bytes of ACPI registers)
* 0xE2 (32 bytes of SMB registers)
*/
static void __init quirk_ali7101_acpi(struct pci_dev *dev)
{
u16 region;
pci_read_config_word(dev, 0xE0, &region);
quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
pci_read_config_word(dev, 0xE2, &region);
quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
}
/*
* PIIX4 ACPI: Two IO regions pointed to by longwords at
* 0x40 (64 bytes of ACPI registers)
* 0x90 (32 bytes of SMB registers)
*/
static void __init quirk_piix4_acpi(struct pci_dev *dev)
{
u32 region;
pci_read_config_dword(dev, 0x40, &region);
quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
pci_read_config_dword(dev, 0x90, &region);
quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
}
/*
* ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
* 0x40 (128 bytes of ACPI, GPIO & TCO registers)
* 0x58 (64 bytes of GPIO I/O space)
*/
static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
{
u32 region;
pci_read_config_dword(dev, 0x40, &region);
quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES);
pci_read_config_dword(dev, 0x58, &region);
quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1);
}
/*
* VIA ACPI: One IO region pointed to by longword at
* 0x48 or 0x20 (256 bytes of ACPI registers)
*/
static void __init quirk_vt82c586_acpi(struct pci_dev *dev)
{
u8 rev;
u32 region;
pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
if (rev & 0x10) {
pci_read_config_dword(dev, 0x48, &region);
region &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, region, 256, PCI_BRIDGE_RESOURCES);
}
}
/*
* VIA VT82C686 ACPI: Three IO region pointed to by (long)words at
* 0x48 (256 bytes of ACPI registers)
* 0x70 (128 bytes of hardware monitoring register)
* 0x90 (16 bytes of SMB registers)
*/
static void __init quirk_vt82c686_acpi(struct pci_dev *dev)
{
u16 hm;
u32 smb;
quirk_vt82c586_acpi(dev);
pci_read_config_word(dev, 0x70, &hm);
hm &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1);
pci_read_config_dword(dev, 0x90, &smb);
smb &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2);
}
#ifdef CONFIG_X86_IO_APIC
#include <asm/io_apic.h>
/*
* VIA 686A/B: If an IO-APIC is active, we need to route all on-chip
* devices to the external APIC.
*
* TODO: When we have device-specific interrupt routers,
* this code will go away from quirks.
*/
static void __init quirk_via_ioapic(struct pci_dev *dev)
{
u8 tmp;
if (nr_ioapics < 1)
tmp = 0; /* nothing routed to external APIC */
else
tmp = 0x1f; /* all known bits (4-0) routed to external APIC */
printk(KERN_INFO "PCI: %sbling Via external APIC routing\n",
tmp == 0 ? "Disa" : "Ena");
/* Offset 0x58: External APIC IRQ output control */
pci_write_config_byte (dev, 0x58, tmp);
}
#endif /* CONFIG_X86_IO_APIC */
/*
* Via 686A/B: The PCI_INTERRUPT_LINE register for the on-chip
* devices, USB0/1, AC97, MC97, and ACPI, has an unusual feature:
* when written, it makes an internal connection to the PIC.
* For these devices, this register is defined to be 4 bits wide.
* Normally this is fine. However for IO-APIC motherboards, or
* non-x86 architectures (yes Via exists on PPC among other places),
* we must mask the PCI_INTERRUPT_LINE value versus 0xf to get
* interrupts delivered properly.
*
* TODO: When we have device-specific interrupt routers,
* quirk_via_irqpic will go away from quirks.
*/
/*
* FIXME: it is questionable that quirk_via_acpi
* is needed. It shows up as an ISA bridge, and does not
* support the PCI_INTERRUPT_LINE register at all. Therefore
* it seems like setting the pci_dev's 'irq' to the
* value of the ACPI SCI interrupt is only done for convenience.
* -jgarzik
*/
static void __init quirk_via_acpi(struct pci_dev *d)
{
/*
* VIA ACPI device: SCI IRQ line in PCI config byte 0x42
*/
u8 irq;
pci_read_config_byte(d, 0x42, &irq);
irq &= 0xf;
if (irq && (irq != 2))
d->irq = irq;
}
static void __init quirk_via_irqpic(struct pci_dev *dev)
{
u8 irq, new_irq = dev->irq & 0xf;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
if (new_irq != irq) {
printk(KERN_INFO "PCI: Via IRQ fixup for %s, from %d to %d\n",
dev->slot_name, irq, new_irq);
udelay(15);
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
}
}
/*
* PIIX3 USB: We have to disable USB interrupts that are
* hardwired to PIRQD# and may be shared with an
* external device.
*
* Legacy Support Register (LEGSUP):
* bit13: USB PIRQ Enable (USBPIRQDEN),
* bit4: Trap/SMI On IRQ Enable (USBSMIEN).
*
* We mask out all r/wc bits, too.
*/
static void __init quirk_piix3_usb(struct pci_dev *dev)
{
u16 legsup;
pci_read_config_word(dev, 0xc0, &legsup);
legsup &= 0x50ef;
pci_write_config_word(dev, 0xc0, legsup);
}
/*
* VIA VT82C598 has its device ID settable and many BIOSes
* set it to the ID of VT82C597 for backward compatibility.
* We need to switch it off to be able to recognize the real
* type of the chip.
*/
static void __init quirk_vt82c598_id(struct pci_dev *dev)
{
pci_write_config_byte(dev, 0xfc, 0);
pci_read_config_word(dev, PCI_DEVICE_ID, &dev->device);
}
/*
* CardBus controllers have a legacy base address that enables them
* to respond as i82365 pcmcia controllers. We don't want them to
* do this even if the Linux CardBus driver is not loaded, because
* the Linux i82365 driver does not (and should not) handle CardBus.
*/
static void __init quirk_cardbus_legacy(struct pci_dev *dev)
{
if ((PCI_CLASS_BRIDGE_CARDBUS << 8) ^ dev->class)
return;
pci_write_config_dword(dev, PCI_CB_LEGACY_MODE_BASE, 0);
}
/*
* The AMD io apic can hang the box when an apic irq is masked.
* We check all revs >= B0 (yet not in the pre production!) as the bug
* is currently marked NoFix
*
* We have multiple reports of hangs with this chipset that went away with
* noapic specified. For the moment we assume its the errata. We may be wrong
* of course. However the advice is demonstrably good even if so..
*/
static void __init quirk_amd_ioapic(struct pci_dev *dev)
{
u8 rev;
pci_read_config_byte(dev, PCI_REVISION_ID, &rev);
if(rev >= 0x02)
{
printk(KERN_WARNING "I/O APIC: AMD Errata #22 may be present. In the event of instability try\n");
printk(KERN_WARNING " : booting with the \"noapic\" option.\n");
}
}
/*
* Following the PCI ordering rules is optional on the AMD762. I'm not
* sure what the designers were smoking but let's not inhale...
*
* To be fair to AMD, it follows the spec by default, its BIOS people
* who turn it off!
*/
static void __init quirk_amd_ordering(struct pci_dev *dev)
{
u32 pcic;
pci_read_config_dword(dev, 0x4C, &pcic);
if((pcic&6)!=6)
{
pcic |= 6;
printk(KERN_WARNING "BIOS failed to enable PCI standards compliance, fixing this error.\n");
pci_write_config_dword(dev, 0x4C, pcic);
pci_read_config_dword(dev, 0x84, &pcic);
pcic |= (1<<23); /* Required in this mode */
pci_write_config_dword(dev, 0x84, pcic);
}
}
#ifdef CONFIG_X86_IO_APIC
#define AMD8131_revA0 0x01
#define AMD8131_revB0 0x11
#define AMD8131_MISC 0x40
#define AMD8131_NIOAMODE_BIT 0
static void __init quirk_amd_8131_ioapic(struct pci_dev *dev)
{
unsigned char revid, tmp;
if (nr_ioapics == 0)
return;
pci_read_config_byte(dev, PCI_REVISION_ID, &revid);
if (revid == AMD8131_revA0 || revid == AMD8131_revB0) {
printk(KERN_INFO "Fixing up AMD8131 IOAPIC mode\n");
pci_read_config_byte( dev, AMD8131_MISC, &tmp);
tmp &= ~(1 << AMD8131_NIOAMODE_BIT);
pci_write_config_byte( dev, AMD8131_MISC, tmp);
}
}
#endif
/*
* DreamWorks provided workaround for Dunord I-3000 problem
*
* This card decodes and responds to addresses not apparently
* assigned to it. We force a larger allocation to ensure that
* nothing gets put too close to it.
*/
static void __init quirk_dunord ( struct pci_dev * dev )
{
struct resource * r = & dev -> resource [ 1 ];
r -> start = 0;
r -> end = 0xffffff;
}
static void __init quirk_transparent_bridge(struct pci_dev *dev)
{
dev->transparent = 1;
}
/*
* Common misconfiguration of the MediaGX/Geode PCI master that will
* reduce PCI bandwidth from 70MB/s to 25MB/s. See the GXM/GXLV/GX1
* datasheets found at http://www.national.com/ds/GX for info on what
* these bits do. <christer@weinigel.se>
*/
static void __init quirk_mediagx_master(struct pci_dev *dev)
{
u8 reg;
pci_read_config_byte(dev, 0x41, &reg);
if (reg & 2) {
reg &= ~2;
printk(KERN_INFO "PCI: Fixup for MediaGX/Geode Slave Disconnect Boundary (0x41=0x%02x)\n", reg);
pci_write_config_byte(dev, 0x41, reg);
}
}
/*
* As per PCI spec, ignore base address registers 0-3 of the IDE controllers
* running in Compatible mode (bits 0 and 2 in the ProgIf for primary and
* secondary channels respectively). If the device reports Compatible mode
* but does use BAR0-3 for address decoding, we assume that firmware has
* programmed these BARs with standard values (0x1f0,0x3f4 and 0x170,0x374).
* Exceptions (if they exist) must be handled in chip/architecture specific
* fixups.
*
* Note: for non x86 people. You may need an arch specific quirk to handle
* moving IDE devices to native mode as well. Some plug in card devices power
* up in compatible mode and assume the BIOS will adjust them.
*
* Q: should we load the 0x1f0,0x3f4 into the registers or zap them as
* we do now ? We don't want is pci_enable_device to come along
* and assign new resources. Both approaches work for that.
*/
static void __devinit quirk_ide_bases(struct pci_dev *dev)
{
struct resource *res;
int first_bar = 2, last_bar = 0;
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
return;
res = &dev->resource[0];
/* primary channel: ProgIf bit 0, BAR0, BAR1 */
if (!(dev->class & 1) && (res[0].flags || res[1].flags)) {
res[0].start = res[0].end = res[0].flags = 0;
res[1].start = res[1].end = res[1].flags = 0;
first_bar = 0;
last_bar = 1;
}
/* secondary channel: ProgIf bit 2, BAR2, BAR3 */
if (!(dev->class & 4) && (res[2].flags || res[3].flags)) {
res[2].start = res[2].end = res[2].flags = 0;
res[3].start = res[3].end = res[3].flags = 0;
last_bar = 3;
}
if (!last_bar)
return;
printk(KERN_INFO "PCI: Ignoring BAR%d-%d of IDE controller %s\n",
first_bar, last_bar, dev->slot_name);
}
/*
* Ensure C0 rev restreaming is off. This is normally done by
* the BIOS but in the odd case it is not the results are corruption
* hence the presence of a Linux check
*/
static void __init quirk_disable_pxb(struct pci_dev *pdev)
{
u16 config;
u8 rev;
pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
if(rev != 0x04) /* Only C0 requires this */
return;
pci_read_config_word(pdev, 0x40, &config);
if(config & (1<<6))
{
config &= ~(1<<6);
pci_write_config_word(pdev, 0x40, config);
printk(KERN_INFO "PCI: C0 revision 450NX. Disabling PCI restreaming.\n");
}
}
/*
* VIA northbridges care about PCI_INTERRUPT_LINE
*/
int interrupt_line_quirk;
static void __init quirk_via_bridge(struct pci_dev *pdev)
{
if(pdev->devfn == 0)
interrupt_line_quirk = 1;
}
/*
* Serverworks CSB5 IDE does not fully support native mode
*/
static void __init quirk_svwks_csb5ide(struct pci_dev *pdev)
{
u8 prog;
pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
if (prog & 5) {
prog &= ~5;
pdev->class &= ~5;
pci_write_config_byte(pdev, PCI_CLASS_PROG, prog);
/* need to re-assign BARs for compat mode */
quirk_ide_bases(pdev);
}
}
/*
* On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge
* is not activated. The myth is that Asus said that they do not want the
* users to be irritated by just another PCI Device in the Win98 device
* manager. (see the file prog/hotplug/README.p4b in the lm_sensors
* package 2.7.0 for details)
*
* The SMBus PCI Device can be activated by setting a bit in the ICH LPC
* bridge. Unfortunately, this device has no subvendor/subdevice ID. So it
* becomes necessary to do this tweak in two steps -- I've chosen the Host
* bridge as trigger.
*/
static int __initdata asus_hides_smbus = 0;
static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
{
if (likely(dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK))
return;
if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
switch(dev->subsystem_device) {
case 0x8070: /* P4B */
case 0x8088: /* P4B533 */
asus_hides_smbus = 1;
}
if ((dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) &&
(dev->subsystem_device == 0x80b2)) /* P4PE */
asus_hides_smbus = 1;
if ((dev->device == PCI_DEVICE_ID_INTEL_82850_HB) &&
(dev->subsystem_device == 0x8030)) /* P4T533 */
asus_hides_smbus = 1;
if ((dev->device == PCI_DEVICE_ID_INTEL_7205_0) &&
(dev->subsystem_device == 0x8070)) /* P4G8X Deluxe */
asus_hides_smbus = 1;
return;
}
static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
{
u16 val;
if (likely(!asus_hides_smbus))
return;
pci_read_config_word(dev, 0xF2, &val);
if (val & 0x8) {
pci_write_config_word(dev, 0xF2, val & (~0x8));
pci_read_config_word(dev, 0xF2, &val);
if(val & 0x8)
printk(KERN_INFO "PCI: i801 SMBus device continues to play 'hide and seek'! 0x%x\n", val);
else
printk(KERN_INFO "PCI: Enabled i801 SMBus device\n");
}
}
/*
* The main table of quirks.
*/
static struct pci_fixup pci_fixups[] __initdata = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_DUNORD, PCI_DEVICE_ID_DUNORD_I3000, quirk_dunord },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release },
/*
* Its not totally clear which chipsets are the problematic ones
* We know 82C586 and 82C596 variants are affected.
*/
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_isa_dma_hangs },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, quirk_isa_dma_hangs },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, quirk_isa_dma_hangs },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, quirk_triton },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437VX, quirk_triton },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439, quirk_triton },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82439TX, quirk_triton },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_0, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443LX_1, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_1, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1647, quirk_alimagik },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1651, quirk_alimagik },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8361, quirk_vialatency },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576, quirk_vsfx },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_viaetbf },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C597_0, quirk_vt82c598_id },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_vt82c586_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, quirk_ich4_lpc_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, quirk_ali7101_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_2, quirk_piix3_usb },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_2, quirk_piix3_usb },
{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, quirk_ide_bases },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_bridge },
{ PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, quirk_cardbus_legacy },
#ifdef CONFIG_X86_IO_APIC
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic },
#endif
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irqpic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irqpic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_6, quirk_via_irqpic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7410, quirk_amd_ioapic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C, quirk_amd_ordering },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_IGP, quirk_ati_exploding_mce },
/*
* i82380FB mobile docking controller: its PCI-to-PCI bridge
* is subtractive decoding (transparent), and does indicate this
* in the ProgIf. Unfortunately, the ProgIf value is wrong - 0x80
* instead of 0x01.
*/
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82380FB, quirk_transparent_bridge },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_TOSHIBA, 0x605, quirk_transparent_bridge },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, quirk_svwks_csb5ide },
#ifdef CONFIG_X86_IO_APIC
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_APIC,
quirk_amd_8131_ioapic },
#endif
/*
* on Asus P4B boards, the i801SMBus device is disabled at startup.
*/
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845G_HB, asus_hides_smbus_hostbridge },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc },
{ 0 }
};
static void pci_do_fixups(struct pci_dev *dev, int pass, struct pci_fixup *f)
{
while (f->pass) {
if (f->pass == pass &&
(f->vendor == dev->vendor || f->vendor == (u16) PCI_ANY_ID) &&
(f->device == dev->device || f->device == (u16) PCI_ANY_ID)) {
#ifdef DEBUG
printk(KERN_INFO "PCI: Calling quirk %p for %s\n", f->hook, dev->slot_name);
#endif
f->hook(dev);
}
f++;
}
}
void pci_fixup_device(int pass, struct pci_dev *dev)
{
pci_do_fixups(dev, pass, pcibios_fixups);
pci_do_fixups(dev, pass, pci_fixups);
}
-241
View File
@@ -1,241 +0,0 @@
/*
* drivers/pci/setup-res.c
*
* Extruded from code written by
* Dave Rusling (david.rusling@reo.mts.dec.com)
* David Mosberger (davidm@cs.arizona.edu)
* David Miller (davem@redhat.com)
*
* Support routines for initializing a PCI subsystem.
*/
/* fixed for multiple pci buses, 1999 Andrea Arcangeli <andrea@suse.de> */
/*
* Nov 2000, Ivan Kokshaysky <ink@jurassic.park.msu.ru>
* Resource sorting
*/
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/pci.h>
#include <xen/errno.h>
#include <xen/ioport.h>
#include <xen/cache.h>
#include <xen/slab.h>
#define DEBUG_CONFIG 0
#if DEBUG_CONFIG
# define DBGC(args) printk args
#else
# define DBGC(args)
#endif
int __init
pci_claim_resource(struct pci_dev *dev, int resource)
{
struct resource *res = &dev->resource[resource];
struct resource *root = pci_find_parent_resource(dev, res);
int err;
err = -EINVAL;
if (root != NULL) {
err = request_resource(root, res);
if (err) {
printk(KERN_ERR "PCI: Address space collision on "
"region %d of device %s [%lx:%lx]\n",
resource, dev->name, res->start, res->end);
}
} else {
printk(KERN_ERR "PCI: No parent found for region %d "
"of device %s\n", resource, dev->name);
}
return err;
}
/*
* Given the PCI bus a device resides on, try to
* find an acceptable resource allocation for a
* specific device resource..
*/
static int pci_assign_bus_resource(const struct pci_bus *bus,
struct pci_dev *dev,
struct resource *res,
unsigned long size,
unsigned long min,
unsigned int type_mask,
int resno)
{
unsigned long align;
int i;
type_mask |= IORESOURCE_IO | IORESOURCE_MEM;
for (i = 0 ; i < 4; i++) {
struct resource *r = bus->resource[i];
if (!r)
continue;
/* type_mask must match */
if ((res->flags ^ r->flags) & type_mask)
continue;
/* We cannot allocate a non-prefetching resource
from a pre-fetching area */
if ((r->flags & IORESOURCE_PREFETCH) &&
!(res->flags & IORESOURCE_PREFETCH))
continue;
/* The bridge resources are special, as their
size != alignment. Sizing routines return
required alignment in the "start" field. */
align = (resno < PCI_BRIDGE_RESOURCES) ? size : res->start;
/* Ok, try it out.. */
if (allocate_resource(r, res, size, min, -1, align,
pcibios_align_resource, dev) < 0)
continue;
/* Update PCI config space. */
pcibios_update_resource(dev, r, res, resno);
return 0;
}
return -EBUSY;
}
int
pci_assign_resource(struct pci_dev *dev, int i)
{
const struct pci_bus *bus = dev->bus;
struct resource *res = dev->resource + i;
unsigned long size, min;
size = res->end - res->start + 1;
min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
/* First, try exact prefetching match.. */
if (pci_assign_bus_resource(bus, dev, res, size, min, IORESOURCE_PREFETCH, i) < 0) {
/*
* That failed.
*
* But a prefetching area can handle a non-prefetching
* window (it will just not perform as well).
*/
if (!(res->flags & IORESOURCE_PREFETCH) || pci_assign_bus_resource(bus, dev, res, size, min, 0, i) < 0) {
printk(KERN_ERR "PCI: Failed to allocate resource %d(%lx-%lx) for %s\n",
i, res->start, res->end, dev->slot_name);
return -EBUSY;
}
}
DBGC((KERN_ERR " got res[%lx:%lx] for resource %d of %s\n", res->start,
res->end, i, dev->name));
return 0;
}
/* Sort resources by alignment */
void __init
pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
{
int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *r;
struct resource_list *list, *tmp;
unsigned long r_align;
r = &dev->resource[i];
r_align = r->end - r->start;
if (!(r->flags) || r->parent)
continue;
if (!r_align) {
printk(KERN_WARNING "PCI: Ignore bogus resource %d "
"[%lx:%lx] of %s\n",
i, r->start, r->end, dev->name);
continue;
}
r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
for (list = head; ; list = list->next) {
unsigned long align = 0;
struct resource_list *ln = list->next;
int idx;
if (ln) {
idx = ln->res - &ln->dev->resource[0];
align = (idx < PCI_BRIDGE_RESOURCES) ?
ln->res->end - ln->res->start + 1 :
ln->res->start;
}
if (r_align > align) {
tmp = xmalloc(struct resource_list);
if (!tmp)
panic("pdev_sort_resources(): "
"malloc() failed!\n");
tmp->next = ln;
tmp->res = r;
tmp->dev = dev;
list->next = tmp;
break;
}
}
}
}
void __init
pdev_enable_device(struct pci_dev *dev)
{
u32 reg;
u16 cmd;
int i;
DBGC((KERN_ERR "PCI enable device: (%s)\n", dev->name));
pci_read_config_word(dev, PCI_COMMAND, &cmd);
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *res = &dev->resource[i];
if (res->flags & IORESOURCE_IO)
cmd |= PCI_COMMAND_IO;
else if (res->flags & IORESOURCE_MEM)
cmd |= PCI_COMMAND_MEMORY;
}
/* Special case, disable the ROM. Several devices act funny
(ie. do not respond to memory space writes) when it is left
enabled. A good example are QlogicISP adapters. */
if (dev->rom_base_reg) {
pci_read_config_dword(dev, dev->rom_base_reg, &reg);
reg &= ~PCI_ROM_ADDRESS_ENABLE;
pci_write_config_dword(dev, dev->rom_base_reg, reg);
dev->resource[PCI_ROM_RESOURCE].flags &= ~PCI_ROM_ADDRESS_ENABLE;
}
/* All of these (may) have I/O scattered all around and may not
use I/O base address registers at all. So we just have to
always enable IO to these devices. */
if ((dev->class >> 8) == PCI_CLASS_NOT_DEFINED
|| (dev->class >> 8) == PCI_CLASS_NOT_DEFINED_VGA
|| (dev->class >> 8) == PCI_CLASS_STORAGE_IDE
|| (dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) {
cmd |= PCI_COMMAND_IO;
}
/* ??? Always turn on bus mastering. If the device doesn't support
it, the bit will go into the bucket. */
cmd |= PCI_COMMAND_MASTER;
/* Set the cache line and default latency (32). */
pci_write_config_word(dev, PCI_CACHE_LINE_SIZE,
(32 << 8) | (L1_CACHE_BYTES / sizeof(u32)));
/* Enable the appropriate bits in the PCI command register. */
pci_write_config_word(dev, PCI_COMMAND, cmd);
DBGC((KERN_ERR " cmd reg 0x%x\n", cmd));
}
-469
View File
@@ -1,469 +0,0 @@
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACDEBUG_H__
#define __ACDEBUG_H__
#define ACPI_DEBUG_BUFFER_SIZE 4196
struct command_info
{
char *name; /* Command Name */
u8 min_args; /* Minimum arguments required */
};
struct argument_info
{
char *name; /* Argument Name */
};
#define PARAM_LIST(pl) pl
#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
acpi_os_printf PARAM_LIST(fp);}
#define EX_NO_SINGLE_STEP 1
#define EX_SINGLE_STEP 2
/* Prototypes */
/*
* dbxface - external debugger interfaces
*/
acpi_status
acpi_db_initialize (
void);
void
acpi_db_terminate (
void);
acpi_status
acpi_db_single_step (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
u32 op_type);
acpi_status
acpi_db_start_command (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
void
acpi_db_method_end (
struct acpi_walk_state *walk_state);
/*
* dbcmds - debug commands and output routines
*/
void
acpi_db_display_table_info (
char *table_arg);
void
acpi_db_unload_acpi_table (
char *table_arg,
char *instance_arg);
void
acpi_db_set_method_breakpoint (
char *location,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
void
acpi_db_set_method_call_breakpoint (
union acpi_parse_object *op);
void
acpi_db_disassemble_aml (
char *statements,
union acpi_parse_object *op);
void
acpi_db_dump_namespace (
char *start_arg,
char *depth_arg);
void
acpi_db_dump_namespace_by_owner (
char *owner_arg,
char *depth_arg);
void
acpi_db_send_notify (
char *name,
u32 value);
void
acpi_db_set_method_data (
char *type_arg,
char *index_arg,
char *value_arg);
acpi_status
acpi_db_display_objects (
char *obj_type_arg,
char *display_count_arg);
acpi_status
acpi_db_find_name_in_namespace (
char *name_arg);
void
acpi_db_set_scope (
char *name);
void
acpi_db_find_references (
char *object_arg);
void
acpi_db_display_locks (void);
void
acpi_db_display_resources (
char *object_arg);
void
acpi_db_display_gpes (void);
void
acpi_db_check_integrity (
void);
acpi_status
acpi_db_integrity_walk (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
acpi_status
acpi_db_walk_and_match_name (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
acpi_status
acpi_db_walk_for_references (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
acpi_status
acpi_db_walk_for_specific_objects (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
void
acpi_db_generate_gpe (
char *gpe_arg,
char *block_arg);
/*
* dbdisply - debug display commands
*/
void
acpi_db_display_method_info (
union acpi_parse_object *op);
void
acpi_db_decode_and_display_object (
char *target,
char *output_type);
void
acpi_db_display_result_object (
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_db_display_all_methods (
char *display_count_arg);
void
acpi_db_display_arguments (
void);
void
acpi_db_display_locals (
void);
void
acpi_db_display_results (
void);
void
acpi_db_display_calling_tree (
void);
void
acpi_db_display_object_type (
char *object_arg);
void
acpi_db_display_argument_object (
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state);
void
acpi_db_dump_parser_descriptor (
union acpi_parse_object *op);
void *
acpi_db_get_pointer (
void *target);
/*
* dbexec - debugger control method execution
*/
void
acpi_db_execute (
char *name,
char **args,
u32 flags);
void
acpi_db_create_execution_threads (
char *num_threads_arg,
char *num_loops_arg,
char *method_name_arg);
acpi_status
acpi_db_execute_method (
struct acpi_db_method_info *info,
struct acpi_buffer *return_obj);
void
acpi_db_execute_setup (
struct acpi_db_method_info *info);
u32
acpi_db_get_outstanding_allocations (
void);
void ACPI_SYSTEM_XFACE
acpi_db_method_thread (
void *context);
acpi_status
acpi_db_execution_walk (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
/*
* dbfileio - Debugger file I/O commands
*/
acpi_object_type
acpi_db_match_argument (
char *user_argument,
struct argument_info *arguments);
acpi_status
ae_local_load_table (
struct acpi_table_header *table_ptr);
void
acpi_db_close_debug_file (
void);
void
acpi_db_open_debug_file (
char *name);
acpi_status
acpi_db_load_acpi_table (
char *filename);
acpi_status
acpi_db_get_table_from_file (
char *filename,
struct acpi_table_header **table);
acpi_status
acpi_db_read_table_from_file (
char *filename,
struct acpi_table_header **table);
/*
* dbhistry - debugger HISTORY command
*/
void
acpi_db_add_to_history (
char *command_line);
void
acpi_db_display_history (void);
char *
acpi_db_get_from_history (
char *command_num_arg);
/*
* dbinput - user front-end to the AML debugger
*/
acpi_status
acpi_db_command_dispatch (
char *input_buffer,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
void ACPI_SYSTEM_XFACE
acpi_db_execute_thread (
void *context);
acpi_status
acpi_db_user_commands (
char prompt,
union acpi_parse_object *op);
void
acpi_db_display_help (
char *help_type);
char *
acpi_db_get_next_token (
char *string,
char **next);
u32
acpi_db_get_line (
char *input_buffer);
u32
acpi_db_match_command (
char *user_command);
void
acpi_db_single_thread (
void);
/*
* dbstats - Generation and display of ACPI table statistics
*/
void
acpi_db_generate_statistics (
union acpi_parse_object *root,
u8 is_method);
acpi_status
acpi_db_display_statistics (
char *type_arg);
acpi_status
acpi_db_classify_one_object (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
void
acpi_db_count_namespace_objects (
void);
void
acpi_db_enumerate_object (
union acpi_operand_object *obj_desc);
/*
* dbutils - AML debugger utilities
*/
void
acpi_db_set_output_destination (
u32 where);
void
acpi_db_dump_buffer (
u32 address);
void
acpi_db_dump_object (
union acpi_object *obj_desc,
u32 level);
void
acpi_db_prep_namestring (
char *name);
acpi_status
acpi_db_second_pass_parse (
union acpi_parse_object *root);
struct acpi_namespace_node *
acpi_db_local_ns_lookup (
char *name);
#endif /* __ACDEBUG_H__ */
-402
View File
@@ -1,402 +0,0 @@
/******************************************************************************
*
* Name: acdisasm.h - AML disassembler
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACDISASM_H__
#define __ACDISASM_H__
#include "amlresrc.h"
#define BLOCK_NONE 0
#define BLOCK_PAREN 1
#define BLOCK_BRACE 2
#define BLOCK_COMMA_LIST 4
extern const char *acpi_gbl_io_decode[2];
extern const char *acpi_gbl_word_decode[4];
extern const char *acpi_gbl_consume_decode[2];
extern const char *acpi_gbl_min_decode[2];
extern const char *acpi_gbl_max_decode[2];
extern const char *acpi_gbl_DECdecode[2];
extern const char *acpi_gbl_RNGdecode[4];
extern const char *acpi_gbl_MEMdecode[4];
extern const char *acpi_gbl_RWdecode[2];
extern const char *acpi_gbl_irq_decode[2];
extern const char *acpi_gbl_HEdecode[2];
extern const char *acpi_gbl_LLdecode[2];
extern const char *acpi_gbl_SHRdecode[2];
extern const char *acpi_gbl_TYPdecode[4];
extern const char *acpi_gbl_BMdecode[2];
extern const char *acpi_gbl_SIZdecode[4];
extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
struct acpi_op_walk_info
{
u32 level;
u32 bit_offset;
};
typedef
acpi_status (*asl_walk_callback) (
union acpi_parse_object *op,
u32 level,
void *context);
/*
* dmwalk
*/
void
acpi_dm_walk_parse_tree (
union acpi_parse_object *op,
asl_walk_callback descending_callback,
asl_walk_callback ascending_callback,
void *context);
acpi_status
acpi_dm_descending_op (
union acpi_parse_object *op,
u32 level,
void *context);
acpi_status
acpi_dm_ascending_op (
union acpi_parse_object *op,
u32 level,
void *context);
/*
* dmopcode
*/
void
acpi_dm_validate_name (
char *name,
union acpi_parse_object *op);
u32
acpi_dm_dump_name (
char *name);
void
acpi_dm_unicode (
union acpi_parse_object *op);
void
acpi_dm_disassemble (
struct acpi_walk_state *walk_state,
union acpi_parse_object *origin,
u32 num_opcodes);
void
acpi_dm_namestring (
char *name);
void
acpi_dm_display_path (
union acpi_parse_object *op);
void
acpi_dm_disassemble_one_op (
struct acpi_walk_state *walk_state,
struct acpi_op_walk_info *info,
union acpi_parse_object *op);
void
acpi_dm_decode_internal_object (
union acpi_operand_object *obj_desc);
u32
acpi_dm_block_type (
union acpi_parse_object *op);
u32
acpi_dm_list_type (
union acpi_parse_object *op);
acpi_status
acpi_ps_display_object_pathname (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
void
acpi_dm_method_flags (
union acpi_parse_object *op);
void
acpi_dm_field_flags (
union acpi_parse_object *op);
void
acpi_dm_address_space (
u8 space_id);
void
acpi_dm_region_flags (
union acpi_parse_object *op);
void
acpi_dm_match_op (
union acpi_parse_object *op);
void
acpi_dm_match_keyword (
union acpi_parse_object *op);
u8
acpi_dm_comma_if_list_member (
union acpi_parse_object *op);
void
acpi_dm_comma_if_field_member (
union acpi_parse_object *op);
/*
* dmobject
*/
void
acpi_dm_decode_node (
struct acpi_namespace_node *node);
void
acpi_dm_display_internal_object (
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state);
void
acpi_dm_display_arguments (
struct acpi_walk_state *walk_state);
void
acpi_dm_display_locals (
struct acpi_walk_state *walk_state);
void
acpi_dm_dump_method_info (
acpi_status status,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
/*
* dmbuffer
*/
void
acpi_is_eisa_id (
union acpi_parse_object *op);
void
acpi_dm_eisa_id (
u32 encoded_id);
u8
acpi_dm_is_unicode_buffer (
union acpi_parse_object *op);
u8
acpi_dm_is_string_buffer (
union acpi_parse_object *op);
/*
* dmresrc
*/
void
acpi_dm_disasm_byte_list (
u32 level,
u8 *byte_data,
u32 byte_count);
void
acpi_dm_byte_list (
struct acpi_op_walk_info *info,
union acpi_parse_object *op);
void
acpi_dm_resource_descriptor (
struct acpi_op_walk_info *info,
u8 *byte_data,
u32 byte_count);
u8
acpi_dm_is_resource_descriptor (
union acpi_parse_object *op);
void
acpi_dm_indent (
u32 level);
void
acpi_dm_bit_list (
u16 mask);
void
acpi_dm_decode_attribute (
u8 attribute);
/*
* dmresrcl
*/
void
acpi_dm_io_flags (
u8 flags);
void
acpi_dm_memory_flags (
u8 flags,
u8 specific_flags);
void
acpi_dm_word_descriptor (
struct asl_word_address_desc *resource,
u32 length,
u32 level);
void
acpi_dm_dword_descriptor (
struct asl_dword_address_desc *resource,
u32 length,
u32 level);
void
acpi_dm_qword_descriptor (
struct asl_qword_address_desc *resource,
u32 length,
u32 level);
void
acpi_dm_memory24_descriptor (
struct asl_memory_24_desc *resource,
u32 length,
u32 level);
void
acpi_dm_memory32_descriptor (
struct asl_memory_32_desc *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_mem32_descriptor (
struct asl_fixed_memory_32_desc *resource,
u32 length,
u32 level);
void
acpi_dm_generic_register_descriptor (
struct asl_general_register_desc *resource,
u32 length,
u32 level);
void
acpi_dm_interrupt_descriptor (
struct asl_extended_xrupt_desc *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_large_descriptor (
struct asl_large_vendor_desc *resource,
u32 length,
u32 level);
/*
* dmresrcs
*/
void
acpi_dm_irq_descriptor (
struct asl_irq_format_desc *resource,
u32 length,
u32 level);
void
acpi_dm_dma_descriptor (
struct asl_dma_format_desc *resource,
u32 length,
u32 level);
void
acpi_dm_io_descriptor (
struct asl_io_port_desc *resource,
u32 length,
u32 level);
void
acpi_dm_fixed_io_descriptor (
struct asl_fixed_io_port_desc *resource,
u32 length,
u32 level);
void
acpi_dm_start_dependent_descriptor (
struct asl_start_dependent_desc *resource,
u32 length,
u32 level);
void
acpi_dm_end_dependent_descriptor (
struct asl_start_dependent_desc *resource,
u32 length,
u32 level);
void
acpi_dm_vendor_small_descriptor (
struct asl_small_vendor_desc *resource,
u32 length,
u32 level);
#endif /* __ACDISASM_H__ */
-513
View File
@@ -1,513 +0,0 @@
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
#define NAMEOF_LOCAL_NTE "__L0"
#define NAMEOF_ARG_NTE "__A0"
/* Common interfaces */
acpi_status
acpi_ds_obj_stack_push (
void *object,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_obj_stack_pop (
u32 pop_count,
struct acpi_walk_state *walk_state);
void *
acpi_ds_obj_stack_get_value (
u32 index,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_obj_stack_pop_object (
union acpi_operand_object **object,
struct acpi_walk_state *walk_state);
/* dsopcode - support for late evaluation */
acpi_status
acpi_ds_execute_arguments (
struct acpi_namespace_node *node,
struct acpi_namespace_node *scope_node,
u32 aml_length,
u8 *aml_start);
acpi_status
acpi_ds_get_buffer_field_arguments (
union acpi_operand_object *obj_desc);
acpi_status
acpi_ds_get_region_arguments (
union acpi_operand_object *rgn_desc);
acpi_status
acpi_ds_get_buffer_arguments (
union acpi_operand_object *obj_desc);
acpi_status
acpi_ds_get_package_arguments (
union acpi_operand_object *obj_desc);
acpi_status
acpi_ds_init_buffer_field (
u16 aml_opcode,
union acpi_operand_object *obj_desc,
union acpi_operand_object *buffer_desc,
union acpi_operand_object *offset_desc,
union acpi_operand_object *length_desc,
union acpi_operand_object *result_desc);
acpi_status
acpi_ds_eval_buffer_field_operands (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
acpi_status
acpi_ds_eval_region_operands (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
acpi_status
acpi_ds_eval_data_object_operands (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
union acpi_operand_object *obj_desc);
acpi_status
acpi_ds_initialize_region (
acpi_handle obj_handle);
/* dsctrl - Parser/Interpreter interface, control stack routines */
acpi_status
acpi_ds_exec_begin_control_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
acpi_status
acpi_ds_exec_end_control_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
/* dsexec - Parser/Interpreter interface, method execution callbacks */
acpi_status
acpi_ds_get_predicate_value (
struct acpi_walk_state *walk_state,
union acpi_operand_object *result_obj);
acpi_status
acpi_ds_exec_begin_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
acpi_status
acpi_ds_exec_end_op (
struct acpi_walk_state *state);
/* dsfield - Parser/Interpreter interface for AML fields */
acpi_status
acpi_ds_get_field_names (
struct acpi_create_field_info *info,
struct acpi_walk_state *walk_state,
union acpi_parse_object *arg);
acpi_status
acpi_ds_create_field (
union acpi_parse_object *op,
struct acpi_namespace_node *region_node,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_create_bank_field (
union acpi_parse_object *op,
struct acpi_namespace_node *region_node,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_create_index_field (
union acpi_parse_object *op,
struct acpi_namespace_node *region_node,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_create_buffer_field (
union acpi_parse_object *op,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_init_field_objects (
union acpi_parse_object *op,
struct acpi_walk_state *walk_state);
/* dsload - Parser/Interpreter interface, namespace load callbacks */
acpi_status
acpi_ds_load1_begin_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
acpi_status
acpi_ds_load1_end_op (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_load2_begin_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
acpi_status
acpi_ds_load2_end_op (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_init_callbacks (
struct acpi_walk_state *walk_state,
u32 pass_number);
/* dsmthdat - method data (locals/args) */
acpi_status
acpi_ds_store_object_to_local (
u16 opcode,
u32 index,
union acpi_operand_object *src_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_method_data_get_entry (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state,
union acpi_operand_object ***node);
void
acpi_ds_method_data_delete_all (
struct acpi_walk_state *walk_state);
u8
acpi_ds_is_method_value (
union acpi_operand_object *obj_desc);
acpi_object_type
acpi_ds_method_data_get_type (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_method_data_get_value (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state,
union acpi_operand_object **dest_desc);
void
acpi_ds_method_data_delete_value (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_method_data_init_args (
union acpi_operand_object **params,
u32 max_param_count,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_method_data_get_node (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state,
struct acpi_namespace_node **node);
void
acpi_ds_method_data_init (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_method_data_set_value (
u16 opcode,
u32 index,
union acpi_operand_object *object,
struct acpi_walk_state *walk_state);
/* dsmethod - Parser/Interpreter interface - control method parsing */
acpi_status
acpi_ds_parse_method (
acpi_handle obj_handle);
acpi_status
acpi_ds_call_control_method (
struct acpi_thread_state *acpi_thread,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
acpi_status
acpi_ds_restart_control_method (
struct acpi_walk_state *walk_state,
union acpi_operand_object *return_desc);
acpi_status
acpi_ds_terminate_control_method (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_begin_method_execution (
struct acpi_namespace_node *method_node,
union acpi_operand_object *obj_desc,
struct acpi_namespace_node *calling_method_node);
/* dsobj - Parser/Interpreter interface - object initialization and conversion */
acpi_status
acpi_ds_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
acpi_status
acpi_ds_initialize_objects (
struct acpi_table_desc *table_desc,
struct acpi_namespace_node *start_node);
acpi_status
acpi_ds_build_internal_buffer_obj (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
u32 buffer_length,
union acpi_operand_object **obj_desc_ptr);
acpi_status
acpi_ds_build_internal_package_obj (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
u32 package_length,
union acpi_operand_object **obj_desc);
acpi_status
acpi_ds_build_internal_object (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
union acpi_operand_object **obj_desc_ptr);
acpi_status
acpi_ds_init_object_from_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
u16 opcode,
union acpi_operand_object **obj_desc);
acpi_status
acpi_ds_create_node (
struct acpi_walk_state *walk_state,
struct acpi_namespace_node *node,
union acpi_parse_object *op);
/* dsutils - Parser/Interpreter interface utility routines */
u8
acpi_ds_is_result_used (
union acpi_parse_object *op,
struct acpi_walk_state *walk_state);
void
acpi_ds_delete_result_if_not_used (
union acpi_parse_object *op,
union acpi_operand_object *result_obj,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_create_operand (
struct acpi_walk_state *walk_state,
union acpi_parse_object *arg,
u32 args_remaining);
acpi_status
acpi_ds_create_operands (
struct acpi_walk_state *walk_state,
union acpi_parse_object *first_arg);
acpi_status
acpi_ds_resolve_operands (
struct acpi_walk_state *walk_state);
void
acpi_ds_clear_operands (
struct acpi_walk_state *walk_state);
/*
* dswscope - Scope Stack manipulation
*/
acpi_status
acpi_ds_scope_stack_push (
struct acpi_namespace_node *node,
acpi_object_type type,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_scope_stack_pop (
struct acpi_walk_state *walk_state);
void
acpi_ds_scope_stack_clear (
struct acpi_walk_state *walk_state);
/* dswstate - parser WALK_STATE management routines */
struct acpi_walk_state *
acpi_ds_create_walk_state (
acpi_owner_id owner_id,
union acpi_parse_object *origin,
union acpi_operand_object *mth_desc,
struct acpi_thread_state *acpi_thread);
acpi_status
acpi_ds_init_aml_walk (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
struct acpi_namespace_node *method_node,
u8 *aml_start,
u32 aml_length,
union acpi_operand_object **params,
union acpi_operand_object **return_obj_desc,
u32 pass_number);
acpi_status
acpi_ds_obj_stack_delete_all (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_obj_stack_pop_and_delete (
u32 pop_count,
struct acpi_walk_state *walk_state);
void
acpi_ds_delete_walk_state (
struct acpi_walk_state *walk_state);
struct acpi_walk_state *
acpi_ds_pop_walk_state (
struct acpi_thread_state *acpi_thread);
void
acpi_ds_push_walk_state (
struct acpi_walk_state *walk_state,
struct acpi_thread_state *acpi_thread);
acpi_status
acpi_ds_result_stack_pop (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_stack_push (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_stack_clear (
struct acpi_walk_state *walk_state);
struct acpi_walk_state *
acpi_ds_get_current_walk_state (
struct acpi_thread_state *acpi_thread);
void
acpi_ds_delete_walk_state_cache (
void);
acpi_status
acpi_ds_result_insert (
void *object,
u32 index,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_remove (
union acpi_operand_object **object,
u32 index,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_pop (
union acpi_operand_object **object,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_push (
union acpi_operand_object *object,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ds_result_pop_from_bottom (
union acpi_operand_object **object,
struct acpi_walk_state *walk_state);
#endif /* _ACDISPAT_H_ */
-274
View File
@@ -1,274 +0,0 @@
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACEVENTS_H__
#define __ACEVENTS_H__
acpi_status
acpi_ev_initialize (
void);
acpi_status
acpi_ev_handler_initialize (
void);
/*
* Evfixed - Fixed event handling
*/
acpi_status
acpi_ev_fixed_event_initialize (
void);
u32
acpi_ev_fixed_event_detect (
void);
u32
acpi_ev_fixed_event_dispatch (
u32 event);
/*
* Evmisc
*/
u8
acpi_ev_is_notify_object (
struct acpi_namespace_node *node);
acpi_status
acpi_ev_acquire_global_lock(
u16 timeout);
acpi_status
acpi_ev_release_global_lock(
void);
acpi_status
acpi_ev_init_global_lock_handler (
void);
u32
acpi_ev_get_gpe_number_index (
u32 gpe_number);
acpi_status
acpi_ev_queue_notify_request (
struct acpi_namespace_node *node,
u32 notify_value);
void ACPI_SYSTEM_XFACE
acpi_ev_notify_dispatch (
void *context);
/*
* Evgpe - GPE handling and dispatch
*/
acpi_status
acpi_ev_walk_gpe_list (
ACPI_GPE_CALLBACK gpe_walk_callback);
u8
acpi_ev_valid_gpe_event (
struct acpi_gpe_event_info *gpe_event_info);
struct acpi_gpe_event_info *
acpi_ev_get_gpe_event_info (
acpi_handle gpe_device,
u32 gpe_number);
acpi_status
acpi_ev_gpe_initialize (
void);
acpi_status
acpi_ev_create_gpe_block (
struct acpi_namespace_node *gpe_device,
struct acpi_generic_address *gpe_block_address,
u32 register_count,
u8 gpe_block_base_number,
u32 interrupt_level,
struct acpi_gpe_block_info **return_gpe_block);
acpi_status
acpi_ev_delete_gpe_block (
struct acpi_gpe_block_info *gpe_block);
u32
acpi_ev_gpe_dispatch (
struct acpi_gpe_event_info *gpe_event_info,
u32 gpe_number);
u32
acpi_ev_gpe_detect (
struct acpi_gpe_xrupt_info *gpe_xrupt_list);
/*
* Evregion - Address Space handling
*/
acpi_status
acpi_ev_init_address_spaces (
void);
acpi_status
acpi_ev_address_space_dispatch (
union acpi_operand_object *region_obj,
u32 function,
acpi_physical_address address,
u32 bit_width,
void *value);
acpi_status
acpi_ev_install_handler (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
acpi_status
acpi_ev_attach_region (
union acpi_operand_object *handler_obj,
union acpi_operand_object *region_obj,
u8 acpi_ns_is_locked);
void
acpi_ev_detach_region (
union acpi_operand_object *region_obj,
u8 acpi_ns_is_locked);
acpi_status
acpi_ev_execute_reg_method (
union acpi_operand_object *region_obj,
u32 function);
acpi_status
acpi_ev_reg_run (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
/*
* Evregini - Region initialization and setup
*/
acpi_status
acpi_ev_system_memory_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_io_space_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_pci_config_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_cmos_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_pci_bar_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_default_region_setup (
acpi_handle handle,
u32 function,
void *handler_context,
void **region_context);
acpi_status
acpi_ev_initialize_region (
union acpi_operand_object *region_obj,
u8 acpi_ns_locked);
/*
* Evsci - SCI (System Control Interrupt) handling/dispatch
*/
u32 ACPI_SYSTEM_XFACE
acpi_ev_gpe_xrupt_handler (
void *context);
u32
acpi_ev_install_sci_handler (
void);
acpi_status
acpi_ev_remove_sci_handler (
void);
u32
acpi_ev_initialize_sCI (
u32 program_sCI);
void
acpi_ev_terminate (
void);
#endif /* __ACEVENTS_H__ */
-738
View File
@@ -1,738 +0,0 @@
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACINTERP_H__
#define __ACINTERP_H__
#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
acpi_status
acpi_ex_resolve_operands (
u16 opcode,
union acpi_operand_object **stack_ptr,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_check_object_type (
acpi_object_type type_needed,
acpi_object_type this_type,
void *object);
/*
* exxface - External interpreter interfaces
*/
acpi_status
acpi_ex_load_table (
acpi_table_type table_id);
acpi_status
acpi_ex_execute_method (
struct acpi_namespace_node *method_node,
union acpi_operand_object **params,
union acpi_operand_object **return_obj_desc);
/*
* exconvrt - object conversion
*/
acpi_status
acpi_ex_convert_to_integer (
union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_convert_to_buffer (
union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_convert_to_string (
union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc,
u32 base,
u32 max_length,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_convert_to_target_type (
acpi_object_type destination_type,
union acpi_operand_object *source_desc,
union acpi_operand_object **result_desc,
struct acpi_walk_state *walk_state);
u32
acpi_ex_convert_to_ascii (
acpi_integer integer,
u32 base,
u8 *string,
u8 max_length);
/*
* exfield - ACPI AML (p-code) execution - field manipulation
*/
acpi_status
acpi_ex_extract_from_field (
union acpi_operand_object *obj_desc,
void *buffer,
u32 buffer_length);
acpi_status
acpi_ex_insert_into_field (
union acpi_operand_object *obj_desc,
void *buffer,
u32 buffer_length);
acpi_status
acpi_ex_setup_region (
union acpi_operand_object *obj_desc,
u32 field_datum_byte_offset);
acpi_status
acpi_ex_access_region (
union acpi_operand_object *obj_desc,
u32 field_datum_byte_offset,
acpi_integer *value,
u32 read_write);
u8
acpi_ex_register_overflow (
union acpi_operand_object *obj_desc,
acpi_integer value);
acpi_status
acpi_ex_field_datum_io (
union acpi_operand_object *obj_desc,
u32 field_datum_byte_offset,
acpi_integer *value,
u32 read_write);
acpi_status
acpi_ex_write_with_update_rule (
union acpi_operand_object *obj_desc,
acpi_integer mask,
acpi_integer field_value,
u32 field_datum_byte_offset);
void
acpi_ex_get_buffer_datum(
acpi_integer *datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 buffer_offset);
void
acpi_ex_set_buffer_datum (
acpi_integer merged_datum,
void *buffer,
u32 buffer_length,
u32 byte_granularity,
u32 buffer_offset);
acpi_status
acpi_ex_read_data_from_field (
struct acpi_walk_state *walk_state,
union acpi_operand_object *obj_desc,
union acpi_operand_object **ret_buffer_desc);
acpi_status
acpi_ex_write_data_to_field (
union acpi_operand_object *source_desc,
union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc);
/*
* exmisc - ACPI AML (p-code) execution - specific opcodes
*/
acpi_status
acpi_ex_opcode_3A_0T_0R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_3A_1T_1R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_6A_0T_1R (
struct acpi_walk_state *walk_state);
u8
acpi_ex_do_match (
u32 match_op,
acpi_integer package_value,
acpi_integer match_value);
acpi_status
acpi_ex_get_object_reference (
union acpi_operand_object *obj_desc,
union acpi_operand_object **return_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_resolve_multiple (
struct acpi_walk_state *walk_state,
union acpi_operand_object *operand,
acpi_object_type *return_type,
union acpi_operand_object **return_desc);
acpi_status
acpi_ex_concat_template (
union acpi_operand_object *obj_desc,
union acpi_operand_object *obj_desc2,
union acpi_operand_object **actual_return_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_do_concatenate (
union acpi_operand_object *obj_desc,
union acpi_operand_object *obj_desc2,
union acpi_operand_object **actual_return_desc,
struct acpi_walk_state *walk_state);
u8
acpi_ex_do_logical_op (
u16 opcode,
acpi_integer operand0,
acpi_integer operand1);
acpi_integer
acpi_ex_do_math_op (
u16 opcode,
acpi_integer operand0,
acpi_integer operand1);
acpi_status
acpi_ex_create_mutex (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_processor (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_power_resource (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_region (
u8 *aml_start,
u32 aml_length,
u8 region_space,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_table_region (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_event (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_alias (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_create_method (
u8 *aml_start,
u32 aml_length,
struct acpi_walk_state *walk_state);
/*
* exconfig - dynamic table load/unload
*/
acpi_status
acpi_ex_add_table (
struct acpi_table_header *table,
struct acpi_namespace_node *parent_node,
union acpi_operand_object **ddb_handle);
acpi_status
acpi_ex_load_op (
union acpi_operand_object *obj_desc,
union acpi_operand_object *target,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_load_table_op (
struct acpi_walk_state *walk_state,
union acpi_operand_object **return_desc);
acpi_status
acpi_ex_unload_table (
union acpi_operand_object *ddb_handle);
/*
* exmutex - mutex support
*/
acpi_status
acpi_ex_acquire_mutex (
union acpi_operand_object *time_desc,
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_release_mutex (
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state);
void
acpi_ex_release_all_mutexes (
struct acpi_thread_state *acpi_thread);
void
acpi_ex_unlink_mutex (
union acpi_operand_object *obj_desc);
void
acpi_ex_link_mutex (
union acpi_operand_object *obj_desc,
struct acpi_thread_state *acpi_thread);
/*
* exprep - ACPI AML (p-code) execution - prep utilities
*/
acpi_status
acpi_ex_prep_common_field_object (
union acpi_operand_object *obj_desc,
u8 field_flags,
u8 field_attribute,
u32 field_bit_position,
u32 field_bit_length);
acpi_status
acpi_ex_prep_field_value (
struct acpi_create_field_info *info);
/*
* exsystem - Interface to OS services
*/
acpi_status
acpi_ex_system_do_notify_op (
union acpi_operand_object *value,
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_do_suspend(
u32 time);
acpi_status
acpi_ex_system_do_stall (
u32 time);
acpi_status
acpi_ex_system_acquire_mutex(
union acpi_operand_object *time,
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_release_mutex(
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_signal_event(
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_wait_event(
union acpi_operand_object *time,
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_reset_event(
union acpi_operand_object *obj_desc);
acpi_status
acpi_ex_system_wait_semaphore (
acpi_handle semaphore,
u16 timeout);
/*
* exmonadic - ACPI AML (p-code) execution, monadic operators
*/
acpi_status
acpi_ex_opcode_1A_0T_0R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_1A_0T_1R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_1A_1T_1R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_1A_1T_0R (
struct acpi_walk_state *walk_state);
/*
* exdyadic - ACPI AML (p-code) execution, dyadic operators
*/
acpi_status
acpi_ex_opcode_2A_0T_0R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_2A_0T_1R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_2A_1T_1R (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_opcode_2A_2T_1R (
struct acpi_walk_state *walk_state);
/*
* exresolv - Object resolution and get value functions
*/
acpi_status
acpi_ex_resolve_to_value (
union acpi_operand_object **stack_ptr,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_resolve_node_to_value (
struct acpi_namespace_node **stack_ptr,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_resolve_object_to_value (
union acpi_operand_object **stack_ptr,
struct acpi_walk_state *walk_state);
/*
* exdump - Scanner debug output routines
*/
void
acpi_ex_dump_operand (
union acpi_operand_object *entry_desc);
void
acpi_ex_dump_operands (
union acpi_operand_object **operands,
acpi_interpreter_mode interpreter_mode,
char *ident,
u32 num_levels,
char *note,
char *module_name,
u32 line_number);
void
acpi_ex_dump_object_descriptor (
union acpi_operand_object *object,
u32 flags);
void
acpi_ex_dump_node (
struct acpi_namespace_node *node,
u32 flags);
void
acpi_ex_out_string (
char *title,
char *value);
void
acpi_ex_out_pointer (
char *title,
void *value);
void
acpi_ex_out_integer (
char *title,
u32 value);
void
acpi_ex_out_address (
char *title,
acpi_physical_address value);
/*
* exnames - interpreter/scanner name load/execute
*/
char *
acpi_ex_allocate_name_string (
u32 prefix_count,
u32 num_name_segs);
u32
acpi_ex_good_char (
u32 character);
acpi_status
acpi_ex_name_segment (
u8 **in_aml_address,
char *name_string);
acpi_status
acpi_ex_get_name_string (
acpi_object_type data_type,
u8 *in_aml_address,
char **out_name_string,
u32 *out_name_length);
acpi_status
acpi_ex_do_name (
acpi_object_type data_type,
acpi_interpreter_mode load_exec_mode);
/*
* exstore - Object store support
*/
acpi_status
acpi_ex_store (
union acpi_operand_object *val_desc,
union acpi_operand_object *dest_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_store_object_to_index (
union acpi_operand_object *val_desc,
union acpi_operand_object *dest_desc,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_store_object_to_node (
union acpi_operand_object *source_desc,
struct acpi_namespace_node *node,
struct acpi_walk_state *walk_state);
/*
* exstoren
*/
acpi_status
acpi_ex_resolve_object (
union acpi_operand_object **source_desc_ptr,
acpi_object_type target_type,
struct acpi_walk_state *walk_state);
acpi_status
acpi_ex_store_object_to_object (
union acpi_operand_object *source_desc,
union acpi_operand_object *dest_desc,
union acpi_operand_object **new_desc,
struct acpi_walk_state *walk_state);
/*
* excopy - object copy
*/
acpi_status
acpi_ex_store_buffer_to_buffer (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
acpi_status
acpi_ex_store_string_to_string (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
acpi_status
acpi_ex_copy_integer_to_index_field (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
acpi_status
acpi_ex_copy_integer_to_bank_field (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
acpi_status
acpi_ex_copy_data_to_named_field (
union acpi_operand_object *source_desc,
struct acpi_namespace_node *node);
acpi_status
acpi_ex_copy_integer_to_buffer_field (
union acpi_operand_object *source_desc,
union acpi_operand_object *target_desc);
/*
* exutils - interpreter/scanner utilities
*/
acpi_status
acpi_ex_enter_interpreter (
void);
void
acpi_ex_exit_interpreter (
void);
void
acpi_ex_truncate_for32bit_table (
union acpi_operand_object *obj_desc);
u8
acpi_ex_acquire_global_lock (
u32 rule);
void
acpi_ex_release_global_lock (
u8 locked);
u32
acpi_ex_digits_needed (
acpi_integer value,
u32 base);
void
acpi_ex_eisa_id_to_string (
u32 numeric_id,
char *out_string);
void
acpi_ex_unsigned_integer_to_string (
acpi_integer value,
char *out_string);
/*
* exregion - default op_region handlers
*/
acpi_status
acpi_ex_system_memory_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_system_io_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_pci_config_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_cmos_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_pci_bar_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_embedded_controller_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_sm_bus_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
acpi_status
acpi_ex_data_table_space_handler (
u32 function,
acpi_physical_address address,
u32 bit_width,
acpi_integer *value,
void *handler_context,
void *region_context);
#endif /* __INTERP_H__ */
-513
View File
@@ -1,513 +0,0 @@
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACNAMESP_H__
#define __ACNAMESP_H__
/* To search the entire name space, pass this as search_base */
#define ACPI_NS_ALL ((acpi_handle)0)
/*
* Elements of acpi_ns_properties are bit significant
* and should be one-to-one with values of acpi_object_type
*/
#define ACPI_NS_NORMAL 0
#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
/* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
#define ACPI_NS_ROOT_PATH "\\"
#define ACPI_NS_SYSTEM_BUS "_SB_"
/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
#define ACPI_NS_NO_UPSEARCH 0
#define ACPI_NS_SEARCH_PARENT 0x01
#define ACPI_NS_DONT_OPEN_SCOPE 0x02
#define ACPI_NS_NO_PEER_SEARCH 0x04
#define ACPI_NS_ERROR_IF_FOUND 0x08
#define ACPI_NS_WALK_UNLOCK TRUE
#define ACPI_NS_WALK_NO_UNLOCK FALSE
acpi_status
acpi_ns_load_namespace (
void);
acpi_status
acpi_ns_initialize_objects (
void);
acpi_status
acpi_ns_initialize_devices (
void);
/* Namespace init - nsxfinit */
acpi_status
acpi_ns_init_one_device (
acpi_handle obj_handle,
u32 nesting_level,
void *context,
void **return_value);
acpi_status
acpi_ns_init_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
acpi_status
acpi_ns_walk_namespace (
acpi_object_type type,
acpi_handle start_object,
u32 max_depth,
u8 unlock_before_callback,
acpi_walk_callback user_function,
void *context,
void **return_value);
struct acpi_namespace_node *
acpi_ns_get_next_node (
acpi_object_type type,
struct acpi_namespace_node *parent,
struct acpi_namespace_node *child);
void
acpi_ns_delete_namespace_by_owner (
u16 table_id);
/* Namespace loading - nsload */
acpi_status
acpi_ns_one_complete_parse (
u32 pass_number,
struct acpi_table_desc *table_desc);
acpi_status
acpi_ns_parse_table (
struct acpi_table_desc *table_desc,
struct acpi_namespace_node *scope);
acpi_status
acpi_ns_load_table (
struct acpi_table_desc *table_desc,
struct acpi_namespace_node *node);
acpi_status
acpi_ns_load_table_by_type (
acpi_table_type table_type);
/*
* Top-level namespace access - nsaccess
*/
acpi_status
acpi_ns_root_initialize (
void);
acpi_status
acpi_ns_lookup (
union acpi_generic_state *scope_info,
char *name,
acpi_object_type type,
acpi_interpreter_mode interpreter_mode,
u32 flags,
struct acpi_walk_state *walk_state,
struct acpi_namespace_node **ret_node);
/*
* Named object allocation/deallocation - nsalloc
*/
struct acpi_namespace_node *
acpi_ns_create_node (
u32 name);
void
acpi_ns_delete_node (
struct acpi_namespace_node *node);
void
acpi_ns_delete_namespace_subtree (
struct acpi_namespace_node *parent_handle);
void
acpi_ns_detach_object (
struct acpi_namespace_node *node);
void
acpi_ns_delete_children (
struct acpi_namespace_node *parent);
int
acpi_ns_compare_names (
char *name1,
char *name2);
void
acpi_ns_remove_reference (
struct acpi_namespace_node *node);
/*
* Namespace modification - nsmodify
*/
acpi_status
acpi_ns_unload_namespace (
acpi_handle handle);
acpi_status
acpi_ns_delete_subtree (
acpi_handle start_handle);
/*
* Namespace dump/print utilities - nsdump
*/
void
acpi_ns_dump_tables (
acpi_handle search_base,
u32 max_depth);
void
acpi_ns_dump_entry (
acpi_handle handle,
u32 debug_level);
void
acpi_ns_dump_pathname (
acpi_handle handle,
char *msg,
u32 level,
u32 component);
void
acpi_ns_print_pathname (
u32 num_segments,
char *pathname);
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
void
acpi_ns_dump_root_devices (
void);
acpi_status
acpi_ns_dump_one_object (
acpi_handle obj_handle,
u32 level,
void *context,
void **return_value);
void
acpi_ns_dump_objects (
acpi_object_type type,
u8 display_type,
u32 max_depth,
u32 ownder_id,
acpi_handle start_handle);
/*
* Namespace evaluation functions - nseval
*/
acpi_status
acpi_ns_evaluate_by_handle (
struct acpi_namespace_node *prefix_node,
union acpi_operand_object **params,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_evaluate_by_name (
char *pathname,
union acpi_operand_object **params,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_evaluate_relative (
struct acpi_namespace_node *prefix_node,
char *pathname,
union acpi_operand_object **params,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_execute_control_method (
struct acpi_namespace_node *method_node,
union acpi_operand_object **params,
union acpi_operand_object **return_obj_desc);
acpi_status
acpi_ns_get_object_value (
struct acpi_namespace_node *object_node,
union acpi_operand_object **return_obj_desc);
/*
* Parent/Child/Peer utility functions
*/
acpi_name
acpi_ns_find_parent_name (
struct acpi_namespace_node *node_to_search);
/*
* Name and Scope manipulation - nsnames
*/
u32
acpi_ns_opens_scope (
acpi_object_type type);
void
acpi_ns_build_external_path (
struct acpi_namespace_node *node,
acpi_size size,
char *name_buffer);
char *
acpi_ns_get_external_pathname (
struct acpi_namespace_node *node);
char *
acpi_ns_name_of_current_scope (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ns_handle_to_pathname (
acpi_handle target_handle,
struct acpi_buffer *buffer);
u8
acpi_ns_pattern_match (
struct acpi_namespace_node *obj_node,
char *search_for);
acpi_status
acpi_ns_get_node_by_path (
char *external_pathname,
struct acpi_namespace_node *in_prefix_node,
u32 flags,
struct acpi_namespace_node **out_node);
acpi_size
acpi_ns_get_pathname_length (
struct acpi_namespace_node *node);
/*
* Object management for namespace nodes - nsobject
*/
acpi_status
acpi_ns_attach_object (
struct acpi_namespace_node *node,
union acpi_operand_object *object,
acpi_object_type type);
union acpi_operand_object *
acpi_ns_get_attached_object (
struct acpi_namespace_node *node);
union acpi_operand_object *
acpi_ns_get_secondary_object (
union acpi_operand_object *obj_desc);
acpi_status
acpi_ns_attach_data (
struct acpi_namespace_node *node,
acpi_object_handler handler,
void *data);
acpi_status
acpi_ns_detach_data (
struct acpi_namespace_node *node,
acpi_object_handler handler);
acpi_status
acpi_ns_get_attached_data (
struct acpi_namespace_node *node,
acpi_object_handler handler,
void **data);
/*
* Namespace searching and entry - nssearch
*/
acpi_status
acpi_ns_search_and_enter (
u32 entry_name,
struct acpi_walk_state *walk_state,
struct acpi_namespace_node *node,
acpi_interpreter_mode interpreter_mode,
acpi_object_type type,
u32 flags,
struct acpi_namespace_node **ret_node);
acpi_status
acpi_ns_search_node (
u32 entry_name,
struct acpi_namespace_node *node,
acpi_object_type type,
struct acpi_namespace_node **ret_node);
void
acpi_ns_install_node (
struct acpi_walk_state *walk_state,
struct acpi_namespace_node *parent_node,
struct acpi_namespace_node *node,
acpi_object_type type);
/*
* Utility functions - nsutils
*/
u8
acpi_ns_valid_root_prefix (
char prefix);
u8
acpi_ns_valid_path_separator (
char sep);
acpi_object_type
acpi_ns_get_type (
struct acpi_namespace_node *node);
u32
acpi_ns_local (
acpi_object_type type);
void
acpi_ns_report_error (
char *module_name,
u32 line_number,
u32 component_id,
char *internal_name,
acpi_status lookup_status);
void
acpi_ns_report_method_error (
char *module_name,
u32 line_number,
u32 component_id,
char *message,
struct acpi_namespace_node *node,
char *path,
acpi_status lookup_status);
void
acpi_ns_print_node_pathname (
struct acpi_namespace_node *node,
char *msg);
acpi_status
acpi_ns_build_internal_name (
struct acpi_namestring_info *info);
void
acpi_ns_get_internal_name_length (
struct acpi_namestring_info *info);
acpi_status
acpi_ns_internalize_name (
char *dotted_name,
char **converted_name);
acpi_status
acpi_ns_externalize_name (
u32 internal_name_length,
char *internal_name,
u32 *converted_name_length,
char **converted_name);
struct acpi_namespace_node *
acpi_ns_map_handle_to_node (
acpi_handle handle);
acpi_handle
acpi_ns_convert_entry_to_handle(
struct acpi_namespace_node *node);
void
acpi_ns_terminate (
void);
struct acpi_namespace_node *
acpi_ns_get_parent_node (
struct acpi_namespace_node *node);
struct acpi_namespace_node *
acpi_ns_get_next_valid_node (
struct acpi_namespace_node *node);
#endif /* __ACNAMESP_H__ */
-347
View File
@@ -1,347 +0,0 @@
/******************************************************************************
*
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
#define OP_HAS_RETURN_VALUE 1
/* variable # arguments */
#define ACPI_VAR_ARGS ACPI_UINT32_MAX
#define ACPI_PARSE_DELETE_TREE 0x0001
#define ACPI_PARSE_NO_TREE_DELETE 0x0000
#define ACPI_PARSE_TREE_MASK 0x0001
#define ACPI_PARSE_LOAD_PASS1 0x0010
#define ACPI_PARSE_LOAD_PASS2 0x0020
#define ACPI_PARSE_EXECUTE 0x0030
#define ACPI_PARSE_MODE_MASK 0x0030
#define ACPI_PARSE_DEFERRED_OP 0x0100
/* Parser external interfaces */
acpi_status
acpi_psx_load_table (
u8 *pcode_addr,
u32 pcode_length);
acpi_status
acpi_psx_execute (
struct acpi_namespace_node *method_node,
union acpi_operand_object **params,
union acpi_operand_object **return_obj_desc);
/******************************************************************************
*
* Parser interfaces
*
*****************************************************************************/
/* psargs - Parse AML opcode arguments */
u8 *
acpi_ps_get_next_package_end (
struct acpi_parse_state *parser_state);
u32
acpi_ps_get_next_package_length (
struct acpi_parse_state *parser_state);
char *
acpi_ps_get_next_namestring (
struct acpi_parse_state *parser_state);
void
acpi_ps_get_next_simple_arg (
struct acpi_parse_state *parser_state,
u32 arg_type,
union acpi_parse_object *arg);
acpi_status
acpi_ps_get_next_namepath (
struct acpi_walk_state *walk_state,
struct acpi_parse_state *parser_state,
union acpi_parse_object *arg,
u8 method_call);
union acpi_parse_object *
acpi_ps_get_next_field (
struct acpi_parse_state *parser_state);
acpi_status
acpi_ps_get_next_arg (
struct acpi_walk_state *walk_state,
struct acpi_parse_state *parser_state,
u32 arg_type,
union acpi_parse_object **return_arg);
/* psfind */
union acpi_parse_object *
acpi_ps_find_name (
union acpi_parse_object *scope,
u32 name,
u32 opcode);
union acpi_parse_object*
acpi_ps_get_parent (
union acpi_parse_object *op);
/* psopcode - AML Opcode information */
const struct acpi_opcode_info *
acpi_ps_get_opcode_info (
u16 opcode);
char *
acpi_ps_get_opcode_name (
u16 opcode);
/* psparse - top level parsing routines */
u32
acpi_ps_get_opcode_size (
u32 opcode);
void
acpi_ps_complete_this_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
acpi_status
acpi_ps_next_parse_state (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
acpi_status callback_status);
acpi_status
acpi_ps_find_object (
struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
void
acpi_ps_delete_parse_tree (
union acpi_parse_object *root);
acpi_status
acpi_ps_parse_loop (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ps_parse_aml (
struct acpi_walk_state *walk_state);
acpi_status
acpi_ps_parse_table (
u8 *aml,
u32 aml_size,
acpi_parse_downwards descending_callback,
acpi_parse_upwards ascending_callback,
union acpi_parse_object **root_object);
u16
acpi_ps_peek_opcode (
struct acpi_parse_state *state);
/* psscope - Scope stack management routines */
acpi_status
acpi_ps_init_scope (
struct acpi_parse_state *parser_state,
union acpi_parse_object *root);
union acpi_parse_object *
acpi_ps_get_parent_scope (
struct acpi_parse_state *state);
u8
acpi_ps_has_completed_scope (
struct acpi_parse_state *parser_state);
void
acpi_ps_pop_scope (
struct acpi_parse_state *parser_state,
union acpi_parse_object **op,
u32 *arg_list,
u32 *arg_count);
acpi_status
acpi_ps_push_scope (
struct acpi_parse_state *parser_state,
union acpi_parse_object *op,
u32 remaining_args,
u32 arg_count);
void
acpi_ps_cleanup_scope (
struct acpi_parse_state *state);
/* pstree - parse tree manipulation routines */
void
acpi_ps_append_arg(
union acpi_parse_object *op,
union acpi_parse_object *arg);
union acpi_parse_object*
acpi_ps_find (
union acpi_parse_object *scope,
char *path,
u16 opcode,
u32 create);
union acpi_parse_object *
acpi_ps_get_arg(
union acpi_parse_object *op,
u32 argn);
union acpi_parse_object *
acpi_ps_get_child (
union acpi_parse_object *op);
union acpi_parse_object *
acpi_ps_get_depth_next (
union acpi_parse_object *origin,
union acpi_parse_object *op);
/* pswalk - parse tree walk routines */
acpi_status
acpi_ps_walk_parsed_aml (
union acpi_parse_object *start_op,
union acpi_parse_object *end_op,
union acpi_operand_object *mth_desc,
struct acpi_namespace_node *start_node,
union acpi_operand_object **params,
union acpi_operand_object **caller_return_desc,
acpi_owner_id owner_id,
acpi_parse_downwards descending_callback,
acpi_parse_upwards ascending_callback);
acpi_status
acpi_ps_get_next_walk_op (
struct acpi_walk_state *walk_state,
union acpi_parse_object *op,
acpi_parse_upwards ascending_callback);
acpi_status
acpi_ps_delete_completed_op (
struct acpi_walk_state *walk_state);
/* psutils - parser utilities */
union acpi_parse_object *
acpi_ps_create_scope_op (
void);
void
acpi_ps_init_op (
union acpi_parse_object *op,
u16 opcode);
union acpi_parse_object *
acpi_ps_alloc_op (
u16 opcode);
void
acpi_ps_free_op (
union acpi_parse_object *op);
void
acpi_ps_delete_parse_cache (
void);
u8
acpi_ps_is_leading_char (
u32 c);
u8
acpi_ps_is_prefix_char (
u32 c);
u32
acpi_ps_get_name(
union acpi_parse_object *op);
void
acpi_ps_set_name(
union acpi_parse_object *op,
u32 name);
/* psdump - display parser tree */
u32
acpi_ps_sprint_path (
char *buffer_start,
u32 buffer_size,
union acpi_parse_object *op);
u32
acpi_ps_sprint_op (
char *buffer_start,
u32 buffer_size,
union acpi_parse_object *op);
void
acpi_ps_show (
union acpi_parse_object *op);
#endif /* __ACPARSER_H__ */
-391
View File
@@ -1,391 +0,0 @@
/******************************************************************************
*
* Name: acresrc.h - Resource Manager function prototypes
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACRESRC_H__
#define __ACRESRC_H__
/*
* Function prototypes called from Acpi* APIs
*/
acpi_status
acpi_rs_get_prt_method_data (
acpi_handle handle,
struct acpi_buffer *ret_buffer);
acpi_status
acpi_rs_get_crs_method_data (
acpi_handle handle,
struct acpi_buffer *ret_buffer);
acpi_status
acpi_rs_get_prs_method_data (
acpi_handle handle,
struct acpi_buffer *ret_buffer);
acpi_status
acpi_rs_get_method_data (
acpi_handle handle,
char *path,
struct acpi_buffer *ret_buffer);
acpi_status
acpi_rs_set_srs_method_data (
acpi_handle handle,
struct acpi_buffer *ret_buffer);
acpi_status
acpi_rs_create_resource_list (
union acpi_operand_object *byte_stream_buffer,
struct acpi_buffer *output_buffer);
acpi_status
acpi_rs_create_byte_stream (
struct acpi_resource *linked_list_buffer,
struct acpi_buffer *output_buffer);
acpi_status
acpi_rs_create_pci_routing_table (
union acpi_operand_object *package_object,
struct acpi_buffer *output_buffer);
/*
* Function prototypes called from acpi_rs_create*
*/
void
acpi_rs_dump_irq (
union acpi_resource_data *data);
void
acpi_rs_dump_address16 (
union acpi_resource_data *data);
void
acpi_rs_dump_address32 (
union acpi_resource_data *data);
void
acpi_rs_dump_address64 (
union acpi_resource_data *data);
void
acpi_rs_dump_dma (
union acpi_resource_data *data);
void
acpi_rs_dump_io (
union acpi_resource_data *data);
void
acpi_rs_dump_extended_irq (
union acpi_resource_data *data);
void
acpi_rs_dump_fixed_io (
union acpi_resource_data *data);
void
acpi_rs_dump_fixed_memory32 (
union acpi_resource_data *data);
void
acpi_rs_dump_memory24 (
union acpi_resource_data *data);
void
acpi_rs_dump_memory32 (
union acpi_resource_data *data);
void
acpi_rs_dump_start_depend_fns (
union acpi_resource_data *data);
void
acpi_rs_dump_vendor_specific (
union acpi_resource_data *data);
void
acpi_rs_dump_resource_list (
struct acpi_resource *resource);
void
acpi_rs_dump_irq_list (
u8 *route_table);
acpi_status
acpi_rs_get_byte_stream_start (
u8 *byte_stream_buffer,
u8 **byte_stream_start,
u32 *size);
acpi_status
acpi_rs_get_list_length (
u8 *byte_stream_buffer,
u32 byte_stream_buffer_length,
acpi_size *size_needed);
acpi_status
acpi_rs_get_byte_stream_length (
struct acpi_resource *linked_list_buffer,
acpi_size *size_needed);
acpi_status
acpi_rs_get_pci_routing_table_length (
union acpi_operand_object *package_object,
acpi_size *buffer_size_needed);
acpi_status
acpi_rs_byte_stream_to_list (
u8 *byte_stream_buffer,
u32 byte_stream_buffer_length,
u8 *output_buffer);
acpi_status
acpi_rs_list_to_byte_stream (
struct acpi_resource *linked_list,
acpi_size byte_stream_size_needed,
u8 *output_buffer);
acpi_status
acpi_rs_io_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_fixed_io_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_io_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_fixed_io_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_irq_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_irq_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_dma_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_dma_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_address16_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_address16_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_address32_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_address32_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_address64_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_address64_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_start_depend_fns_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_end_depend_fns_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_start_depend_fns_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_end_depend_fns_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_memory24_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_memory24_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_memory32_range_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_fixed_memory32_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_memory32_range_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_fixed_memory32_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_extended_irq_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_extended_irq_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_end_tag_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_end_tag_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
acpi_status
acpi_rs_vendor_resource (
u8 *byte_stream_buffer,
acpi_size *bytes_consumed,
u8 **output_buffer,
acpi_size *structure_size);
acpi_status
acpi_rs_vendor_stream (
struct acpi_resource *linked_list,
u8 **output_buffer,
acpi_size *bytes_consumed);
u8
acpi_rs_get_resource_type (
u8 resource_start_byte);
#endif /* __ACRESRC_H__ */
-233
View File
@@ -1,233 +0,0 @@
/******************************************************************************
*
* Name: actables.h - ACPI table management
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */
#define SIZE_IN_HEADER 0
acpi_status
acpi_tb_handle_to_object (
u16 table_id,
struct acpi_table_desc **table_desc);
/*
* tbconvrt - Table conversion routines
*/
acpi_status
acpi_tb_convert_to_xsdt (
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_convert_table_fadt (
void);
acpi_status
acpi_tb_build_common_facs (
struct acpi_table_desc *table_info);
u32
acpi_tb_get_table_count (
struct rsdp_descriptor *RSDP,
struct acpi_table_header *RSDT);
/*
* tbget - Table "get" routines
*/
acpi_status
acpi_tb_get_table (
struct acpi_pointer *address,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_table_header (
struct acpi_pointer *address,
struct acpi_table_header *return_header);
acpi_status
acpi_tb_get_table_body (
struct acpi_pointer *address,
struct acpi_table_header *header,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_this_table (
struct acpi_pointer *address,
struct acpi_table_header *header,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_table_override (
struct acpi_table_header *header,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_table_ptr (
acpi_table_type table_type,
u32 instance,
struct acpi_table_header **table_ptr_loc);
acpi_status
acpi_tb_verify_rsdp (
struct acpi_pointer *address);
void
acpi_tb_get_rsdt_address (
struct acpi_pointer *out_address);
acpi_status
acpi_tb_validate_rsdt (
struct acpi_table_header *table_ptr);
acpi_status
acpi_tb_get_required_tables (
void);
acpi_status
acpi_tb_get_primary_table (
struct acpi_pointer *address,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_secondary_table (
struct acpi_pointer *address,
acpi_string signature,
struct acpi_table_desc *table_info);
/*
* tbinstall - Table installation
*/
acpi_status
acpi_tb_install_table (
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_match_signature (
char *signature,
struct acpi_table_desc *table_info,
u8 search_type);
acpi_status
acpi_tb_recognize_table (
struct acpi_table_desc *table_info,
u8 search_type);
acpi_status
acpi_tb_init_table_descriptor (
acpi_table_type table_type,
struct acpi_table_desc *table_info);
/*
* tbremove - Table removal and deletion
*/
void
acpi_tb_delete_all_tables (
void);
void
acpi_tb_delete_tables_by_type (
acpi_table_type type);
void
acpi_tb_delete_single_table (
struct acpi_table_desc *table_desc);
struct acpi_table_desc *
acpi_tb_uninstall_table (
struct acpi_table_desc *table_desc);
/*
* tbrsd - RSDP, RSDT utilities
*/
acpi_status
acpi_tb_get_table_rsdt (
void);
u8 *
acpi_tb_scan_memory_for_rsdp (
u8 *start_address,
u32 length);
acpi_status
acpi_tb_find_rsdp (
struct acpi_table_desc *table_info,
u32 flags);
/*
* tbutils - common table utilities
*/
acpi_status
acpi_tb_find_table (
char *signature,
char *oem_id,
char *oem_table_id,
struct acpi_table_header **table_ptr);
acpi_status
acpi_tb_verify_table_checksum (
struct acpi_table_header *table_header);
u8
acpi_tb_checksum (
void *buffer,
u32 length);
acpi_status
acpi_tb_validate_table_header (
struct acpi_table_header *table_header);
#endif /* __ACTABLES_H__ */
-144
View File
@@ -1,144 +0,0 @@
/******************************************************************************
*
* Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71
* This file includes tables specific to this
* specification revision.
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2003, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ACTBL71_H__
#define __ACTBL71_H__
/* 0.71 FADT address_space data item bitmasks defines */
/* If the associated bit is zero then it is in memory space else in io space */
#define SMI_CMD_ADDRESS_SPACE 0x01
#define PM1_BLK_ADDRESS_SPACE 0x02
#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
#define PM_TMR_BLK_ADDRESS_SPACE 0x08
#define GPE0_BLK_ADDRESS_SPACE 0x10
#define GPE1_BLK_ADDRESS_SPACE 0x20
/* Only for clarity in declarations */
typedef u64 IO_ADDRESS;
#pragma pack(1)
struct /* Root System Descriptor Pointer */
{
NATIVE_CHAR signature [8]; /* contains "RSD PTR " */
u8 checksum; /* to make sum of struct == 0 */
NATIVE_CHAR oem_id [6]; /* OEM identification */
u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
};
/*****************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Root System Description Table */
/*****************************************/
struct
{
struct acpi_table_header header; /* Table header */
u32 reserved_pad; /* IA64 alignment, must be 0 */
u64 table_offset_entry [1]; /* Array of pointers to other */
/* tables' headers */
};
/*******************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Firmware ACPI Control Structure */
/*******************************************/
struct
{
NATIVE_CHAR signature[4]; /* signature "FACS" */
u32 length; /* length of structure, in bytes */
u32 hardware_signature; /* hardware configuration signature */
u32 reserved4; /* must be 0 */
u64 firmware_waking_vector; /* ACPI OS waking vector */
u64 global_lock; /* Global Lock */
u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */
u32 reserved1 : 31; /* must be 0 */
u8 reserved3 [28]; /* reserved - must be zero */
};
/******************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Fixed ACPI Description Table */
/******************************************/
struct
{
struct acpi_table_header header; /* table header */
u32 reserved_pad; /* IA64 alignment, must be 0 */
u64 firmware_ctrl; /* 64-bit Physical address of FACS */
u64 dsdt; /* 64-bit Physical address of DSDT */
u8 model; /* System Interrupt Model */
u8 address_space; /* Address Space Bitmask */
u16 sci_int; /* System vector of SCI interrupt */
u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
u8 reserved2; /* reserved - must be zero */
u64 smi_cmd; /* Port address of SMI command port */
u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
u8 gpe1_base; /* offset in gpe model where gpe1 events start */
u8 reserved3; /* reserved */
u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */
u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* index to century in RTC CMOS RAM */
u8 reserved4; /* reserved */
u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */
u32 reserved5 : 1; /* reserved - must be zero */
u32 proc_c1 : 1; /* all processors support C1 state */
u32 plvl2_up : 1; /* C2 state works on MP system */
u32 pwr_button : 1; /* Power button is handled as a generic feature */
u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
u32 tmr_val_ext : 1; /* tmr_val is 32 bits */
u32 dock_cap : 1; /* Supports Docking */
u32 reserved6 : 22; /* reserved - must be zero */
};
#pragma pack()
#endif /* __ACTBL71_H__ */
-506
View File
@@ -1,506 +0,0 @@
/******************************************************************************
*
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __AMLCODE_H__
#define __AMLCODE_H__
/* primary opcodes */
#define AML_NULL_CHAR (u16) 0x00
#define AML_ZERO_OP (u16) 0x00
#define AML_ONE_OP (u16) 0x01
#define AML_UNASSIGNED (u16) 0x02
#define AML_ALIAS_OP (u16) 0x06
#define AML_NAME_OP (u16) 0x08
#define AML_BYTE_OP (u16) 0x0a
#define AML_WORD_OP (u16) 0x0b
#define AML_DWORD_OP (u16) 0x0c
#define AML_STRING_OP (u16) 0x0d
#define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */
#define AML_SCOPE_OP (u16) 0x10
#define AML_BUFFER_OP (u16) 0x11
#define AML_PACKAGE_OP (u16) 0x12
#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */
#define AML_METHOD_OP (u16) 0x14
#define AML_DUAL_NAME_PREFIX (u16) 0x2e
#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f
#define AML_NAME_CHAR_SUBSEQ (u16) 0x30
#define AML_NAME_CHAR_FIRST (u16) 0x41
#define AML_OP_PREFIX (u16) 0x5b
#define AML_ROOT_PREFIX (u16) 0x5c
#define AML_PARENT_PREFIX (u16) 0x5e
#define AML_LOCAL_OP (u16) 0x60
#define AML_LOCAL0 (u16) 0x60
#define AML_LOCAL1 (u16) 0x61
#define AML_LOCAL2 (u16) 0x62
#define AML_LOCAL3 (u16) 0x63
#define AML_LOCAL4 (u16) 0x64
#define AML_LOCAL5 (u16) 0x65
#define AML_LOCAL6 (u16) 0x66
#define AML_LOCAL7 (u16) 0x67
#define AML_ARG_OP (u16) 0x68
#define AML_ARG0 (u16) 0x68
#define AML_ARG1 (u16) 0x69
#define AML_ARG2 (u16) 0x6a
#define AML_ARG3 (u16) 0x6b
#define AML_ARG4 (u16) 0x6c
#define AML_ARG5 (u16) 0x6d
#define AML_ARG6 (u16) 0x6e
#define AML_STORE_OP (u16) 0x70
#define AML_REF_OF_OP (u16) 0x71
#define AML_ADD_OP (u16) 0x72
#define AML_CONCAT_OP (u16) 0x73
#define AML_SUBTRACT_OP (u16) 0x74
#define AML_INCREMENT_OP (u16) 0x75
#define AML_DECREMENT_OP (u16) 0x76
#define AML_MULTIPLY_OP (u16) 0x77
#define AML_DIVIDE_OP (u16) 0x78
#define AML_SHIFT_LEFT_OP (u16) 0x79
#define AML_SHIFT_RIGHT_OP (u16) 0x7a
#define AML_BIT_AND_OP (u16) 0x7b
#define AML_BIT_NAND_OP (u16) 0x7c
#define AML_BIT_OR_OP (u16) 0x7d
#define AML_BIT_NOR_OP (u16) 0x7e
#define AML_BIT_XOR_OP (u16) 0x7f
#define AML_BIT_NOT_OP (u16) 0x80
#define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81
#define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82
#define AML_DEREF_OF_OP (u16) 0x83
#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */
#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */
#define AML_NOTIFY_OP (u16) 0x86
#define AML_SIZE_OF_OP (u16) 0x87
#define AML_INDEX_OP (u16) 0x88
#define AML_MATCH_OP (u16) 0x89
#define AML_CREATE_DWORD_FIELD_OP (u16) 0x8a
#define AML_CREATE_WORD_FIELD_OP (u16) 0x8b
#define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c
#define AML_CREATE_BIT_FIELD_OP (u16) 0x8d
#define AML_TYPE_OP (u16) 0x8e
#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */
#define AML_LAND_OP (u16) 0x90
#define AML_LOR_OP (u16) 0x91
#define AML_LNOT_OP (u16) 0x92
#define AML_LEQUAL_OP (u16) 0x93
#define AML_LGREATER_OP (u16) 0x94
#define AML_LLESS_OP (u16) 0x95
#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */
#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */
#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */
#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */
#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */
#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */
#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */
#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */
#define AML_IF_OP (u16) 0xa0
#define AML_ELSE_OP (u16) 0xa1
#define AML_WHILE_OP (u16) 0xa2
#define AML_NOOP_OP (u16) 0xa3
#define AML_RETURN_OP (u16) 0xa4
#define AML_BREAK_OP (u16) 0xa5
#define AML_BREAK_POINT_OP (u16) 0xcc
#define AML_ONES_OP (u16) 0xff
/* prefixed opcodes */
#define AML_EXTOP (u16) 0x005b
#define AML_MUTEX_OP (u16) 0x5b01
#define AML_EVENT_OP (u16) 0x5b02
#define AML_SHIFT_RIGHT_BIT_OP (u16) 0x5b10
#define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11
#define AML_COND_REF_OF_OP (u16) 0x5b12
#define AML_CREATE_FIELD_OP (u16) 0x5b13
#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */
#define AML_LOAD_OP (u16) 0x5b20
#define AML_STALL_OP (u16) 0x5b21
#define AML_SLEEP_OP (u16) 0x5b22
#define AML_ACQUIRE_OP (u16) 0x5b23
#define AML_SIGNAL_OP (u16) 0x5b24
#define AML_WAIT_OP (u16) 0x5b25
#define AML_RESET_OP (u16) 0x5b26
#define AML_RELEASE_OP (u16) 0x5b27
#define AML_FROM_BCD_OP (u16) 0x5b28
#define AML_TO_BCD_OP (u16) 0x5b29
#define AML_UNLOAD_OP (u16) 0x5b2a
#define AML_REVISION_OP (u16) 0x5b30
#define AML_DEBUG_OP (u16) 0x5b31
#define AML_FATAL_OP (u16) 0x5b32
#define AML_REGION_OP (u16) 0x5b80
#define AML_FIELD_OP (u16) 0x5b81
#define AML_DEVICE_OP (u16) 0x5b82
#define AML_PROCESSOR_OP (u16) 0x5b83
#define AML_POWER_RES_OP (u16) 0x5b84
#define AML_THERMAL_ZONE_OP (u16) 0x5b85
#define AML_INDEX_FIELD_OP (u16) 0x5b86
#define AML_BANK_FIELD_OP (u16) 0x5b87
#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */
/* Bogus opcodes (they are actually two separate opcodes) */
#define AML_LGREATEREQUAL_OP (u16) 0x9295
#define AML_LLESSEQUAL_OP (u16) 0x9294
#define AML_LNOTEQUAL_OP (u16) 0x9293
/*
* Internal opcodes
* Use only "Unknown" AML opcodes, don't attempt to use
* any valid ACPI ASCII values (A-Z, 0-9, '-')
*/
#define AML_INT_NAMEPATH_OP (u16) 0x002d
#define AML_INT_NAMEDFIELD_OP (u16) 0x0030
#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031
#define AML_INT_ACCESSFIELD_OP (u16) 0x0032
#define AML_INT_BYTELIST_OP (u16) 0x0033
#define AML_INT_STATICSTRING_OP (u16) 0x0034
#define AML_INT_METHODCALL_OP (u16) 0x0035
#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
#define ARG_NONE 0x0
/*
* Argument types for the AML Parser
* Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types
* Zero is reserved as end-of-list indicator
*/
#define ARGP_BYTEDATA 0x01
#define ARGP_BYTELIST 0x02
#define ARGP_CHARLIST 0x03
#define ARGP_DATAOBJ 0x04
#define ARGP_DATAOBJLIST 0x05
#define ARGP_DWORDDATA 0x06
#define ARGP_FIELDLIST 0x07
#define ARGP_NAME 0x08
#define ARGP_NAMESTRING 0x09
#define ARGP_OBJLIST 0x0A
#define ARGP_PKGLENGTH 0x0B
#define ARGP_SUPERNAME 0x0C
#define ARGP_TARGET 0x0D
#define ARGP_TERMARG 0x0E
#define ARGP_TERMLIST 0x0F
#define ARGP_WORDDATA 0x10
#define ARGP_QWORDDATA 0x11
#define ARGP_SIMPLENAME 0x12
/*
* Resolved argument types for the AML Interpreter
* Each field in the arg_types u32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types (0 is end-of-arg-list indicator)
*
* Note1: These values are completely independent from the ACPI_TYPEs
* i.e., ARGI_INTEGER != ACPI_TYPE_INTEGER
*
* Note2: If and when 5 bits becomes insufficient, it would probably be best
* to convert to a 6-byte array of argument types, allowing 8 bits per argument.
*/
/* Single, simple types */
#define ARGI_ANYTYPE 0x01 /* Don't care */
#define ARGI_PACKAGE 0x02
#define ARGI_EVENT 0x03
#define ARGI_MUTEX 0x04
#define ARGI_DDBHANDLE 0x05
/* Interchangeable types (via implicit conversion) */
#define ARGI_INTEGER 0x06
#define ARGI_STRING 0x07
#define ARGI_BUFFER 0x08
#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */
#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */
/* Reference objects */
#define ARGI_INTEGER_REF 0x0B
#define ARGI_OBJECT_REF 0x0C
#define ARGI_DEVICE_REF 0x0D
#define ARGI_REFERENCE 0x0E
#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */
#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */
#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */
/* Multiple/complex types */
#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/
#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */
/* Note: types above can expand to 0x1F maximum */
#define ARGI_INVALID_OPCODE 0xFFFFFFFF
/*
* hash offsets
*/
#define AML_EXTOP_HASH_OFFSET 22
#define AML_LNOT_HASH_OFFSET 19
/*
* opcode groups and types
*/
#define OPGRP_NAMED 0x01
#define OPGRP_FIELD 0x02
#define OPGRP_BYTELIST 0x04
/*
* Opcode information
*/
/* Opcode flags */
#define AML_HAS_ARGS 0x0800
#define AML_HAS_TARGET 0x0400
#define AML_HAS_RETVAL 0x0200
#define AML_NSOBJECT 0x0100
#define AML_NSOPCODE 0x0080
#define AML_NSNODE 0x0040
#define AML_NAMED 0x0020
#define AML_DEFER 0x0010
#define AML_FIELD 0x0008
#define AML_CREATE 0x0004
#define AML_MATH 0x0002
#define AML_LOGICAL 0x0001
#define AML_CONSTANT 0x1000
/* Convenient flag groupings */
#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */
#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET
#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */
#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */
#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */
#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */
#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS
#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL
/*
* The opcode Type is used in a dispatch table, do not change
* without updating the table.
*/
#define AML_TYPE_EXEC_1A_0T_0R 0x00 /* Monadic1 */
#define AML_TYPE_EXEC_1A_0T_1R 0x01 /* Monadic2 */
#define AML_TYPE_EXEC_1A_1T_0R 0x02
#define AML_TYPE_EXEC_1A_1T_1R 0x03 /* monadic2_r */
#define AML_TYPE_EXEC_2A_0T_0R 0x04 /* Dyadic1 */
#define AML_TYPE_EXEC_2A_0T_1R 0x05 /* Dyadic2 */
#define AML_TYPE_EXEC_2A_1T_1R 0x06 /* dyadic2_r */
#define AML_TYPE_EXEC_2A_2T_1R 0x07
#define AML_TYPE_EXEC_3A_0T_0R 0x08
#define AML_TYPE_EXEC_3A_1T_1R 0x09
#define AML_TYPE_EXEC_6A_0T_1R 0x0A
/* End of types used in dispatch table */
#define AML_TYPE_LITERAL 0x0B
#define AML_TYPE_CONSTANT 0x0C
#define AML_TYPE_METHOD_ARGUMENT 0x0D
#define AML_TYPE_LOCAL_VARIABLE 0x0E
#define AML_TYPE_DATA_TERM 0x0F
/* Generic for an op that returns a value */
#define AML_TYPE_METHOD_CALL 0x10
/* Misc */
#define AML_TYPE_CREATE_FIELD 0x11
#define AML_TYPE_CREATE_OBJECT 0x12
#define AML_TYPE_CONTROL 0x13
#define AML_TYPE_NAMED_NO_OBJ 0x14
#define AML_TYPE_NAMED_FIELD 0x15
#define AML_TYPE_NAMED_SIMPLE 0x16
#define AML_TYPE_NAMED_COMPLEX 0x17
#define AML_TYPE_RETURN 0x18
#define AML_TYPE_UNDEFINED 0x19
#define AML_TYPE_BOGUS 0x1A
/*
* Opcode classes
*/
#define AML_CLASS_EXECUTE 0x00
#define AML_CLASS_CREATE 0x01
#define AML_CLASS_ARGUMENT 0x02
#define AML_CLASS_NAMED_OBJECT 0x03
#define AML_CLASS_CONTROL 0x04
#define AML_CLASS_ASCII 0x05
#define AML_CLASS_PREFIX 0x06
#define AML_CLASS_INTERNAL 0x07
#define AML_CLASS_RETURN_VALUE 0x08
#define AML_CLASS_METHOD_CALL 0x09
#define AML_CLASS_UNKNOWN 0x0A
/* Predefined Operation Region space_iDs */
typedef enum
{
REGION_MEMORY = 0,
REGION_IO,
REGION_PCI_CONFIG,
REGION_EC,
REGION_SMBUS,
REGION_CMOS,
REGION_PCI_BAR,
REGION_DATA_TABLE, /* Internal use only */
REGION_FIXED_HW = 0x7F
} AML_REGION_TYPES;
/* Comparison operation codes for match_op operator */
typedef enum
{
MATCH_MTR = 0,
MATCH_MEQ = 1,
MATCH_MLE = 2,
MATCH_MLT = 3,
MATCH_MGE = 4,
MATCH_MGT = 5
} AML_MATCH_OPERATOR;
#define MAX_MATCH_OPERATOR 5
/*
* field_flags
*
* This byte is extracted from the AML and includes three separate
* pieces of information about the field:
* 1) The field access type
* 2) The field update rule
* 3) The lock rule for the field
*
* Bits 00 - 03 : access_type (any_acc, byte_acc, etc.)
* 04 : lock_rule (1 == Lock)
* 05 - 06 : update_rule
*/
#define AML_FIELD_ACCESS_TYPE_MASK 0x0F
#define AML_FIELD_LOCK_RULE_MASK 0x10
#define AML_FIELD_UPDATE_RULE_MASK 0x60
/* 1) Field Access Types */
typedef enum
{
AML_FIELD_ACCESS_ANY = 0x00,
AML_FIELD_ACCESS_BYTE = 0x01,
AML_FIELD_ACCESS_WORD = 0x02,
AML_FIELD_ACCESS_DWORD = 0x03,
AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */
AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */
} AML_ACCESS_TYPE;
/* 2) Field Lock Rules */
typedef enum
{
AML_FIELD_LOCK_NEVER = 0x00,
AML_FIELD_LOCK_ALWAYS = 0x10
} AML_LOCK_RULE;
/* 3) Field Update Rules */
typedef enum
{
AML_FIELD_UPDATE_PRESERVE = 0x00,
AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20,
AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40
} AML_UPDATE_RULE;
/*
* Field Access Attributes.
* This byte is extracted from the AML via the
* access_as keyword
*/
typedef enum
{
AML_FIELD_ATTRIB_SMB_QUICK = 0x02,
AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04,
AML_FIELD_ATTRIB_SMB_BYTE = 0x06,
AML_FIELD_ATTRIB_SMB_WORD = 0x08,
AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A,
AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
} AML_ACCESS_ATTRIBUTE;
/* bit fields in method_flags byte */
#define METHOD_FLAGS_ARG_COUNT 0x07
#define METHOD_FLAGS_SERIALIZED 0x08
#define METHOD_FLAGS_SYNCH_LEVEL 0xF0
#endif /* __AMLCODE_H__ */
-329
View File
@@ -1,329 +0,0 @@
/******************************************************************************
*
* Module Name: amlresrc.h - AML resource descriptors
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2004, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __AMLRESRC_H
#define __AMLRESRC_H
#define ASL_RESNAME_ADDRESS "_ADR"
#define ASL_RESNAME_ALIGNMENT "_ALN"
#define ASL_RESNAME_ADDRESSSPACE "_ASI"
#define ASL_RESNAME_BASEADDRESS "_BAS"
#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */
#define ASL_RESNAME_DECODE "_DEC"
#define ASL_RESNAME_DMA "_DMA"
#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
#define ASL_RESNAME_GRANULARITY "_GRA"
#define ASL_RESNAME_INTERRUPT "_INT"
#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
#define ASL_RESNAME_LENGTH "_LEN"
#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ASL_RESNAME_MAXADDR "_MAX"
#define ASL_RESNAME_MINADDR "_MIN"
#define ASL_RESNAME_MAXTYPE "_MAF"
#define ASL_RESNAME_MINTYPE "_MIF"
#define ASL_RESNAME_REGISTERBITOFFSET "_RBO"
#define ASL_RESNAME_REGISTERBITWIDTH "_RBW"
#define ASL_RESNAME_RANGETYPE "_RNG"
#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
#define ASL_RESNAME_TRANSLATION "_TRA"
#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */
#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */
/* Default sizes for "small" resource descriptors */
#define ASL_RDESC_IRQ_SIZE 0x02
#define ASL_RDESC_DMA_SIZE 0x02
#define ASL_RDESC_ST_DEPEND_SIZE 0x00
#define ASL_RDESC_END_DEPEND_SIZE 0x00
#define ASL_RDESC_IO_SIZE 0x07
#define ASL_RDESC_FIXED_IO_SIZE 0x03
#define ASL_RDESC_END_TAG_SIZE 0x01
struct asl_resource_node
{
u32 buffer_length;
void *buffer;
struct asl_resource_node *next;
};
/*
* Resource descriptors defined in the ACPI specification.
*
* Alignment must be BYTE because these descriptors
* are used to overlay the AML byte stream.
*/
#pragma pack(1)
struct asl_irq_format_desc
{
u8 descriptor_type;
u16 irq_mask;
u8 flags;
};
struct asl_irq_noflags_desc
{
u8 descriptor_type;
u16 irq_mask;
};
struct asl_dma_format_desc
{
u8 descriptor_type;
u8 dma_channel_mask;
u8 flags;
};
struct asl_start_dependent_desc
{
u8 descriptor_type;
u8 flags;
};
struct asl_start_dependent_noprio_desc
{
u8 descriptor_type;
};
struct asl_end_dependent_desc
{
u8 descriptor_type;
};
struct asl_io_port_desc
{
u8 descriptor_type;
u8 information;
u16 address_min;
u16 address_max;
u8 alignment;
u8 length;
};
struct asl_fixed_io_port_desc
{
u8 descriptor_type;
u16 base_address;
u8 length;
};
struct asl_small_vendor_desc
{
u8 descriptor_type;
u8 vendor_defined[7];
};
struct asl_end_tag_desc
{
u8 descriptor_type;
u8 checksum;
};
/* LARGE descriptors */
struct asl_memory_24_desc
{
u8 descriptor_type;
u16 length;
u8 information;
u16 address_min;
u16 address_max;
u16 alignment;
u16 range_length;
};
struct asl_large_vendor_desc
{
u8 descriptor_type;
u16 length;
u8 vendor_defined[1];
};
struct asl_memory_32_desc
{
u8 descriptor_type;
u16 length;
u8 information;
u32 address_min;
u32 address_max;
u32 alignment;
u32 range_length;
};
struct asl_fixed_memory_32_desc
{
u8 descriptor_type;
u16 length;
u8 information;
u32 base_address;
u32 range_length;
};
struct asl_qword_address_desc
{
u8 descriptor_type;
u16 length;
u8 resource_type;
u8 flags;
u8 specific_flags;
u64 granularity;
u64 address_min;
u64 address_max;
u64 translation_offset;
u64 address_length;
u8 optional_fields[2];
};
struct asl_dword_address_desc
{
u8 descriptor_type;
u16 length;
u8 resource_type;
u8 flags;
u8 specific_flags;
u32 granularity;
u32 address_min;
u32 address_max;
u32 translation_offset;
u32 address_length;
u8 optional_fields[2];
};
struct asl_word_address_desc
{
u8 descriptor_type;
u16 length;
u8 resource_type;
u8 flags;
u8 specific_flags;
u16 granularity;
u16 address_min;
u16 address_max;
u16 translation_offset;
u16 address_length;
u8 optional_fields[2];
};
struct asl_extended_xrupt_desc
{
u8 descriptor_type;
u16 length;
u8 flags;
u8 table_length;
u32 interrupt_number[1];
/* res_source_index, res_source optional fields follow */
};
struct asl_general_register_desc
{
u8 descriptor_type;
u16 length;
u8 address_space_id;
u8 bit_width;
u8 bit_offset;
u8 reserved;
u64 address;
};
/* restore default alignment */
#pragma pack()
/* Union of all resource descriptors, sow we can allocate the worst case */
union asl_resource_desc
{
struct asl_irq_format_desc irq;
struct asl_dma_format_desc dma;
struct asl_start_dependent_desc std;
struct asl_end_dependent_desc end;
struct asl_io_port_desc iop;
struct asl_fixed_io_port_desc fio;
struct asl_small_vendor_desc smv;
struct asl_end_tag_desc et;
struct asl_memory_24_desc M24;
struct asl_large_vendor_desc lgv;
struct asl_memory_32_desc M32;
struct asl_fixed_memory_32_desc F32;
struct asl_qword_address_desc qas;
struct asl_dword_address_desc das;
struct asl_word_address_desc was;
struct asl_extended_xrupt_desc exx;
struct asl_general_register_desc grg;
u32 u32_item;
u16 u16_item;
u8 U8item;
};
#endif
-30
View File
@@ -23,34 +23,6 @@
#define CONFIG_ACPI 1
#define CONFIG_ACPI_BOOT 1
#define CONFIG_PCI 1
#define CONFIG_PCI_DIRECT 1
#if defined(__i386__)
#define CONFIG_PCI_BIOS 1
#endif
#define CONFIG_IDE 1
#define CONFIG_BLK_DEV_IDE 1
#define CONFIG_BLK_DEV_IDEDMA 1
#define CONFIG_BLK_DEV_IDEPCI 1
#define CONFIG_IDEDISK_MULTI_MODE 1
#define CONFIG_IDEDISK_STROKE 1
#define CONFIG_IDEPCI_SHARE_IRQ 1
#define CONFIG_BLK_DEV_IDEDMA_PCI 1
#define CONFIG_IDEDMA_PCI_AUTO 1
#define CONFIG_IDEDMA_AUTO 1
#define CONFIG_IDEDMA_ONLYDISK 1
#define CONFIG_BLK_DEV_IDE_MODES 1
#define CONFIG_BLK_DEV_PIIX 1
#define CONFIG_SCSI 1
#define CONFIG_SCSI_LOGGING 1
#define CONFIG_BLK_DEV_SD 1
#define CONFIG_SD_EXTRA_DEVS 40
#define CONFIG_SCSI_MULTI_LUN 1
#define CONFIG_XEN_ATTENTION_KEY 1
#define HZ 100
#define OPT_CONSOLE_STR "com1,vga"
@@ -91,8 +63,6 @@
#ifndef __ASSEMBLY__
extern unsigned long _end; /* standard ELF symbol */
extern void __out_of_line_bug(int line) __attribute__((noreturn));
#define out_of_line_bug() __out_of_line_bug(__LINE__)
#endif /* __ASSEMBLY__ */
#define FORCE_CRASH() __asm__ __volatile__ ( "ud2" )
+3
View File
@@ -97,6 +97,9 @@ static inline int debugger_trap_fatal(
return kdb_trap(vector, 0, regs);
}
/* Int3 is a trivial way to gather cpu_user_regs context. */
#define debugger_trap_immediate() __asm__ __volatile__ ( "int3" );
#else
#define debugger_trap_entry(_v, _r) (0)
+2
View File
@@ -157,6 +157,8 @@ static inline int ioapic_setup_disabled(void)
return skip_ioapic_setup;
}
extern int assign_irq_vector(int irq);
#else /* !CONFIG_X86_IO_APIC */
#define io_apic_assign_pci_irqs 0
@@ -10,8 +10,6 @@
void physdev_modify_ioport_access_range(
struct domain *d, int enable, int port, int num );
void physdev_destroy_state(struct domain *d);
int physdev_pci_access_modify(
domid_t dom, int bus, int dev, int func, int enable);
int domain_iomem_in_pfn(struct domain *p, unsigned long pfn);
long do_physdev_op(physdev_op_t *uop);
void physdev_init_dom0(struct domain *d);
-14
View File
@@ -208,19 +208,6 @@ typedef struct {
memory_t free_pages;
} dom0_physinfo_t;
/*
* Allow a domain access to a physical PCI device
*/
#define DOM0_PCIDEV_ACCESS 23
typedef struct {
/* IN variables. */
domid_t domain;
u32 bus;
u32 dev;
u32 func;
u32 enable;
} dom0_pcidev_access_t;
/*
* Get the ID of the current scheduler.
*/
@@ -376,7 +363,6 @@ typedef struct {
dom0_pincpudomain_t pincpudomain;
dom0_tbufcontrol_t tbufcontrol;
dom0_physinfo_t physinfo;
dom0_pcidev_access_t pcidev_access;
dom0_sched_id_t sched_id;
dom0_shadow_control_t shadow_control;
dom0_setdomainmaxmem_t setdomainmaxmem;
+20 -51
View File
@@ -1,59 +1,15 @@
/****************************************************************************
* (c) 2004 - Rolf Neugebauer - Intel Research Cambridge
* (c) 2004 - Keir Fraser - University of Cambridge
****************************************************************************
* Description: Interface for domains to access physical devices on the PCI bus
*/
#ifndef __XEN_PUBLIC_PHYSDEV_H__
#define __XEN_PUBLIC_PHYSDEV_H__
/* Commands to HYPERVISOR_physdev_op() */
#define PHYSDEVOP_PCI_CFGREG_READ 0
#define PHYSDEVOP_PCI_CFGREG_WRITE 1
#define PHYSDEVOP_PCI_INITIALISE_DEVICE 2
#define PHYSDEVOP_PCI_PROBE_ROOT_BUSES 3
#define PHYSDEVOP_IRQ_UNMASK_NOTIFY 4
#define PHYSDEVOP_IRQ_STATUS_QUERY 5
#define PHYSDEVOP_SET_IOPL 6
#define PHYSDEVOP_SET_IOBITMAP 7
/* Read from PCI configuration space. */
typedef struct {
/* IN */
u32 bus; /* 0 */
u32 dev; /* 4 */
u32 func; /* 8 */
u32 reg; /* 12 */
u32 len; /* 16 */
/* OUT */
u32 value; /* 20 */
} PACKED physdevop_pci_cfgreg_read_t; /* 24 bytes */
/* Write to PCI configuration space. */
typedef struct {
/* IN */
u32 bus; /* 0 */
u32 dev; /* 4 */
u32 func; /* 8 */
u32 reg; /* 12 */
u32 len; /* 16 */
u32 value; /* 20 */
} PACKED physdevop_pci_cfgreg_write_t; /* 24 bytes */
/* Do final initialisation of a PCI device (e.g., last-moment IRQ routing). */
typedef struct {
/* IN */
u32 bus; /* 0 */
u32 dev; /* 4 */
u32 func; /* 8 */
} PACKED physdevop_pci_initialise_device_t; /* 12 bytes */
/* Find the root buses for subsequent scanning. */
typedef struct {
/* OUT */
u32 busmask[256/32]; /* 0 */
} PACKED physdevop_pci_probe_root_buses_t; /* 32 bytes */
#define PHYSDEVOP_APIC_READ 8
#define PHYSDEVOP_APIC_WRITE 9
#define PHYSDEVOP_ASSIGN_VECTOR 10
typedef struct {
/* IN */
@@ -77,18 +33,31 @@ typedef struct {
u32 __pad0; /* 12 */
} PACKED physdevop_set_iobitmap_t; /* 16 bytes */
typedef struct {
/* IN */
u32 apic; /* 0 */
u32 offset;
/* IN or OUT */
u32 value;
} PACKED physdevop_apic_t;
typedef struct {
/* IN */
u32 irq; /* 0 */
/* OUT */
u32 vector;
} PACKED physdevop_irq_t;
typedef struct _physdev_op_st
{
u32 cmd; /* 0 */
u32 __pad; /* 4 */
union { /* 8 */
physdevop_pci_cfgreg_read_t pci_cfgreg_read;
physdevop_pci_cfgreg_write_t pci_cfgreg_write;
physdevop_pci_initialise_device_t pci_initialise_device;
physdevop_pci_probe_root_buses_t pci_probe_root_buses;
physdevop_irq_status_query_t irq_status_query;
physdevop_set_iopl_t set_iopl;
physdevop_set_iobitmap_t set_iobitmap;
physdevop_apic_t apic_op;
physdevop_irq_t irq_op;
u8 __dummy[32];
} PACKED u;
} PACKED physdev_op_t; /* 40 bytes */
-4
View File
@@ -129,10 +129,6 @@ struct domain
u16 pirq_to_evtchn[NR_PIRQS];
u32 pirq_mask[NR_PIRQS/32];
/* Physical I/O */
spinlock_t pcidev_lock;
struct list_head pcidev_list;
unsigned long d_flags;
unsigned long vm_assist;
-4
View File
@@ -10,10 +10,6 @@
#else
#include <xen/mm.h>
#include <xen/cache.h>
#include <xen/types.h>
/* Allocate space for typed object. */
#define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type)))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.