mirror of
https://github.com/AetherDroid/android_kernel_samsung_on5xelte.git
synced 2025-09-08 01:08:03 -04:00
Fixed MTP to work with TWRP
This commit is contained in:
commit
f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions
648
arch/ia64/Kconfig
Normal file
648
arch/ia64/Kconfig
Normal file
|
@ -0,0 +1,648 @@
|
|||
source "init/Kconfig"
|
||||
|
||||
source "kernel/Kconfig.freezer"
|
||||
|
||||
menu "Processor type and features"
|
||||
|
||||
config IA64
|
||||
bool
|
||||
select ARCH_MIGHT_HAVE_PC_PARPORT
|
||||
select ARCH_MIGHT_HAVE_PC_SERIO
|
||||
select PCI if (!IA64_HP_SIM)
|
||||
select ACPI if (!IA64_HP_SIM)
|
||||
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
|
||||
select PM if (!IA64_HP_SIM)
|
||||
select HAVE_UNSTABLE_SCHED_CLOCK
|
||||
select HAVE_IDE
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_KPROBES
|
||||
select HAVE_KRETPROBES
|
||||
select HAVE_FTRACE_MCOUNT_RECORD
|
||||
select HAVE_DYNAMIC_FTRACE if (!ITANIUM)
|
||||
select HAVE_FUNCTION_TRACER
|
||||
select HAVE_DMA_ATTRS
|
||||
select HAVE_KVM
|
||||
select TTY
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_DMA_API_DEBUG
|
||||
select HAVE_MEMBLOCK
|
||||
select HAVE_MEMBLOCK_NODE_MAP
|
||||
select HAVE_VIRT_CPU_ACCOUNTING
|
||||
select ARCH_HAS_SG_CHAIN
|
||||
select VIRT_TO_BUS
|
||||
select ARCH_DISCARD_MEMBLOCK
|
||||
select GENERIC_IRQ_PROBE
|
||||
select GENERIC_PENDING_IRQ if SMP
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_IRQ_LEGACY
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select ARCH_HAVE_NMI_SAFE_CMPXCHG
|
||||
select GENERIC_IOMAP
|
||||
select GENERIC_SMP_IDLE_THREAD
|
||||
select ARCH_INIT_TASK
|
||||
select ARCH_TASK_STRUCT_ALLOCATOR
|
||||
select ARCH_THREAD_INFO_ALLOCATOR
|
||||
select ARCH_CLOCKSOURCE_DATA
|
||||
select GENERIC_TIME_VSYSCALL_OLD
|
||||
select SYSCTL_ARCH_UNALIGN_NO_WARN
|
||||
select HAVE_MOD_ARCH_SPECIFIC
|
||||
select MODULES_USE_ELF_RELA
|
||||
select ARCH_USE_CMPXCHG_LOCKREF
|
||||
select HAVE_ARCH_AUDITSYSCALL
|
||||
default y
|
||||
help
|
||||
The Itanium Processor Family is Intel's 64-bit successor to
|
||||
the 32-bit X86 line. The IA-64 Linux project has a home
|
||||
page at <http://www.linuxia64.org/> and a mailing list at
|
||||
<linux-ia64@vger.kernel.org>.
|
||||
|
||||
config 64BIT
|
||||
bool
|
||||
select ATA_NONSTANDARD if ATA
|
||||
default y
|
||||
|
||||
config ZONE_DMA
|
||||
def_bool y
|
||||
depends on !IA64_SGI_SN2
|
||||
|
||||
config QUICKLIST
|
||||
bool
|
||||
default y
|
||||
|
||||
config MMU
|
||||
bool
|
||||
default y
|
||||
|
||||
config ARCH_DMA_ADDR_T_64BIT
|
||||
def_bool y
|
||||
|
||||
config NEED_DMA_MAP_STATE
|
||||
def_bool y
|
||||
|
||||
config NEED_SG_DMA_LENGTH
|
||||
def_bool y
|
||||
|
||||
config SWIOTLB
|
||||
bool
|
||||
|
||||
config STACKTRACE_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config GENERIC_LOCKBREAK
|
||||
def_bool n
|
||||
|
||||
config RWSEM_XCHGADD_ALGORITHM
|
||||
bool
|
||||
default y
|
||||
|
||||
config HUGETLB_PAGE_SIZE_VARIABLE
|
||||
bool
|
||||
depends on HUGETLB_PAGE
|
||||
default y
|
||||
|
||||
config GENERIC_CALIBRATE_DELAY
|
||||
bool
|
||||
default y
|
||||
|
||||
config HAVE_SETUP_PER_CPU_AREA
|
||||
def_bool y
|
||||
|
||||
config DMI
|
||||
bool
|
||||
default y
|
||||
select DMI_SCAN_MACHINE_NON_EFI_FALLBACK
|
||||
|
||||
config EFI
|
||||
bool
|
||||
select UCS2_STRING
|
||||
default y
|
||||
|
||||
config SCHED_OMIT_FRAME_POINTER
|
||||
bool
|
||||
default y
|
||||
|
||||
config IA64_UNCACHED_ALLOCATOR
|
||||
bool
|
||||
select GENERIC_ALLOCATOR
|
||||
|
||||
config ARCH_USES_PG_UNCACHED
|
||||
def_bool y
|
||||
depends on IA64_UNCACHED_ALLOCATOR
|
||||
|
||||
config AUDIT_ARCH
|
||||
bool
|
||||
default y
|
||||
|
||||
menuconfig PARAVIRT_GUEST
|
||||
bool "Paravirtualized guest support"
|
||||
depends on BROKEN
|
||||
help
|
||||
Say Y here to get to see options related to running Linux under
|
||||
various hypervisors. This option alone does not add any kernel code.
|
||||
|
||||
If you say N, all options in this submenu will be skipped and disabled.
|
||||
|
||||
if PARAVIRT_GUEST
|
||||
|
||||
config PARAVIRT
|
||||
bool "Enable paravirtualization code"
|
||||
depends on PARAVIRT_GUEST
|
||||
default y
|
||||
help
|
||||
This changes the kernel so it can modify itself when it is run
|
||||
under a hypervisor, potentially improving performance significantly
|
||||
over full virtualization. However, when run without a hypervisor
|
||||
the kernel is theoretically slower and slightly larger.
|
||||
|
||||
endif
|
||||
|
||||
choice
|
||||
prompt "System type"
|
||||
default IA64_GENERIC
|
||||
|
||||
config IA64_GENERIC
|
||||
bool "generic"
|
||||
select NUMA
|
||||
select ACPI_NUMA
|
||||
select SWIOTLB
|
||||
select PCI_MSI
|
||||
help
|
||||
This selects the system type of your hardware. A "generic" kernel
|
||||
will run on any supported IA-64 system. However, if you configure
|
||||
a kernel for your specific system, it will be faster and smaller.
|
||||
|
||||
generic For any supported IA-64 system
|
||||
DIG-compliant For DIG ("Developer's Interface Guide") compliant systems
|
||||
DIG+Intel+IOMMU For DIG systems with Intel IOMMU
|
||||
HP-zx1/sx1000 For HP systems
|
||||
HP-zx1/sx1000+swiotlb For HP systems with (broken) DMA-constrained devices.
|
||||
SGI-SN2 For SGI Altix systems
|
||||
SGI-UV For SGI UV systems
|
||||
Ski-simulator For the HP simulator <http://www.hpl.hp.com/research/linux/ski/>
|
||||
|
||||
If you don't know what to do, choose "generic".
|
||||
|
||||
config IA64_DIG
|
||||
bool "DIG-compliant"
|
||||
select SWIOTLB
|
||||
|
||||
config IA64_DIG_VTD
|
||||
bool "DIG+Intel+IOMMU"
|
||||
select INTEL_IOMMU
|
||||
select PCI_MSI
|
||||
|
||||
config IA64_HP_ZX1
|
||||
bool "HP-zx1/sx1000"
|
||||
help
|
||||
Build a kernel that runs on HP zx1 and sx1000 systems. This adds
|
||||
support for the HP I/O MMU.
|
||||
|
||||
config IA64_HP_ZX1_SWIOTLB
|
||||
bool "HP-zx1/sx1000 with software I/O TLB"
|
||||
select SWIOTLB
|
||||
help
|
||||
Build a kernel that runs on HP zx1 and sx1000 systems even when they
|
||||
have broken PCI devices which cannot DMA to full 32 bits. Apart
|
||||
from support for the HP I/O MMU, this includes support for the software
|
||||
I/O TLB, which allows supporting the broken devices at the expense of
|
||||
wasting some kernel memory (about 2MB by default).
|
||||
|
||||
config IA64_SGI_SN2
|
||||
bool "SGI-SN2"
|
||||
select NUMA
|
||||
select ACPI_NUMA
|
||||
help
|
||||
Selecting this option will optimize the kernel for use on sn2 based
|
||||
systems, but the resulting kernel binary will not run on other
|
||||
types of ia64 systems. If you have an SGI Altix system, it's safe
|
||||
to select this option. If in doubt, select ia64 generic support
|
||||
instead.
|
||||
|
||||
config IA64_SGI_UV
|
||||
bool "SGI-UV"
|
||||
select NUMA
|
||||
select ACPI_NUMA
|
||||
select SWIOTLB
|
||||
help
|
||||
Selecting this option will optimize the kernel for use on UV based
|
||||
systems, but the resulting kernel binary will not run on other
|
||||
types of ia64 systems. If you have an SGI UV system, it's safe
|
||||
to select this option. If in doubt, select ia64 generic support
|
||||
instead.
|
||||
|
||||
config IA64_HP_SIM
|
||||
bool "Ski-simulator"
|
||||
select SWIOTLB
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Processor type"
|
||||
default ITANIUM
|
||||
|
||||
config ITANIUM
|
||||
bool "Itanium"
|
||||
help
|
||||
Select your IA-64 processor type. The default is Itanium.
|
||||
This choice is safe for all IA-64 systems, but may not perform
|
||||
optimally on systems with, say, Itanium 2 or newer processors.
|
||||
|
||||
config MCKINLEY
|
||||
bool "Itanium 2"
|
||||
help
|
||||
Select this to configure for an Itanium 2 (McKinley) processor.
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Kernel page size"
|
||||
default IA64_PAGE_SIZE_16KB
|
||||
|
||||
config IA64_PAGE_SIZE_4KB
|
||||
bool "4KB"
|
||||
help
|
||||
This lets you select the page size of the kernel. For best IA-64
|
||||
performance, a page size of 8KB or 16KB is recommended. For best
|
||||
IA-32 compatibility, a page size of 4KB should be selected (the vast
|
||||
majority of IA-32 binaries work perfectly fine with a larger page
|
||||
size). For Itanium 2 or newer systems, a page size of 64KB can also
|
||||
be selected.
|
||||
|
||||
4KB For best IA-32 compatibility
|
||||
8KB For best IA-64 performance
|
||||
16KB For best IA-64 performance
|
||||
64KB Requires Itanium 2 or newer processor.
|
||||
|
||||
If you don't know what to do, choose 16KB.
|
||||
|
||||
config IA64_PAGE_SIZE_8KB
|
||||
bool "8KB"
|
||||
|
||||
config IA64_PAGE_SIZE_16KB
|
||||
bool "16KB"
|
||||
|
||||
config IA64_PAGE_SIZE_64KB
|
||||
depends on !ITANIUM
|
||||
bool "64KB"
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Page Table Levels"
|
||||
default PGTABLE_3
|
||||
|
||||
config PGTABLE_3
|
||||
bool "3 Levels"
|
||||
|
||||
config PGTABLE_4
|
||||
depends on !IA64_PAGE_SIZE_64KB
|
||||
bool "4 Levels"
|
||||
|
||||
endchoice
|
||||
|
||||
if IA64_HP_SIM
|
||||
config HZ
|
||||
default 32
|
||||
endif
|
||||
|
||||
if !IA64_HP_SIM
|
||||
source kernel/Kconfig.hz
|
||||
endif
|
||||
|
||||
config IA64_BRL_EMU
|
||||
bool
|
||||
depends on ITANIUM
|
||||
default y
|
||||
|
||||
# align cache-sensitive data to 128 bytes
|
||||
config IA64_L1_CACHE_SHIFT
|
||||
int
|
||||
default "7" if MCKINLEY
|
||||
default "6" if ITANIUM
|
||||
|
||||
config IA64_CYCLONE
|
||||
bool "Cyclone (EXA) Time Source support"
|
||||
help
|
||||
Say Y here to enable support for IBM EXA Cyclone time source.
|
||||
If you're unsure, answer N.
|
||||
|
||||
config IOSAPIC
|
||||
bool
|
||||
depends on !IA64_HP_SIM
|
||||
default y
|
||||
|
||||
config FORCE_MAX_ZONEORDER
|
||||
int "MAX_ORDER (11 - 17)" if !HUGETLB_PAGE
|
||||
range 11 17 if !HUGETLB_PAGE
|
||||
default "17" if HUGETLB_PAGE
|
||||
default "11"
|
||||
|
||||
config SMP
|
||||
bool "Symmetric multi-processing support"
|
||||
help
|
||||
This enables support for systems with more than one CPU. If you have
|
||||
a system with only one CPU, say N. If you have a system with more
|
||||
than one CPU, say Y.
|
||||
|
||||
If you say N here, the kernel will run on single and multiprocessor
|
||||
systems, but will use only one CPU of a multiprocessor system. If
|
||||
you say Y here, the kernel will run on many, but not all,
|
||||
single processor systems. On a single processor system, the kernel
|
||||
will run faster if you say N here.
|
||||
|
||||
See also the SMP-HOWTO available at
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
If you don't know what to do here, say N.
|
||||
|
||||
config NR_CPUS
|
||||
int "Maximum number of CPUs (2-4096)"
|
||||
range 2 4096
|
||||
depends on SMP
|
||||
default "4096"
|
||||
help
|
||||
You should set this to the number of CPUs in your system, but
|
||||
keep in mind that a kernel compiled for, e.g., 2 CPUs will boot but
|
||||
only use 2 CPUs on a >2 CPU system. Setting this to a value larger
|
||||
than 64 will cause the use of a CPU mask array, causing a small
|
||||
performance hit.
|
||||
|
||||
config HOTPLUG_CPU
|
||||
bool "Support for hot-pluggable CPUs"
|
||||
depends on SMP
|
||||
default n
|
||||
---help---
|
||||
Say Y here to experiment with turning CPUs off and on. CPUs
|
||||
can be controlled through /sys/devices/system/cpu/cpu#.
|
||||
Say N if you want to disable CPU hotplug.
|
||||
|
||||
config ARCH_ENABLE_MEMORY_HOTPLUG
|
||||
def_bool y
|
||||
|
||||
config ARCH_ENABLE_MEMORY_HOTREMOVE
|
||||
def_bool y
|
||||
|
||||
config SCHED_SMT
|
||||
bool "SMT scheduler support"
|
||||
depends on SMP
|
||||
help
|
||||
Improves the CPU scheduler's decision making when dealing with
|
||||
Intel IA64 chips with MultiThreading at a cost of slightly increased
|
||||
overhead in some places. If unsure say N here.
|
||||
|
||||
config PERMIT_BSP_REMOVE
|
||||
bool "Support removal of Bootstrap Processor"
|
||||
depends on HOTPLUG_CPU
|
||||
default n
|
||||
---help---
|
||||
Say Y here if your platform SAL will support removal of BSP with HOTPLUG_CPU
|
||||
support.
|
||||
|
||||
config FORCE_CPEI_RETARGET
|
||||
bool "Force assumption that CPEI can be re-targeted"
|
||||
depends on PERMIT_BSP_REMOVE
|
||||
default n
|
||||
---help---
|
||||
Say Y if you need to force the assumption that CPEI can be re-targeted to
|
||||
any cpu in the system. This hint is available via ACPI 3.0 specifications.
|
||||
Tiger4 systems are capable of re-directing CPEI to any CPU other than BSP.
|
||||
This option it useful to enable this feature on older BIOS's as well.
|
||||
You can also enable this by using boot command line option force_cpei=1.
|
||||
|
||||
source "kernel/Kconfig.preempt"
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
config ARCH_SELECT_MEMORY_MODEL
|
||||
def_bool y
|
||||
|
||||
config ARCH_DISCONTIGMEM_ENABLE
|
||||
def_bool y
|
||||
help
|
||||
Say Y to support efficient handling of discontiguous physical memory,
|
||||
for architectures which are either NUMA (Non-Uniform Memory Access)
|
||||
or have huge holes in the physical address space for other reasons.
|
||||
See <file:Documentation/vm/numa> for more.
|
||||
|
||||
config ARCH_FLATMEM_ENABLE
|
||||
def_bool y
|
||||
|
||||
config ARCH_SPARSEMEM_ENABLE
|
||||
def_bool y
|
||||
depends on ARCH_DISCONTIGMEM_ENABLE
|
||||
select SPARSEMEM_VMEMMAP_ENABLE
|
||||
|
||||
config ARCH_DISCONTIGMEM_DEFAULT
|
||||
def_bool y if (IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB)
|
||||
depends on ARCH_DISCONTIGMEM_ENABLE
|
||||
|
||||
config NUMA
|
||||
bool "NUMA support"
|
||||
depends on !IA64_HP_SIM && !FLATMEM
|
||||
default y if IA64_SGI_SN2
|
||||
select ACPI_NUMA if ACPI
|
||||
help
|
||||
Say Y to compile the kernel to support NUMA (Non-Uniform Memory
|
||||
Access). This option is for configuring high-end multiprocessor
|
||||
server systems. If in doubt, say N.
|
||||
|
||||
config NODES_SHIFT
|
||||
int "Max num nodes shift(3-10)"
|
||||
range 3 10
|
||||
default "10"
|
||||
depends on NEED_MULTIPLE_NODES
|
||||
help
|
||||
This option specifies the maximum number of nodes in your SSI system.
|
||||
MAX_NUMNODES will be 2^(This value).
|
||||
If in doubt, use the default.
|
||||
|
||||
# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
|
||||
# VIRTUAL_MEM_MAP has been retained for historical reasons.
|
||||
config VIRTUAL_MEM_MAP
|
||||
bool "Virtual mem map"
|
||||
depends on !SPARSEMEM
|
||||
default y if !IA64_HP_SIM
|
||||
help
|
||||
Say Y to compile the kernel with support for a virtual mem map.
|
||||
This code also only takes effect if a memory hole of greater than
|
||||
1 Gb is found during boot. You must turn this option on if you
|
||||
require the DISCONTIGMEM option for your machine. If you are
|
||||
unsure, say Y.
|
||||
|
||||
config HOLES_IN_ZONE
|
||||
bool
|
||||
default y if VIRTUAL_MEM_MAP
|
||||
|
||||
config HAVE_ARCH_EARLY_PFN_TO_NID
|
||||
def_bool NUMA && SPARSEMEM
|
||||
|
||||
config HAVE_ARCH_NODEDATA_EXTENSION
|
||||
def_bool y
|
||||
depends on NUMA
|
||||
|
||||
config USE_PERCPU_NUMA_NODE_ID
|
||||
def_bool y
|
||||
depends on NUMA
|
||||
|
||||
config HAVE_MEMORYLESS_NODES
|
||||
def_bool NUMA
|
||||
|
||||
config ARCH_PROC_KCORE_TEXT
|
||||
def_bool y
|
||||
depends on PROC_KCORE
|
||||
|
||||
config IA64_MCA_RECOVERY
|
||||
tristate "MCA recovery from errors other than TLB."
|
||||
|
||||
config PERFMON
|
||||
bool "Performance monitor support"
|
||||
help
|
||||
Selects whether support for the IA-64 performance monitor hardware
|
||||
is included in the kernel. This makes some kernel data-structures a
|
||||
little bigger and slows down execution a bit, but it is generally
|
||||
a good idea to turn this on. If you're unsure, say Y.
|
||||
|
||||
config IA64_PALINFO
|
||||
tristate "/proc/pal support"
|
||||
help
|
||||
If you say Y here, you are able to get PAL (Processor Abstraction
|
||||
Layer) information in /proc/pal. This contains useful information
|
||||
about the processors in your systems, such as cache and TLB sizes
|
||||
and the PAL firmware version in use.
|
||||
|
||||
To use this option, you have to ensure that the "/proc file system
|
||||
support" (CONFIG_PROC_FS) is enabled, too.
|
||||
|
||||
config IA64_MC_ERR_INJECT
|
||||
tristate "MC error injection support"
|
||||
help
|
||||
Adds support for MC error injection. If enabled, the kernel
|
||||
will provide a sysfs interface for user applications to
|
||||
call MC error injection PAL procedures to inject various errors.
|
||||
This is a useful tool for MCA testing.
|
||||
|
||||
If you're unsure, do not select this option.
|
||||
|
||||
config SGI_SN
|
||||
def_bool y if (IA64_SGI_SN2 || IA64_GENERIC)
|
||||
|
||||
config IA64_ESI
|
||||
bool "ESI (Extensible SAL Interface) support"
|
||||
help
|
||||
If you say Y here, support is built into the kernel to
|
||||
make ESI calls. ESI calls are used to support vendor-specific
|
||||
firmware extensions, such as the ability to inject memory-errors
|
||||
for test-purposes. If you're unsure, say N.
|
||||
|
||||
config IA64_HP_AML_NFW
|
||||
bool "Support ACPI AML calls to native firmware"
|
||||
help
|
||||
This driver installs a global ACPI Operation Region handler for
|
||||
region 0xA1. AML methods can use this OpRegion to call arbitrary
|
||||
native firmware functions. The driver installs the OpRegion
|
||||
handler if there is an HPQ5001 device or if the user supplies
|
||||
the "force" module parameter, e.g., with the "aml_nfw.force"
|
||||
kernel command line option.
|
||||
|
||||
source "drivers/sn/Kconfig"
|
||||
|
||||
config KEXEC
|
||||
bool "kexec system call"
|
||||
depends on !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
|
||||
help
|
||||
kexec is a system call that implements the ability to shutdown your
|
||||
current kernel, and to start another kernel. It is like a reboot
|
||||
but it is independent of the system firmware. And like a reboot
|
||||
you can start any kernel with it, not just Linux.
|
||||
|
||||
The name comes from the similarity to the exec system call.
|
||||
|
||||
It is an ongoing process to be certain the hardware in a machine
|
||||
is properly shutdown, so do not be surprised if this code does not
|
||||
initially work for you. As of this writing the exact hardware
|
||||
interface is strongly in flux, so no good recommendation can be
|
||||
made.
|
||||
|
||||
config CRASH_DUMP
|
||||
bool "kernel crash dumps"
|
||||
depends on IA64_MCA_RECOVERY && !IA64_HP_SIM && (!SMP || HOTPLUG_CPU)
|
||||
help
|
||||
Generate crash dump after being started by kexec.
|
||||
|
||||
source "drivers/firmware/Kconfig"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Power management and ACPI options"
|
||||
|
||||
source "kernel/power/Kconfig"
|
||||
|
||||
source "drivers/acpi/Kconfig"
|
||||
|
||||
if PM
|
||||
menu "CPU Frequency scaling"
|
||||
source "drivers/cpufreq/Kconfig"
|
||||
endmenu
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
if !IA64_HP_SIM
|
||||
|
||||
menu "Bus options (PCI, PCMCIA)"
|
||||
|
||||
config PCI
|
||||
bool "PCI support"
|
||||
help
|
||||
Real IA-64 machines all have PCI/PCI-X/PCI Express busses. Say Y
|
||||
here unless you are using a simulator without PCI support.
|
||||
|
||||
config PCI_DOMAINS
|
||||
def_bool PCI
|
||||
|
||||
config PCI_SYSCALL
|
||||
def_bool PCI
|
||||
|
||||
source "drivers/pci/pcie/Kconfig"
|
||||
|
||||
source "drivers/pci/Kconfig"
|
||||
|
||||
source "drivers/pci/hotplug/Kconfig"
|
||||
|
||||
source "drivers/pcmcia/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
source "arch/ia64/hp/sim/Kconfig"
|
||||
|
||||
config MSPEC
|
||||
tristate "Memory special operations driver"
|
||||
depends on IA64
|
||||
select IA64_UNCACHED_ALLOCATOR
|
||||
help
|
||||
If you have an ia64 and you want to enable memory special
|
||||
operations support (formerly known as fetchop), say Y here,
|
||||
otherwise say N.
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
source "arch/ia64/Kconfig.debug"
|
||||
|
||||
source "security/Kconfig"
|
||||
|
||||
source "crypto/Kconfig"
|
||||
|
||||
source "arch/ia64/kvm/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
|
||||
config IOMMU_HELPER
|
||||
def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
|
64
arch/ia64/Kconfig.debug
Normal file
64
arch/ia64/Kconfig.debug
Normal file
|
@ -0,0 +1,64 @@
|
|||
menu "Kernel hacking"
|
||||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
choice
|
||||
prompt "Physical memory granularity"
|
||||
default IA64_GRANULE_64MB
|
||||
|
||||
config IA64_GRANULE_16MB
|
||||
bool "16MB"
|
||||
help
|
||||
IA-64 identity-mapped regions use a large page size called "granules".
|
||||
|
||||
Select "16MB" for a small granule size.
|
||||
Select "64MB" for a large granule size. This is the current default.
|
||||
|
||||
config IA64_GRANULE_64MB
|
||||
bool "64MB"
|
||||
depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_SGI_SN2)
|
||||
|
||||
endchoice
|
||||
|
||||
config IA64_PRINT_HAZARDS
|
||||
bool "Print possible IA-64 dependency violations to console"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Selecting this option prints more information for Illegal Dependency
|
||||
Faults, that is, for Read-after-Write (RAW), Write-after-Write (WAW),
|
||||
or Write-after-Read (WAR) violations. This option is ignored if you
|
||||
are compiling for an Itanium A step processor
|
||||
(CONFIG_ITANIUM_ASTEP_SPECIFIC). If you're unsure, select Y.
|
||||
|
||||
config DISABLE_VHPT
|
||||
bool "Disable VHPT"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
The Virtual Hash Page Table (VHPT) enhances virtual address
|
||||
translation performance. Normally you want the VHPT active but you
|
||||
can select this option to disable the VHPT for debugging. If you're
|
||||
unsure, answer N.
|
||||
|
||||
config IA64_DEBUG_CMPXCHG
|
||||
bool "Turn on compare-and-exchange bug checking (slow!)"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Selecting this option turns on bug checking for the IA-64
|
||||
compare-and-exchange instructions. This is slow! Itaniums
|
||||
from step B3 or later don't have this problem. If you're unsure,
|
||||
select N.
|
||||
|
||||
config IA64_DEBUG_IRQ
|
||||
bool "Turn on irq debug checks (slow!)"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Selecting this option turns on bug checking for the IA-64 irq_save
|
||||
and restore instructions. It's useful for tracking down spinlock
|
||||
problems, but slow! If you're unsure, select N.
|
||||
|
||||
config SYSVIPC_COMPAT
|
||||
bool
|
||||
depends on COMPAT && SYSVIPC
|
||||
default y
|
||||
|
||||
endmenu
|
103
arch/ia64/Makefile
Normal file
103
arch/ia64/Makefile
Normal file
|
@ -0,0 +1,103 @@
|
|||
#
|
||||
# ia64/Makefile
|
||||
#
|
||||
# This file is included by the global makefile so that you can add your own
|
||||
# architecture-specific flags and dependencies.
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 1998-2004 by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
#
|
||||
|
||||
KBUILD_DEFCONFIG := generic_defconfig
|
||||
|
||||
NM := $(CROSS_COMPILE)nm -B
|
||||
READELF := $(CROSS_COMPILE)readelf
|
||||
|
||||
export AWK
|
||||
|
||||
CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
|
||||
|
||||
OBJCOPYFLAGS := --strip-all
|
||||
LDFLAGS_vmlinux := -static
|
||||
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds
|
||||
KBUILD_AFLAGS_KERNEL := -mconstant-gp
|
||||
EXTRA :=
|
||||
|
||||
cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
|
||||
-falign-functions=32 -frename-registers -fno-optimize-sibling-calls
|
||||
KBUILD_CFLAGS_KERNEL := -mconstant-gp
|
||||
|
||||
GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
|
||||
KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")
|
||||
|
||||
ifeq ($(GAS_STATUS),buggy)
|
||||
$(error Sorry, you need a newer version of the assember, one that is built from \
|
||||
a source-tree that post-dates 18-Dec-2002. You can find a pre-compiled \
|
||||
static binary of such an assembler at: \
|
||||
\
|
||||
ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(cflags-y)
|
||||
head-y := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
|
||||
|
||||
libs-y += arch/ia64/lib/
|
||||
core-y += arch/ia64/kernel/ arch/ia64/mm/
|
||||
core-$(CONFIG_IA64_DIG) += arch/ia64/dig/
|
||||
core-$(CONFIG_IA64_DIG_VTD) += arch/ia64/dig/
|
||||
core-$(CONFIG_IA64_GENERIC) += arch/ia64/dig/
|
||||
core-$(CONFIG_IA64_HP_ZX1) += arch/ia64/dig/
|
||||
core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/
|
||||
core-$(CONFIG_IA64_SGI_SN2) += arch/ia64/sn/
|
||||
core-$(CONFIG_IA64_SGI_UV) += arch/ia64/uv/
|
||||
core-$(CONFIG_KVM) += arch/ia64/kvm/
|
||||
|
||||
drivers-$(CONFIG_PCI) += arch/ia64/pci/
|
||||
drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/
|
||||
drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
|
||||
drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
|
||||
drivers-$(CONFIG_IA64_GENERIC) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/ arch/ia64/uv/
|
||||
drivers-$(CONFIG_OPROFILE) += arch/ia64/oprofile/
|
||||
|
||||
boot := arch/ia64/hp/sim/boot
|
||||
|
||||
PHONY += boot compressed check
|
||||
|
||||
all: compressed unwcheck
|
||||
|
||||
compressed: vmlinux.gz
|
||||
|
||||
vmlinuz: vmlinux.gz
|
||||
|
||||
vmlinux.gz: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $@
|
||||
|
||||
unwcheck: vmlinux
|
||||
-$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<
|
||||
|
||||
archclean:
|
||||
$(Q)$(MAKE) $(clean)=$(boot)
|
||||
|
||||
CLEAN_FILES += vmlinux.gz bootloader
|
||||
|
||||
boot: lib/lib.a vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $@
|
||||
|
||||
install: vmlinux.gz
|
||||
sh $(srctree)/arch/ia64/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
|
||||
|
||||
define archhelp
|
||||
echo '* compressed - Build compressed kernel image'
|
||||
echo ' install - Install compressed kernel image'
|
||||
echo ' boot - Build vmlinux and bootloader for Ski simulator'
|
||||
echo '* unwcheck - Check vmlinux for invalid unwind info'
|
||||
endef
|
||||
|
||||
archprepare: make_nr_irqs_h FORCE
|
||||
PHONY += make_nr_irqs_h FORCE
|
||||
|
||||
make_nr_irqs_h: FORCE
|
||||
$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
|
109
arch/ia64/configs/bigsur_defconfig
Normal file
109
arch/ia64/configs/bigsur_defconfig
Normal file
|
@ -0,0 +1,109 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_OPROFILE=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_SGI_PARTITION=y
|
||||
CONFIG_IA64_DIG=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_VIRTUAL_MEM_MAP is not set
|
||||
CONFIG_PERFMON=y
|
||||
CONFIG_IA64_PALINFO=y
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=m
|
||||
CONFIG_ACPI_BUTTON=m
|
||||
CONFIG_ACPI_FAN=m
|
||||
CONFIG_ACPI_PROCESSOR=m
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=m
|
||||
CONFIG_IDE=m
|
||||
CONFIG_BLK_DEV_IDECD=m
|
||||
CONFIG_BLK_DEV_GENERIC=m
|
||||
CONFIG_BLK_DEV_PIIX=m
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_SCSI_CONSTANTS=y
|
||||
CONFIG_SCSI_LOGGING=y
|
||||
CONFIG_SCSI_SPI_ATTRS=m
|
||||
CONFIG_SCSI_QLOGIC_1280=y
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_MD=m
|
||||
CONFIG_MD_LINEAR=m
|
||||
CONFIG_MD_RAID0=m
|
||||
CONFIG_MD_RAID1=m
|
||||
CONFIG_MD_RAID10=m
|
||||
CONFIG_MD_MULTIPATH=m
|
||||
CONFIG_BLK_DEV_DM=m
|
||||
CONFIG_DM_CRYPT=m
|
||||
CONFIG_DM_SNAPSHOT=m
|
||||
CONFIG_DM_MIRROR=m
|
||||
CONFIG_DM_ZERO=m
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_AGP=m
|
||||
CONFIG_AGP_I460=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_R128=m
|
||||
CONFIG_SOUND=m
|
||||
CONFIG_SND=m
|
||||
CONFIG_SND_SEQUENCER=m
|
||||
CONFIG_SND_MIXER_OSS=m
|
||||
CONFIG_SND_PCM_OSS=m
|
||||
CONFIG_SND_CS4281=m
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB=m
|
||||
CONFIG_USB_MON=m
|
||||
CONFIG_USB_UHCI_HCD=m
|
||||
CONFIG_USB_ACM=m
|
||||
CONFIG_USB_PRINTER=m
|
||||
CONFIG_USB_STORAGE=m
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_XFS_FS=y
|
||||
CONFIG_XFS_QUOTA=y
|
||||
CONFIG_XFS_POSIX_ACL=y
|
||||
CONFIG_AUTOFS4_FS=m
|
||||
CONFIG_ISO9660_FS=m
|
||||
CONFIG_JOLIET=y
|
||||
CONFIG_UDF_FS=m
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=m
|
||||
CONFIG_NFS_V4=m
|
||||
CONFIG_NFSD=m
|
||||
CONFIG_NFSD_V4=y
|
||||
CONFIG_CIFS=m
|
||||
CONFIG_CIFS_STATS=y
|
||||
CONFIG_CIFS_XATTR=y
|
||||
CONFIG_CIFS_POSIX=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_UTF8=m
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_CRYPTO_MD5=y
|
||||
CONFIG_CRYPTO_DES=y
|
220
arch/ia64/configs/generic_defconfig
Normal file
220
arch/ia64/configs/generic_defconfig
Normal file
|
@ -0,0 +1,220 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=20
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_SGI_PARTITION=y
|
||||
CONFIG_MCKINLEY=y
|
||||
CONFIG_IA64_PAGE_SIZE_64KB=y
|
||||
CONFIG_IA64_CYCLONE=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_IA64_MCA_RECOVERY=y
|
||||
CONFIG_PERFMON=y
|
||||
CONFIG_IA64_PALINFO=y
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_CRASH_DUMP=y
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=m
|
||||
CONFIG_ACPI_BUTTON=m
|
||||
CONFIG_ACPI_FAN=m
|
||||
CONFIG_ACPI_DOCK=y
|
||||
CONFIG_ACPI_PROCESSOR=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_HOTPLUG_PCI_ACPI=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
|
||||
CONFIG_CONNECTOR=y
|
||||
# CONFIG_PNP_DEBUG_MESSAGES is not set
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_SGI_IOC4=y
|
||||
CONFIG_SGI_XP=m
|
||||
CONFIG_IDE=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_BLK_DEV_GENERIC=y
|
||||
CONFIG_BLK_DEV_CMD64X=y
|
||||
CONFIG_BLK_DEV_PIIX=y
|
||||
CONFIG_BLK_DEV_SGIIOC4=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_CHR_DEV_ST=m
|
||||
CONFIG_BLK_DEV_SR=m
|
||||
CONFIG_CHR_DEV_SG=m
|
||||
CONFIG_SCSI_FC_ATTRS=y
|
||||
CONFIG_SCSI_SYM53C8XX_2=y
|
||||
CONFIG_SCSI_QLOGIC_1280=y
|
||||
CONFIG_ATA=y
|
||||
CONFIG_ATA_PIIX=y
|
||||
CONFIG_SATA_VITESSE=y
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_MD=m
|
||||
CONFIG_MD_LINEAR=m
|
||||
CONFIG_MD_RAID0=m
|
||||
CONFIG_MD_RAID1=m
|
||||
CONFIG_MD_MULTIPATH=m
|
||||
CONFIG_BLK_DEV_DM=m
|
||||
CONFIG_DM_CRYPT=m
|
||||
CONFIG_DM_SNAPSHOT=m
|
||||
CONFIG_DM_MIRROR=m
|
||||
CONFIG_DM_ZERO=m
|
||||
CONFIG_DM_MULTIPATH=m
|
||||
CONFIG_FUSION=y
|
||||
CONFIG_FUSION_SPI=y
|
||||
CONFIG_FUSION_FC=m
|
||||
CONFIG_FUSION_SAS=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=m
|
||||
CONFIG_NETCONSOLE=y
|
||||
CONFIG_TIGON3=y
|
||||
CONFIG_NET_TULIP=y
|
||||
CONFIG_TULIP=m
|
||||
CONFIG_E100=m
|
||||
CONFIG_E1000=y
|
||||
CONFIG_IGB=y
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_GAMEPORT=m
|
||||
CONFIG_SERIAL_NONSTANDARD=y
|
||||
CONFIG_SGI_SNSC=y
|
||||
CONFIG_SGI_TIOCX=y
|
||||
CONFIG_SGI_MBCS=m
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=6
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_SGI_L1_CONSOLE=y
|
||||
CONFIG_SERIAL_SGI_IOC4=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
CONFIG_RAW_DRIVER=m
|
||||
CONFIG_HPET=y
|
||||
CONFIG_AGP=m
|
||||
CONFIG_AGP_I460=m
|
||||
CONFIG_AGP_HP_ZX1=m
|
||||
CONFIG_AGP_SGI_TIOCA=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_TDFX=m
|
||||
CONFIG_DRM_R128=m
|
||||
CONFIG_DRM_RADEON=m
|
||||
CONFIG_DRM_MGA=m
|
||||
CONFIG_DRM_SIS=m
|
||||
CONFIG_SOUND=m
|
||||
CONFIG_SND=m
|
||||
CONFIG_SND_SEQUENCER=m
|
||||
CONFIG_SND_SEQ_DUMMY=m
|
||||
CONFIG_SND_MIXER_OSS=m
|
||||
CONFIG_SND_PCM_OSS=m
|
||||
CONFIG_SND_SEQUENCER_OSS=y
|
||||
CONFIG_SND_VERBOSE_PRINTK=y
|
||||
CONFIG_SND_DUMMY=m
|
||||
CONFIG_SND_VIRMIDI=m
|
||||
CONFIG_SND_MTPAV=m
|
||||
CONFIG_SND_SERIAL_U16550=m
|
||||
CONFIG_SND_MPU401=m
|
||||
CONFIG_SND_CS4281=m
|
||||
CONFIG_SND_CS46XX=m
|
||||
CONFIG_SND_EMU10K1=m
|
||||
CONFIG_SND_FM801=m
|
||||
CONFIG_HID_GYRATION=m
|
||||
CONFIG_HID_PANTHERLORD=m
|
||||
CONFIG_HID_PETALYNX=m
|
||||
CONFIG_HID_SAMSUNG=m
|
||||
CONFIG_HID_SONY=m
|
||||
CONFIG_HID_SUNPLUS=m
|
||||
CONFIG_USB=m
|
||||
CONFIG_USB_MON=m
|
||||
CONFIG_USB_EHCI_HCD=m
|
||||
CONFIG_USB_OHCI_HCD=m
|
||||
CONFIG_USB_UHCI_HCD=m
|
||||
CONFIG_USB_STORAGE=m
|
||||
CONFIG_INFINIBAND=m
|
||||
CONFIG_INFINIBAND_MTHCA=m
|
||||
CONFIG_INFINIBAND_IPOIB=m
|
||||
CONFIG_INTEL_IOMMU=y
|
||||
CONFIG_MSPEC=m
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||
CONFIG_EXT2_FS_SECURITY=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_EXT3_FS_POSIX_ACL=y
|
||||
CONFIG_EXT3_FS_SECURITY=y
|
||||
CONFIG_REISERFS_FS=y
|
||||
CONFIG_REISERFS_FS_XATTR=y
|
||||
CONFIG_REISERFS_FS_POSIX_ACL=y
|
||||
CONFIG_REISERFS_FS_SECURITY=y
|
||||
CONFIG_XFS_FS=y
|
||||
CONFIG_AUTOFS4_FS=m
|
||||
CONFIG_ISO9660_FS=m
|
||||
CONFIG_JOLIET=y
|
||||
CONFIG_UDF_FS=m
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=m
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=m
|
||||
CONFIG_NFS_V4=m
|
||||
CONFIG_NFSD=m
|
||||
CONFIG_NFSD_V4=y
|
||||
CONFIG_CIFS=m
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_737=m
|
||||
CONFIG_NLS_CODEPAGE_775=m
|
||||
CONFIG_NLS_CODEPAGE_850=m
|
||||
CONFIG_NLS_CODEPAGE_852=m
|
||||
CONFIG_NLS_CODEPAGE_855=m
|
||||
CONFIG_NLS_CODEPAGE_857=m
|
||||
CONFIG_NLS_CODEPAGE_860=m
|
||||
CONFIG_NLS_CODEPAGE_861=m
|
||||
CONFIG_NLS_CODEPAGE_862=m
|
||||
CONFIG_NLS_CODEPAGE_863=m
|
||||
CONFIG_NLS_CODEPAGE_864=m
|
||||
CONFIG_NLS_CODEPAGE_865=m
|
||||
CONFIG_NLS_CODEPAGE_866=m
|
||||
CONFIG_NLS_CODEPAGE_869=m
|
||||
CONFIG_NLS_CODEPAGE_936=m
|
||||
CONFIG_NLS_CODEPAGE_950=m
|
||||
CONFIG_NLS_CODEPAGE_932=m
|
||||
CONFIG_NLS_CODEPAGE_949=m
|
||||
CONFIG_NLS_CODEPAGE_874=m
|
||||
CONFIG_NLS_ISO8859_8=m
|
||||
CONFIG_NLS_CODEPAGE_1250=m
|
||||
CONFIG_NLS_CODEPAGE_1251=m
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_2=m
|
||||
CONFIG_NLS_ISO8859_3=m
|
||||
CONFIG_NLS_ISO8859_4=m
|
||||
CONFIG_NLS_ISO8859_5=m
|
||||
CONFIG_NLS_ISO8859_6=m
|
||||
CONFIG_NLS_ISO8859_7=m
|
||||
CONFIG_NLS_ISO8859_9=m
|
||||
CONFIG_NLS_ISO8859_13=m
|
||||
CONFIG_NLS_ISO8859_14=m
|
||||
CONFIG_NLS_ISO8859_15=m
|
||||
CONFIG_NLS_KOI8_R=m
|
||||
CONFIG_NLS_KOI8_U=m
|
||||
CONFIG_NLS_UTF8=m
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_CRYPTO_PCBC=m
|
||||
CONFIG_CRYPTO_MD5=y
|
||||
# CONFIG_CRYPTO_ANSI_CPRNG is not set
|
||||
CONFIG_CRC_T10DIF=y
|
199
arch/ia64/configs/gensparse_defconfig
Normal file
199
arch/ia64/configs/gensparse_defconfig
Normal file
|
@ -0,0 +1,199 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=20
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_SGI_PARTITION=y
|
||||
CONFIG_MCKINLEY=y
|
||||
CONFIG_IA64_CYCLONE=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=512
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_SPARSEMEM_MANUAL=y
|
||||
CONFIG_IA64_MCA_RECOVERY=y
|
||||
CONFIG_PERFMON=y
|
||||
CONFIG_IA64_PALINFO=y
|
||||
CONFIG_SGI_IOC3=y
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=m
|
||||
CONFIG_ACPI_BUTTON=m
|
||||
CONFIG_ACPI_FAN=m
|
||||
CONFIG_ACPI_PROCESSOR=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_SGI_IOC4=y
|
||||
CONFIG_IDE=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_IDE_GENERIC=y
|
||||
CONFIG_BLK_DEV_GENERIC=y
|
||||
CONFIG_BLK_DEV_CMD64X=y
|
||||
CONFIG_BLK_DEV_PIIX=y
|
||||
CONFIG_BLK_DEV_SGIIOC4=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_CHR_DEV_ST=m
|
||||
CONFIG_BLK_DEV_SR=m
|
||||
CONFIG_CHR_DEV_SG=m
|
||||
CONFIG_SCSI_FC_ATTRS=y
|
||||
CONFIG_SCSI_SYM53C8XX_2=y
|
||||
CONFIG_SCSI_QLOGIC_1280=y
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_MD=m
|
||||
CONFIG_MD_LINEAR=m
|
||||
CONFIG_MD_RAID0=m
|
||||
CONFIG_MD_RAID1=m
|
||||
CONFIG_MD_MULTIPATH=m
|
||||
CONFIG_BLK_DEV_DM=m
|
||||
CONFIG_DM_CRYPT=m
|
||||
CONFIG_DM_SNAPSHOT=m
|
||||
CONFIG_DM_MIRROR=m
|
||||
CONFIG_DM_ZERO=m
|
||||
CONFIG_DM_MULTIPATH=m
|
||||
CONFIG_FUSION=y
|
||||
CONFIG_FUSION_SPI=y
|
||||
CONFIG_FUSION_FC=m
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=m
|
||||
CONFIG_NETCONSOLE=y
|
||||
CONFIG_TIGON3=y
|
||||
CONFIG_NET_TULIP=y
|
||||
CONFIG_TULIP=m
|
||||
CONFIG_E100=m
|
||||
CONFIG_E1000=y
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_GAMEPORT=m
|
||||
CONFIG_SERIAL_NONSTANDARD=y
|
||||
CONFIG_SGI_SNSC=y
|
||||
CONFIG_SGI_TIOCX=y
|
||||
CONFIG_SGI_MBCS=m
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=6
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_SGI_L1_CONSOLE=y
|
||||
CONFIG_SERIAL_SGI_IOC4=y
|
||||
CONFIG_SERIAL_SGI_IOC3=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
CONFIG_RAW_DRIVER=m
|
||||
CONFIG_HPET=y
|
||||
CONFIG_AGP=m
|
||||
CONFIG_AGP_I460=m
|
||||
CONFIG_AGP_HP_ZX1=m
|
||||
CONFIG_AGP_SGI_TIOCA=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_TDFX=m
|
||||
CONFIG_DRM_R128=m
|
||||
CONFIG_DRM_RADEON=m
|
||||
CONFIG_DRM_MGA=m
|
||||
CONFIG_DRM_SIS=m
|
||||
CONFIG_SOUND=m
|
||||
CONFIG_SND=m
|
||||
CONFIG_SND_SEQUENCER=m
|
||||
CONFIG_SND_SEQ_DUMMY=m
|
||||
CONFIG_SND_MIXER_OSS=m
|
||||
CONFIG_SND_PCM_OSS=m
|
||||
CONFIG_SND_SEQUENCER_OSS=y
|
||||
CONFIG_SND_VERBOSE_PRINTK=y
|
||||
CONFIG_SND_DUMMY=m
|
||||
CONFIG_SND_VIRMIDI=m
|
||||
CONFIG_SND_MTPAV=m
|
||||
CONFIG_SND_SERIAL_U16550=m
|
||||
CONFIG_SND_MPU401=m
|
||||
CONFIG_SND_CS4281=m
|
||||
CONFIG_SND_CS46XX=m
|
||||
CONFIG_SND_EMU10K1=m
|
||||
CONFIG_SND_FM801=m
|
||||
CONFIG_USB=m
|
||||
CONFIG_USB_MON=m
|
||||
CONFIG_USB_EHCI_HCD=m
|
||||
CONFIG_USB_OHCI_HCD=m
|
||||
CONFIG_USB_UHCI_HCD=m
|
||||
CONFIG_USB_STORAGE=m
|
||||
CONFIG_INFINIBAND=m
|
||||
CONFIG_INFINIBAND_MTHCA=m
|
||||
CONFIG_INFINIBAND_IPOIB=m
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||
CONFIG_EXT2_FS_SECURITY=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_EXT3_FS_POSIX_ACL=y
|
||||
CONFIG_EXT3_FS_SECURITY=y
|
||||
CONFIG_REISERFS_FS=y
|
||||
CONFIG_REISERFS_FS_XATTR=y
|
||||
CONFIG_REISERFS_FS_POSIX_ACL=y
|
||||
CONFIG_REISERFS_FS_SECURITY=y
|
||||
CONFIG_XFS_FS=y
|
||||
CONFIG_AUTOFS4_FS=y
|
||||
CONFIG_ISO9660_FS=m
|
||||
CONFIG_JOLIET=y
|
||||
CONFIG_UDF_FS=m
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=m
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=m
|
||||
CONFIG_NFS_V4=m
|
||||
CONFIG_NFSD=m
|
||||
CONFIG_NFSD_V4=y
|
||||
CONFIG_CIFS=m
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_737=m
|
||||
CONFIG_NLS_CODEPAGE_775=m
|
||||
CONFIG_NLS_CODEPAGE_850=m
|
||||
CONFIG_NLS_CODEPAGE_852=m
|
||||
CONFIG_NLS_CODEPAGE_855=m
|
||||
CONFIG_NLS_CODEPAGE_857=m
|
||||
CONFIG_NLS_CODEPAGE_860=m
|
||||
CONFIG_NLS_CODEPAGE_861=m
|
||||
CONFIG_NLS_CODEPAGE_862=m
|
||||
CONFIG_NLS_CODEPAGE_863=m
|
||||
CONFIG_NLS_CODEPAGE_864=m
|
||||
CONFIG_NLS_CODEPAGE_865=m
|
||||
CONFIG_NLS_CODEPAGE_866=m
|
||||
CONFIG_NLS_CODEPAGE_869=m
|
||||
CONFIG_NLS_CODEPAGE_936=m
|
||||
CONFIG_NLS_CODEPAGE_950=m
|
||||
CONFIG_NLS_CODEPAGE_932=m
|
||||
CONFIG_NLS_CODEPAGE_949=m
|
||||
CONFIG_NLS_CODEPAGE_874=m
|
||||
CONFIG_NLS_ISO8859_8=m
|
||||
CONFIG_NLS_CODEPAGE_1250=m
|
||||
CONFIG_NLS_CODEPAGE_1251=m
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_2=m
|
||||
CONFIG_NLS_ISO8859_3=m
|
||||
CONFIG_NLS_ISO8859_4=m
|
||||
CONFIG_NLS_ISO8859_5=m
|
||||
CONFIG_NLS_ISO8859_6=m
|
||||
CONFIG_NLS_ISO8859_7=m
|
||||
CONFIG_NLS_ISO8859_9=m
|
||||
CONFIG_NLS_ISO8859_13=m
|
||||
CONFIG_NLS_ISO8859_14=m
|
||||
CONFIG_NLS_ISO8859_15=m
|
||||
CONFIG_NLS_KOI8_R=m
|
||||
CONFIG_NLS_KOI8_U=m
|
||||
CONFIG_NLS_UTF8=m
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_CRYPTO_MD5=y
|
52
arch/ia64/configs/sim_defconfig
Normal file
52
arch/ia64/configs/sim_defconfig
Normal file
|
@ -0,0 +1,52 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_IA64_HP_SIM=y
|
||||
CONFIG_MCKINLEY=y
|
||||
CONFIG_IA64_PAGE_SIZE_64KB=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=64
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_IA64_PALINFO=m
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_SCSI_CONSTANTS=y
|
||||
CONFIG_SCSI_LOGGING=y
|
||||
CONFIG_SCSI_SPI_ATTRS=y
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO_I8042 is not set
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
CONFIG_HP_SIMETH=y
|
||||
CONFIG_HP_SIMSERIAL=y
|
||||
CONFIG_HP_SIMSERIAL_CONSOLE=y
|
||||
CONFIG_HP_SIMSCSI=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT3_FS=y
|
||||
# CONFIG_EXT3_FS_XATTR is not set
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFSD=y
|
||||
CONFIG_NFSD_V3=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
174
arch/ia64/configs/tiger_defconfig
Normal file
174
arch/ia64/configs/tiger_defconfig
Normal file
|
@ -0,0 +1,174 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=20
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
CONFIG_MODULE_SRCVERSION_ALL=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_SGI_PARTITION=y
|
||||
CONFIG_IA64_DIG=y
|
||||
CONFIG_MCKINLEY=y
|
||||
CONFIG_IA64_PAGE_SIZE_64KB=y
|
||||
CONFIG_IA64_CYCLONE=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=16
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_PERMIT_BSP_REMOVE=y
|
||||
CONFIG_FORCE_CPEI_RETARGET=y
|
||||
CONFIG_IA64_MCA_RECOVERY=y
|
||||
CONFIG_PERFMON=y
|
||||
CONFIG_IA64_PALINFO=y
|
||||
CONFIG_KEXEC=y
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=m
|
||||
CONFIG_ACPI_BUTTON=m
|
||||
CONFIG_ACPI_FAN=m
|
||||
CONFIG_ACPI_PROCESSOR=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_IDE=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_BLK_DEV_GENERIC=y
|
||||
CONFIG_BLK_DEV_CMD64X=y
|
||||
CONFIG_BLK_DEV_PIIX=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_CHR_DEV_ST=m
|
||||
CONFIG_BLK_DEV_SR=m
|
||||
CONFIG_CHR_DEV_SG=m
|
||||
CONFIG_SCSI_FC_ATTRS=y
|
||||
CONFIG_SCSI_SYM53C8XX_2=y
|
||||
CONFIG_SCSI_QLOGIC_1280=y
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_MD=m
|
||||
CONFIG_MD_LINEAR=m
|
||||
CONFIG_MD_RAID0=m
|
||||
CONFIG_MD_RAID1=m
|
||||
CONFIG_MD_MULTIPATH=m
|
||||
CONFIG_BLK_DEV_DM=m
|
||||
CONFIG_DM_CRYPT=m
|
||||
CONFIG_DM_SNAPSHOT=m
|
||||
CONFIG_DM_MIRROR=m
|
||||
CONFIG_DM_ZERO=m
|
||||
CONFIG_FUSION=y
|
||||
CONFIG_FUSION_SPI=y
|
||||
CONFIG_FUSION_FC=y
|
||||
CONFIG_FUSION_CTL=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=m
|
||||
CONFIG_NETCONSOLE=y
|
||||
CONFIG_TIGON3=y
|
||||
CONFIG_NET_TULIP=y
|
||||
CONFIG_TULIP=m
|
||||
CONFIG_E100=m
|
||||
CONFIG_E1000=y
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_GAMEPORT=m
|
||||
CONFIG_SERIAL_NONSTANDARD=y
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=6
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
CONFIG_RAW_DRIVER=m
|
||||
CONFIG_HPET=y
|
||||
CONFIG_AGP=m
|
||||
CONFIG_AGP_I460=m
|
||||
CONFIG_DRM=m
|
||||
CONFIG_DRM_TDFX=m
|
||||
CONFIG_DRM_R128=m
|
||||
CONFIG_DRM_RADEON=m
|
||||
CONFIG_DRM_MGA=m
|
||||
CONFIG_DRM_SIS=m
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI_HCD=m
|
||||
CONFIG_USB_OHCI_HCD=m
|
||||
CONFIG_USB_UHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=m
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||
CONFIG_EXT2_FS_SECURITY=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_EXT3_FS_POSIX_ACL=y
|
||||
CONFIG_EXT3_FS_SECURITY=y
|
||||
CONFIG_REISERFS_FS=y
|
||||
CONFIG_REISERFS_FS_XATTR=y
|
||||
CONFIG_REISERFS_FS_POSIX_ACL=y
|
||||
CONFIG_REISERFS_FS_SECURITY=y
|
||||
CONFIG_XFS_FS=y
|
||||
CONFIG_AUTOFS4_FS=y
|
||||
CONFIG_ISO9660_FS=m
|
||||
CONFIG_JOLIET=y
|
||||
CONFIG_UDF_FS=m
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=m
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=m
|
||||
CONFIG_NFS_V4=m
|
||||
CONFIG_NFSD=m
|
||||
CONFIG_NFSD_V4=y
|
||||
CONFIG_CIFS=m
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_737=m
|
||||
CONFIG_NLS_CODEPAGE_775=m
|
||||
CONFIG_NLS_CODEPAGE_850=m
|
||||
CONFIG_NLS_CODEPAGE_852=m
|
||||
CONFIG_NLS_CODEPAGE_855=m
|
||||
CONFIG_NLS_CODEPAGE_857=m
|
||||
CONFIG_NLS_CODEPAGE_860=m
|
||||
CONFIG_NLS_CODEPAGE_861=m
|
||||
CONFIG_NLS_CODEPAGE_862=m
|
||||
CONFIG_NLS_CODEPAGE_863=m
|
||||
CONFIG_NLS_CODEPAGE_864=m
|
||||
CONFIG_NLS_CODEPAGE_865=m
|
||||
CONFIG_NLS_CODEPAGE_866=m
|
||||
CONFIG_NLS_CODEPAGE_869=m
|
||||
CONFIG_NLS_CODEPAGE_936=m
|
||||
CONFIG_NLS_CODEPAGE_950=m
|
||||
CONFIG_NLS_CODEPAGE_932=m
|
||||
CONFIG_NLS_CODEPAGE_949=m
|
||||
CONFIG_NLS_CODEPAGE_874=m
|
||||
CONFIG_NLS_ISO8859_8=m
|
||||
CONFIG_NLS_CODEPAGE_1250=m
|
||||
CONFIG_NLS_CODEPAGE_1251=m
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_2=m
|
||||
CONFIG_NLS_ISO8859_3=m
|
||||
CONFIG_NLS_ISO8859_4=m
|
||||
CONFIG_NLS_ISO8859_5=m
|
||||
CONFIG_NLS_ISO8859_6=m
|
||||
CONFIG_NLS_ISO8859_7=m
|
||||
CONFIG_NLS_ISO8859_9=m
|
||||
CONFIG_NLS_ISO8859_13=m
|
||||
CONFIG_NLS_ISO8859_14=m
|
||||
CONFIG_NLS_ISO8859_15=m
|
||||
CONFIG_NLS_KOI8_R=m
|
||||
CONFIG_NLS_KOI8_U=m
|
||||
CONFIG_NLS_UTF8=m
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_IA64_GRANULE_16MB=y
|
||||
CONFIG_CRYPTO_PCBC=m
|
||||
CONFIG_CRYPTO_MD5=y
|
154
arch/ia64/configs/zx1_defconfig
Normal file
154
arch/ia64/configs/zx1_defconfig
Normal file
|
@ -0,0 +1,154 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KPROBES=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_IA64_HP_ZX1=y
|
||||
CONFIG_MCKINLEY=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=16
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_FLATMEM_MANUAL=y
|
||||
CONFIG_IA64_MCA_RECOVERY=y
|
||||
CONFIG_PERFMON=y
|
||||
CONFIG_IA64_PALINFO=y
|
||||
CONFIG_CRASH_DUMP=y
|
||||
CONFIG_EFI_VARS=y
|
||||
CONFIG_BINFMT_MISC=y
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_HOTPLUG_PCI_ACPI=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_NETFILTER=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_IDE=y
|
||||
CONFIG_BLK_DEV_IDECD=y
|
||||
CONFIG_BLK_DEV_GENERIC=y
|
||||
CONFIG_BLK_DEV_CMD64X=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_CHR_DEV_ST=y
|
||||
CONFIG_CHR_DEV_OSST=y
|
||||
CONFIG_BLK_DEV_SR=y
|
||||
CONFIG_BLK_DEV_SR_VENDOR=y
|
||||
CONFIG_CHR_DEV_SG=y
|
||||
CONFIG_SCSI_CONSTANTS=y
|
||||
CONFIG_SCSI_LOGGING=y
|
||||
CONFIG_SCSI_FC_ATTRS=y
|
||||
CONFIG_SCSI_SYM53C8XX_2=y
|
||||
CONFIG_SCSI_QLOGIC_1280=y
|
||||
CONFIG_FUSION=y
|
||||
CONFIG_FUSION_SPI=y
|
||||
CONFIG_FUSION_FC=y
|
||||
CONFIG_FUSION_CTL=m
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
CONFIG_TIGON3=y
|
||||
CONFIG_NET_TULIP=y
|
||||
CONFIG_TULIP=y
|
||||
CONFIG_TULIP_MWI=y
|
||||
CONFIG_TULIP_MMIO=y
|
||||
CONFIG_TULIP_NAPI=y
|
||||
CONFIG_TULIP_NAPI_HW_MITIGATION=y
|
||||
CONFIG_E100=y
|
||||
CONFIG_E1000=y
|
||||
CONFIG_INPUT_JOYDEV=y
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO_I8042 is not set
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=8
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
CONFIG_EFI_RTC=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_AGP=y
|
||||
CONFIG_AGP_HP_ZX1=y
|
||||
CONFIG_DRM=y
|
||||
CONFIG_DRM_RADEON=y
|
||||
CONFIG_FB_RADEON=y
|
||||
CONFIG_FB_RADEON_DEBUG=y
|
||||
CONFIG_LOGO=y
|
||||
# CONFIG_LOGO_LINUX_MONO is not set
|
||||
# CONFIG_LOGO_LINUX_VGA16 is not set
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_SEQUENCER=y
|
||||
CONFIG_SND_MIXER_OSS=y
|
||||
CONFIG_SND_PCM_OSS=y
|
||||
CONFIG_SND_SEQUENCER_OSS=y
|
||||
CONFIG_SND_FM801=y
|
||||
CONFIG_USB_HIDDEV=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_MON=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
CONFIG_USB_UHCI_HCD=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_ISO9660_FS=y
|
||||
CONFIG_JOLIET=y
|
||||
CONFIG_UDF_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_HUGETLBFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V4=y
|
||||
CONFIG_NFSD=y
|
||||
CONFIG_NFSD_V3=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_737=y
|
||||
CONFIG_NLS_CODEPAGE_775=y
|
||||
CONFIG_NLS_CODEPAGE_850=y
|
||||
CONFIG_NLS_CODEPAGE_852=y
|
||||
CONFIG_NLS_CODEPAGE_855=y
|
||||
CONFIG_NLS_CODEPAGE_857=y
|
||||
CONFIG_NLS_CODEPAGE_860=y
|
||||
CONFIG_NLS_CODEPAGE_861=y
|
||||
CONFIG_NLS_CODEPAGE_862=y
|
||||
CONFIG_NLS_CODEPAGE_863=y
|
||||
CONFIG_NLS_CODEPAGE_864=y
|
||||
CONFIG_NLS_CODEPAGE_865=y
|
||||
CONFIG_NLS_CODEPAGE_866=y
|
||||
CONFIG_NLS_CODEPAGE_869=y
|
||||
CONFIG_NLS_CODEPAGE_936=y
|
||||
CONFIG_NLS_CODEPAGE_950=y
|
||||
CONFIG_NLS_CODEPAGE_932=y
|
||||
CONFIG_NLS_CODEPAGE_949=y
|
||||
CONFIG_NLS_CODEPAGE_874=y
|
||||
CONFIG_NLS_ISO8859_8=y
|
||||
CONFIG_NLS_CODEPAGE_1251=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_2=y
|
||||
CONFIG_NLS_ISO8859_3=y
|
||||
CONFIG_NLS_ISO8859_4=y
|
||||
CONFIG_NLS_ISO8859_5=y
|
||||
CONFIG_NLS_ISO8859_6=y
|
||||
CONFIG_NLS_ISO8859_7=y
|
||||
CONFIG_NLS_ISO8859_9=y
|
||||
CONFIG_NLS_ISO8859_13=y
|
||||
CONFIG_NLS_ISO8859_14=y
|
||||
CONFIG_NLS_ISO8859_15=y
|
||||
CONFIG_NLS_KOI8_R=y
|
||||
CONFIG_NLS_KOI8_U=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_IA64_PRINT_HAZARDS=y
|
||||
CONFIG_CRYPTO_ECB=m
|
||||
CONFIG_CRYPTO_PCBC=m
|
14
arch/ia64/dig/Makefile
Normal file
14
arch/ia64/dig/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# ia64/platform/dig/Makefile
|
||||
#
|
||||
# Copyright (C) 1999 Silicon Graphics, Inc.
|
||||
# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
|
||||
#
|
||||
|
||||
obj-y := setup.o
|
||||
ifeq ($(CONFIG_INTEL_IOMMU), y)
|
||||
obj-$(CONFIG_IA64_GENERIC) += machvec.o machvec_vtd.o
|
||||
else
|
||||
obj-$(CONFIG_IA64_GENERIC) += machvec.o
|
||||
endif
|
||||
|
3
arch/ia64/dig/machvec.c
Normal file
3
arch/ia64/dig/machvec.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MACHVEC_PLATFORM_NAME dig
|
||||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_dig.h>
|
||||
#include <asm/machvec_init.h>
|
3
arch/ia64/dig/machvec_vtd.c
Normal file
3
arch/ia64/dig/machvec_vtd.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MACHVEC_PLATFORM_NAME dig_vtd
|
||||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_dig_vtd.h>
|
||||
#include <asm/machvec_init.h>
|
70
arch/ia64/dig/setup.c
Normal file
70
arch/ia64/dig/setup.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Platform dependent support for DIG64 platforms.
|
||||
*
|
||||
* Copyright (C) 1999 Intel Corp.
|
||||
* Copyright (C) 1999, 2001 Hewlett-Packard Co
|
||||
* Copyright (C) 1999, 2001, 2003 David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 VA Linux Systems
|
||||
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
|
||||
* Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/screen_info.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/timex.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/root_dev.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/setup.h>
|
||||
|
||||
void __init
|
||||
dig_setup (char **cmdline_p)
|
||||
{
|
||||
unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
|
||||
|
||||
/*
|
||||
* Default to /dev/sda2. This assumes that the EFI partition
|
||||
* is physical disk 1 partition 1 and the Linux root disk is
|
||||
* physical disk 1 partition 2.
|
||||
*/
|
||||
ROOT_DEV = Root_SDA2; /* default to second partition on first drive */
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
init_smp_config();
|
||||
#endif
|
||||
|
||||
memset(&screen_info, 0, sizeof(screen_info));
|
||||
|
||||
if (!ia64_boot_param->console_info.num_rows
|
||||
|| !ia64_boot_param->console_info.num_cols)
|
||||
{
|
||||
printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n");
|
||||
orig_x = 0;
|
||||
orig_y = 0;
|
||||
num_cols = 80;
|
||||
num_rows = 25;
|
||||
font_height = 16;
|
||||
} else {
|
||||
orig_x = ia64_boot_param->console_info.orig_x;
|
||||
orig_y = ia64_boot_param->console_info.orig_y;
|
||||
num_cols = ia64_boot_param->console_info.num_cols;
|
||||
num_rows = ia64_boot_param->console_info.num_rows;
|
||||
font_height = 400 / num_rows;
|
||||
}
|
||||
|
||||
screen_info.orig_x = orig_x;
|
||||
screen_info.orig_y = orig_y;
|
||||
screen_info.orig_video_cols = num_cols;
|
||||
screen_info.orig_video_lines = num_rows;
|
||||
screen_info.orig_video_points = font_height;
|
||||
screen_info.orig_video_mode = 3; /* XXX fake */
|
||||
screen_info.orig_video_isVGA = 1; /* XXX fake */
|
||||
screen_info.orig_video_ega_bx = 3; /* XXX fake */
|
||||
}
|
11
arch/ia64/hp/common/Makefile
Normal file
11
arch/ia64/hp/common/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# ia64/platform/hp/common/Makefile
|
||||
#
|
||||
# Copyright (C) 2002 Hewlett Packard
|
||||
# Copyright (C) Alex Williamson (alex_williamson@hp.com)
|
||||
#
|
||||
|
||||
obj-y := sba_iommu.o
|
||||
obj-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += hwsw_iommu.o
|
||||
obj-$(CONFIG_IA64_GENERIC) += hwsw_iommu.o
|
||||
obj-$(CONFIG_IA64_HP_AML_NFW) += aml_nfw.o
|
235
arch/ia64/hp/common/aml_nfw.c
Normal file
235
arch/ia64/hp/common/aml_nfw.c
Normal file
|
@ -0,0 +1,235 @@
|
|||
/*
|
||||
* OpRegion handler to allow AML to call native firmware
|
||||
*
|
||||
* (c) Copyright 2007 Hewlett-Packard Development Company, L.P.
|
||||
* Bjorn Helgaas <bjorn.helgaas@hp.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This driver implements HP Open Source Review Board proposal 1842,
|
||||
* which was approved on 9/20/2006.
|
||||
*
|
||||
* For technical documentation, see the HP SPPA Firmware EAS, Appendix F.
|
||||
*
|
||||
* ACPI does not define a mechanism for AML methods to call native firmware
|
||||
* interfaces such as PAL or SAL. This OpRegion handler adds such a mechanism.
|
||||
* After the handler is installed, an AML method can call native firmware by
|
||||
* storing the arguments and firmware entry point to specific offsets in the
|
||||
* OpRegion. When AML reads the "return value" offset from the OpRegion, this
|
||||
* handler loads up the arguments, makes the firmware call, and returns the
|
||||
* result.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <asm/sal.h>
|
||||
|
||||
MODULE_AUTHOR("Bjorn Helgaas <bjorn.helgaas@hp.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("ACPI opregion handler for native firmware calls");
|
||||
|
||||
static bool force_register;
|
||||
module_param_named(force, force_register, bool, 0);
|
||||
MODULE_PARM_DESC(force, "Install opregion handler even without HPQ5001 device");
|
||||
|
||||
#define AML_NFW_SPACE 0xA1
|
||||
|
||||
struct ia64_pdesc {
|
||||
void *ip;
|
||||
void *gp;
|
||||
};
|
||||
|
||||
/*
|
||||
* N.B. The layout of this structure is defined in the HP SPPA FW EAS, and
|
||||
* the member offsets are embedded in AML methods.
|
||||
*/
|
||||
struct ia64_nfw_context {
|
||||
u64 arg[8];
|
||||
struct ia64_sal_retval ret;
|
||||
u64 ip;
|
||||
u64 gp;
|
||||
u64 pad[2];
|
||||
};
|
||||
|
||||
static void *virt_map(u64 address)
|
||||
{
|
||||
if (address & (1UL << 63))
|
||||
return (void *) (__IA64_UNCACHED_OFFSET | address);
|
||||
|
||||
return __va(address);
|
||||
}
|
||||
|
||||
static void aml_nfw_execute(struct ia64_nfw_context *c)
|
||||
{
|
||||
struct ia64_pdesc virt_entry;
|
||||
ia64_sal_handler entry;
|
||||
|
||||
virt_entry.ip = virt_map(c->ip);
|
||||
virt_entry.gp = virt_map(c->gp);
|
||||
|
||||
entry = (ia64_sal_handler) &virt_entry;
|
||||
|
||||
IA64_FW_CALL(entry, c->ret,
|
||||
c->arg[0], c->arg[1], c->arg[2], c->arg[3],
|
||||
c->arg[4], c->arg[5], c->arg[6], c->arg[7]);
|
||||
}
|
||||
|
||||
static void aml_nfw_read_arg(u8 *offset, u32 bit_width, u64 *value)
|
||||
{
|
||||
switch (bit_width) {
|
||||
case 8:
|
||||
*value = *(u8 *)offset;
|
||||
break;
|
||||
case 16:
|
||||
*value = *(u16 *)offset;
|
||||
break;
|
||||
case 32:
|
||||
*value = *(u32 *)offset;
|
||||
break;
|
||||
case 64:
|
||||
*value = *(u64 *)offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void aml_nfw_write_arg(u8 *offset, u32 bit_width, u64 *value)
|
||||
{
|
||||
switch (bit_width) {
|
||||
case 8:
|
||||
*(u8 *) offset = *value;
|
||||
break;
|
||||
case 16:
|
||||
*(u16 *) offset = *value;
|
||||
break;
|
||||
case 32:
|
||||
*(u32 *) offset = *value;
|
||||
break;
|
||||
case 64:
|
||||
*(u64 *) offset = *value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static acpi_status aml_nfw_handler(u32 function, acpi_physical_address address,
|
||||
u32 bit_width, u64 *value, void *handler_context,
|
||||
void *region_context)
|
||||
{
|
||||
struct ia64_nfw_context *context = handler_context;
|
||||
u8 *offset = (u8 *) context + address;
|
||||
|
||||
if (bit_width != 8 && bit_width != 16 &&
|
||||
bit_width != 32 && bit_width != 64)
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
if (address + (bit_width >> 3) > sizeof(struct ia64_nfw_context))
|
||||
return AE_BAD_PARAMETER;
|
||||
|
||||
switch (function) {
|
||||
case ACPI_READ:
|
||||
if (address == offsetof(struct ia64_nfw_context, ret))
|
||||
aml_nfw_execute(context);
|
||||
aml_nfw_read_arg(offset, bit_width, value);
|
||||
break;
|
||||
case ACPI_WRITE:
|
||||
aml_nfw_write_arg(offset, bit_width, value);
|
||||
break;
|
||||
}
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static struct ia64_nfw_context global_context;
|
||||
static int global_handler_registered;
|
||||
|
||||
static int aml_nfw_add_global_handler(void)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
if (global_handler_registered)
|
||||
return 0;
|
||||
|
||||
status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
|
||||
AML_NFW_SPACE, aml_nfw_handler, NULL, &global_context);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
|
||||
global_handler_registered = 1;
|
||||
printk(KERN_INFO "Global 0x%02X opregion handler registered\n",
|
||||
AML_NFW_SPACE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aml_nfw_remove_global_handler(void)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
if (!global_handler_registered)
|
||||
return 0;
|
||||
|
||||
status = acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
|
||||
AML_NFW_SPACE, aml_nfw_handler);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
|
||||
global_handler_registered = 0;
|
||||
printk(KERN_INFO "Global 0x%02X opregion handler removed\n",
|
||||
AML_NFW_SPACE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aml_nfw_add(struct acpi_device *device)
|
||||
{
|
||||
/*
|
||||
* We would normally allocate a new context structure and install
|
||||
* the address space handler for the specific device we found.
|
||||
* But the HP-UX implementation shares a single global context
|
||||
* and always puts the handler at the root, so we'll do the same.
|
||||
*/
|
||||
return aml_nfw_add_global_handler();
|
||||
}
|
||||
|
||||
static int aml_nfw_remove(struct acpi_device *device)
|
||||
{
|
||||
return aml_nfw_remove_global_handler();
|
||||
}
|
||||
|
||||
static const struct acpi_device_id aml_nfw_ids[] = {
|
||||
{"HPQ5001", 0},
|
||||
{"", 0}
|
||||
};
|
||||
|
||||
static struct acpi_driver acpi_aml_nfw_driver = {
|
||||
.name = "native firmware",
|
||||
.ids = aml_nfw_ids,
|
||||
.ops = {
|
||||
.add = aml_nfw_add,
|
||||
.remove = aml_nfw_remove,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init aml_nfw_init(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (force_register)
|
||||
aml_nfw_add_global_handler();
|
||||
|
||||
result = acpi_bus_register_driver(&acpi_aml_nfw_driver);
|
||||
if (result < 0) {
|
||||
aml_nfw_remove_global_handler();
|
||||
return result;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit aml_nfw_exit(void)
|
||||
{
|
||||
acpi_bus_unregister_driver(&acpi_aml_nfw_driver);
|
||||
aml_nfw_remove_global_handler();
|
||||
}
|
||||
|
||||
module_init(aml_nfw_init);
|
||||
module_exit(aml_nfw_exit);
|
59
arch/ia64/hp/common/hwsw_iommu.c
Normal file
59
arch/ia64/hp/common/hwsw_iommu.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
|
||||
* Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*
|
||||
* This is a pseudo I/O MMU which dispatches to the hardware I/O MMU
|
||||
* whenever possible. We assume that the hardware I/O MMU requires
|
||||
* full 32-bit addressability, as is the case, e.g., for HP zx1-based
|
||||
* systems (there, the I/O MMU window is mapped at 3-4GB). If a
|
||||
* device doesn't provide full 32-bit addressability, we fall back on
|
||||
* the sw I/O TLB. This is good enough to let us support broken
|
||||
* hardware such as soundcards which have a DMA engine that can
|
||||
* address only 28 bits.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/swiotlb.h>
|
||||
#include <linux/export.h>
|
||||
#include <asm/machvec.h>
|
||||
|
||||
extern struct dma_map_ops sba_dma_ops, swiotlb_dma_ops;
|
||||
|
||||
/* swiotlb declarations & definitions: */
|
||||
extern int swiotlb_late_init_with_default_size (size_t size);
|
||||
|
||||
/*
|
||||
* Note: we need to make the determination of whether or not to use
|
||||
* the sw I/O TLB based purely on the device structure. Anything else
|
||||
* would be unreliable or would be too intrusive.
|
||||
*/
|
||||
static inline int use_swiotlb(struct device *dev)
|
||||
{
|
||||
return dev && dev->dma_mask &&
|
||||
!sba_dma_ops.dma_supported(dev, *dev->dma_mask);
|
||||
}
|
||||
|
||||
struct dma_map_ops *hwsw_dma_get_ops(struct device *dev)
|
||||
{
|
||||
if (use_swiotlb(dev))
|
||||
return &swiotlb_dma_ops;
|
||||
return &sba_dma_ops;
|
||||
}
|
||||
EXPORT_SYMBOL(hwsw_dma_get_ops);
|
||||
|
||||
void __init
|
||||
hwsw_init (void)
|
||||
{
|
||||
/* default to a smallish 2MB sw I/O TLB */
|
||||
if (swiotlb_late_init_with_default_size (2 * (1<<20)) != 0) {
|
||||
#ifdef CONFIG_IA64_GENERIC
|
||||
/* Better to have normal DMA than panic */
|
||||
printk(KERN_WARNING "%s: Failed to initialize software I/O TLB,"
|
||||
" reverting to hpzx1 platform vector\n", __func__);
|
||||
machvec_init("hpzx1");
|
||||
#else
|
||||
panic("Unable to initialize software I/O TLB services");
|
||||
#endif
|
||||
}
|
||||
}
|
2241
arch/ia64/hp/common/sba_iommu.c
Normal file
2241
arch/ia64/hp/common/sba_iommu.c
Normal file
File diff suppressed because it is too large
Load diff
22
arch/ia64/hp/sim/Kconfig
Normal file
22
arch/ia64/hp/sim/Kconfig
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
menu "HP Simulator drivers"
|
||||
depends on IA64_HP_SIM || IA64_GENERIC
|
||||
|
||||
config HP_SIMETH
|
||||
bool "Simulated Ethernet "
|
||||
depends on NET
|
||||
|
||||
config HP_SIMSERIAL
|
||||
bool "Simulated serial driver support"
|
||||
depends on TTY
|
||||
|
||||
config HP_SIMSERIAL_CONSOLE
|
||||
bool "Console for HP simulator"
|
||||
depends on HP_SIMSERIAL
|
||||
|
||||
config HP_SIMSCSI
|
||||
bool "Simulated SCSI disk"
|
||||
depends on SCSI=y
|
||||
|
||||
endmenu
|
||||
|
16
arch/ia64/hp/sim/Makefile
Normal file
16
arch/ia64/hp/sim/Makefile
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# ia64/platform/hp/sim/Makefile
|
||||
#
|
||||
# Copyright (C) 2002 Hewlett-Packard Co.
|
||||
# David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
# Copyright (C) 1999 Silicon Graphics, Inc.
|
||||
# Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
|
||||
#
|
||||
|
||||
obj-y := hpsim_irq.o hpsim_setup.o hpsim.o
|
||||
obj-$(CONFIG_IA64_GENERIC) += hpsim_machvec.o
|
||||
|
||||
obj-$(CONFIG_HP_SIMETH) += simeth.o
|
||||
obj-$(CONFIG_HP_SIMSERIAL) += simserial.o
|
||||
obj-$(CONFIG_HP_SIMSERIAL_CONSOLE) += hpsim_console.o
|
||||
obj-$(CONFIG_HP_SIMSCSI) += simscsi.o
|
37
arch/ia64/hp/sim/boot/Makefile
Normal file
37
arch/ia64/hp/sim/boot/Makefile
Normal file
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# ia64/boot/Makefile
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 1998, 2003 by David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
#
|
||||
|
||||
targets-$(CONFIG_IA64_HP_SIM) += bootloader
|
||||
targets := vmlinux.bin vmlinux.gz $(targets-y)
|
||||
|
||||
quiet_cmd_cptotop = LN $@
|
||||
cmd_cptotop = ln -f $< $@
|
||||
|
||||
vmlinux.gz: $(obj)/vmlinux.gz $(addprefix $(obj)/,$(targets-y))
|
||||
$(call cmd,cptotop)
|
||||
@echo ' Kernel: $@ is ready'
|
||||
|
||||
boot: bootloader
|
||||
|
||||
bootloader: $(obj)/bootloader
|
||||
$(call cmd,cptotop)
|
||||
|
||||
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,gzip)
|
||||
|
||||
$(obj)/vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
|
||||
LDFLAGS_bootloader = -static -T
|
||||
|
||||
$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \
|
||||
lib/lib.a arch/ia64/lib/built-in.o arch/ia64/lib/lib.a FORCE
|
||||
$(call if_changed,ld)
|
164
arch/ia64/hp/sim/boot/boot_head.S
Normal file
164
arch/ia64/hp/sim/boot/boot_head.S
Normal file
|
@ -0,0 +1,164 @@
|
|||
/*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#include <asm/asmmacro.h>
|
||||
#include <asm/pal.h>
|
||||
|
||||
.bss
|
||||
.align 16
|
||||
stack_mem:
|
||||
.skip 16834
|
||||
|
||||
.text
|
||||
|
||||
/* This needs to be defined because lib/string.c:strlcat() calls it in case of error... */
|
||||
GLOBAL_ENTRY(printk)
|
||||
break 0
|
||||
END(printk)
|
||||
|
||||
GLOBAL_ENTRY(_start)
|
||||
.prologue
|
||||
.save rp, r0
|
||||
.body
|
||||
movl gp = __gp
|
||||
movl sp = stack_mem+16384-16
|
||||
bsw.1
|
||||
br.call.sptk.many rp=start_bootloader
|
||||
0: nop 0 /* dummy nop to make unwinding work */
|
||||
END(_start)
|
||||
|
||||
/*
|
||||
* Set a break point on this function so that symbols are available to set breakpoints in
|
||||
* the kernel being debugged.
|
||||
*/
|
||||
GLOBAL_ENTRY(debug_break)
|
||||
br.ret.sptk.many b0
|
||||
END(debug_break)
|
||||
|
||||
GLOBAL_ENTRY(ssc)
|
||||
.regstk 5,0,0,0
|
||||
mov r15=in4
|
||||
break 0x80001
|
||||
br.ret.sptk.many b0
|
||||
END(ssc)
|
||||
|
||||
GLOBAL_ENTRY(jmp_to_kernel)
|
||||
.regstk 2,0,0,0
|
||||
mov r28=in0
|
||||
mov b7=in1
|
||||
br.sptk.few b7
|
||||
END(jmp_to_kernel)
|
||||
|
||||
/*
|
||||
* r28 contains the index of the PAL function
|
||||
* r29--31 the args
|
||||
* Return values in ret0--3 (r8--11)
|
||||
*/
|
||||
GLOBAL_ENTRY(pal_emulator_static)
|
||||
mov r8=-1
|
||||
mov r9=256
|
||||
;;
|
||||
cmp.gtu p6,p7=r9,r28 /* r28 <= 255? */
|
||||
(p6) br.cond.sptk.few static
|
||||
;;
|
||||
mov r9=512
|
||||
;;
|
||||
cmp.gtu p6,p7=r9,r28
|
||||
(p6) br.cond.sptk.few stacked
|
||||
;;
|
||||
static: cmp.eq p6,p7=PAL_PTCE_INFO,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
;;
|
||||
mov r8=0 /* status = 0 */
|
||||
movl r9=0x100000000 /* tc.base */
|
||||
movl r10=0x0000000200000003 /* count[0], count[1] */
|
||||
movl r11=0x1000000000002000 /* stride[0], stride[1] */
|
||||
br.cond.sptk.few rp
|
||||
1: cmp.eq p6,p7=PAL_FREQ_RATIOS,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r8=0 /* status = 0 */
|
||||
movl r9 =0x100000064 /* proc_ratio (1/100) */
|
||||
movl r10=0x100000100 /* bus_ratio<<32 (1/256) */
|
||||
movl r11=0x100000064 /* itc_ratio<<32 (1/100) */
|
||||
;;
|
||||
1: cmp.eq p6,p7=PAL_RSE_INFO,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r8=0 /* status = 0 */
|
||||
mov r9=96 /* num phys stacked */
|
||||
mov r10=0 /* hints */
|
||||
mov r11=0
|
||||
br.cond.sptk.few rp
|
||||
1: cmp.eq p6,p7=PAL_CACHE_FLUSH,r28 /* PAL_CACHE_FLUSH */
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r9=ar.lc
|
||||
movl r8=524288 /* flush 512k million cache lines (16MB) */
|
||||
;;
|
||||
mov ar.lc=r8
|
||||
movl r8=0xe000000000000000
|
||||
;;
|
||||
.loop: fc r8
|
||||
add r8=32,r8
|
||||
br.cloop.sptk.few .loop
|
||||
sync.i
|
||||
;;
|
||||
srlz.i
|
||||
;;
|
||||
mov ar.lc=r9
|
||||
mov r8=r0
|
||||
;;
|
||||
1: cmp.eq p6,p7=PAL_PERF_MON_INFO,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r8=0 /* status = 0 */
|
||||
movl r9 =0x08122f04 /* generic=4 width=47 retired=8 cycles=18 */
|
||||
mov r10=0 /* reserved */
|
||||
mov r11=0 /* reserved */
|
||||
mov r16=0xffff /* implemented PMC */
|
||||
mov r17=0x3ffff /* implemented PMD */
|
||||
add r18=8,r29 /* second index */
|
||||
;;
|
||||
st8 [r29]=r16,16 /* store implemented PMC */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
st8 [r29]=r0,16 /* clear remaining bits */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
st8 [r29]=r17,16 /* store implemented PMD */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
mov r16=0xf0 /* cycles count capable PMC */
|
||||
;;
|
||||
st8 [r29]=r0,16 /* clear remaining bits */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
mov r17=0xf0 /* retired bundles capable PMC */
|
||||
;;
|
||||
st8 [r29]=r16,16 /* store cycles capable */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
st8 [r29]=r0,16 /* clear remaining bits */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
st8 [r29]=r17,16 /* store retired bundle capable */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
st8 [r29]=r0,16 /* clear remaining bits */
|
||||
st8 [r18]=r0,16 /* clear remaining bits */
|
||||
;;
|
||||
1: cmp.eq p6,p7=PAL_VM_SUMMARY,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r8=0 /* status = 0 */
|
||||
movl r9=0x2044040020F1865 /* num_tc_levels=2, num_unique_tcs=4 */
|
||||
/* max_itr_entry=64, max_dtr_entry=64 */
|
||||
/* hash_tag_id=2, max_pkr=15 */
|
||||
/* key_size=24, phys_add_size=50, vw=1 */
|
||||
movl r10=0x183C /* rid_size=24, impl_va_msb=60 */
|
||||
;;
|
||||
1: cmp.eq p6,p7=PAL_MEM_ATTRIB,r28
|
||||
(p7) br.cond.sptk.few 1f
|
||||
mov r8=0 /* status = 0 */
|
||||
mov r9=0x80|0x01 /* NatPage|WB */
|
||||
;;
|
||||
1: br.cond.sptk.few rp
|
||||
stacked:
|
||||
br.ret.sptk.few rp
|
||||
END(pal_emulator_static)
|
174
arch/ia64/hp/sim/boot/bootloader.c
Normal file
174
arch/ia64/hp/sim/boot/bootloader.c
Normal file
|
@ -0,0 +1,174 @@
|
|||
/*
|
||||
* arch/ia64/hp/sim/boot/bootloader.c
|
||||
*
|
||||
* Loads an ELF kernel.
|
||||
*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
*
|
||||
* 01/07/99 S.Eranian modified to pass command line arguments to kernel
|
||||
*/
|
||||
struct task_struct; /* forward declaration for elf.h */
|
||||
|
||||
#include <linux/elf.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#include <asm/elf.h>
|
||||
#include <asm/intrinsics.h>
|
||||
#include <asm/pal.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/sal.h>
|
||||
|
||||
#include "ssc.h"
|
||||
|
||||
struct disk_req {
|
||||
unsigned long addr;
|
||||
unsigned len;
|
||||
};
|
||||
|
||||
struct disk_stat {
|
||||
int fd;
|
||||
unsigned count;
|
||||
};
|
||||
|
||||
extern void jmp_to_kernel (unsigned long bp, unsigned long e_entry);
|
||||
extern struct ia64_boot_param *sys_fw_init (const char *args, int arglen);
|
||||
extern void debug_break (void);
|
||||
|
||||
static void
|
||||
cons_write (const char *buf)
|
||||
{
|
||||
unsigned long ch;
|
||||
|
||||
while ((ch = *buf++) != '\0') {
|
||||
ssc(ch, 0, 0, 0, SSC_PUTCHAR);
|
||||
if (ch == '\n')
|
||||
ssc('\r', 0, 0, 0, SSC_PUTCHAR);
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_ARGS 32
|
||||
|
||||
void
|
||||
start_bootloader (void)
|
||||
{
|
||||
static char mem[4096];
|
||||
static char buffer[1024];
|
||||
unsigned long off;
|
||||
int fd, i;
|
||||
struct disk_req req;
|
||||
struct disk_stat stat;
|
||||
struct elfhdr *elf;
|
||||
struct elf_phdr *elf_phdr; /* program header */
|
||||
unsigned long e_entry, e_phoff, e_phnum;
|
||||
register struct ia64_boot_param *bp;
|
||||
char *kpath, *args;
|
||||
long arglen = 0;
|
||||
|
||||
ssc(0, 0, 0, 0, SSC_CONSOLE_INIT);
|
||||
|
||||
/*
|
||||
* S.Eranian: extract the commandline argument from the simulator
|
||||
*
|
||||
* The expected format is as follows:
|
||||
*
|
||||
* kernelname args...
|
||||
*
|
||||
* Both are optional but you can't have the second one without the first.
|
||||
*/
|
||||
arglen = ssc((long) buffer, 0, 0, 0, SSC_GET_ARGS);
|
||||
|
||||
kpath = "vmlinux";
|
||||
args = buffer;
|
||||
if (arglen > 0) {
|
||||
kpath = buffer;
|
||||
while (*args != ' ' && *args != '\0')
|
||||
++args, --arglen;
|
||||
if (*args == ' ')
|
||||
*args++ = '\0', --arglen;
|
||||
}
|
||||
|
||||
if (arglen <= 0) {
|
||||
args = "";
|
||||
arglen = 1;
|
||||
}
|
||||
|
||||
fd = ssc((long) kpath, 1, 0, 0, SSC_OPEN);
|
||||
|
||||
if (fd < 0) {
|
||||
cons_write(kpath);
|
||||
cons_write(": file not found, reboot now\n");
|
||||
for(;;);
|
||||
}
|
||||
stat.fd = fd;
|
||||
off = 0;
|
||||
|
||||
req.len = sizeof(mem);
|
||||
req.addr = (long) mem;
|
||||
ssc(fd, 1, (long) &req, off, SSC_READ);
|
||||
ssc((long) &stat, 0, 0, 0, SSC_WAIT_COMPLETION);
|
||||
|
||||
elf = (struct elfhdr *) mem;
|
||||
if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) != 0) {
|
||||
cons_write("not an ELF file\n");
|
||||
return;
|
||||
}
|
||||
if (elf->e_type != ET_EXEC) {
|
||||
cons_write("not an ELF executable\n");
|
||||
return;
|
||||
}
|
||||
if (!elf_check_arch(elf)) {
|
||||
cons_write("kernel not for this processor\n");
|
||||
return;
|
||||
}
|
||||
|
||||
e_entry = elf->e_entry;
|
||||
e_phnum = elf->e_phnum;
|
||||
e_phoff = elf->e_phoff;
|
||||
|
||||
cons_write("loading ");
|
||||
cons_write(kpath);
|
||||
cons_write("...\n");
|
||||
|
||||
for (i = 0; i < e_phnum; ++i) {
|
||||
req.len = sizeof(*elf_phdr);
|
||||
req.addr = (long) mem;
|
||||
ssc(fd, 1, (long) &req, e_phoff, SSC_READ);
|
||||
ssc((long) &stat, 0, 0, 0, SSC_WAIT_COMPLETION);
|
||||
if (stat.count != sizeof(*elf_phdr)) {
|
||||
cons_write("failed to read phdr\n");
|
||||
return;
|
||||
}
|
||||
e_phoff += sizeof(*elf_phdr);
|
||||
|
||||
elf_phdr = (struct elf_phdr *) mem;
|
||||
|
||||
if (elf_phdr->p_type != PT_LOAD)
|
||||
continue;
|
||||
|
||||
req.len = elf_phdr->p_filesz;
|
||||
req.addr = __pa(elf_phdr->p_paddr);
|
||||
ssc(fd, 1, (long) &req, elf_phdr->p_offset, SSC_READ);
|
||||
ssc((long) &stat, 0, 0, 0, SSC_WAIT_COMPLETION);
|
||||
memset((char *)__pa(elf_phdr->p_paddr) + elf_phdr->p_filesz, 0,
|
||||
elf_phdr->p_memsz - elf_phdr->p_filesz);
|
||||
}
|
||||
ssc(fd, 0, 0, 0, SSC_CLOSE);
|
||||
|
||||
cons_write("starting kernel...\n");
|
||||
|
||||
/* fake an I/O base address: */
|
||||
ia64_setreg(_IA64_REG_AR_KR0, 0xffffc000000UL);
|
||||
|
||||
bp = sys_fw_init(args, arglen);
|
||||
|
||||
ssc(0, (long) kpath, 0, 0, SSC_LOAD_SYMBOLS);
|
||||
|
||||
debug_break();
|
||||
jmp_to_kernel((unsigned long) bp, e_entry);
|
||||
|
||||
cons_write("kernel returned!\n");
|
||||
ssc(-1, 0, 0, 0, SSC_EXIT);
|
||||
}
|
66
arch/ia64/hp/sim/boot/bootloader.lds
Normal file
66
arch/ia64/hp/sim/boot/bootloader.lds
Normal file
|
@ -0,0 +1,66 @@
|
|||
OUTPUT_FORMAT("elf64-ia64-little")
|
||||
OUTPUT_ARCH(ia64)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
. = 0x100000;
|
||||
|
||||
_text = .;
|
||||
.text : { *(__ivt_section) *(.text) }
|
||||
_etext = .;
|
||||
|
||||
/* Global data */
|
||||
_data = .;
|
||||
.rodata : { *(.rodata) *(.rodata.*) }
|
||||
.data : { *(.data) *(.gnu.linkonce.d*) CONSTRUCTORS }
|
||||
__gp = ALIGN (8) + 0x200000;
|
||||
.got : { *(.got.plt) *(.got) }
|
||||
/* We want the small data sections together, so single-instruction offsets
|
||||
can access them all, and initialized data all before uninitialized, so
|
||||
we can shorten the on-disk segment size. */
|
||||
.sdata : { *(.sdata) }
|
||||
_edata = .;
|
||||
|
||||
__bss_start = .;
|
||||
.sbss : { *(.sbss) *(.scommon) }
|
||||
.bss : { *(.bss) *(COMMON) }
|
||||
. = ALIGN(64 / 8);
|
||||
__bss_stop = .;
|
||||
_end = . ;
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/* These must appear regardless of . */
|
||||
}
|
373
arch/ia64/hp/sim/boot/fw-emu.c
Normal file
373
arch/ia64/hp/sim/boot/fw-emu.c
Normal file
|
@ -0,0 +1,373 @@
|
|||
/*
|
||||
* PAL & SAL emulation.
|
||||
*
|
||||
* Copyright (C) 1998-2001 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
# include <linux/pci.h>
|
||||
#endif
|
||||
|
||||
#include <linux/efi.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/pal.h>
|
||||
#include <asm/sal.h>
|
||||
#include <asm/setup.h>
|
||||
|
||||
#include "ssc.h"
|
||||
|
||||
#define MB (1024*1024UL)
|
||||
|
||||
#define SIMPLE_MEMMAP 1
|
||||
|
||||
#if SIMPLE_MEMMAP
|
||||
# define NUM_MEM_DESCS 4
|
||||
#else
|
||||
# define NUM_MEM_DESCS 16
|
||||
#endif
|
||||
|
||||
static char fw_mem[( sizeof(struct ia64_boot_param)
|
||||
+ sizeof(efi_system_table_t)
|
||||
+ sizeof(efi_runtime_services_t)
|
||||
+ 1*sizeof(efi_config_table_t)
|
||||
+ sizeof(struct ia64_sal_systab)
|
||||
+ sizeof(struct ia64_sal_desc_entry_point)
|
||||
+ NUM_MEM_DESCS*(sizeof(efi_memory_desc_t))
|
||||
+ 1024)] __attribute__ ((aligned (8)));
|
||||
|
||||
#define SECS_PER_HOUR (60 * 60)
|
||||
#define SECS_PER_DAY (SECS_PER_HOUR * 24)
|
||||
|
||||
/* Compute the `struct tm' representation of *T,
|
||||
offset OFFSET seconds east of UTC,
|
||||
and store year, yday, mon, mday, wday, hour, min, sec into *TP.
|
||||
Return nonzero if successful. */
|
||||
int
|
||||
offtime (unsigned long t, efi_time_t *tp)
|
||||
{
|
||||
const unsigned short int __mon_yday[2][13] =
|
||||
{
|
||||
/* Normal years. */
|
||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
/* Leap years. */
|
||||
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
long int days, rem, y;
|
||||
const unsigned short int *ip;
|
||||
|
||||
days = t / SECS_PER_DAY;
|
||||
rem = t % SECS_PER_DAY;
|
||||
while (rem < 0) {
|
||||
rem += SECS_PER_DAY;
|
||||
--days;
|
||||
}
|
||||
while (rem >= SECS_PER_DAY) {
|
||||
rem -= SECS_PER_DAY;
|
||||
++days;
|
||||
}
|
||||
tp->hour = rem / SECS_PER_HOUR;
|
||||
rem %= SECS_PER_HOUR;
|
||||
tp->minute = rem / 60;
|
||||
tp->second = rem % 60;
|
||||
/* January 1, 1970 was a Thursday. */
|
||||
y = 1970;
|
||||
|
||||
# define DIV(a, b) ((a) / (b) - ((a) % (b) < 0))
|
||||
# define LEAPS_THRU_END_OF(y) (DIV (y, 4) - DIV (y, 100) + DIV (y, 400))
|
||||
# define __isleap(year) \
|
||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||
|
||||
while (days < 0 || days >= (__isleap (y) ? 366 : 365)) {
|
||||
/* Guess a corrected year, assuming 365 days per year. */
|
||||
long int yg = y + days / 365 - (days % 365 < 0);
|
||||
|
||||
/* Adjust DAYS and Y to match the guessed year. */
|
||||
days -= ((yg - y) * 365 + LEAPS_THRU_END_OF (yg - 1)
|
||||
- LEAPS_THRU_END_OF (y - 1));
|
||||
y = yg;
|
||||
}
|
||||
tp->year = y;
|
||||
ip = __mon_yday[__isleap(y)];
|
||||
for (y = 11; days < (long int) ip[y]; --y)
|
||||
continue;
|
||||
days -= ip[y];
|
||||
tp->month = y + 1;
|
||||
tp->day = days + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern void pal_emulator_static (void);
|
||||
|
||||
/* Macro to emulate SAL call using legacy IN and OUT calls to CF8, CFC etc.. */
|
||||
|
||||
#define BUILD_CMD(addr) ((0x80000000 | (addr)) & ~3)
|
||||
|
||||
#define REG_OFFSET(addr) (0x00000000000000FF & (addr))
|
||||
#define DEVICE_FUNCTION(addr) (0x000000000000FF00 & (addr))
|
||||
#define BUS_NUMBER(addr) (0x0000000000FF0000 & (addr))
|
||||
|
||||
static efi_status_t
|
||||
fw_efi_get_time (efi_time_t *tm, efi_time_cap_t *tc)
|
||||
{
|
||||
#if defined(CONFIG_IA64_HP_SIM) || defined(CONFIG_IA64_GENERIC)
|
||||
struct {
|
||||
int tv_sec; /* must be 32bits to work */
|
||||
int tv_usec;
|
||||
} tv32bits;
|
||||
|
||||
ssc((unsigned long) &tv32bits, 0, 0, 0, SSC_GET_TOD);
|
||||
|
||||
memset(tm, 0, sizeof(*tm));
|
||||
offtime(tv32bits.tv_sec, tm);
|
||||
|
||||
if (tc)
|
||||
memset(tc, 0, sizeof(*tc));
|
||||
#else
|
||||
# error Not implemented yet...
|
||||
#endif
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
efi_reset_system (int reset_type, efi_status_t status, unsigned long data_size, efi_char16_t *data)
|
||||
{
|
||||
#if defined(CONFIG_IA64_HP_SIM) || defined(CONFIG_IA64_GENERIC)
|
||||
ssc(status, 0, 0, 0, SSC_EXIT);
|
||||
#else
|
||||
# error Not implemented yet...
|
||||
#endif
|
||||
}
|
||||
|
||||
static efi_status_t
|
||||
efi_unimplemented (void)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static struct sal_ret_values
|
||||
sal_emulator (long index, unsigned long in1, unsigned long in2,
|
||||
unsigned long in3, unsigned long in4, unsigned long in5,
|
||||
unsigned long in6, unsigned long in7)
|
||||
{
|
||||
long r9 = 0;
|
||||
long r10 = 0;
|
||||
long r11 = 0;
|
||||
long status;
|
||||
|
||||
/*
|
||||
* Don't do a "switch" here since that gives us code that
|
||||
* isn't self-relocatable.
|
||||
*/
|
||||
status = 0;
|
||||
if (index == SAL_FREQ_BASE) {
|
||||
if (in1 == SAL_FREQ_BASE_PLATFORM)
|
||||
r9 = 200000000;
|
||||
else if (in1 == SAL_FREQ_BASE_INTERVAL_TIMER) {
|
||||
/*
|
||||
* Is this supposed to be the cr.itc frequency
|
||||
* or something platform specific? The SAL
|
||||
* doc ain't exactly clear on this...
|
||||
*/
|
||||
r9 = 700000000;
|
||||
} else if (in1 == SAL_FREQ_BASE_REALTIME_CLOCK)
|
||||
r9 = 1;
|
||||
else
|
||||
status = -1;
|
||||
} else if (index == SAL_SET_VECTORS) {
|
||||
;
|
||||
} else if (index == SAL_GET_STATE_INFO) {
|
||||
;
|
||||
} else if (index == SAL_GET_STATE_INFO_SIZE) {
|
||||
;
|
||||
} else if (index == SAL_CLEAR_STATE_INFO) {
|
||||
;
|
||||
} else if (index == SAL_MC_RENDEZ) {
|
||||
;
|
||||
} else if (index == SAL_MC_SET_PARAMS) {
|
||||
;
|
||||
} else if (index == SAL_CACHE_FLUSH) {
|
||||
;
|
||||
} else if (index == SAL_CACHE_INIT) {
|
||||
;
|
||||
#ifdef CONFIG_PCI
|
||||
} else if (index == SAL_PCI_CONFIG_READ) {
|
||||
/*
|
||||
* in1 contains the PCI configuration address and in2
|
||||
* the size of the read. The value that is read is
|
||||
* returned via the general register r9.
|
||||
*/
|
||||
outl(BUILD_CMD(in1), 0xCF8);
|
||||
if (in2 == 1) /* Reading byte */
|
||||
r9 = inb(0xCFC + ((REG_OFFSET(in1) & 3)));
|
||||
else if (in2 == 2) /* Reading word */
|
||||
r9 = inw(0xCFC + ((REG_OFFSET(in1) & 2)));
|
||||
else /* Reading dword */
|
||||
r9 = inl(0xCFC);
|
||||
status = PCIBIOS_SUCCESSFUL;
|
||||
} else if (index == SAL_PCI_CONFIG_WRITE) {
|
||||
/*
|
||||
* in1 contains the PCI configuration address, in2 the
|
||||
* size of the write, and in3 the actual value to be
|
||||
* written out.
|
||||
*/
|
||||
outl(BUILD_CMD(in1), 0xCF8);
|
||||
if (in2 == 1) /* Writing byte */
|
||||
outb(in3, 0xCFC + ((REG_OFFSET(in1) & 3)));
|
||||
else if (in2 == 2) /* Writing word */
|
||||
outw(in3, 0xCFC + ((REG_OFFSET(in1) & 2)));
|
||||
else /* Writing dword */
|
||||
outl(in3, 0xCFC);
|
||||
status = PCIBIOS_SUCCESSFUL;
|
||||
#endif /* CONFIG_PCI */
|
||||
} else if (index == SAL_UPDATE_PAL) {
|
||||
;
|
||||
} else {
|
||||
status = -1;
|
||||
}
|
||||
return ((struct sal_ret_values) {status, r9, r10, r11});
|
||||
}
|
||||
|
||||
struct ia64_boot_param *
|
||||
sys_fw_init (const char *args, int arglen)
|
||||
{
|
||||
efi_system_table_t *efi_systab;
|
||||
efi_runtime_services_t *efi_runtime;
|
||||
efi_config_table_t *efi_tables;
|
||||
struct ia64_sal_systab *sal_systab;
|
||||
efi_memory_desc_t *efi_memmap, *md;
|
||||
unsigned long *pal_desc, *sal_desc;
|
||||
struct ia64_sal_desc_entry_point *sal_ed;
|
||||
struct ia64_boot_param *bp;
|
||||
unsigned char checksum = 0;
|
||||
char *cp, *cmd_line;
|
||||
int i = 0;
|
||||
# define MAKE_MD(typ, attr, start, end) \
|
||||
do { \
|
||||
md = efi_memmap + i++; \
|
||||
md->type = typ; \
|
||||
md->pad = 0; \
|
||||
md->phys_addr = start; \
|
||||
md->virt_addr = 0; \
|
||||
md->num_pages = (end - start) >> 12; \
|
||||
md->attribute = attr; \
|
||||
} while (0)
|
||||
|
||||
memset(fw_mem, 0, sizeof(fw_mem));
|
||||
|
||||
pal_desc = (unsigned long *) &pal_emulator_static;
|
||||
sal_desc = (unsigned long *) &sal_emulator;
|
||||
|
||||
cp = fw_mem;
|
||||
efi_systab = (void *) cp; cp += sizeof(*efi_systab);
|
||||
efi_runtime = (void *) cp; cp += sizeof(*efi_runtime);
|
||||
efi_tables = (void *) cp; cp += sizeof(*efi_tables);
|
||||
sal_systab = (void *) cp; cp += sizeof(*sal_systab);
|
||||
sal_ed = (void *) cp; cp += sizeof(*sal_ed);
|
||||
efi_memmap = (void *) cp; cp += NUM_MEM_DESCS*sizeof(*efi_memmap);
|
||||
bp = (void *) cp; cp += sizeof(*bp);
|
||||
cmd_line = (void *) cp;
|
||||
|
||||
if (args) {
|
||||
if (arglen >= 1024)
|
||||
arglen = 1023;
|
||||
memcpy(cmd_line, args, arglen);
|
||||
} else {
|
||||
arglen = 0;
|
||||
}
|
||||
cmd_line[arglen] = '\0';
|
||||
|
||||
memset(efi_systab, 0, sizeof(*efi_systab));
|
||||
efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE;
|
||||
efi_systab->hdr.revision = ((1 << 16) | 00);
|
||||
efi_systab->hdr.headersize = sizeof(efi_systab->hdr);
|
||||
efi_systab->fw_vendor = __pa("H\0e\0w\0l\0e\0t\0t\0-\0P\0a\0c\0k\0a\0r\0d\0\0");
|
||||
efi_systab->fw_revision = 1;
|
||||
efi_systab->runtime = (void *) __pa(efi_runtime);
|
||||
efi_systab->nr_tables = 1;
|
||||
efi_systab->tables = __pa(efi_tables);
|
||||
|
||||
efi_runtime->hdr.signature = EFI_RUNTIME_SERVICES_SIGNATURE;
|
||||
efi_runtime->hdr.revision = EFI_RUNTIME_SERVICES_REVISION;
|
||||
efi_runtime->hdr.headersize = sizeof(efi_runtime->hdr);
|
||||
efi_runtime->get_time = (void *)__pa(&fw_efi_get_time);
|
||||
efi_runtime->set_time = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->get_wakeup_time = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->set_wakeup_time = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->set_virtual_address_map = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->get_variable = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->get_next_variable = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->set_variable = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->get_next_high_mono_count = (void *)__pa(&efi_unimplemented);
|
||||
efi_runtime->reset_system = (void *)__pa(&efi_reset_system);
|
||||
|
||||
efi_tables->guid = SAL_SYSTEM_TABLE_GUID;
|
||||
efi_tables->table = __pa(sal_systab);
|
||||
|
||||
/* fill in the SAL system table: */
|
||||
memcpy(sal_systab->signature, "SST_", 4);
|
||||
sal_systab->size = sizeof(*sal_systab);
|
||||
sal_systab->sal_rev_minor = 1;
|
||||
sal_systab->sal_rev_major = 0;
|
||||
sal_systab->entry_count = 1;
|
||||
|
||||
#ifdef CONFIG_IA64_GENERIC
|
||||
strcpy(sal_systab->oem_id, "Generic");
|
||||
strcpy(sal_systab->product_id, "IA-64 system");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IA64_HP_SIM
|
||||
strcpy(sal_systab->oem_id, "Hewlett-Packard");
|
||||
strcpy(sal_systab->product_id, "HP-simulator");
|
||||
#endif
|
||||
|
||||
/* fill in an entry point: */
|
||||
sal_ed->type = SAL_DESC_ENTRY_POINT;
|
||||
sal_ed->pal_proc = __pa(pal_desc[0]);
|
||||
sal_ed->sal_proc = __pa(sal_desc[0]);
|
||||
sal_ed->gp = __pa(sal_desc[1]);
|
||||
|
||||
for (cp = (char *) sal_systab; cp < (char *) efi_memmap; ++cp)
|
||||
checksum += *cp;
|
||||
|
||||
sal_systab->checksum = -checksum;
|
||||
|
||||
#if SIMPLE_MEMMAP
|
||||
/* simulate free memory at physical address zero */
|
||||
MAKE_MD(EFI_BOOT_SERVICES_DATA, EFI_MEMORY_WB, 0*MB, 1*MB);
|
||||
MAKE_MD(EFI_PAL_CODE, EFI_MEMORY_WB, 1*MB, 2*MB);
|
||||
MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 2*MB, 130*MB);
|
||||
MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 4096*MB, 4128*MB);
|
||||
#else
|
||||
MAKE_MD( 4, 0x9, 0x0000000000000000, 0x0000000000001000);
|
||||
MAKE_MD( 7, 0x9, 0x0000000000001000, 0x000000000008a000);
|
||||
MAKE_MD( 4, 0x9, 0x000000000008a000, 0x00000000000a0000);
|
||||
MAKE_MD( 5, 0x8000000000000009, 0x00000000000c0000, 0x0000000000100000);
|
||||
MAKE_MD( 7, 0x9, 0x0000000000100000, 0x0000000004400000);
|
||||
MAKE_MD( 2, 0x9, 0x0000000004400000, 0x0000000004be5000);
|
||||
MAKE_MD( 7, 0x9, 0x0000000004be5000, 0x000000007f77e000);
|
||||
MAKE_MD( 6, 0x8000000000000009, 0x000000007f77e000, 0x000000007fb94000);
|
||||
MAKE_MD( 6, 0x8000000000000009, 0x000000007fb94000, 0x000000007fb95000);
|
||||
MAKE_MD( 6, 0x8000000000000009, 0x000000007fb95000, 0x000000007fc00000);
|
||||
MAKE_MD(13, 0x8000000000000009, 0x000000007fc00000, 0x000000007fc3a000);
|
||||
MAKE_MD( 7, 0x9, 0x000000007fc3a000, 0x000000007fea0000);
|
||||
MAKE_MD( 5, 0x8000000000000009, 0x000000007fea0000, 0x000000007fea8000);
|
||||
MAKE_MD( 7, 0x9, 0x000000007fea8000, 0x000000007feab000);
|
||||
MAKE_MD( 5, 0x8000000000000009, 0x000000007feab000, 0x000000007ffff000);
|
||||
MAKE_MD( 7, 0x9, 0x00000000ff400000, 0x0000000104000000);
|
||||
#endif
|
||||
|
||||
bp->efi_systab = __pa(&fw_mem);
|
||||
bp->efi_memmap = __pa(efi_memmap);
|
||||
bp->efi_memmap_size = NUM_MEM_DESCS*sizeof(efi_memory_desc_t);
|
||||
bp->efi_memdesc_size = sizeof(efi_memory_desc_t);
|
||||
bp->efi_memdesc_version = 1;
|
||||
bp->command_line = __pa(cmd_line);
|
||||
bp->console_info.num_cols = 80;
|
||||
bp->console_info.num_rows = 25;
|
||||
bp->console_info.orig_x = 0;
|
||||
bp->console_info.orig_y = 24;
|
||||
bp->fpswa = 0;
|
||||
|
||||
return bp;
|
||||
}
|
35
arch/ia64/hp/sim/boot/ssc.h
Normal file
35
arch/ia64/hp/sim/boot/ssc.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
*/
|
||||
#ifndef ssc_h
|
||||
#define ssc_h
|
||||
|
||||
/* Simulator system calls: */
|
||||
|
||||
#define SSC_CONSOLE_INIT 20
|
||||
#define SSC_GETCHAR 21
|
||||
#define SSC_PUTCHAR 31
|
||||
#define SSC_OPEN 50
|
||||
#define SSC_CLOSE 51
|
||||
#define SSC_READ 52
|
||||
#define SSC_WRITE 53
|
||||
#define SSC_GET_COMPLETION 54
|
||||
#define SSC_WAIT_COMPLETION 55
|
||||
#define SSC_CONNECT_INTERRUPT 58
|
||||
#define SSC_GENERATE_INTERRUPT 59
|
||||
#define SSC_SET_PERIODIC_INTERRUPT 60
|
||||
#define SSC_GET_RTC 65
|
||||
#define SSC_EXIT 66
|
||||
#define SSC_LOAD_SYMBOLS 69
|
||||
#define SSC_GET_TOD 74
|
||||
|
||||
#define SSC_GET_ARGS 75
|
||||
|
||||
/*
|
||||
* Simulator system call.
|
||||
*/
|
||||
extern long ssc (long arg0, long arg1, long arg2, long arg3, int nr);
|
||||
|
||||
#endif /* ssc_h */
|
10
arch/ia64/hp/sim/hpsim.S
Normal file
10
arch/ia64/hp/sim/hpsim.S
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <asm/asmmacro.h>
|
||||
|
||||
/*
|
||||
* Simulator system call.
|
||||
*/
|
||||
GLOBAL_ENTRY(ia64_ssc)
|
||||
mov r15=r36
|
||||
break 0x80001
|
||||
br.ret.sptk.many rp
|
||||
END(ia64_ssc)
|
76
arch/ia64/hp/sim/hpsim_console.c
Normal file
76
arch/ia64/hp/sim/hpsim_console.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Platform dependent support for HP simulator.
|
||||
*
|
||||
* Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/param.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/console.h>
|
||||
|
||||
#include <asm/delay.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pal.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/sal.h>
|
||||
#include <asm/hpsim.h>
|
||||
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
static int simcons_init (struct console *, char *);
|
||||
static void simcons_write (struct console *, const char *, unsigned);
|
||||
static struct tty_driver *simcons_console_device (struct console *, int *);
|
||||
|
||||
static struct console hpsim_cons = {
|
||||
.name = "simcons",
|
||||
.write = simcons_write,
|
||||
.device = simcons_console_device,
|
||||
.setup = simcons_init,
|
||||
.flags = CON_PRINTBUFFER,
|
||||
.index = -1,
|
||||
};
|
||||
|
||||
static int
|
||||
simcons_init (struct console *cons, char *options)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
simcons_write (struct console *cons, const char *buf, unsigned count)
|
||||
{
|
||||
unsigned long ch;
|
||||
|
||||
while (count-- > 0) {
|
||||
ch = *buf++;
|
||||
ia64_ssc(ch, 0, 0, 0, SSC_PUTCHAR);
|
||||
if (ch == '\n')
|
||||
ia64_ssc('\r', 0, 0, 0, SSC_PUTCHAR);
|
||||
}
|
||||
}
|
||||
|
||||
static struct tty_driver *simcons_console_device (struct console *c, int *index)
|
||||
{
|
||||
*index = c->index;
|
||||
return hp_simserial_driver;
|
||||
}
|
||||
|
||||
int simcons_register(void)
|
||||
{
|
||||
if (!ia64_platform_is("hpsim"))
|
||||
return 1;
|
||||
|
||||
if (hpsim_cons.flags & CON_ENABLED)
|
||||
return 1;
|
||||
|
||||
register_console(&hpsim_cons);
|
||||
return 0;
|
||||
}
|
75
arch/ia64/hp/sim/hpsim_irq.c
Normal file
75
arch/ia64/hp/sim/hpsim_irq.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Platform dependent support for HP simulator.
|
||||
*
|
||||
* Copyright (C) 1998-2001 Hewlett-Packard Co
|
||||
* Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
static unsigned int
|
||||
hpsim_irq_startup(struct irq_data *data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
hpsim_irq_noop(struct irq_data *data)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
hpsim_set_affinity_noop(struct irq_data *d, const struct cpumask *b, bool f)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_chip irq_type_hp_sim = {
|
||||
.name = "hpsim",
|
||||
.irq_startup = hpsim_irq_startup,
|
||||
.irq_shutdown = hpsim_irq_noop,
|
||||
.irq_enable = hpsim_irq_noop,
|
||||
.irq_disable = hpsim_irq_noop,
|
||||
.irq_ack = hpsim_irq_noop,
|
||||
.irq_set_affinity = hpsim_set_affinity_noop,
|
||||
};
|
||||
|
||||
static void hpsim_irq_set_chip(int irq)
|
||||
{
|
||||
struct irq_chip *chip = irq_get_chip(irq);
|
||||
|
||||
if (chip == &no_irq_chip)
|
||||
irq_set_chip(irq, &irq_type_hp_sim);
|
||||
}
|
||||
|
||||
static void hpsim_connect_irq(int intr, int irq)
|
||||
{
|
||||
ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT);
|
||||
}
|
||||
|
||||
int hpsim_get_irq(int intr)
|
||||
{
|
||||
int irq = assign_irq_vector(AUTO_ASSIGN);
|
||||
|
||||
if (irq >= 0) {
|
||||
hpsim_irq_set_chip(irq);
|
||||
irq_set_handler(irq, handle_simple_irq);
|
||||
hpsim_connect_irq(intr, irq);
|
||||
}
|
||||
|
||||
return irq;
|
||||
}
|
||||
|
||||
void __init
|
||||
hpsim_irq_init (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for_each_active_irq(i)
|
||||
hpsim_irq_set_chip(i);
|
||||
}
|
3
arch/ia64/hp/sim/hpsim_machvec.c
Normal file
3
arch/ia64/hp/sim/hpsim_machvec.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MACHVEC_PLATFORM_NAME hpsim
|
||||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_hpsim.h>
|
||||
#include <asm/machvec_init.h>
|
40
arch/ia64/hp/sim/hpsim_setup.c
Normal file
40
arch/ia64/hp/sim/hpsim_setup.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Platform dependent support for HP simulator.
|
||||
*
|
||||
* Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
|
||||
*/
|
||||
#include <linux/console.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/param.h>
|
||||
#include <linux/root_dev.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/delay.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pal.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/sal.h>
|
||||
#include <asm/hpsim.h>
|
||||
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
void
|
||||
ia64_ctl_trace (long on)
|
||||
{
|
||||
ia64_ssc(on, 0, 0, 0, SSC_CTL_TRACE);
|
||||
}
|
||||
|
||||
void __init
|
||||
hpsim_setup (char **cmdline_p)
|
||||
{
|
||||
ROOT_DEV = Root_SDA1; /* default to first SCSI drive */
|
||||
|
||||
simcons_register();
|
||||
}
|
36
arch/ia64/hp/sim/hpsim_ssc.h
Normal file
36
arch/ia64/hp/sim/hpsim_ssc.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Platform dependent support for HP simulator.
|
||||
*
|
||||
* Copyright (C) 1998, 1999 Hewlett-Packard Co
|
||||
* Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
|
||||
*/
|
||||
#ifndef _IA64_PLATFORM_HPSIM_SSC_H
|
||||
#define _IA64_PLATFORM_HPSIM_SSC_H
|
||||
|
||||
/* Simulator system calls: */
|
||||
|
||||
#define SSC_CONSOLE_INIT 20
|
||||
#define SSC_GETCHAR 21
|
||||
#define SSC_PUTCHAR 31
|
||||
#define SSC_CONNECT_INTERRUPT 58
|
||||
#define SSC_GENERATE_INTERRUPT 59
|
||||
#define SSC_SET_PERIODIC_INTERRUPT 60
|
||||
#define SSC_GET_RTC 65
|
||||
#define SSC_EXIT 66
|
||||
#define SSC_LOAD_SYMBOLS 69
|
||||
#define SSC_GET_TOD 74
|
||||
#define SSC_CTL_TRACE 76
|
||||
|
||||
#define SSC_NETDEV_PROBE 100
|
||||
#define SSC_NETDEV_SEND 101
|
||||
#define SSC_NETDEV_RECV 102
|
||||
#define SSC_NETDEV_ATTACH 103
|
||||
#define SSC_NETDEV_DETACH 104
|
||||
|
||||
/*
|
||||
* Simulator system call.
|
||||
*/
|
||||
extern long ia64_ssc (long arg0, long arg1, long arg2, long arg3, int nr);
|
||||
|
||||
#endif /* _IA64_PLATFORM_HPSIM_SSC_H */
|
509
arch/ia64/hp/sim/simeth.c
Normal file
509
arch/ia64/hp/sim/simeth.c
Normal file
|
@ -0,0 +1,509 @@
|
|||
/*
|
||||
* Simulated Ethernet Driver
|
||||
*
|
||||
* Copyright (C) 1999-2001, 2003 Hewlett-Packard Co
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/inetdevice.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/hpsim.h>
|
||||
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
#define SIMETH_RECV_MAX 10
|
||||
|
||||
/*
|
||||
* Maximum possible received frame for Ethernet.
|
||||
* We preallocate an sk_buff of that size to avoid costly
|
||||
* memcpy for temporary buffer into sk_buff. We do basically
|
||||
* what's done in other drivers, like eepro with a ring.
|
||||
* The difference is, of course, that we don't have real DMA !!!
|
||||
*/
|
||||
#define SIMETH_FRAME_SIZE ETH_FRAME_LEN
|
||||
|
||||
|
||||
#define NETWORK_INTR 8
|
||||
|
||||
struct simeth_local {
|
||||
struct net_device_stats stats;
|
||||
int simfd; /* descriptor in the simulator */
|
||||
};
|
||||
|
||||
static int simeth_probe1(void);
|
||||
static int simeth_open(struct net_device *dev);
|
||||
static int simeth_close(struct net_device *dev);
|
||||
static int simeth_tx(struct sk_buff *skb, struct net_device *dev);
|
||||
static int simeth_rx(struct net_device *dev);
|
||||
static struct net_device_stats *simeth_get_stats(struct net_device *dev);
|
||||
static irqreturn_t simeth_interrupt(int irq, void *dev_id);
|
||||
static void set_multicast_list(struct net_device *dev);
|
||||
static int simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr);
|
||||
|
||||
static char *simeth_version="0.3";
|
||||
|
||||
/*
|
||||
* This variable is used to establish a mapping between the Linux/ia64 kernel
|
||||
* and the host linux kernel.
|
||||
*
|
||||
* As of today, we support only one card, even though most of the code
|
||||
* is ready for many more. The mapping is then:
|
||||
* linux/ia64 -> linux/x86
|
||||
* eth0 -> eth1
|
||||
*
|
||||
* In the future, we some string operations, we could easily support up
|
||||
* to 10 cards (0-9).
|
||||
*
|
||||
* The default mapping can be changed on the kernel command line by
|
||||
* specifying simeth=ethX (or whatever string you want).
|
||||
*/
|
||||
static char *simeth_device="eth0"; /* default host interface to use */
|
||||
|
||||
|
||||
|
||||
static volatile unsigned int card_count; /* how many cards "found" so far */
|
||||
static int simeth_debug; /* set to 1 to get debug information */
|
||||
|
||||
/*
|
||||
* Used to catch IFF_UP & IFF_DOWN events
|
||||
*/
|
||||
static struct notifier_block simeth_dev_notifier = {
|
||||
simeth_device_event,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Function used when using a kernel command line option.
|
||||
*
|
||||
* Format: simeth=interface_name (like eth0)
|
||||
*/
|
||||
static int __init
|
||||
simeth_setup(char *str)
|
||||
{
|
||||
simeth_device = str;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("simeth=", simeth_setup);
|
||||
|
||||
/*
|
||||
* Function used to probe for simeth devices when not installed
|
||||
* as a loadable module
|
||||
*/
|
||||
|
||||
int __init
|
||||
simeth_probe (void)
|
||||
{
|
||||
int r;
|
||||
|
||||
printk(KERN_INFO "simeth: v%s\n", simeth_version);
|
||||
|
||||
r = simeth_probe1();
|
||||
|
||||
if (r == 0) register_netdevice_notifier(&simeth_dev_notifier);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline int
|
||||
netdev_probe(char *name, unsigned char *ether)
|
||||
{
|
||||
return ia64_ssc(__pa(name), __pa(ether), 0,0, SSC_NETDEV_PROBE);
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
netdev_attach(int fd, int irq, unsigned int ipaddr)
|
||||
{
|
||||
/* this puts the host interface in the right mode (start interrupting) */
|
||||
return ia64_ssc(fd, ipaddr, 0,0, SSC_NETDEV_ATTACH);
|
||||
}
|
||||
|
||||
|
||||
static inline int
|
||||
netdev_detach(int fd)
|
||||
{
|
||||
/*
|
||||
* inactivate the host interface (don't interrupt anymore) */
|
||||
return ia64_ssc(fd, 0,0,0, SSC_NETDEV_DETACH);
|
||||
}
|
||||
|
||||
static inline int
|
||||
netdev_send(int fd, unsigned char *buf, unsigned int len)
|
||||
{
|
||||
return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_SEND);
|
||||
}
|
||||
|
||||
static inline int
|
||||
netdev_read(int fd, unsigned char *buf, unsigned int len)
|
||||
{
|
||||
return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_RECV);
|
||||
}
|
||||
|
||||
static const struct net_device_ops simeth_netdev_ops = {
|
||||
.ndo_open = simeth_open,
|
||||
.ndo_stop = simeth_close,
|
||||
.ndo_start_xmit = simeth_tx,
|
||||
.ndo_get_stats = simeth_get_stats,
|
||||
.ndo_set_rx_mode = set_multicast_list, /* not yet used */
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* Function shared with module code, so cannot be in init section
|
||||
*
|
||||
* So far this function "detects" only one card (test_&_set) but could
|
||||
* be extended easily.
|
||||
*
|
||||
* Return:
|
||||
* - -ENODEV is no device found
|
||||
* - -ENOMEM is no more memory
|
||||
* - 0 otherwise
|
||||
*/
|
||||
static int
|
||||
simeth_probe1(void)
|
||||
{
|
||||
unsigned char mac_addr[ETH_ALEN];
|
||||
struct simeth_local *local;
|
||||
struct net_device *dev;
|
||||
int fd, err, rc;
|
||||
|
||||
/*
|
||||
* XXX Fix me
|
||||
* let's support just one card for now
|
||||
*/
|
||||
if (test_and_set_bit(0, &card_count))
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* check with the simulator for the device
|
||||
*/
|
||||
fd = netdev_probe(simeth_device, mac_addr);
|
||||
if (fd == -1)
|
||||
return -ENODEV;
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct simeth_local));
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr));
|
||||
|
||||
local = netdev_priv(dev);
|
||||
local->simfd = fd; /* keep track of underlying file descriptor */
|
||||
|
||||
dev->netdev_ops = &simeth_netdev_ops;
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
free_netdev(dev);
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* attach the interrupt in the simulator, this does enable interrupts
|
||||
* until a netdev_attach() is called
|
||||
*/
|
||||
if ((rc = hpsim_get_irq(NETWORK_INTR)) < 0)
|
||||
panic("%s: out of interrupt vectors!\n", __func__);
|
||||
dev->irq = rc;
|
||||
|
||||
printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr=%pm, IRQ %d\n",
|
||||
dev->name, simeth_device, local->simfd, dev->dev_addr, dev->irq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* actually binds the device to an interrupt vector
|
||||
*/
|
||||
static int
|
||||
simeth_open(struct net_device *dev)
|
||||
{
|
||||
if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) {
|
||||
printk(KERN_WARNING "simeth: unable to get IRQ %d.\n", dev->irq);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
netif_start_queue(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* copied from lapbether.c */
|
||||
static __inline__ int dev_is_ethdev(struct net_device *dev)
|
||||
{
|
||||
return ( dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handler for IFF_UP or IFF_DOWN
|
||||
*
|
||||
* The reason for that is that we don't want to be interrupted when the
|
||||
* interface is down. There is no way to unconnect in the simualtor. Instead
|
||||
* we use this function to shutdown packet processing in the frame filter
|
||||
* in the simulator. Thus no interrupts are generated
|
||||
*
|
||||
*
|
||||
* That's also the place where we pass the IP address of this device to the
|
||||
* simulator so that that we can start filtering packets for it
|
||||
*
|
||||
* There may be a better way of doing this, but I don't know which yet.
|
||||
*/
|
||||
static int
|
||||
simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
struct simeth_local *local;
|
||||
struct in_device *in_dev;
|
||||
struct in_ifaddr **ifap = NULL;
|
||||
struct in_ifaddr *ifa = NULL;
|
||||
int r;
|
||||
|
||||
|
||||
if ( ! dev ) {
|
||||
printk(KERN_WARNING "simeth_device_event dev=0\n");
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
if (dev_net(dev) != &init_net)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
if ( event != NETDEV_UP && event != NETDEV_DOWN ) return NOTIFY_DONE;
|
||||
|
||||
/*
|
||||
* Check whether or not it's for an ethernet device
|
||||
*
|
||||
* XXX Fixme: This works only as long as we support one
|
||||
* type of ethernet device.
|
||||
*/
|
||||
if ( !dev_is_ethdev(dev) ) return NOTIFY_DONE;
|
||||
|
||||
if ((in_dev=dev->ip_ptr) != NULL) {
|
||||
for (ifap=&in_dev->ifa_list; (ifa=*ifap) != NULL; ifap=&ifa->ifa_next)
|
||||
if (strcmp(dev->name, ifa->ifa_label) == 0) break;
|
||||
}
|
||||
if ( ifa == NULL ) {
|
||||
printk(KERN_ERR "simeth_open: can't find device %s's ifa\n", dev->name);
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "simeth_device_event: %s ipaddr=0x%x\n",
|
||||
dev->name, ntohl(ifa->ifa_local));
|
||||
|
||||
/*
|
||||
* XXX Fix me
|
||||
* if the device was up, and we're simply reconfiguring it, not sure
|
||||
* we get DOWN then UP.
|
||||
*/
|
||||
|
||||
local = netdev_priv(dev);
|
||||
/* now do it for real */
|
||||
r = event == NETDEV_UP ?
|
||||
netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)):
|
||||
netdev_detach(local->simfd);
|
||||
|
||||
printk(KERN_INFO "simeth: netdev_attach/detach: event=%s ->%d\n",
|
||||
event == NETDEV_UP ? "attach":"detach", r);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static int
|
||||
simeth_close(struct net_device *dev)
|
||||
{
|
||||
netif_stop_queue(dev);
|
||||
|
||||
free_irq(dev->irq, dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only used for debug
|
||||
*/
|
||||
static void
|
||||
frame_print(unsigned char *from, unsigned char *frame, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
printk("%s: (%d) %02x", from, len, frame[0] & 0xff);
|
||||
for(i=1; i < 6; i++ ) {
|
||||
printk(":%02x", frame[i] &0xff);
|
||||
}
|
||||
printk(" %2x", frame[6] &0xff);
|
||||
for(i=7; i < 12; i++ ) {
|
||||
printk(":%02x", frame[i] &0xff);
|
||||
}
|
||||
printk(" [%02x%02x]\n", frame[12], frame[13]);
|
||||
|
||||
for(i=14; i < len; i++ ) {
|
||||
printk("%02x ", frame[i] &0xff);
|
||||
if ( (i%10)==0) printk("\n");
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Function used to transmit of frame, very last one on the path before
|
||||
* going to the simulator.
|
||||
*/
|
||||
static int
|
||||
simeth_tx(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct simeth_local *local = netdev_priv(dev);
|
||||
|
||||
#if 0
|
||||
/* ensure we have at least ETH_ZLEN bytes (min frame size) */
|
||||
unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
|
||||
/* Where do the extra padding bytes comes from inthe skbuff ? */
|
||||
#else
|
||||
/* the real driver in the host system is going to take care of that
|
||||
* or maybe it's the NIC itself.
|
||||
*/
|
||||
unsigned int length = skb->len;
|
||||
#endif
|
||||
|
||||
local->stats.tx_bytes += skb->len;
|
||||
local->stats.tx_packets++;
|
||||
|
||||
|
||||
if (simeth_debug > 5) frame_print("simeth_tx", skb->data, length);
|
||||
|
||||
netdev_send(local->simfd, skb->data, length);
|
||||
|
||||
/*
|
||||
* we are synchronous on write, so we don't simulate a
|
||||
* trasnmit complete interrupt, thus we don't need to arm a tx
|
||||
*/
|
||||
|
||||
dev_kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
static inline struct sk_buff *
|
||||
make_new_skb(struct net_device *dev)
|
||||
{
|
||||
struct sk_buff *nskb;
|
||||
|
||||
/*
|
||||
* The +2 is used to make sure that the IP header is nicely
|
||||
* aligned (on 4byte boundary I assume 14+2=16)
|
||||
*/
|
||||
nskb = dev_alloc_skb(SIMETH_FRAME_SIZE + 2);
|
||||
if ( nskb == NULL ) {
|
||||
printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
skb_reserve(nskb, 2); /* Align IP on 16 byte boundaries */
|
||||
|
||||
skb_put(nskb,SIMETH_FRAME_SIZE);
|
||||
|
||||
return nskb;
|
||||
}
|
||||
|
||||
/*
|
||||
* called from interrupt handler to process a received frame
|
||||
*/
|
||||
static int
|
||||
simeth_rx(struct net_device *dev)
|
||||
{
|
||||
struct simeth_local *local;
|
||||
struct sk_buff *skb;
|
||||
int len;
|
||||
int rcv_count = SIMETH_RECV_MAX;
|
||||
|
||||
local = netdev_priv(dev);
|
||||
/*
|
||||
* the loop concept has been borrowed from other drivers
|
||||
* looks to me like it's a throttling thing to avoid pushing to many
|
||||
* packets at one time into the stack. Making sure we can process them
|
||||
* upstream and make forward progress overall
|
||||
*/
|
||||
do {
|
||||
if ( (skb=make_new_skb(dev)) == NULL ) {
|
||||
printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name);
|
||||
local->stats.rx_dropped++;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* Read only one frame at a time
|
||||
*/
|
||||
len = netdev_read(local->simfd, skb->data, SIMETH_FRAME_SIZE);
|
||||
if ( len == 0 ) {
|
||||
if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n",
|
||||
dev->name, SIMETH_RECV_MAX-rcv_count);
|
||||
break;
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
* XXX Fix me
|
||||
* Should really do a csum+copy here
|
||||
*/
|
||||
skb_copy_to_linear_data(skb, frame, len);
|
||||
#endif
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
|
||||
if ( simeth_debug > 6 ) frame_print("simeth_rx", skb->data, len);
|
||||
|
||||
/*
|
||||
* push the packet up & trigger software interrupt
|
||||
*/
|
||||
netif_rx(skb);
|
||||
|
||||
local->stats.rx_packets++;
|
||||
local->stats.rx_bytes += len;
|
||||
|
||||
} while ( --rcv_count );
|
||||
|
||||
return len; /* 0 = nothing left to read, otherwise, we can try again */
|
||||
}
|
||||
|
||||
/*
|
||||
* Interrupt handler (Yes, we can do it too !!!)
|
||||
*/
|
||||
static irqreturn_t
|
||||
simeth_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct net_device *dev = dev_id;
|
||||
|
||||
/*
|
||||
* very simple loop because we get interrupts only when receiving
|
||||
*/
|
||||
while (simeth_rx(dev));
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct net_device_stats *
|
||||
simeth_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct simeth_local *local = netdev_priv(dev);
|
||||
|
||||
return &local->stats;
|
||||
}
|
||||
|
||||
/* fake multicast ability */
|
||||
static void
|
||||
set_multicast_list(struct net_device *dev)
|
||||
{
|
||||
printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name);
|
||||
}
|
||||
|
||||
__initcall(simeth_probe);
|
380
arch/ia64/hp/sim/simscsi.c
Normal file
380
arch/ia64/hp/sim/simscsi.c
Normal file
|
@ -0,0 +1,380 @@
|
|||
/*
|
||||
* Simulated SCSI driver.
|
||||
*
|
||||
* Copyright (C) 1999, 2001-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
*
|
||||
* 02/01/15 David Mosberger Updated for v2.5.1
|
||||
* 99/12/18 David Mosberger Added support for READ10/WRITE10 needed by linux v2.3.33
|
||||
*/
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/timer.h>
|
||||
#include <asm/irq.h>
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
#include <scsi/scsi.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_device.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
|
||||
#define DEBUG_SIMSCSI 0
|
||||
|
||||
#define SIMSCSI_REQ_QUEUE_LEN 64
|
||||
#define DEFAULT_SIMSCSI_ROOT "/var/ski-disks/sd"
|
||||
|
||||
/* Simulator system calls: */
|
||||
|
||||
#define SSC_OPEN 50
|
||||
#define SSC_CLOSE 51
|
||||
#define SSC_READ 52
|
||||
#define SSC_WRITE 53
|
||||
#define SSC_GET_COMPLETION 54
|
||||
#define SSC_WAIT_COMPLETION 55
|
||||
|
||||
#define SSC_WRITE_ACCESS 2
|
||||
#define SSC_READ_ACCESS 1
|
||||
|
||||
#if DEBUG_SIMSCSI
|
||||
int simscsi_debug;
|
||||
# define DBG simscsi_debug
|
||||
#else
|
||||
# define DBG 0
|
||||
#endif
|
||||
|
||||
static struct Scsi_Host *host;
|
||||
|
||||
static void simscsi_interrupt (unsigned long val);
|
||||
static DECLARE_TASKLET(simscsi_tasklet, simscsi_interrupt, 0);
|
||||
|
||||
struct disk_req {
|
||||
unsigned long addr;
|
||||
unsigned len;
|
||||
};
|
||||
|
||||
struct disk_stat {
|
||||
int fd;
|
||||
unsigned count;
|
||||
};
|
||||
|
||||
static int desc[16] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
static struct queue_entry {
|
||||
struct scsi_cmnd *sc;
|
||||
} queue[SIMSCSI_REQ_QUEUE_LEN];
|
||||
|
||||
static int rd, wr;
|
||||
static atomic_t num_reqs = ATOMIC_INIT(0);
|
||||
|
||||
/* base name for default disks */
|
||||
static char *simscsi_root = DEFAULT_SIMSCSI_ROOT;
|
||||
|
||||
#define MAX_ROOT_LEN 128
|
||||
|
||||
/*
|
||||
* used to setup a new base for disk images
|
||||
* to use /foo/bar/disk[a-z] as disk images
|
||||
* you have to specify simscsi=/foo/bar/disk on the command line
|
||||
*/
|
||||
static int __init
|
||||
simscsi_setup (char *s)
|
||||
{
|
||||
/* XXX Fix me we may need to strcpy() ? */
|
||||
if (strlen(s) > MAX_ROOT_LEN) {
|
||||
printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
|
||||
simscsi_root);
|
||||
} else
|
||||
simscsi_root = s;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("simscsi=", simscsi_setup);
|
||||
|
||||
static void
|
||||
simscsi_interrupt (unsigned long val)
|
||||
{
|
||||
struct scsi_cmnd *sc;
|
||||
|
||||
while ((sc = queue[rd].sc) != NULL) {
|
||||
atomic_dec(&num_reqs);
|
||||
queue[rd].sc = NULL;
|
||||
if (DBG)
|
||||
printk("simscsi_interrupt: done with %ld\n", sc->serial_number);
|
||||
(*sc->scsi_done)(sc);
|
||||
rd = (rd + 1) % SIMSCSI_REQ_QUEUE_LEN;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
simscsi_biosparam (struct scsi_device *sdev, struct block_device *n,
|
||||
sector_t capacity, int ip[])
|
||||
{
|
||||
ip[0] = 64; /* heads */
|
||||
ip[1] = 32; /* sectors */
|
||||
ip[2] = capacity >> 11; /* cylinders */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
simscsi_sg_readwrite (struct scsi_cmnd *sc, int mode, unsigned long offset)
|
||||
{
|
||||
int i;
|
||||
struct scatterlist *sl;
|
||||
struct disk_stat stat;
|
||||
struct disk_req req;
|
||||
|
||||
stat.fd = desc[sc->device->id];
|
||||
|
||||
scsi_for_each_sg(sc, sl, scsi_sg_count(sc), i) {
|
||||
req.addr = __pa(sg_virt(sl));
|
||||
req.len = sl->length;
|
||||
if (DBG)
|
||||
printk("simscsi_sg_%s @ %lx (off %lx) use_sg=%d len=%d\n",
|
||||
mode == SSC_READ ? "read":"write", req.addr, offset,
|
||||
scsi_sg_count(sc) - i, sl->length);
|
||||
ia64_ssc(stat.fd, 1, __pa(&req), offset, mode);
|
||||
ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
|
||||
|
||||
/* should not happen in our case */
|
||||
if (stat.count != req.len) {
|
||||
sc->result = DID_ERROR << 16;
|
||||
return;
|
||||
}
|
||||
offset += sl->length;
|
||||
}
|
||||
sc->result = GOOD;
|
||||
}
|
||||
|
||||
/*
|
||||
* function handling both READ_6/WRITE_6 (non-scatter/gather mode)
|
||||
* commands.
|
||||
* Added 02/26/99 S.Eranian
|
||||
*/
|
||||
static void
|
||||
simscsi_readwrite6 (struct scsi_cmnd *sc, int mode)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
offset = (((sc->cmnd[1] & 0x1f) << 16) | (sc->cmnd[2] << 8) | sc->cmnd[3])*512;
|
||||
simscsi_sg_readwrite(sc, mode, offset);
|
||||
}
|
||||
|
||||
static size_t
|
||||
simscsi_get_disk_size (int fd)
|
||||
{
|
||||
struct disk_stat stat;
|
||||
size_t bit, sectors = 0;
|
||||
struct disk_req req;
|
||||
char buf[512];
|
||||
|
||||
/*
|
||||
* This is a bit kludgey: the simulator doesn't provide a
|
||||
* direct way of determining the disk size, so we do a binary
|
||||
* search, assuming a maximum disk size of 128GB.
|
||||
*/
|
||||
for (bit = (128UL << 30)/512; bit != 0; bit >>= 1) {
|
||||
req.addr = __pa(&buf);
|
||||
req.len = sizeof(buf);
|
||||
ia64_ssc(fd, 1, __pa(&req), ((sectors | bit) - 1)*512, SSC_READ);
|
||||
stat.fd = fd;
|
||||
ia64_ssc(__pa(&stat), 0, 0, 0, SSC_WAIT_COMPLETION);
|
||||
if (stat.count == sizeof(buf))
|
||||
sectors |= bit;
|
||||
}
|
||||
return sectors - 1; /* return last valid sector number */
|
||||
}
|
||||
|
||||
static void
|
||||
simscsi_readwrite10 (struct scsi_cmnd *sc, int mode)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
offset = (((unsigned long)sc->cmnd[2] << 24)
|
||||
| ((unsigned long)sc->cmnd[3] << 16)
|
||||
| ((unsigned long)sc->cmnd[4] << 8)
|
||||
| ((unsigned long)sc->cmnd[5] << 0))*512UL;
|
||||
simscsi_sg_readwrite(sc, mode, offset);
|
||||
}
|
||||
|
||||
static int
|
||||
simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
||||
{
|
||||
unsigned int target_id = sc->device->id;
|
||||
char fname[MAX_ROOT_LEN+16];
|
||||
size_t disk_size;
|
||||
char *buf;
|
||||
char localbuf[36];
|
||||
#if DEBUG_SIMSCSI
|
||||
register long sp asm ("sp");
|
||||
|
||||
if (DBG)
|
||||
printk("simscsi_queuecommand: target=%d,cmnd=%u,sc=%lu,sp=%lx,done=%p\n",
|
||||
target_id, sc->cmnd[0], sc->serial_number, sp, done);
|
||||
#endif
|
||||
|
||||
sc->result = DID_BAD_TARGET << 16;
|
||||
sc->scsi_done = done;
|
||||
if (target_id <= 15 && sc->device->lun == 0) {
|
||||
switch (sc->cmnd[0]) {
|
||||
case INQUIRY:
|
||||
if (scsi_bufflen(sc) < 35) {
|
||||
break;
|
||||
}
|
||||
sprintf (fname, "%s%c", simscsi_root, 'a' + target_id);
|
||||
desc[target_id] = ia64_ssc(__pa(fname), SSC_READ_ACCESS|SSC_WRITE_ACCESS,
|
||||
0, 0, SSC_OPEN);
|
||||
if (desc[target_id] < 0) {
|
||||
/* disk doesn't exist... */
|
||||
break;
|
||||
}
|
||||
buf = localbuf;
|
||||
buf[0] = 0; /* magnetic disk */
|
||||
buf[1] = 0; /* not a removable medium */
|
||||
buf[2] = 2; /* SCSI-2 compliant device */
|
||||
buf[3] = 2; /* SCSI-2 response data format */
|
||||
buf[4] = 31; /* additional length (bytes) */
|
||||
buf[5] = 0; /* reserved */
|
||||
buf[6] = 0; /* reserved */
|
||||
buf[7] = 0; /* various flags */
|
||||
memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28);
|
||||
scsi_sg_copy_from_buffer(sc, buf, 36);
|
||||
sc->result = GOOD;
|
||||
break;
|
||||
|
||||
case TEST_UNIT_READY:
|
||||
sc->result = GOOD;
|
||||
break;
|
||||
|
||||
case READ_6:
|
||||
if (desc[target_id] < 0 )
|
||||
break;
|
||||
simscsi_readwrite6(sc, SSC_READ);
|
||||
break;
|
||||
|
||||
case READ_10:
|
||||
if (desc[target_id] < 0 )
|
||||
break;
|
||||
simscsi_readwrite10(sc, SSC_READ);
|
||||
break;
|
||||
|
||||
case WRITE_6:
|
||||
if (desc[target_id] < 0)
|
||||
break;
|
||||
simscsi_readwrite6(sc, SSC_WRITE);
|
||||
break;
|
||||
|
||||
case WRITE_10:
|
||||
if (desc[target_id] < 0)
|
||||
break;
|
||||
simscsi_readwrite10(sc, SSC_WRITE);
|
||||
break;
|
||||
|
||||
case READ_CAPACITY:
|
||||
if (desc[target_id] < 0 || scsi_bufflen(sc) < 8) {
|
||||
break;
|
||||
}
|
||||
buf = localbuf;
|
||||
disk_size = simscsi_get_disk_size(desc[target_id]);
|
||||
|
||||
buf[0] = (disk_size >> 24) & 0xff;
|
||||
buf[1] = (disk_size >> 16) & 0xff;
|
||||
buf[2] = (disk_size >> 8) & 0xff;
|
||||
buf[3] = (disk_size >> 0) & 0xff;
|
||||
/* set block size of 512 bytes: */
|
||||
buf[4] = 0;
|
||||
buf[5] = 0;
|
||||
buf[6] = 2;
|
||||
buf[7] = 0;
|
||||
scsi_sg_copy_from_buffer(sc, buf, 8);
|
||||
sc->result = GOOD;
|
||||
break;
|
||||
|
||||
case MODE_SENSE:
|
||||
case MODE_SENSE_10:
|
||||
/* sd.c uses this to determine whether disk does write-caching. */
|
||||
scsi_sg_copy_from_buffer(sc, (char *)empty_zero_page,
|
||||
PAGE_SIZE);
|
||||
sc->result = GOOD;
|
||||
break;
|
||||
|
||||
case START_STOP:
|
||||
printk(KERN_ERR "START_STOP\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
panic("simscsi: unknown SCSI command %u\n", sc->cmnd[0]);
|
||||
}
|
||||
}
|
||||
if (sc->result == DID_BAD_TARGET) {
|
||||
sc->result |= DRIVER_SENSE << 24;
|
||||
sc->sense_buffer[0] = 0x70;
|
||||
sc->sense_buffer[2] = 0x00;
|
||||
}
|
||||
if (atomic_read(&num_reqs) >= SIMSCSI_REQ_QUEUE_LEN) {
|
||||
panic("Attempt to queue command while command is pending!!");
|
||||
}
|
||||
atomic_inc(&num_reqs);
|
||||
queue[wr].sc = sc;
|
||||
wr = (wr + 1) % SIMSCSI_REQ_QUEUE_LEN;
|
||||
|
||||
tasklet_schedule(&simscsi_tasklet);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DEF_SCSI_QCMD(simscsi_queuecommand)
|
||||
|
||||
static int
|
||||
simscsi_host_reset (struct scsi_cmnd *sc)
|
||||
{
|
||||
printk(KERN_ERR "simscsi_host_reset: not implemented\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct scsi_host_template driver_template = {
|
||||
.name = "simulated SCSI host adapter",
|
||||
.proc_name = "simscsi",
|
||||
.queuecommand = simscsi_queuecommand,
|
||||
.eh_host_reset_handler = simscsi_host_reset,
|
||||
.bios_param = simscsi_biosparam,
|
||||
.can_queue = SIMSCSI_REQ_QUEUE_LEN,
|
||||
.this_id = -1,
|
||||
.sg_tablesize = SG_ALL,
|
||||
.max_sectors = 1024,
|
||||
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN,
|
||||
.use_clustering = DISABLE_CLUSTERING,
|
||||
};
|
||||
|
||||
static int __init
|
||||
simscsi_init(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
host = scsi_host_alloc(&driver_template, 0);
|
||||
if (!host)
|
||||
return -ENOMEM;
|
||||
|
||||
error = scsi_add_host(host, NULL);
|
||||
if (error)
|
||||
goto free_host;
|
||||
scsi_scan_host(host);
|
||||
return 0;
|
||||
|
||||
free_host:
|
||||
scsi_host_put(host);
|
||||
return error;
|
||||
}
|
||||
|
||||
static void __exit
|
||||
simscsi_exit(void)
|
||||
{
|
||||
scsi_remove_host(host);
|
||||
scsi_host_put(host);
|
||||
}
|
||||
|
||||
module_init(simscsi_init);
|
||||
module_exit(simscsi_exit);
|
545
arch/ia64/hp/sim/simserial.c
Normal file
545
arch/ia64/hp/sim/simserial.c
Normal file
|
@ -0,0 +1,545 @@
|
|||
/*
|
||||
* Simulated Serial Driver (fake serial)
|
||||
*
|
||||
* This driver is mostly used for bringup purposes and will go away.
|
||||
* It has a strong dependency on the system console. All outputs
|
||||
* are rerouted to the same facility as the one used by printk which, in our
|
||||
* case means sys_sim.c console (goes via the simulator).
|
||||
*
|
||||
* Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/tty_flip.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fcntl.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/circ_buf.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/sysrq.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#include <asm/hpsim.h>
|
||||
|
||||
#include "hpsim_ssc.h"
|
||||
|
||||
#undef SIMSERIAL_DEBUG /* define this to get some debug information */
|
||||
|
||||
#define KEYBOARD_INTR 3 /* must match with simulator! */
|
||||
|
||||
#define NR_PORTS 1 /* only one port for now */
|
||||
|
||||
struct serial_state {
|
||||
struct tty_port port;
|
||||
struct circ_buf xmit;
|
||||
int irq;
|
||||
int x_char;
|
||||
};
|
||||
|
||||
static struct serial_state rs_table[NR_PORTS];
|
||||
|
||||
struct tty_driver *hp_simserial_driver;
|
||||
|
||||
static struct console *console;
|
||||
|
||||
static void receive_chars(struct tty_port *port)
|
||||
{
|
||||
unsigned char ch;
|
||||
static unsigned char seen_esc = 0;
|
||||
|
||||
while ( (ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR)) ) {
|
||||
if (ch == 27 && seen_esc == 0) {
|
||||
seen_esc = 1;
|
||||
continue;
|
||||
} else if (seen_esc == 1 && ch == 'O') {
|
||||
seen_esc = 2;
|
||||
continue;
|
||||
} else if (seen_esc == 2) {
|
||||
if (ch == 'P') /* F1 */
|
||||
show_state();
|
||||
#ifdef CONFIG_MAGIC_SYSRQ
|
||||
if (ch == 'S') { /* F4 */
|
||||
do {
|
||||
ch = ia64_ssc(0, 0, 0, 0, SSC_GETCHAR);
|
||||
} while (!ch);
|
||||
handle_sysrq(ch);
|
||||
}
|
||||
#endif
|
||||
seen_esc = 0;
|
||||
continue;
|
||||
}
|
||||
seen_esc = 0;
|
||||
|
||||
if (tty_insert_flip_char(port, ch, TTY_NORMAL) == 0)
|
||||
break;
|
||||
}
|
||||
tty_flip_buffer_push(port);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the serial driver's interrupt routine for a single port
|
||||
*/
|
||||
static irqreturn_t rs_interrupt_single(int irq, void *dev_id)
|
||||
{
|
||||
struct serial_state *info = dev_id;
|
||||
|
||||
receive_chars(&info->port);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/*
|
||||
* -------------------------------------------------------------------
|
||||
* Here ends the serial interrupt routines.
|
||||
* -------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int rs_put_char(struct tty_struct *tty, unsigned char ch)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
if (!info->xmit.buf)
|
||||
return 0;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) == 0) {
|
||||
local_irq_restore(flags);
|
||||
return 0;
|
||||
}
|
||||
info->xmit.buf[info->xmit.head] = ch;
|
||||
info->xmit.head = (info->xmit.head + 1) & (SERIAL_XMIT_SIZE-1);
|
||||
local_irq_restore(flags);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void transmit_chars(struct tty_struct *tty, struct serial_state *info,
|
||||
int *intr_done)
|
||||
{
|
||||
int count;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
if (info->x_char) {
|
||||
char c = info->x_char;
|
||||
|
||||
console->write(console, &c, 1);
|
||||
|
||||
info->x_char = 0;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (info->xmit.head == info->xmit.tail || tty->stopped) {
|
||||
#ifdef SIMSERIAL_DEBUG
|
||||
printk("transmit_chars: head=%d, tail=%d, stopped=%d\n",
|
||||
info->xmit.head, info->xmit.tail, tty->stopped);
|
||||
#endif
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* We removed the loop and try to do it in to chunks. We need
|
||||
* 2 operations maximum because it's a ring buffer.
|
||||
*
|
||||
* First from current to tail if possible.
|
||||
* Then from the beginning of the buffer until necessary
|
||||
*/
|
||||
|
||||
count = min(CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE),
|
||||
SERIAL_XMIT_SIZE - info->xmit.tail);
|
||||
console->write(console, info->xmit.buf+info->xmit.tail, count);
|
||||
|
||||
info->xmit.tail = (info->xmit.tail+count) & (SERIAL_XMIT_SIZE-1);
|
||||
|
||||
/*
|
||||
* We have more at the beginning of the buffer
|
||||
*/
|
||||
count = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
|
||||
if (count) {
|
||||
console->write(console, info->xmit.buf, count);
|
||||
info->xmit.tail += count;
|
||||
}
|
||||
out:
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static void rs_flush_chars(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
if (info->xmit.head == info->xmit.tail || tty->stopped ||
|
||||
!info->xmit.buf)
|
||||
return;
|
||||
|
||||
transmit_chars(tty, info, NULL);
|
||||
}
|
||||
|
||||
static int rs_write(struct tty_struct * tty,
|
||||
const unsigned char *buf, int count)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
int c, ret = 0;
|
||||
unsigned long flags;
|
||||
|
||||
if (!info->xmit.buf)
|
||||
return 0;
|
||||
|
||||
local_irq_save(flags);
|
||||
while (1) {
|
||||
c = CIRC_SPACE_TO_END(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
|
||||
if (count < c)
|
||||
c = count;
|
||||
if (c <= 0) {
|
||||
break;
|
||||
}
|
||||
memcpy(info->xmit.buf + info->xmit.head, buf, c);
|
||||
info->xmit.head = ((info->xmit.head + c) &
|
||||
(SERIAL_XMIT_SIZE-1));
|
||||
buf += c;
|
||||
count -= c;
|
||||
ret += c;
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
/*
|
||||
* Hey, we transmit directly from here in our case
|
||||
*/
|
||||
if (CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE) &&
|
||||
!tty->stopped)
|
||||
transmit_chars(tty, info, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rs_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
|
||||
}
|
||||
|
||||
static int rs_chars_in_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE);
|
||||
}
|
||||
|
||||
static void rs_flush_buffer(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
info->xmit.head = info->xmit.tail = 0;
|
||||
local_irq_restore(flags);
|
||||
|
||||
tty_wakeup(tty);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is used to send a high-priority XON/XOFF character to
|
||||
* the device
|
||||
*/
|
||||
static void rs_send_xchar(struct tty_struct *tty, char ch)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
info->x_char = ch;
|
||||
if (ch) {
|
||||
/*
|
||||
* I guess we could call console->write() directly but
|
||||
* let's do that for now.
|
||||
*/
|
||||
transmit_chars(tty, info, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* rs_throttle()
|
||||
*
|
||||
* This routine is called by the upper-layer tty layer to signal that
|
||||
* incoming characters should be throttled.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
static void rs_throttle(struct tty_struct * tty)
|
||||
{
|
||||
if (I_IXOFF(tty))
|
||||
rs_send_xchar(tty, STOP_CHAR(tty));
|
||||
|
||||
printk(KERN_INFO "simrs_throttle called\n");
|
||||
}
|
||||
|
||||
static void rs_unthrottle(struct tty_struct * tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
if (I_IXOFF(tty)) {
|
||||
if (info->x_char)
|
||||
info->x_char = 0;
|
||||
else
|
||||
rs_send_xchar(tty, START_CHAR(tty));
|
||||
}
|
||||
printk(KERN_INFO "simrs_unthrottle called\n");
|
||||
}
|
||||
|
||||
static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
|
||||
(cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
|
||||
(cmd != TIOCMIWAIT)) {
|
||||
if (tty->flags & (1 << TTY_IO_ERROR))
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case TIOCGSERIAL:
|
||||
case TIOCSSERIAL:
|
||||
case TIOCSERGSTRUCT:
|
||||
case TIOCMIWAIT:
|
||||
return 0;
|
||||
case TIOCSERCONFIG:
|
||||
case TIOCSERGETLSR: /* Get line status register */
|
||||
return -EINVAL;
|
||||
case TIOCSERGWILD:
|
||||
case TIOCSERSWILD:
|
||||
/* "setserial -W" is called in Debian boot */
|
||||
printk (KERN_INFO "TIOCSER?WILD ioctl obsolete, ignored.\n");
|
||||
return 0;
|
||||
}
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
|
||||
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
|
||||
|
||||
/*
|
||||
* This routine will shutdown a serial port; interrupts are disabled, and
|
||||
* DTR is dropped if the hangup on close termio flag is on.
|
||||
*/
|
||||
static void shutdown(struct tty_port *port)
|
||||
{
|
||||
struct serial_state *info = container_of(port, struct serial_state,
|
||||
port);
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (info->irq)
|
||||
free_irq(info->irq, info);
|
||||
|
||||
if (info->xmit.buf) {
|
||||
free_page((unsigned long) info->xmit.buf);
|
||||
info->xmit.buf = NULL;
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static void rs_close(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
tty_port_close(&info->port, tty, filp);
|
||||
}
|
||||
|
||||
static void rs_hangup(struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *info = tty->driver_data;
|
||||
|
||||
rs_flush_buffer(tty);
|
||||
tty_port_hangup(&info->port);
|
||||
}
|
||||
|
||||
static int activate(struct tty_port *port, struct tty_struct *tty)
|
||||
{
|
||||
struct serial_state *state = container_of(port, struct serial_state,
|
||||
port);
|
||||
unsigned long flags, page;
|
||||
int retval = 0;
|
||||
|
||||
page = get_zeroed_page(GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
if (state->xmit.buf)
|
||||
free_page(page);
|
||||
else
|
||||
state->xmit.buf = (unsigned char *) page;
|
||||
|
||||
if (state->irq) {
|
||||
retval = request_irq(state->irq, rs_interrupt_single, 0,
|
||||
"simserial", state);
|
||||
if (retval)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
state->xmit.head = state->xmit.tail = 0;
|
||||
|
||||
/*
|
||||
* Set up the tty->alt_speed kludge
|
||||
*/
|
||||
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
|
||||
tty->alt_speed = 57600;
|
||||
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
|
||||
tty->alt_speed = 115200;
|
||||
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
|
||||
tty->alt_speed = 230400;
|
||||
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
|
||||
tty->alt_speed = 460800;
|
||||
|
||||
errout:
|
||||
local_irq_restore(flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine is called whenever a serial port is opened. It
|
||||
* enables interrupts for a serial port, linking in its async structure into
|
||||
* the IRQ chain. It also performs the serial-specific
|
||||
* initialization for the tty structure.
|
||||
*/
|
||||
static int rs_open(struct tty_struct *tty, struct file * filp)
|
||||
{
|
||||
struct serial_state *info = rs_table + tty->index;
|
||||
struct tty_port *port = &info->port;
|
||||
|
||||
tty->driver_data = info;
|
||||
port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
|
||||
|
||||
/*
|
||||
* figure out which console to use (should be one already)
|
||||
*/
|
||||
console = console_drivers;
|
||||
while (console) {
|
||||
if ((console->flags & CON_ENABLED) && console->write) break;
|
||||
console = console->next;
|
||||
}
|
||||
|
||||
return tty_port_open(port, tty, filp);
|
||||
}
|
||||
|
||||
/*
|
||||
* /proc fs routines....
|
||||
*/
|
||||
|
||||
static int rs_proc_show(struct seq_file *m, void *v)
|
||||
{
|
||||
int i;
|
||||
|
||||
seq_printf(m, "simserinfo:1.0\n");
|
||||
for (i = 0; i < NR_PORTS; i++)
|
||||
seq_printf(m, "%d: uart:16550 port:3F8 irq:%d\n",
|
||||
i, rs_table[i].irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rs_proc_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, rs_proc_show, NULL);
|
||||
}
|
||||
|
||||
static const struct file_operations rs_proc_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rs_proc_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static const struct tty_operations hp_ops = {
|
||||
.open = rs_open,
|
||||
.close = rs_close,
|
||||
.write = rs_write,
|
||||
.put_char = rs_put_char,
|
||||
.flush_chars = rs_flush_chars,
|
||||
.write_room = rs_write_room,
|
||||
.chars_in_buffer = rs_chars_in_buffer,
|
||||
.flush_buffer = rs_flush_buffer,
|
||||
.ioctl = rs_ioctl,
|
||||
.throttle = rs_throttle,
|
||||
.unthrottle = rs_unthrottle,
|
||||
.send_xchar = rs_send_xchar,
|
||||
.hangup = rs_hangup,
|
||||
.proc_fops = &rs_proc_fops,
|
||||
};
|
||||
|
||||
static const struct tty_port_operations hp_port_ops = {
|
||||
.activate = activate,
|
||||
.shutdown = shutdown,
|
||||
};
|
||||
|
||||
static int __init simrs_init(void)
|
||||
{
|
||||
struct serial_state *state;
|
||||
int retval;
|
||||
|
||||
if (!ia64_platform_is("hpsim"))
|
||||
return -ENODEV;
|
||||
|
||||
hp_simserial_driver = alloc_tty_driver(NR_PORTS);
|
||||
if (!hp_simserial_driver)
|
||||
return -ENOMEM;
|
||||
|
||||
printk(KERN_INFO "SimSerial driver with no serial options enabled\n");
|
||||
|
||||
/* Initialize the tty_driver structure */
|
||||
|
||||
hp_simserial_driver->driver_name = "simserial";
|
||||
hp_simserial_driver->name = "ttyS";
|
||||
hp_simserial_driver->major = TTY_MAJOR;
|
||||
hp_simserial_driver->minor_start = 64;
|
||||
hp_simserial_driver->type = TTY_DRIVER_TYPE_SERIAL;
|
||||
hp_simserial_driver->subtype = SERIAL_TYPE_NORMAL;
|
||||
hp_simserial_driver->init_termios = tty_std_termios;
|
||||
hp_simserial_driver->init_termios.c_cflag =
|
||||
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
|
||||
hp_simserial_driver->flags = TTY_DRIVER_REAL_RAW;
|
||||
tty_set_operations(hp_simserial_driver, &hp_ops);
|
||||
|
||||
state = rs_table;
|
||||
tty_port_init(&state->port);
|
||||
state->port.ops = &hp_port_ops;
|
||||
state->port.close_delay = 0; /* XXX really 0? */
|
||||
|
||||
retval = hpsim_get_irq(KEYBOARD_INTR);
|
||||
if (retval < 0) {
|
||||
printk(KERN_ERR "%s: out of interrupt vectors!\n",
|
||||
__func__);
|
||||
goto err_free_tty;
|
||||
}
|
||||
|
||||
state->irq = retval;
|
||||
|
||||
/* the port is imaginary */
|
||||
printk(KERN_INFO "ttyS0 at 0x03f8 (irq = %d) is a 16550\n", state->irq);
|
||||
|
||||
tty_port_link_device(&state->port, hp_simserial_driver, 0);
|
||||
retval = tty_register_driver(hp_simserial_driver);
|
||||
if (retval) {
|
||||
printk(KERN_ERR "Couldn't register simserial driver\n");
|
||||
goto err_free_tty;
|
||||
}
|
||||
|
||||
return 0;
|
||||
err_free_tty:
|
||||
put_tty_driver(hp_simserial_driver);
|
||||
tty_port_destroy(&state->port);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
__initcall(simrs_init);
|
||||
#endif
|
8
arch/ia64/hp/zx1/Makefile
Normal file
8
arch/ia64/hp/zx1/Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# ia64/hp/zx1/Makefile
|
||||
#
|
||||
# Copyright (C) 2002 Hewlett Packard
|
||||
# Copyright (C) Alex Williamson (alex_williamson@hp.com)
|
||||
#
|
||||
|
||||
obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o hpzx1_swiotlb_machvec.o
|
3
arch/ia64/hp/zx1/hpzx1_machvec.c
Normal file
3
arch/ia64/hp/zx1/hpzx1_machvec.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MACHVEC_PLATFORM_NAME hpzx1
|
||||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_hpzx1.h>
|
||||
#include <asm/machvec_init.h>
|
3
arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c
Normal file
3
arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c
Normal file
|
@ -0,0 +1,3 @@
|
|||
#define MACHVEC_PLATFORM_NAME hpzx1_swiotlb
|
||||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_hpzx1_swiotlb.h>
|
||||
#include <asm/machvec_init.h>
|
11
arch/ia64/include/asm/Kbuild
Normal file
11
arch/ia64/include/asm/Kbuild
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
generic-y += clkdev.h
|
||||
generic-y += exec.h
|
||||
generic-y += hash.h
|
||||
generic-y += irq_work.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += mcs_spinlock.h
|
||||
generic-y += preempt.h
|
||||
generic-y += scatterlist.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += vtime.h
|
52
arch/ia64/include/asm/acenv.h
Normal file
52
arch/ia64/include/asm/acenv.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* IA64 specific ACPICA environments and implementation
|
||||
*
|
||||
* Copyright (C) 2014, Intel Corporation
|
||||
* Author: Lv Zheng <lv.zheng@intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_IA64_ACENV_H
|
||||
#define _ASM_IA64_ACENV_H
|
||||
|
||||
#include <asm/intrinsics.h>
|
||||
|
||||
#define COMPILER_DEPENDENT_INT64 long
|
||||
#define COMPILER_DEPENDENT_UINT64 unsigned long
|
||||
|
||||
/* Asm macros */
|
||||
|
||||
static inline int
|
||||
ia64_acpi_acquire_global_lock(unsigned int *lock)
|
||||
{
|
||||
unsigned int old, new, val;
|
||||
do {
|
||||
old = *lock;
|
||||
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
|
||||
val = ia64_cmpxchg4_acq(lock, new, old);
|
||||
} while (unlikely (val != old));
|
||||
return (new < 3) ? -1 : 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
ia64_acpi_release_global_lock(unsigned int *lock)
|
||||
{
|
||||
unsigned int old, new, val;
|
||||
do {
|
||||
old = *lock;
|
||||
new = old & ~0x3;
|
||||
val = ia64_cmpxchg4_acq(lock, new, old);
|
||||
} while (unlikely (val != old));
|
||||
return old & 0x1;
|
||||
}
|
||||
|
||||
#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
|
||||
((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
|
||||
|
||||
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
|
||||
((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
|
||||
|
||||
#endif /* _ASM_IA64_ACENV_H */
|
20
arch/ia64/include/asm/acpi-ext.h
Normal file
20
arch/ia64/include/asm/acpi-ext.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P.
|
||||
* Alex Williamson <alex.williamson@hp.com>
|
||||
* Bjorn Helgaas <bjorn.helgaas@hp.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Vendor specific extensions to ACPI.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_IA64_ACPI_EXT_H
|
||||
#define _ASM_IA64_ACPI_EXT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
|
||||
|
||||
#endif /* _ASM_IA64_ACPI_EXT_H */
|
147
arch/ia64/include/asm/acpi.h
Normal file
147
arch/ia64/include/asm/acpi.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Copyright (C) 1999 VA Linux Systems
|
||||
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
|
||||
* Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@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
|
||||
*
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef _ASM_ACPI_H
|
||||
#define _ASM_ACPI_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <acpi/pdc_intel.h>
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/numa.h>
|
||||
#include <asm/numa.h>
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
extern int acpi_lapic;
|
||||
#define acpi_disabled 0 /* ACPI always enabled on IA64 */
|
||||
#define acpi_noirq 0 /* ACPI always enabled on IA64 */
|
||||
#define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
|
||||
#define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
|
||||
|
||||
static inline bool acpi_has_cpu_in_madt(void)
|
||||
{
|
||||
return !!acpi_lapic;
|
||||
}
|
||||
#endif
|
||||
#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
|
||||
static inline void disable_acpi(void) { }
|
||||
|
||||
#ifdef CONFIG_IA64_GENERIC
|
||||
const char *acpi_get_sysname (void);
|
||||
#else
|
||||
static inline const char *acpi_get_sysname (void)
|
||||
{
|
||||
# if defined (CONFIG_IA64_HP_SIM)
|
||||
return "hpsim";
|
||||
# elif defined (CONFIG_IA64_HP_ZX1)
|
||||
return "hpzx1";
|
||||
# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
|
||||
return "hpzx1_swiotlb";
|
||||
# elif defined (CONFIG_IA64_SGI_SN2)
|
||||
return "sn2";
|
||||
# elif defined (CONFIG_IA64_SGI_UV)
|
||||
return "uv";
|
||||
# elif defined (CONFIG_IA64_DIG)
|
||||
return "dig";
|
||||
# elif defined(CONFIG_IA64_DIG_VTD)
|
||||
return "dig_vtd";
|
||||
# else
|
||||
# error Unknown platform. Fix acpi.c.
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
int acpi_request_vector (u32 int_type);
|
||||
int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
|
||||
|
||||
/* Low-level suspend routine. */
|
||||
extern int acpi_suspend_lowlevel(void);
|
||||
|
||||
extern unsigned long acpi_wakeup_address;
|
||||
|
||||
/*
|
||||
* Record the cpei override flag and current logical cpu. This is
|
||||
* useful for CPU removal.
|
||||
*/
|
||||
extern unsigned int can_cpei_retarget(void);
|
||||
extern unsigned int is_cpu_cpei_target(unsigned int cpu);
|
||||
extern void set_cpei_target_cpu(unsigned int cpu);
|
||||
extern unsigned int get_cpei_target_cpu(void);
|
||||
extern void prefill_possible_map(void);
|
||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||
extern int additional_cpus;
|
||||
#else
|
||||
#define additional_cpus 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
#if MAX_NUMNODES > 256
|
||||
#define MAX_PXM_DOMAINS MAX_NUMNODES
|
||||
#else
|
||||
#define MAX_PXM_DOMAINS (256)
|
||||
#endif
|
||||
extern int pxm_to_nid_map[MAX_PXM_DOMAINS];
|
||||
extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
|
||||
#endif
|
||||
|
||||
static inline bool arch_has_acpi_pdc(void) { return true; }
|
||||
static inline void arch_acpi_set_pdc_bits(u32 *buf)
|
||||
{
|
||||
buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
|
||||
}
|
||||
|
||||
#define acpi_unlazy_tlb(x)
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
extern cpumask_t early_cpu_possible_map;
|
||||
#define for_each_possible_early_cpu(cpu) \
|
||||
for_each_cpu_mask((cpu), early_cpu_possible_map)
|
||||
|
||||
static inline void per_cpu_scan_finalize(int min_cpus, int reserve_cpus)
|
||||
{
|
||||
int low_cpu, high_cpu;
|
||||
int cpu;
|
||||
int next_nid = 0;
|
||||
|
||||
low_cpu = cpus_weight(early_cpu_possible_map);
|
||||
|
||||
high_cpu = max(low_cpu, min_cpus);
|
||||
high_cpu = min(high_cpu + reserve_cpus, NR_CPUS);
|
||||
|
||||
for (cpu = low_cpu; cpu < high_cpu; cpu++) {
|
||||
cpu_set(cpu, early_cpu_possible_map);
|
||||
if (node_cpuid[cpu].nid == NUMA_NO_NODE) {
|
||||
node_cpuid[cpu].nid = next_nid;
|
||||
next_nid++;
|
||||
if (next_nid >= num_online_nodes())
|
||||
next_nid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_ACPI_NUMA */
|
||||
|
||||
#endif /*__KERNEL__*/
|
||||
|
||||
#endif /*_ASM_ACPI_H*/
|
26
arch/ia64/include/asm/agp.h
Normal file
26
arch/ia64/include/asm/agp.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef _ASM_IA64_AGP_H
|
||||
#define _ASM_IA64_AGP_H
|
||||
|
||||
/*
|
||||
* IA-64 specific AGP definitions.
|
||||
*
|
||||
* Copyright (C) 2002-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* To avoid memory-attribute aliasing issues, we require that the AGPGART engine operate
|
||||
* in coherent mode, which lets us map the AGP memory as normal (write-back) memory
|
||||
* (unlike x86, where it gets mapped "write-coalescing").
|
||||
*/
|
||||
#define map_page_into_agp(page) /* nothing */
|
||||
#define unmap_page_from_agp(page) /* nothing */
|
||||
#define flush_agp_cache() mb()
|
||||
|
||||
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
|
||||
#define alloc_gatt_pages(order) \
|
||||
((char *)__get_free_pages(GFP_KERNEL, (order)))
|
||||
#define free_gatt_pages(table, order) \
|
||||
free_pages((unsigned long)(table), (order))
|
||||
|
||||
#endif /* _ASM_IA64_AGP_H */
|
1
arch/ia64/include/asm/asm-offsets.h
Normal file
1
arch/ia64/include/asm/asm-offsets.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <generated/asm-offsets.h>
|
135
arch/ia64/include/asm/asmmacro.h
Normal file
135
arch/ia64/include/asm/asmmacro.h
Normal file
|
@ -0,0 +1,135 @@
|
|||
#ifndef _ASM_IA64_ASMMACRO_H
|
||||
#define _ASM_IA64_ASMMACRO_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000-2001, 2003-2004 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
|
||||
#define ENTRY(name) \
|
||||
.align 32; \
|
||||
.proc name; \
|
||||
name:
|
||||
|
||||
#define ENTRY_MIN_ALIGN(name) \
|
||||
.align 16; \
|
||||
.proc name; \
|
||||
name:
|
||||
|
||||
#define GLOBAL_ENTRY(name) \
|
||||
.global name; \
|
||||
ENTRY(name)
|
||||
|
||||
#define END(name) \
|
||||
.endp name
|
||||
|
||||
/*
|
||||
* Helper macros to make unwind directives more readable:
|
||||
*/
|
||||
|
||||
/* prologue_gr: */
|
||||
#define ASM_UNW_PRLG_RP 0x8
|
||||
#define ASM_UNW_PRLG_PFS 0x4
|
||||
#define ASM_UNW_PRLG_PSP 0x2
|
||||
#define ASM_UNW_PRLG_PR 0x1
|
||||
#define ASM_UNW_PRLG_GRSAVE(ninputs) (32+(ninputs))
|
||||
|
||||
/*
|
||||
* Helper macros for accessing user memory.
|
||||
*
|
||||
* When adding any new .section/.previous entries here, make sure to
|
||||
* also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or
|
||||
* unpleasant things will happen.
|
||||
*/
|
||||
|
||||
.section "__ex_table", "a" // declare section & section attributes
|
||||
.previous
|
||||
|
||||
# define EX(y,x...) \
|
||||
.xdata4 "__ex_table", 99f-., y-.; \
|
||||
[99:] x
|
||||
# define EXCLR(y,x...) \
|
||||
.xdata4 "__ex_table", 99f-., y-.+4; \
|
||||
[99:] x
|
||||
|
||||
/*
|
||||
* Tag MCA recoverable instruction ranges.
|
||||
*/
|
||||
|
||||
.section "__mca_table", "a" // declare section & section attributes
|
||||
.previous
|
||||
|
||||
# define MCA_RECOVER_RANGE(y) \
|
||||
.xdata4 "__mca_table", y-., 99f-.; \
|
||||
[99:]
|
||||
|
||||
/*
|
||||
* Mark instructions that need a load of a virtual address patched to be
|
||||
* a load of a physical address. We use this either in critical performance
|
||||
* path (ivt.S - TLB miss processing) or in places where it might not be
|
||||
* safe to use a "tpa" instruction (mca_asm.S - error recovery).
|
||||
*/
|
||||
.section ".data..patch.vtop", "a" // declare section & section attributes
|
||||
.previous
|
||||
|
||||
#define LOAD_PHYSICAL(pr, reg, obj) \
|
||||
[1:](pr)movl reg = obj; \
|
||||
.xdata4 ".data..patch.vtop", 1b-.
|
||||
|
||||
/*
|
||||
* For now, we always put in the McKinley E9 workaround. On CPUs that don't need it,
|
||||
* we'll patch out the work-around bundles with NOPs, so their impact is minimal.
|
||||
*/
|
||||
#define DO_MCKINLEY_E9_WORKAROUND
|
||||
|
||||
#ifdef DO_MCKINLEY_E9_WORKAROUND
|
||||
.section ".data..patch.mckinley_e9", "a"
|
||||
.previous
|
||||
/* workaround for Itanium 2 Errata 9: */
|
||||
# define FSYS_RETURN \
|
||||
.xdata4 ".data..patch.mckinley_e9", 1f-.; \
|
||||
1:{ .mib; \
|
||||
nop.m 0; \
|
||||
mov r16=ar.pfs; \
|
||||
br.call.sptk.many b7=2f;; \
|
||||
}; \
|
||||
2:{ .mib; \
|
||||
nop.m 0; \
|
||||
mov ar.pfs=r16; \
|
||||
br.ret.sptk.many b6;; \
|
||||
}
|
||||
#else
|
||||
# define FSYS_RETURN br.ret.sptk.many b6
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If physical stack register size is different from DEF_NUM_STACK_REG,
|
||||
* dynamically patch the kernel for correct size.
|
||||
*/
|
||||
.section ".data..patch.phys_stack_reg", "a"
|
||||
.previous
|
||||
#define LOAD_PHYS_STACK_REG_SIZE(reg) \
|
||||
[1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \
|
||||
.xdata4 ".data..patch.phys_stack_reg", 1b-.
|
||||
|
||||
/*
|
||||
* Up until early 2004, use of .align within a function caused bad unwind info.
|
||||
* TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing
|
||||
* otherwise.
|
||||
*/
|
||||
#ifdef HAVE_WORKING_TEXT_ALIGN
|
||||
# define TEXT_ALIGN(n) .align n
|
||||
#else
|
||||
# define TEXT_ALIGN(n)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SERIALIZE_DIRECTIVE
|
||||
# define dv_serialize_data .serialize.data
|
||||
# define dv_serialize_instruction .serialize.instruction
|
||||
#else
|
||||
# define dv_serialize_data
|
||||
# define dv_serialize_instruction
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_IA64_ASMMACRO_H */
|
196
arch/ia64/include/asm/atomic.h
Normal file
196
arch/ia64/include/asm/atomic.h
Normal file
|
@ -0,0 +1,196 @@
|
|||
#ifndef _ASM_IA64_ATOMIC_H
|
||||
#define _ASM_IA64_ATOMIC_H
|
||||
|
||||
/*
|
||||
* Atomic operations that C can't guarantee us. Useful for
|
||||
* resource counting etc..
|
||||
*
|
||||
* NOTE: don't mess with the types below! The "unsigned long" and
|
||||
* "int" types were carefully placed so as to ensure proper operation
|
||||
* of the macros.
|
||||
*
|
||||
* Copyright (C) 1998, 1999, 2002-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/intrinsics.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
#define ATOMIC64_INIT(i) { (i) }
|
||||
|
||||
#define atomic_read(v) ACCESS_ONCE((v)->counter)
|
||||
#define atomic64_read(v) ACCESS_ONCE((v)->counter)
|
||||
|
||||
#define atomic_set(v,i) (((v)->counter) = (i))
|
||||
#define atomic64_set(v,i) (((v)->counter) = (i))
|
||||
|
||||
#define ATOMIC_OP(op, c_op) \
|
||||
static __inline__ int \
|
||||
ia64_atomic_##op (int i, atomic_t *v) \
|
||||
{ \
|
||||
__s32 old, new; \
|
||||
CMPXCHG_BUGCHECK_DECL \
|
||||
\
|
||||
do { \
|
||||
CMPXCHG_BUGCHECK(v); \
|
||||
old = atomic_read(v); \
|
||||
new = old c_op i; \
|
||||
} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old); \
|
||||
return new; \
|
||||
}
|
||||
|
||||
ATOMIC_OP(add, +)
|
||||
ATOMIC_OP(sub, -)
|
||||
|
||||
#undef ATOMIC_OP
|
||||
|
||||
#define atomic_add_return(i,v) \
|
||||
({ \
|
||||
int __ia64_aar_i = (i); \
|
||||
(__builtin_constant_p(i) \
|
||||
&& ( (__ia64_aar_i == 1) || (__ia64_aar_i == 4) \
|
||||
|| (__ia64_aar_i == 8) || (__ia64_aar_i == 16) \
|
||||
|| (__ia64_aar_i == -1) || (__ia64_aar_i == -4) \
|
||||
|| (__ia64_aar_i == -8) || (__ia64_aar_i == -16))) \
|
||||
? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter) \
|
||||
: ia64_atomic_add(__ia64_aar_i, v); \
|
||||
})
|
||||
|
||||
#define atomic_sub_return(i,v) \
|
||||
({ \
|
||||
int __ia64_asr_i = (i); \
|
||||
(__builtin_constant_p(i) \
|
||||
&& ( (__ia64_asr_i == 1) || (__ia64_asr_i == 4) \
|
||||
|| (__ia64_asr_i == 8) || (__ia64_asr_i == 16) \
|
||||
|| (__ia64_asr_i == -1) || (__ia64_asr_i == -4) \
|
||||
|| (__ia64_asr_i == -8) || (__ia64_asr_i == -16))) \
|
||||
? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter) \
|
||||
: ia64_atomic_sub(__ia64_asr_i, v); \
|
||||
})
|
||||
|
||||
#define ATOMIC64_OP(op, c_op) \
|
||||
static __inline__ long \
|
||||
ia64_atomic64_##op (__s64 i, atomic64_t *v) \
|
||||
{ \
|
||||
__s64 old, new; \
|
||||
CMPXCHG_BUGCHECK_DECL \
|
||||
\
|
||||
do { \
|
||||
CMPXCHG_BUGCHECK(v); \
|
||||
old = atomic64_read(v); \
|
||||
new = old c_op i; \
|
||||
} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old); \
|
||||
return new; \
|
||||
}
|
||||
|
||||
ATOMIC64_OP(add, +)
|
||||
ATOMIC64_OP(sub, -)
|
||||
|
||||
#undef ATOMIC64_OP
|
||||
|
||||
#define atomic64_add_return(i,v) \
|
||||
({ \
|
||||
long __ia64_aar_i = (i); \
|
||||
(__builtin_constant_p(i) \
|
||||
&& ( (__ia64_aar_i == 1) || (__ia64_aar_i == 4) \
|
||||
|| (__ia64_aar_i == 8) || (__ia64_aar_i == 16) \
|
||||
|| (__ia64_aar_i == -1) || (__ia64_aar_i == -4) \
|
||||
|| (__ia64_aar_i == -8) || (__ia64_aar_i == -16))) \
|
||||
? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter) \
|
||||
: ia64_atomic64_add(__ia64_aar_i, v); \
|
||||
})
|
||||
|
||||
#define atomic64_sub_return(i,v) \
|
||||
({ \
|
||||
long __ia64_asr_i = (i); \
|
||||
(__builtin_constant_p(i) \
|
||||
&& ( (__ia64_asr_i == 1) || (__ia64_asr_i == 4) \
|
||||
|| (__ia64_asr_i == 8) || (__ia64_asr_i == 16) \
|
||||
|| (__ia64_asr_i == -1) || (__ia64_asr_i == -4) \
|
||||
|| (__ia64_asr_i == -8) || (__ia64_asr_i == -16))) \
|
||||
? ia64_fetch_and_add(-__ia64_asr_i, &(v)->counter) \
|
||||
: ia64_atomic64_sub(__ia64_asr_i, v); \
|
||||
})
|
||||
|
||||
#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
|
||||
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
#define atomic64_cmpxchg(v, old, new) \
|
||||
(cmpxchg(&((v)->counter), old, new))
|
||||
#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
|
||||
{
|
||||
int c, old;
|
||||
c = atomic_read(v);
|
||||
for (;;) {
|
||||
if (unlikely(c == (u)))
|
||||
break;
|
||||
old = atomic_cmpxchg((v), c, c + (a));
|
||||
if (likely(old == c))
|
||||
break;
|
||||
c = old;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static __inline__ long atomic64_add_unless(atomic64_t *v, long a, long u)
|
||||
{
|
||||
long c, old;
|
||||
c = atomic64_read(v);
|
||||
for (;;) {
|
||||
if (unlikely(c == (u)))
|
||||
break;
|
||||
old = atomic64_cmpxchg((v), c, c + (a));
|
||||
if (likely(old == c))
|
||||
break;
|
||||
c = old;
|
||||
}
|
||||
return c != (u);
|
||||
}
|
||||
|
||||
#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
|
||||
|
||||
/*
|
||||
* Atomically add I to V and return TRUE if the resulting value is
|
||||
* negative.
|
||||
*/
|
||||
static __inline__ int
|
||||
atomic_add_negative (int i, atomic_t *v)
|
||||
{
|
||||
return atomic_add_return(i, v) < 0;
|
||||
}
|
||||
|
||||
static __inline__ long
|
||||
atomic64_add_negative (__s64 i, atomic64_t *v)
|
||||
{
|
||||
return atomic64_add_return(i, v) < 0;
|
||||
}
|
||||
|
||||
#define atomic_dec_return(v) atomic_sub_return(1, (v))
|
||||
#define atomic_inc_return(v) atomic_add_return(1, (v))
|
||||
#define atomic64_dec_return(v) atomic64_sub_return(1, (v))
|
||||
#define atomic64_inc_return(v) atomic64_add_return(1, (v))
|
||||
|
||||
#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
|
||||
#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
|
||||
#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
|
||||
#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
|
||||
#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0)
|
||||
|
||||
#define atomic_add(i,v) (void)atomic_add_return((i), (v))
|
||||
#define atomic_sub(i,v) (void)atomic_sub_return((i), (v))
|
||||
#define atomic_inc(v) atomic_add(1, (v))
|
||||
#define atomic_dec(v) atomic_sub(1, (v))
|
||||
|
||||
#define atomic64_add(i,v) (void)atomic64_add_return((i), (v))
|
||||
#define atomic64_sub(i,v) (void)atomic64_sub_return((i), (v))
|
||||
#define atomic64_inc(v) atomic64_add(1, (v))
|
||||
#define atomic64_dec(v) atomic64_sub(1, (v))
|
||||
|
||||
#endif /* _ASM_IA64_ATOMIC_H */
|
94
arch/ia64/include/asm/barrier.h
Normal file
94
arch/ia64/include/asm/barrier.h
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* Memory barrier definitions. This is based on information published
|
||||
* in the Processor Abstraction Layer and the System Abstraction Layer
|
||||
* manual.
|
||||
*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
|
||||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
|
||||
*/
|
||||
#ifndef _ASM_IA64_BARRIER_H
|
||||
#define _ASM_IA64_BARRIER_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/*
|
||||
* Macros to force memory ordering. In these descriptions, "previous"
|
||||
* and "subsequent" refer to program order; "visible" means that all
|
||||
* architecturally visible effects of a memory access have occurred
|
||||
* (at a minimum, this means the memory has been read or written).
|
||||
*
|
||||
* wmb(): Guarantees that all preceding stores to memory-
|
||||
* like regions are visible before any subsequent
|
||||
* stores and that all following stores will be
|
||||
* visible only after all previous stores.
|
||||
* rmb(): Like wmb(), but for reads.
|
||||
* mb(): wmb()/rmb() combo, i.e., all previous memory
|
||||
* accesses are visible before all subsequent
|
||||
* accesses and vice versa. This is also known as
|
||||
* a "fence."
|
||||
*
|
||||
* Note: "mb()" and its variants cannot be used as a fence to order
|
||||
* accesses to memory mapped I/O registers. For that, mf.a needs to
|
||||
* be used. However, we don't want to always use mf.a because (a)
|
||||
* it's (presumably) much slower than mf and (b) mf.a is supported for
|
||||
* sequential memory pages only.
|
||||
*/
|
||||
#define mb() ia64_mf()
|
||||
#define rmb() mb()
|
||||
#define wmb() mb()
|
||||
#define read_barrier_depends() do { } while(0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# define smp_mb() mb()
|
||||
# define smp_rmb() rmb()
|
||||
# define smp_wmb() wmb()
|
||||
# define smp_read_barrier_depends() read_barrier_depends()
|
||||
|
||||
#else
|
||||
|
||||
# define smp_mb() barrier()
|
||||
# define smp_rmb() barrier()
|
||||
# define smp_wmb() barrier()
|
||||
# define smp_read_barrier_depends() do { } while(0)
|
||||
|
||||
#endif
|
||||
|
||||
#define smp_mb__before_atomic() barrier()
|
||||
#define smp_mb__after_atomic() barrier()
|
||||
|
||||
/*
|
||||
* IA64 GCC turns volatile stores into st.rel and volatile loads into ld.acq no
|
||||
* need for asm trickery!
|
||||
*/
|
||||
|
||||
#define smp_store_release(p, v) \
|
||||
do { \
|
||||
compiletime_assert_atomic_type(*p); \
|
||||
barrier(); \
|
||||
ACCESS_ONCE(*p) = (v); \
|
||||
} while (0)
|
||||
|
||||
#define smp_load_acquire(p) \
|
||||
({ \
|
||||
typeof(*p) ___p1 = ACCESS_ONCE(*p); \
|
||||
compiletime_assert_atomic_type(*p); \
|
||||
barrier(); \
|
||||
___p1; \
|
||||
})
|
||||
|
||||
/*
|
||||
* XXX check on this ---I suspect what Linus really wants here is
|
||||
* acquire vs release semantics but we can't discuss this stuff with
|
||||
* Linus just yet. Grrr...
|
||||
*/
|
||||
#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
|
||||
|
||||
/*
|
||||
* The group barrier in front of the rsm & ssm are necessary to ensure
|
||||
* that none of the previous instructions in the same group are
|
||||
* affected by the rsm/ssm.
|
||||
*/
|
||||
|
||||
#endif /* _ASM_IA64_BARRIER_H */
|
456
arch/ia64/include/asm/bitops.h
Normal file
456
arch/ia64/include/asm/bitops.h
Normal file
|
@ -0,0 +1,456 @@
|
|||
#ifndef _ASM_IA64_BITOPS_H
|
||||
#define _ASM_IA64_BITOPS_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*
|
||||
* 02/06/02 find_next_bit() and find_first_bit() added from Erich Focht's ia64
|
||||
* O(1) scheduler patch
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_BITOPS_H
|
||||
#error only <linux/bitops.h> can be included directly
|
||||
#endif
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/intrinsics.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
/**
|
||||
* set_bit - Atomically set a bit in memory
|
||||
* @nr: the bit to set
|
||||
* @addr: the address to start counting from
|
||||
*
|
||||
* This function is atomic and may not be reordered. See __set_bit()
|
||||
* if you do not require the atomic guarantees.
|
||||
* Note that @nr may be almost arbitrarily large; this function is not
|
||||
* restricted to acting on a single-word quantity.
|
||||
*
|
||||
* The address must be (at least) "long" aligned.
|
||||
* Note that there are driver (e.g., eepro100) which use these operations to
|
||||
* operate on hw-defined data-structures, so we can't easily change these
|
||||
* operations to force a bigger alignment.
|
||||
*
|
||||
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
||||
*/
|
||||
static __inline__ void
|
||||
set_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 bit, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
bit = 1 << (nr & 31);
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old | bit;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
}
|
||||
|
||||
/**
|
||||
* __set_bit - Set a bit in memory
|
||||
* @nr: the bit to set
|
||||
* @addr: the address to start counting from
|
||||
*
|
||||
* Unlike set_bit(), this function is non-atomic and may be reordered.
|
||||
* If it's called on the same region of memory simultaneously, the effect
|
||||
* may be that only one operation succeeds.
|
||||
*/
|
||||
static __inline__ void
|
||||
__set_bit (int nr, volatile void *addr)
|
||||
{
|
||||
*((__u32 *) addr + (nr >> 5)) |= (1 << (nr & 31));
|
||||
}
|
||||
|
||||
/**
|
||||
* clear_bit - Clears a bit in memory
|
||||
* @nr: Bit to clear
|
||||
* @addr: Address to start counting from
|
||||
*
|
||||
* clear_bit() is atomic and may not be reordered. However, it does
|
||||
* not contain a memory barrier, so if it is used for locking purposes,
|
||||
* you should call smp_mb__before_atomic() and/or smp_mb__after_atomic()
|
||||
* in order to ensure changes are visible on other processors.
|
||||
*/
|
||||
static __inline__ void
|
||||
clear_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 mask, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
mask = ~(1 << (nr & 31));
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old & mask;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
}
|
||||
|
||||
/**
|
||||
* clear_bit_unlock - Clears a bit in memory with release
|
||||
* @nr: Bit to clear
|
||||
* @addr: Address to start counting from
|
||||
*
|
||||
* clear_bit_unlock() is atomic and may not be reordered. It does
|
||||
* contain a memory barrier suitable for unlock type operations.
|
||||
*/
|
||||
static __inline__ void
|
||||
clear_bit_unlock (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 mask, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
mask = ~(1 << (nr & 31));
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old & mask;
|
||||
} while (cmpxchg_rel(m, old, new) != old);
|
||||
}
|
||||
|
||||
/**
|
||||
* __clear_bit_unlock - Non-atomically clears a bit in memory with release
|
||||
* @nr: Bit to clear
|
||||
* @addr: Address to start counting from
|
||||
*
|
||||
* Similarly to clear_bit_unlock, the implementation uses a store
|
||||
* with release semantics. See also arch_spin_unlock().
|
||||
*/
|
||||
static __inline__ void
|
||||
__clear_bit_unlock(int nr, void *addr)
|
||||
{
|
||||
__u32 * const m = (__u32 *) addr + (nr >> 5);
|
||||
__u32 const new = *m & ~(1 << (nr & 31));
|
||||
|
||||
ia64_st4_rel_nta(m, new);
|
||||
}
|
||||
|
||||
/**
|
||||
* __clear_bit - Clears a bit in memory (non-atomic version)
|
||||
* @nr: the bit to clear
|
||||
* @addr: the address to start counting from
|
||||
*
|
||||
* Unlike clear_bit(), this function is non-atomic and may be reordered.
|
||||
* If it's called on the same region of memory simultaneously, the effect
|
||||
* may be that only one operation succeeds.
|
||||
*/
|
||||
static __inline__ void
|
||||
__clear_bit (int nr, volatile void *addr)
|
||||
{
|
||||
*((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
|
||||
}
|
||||
|
||||
/**
|
||||
* change_bit - Toggle a bit in memory
|
||||
* @nr: Bit to toggle
|
||||
* @addr: Address to start counting from
|
||||
*
|
||||
* change_bit() is atomic and may not be reordered.
|
||||
* Note that @nr may be almost arbitrarily large; this function is not
|
||||
* restricted to acting on a single-word quantity.
|
||||
*/
|
||||
static __inline__ void
|
||||
change_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 bit, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
bit = (1 << (nr & 31));
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old ^ bit;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
}
|
||||
|
||||
/**
|
||||
* __change_bit - Toggle a bit in memory
|
||||
* @nr: the bit to toggle
|
||||
* @addr: the address to start counting from
|
||||
*
|
||||
* Unlike change_bit(), this function is non-atomic and may be reordered.
|
||||
* If it's called on the same region of memory simultaneously, the effect
|
||||
* may be that only one operation succeeds.
|
||||
*/
|
||||
static __inline__ void
|
||||
__change_bit (int nr, volatile void *addr)
|
||||
{
|
||||
*((__u32 *) addr + (nr >> 5)) ^= (1 << (nr & 31));
|
||||
}
|
||||
|
||||
/**
|
||||
* test_and_set_bit - Set a bit and return its old value
|
||||
* @nr: Bit to set
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is atomic and cannot be reordered.
|
||||
* It also implies the acquisition side of the memory barrier.
|
||||
*/
|
||||
static __inline__ int
|
||||
test_and_set_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 bit, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
bit = 1 << (nr & 31);
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old | bit;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
return (old & bit) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* test_and_set_bit_lock - Set a bit and return its old value for lock
|
||||
* @nr: Bit to set
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This is the same as test_and_set_bit on ia64
|
||||
*/
|
||||
#define test_and_set_bit_lock test_and_set_bit
|
||||
|
||||
/**
|
||||
* __test_and_set_bit - Set a bit and return its old value
|
||||
* @nr: Bit to set
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is non-atomic and can be reordered.
|
||||
* If two examples of this operation race, one can appear to succeed
|
||||
* but actually fail. You must protect multiple accesses with a lock.
|
||||
*/
|
||||
static __inline__ int
|
||||
__test_and_set_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 *p = (__u32 *) addr + (nr >> 5);
|
||||
__u32 m = 1 << (nr & 31);
|
||||
int oldbitset = (*p & m) != 0;
|
||||
|
||||
*p |= m;
|
||||
return oldbitset;
|
||||
}
|
||||
|
||||
/**
|
||||
* test_and_clear_bit - Clear a bit and return its old value
|
||||
* @nr: Bit to clear
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is atomic and cannot be reordered.
|
||||
* It also implies the acquisition side of the memory barrier.
|
||||
*/
|
||||
static __inline__ int
|
||||
test_and_clear_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 mask, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
mask = ~(1 << (nr & 31));
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old & mask;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
return (old & ~mask) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* __test_and_clear_bit - Clear a bit and return its old value
|
||||
* @nr: Bit to clear
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is non-atomic and can be reordered.
|
||||
* If two examples of this operation race, one can appear to succeed
|
||||
* but actually fail. You must protect multiple accesses with a lock.
|
||||
*/
|
||||
static __inline__ int
|
||||
__test_and_clear_bit(int nr, volatile void * addr)
|
||||
{
|
||||
__u32 *p = (__u32 *) addr + (nr >> 5);
|
||||
__u32 m = 1 << (nr & 31);
|
||||
int oldbitset = (*p & m) != 0;
|
||||
|
||||
*p &= ~m;
|
||||
return oldbitset;
|
||||
}
|
||||
|
||||
/**
|
||||
* test_and_change_bit - Change a bit and return its old value
|
||||
* @nr: Bit to change
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is atomic and cannot be reordered.
|
||||
* It also implies the acquisition side of the memory barrier.
|
||||
*/
|
||||
static __inline__ int
|
||||
test_and_change_bit (int nr, volatile void *addr)
|
||||
{
|
||||
__u32 bit, old, new;
|
||||
volatile __u32 *m;
|
||||
CMPXCHG_BUGCHECK_DECL
|
||||
|
||||
m = (volatile __u32 *) addr + (nr >> 5);
|
||||
bit = (1 << (nr & 31));
|
||||
do {
|
||||
CMPXCHG_BUGCHECK(m);
|
||||
old = *m;
|
||||
new = old ^ bit;
|
||||
} while (cmpxchg_acq(m, old, new) != old);
|
||||
return (old & bit) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* __test_and_change_bit - Change a bit and return its old value
|
||||
* @nr: Bit to change
|
||||
* @addr: Address to count from
|
||||
*
|
||||
* This operation is non-atomic and can be reordered.
|
||||
*/
|
||||
static __inline__ int
|
||||
__test_and_change_bit (int nr, void *addr)
|
||||
{
|
||||
__u32 old, bit = (1 << (nr & 31));
|
||||
__u32 *m = (__u32 *) addr + (nr >> 5);
|
||||
|
||||
old = *m;
|
||||
*m = old ^ bit;
|
||||
return (old & bit) != 0;
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
test_bit (int nr, const volatile void *addr)
|
||||
{
|
||||
return 1 & (((const volatile __u32 *) addr)[nr >> 5] >> (nr & 31));
|
||||
}
|
||||
|
||||
/**
|
||||
* ffz - find the first zero bit in a long word
|
||||
* @x: The long word to find the bit in
|
||||
*
|
||||
* Returns the bit-number (0..63) of the first (least significant) zero bit.
|
||||
* Undefined if no zero exists, so code should check against ~0UL first...
|
||||
*/
|
||||
static inline unsigned long
|
||||
ffz (unsigned long x)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = ia64_popcnt(x & (~x - 1));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* __ffs - find first bit in word.
|
||||
* @x: The word to search
|
||||
*
|
||||
* Undefined if no bit exists, so code should check against 0 first.
|
||||
*/
|
||||
static __inline__ unsigned long
|
||||
__ffs (unsigned long x)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = ia64_popcnt((x-1) & ~x);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* Return bit number of last (most-significant) bit set. Undefined
|
||||
* for x==0. Bits are numbered from 0..63 (e.g., ia64_fls(9) == 3).
|
||||
*/
|
||||
static inline unsigned long
|
||||
ia64_fls (unsigned long x)
|
||||
{
|
||||
long double d = x;
|
||||
long exp;
|
||||
|
||||
exp = ia64_getf_exp(d);
|
||||
return exp - 0xffff;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the last (most significant) bit set. Returns 0 for x==0 and
|
||||
* bits are numbered from 1..32 (e.g., fls(9) == 4).
|
||||
*/
|
||||
static inline int
|
||||
fls (int t)
|
||||
{
|
||||
unsigned long x = t & 0xffffffffu;
|
||||
|
||||
if (!x)
|
||||
return 0;
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
return ia64_popcnt(x);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the last (most significant) bit set. Undefined for x==0.
|
||||
* Bits are numbered from 0..63 (e.g., __fls(9) == 3).
|
||||
*/
|
||||
static inline unsigned long
|
||||
__fls (unsigned long x)
|
||||
{
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
x |= x >> 32;
|
||||
return ia64_popcnt(x) - 1;
|
||||
}
|
||||
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
|
||||
#include <asm-generic/bitops/builtin-ffs.h>
|
||||
|
||||
/*
|
||||
* hweightN: returns the hamming weight (i.e. the number
|
||||
* of bits set) of a N-bit word
|
||||
*/
|
||||
static __inline__ unsigned long __arch_hweight64(unsigned long x)
|
||||
{
|
||||
unsigned long result;
|
||||
result = ia64_popcnt(x);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define __arch_hweight32(x) ((unsigned int) __arch_hweight64((x) & 0xfffffffful))
|
||||
#define __arch_hweight16(x) ((unsigned int) __arch_hweight64((x) & 0xfffful))
|
||||
#define __arch_hweight8(x) ((unsigned int) __arch_hweight64((x) & 0xfful))
|
||||
|
||||
#include <asm-generic/bitops/const_hweight.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#include <asm-generic/bitops/find.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm-generic/bitops/le.h>
|
||||
|
||||
#include <asm-generic/bitops/ext2-atomic-setbit.h>
|
||||
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_IA64_BITOPS_H */
|
14
arch/ia64/include/asm/bug.h
Normal file
14
arch/ia64/include/asm/bug.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef _ASM_IA64_BUG_H
|
||||
#define _ASM_IA64_BUG_H
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#define ia64_abort() __builtin_trap()
|
||||
#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
|
||||
|
||||
/* should this BUG be made generic? */
|
||||
#define HAVE_ARCH_BUG
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
|
||||
#endif
|
19
arch/ia64/include/asm/bugs.h
Normal file
19
arch/ia64/include/asm/bugs.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* This is included by init/main.c to check for architecture-dependent bugs.
|
||||
*
|
||||
* Needs:
|
||||
* void check_bugs(void);
|
||||
*
|
||||
* Based on <asm-alpha/bugs.h>.
|
||||
*
|
||||
* Modified 1998, 1999, 2003
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
|
||||
*/
|
||||
#ifndef _ASM_IA64_BUGS_H
|
||||
#define _ASM_IA64_BUGS_H
|
||||
|
||||
#include <asm/processor.h>
|
||||
|
||||
extern void check_bugs (void);
|
||||
|
||||
#endif /* _ASM_IA64_BUGS_H */
|
29
arch/ia64/include/asm/cache.h
Normal file
29
arch/ia64/include/asm/cache.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef _ASM_IA64_CACHE_H
|
||||
#define _ASM_IA64_CACHE_H
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998-2000 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
/* Bytes per L1 (data) cache line. */
|
||||
#define L1_CACHE_SHIFT CONFIG_IA64_L1_CACHE_SHIFT
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
# define SMP_CACHE_SHIFT L1_CACHE_SHIFT
|
||||
# define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
#else
|
||||
/*
|
||||
* The "aligned" directive can only _increase_ alignment, so this is
|
||||
* safe and provides an easy way to avoid wasting space on a
|
||||
* uni-processor:
|
||||
*/
|
||||
# define SMP_CACHE_SHIFT 3
|
||||
# define SMP_CACHE_BYTES (1 << 3)
|
||||
#endif
|
||||
|
||||
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
|
||||
|
||||
#endif /* _ASM_IA64_CACHE_H */
|
54
arch/ia64/include/asm/cacheflush.h
Normal file
54
arch/ia64/include/asm/cacheflush.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#ifndef _ASM_IA64_CACHEFLUSH_H
|
||||
#define _ASM_IA64_CACHEFLUSH_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#include <linux/page-flags.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
/*
|
||||
* Cache flushing routines. This is the kind of stuff that can be very expensive, so try
|
||||
* to avoid them whenever possible.
|
||||
*/
|
||||
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
#define flush_icache_page(vma,page) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
|
||||
#define flush_dcache_page(page) \
|
||||
do { \
|
||||
clear_bit(PG_arch_1, &(page)->flags); \
|
||||
} while (0)
|
||||
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
|
||||
extern void flush_icache_range (unsigned long start, unsigned long end);
|
||||
extern void clflush_cache_range(void *addr, int size);
|
||||
|
||||
|
||||
#define flush_icache_user_range(vma, page, user_addr, len) \
|
||||
do { \
|
||||
unsigned long _addr = (unsigned long) page_address(page) + ((user_addr) & ~PAGE_MASK); \
|
||||
flush_icache_range(_addr, _addr + (len)); \
|
||||
} while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
do { memcpy(dst, src, len); \
|
||||
flush_icache_user_range(vma, page, vaddr, len); \
|
||||
} while (0)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
#endif /* _ASM_IA64_CACHEFLUSH_H */
|
79
arch/ia64/include/asm/checksum.h
Normal file
79
arch/ia64/include/asm/checksum.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
#ifndef _ASM_IA64_CHECKSUM_H
|
||||
#define _ASM_IA64_CHECKSUM_H
|
||||
|
||||
/*
|
||||
* Modified 1998, 1999
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* Computes the checksum of the TCP/UDP pseudo-header returns a 16-bit
|
||||
* checksum, already complemented
|
||||
*/
|
||||
extern __sum16 csum_tcpudp_magic (__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
__wsum sum);
|
||||
|
||||
extern __wsum csum_tcpudp_nofold (__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
__wsum sum);
|
||||
|
||||
/*
|
||||
* Computes the checksum of a memory block at buff, length len,
|
||||
* and adds in "sum" (32-bit)
|
||||
*
|
||||
* returns a 32-bit number suitable for feeding into itself
|
||||
* or csum_tcpudp_magic
|
||||
*
|
||||
* this function must be called with even lengths, except
|
||||
* for the last fragment, which may be odd
|
||||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
extern __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* Same as csum_partial, but copies from src while it checksums.
|
||||
*
|
||||
* Here it is even more important to align src and dst on a 32-bit (or
|
||||
* even better 64-bit) boundary.
|
||||
*/
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum,
|
||||
int *errp);
|
||||
|
||||
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* This routine is used for miscellaneous IP-like checksums, mainly in
|
||||
* icmp.c
|
||||
*/
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers.
|
||||
*/
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
u32 sum = (__force u32)csum;
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM 1
|
||||
struct in6_addr;
|
||||
extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr, __u32 len, unsigned short proto,
|
||||
__wsum csum);
|
||||
|
||||
#endif /* _ASM_IA64_CHECKSUM_H */
|
10
arch/ia64/include/asm/clocksource.h
Normal file
10
arch/ia64/include/asm/clocksource.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* IA64-specific clocksource additions */
|
||||
|
||||
#ifndef _ASM_IA64_CLOCKSOURCE_H
|
||||
#define _ASM_IA64_CLOCKSOURCE_H
|
||||
|
||||
struct arch_clocksource_data {
|
||||
void *fsys_mmio; /* used by fsyscall asm code */
|
||||
};
|
||||
|
||||
#endif /* _ASM_IA64_CLOCKSOURCE_H */
|
22
arch/ia64/include/asm/cpu.h
Normal file
22
arch/ia64/include/asm/cpu.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef _ASM_IA64_CPU_H_
|
||||
#define _ASM_IA64_CPU_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/topology.h>
|
||||
#include <linux/percpu.h>
|
||||
|
||||
struct ia64_cpu {
|
||||
struct cpu cpu;
|
||||
};
|
||||
|
||||
DECLARE_PER_CPU(struct ia64_cpu, cpu_devices);
|
||||
|
||||
DECLARE_PER_CPU(int, cpu_state);
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
extern int arch_register_cpu(int num);
|
||||
extern void arch_unregister_cpu(int);
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_IA64_CPU_H_ */
|
29
arch/ia64/include/asm/cputime.h
Normal file
29
arch/ia64/include/asm/cputime.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Definitions for measuring cputime on ia64 machines.
|
||||
*
|
||||
* Based on <asm-powerpc/cputime.h>.
|
||||
*
|
||||
* Copyright (C) 2007 FUJITSU LIMITED
|
||||
* Copyright (C) 2007 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.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.
|
||||
*
|
||||
* If we have CONFIG_VIRT_CPU_ACCOUNTING_NATIVE, we measure cpu time in nsec.
|
||||
* Otherwise we measure cpu time in jiffies using the generic definitions.
|
||||
*/
|
||||
|
||||
#ifndef __IA64_CPUTIME_H
|
||||
#define __IA64_CPUTIME_H
|
||||
|
||||
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
|
||||
# include <asm-generic/cputime.h>
|
||||
#else
|
||||
# include <asm/processor.h>
|
||||
# include <asm-generic/cputime_nsecs.h>
|
||||
extern void arch_vtime_task_switch(struct task_struct *tsk);
|
||||
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
|
||||
|
||||
#endif /* __IA64_CPUTIME_H */
|
17
arch/ia64/include/asm/current.h
Normal file
17
arch/ia64/include/asm/current.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifndef _ASM_IA64_CURRENT_H
|
||||
#define _ASM_IA64_CURRENT_H
|
||||
|
||||
/*
|
||||
* Modified 1998-2000
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
|
||||
*/
|
||||
|
||||
#include <asm/intrinsics.h>
|
||||
|
||||
/*
|
||||
* In kernel mode, thread pointer (r13) is used to point to the current task
|
||||
* structure.
|
||||
*/
|
||||
#define current ((struct task_struct *) ia64_getreg(_IA64_REG_TP))
|
||||
|
||||
#endif /* _ASM_IA64_CURRENT_H */
|
15
arch/ia64/include/asm/cyclone.h
Normal file
15
arch/ia64/include/asm/cyclone.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef ASM_IA64_CYCLONE_H
|
||||
#define ASM_IA64_CYCLONE_H
|
||||
|
||||
#ifdef CONFIG_IA64_CYCLONE
|
||||
extern int use_cyclone;
|
||||
extern void __init cyclone_setup(void);
|
||||
#else /* CONFIG_IA64_CYCLONE */
|
||||
#define use_cyclone 0
|
||||
static inline void cyclone_setup(void)
|
||||
{
|
||||
printk(KERN_ERR "Cyclone Counter: System not configured"
|
||||
" w/ CONFIG_IA64_CYCLONE.\n");
|
||||
}
|
||||
#endif /* CONFIG_IA64_CYCLONE */
|
||||
#endif /* !ASM_IA64_CYCLONE_H */
|
88
arch/ia64/include/asm/delay.h
Normal file
88
arch/ia64/include/asm/delay.h
Normal file
|
@ -0,0 +1,88 @@
|
|||
#ifndef _ASM_IA64_DELAY_H
|
||||
#define _ASM_IA64_DELAY_H
|
||||
|
||||
/*
|
||||
* Delay routines using a pre-computed "cycles/usec" value.
|
||||
*
|
||||
* Copyright (C) 1998, 1999 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 VA Linux Systems
|
||||
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
|
||||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
|
||||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#include <asm/intrinsics.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
static __inline__ void
|
||||
ia64_set_itm (unsigned long val)
|
||||
{
|
||||
ia64_setreg(_IA64_REG_CR_ITM, val);
|
||||
ia64_srlz_d();
|
||||
}
|
||||
|
||||
static __inline__ unsigned long
|
||||
ia64_get_itm (void)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = ia64_getreg(_IA64_REG_CR_ITM);
|
||||
ia64_srlz_d();
|
||||
return result;
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
ia64_set_itv (unsigned long val)
|
||||
{
|
||||
ia64_setreg(_IA64_REG_CR_ITV, val);
|
||||
ia64_srlz_d();
|
||||
}
|
||||
|
||||
static __inline__ unsigned long
|
||||
ia64_get_itv (void)
|
||||
{
|
||||
return ia64_getreg(_IA64_REG_CR_ITV);
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
ia64_set_itc (unsigned long val)
|
||||
{
|
||||
ia64_setreg(_IA64_REG_AR_ITC, val);
|
||||
ia64_srlz_d();
|
||||
}
|
||||
|
||||
static __inline__ unsigned long
|
||||
ia64_get_itc (void)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = ia64_getreg(_IA64_REG_AR_ITC);
|
||||
ia64_barrier();
|
||||
#ifdef CONFIG_ITANIUM
|
||||
while (unlikely((__s32) result == -1)) {
|
||||
result = ia64_getreg(_IA64_REG_AR_ITC);
|
||||
ia64_barrier();
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
extern void ia64_delay_loop (unsigned long loops);
|
||||
|
||||
static __inline__ void
|
||||
__delay (unsigned long loops)
|
||||
{
|
||||
if (unlikely(loops < 1))
|
||||
return;
|
||||
|
||||
ia64_delay_loop (loops - 1);
|
||||
}
|
||||
|
||||
extern void udelay (unsigned long usecs);
|
||||
|
||||
#endif /* _ASM_IA64_DELAY_H */
|
18
arch/ia64/include/asm/device.h
Normal file
18
arch/ia64/include/asm/device.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_IA64_DEVICE_H
|
||||
#define _ASM_IA64_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_INTEL_IOMMU
|
||||
void *iommu; /* hook for IOMMU specific extension */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct pdev_archdata {
|
||||
};
|
||||
|
||||
#endif /* _ASM_IA64_DEVICE_H */
|
1
arch/ia64/include/asm/div64.h
Normal file
1
arch/ia64/include/asm/div64.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/div64.h>
|
109
arch/ia64/include/asm/dma-mapping.h
Normal file
109
arch/ia64/include/asm/dma-mapping.h
Normal file
|
@ -0,0 +1,109 @@
|
|||
#ifndef _ASM_IA64_DMA_MAPPING_H
|
||||
#define _ASM_IA64_DMA_MAPPING_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2003-2004 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
#include <asm/machvec.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <asm/swiotlb.h>
|
||||
#include <linux/dma-debug.h>
|
||||
|
||||
#define ARCH_HAS_DMA_GET_REQUIRED_MASK
|
||||
|
||||
#define DMA_ERROR_CODE 0
|
||||
|
||||
extern struct dma_map_ops *dma_ops;
|
||||
extern struct ia64_machine_vector ia64_mv;
|
||||
extern void set_iommu_machvec(void);
|
||||
|
||||
extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t,
|
||||
enum dma_data_direction);
|
||||
extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int,
|
||||
enum dma_data_direction);
|
||||
|
||||
#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
|
||||
|
||||
static inline void *dma_alloc_attrs(struct device *dev, size_t size,
|
||||
dma_addr_t *daddr, gfp_t gfp,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
struct dma_map_ops *ops = platform_dma_get_ops(dev);
|
||||
void *caddr;
|
||||
|
||||
caddr = ops->alloc(dev, size, daddr, gfp, attrs);
|
||||
debug_dma_alloc_coherent(dev, size, *daddr, caddr);
|
||||
return caddr;
|
||||
}
|
||||
|
||||
#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
|
||||
|
||||
static inline void dma_free_attrs(struct device *dev, size_t size,
|
||||
void *caddr, dma_addr_t daddr,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
struct dma_map_ops *ops = platform_dma_get_ops(dev);
|
||||
debug_dma_free_coherent(dev, size, caddr, daddr);
|
||||
ops->free(dev, size, caddr, daddr, attrs);
|
||||
}
|
||||
|
||||
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
||||
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
||||
|
||||
#define get_dma_ops(dev) platform_dma_get_ops(dev)
|
||||
|
||||
#include <asm-generic/dma-mapping-common.h>
|
||||
|
||||
static inline int dma_mapping_error(struct device *dev, dma_addr_t daddr)
|
||||
{
|
||||
struct dma_map_ops *ops = platform_dma_get_ops(dev);
|
||||
debug_dma_mapping_error(dev, daddr);
|
||||
return ops->mapping_error(dev, daddr);
|
||||
}
|
||||
|
||||
static inline int dma_supported(struct device *dev, u64 mask)
|
||||
{
|
||||
struct dma_map_ops *ops = platform_dma_get_ops(dev);
|
||||
return ops->dma_supported(dev, mask);
|
||||
}
|
||||
|
||||
static inline int
|
||||
dma_set_mask (struct device *dev, u64 mask)
|
||||
{
|
||||
if (!dev->dma_mask || !dma_supported(dev, mask))
|
||||
return -EIO;
|
||||
*dev->dma_mask = mask;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
|
||||
{
|
||||
if (!dev->dma_mask)
|
||||
return 0;
|
||||
|
||||
return addr + size - 1 <= *dev->dma_mask;
|
||||
}
|
||||
|
||||
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
|
||||
{
|
||||
return paddr;
|
||||
}
|
||||
|
||||
static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
|
||||
{
|
||||
return daddr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_cache_sync (struct device *dev, void *vaddr, size_t size,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
/*
|
||||
* IA-64 is cache-coherent, so this is mostly a no-op. However, we do need to
|
||||
* ensure that dma_cache_sync() enforces order, hence the mb().
|
||||
*/
|
||||
mb();
|
||||
}
|
||||
|
||||
#endif /* _ASM_IA64_DMA_MAPPING_H */
|
24
arch/ia64/include/asm/dma.h
Normal file
24
arch/ia64/include/asm/dma.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef _ASM_IA64_DMA_H
|
||||
#define _ASM_IA64_DMA_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1998-2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <asm/io.h> /* need byte IO */
|
||||
|
||||
extern unsigned long MAX_DMA_ADDRESS;
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
extern int isa_dma_bridge_buggy;
|
||||
#else
|
||||
# define isa_dma_bridge_buggy (0)
|
||||
#endif
|
||||
|
||||
#define free_dma(x)
|
||||
|
||||
void dma_mark_clean(void *addr, size_t size);
|
||||
|
||||
#endif /* _ASM_IA64_DMA_H */
|
14
arch/ia64/include/asm/dmi.h
Normal file
14
arch/ia64/include/asm/dmi.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef _ASM_DMI_H
|
||||
#define _ASM_DMI_H 1
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
/* Use normal IO mappings for DMI */
|
||||
#define dmi_early_remap ioremap
|
||||
#define dmi_early_unmap(x, l) iounmap(x)
|
||||
#define dmi_remap ioremap
|
||||
#define dmi_unmap iounmap
|
||||
#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC)
|
||||
|
||||
#endif
|
234
arch/ia64/include/asm/elf.h
Normal file
234
arch/ia64/include/asm/elf.h
Normal file
|
@ -0,0 +1,234 @@
|
|||
#ifndef _ASM_IA64_ELF_H
|
||||
#define _ASM_IA64_ELF_H
|
||||
|
||||
/*
|
||||
* ELF-specific definitions.
|
||||
*
|
||||
* Copyright (C) 1998-1999, 2002-2004 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/auxvec.h>
|
||||
|
||||
/*
|
||||
* This is used to ensure we don't load something for the wrong architecture.
|
||||
*/
|
||||
#define elf_check_arch(x) ((x)->e_machine == EM_IA_64)
|
||||
|
||||
/*
|
||||
* These are used to set parameters in the core dumps.
|
||||
*/
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
#define ELF_DATA ELFDATA2LSB
|
||||
#define ELF_ARCH EM_IA_64
|
||||
|
||||
#define CORE_DUMP_USE_REGSET
|
||||
|
||||
/* Least-significant four bits of ELF header's e_flags are OS-specific. The bits are
|
||||
interpreted as follows by Linux: */
|
||||
#define EF_IA_64_LINUX_EXECUTABLE_STACK 0x1 /* is stack (& heap) executable by default? */
|
||||
|
||||
#define ELF_EXEC_PAGESIZE PAGE_SIZE
|
||||
|
||||
/*
|
||||
* This is the location that an ET_DYN program is loaded if exec'ed.
|
||||
* Typical use of this is to invoke "./ld.so someprog" to test out a
|
||||
* new version of the loader. We need to make sure that it is out of
|
||||
* the way of the program that it will "exec", and that there is
|
||||
* sufficient room for the brk.
|
||||
*/
|
||||
#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x800000000UL)
|
||||
|
||||
#define PT_IA_64_UNWIND 0x70000001
|
||||
|
||||
/* IA-64 relocations: */
|
||||
#define R_IA64_NONE 0x00 /* none */
|
||||
#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */
|
||||
#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */
|
||||
#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */
|
||||
#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */
|
||||
#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */
|
||||
#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */
|
||||
#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */
|
||||
#define R_IA64_GPREL22 0x2a /* @gprel(sym+add), add imm22 */
|
||||
#define R_IA64_GPREL64I 0x2b /* @gprel(sym+add), mov imm64 */
|
||||
#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym+add), data4 MSB */
|
||||
#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym+add), data4 LSB */
|
||||
#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym+add), data8 MSB */
|
||||
#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym+add), data8 LSB */
|
||||
#define R_IA64_LTOFF22 0x32 /* @ltoff(sym+add), add imm22 */
|
||||
#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym+add), mov imm64 */
|
||||
#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym+add), add imm22 */
|
||||
#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym+add), mov imm64 */
|
||||
#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym+add), data8 MSB */
|
||||
#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym+add), data8 LSB */
|
||||
#define R_IA64_FPTR64I 0x43 /* @fptr(sym+add), mov imm64 */
|
||||
#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym+add), data4 MSB */
|
||||
#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym+add), data4 LSB */
|
||||
#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym+add), data8 MSB */
|
||||
#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym+add), data8 LSB */
|
||||
#define R_IA64_PCREL60B 0x48 /* @pcrel(sym+add), brl */
|
||||
#define R_IA64_PCREL21B 0x49 /* @pcrel(sym+add), ptb, call */
|
||||
#define R_IA64_PCREL21M 0x4a /* @pcrel(sym+add), chk.s */
|
||||
#define R_IA64_PCREL21F 0x4b /* @pcrel(sym+add), fchkf */
|
||||
#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym+add), data4 MSB */
|
||||
#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym+add), data4 LSB */
|
||||
#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym+add), data8 MSB */
|
||||
#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym+add), data8 LSB */
|
||||
#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */
|
||||
#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */
|
||||
#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), 4 MSB */
|
||||
#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), 4 LSB */
|
||||
#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), 8 MSB */
|
||||
#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), 8 LSB */
|
||||
#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym+add), data4 MSB */
|
||||
#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym+add), data4 LSB */
|
||||
#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym+add), data8 MSB */
|
||||
#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym+add), data8 LSB */
|
||||
#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym+add), data4 MSB */
|
||||
#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym+add), data4 LSB */
|
||||
#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym+add), data8 MSB */
|
||||
#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym+add), data8 LSB */
|
||||
#define R_IA64_REL32MSB 0x6c /* data 4 + REL */
|
||||
#define R_IA64_REL32LSB 0x6d /* data 4 + REL */
|
||||
#define R_IA64_REL64MSB 0x6e /* data 8 + REL */
|
||||
#define R_IA64_REL64LSB 0x6f /* data 8 + REL */
|
||||
#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */
|
||||
#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */
|
||||
#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */
|
||||
#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */
|
||||
#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym+add), ptb, call */
|
||||
#define R_IA64_PCREL22 0x7a /* @pcrel(sym+add), imm22 */
|
||||
#define R_IA64_PCREL64I 0x7b /* @pcrel(sym+add), imm64 */
|
||||
#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
|
||||
#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
|
||||
#define R_IA64_COPY 0x84 /* dynamic reloc, data copy */
|
||||
#define R_IA64_SUB 0x85 /* -symbol + addend, add imm22 */
|
||||
#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
|
||||
#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
|
||||
#define R_IA64_TPREL14 0x91 /* @tprel(sym+add), add imm14 */
|
||||
#define R_IA64_TPREL22 0x92 /* @tprel(sym+add), add imm22 */
|
||||
#define R_IA64_TPREL64I 0x93 /* @tprel(sym+add), add imm64 */
|
||||
#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym+add), data8 MSB */
|
||||
#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym+add), data8 LSB */
|
||||
#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), add imm22 */
|
||||
#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym+add), data8 MSB */
|
||||
#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym+add), data8 LSB */
|
||||
#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(s+a)), imm22 */
|
||||
#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym+add), imm14 */
|
||||
#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym+add), imm22 */
|
||||
#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym+add), imm64 */
|
||||
#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym+add), data4 MSB */
|
||||
#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym+add), data4 LSB */
|
||||
#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym+add), data8 MSB */
|
||||
#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym+add), data8 LSB */
|
||||
#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */
|
||||
|
||||
/* IA-64 specific section flags: */
|
||||
#define SHF_IA_64_SHORT 0x10000000 /* section near gp */
|
||||
|
||||
/*
|
||||
* We use (abuse?) this macro to insert the (empty) vm_area that is
|
||||
* used to map the register backing store. I don't see any better
|
||||
* place to do this, but we should discuss this with Linus once we can
|
||||
* talk to him...
|
||||
*/
|
||||
extern void ia64_init_addr_space (void);
|
||||
#define ELF_PLAT_INIT(_r, load_addr) ia64_init_addr_space()
|
||||
|
||||
/* ELF register definitions. This is needed for core dump support. */
|
||||
|
||||
/*
|
||||
* elf_gregset_t contains the application-level state in the following order:
|
||||
* r0-r31
|
||||
* NaT bits (for r0-r31; bit N == 1 iff rN is a NaT)
|
||||
* predicate registers (p0-p63)
|
||||
* b0-b7
|
||||
* ip cfm psr
|
||||
* ar.rsc ar.bsp ar.bspstore ar.rnat
|
||||
* ar.ccv ar.unat ar.fpsr ar.pfs ar.lc ar.ec ar.csd ar.ssd
|
||||
*/
|
||||
#define ELF_NGREG 128 /* we really need just 72 but let's leave some headroom... */
|
||||
#define ELF_NFPREG 128 /* f0 and f1 could be omitted, but so what... */
|
||||
|
||||
/* elf_gregset_t register offsets */
|
||||
#define ELF_GR_0_OFFSET 0
|
||||
#define ELF_NAT_OFFSET (32 * sizeof(elf_greg_t))
|
||||
#define ELF_PR_OFFSET (33 * sizeof(elf_greg_t))
|
||||
#define ELF_BR_0_OFFSET (34 * sizeof(elf_greg_t))
|
||||
#define ELF_CR_IIP_OFFSET (42 * sizeof(elf_greg_t))
|
||||
#define ELF_CFM_OFFSET (43 * sizeof(elf_greg_t))
|
||||
#define ELF_CR_IPSR_OFFSET (44 * sizeof(elf_greg_t))
|
||||
#define ELF_GR_OFFSET(i) (ELF_GR_0_OFFSET + i * sizeof(elf_greg_t))
|
||||
#define ELF_BR_OFFSET(i) (ELF_BR_0_OFFSET + i * sizeof(elf_greg_t))
|
||||
#define ELF_AR_RSC_OFFSET (45 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_BSP_OFFSET (46 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_BSPSTORE_OFFSET (47 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_RNAT_OFFSET (48 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_CCV_OFFSET (49 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_UNAT_OFFSET (50 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_FPSR_OFFSET (51 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_PFS_OFFSET (52 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_LC_OFFSET (53 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_EC_OFFSET (54 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_CSD_OFFSET (55 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_SSD_OFFSET (56 * sizeof(elf_greg_t))
|
||||
#define ELF_AR_END_OFFSET (57 * sizeof(elf_greg_t))
|
||||
|
||||
typedef unsigned long elf_fpxregset_t;
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
typedef struct ia64_fpreg elf_fpreg_t;
|
||||
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
|
||||
|
||||
|
||||
|
||||
struct pt_regs; /* forward declaration... */
|
||||
extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
|
||||
#define ELF_CORE_COPY_REGS(_dest,_regs) ia64_elf_core_copy_regs(_regs, _dest);
|
||||
|
||||
/* This macro yields a bitmask that programs can use to figure out
|
||||
what instruction set this CPU supports. */
|
||||
#define ELF_HWCAP 0
|
||||
|
||||
/* This macro yields a string that ld.so will use to load
|
||||
implementation specific libraries for optimization. Not terribly
|
||||
relevant until we have real hardware to play with... */
|
||||
#define ELF_PLATFORM NULL
|
||||
|
||||
#define elf_read_implies_exec(ex, executable_stack) \
|
||||
((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
|
||||
|
||||
struct task_struct;
|
||||
|
||||
#define GATE_EHDR ((const struct elfhdr *) GATE_ADDR)
|
||||
|
||||
/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
|
||||
#define ARCH_DLINFO \
|
||||
do { \
|
||||
extern char __kernel_syscall_via_epc[]; \
|
||||
NEW_AUX_ENT(AT_SYSINFO, (unsigned long) __kernel_syscall_via_epc); \
|
||||
NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* format for entries in the Global Offset Table
|
||||
*/
|
||||
struct got_entry {
|
||||
uint64_t val;
|
||||
};
|
||||
|
||||
/*
|
||||
* Layout of the Function Descriptor
|
||||
*/
|
||||
struct fdesc {
|
||||
uint64_t ip;
|
||||
uint64_t gp;
|
||||
};
|
||||
|
||||
#endif /* _ASM_IA64_ELF_H */
|
6
arch/ia64/include/asm/emergency-restart.h
Normal file
6
arch/ia64/include/asm/emergency-restart.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _ASM_EMERGENCY_RESTART_H
|
||||
#define _ASM_EMERGENCY_RESTART_H
|
||||
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
|
||||
#endif /* _ASM_EMERGENCY_RESTART_H */
|
29
arch/ia64/include/asm/esi.h
Normal file
29
arch/ia64/include/asm/esi.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* ESI service calls.
|
||||
*
|
||||
* Copyright (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P.
|
||||
* Alex Williamson <alex.williamson@hp.com>
|
||||
*/
|
||||
#ifndef esi_h
|
||||
#define esi_h
|
||||
|
||||
#include <linux/efi.h>
|
||||
|
||||
#define ESI_QUERY 0x00000001
|
||||
#define ESI_OPEN_HANDLE 0x02000000
|
||||
#define ESI_CLOSE_HANDLE 0x02000001
|
||||
|
||||
enum esi_proc_type {
|
||||
ESI_PROC_SERIALIZED, /* calls need to be serialized */
|
||||
ESI_PROC_MP_SAFE, /* MP-safe, but not reentrant */
|
||||
ESI_PROC_REENTRANT /* MP-safe and reentrant */
|
||||
};
|
||||
|
||||
extern struct ia64_sal_retval esi_call_phys (void *, u64 *);
|
||||
extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *,
|
||||
enum esi_proc_type,
|
||||
u64, u64, u64, u64, u64, u64, u64, u64);
|
||||
extern int ia64_esi_call_phys(efi_guid_t, struct ia64_sal_retval *, u64, u64,
|
||||
u64, u64, u64, u64, u64, u64);
|
||||
|
||||
#endif /* esi_h */
|
23
arch/ia64/include/asm/fb.h
Normal file
23
arch/ia64/include/asm/fb.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef _ASM_FB_H_
|
||||
#define _ASM_FB_H_
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/efi.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
|
||||
unsigned long off)
|
||||
{
|
||||
if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
else
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
}
|
||||
|
||||
static inline int fb_is_primary_device(struct fb_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _ASM_FB_H_ */
|
73
arch/ia64/include/asm/fpswa.h
Normal file
73
arch/ia64/include/asm/fpswa.h
Normal file
|
@ -0,0 +1,73 @@
|
|||
#ifndef _ASM_IA64_FPSWA_H
|
||||
#define _ASM_IA64_FPSWA_H
|
||||
|
||||
/*
|
||||
* Floating-point Software Assist
|
||||
*
|
||||
* Copyright (C) 1999 Intel Corporation.
|
||||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
|
||||
* Copyright (C) 1999 Goutham Rao <goutham.rao@intel.com>
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* 4 * 128 bits */
|
||||
unsigned long fp_lp[4*2];
|
||||
} fp_state_low_preserved_t;
|
||||
|
||||
typedef struct {
|
||||
/* 10 * 128 bits */
|
||||
unsigned long fp_lv[10 * 2];
|
||||
} fp_state_low_volatile_t;
|
||||
|
||||
typedef struct {
|
||||
/* 16 * 128 bits */
|
||||
unsigned long fp_hp[16 * 2];
|
||||
} fp_state_high_preserved_t;
|
||||
|
||||
typedef struct {
|
||||
/* 96 * 128 bits */
|
||||
unsigned long fp_hv[96 * 2];
|
||||
} fp_state_high_volatile_t;
|
||||
|
||||
/**
|
||||
* floating point state to be passed to the FP emulation library by
|
||||
* the trap/fault handler
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long bitmask_low64;
|
||||
unsigned long bitmask_high64;
|
||||
fp_state_low_preserved_t *fp_state_low_preserved;
|
||||
fp_state_low_volatile_t *fp_state_low_volatile;
|
||||
fp_state_high_preserved_t *fp_state_high_preserved;
|
||||
fp_state_high_volatile_t *fp_state_high_volatile;
|
||||
} fp_state_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned long status;
|
||||
unsigned long err0;
|
||||
unsigned long err1;
|
||||
unsigned long err2;
|
||||
} fpswa_ret_t;
|
||||
|
||||
/**
|
||||
* function header for the Floating Point software assist
|
||||
* library. This function is invoked by the Floating point software
|
||||
* assist trap/fault handler.
|
||||
*/
|
||||
typedef fpswa_ret_t (*efi_fpswa_t) (unsigned long trap_type, void *bundle, unsigned long *ipsr,
|
||||
unsigned long *fsr, unsigned long *isr, unsigned long *preds,
|
||||
unsigned long *ifs, fp_state_t *fp_state);
|
||||
|
||||
/**
|
||||
* This is the FPSWA library interface as defined by EFI. We need to pass a
|
||||
* pointer to the interface itself on a call to the assist library
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int revision;
|
||||
unsigned int reserved;
|
||||
efi_fpswa_t fpswa;
|
||||
} fpswa_interface_t;
|
||||
|
||||
extern fpswa_interface_t *fpswa_interface;
|
||||
|
||||
#endif /* _ASM_IA64_FPSWA_H */
|
27
arch/ia64/include/asm/ftrace.h
Normal file
27
arch/ia64/include/asm/ftrace.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef _ASM_IA64_FTRACE_H
|
||||
#define _ASM_IA64_FTRACE_H
|
||||
|
||||
#ifdef CONFIG_FUNCTION_TRACER
|
||||
#define MCOUNT_INSN_SIZE 32 /* sizeof mcount call */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
extern void _mcount(unsigned long pfs, unsigned long r1, unsigned long b0, unsigned long r0);
|
||||
#define mcount _mcount
|
||||
|
||||
/* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */
|
||||
#define MCOUNT_ADDR (((struct fnptr *)mcount)->ip)
|
||||
#define FTRACE_ADDR (((struct fnptr *)ftrace_caller)->ip)
|
||||
|
||||
static inline unsigned long ftrace_call_adjust(unsigned long addr)
|
||||
{
|
||||
/* second bundle, insn 2 */
|
||||
return addr - 0x12;
|
||||
}
|
||||
|
||||
struct dyn_arch_ftrace {
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_FUNCTION_TRACER */
|
||||
|
||||
#endif /* _ASM_IA64_FTRACE_H */
|
126
arch/ia64/include/asm/futex.h
Normal file
126
arch/ia64/include/asm/futex.h
Normal file
|
@ -0,0 +1,126 @@
|
|||
#ifndef _ASM_FUTEX_H
|
||||
#define _ASM_FUTEX_H
|
||||
|
||||
#include <linux/futex.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/errno.h>
|
||||
|
||||
#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
|
||||
do { \
|
||||
register unsigned long r8 __asm ("r8") = 0; \
|
||||
__asm__ __volatile__( \
|
||||
" mf;; \n" \
|
||||
"[1:] " insn ";; \n" \
|
||||
" .xdata4 \"__ex_table\", 1b-., 2f-. \n" \
|
||||
"[2:]" \
|
||||
: "+r" (r8), "=r" (oldval) \
|
||||
: "r" (uaddr), "r" (oparg) \
|
||||
: "memory"); \
|
||||
ret = r8; \
|
||||
} while (0)
|
||||
|
||||
#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
|
||||
do { \
|
||||
register unsigned long r8 __asm ("r8") = 0; \
|
||||
int val, newval; \
|
||||
do { \
|
||||
__asm__ __volatile__( \
|
||||
" mf;; \n" \
|
||||
"[1:] ld4 %3=[%4];; \n" \
|
||||
" mov %2=%3 \n" \
|
||||
insn ";; \n" \
|
||||
" mov ar.ccv=%2;; \n" \
|
||||
"[2:] cmpxchg4.acq %1=[%4],%3,ar.ccv;; \n" \
|
||||
" .xdata4 \"__ex_table\", 1b-., 3f-.\n" \
|
||||
" .xdata4 \"__ex_table\", 2b-., 3f-.\n" \
|
||||
"[3:]" \
|
||||
: "+r" (r8), "=r" (val), "=&r" (oldval), \
|
||||
"=&r" (newval) \
|
||||
: "r" (uaddr), "r" (oparg) \
|
||||
: "memory"); \
|
||||
if (unlikely (r8)) \
|
||||
break; \
|
||||
} while (unlikely (val != oldval)); \
|
||||
ret = r8; \
|
||||
} while (0)
|
||||
|
||||
static inline int
|
||||
futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
|
||||
{
|
||||
int op = (encoded_op >> 28) & 7;
|
||||
int cmp = (encoded_op >> 24) & 15;
|
||||
int oparg = (encoded_op << 8) >> 20;
|
||||
int cmparg = (encoded_op << 20) >> 20;
|
||||
int oldval = 0, ret;
|
||||
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
|
||||
oparg = 1 << oparg;
|
||||
|
||||
if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
pagefault_disable();
|
||||
|
||||
switch (op) {
|
||||
case FUTEX_OP_SET:
|
||||
__futex_atomic_op1("xchg4 %1=[%2],%3", ret, oldval, uaddr,
|
||||
oparg);
|
||||
break;
|
||||
case FUTEX_OP_ADD:
|
||||
__futex_atomic_op2("add %3=%3,%5", ret, oldval, uaddr, oparg);
|
||||
break;
|
||||
case FUTEX_OP_OR:
|
||||
__futex_atomic_op2("or %3=%3,%5", ret, oldval, uaddr, oparg);
|
||||
break;
|
||||
case FUTEX_OP_ANDN:
|
||||
__futex_atomic_op2("and %3=%3,%5", ret, oldval, uaddr,
|
||||
~oparg);
|
||||
break;
|
||||
case FUTEX_OP_XOR:
|
||||
__futex_atomic_op2("xor %3=%3,%5", ret, oldval, uaddr, oparg);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOSYS;
|
||||
}
|
||||
|
||||
pagefault_enable();
|
||||
|
||||
if (!ret) {
|
||||
switch (cmp) {
|
||||
case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
|
||||
case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
|
||||
case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
|
||||
case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
|
||||
case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
|
||||
case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
|
||||
default: ret = -ENOSYS;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int
|
||||
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
|
||||
u32 oldval, u32 newval)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
{
|
||||
register unsigned long r8 __asm ("r8") = 0;
|
||||
unsigned long prev;
|
||||
__asm__ __volatile__(
|
||||
" mf;; \n"
|
||||
" mov ar.ccv=%4;; \n"
|
||||
"[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n"
|
||||
" .xdata4 \"__ex_table\", 1b-., 2f-. \n"
|
||||
"[2:]"
|
||||
: "+r" (r8), "=&r" (prev)
|
||||
: "r" (uaddr), "r" (newval),
|
||||
"rO" ((long) (unsigned) oldval)
|
||||
: "memory");
|
||||
*uval = prev;
|
||||
return r8;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _ASM_FUTEX_H */
|
12
arch/ia64/include/asm/gcc_intrin.h
Normal file
12
arch/ia64/include/asm/gcc_intrin.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
*
|
||||
* Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com>
|
||||
* Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
|
||||
*/
|
||||
#ifndef _ASM_IA64_GCC_INTRIN_H
|
||||
#define _ASM_IA64_GCC_INTRIN_H
|
||||
|
||||
#include <uapi/asm/gcc_intrin.h>
|
||||
|
||||
register unsigned long ia64_r13 asm ("r13") __used;
|
||||
#endif /* _ASM_IA64_GCC_INTRIN_H */
|
4
arch/ia64/include/asm/gpio.h
Normal file
4
arch/ia64/include/asm/gpio.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ifndef __LINUX_GPIO_H
|
||||
#warning Include linux/gpio.h instead of asm/gpio.h
|
||||
#include <linux/gpio.h>
|
||||
#endif
|
26
arch/ia64/include/asm/hardirq.h
Normal file
26
arch/ia64/include/asm/hardirq.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef _ASM_IA64_HARDIRQ_H
|
||||
#define _ASM_IA64_HARDIRQ_H
|
||||
|
||||
/*
|
||||
* Modified 1998-2002, 2004 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* No irq_cpustat_t for IA-64. The data is held in the per-CPU data structure.
|
||||
*/
|
||||
|
||||
#define __ARCH_IRQ_STAT 1
|
||||
|
||||
#define local_softirq_pending() (local_cpu_data->softirq_pending)
|
||||
|
||||
#include <linux/threads.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
|
||||
extern void __iomem *ipi_base_addr;
|
||||
|
||||
void ack_bad_irq(unsigned int irq);
|
||||
|
||||
#endif /* _ASM_IA64_HARDIRQ_H */
|
16
arch/ia64/include/asm/hpsim.h
Normal file
16
arch/ia64/include/asm/hpsim.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef _ASMIA64_HPSIM_H
|
||||
#define _ASMIA64_HPSIM_H
|
||||
|
||||
#ifndef CONFIG_HP_SIMSERIAL_CONSOLE
|
||||
static inline int simcons_register(void) { return 1; }
|
||||
#else
|
||||
int simcons_register(void);
|
||||
#endif
|
||||
|
||||
struct tty_driver;
|
||||
extern struct tty_driver *hp_simserial_driver;
|
||||
|
||||
extern int hpsim_get_irq(int intr);
|
||||
void ia64_ctl_trace(long on);
|
||||
|
||||
#endif
|
85
arch/ia64/include/asm/hugetlb.h
Normal file
85
arch/ia64/include/asm/hugetlb.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
#ifndef _ASM_IA64_HUGETLB_H
|
||||
#define _ASM_IA64_HUGETLB_H
|
||||
|
||||
#include <asm/page.h>
|
||||
#include <asm-generic/hugetlb.h>
|
||||
|
||||
|
||||
void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
|
||||
unsigned long end, unsigned long floor,
|
||||
unsigned long ceiling);
|
||||
|
||||
int prepare_hugepage_range(struct file *file,
|
||||
unsigned long addr, unsigned long len);
|
||||
|
||||
static inline int is_hugepage_only_range(struct mm_struct *mm,
|
||||
unsigned long addr,
|
||||
unsigned long len)
|
||||
{
|
||||
return (REGION_NUMBER(addr) == RGN_HPAGE ||
|
||||
REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
|
||||
}
|
||||
|
||||
static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||
pte_t *ptep, pte_t pte)
|
||||
{
|
||||
set_pte_at(mm, addr, ptep, pte);
|
||||
}
|
||||
|
||||
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
|
||||
unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
return ptep_get_and_clear(mm, addr, ptep);
|
||||
}
|
||||
|
||||
static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
|
||||
unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int huge_pte_none(pte_t pte)
|
||||
{
|
||||
return pte_none(pte);
|
||||
}
|
||||
|
||||
static inline pte_t huge_pte_wrprotect(pte_t pte)
|
||||
{
|
||||
return pte_wrprotect(pte);
|
||||
}
|
||||
|
||||
static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
|
||||
unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
ptep_set_wrprotect(mm, addr, ptep);
|
||||
}
|
||||
|
||||
static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
||||
unsigned long addr, pte_t *ptep,
|
||||
pte_t pte, int dirty)
|
||||
{
|
||||
return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
|
||||
}
|
||||
|
||||
static inline pte_t huge_ptep_get(pte_t *ptep)
|
||||
{
|
||||
return *ptep;
|
||||
}
|
||||
|
||||
static inline int arch_prepare_hugepage(struct page *page)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void arch_release_hugepage(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void arch_clear_hugepage_flags(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* _ASM_IA64_HUGETLB_H */
|
194
arch/ia64/include/asm/hw_irq.h
Normal file
194
arch/ia64/include/asm/hw_irq.h
Normal file
|
@ -0,0 +1,194 @@
|
|||
#ifndef _ASM_IA64_HW_IRQ_H
|
||||
#define _ASM_IA64_HW_IRQ_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/profile.h>
|
||||
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/smp.h>
|
||||
|
||||
#ifndef CONFIG_PARAVIRT
|
||||
typedef u8 ia64_vector;
|
||||
#else
|
||||
typedef u16 ia64_vector;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 0 special
|
||||
*
|
||||
* 1,3-14 are reserved from firmware
|
||||
*
|
||||
* 16-255 (vectored external interrupts) are available
|
||||
*
|
||||
* 15 spurious interrupt (see IVR)
|
||||
*
|
||||
* 16 lowest priority, 255 highest priority
|
||||
*
|
||||
* 15 classes of 16 interrupts each.
|
||||
*/
|
||||
#define IA64_MIN_VECTORED_IRQ 16
|
||||
#define IA64_MAX_VECTORED_IRQ 255
|
||||
#define IA64_NUM_VECTORS 256
|
||||
|
||||
#define AUTO_ASSIGN -1
|
||||
|
||||
#define IA64_SPURIOUS_INT_VECTOR 0x0f
|
||||
|
||||
/*
|
||||
* Vectors 0x10-0x1f are used for low priority interrupts, e.g. CMCI.
|
||||
*/
|
||||
#define IA64_CPEP_VECTOR 0x1c /* corrected platform error polling vector */
|
||||
#define IA64_CMCP_VECTOR 0x1d /* corrected machine-check polling vector */
|
||||
#define IA64_CPE_VECTOR 0x1e /* corrected platform error interrupt vector */
|
||||
#define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */
|
||||
/*
|
||||
* Vectors 0x20-0x2f are reserved for legacy ISA IRQs.
|
||||
* Use vectors 0x30-0xe7 as the default device vector range for ia64.
|
||||
* Platforms may choose to reduce this range in platform_irq_setup, but the
|
||||
* platform range must fall within
|
||||
* [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR]
|
||||
*/
|
||||
extern int ia64_first_device_vector;
|
||||
extern int ia64_last_device_vector;
|
||||
|
||||
#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined (CONFIG_IA64_DIG))
|
||||
/* Reserve the lower priority vector than device vectors for "move IRQ" IPI */
|
||||
#define IA64_IRQ_MOVE_VECTOR 0x30 /* "move IRQ" IPI */
|
||||
#define IA64_DEF_FIRST_DEVICE_VECTOR 0x31
|
||||
#else
|
||||
#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30
|
||||
#endif
|
||||
#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7
|
||||
#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector
|
||||
#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector
|
||||
#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1)
|
||||
#define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1)
|
||||
|
||||
#define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */
|
||||
#define IA64_PERFMON_VECTOR 0xee /* performance monitor interrupt vector */
|
||||
#define IA64_TIMER_VECTOR 0xef /* use highest-prio group 15 interrupt for timer */
|
||||
#define IA64_MCA_WAKEUP_VECTOR 0xf0 /* MCA wakeup (must be >MCA_RENDEZ_VECTOR) */
|
||||
#define IA64_IPI_LOCAL_TLB_FLUSH 0xfc /* SMP flush local TLB */
|
||||
#define IA64_IPI_RESCHEDULE 0xfd /* SMP reschedule */
|
||||
#define IA64_IPI_VECTOR 0xfe /* inter-processor interrupt vector */
|
||||
|
||||
/* Used for encoding redirected irqs */
|
||||
|
||||
#define IA64_IRQ_REDIRECTED (1 << 31)
|
||||
|
||||
/* IA64 inter-cpu interrupt related definitions */
|
||||
|
||||
#define IA64_IPI_DEFAULT_BASE_ADDR 0xfee00000
|
||||
|
||||
/* Delivery modes for inter-cpu interrupts */
|
||||
enum {
|
||||
IA64_IPI_DM_INT = 0x0, /* pend an external interrupt */
|
||||
IA64_IPI_DM_PMI = 0x2, /* pend a PMI */
|
||||
IA64_IPI_DM_NMI = 0x4, /* pend an NMI (vector 2) */
|
||||
IA64_IPI_DM_INIT = 0x5, /* pend an INIT interrupt */
|
||||
IA64_IPI_DM_EXTINT = 0x7, /* pend an 8259-compatible interrupt. */
|
||||
};
|
||||
|
||||
extern __u8 isa_irq_to_vector_map[16];
|
||||
#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)]
|
||||
|
||||
struct irq_cfg {
|
||||
ia64_vector vector;
|
||||
cpumask_t domain;
|
||||
cpumask_t old_domain;
|
||||
unsigned move_cleanup_count;
|
||||
u8 move_in_progress : 1;
|
||||
};
|
||||
extern spinlock_t vector_lock;
|
||||
extern struct irq_cfg irq_cfg[NR_IRQS];
|
||||
#define irq_to_domain(x) irq_cfg[(x)].domain
|
||||
DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
|
||||
|
||||
extern struct irq_chip irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
|
||||
|
||||
#ifdef CONFIG_PARAVIRT_GUEST
|
||||
#include <asm/paravirt.h>
|
||||
#else
|
||||
#define ia64_register_ipi ia64_native_register_ipi
|
||||
#define assign_irq_vector ia64_native_assign_irq_vector
|
||||
#define free_irq_vector ia64_native_free_irq_vector
|
||||
#define register_percpu_irq ia64_native_register_percpu_irq
|
||||
#define ia64_resend_irq ia64_native_resend_irq
|
||||
#endif
|
||||
|
||||
extern void ia64_native_register_ipi(void);
|
||||
extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
|
||||
extern int ia64_native_assign_irq_vector (int irq); /* allocate a free vector */
|
||||
extern void ia64_native_free_irq_vector (int vector);
|
||||
extern int reserve_irq_vector (int vector);
|
||||
extern void __setup_vector_irq(int cpu);
|
||||
extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
|
||||
extern void ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action);
|
||||
extern void destroy_and_reserve_irq (unsigned int irq);
|
||||
|
||||
#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
|
||||
extern int irq_prepare_move(int irq, int cpu);
|
||||
extern void irq_complete_move(unsigned int irq);
|
||||
#else
|
||||
static inline int irq_prepare_move(int irq, int cpu) { return 0; }
|
||||
static inline void irq_complete_move(unsigned int irq) {}
|
||||
#endif
|
||||
|
||||
static inline void ia64_native_resend_irq(unsigned int vector)
|
||||
{
|
||||
platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Default implementations for the irq-descriptor API:
|
||||
*/
|
||||
#ifndef CONFIG_IA64_GENERIC
|
||||
static inline ia64_vector __ia64_irq_to_vector(int irq)
|
||||
{
|
||||
return irq_cfg[irq].vector;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
__ia64_local_vector_to_irq (ia64_vector vec)
|
||||
{
|
||||
return __this_cpu_read(vector_irq[vec]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Next follows the irq descriptor interface. On IA-64, each CPU supports 256 interrupt
|
||||
* vectors. On smaller systems, there is a one-to-one correspondence between interrupt
|
||||
* vectors and the Linux irq numbers. However, larger systems may have multiple interrupt
|
||||
* domains meaning that the translation from vector number to irq number depends on the
|
||||
* interrupt domain that a CPU belongs to. This API abstracts such platform-dependent
|
||||
* differences and provides a uniform means to translate between vector and irq numbers
|
||||
* and to obtain the irq descriptor for a given irq number.
|
||||
*/
|
||||
|
||||
/* Extract the IA-64 vector that corresponds to IRQ. */
|
||||
static inline ia64_vector
|
||||
irq_to_vector (int irq)
|
||||
{
|
||||
return platform_irq_to_vector(irq);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert the local IA-64 vector to the corresponding irq number. This translation is
|
||||
* done in the context of the interrupt domain that the currently executing CPU belongs
|
||||
* to.
|
||||
*/
|
||||
static inline unsigned int
|
||||
local_vector_to_irq (ia64_vector vec)
|
||||
{
|
||||
return platform_local_vector_to_irq(vec);
|
||||
}
|
||||
|
||||
#endif /* _ASM_IA64_HW_IRQ_H */
|
7
arch/ia64/include/asm/idle.h
Normal file
7
arch/ia64/include/asm/idle.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
#ifndef _ASM_IA64_IDLE_H
|
||||
#define _ASM_IA64_IDLE_H
|
||||
|
||||
static inline void enter_idle(void) { }
|
||||
static inline void exit_idle(void) { }
|
||||
|
||||
#endif /* _ASM_IA64_IDLE_H */
|
25
arch/ia64/include/asm/intrinsics.h
Normal file
25
arch/ia64/include/asm/intrinsics.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Compiler-dependent intrinsics.
|
||||
*
|
||||
* Copyright (C) 2002-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
#ifndef _ASM_IA64_INTRINSICS_H
|
||||
#define _ASM_IA64_INTRINSICS_H
|
||||
|
||||
#include <asm/paravirt_privop.h>
|
||||
#include <uapi/asm/intrinsics.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#if defined(CONFIG_PARAVIRT)
|
||||
# undef IA64_INTRINSIC_API
|
||||
# undef IA64_INTRINSIC_MACRO
|
||||
# ifdef ASM_SUPPORTED
|
||||
# define IA64_INTRINSIC_API(name) paravirt_ ## name
|
||||
# else
|
||||
# define IA64_INTRINSIC_API(name) pv_cpu_ops.name
|
||||
# endif
|
||||
#define IA64_INTRINSIC_MACRO(name) paravirt_ ## name
|
||||
#endif
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* _ASM_IA64_INTRINSICS_H */
|
445
arch/ia64/include/asm/io.h
Normal file
445
arch/ia64/include/asm/io.h
Normal file
|
@ -0,0 +1,445 @@
|
|||
#ifndef _ASM_IA64_IO_H
|
||||
#define _ASM_IA64_IO_H
|
||||
|
||||
/*
|
||||
* This file contains the definitions for the emulated IO instructions
|
||||
* inb/inw/inl/outb/outw/outl and the "string versions" of the same
|
||||
* (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
|
||||
* versions of the single-IO instructions (inb_p/inw_p/..).
|
||||
*
|
||||
* This file is not meant to be obfuscating: it's just complicated to
|
||||
* (a) handle it all in a way that makes gcc able to optimize it as
|
||||
* well as possible and (b) trying to avoid writing the same thing
|
||||
* over and over again with slight variations and possibly making a
|
||||
* mistake somewhere.
|
||||
*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
|
||||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
|
||||
*/
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
/* We don't use IO slowdowns on the ia64, but.. */
|
||||
#define __SLOW_DOWN_IO do { } while (0)
|
||||
#define SLOW_DOWN_IO do { } while (0)
|
||||
|
||||
#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)
|
||||
|
||||
/*
|
||||
* The legacy I/O space defined by the ia64 architecture supports only 65536 ports, but
|
||||
* large machines may have multiple other I/O spaces so we can't place any a priori limit
|
||||
* on IO_SPACE_LIMIT. These additional spaces are described in ACPI.
|
||||
*/
|
||||
#define IO_SPACE_LIMIT 0xffffffffffffffffUL
|
||||
|
||||
#define MAX_IO_SPACES_BITS 8
|
||||
#define MAX_IO_SPACES (1UL << MAX_IO_SPACES_BITS)
|
||||
#define IO_SPACE_BITS 24
|
||||
#define IO_SPACE_SIZE (1UL << IO_SPACE_BITS)
|
||||
|
||||
#define IO_SPACE_NR(port) ((port) >> IO_SPACE_BITS)
|
||||
#define IO_SPACE_BASE(space) ((space) << IO_SPACE_BITS)
|
||||
#define IO_SPACE_PORT(port) ((port) & (IO_SPACE_SIZE - 1))
|
||||
|
||||
#define IO_SPACE_SPARSE_ENCODING(p) ((((p) >> 2) << 12) | ((p) & 0xfff))
|
||||
|
||||
struct io_space {
|
||||
unsigned long mmio_base; /* base in MMIO space */
|
||||
int sparse;
|
||||
};
|
||||
|
||||
extern struct io_space io_space[];
|
||||
extern unsigned int num_io_spaces;
|
||||
|
||||
# ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* All MMIO iomem cookies are in region 6; anything less is a PIO cookie:
|
||||
* 0xCxxxxxxxxxxxxxxx MMIO cookie (return from ioremap)
|
||||
* 0x000000001SPPPPPP PIO cookie (S=space number, P..P=port)
|
||||
*
|
||||
* ioread/writeX() uses the leading 1 in PIO cookies (PIO_OFFSET) to catch
|
||||
* code that uses bare port numbers without the prerequisite pci_iomap().
|
||||
*/
|
||||
#define PIO_OFFSET (1UL << (MAX_IO_SPACES_BITS + IO_SPACE_BITS))
|
||||
#define PIO_MASK (PIO_OFFSET - 1)
|
||||
#define PIO_RESERVED __IA64_UNCACHED_OFFSET
|
||||
#define HAVE_ARCH_PIO_SIZE
|
||||
|
||||
#include <asm/intrinsics.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm-generic/iomap.h>
|
||||
|
||||
/*
|
||||
* Change virtual addresses to physical addresses and vv.
|
||||
*/
|
||||
static inline unsigned long
|
||||
virt_to_phys (volatile void *address)
|
||||
{
|
||||
return (unsigned long) address - PAGE_OFFSET;
|
||||
}
|
||||
|
||||
static inline void*
|
||||
phys_to_virt (unsigned long address)
|
||||
{
|
||||
return (void *) (address + PAGE_OFFSET);
|
||||
}
|
||||
|
||||
#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
|
||||
extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
|
||||
extern int valid_phys_addr_range (phys_addr_t addr, size_t count); /* efi.c */
|
||||
extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
|
||||
|
||||
/*
|
||||
* The following two macros are deprecated and scheduled for removal.
|
||||
* Please use the PCI-DMA interface defined in <asm/pci.h> instead.
|
||||
*/
|
||||
#define bus_to_virt phys_to_virt
|
||||
#define virt_to_bus virt_to_phys
|
||||
#define page_to_bus page_to_phys
|
||||
|
||||
# endif /* KERNEL */
|
||||
|
||||
/*
|
||||
* Memory fence w/accept. This should never be used in code that is
|
||||
* not IA-64 specific.
|
||||
*/
|
||||
#define __ia64_mf_a() ia64_mfa()
|
||||
|
||||
/**
|
||||
* ___ia64_mmiowb - I/O write barrier
|
||||
*
|
||||
* Ensure ordering of I/O space writes. This will make sure that writes
|
||||
* following the barrier will arrive after all previous writes. For most
|
||||
* ia64 platforms, this is a simple 'mf.a' instruction.
|
||||
*
|
||||
* See Documentation/DocBook/deviceiobook.tmpl for more information.
|
||||
*/
|
||||
static inline void ___ia64_mmiowb(void)
|
||||
{
|
||||
ia64_mfa();
|
||||
}
|
||||
|
||||
static inline void*
|
||||
__ia64_mk_io_addr (unsigned long port)
|
||||
{
|
||||
struct io_space *space;
|
||||
unsigned long offset;
|
||||
|
||||
space = &io_space[IO_SPACE_NR(port)];
|
||||
port = IO_SPACE_PORT(port);
|
||||
if (space->sparse)
|
||||
offset = IO_SPACE_SPARSE_ENCODING(port);
|
||||
else
|
||||
offset = port;
|
||||
|
||||
return (void *) (space->mmio_base | offset);
|
||||
}
|
||||
|
||||
#define __ia64_inb ___ia64_inb
|
||||
#define __ia64_inw ___ia64_inw
|
||||
#define __ia64_inl ___ia64_inl
|
||||
#define __ia64_outb ___ia64_outb
|
||||
#define __ia64_outw ___ia64_outw
|
||||
#define __ia64_outl ___ia64_outl
|
||||
#define __ia64_readb ___ia64_readb
|
||||
#define __ia64_readw ___ia64_readw
|
||||
#define __ia64_readl ___ia64_readl
|
||||
#define __ia64_readq ___ia64_readq
|
||||
#define __ia64_readb_relaxed ___ia64_readb
|
||||
#define __ia64_readw_relaxed ___ia64_readw
|
||||
#define __ia64_readl_relaxed ___ia64_readl
|
||||
#define __ia64_readq_relaxed ___ia64_readq
|
||||
#define __ia64_writeb ___ia64_writeb
|
||||
#define __ia64_writew ___ia64_writew
|
||||
#define __ia64_writel ___ia64_writel
|
||||
#define __ia64_writeq ___ia64_writeq
|
||||
#define __ia64_mmiowb ___ia64_mmiowb
|
||||
|
||||
/*
|
||||
* For the in/out routines, we need to do "mf.a" _after_ doing the I/O access to ensure
|
||||
* that the access has completed before executing other I/O accesses. Since we're doing
|
||||
* the accesses through an uncachable (UC) translation, the CPU will execute them in
|
||||
* program order. However, we still need to tell the compiler not to shuffle them around
|
||||
* during optimization, which is why we use "volatile" pointers.
|
||||
*/
|
||||
|
||||
static inline unsigned int
|
||||
___ia64_inb (unsigned long port)
|
||||
{
|
||||
volatile unsigned char *addr = __ia64_mk_io_addr(port);
|
||||
unsigned char ret;
|
||||
|
||||
ret = *addr;
|
||||
__ia64_mf_a();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
___ia64_inw (unsigned long port)
|
||||
{
|
||||
volatile unsigned short *addr = __ia64_mk_io_addr(port);
|
||||
unsigned short ret;
|
||||
|
||||
ret = *addr;
|
||||
__ia64_mf_a();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
___ia64_inl (unsigned long port)
|
||||
{
|
||||
volatile unsigned int *addr = __ia64_mk_io_addr(port);
|
||||
unsigned int ret;
|
||||
|
||||
ret = *addr;
|
||||
__ia64_mf_a();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
___ia64_outb (unsigned char val, unsigned long port)
|
||||
{
|
||||
volatile unsigned char *addr = __ia64_mk_io_addr(port);
|
||||
|
||||
*addr = val;
|
||||
__ia64_mf_a();
|
||||
}
|
||||
|
||||
static inline void
|
||||
___ia64_outw (unsigned short val, unsigned long port)
|
||||
{
|
||||
volatile unsigned short *addr = __ia64_mk_io_addr(port);
|
||||
|
||||
*addr = val;
|
||||
__ia64_mf_a();
|
||||
}
|
||||
|
||||
static inline void
|
||||
___ia64_outl (unsigned int val, unsigned long port)
|
||||
{
|
||||
volatile unsigned int *addr = __ia64_mk_io_addr(port);
|
||||
|
||||
*addr = val;
|
||||
__ia64_mf_a();
|
||||
}
|
||||
|
||||
static inline void
|
||||
__insb (unsigned long port, void *dst, unsigned long count)
|
||||
{
|
||||
unsigned char *dp = dst;
|
||||
|
||||
while (count--)
|
||||
*dp++ = platform_inb(port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__insw (unsigned long port, void *dst, unsigned long count)
|
||||
{
|
||||
unsigned short *dp = dst;
|
||||
|
||||
while (count--)
|
||||
put_unaligned(platform_inw(port), dp++);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__insl (unsigned long port, void *dst, unsigned long count)
|
||||
{
|
||||
unsigned int *dp = dst;
|
||||
|
||||
while (count--)
|
||||
put_unaligned(platform_inl(port), dp++);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__outsb (unsigned long port, const void *src, unsigned long count)
|
||||
{
|
||||
const unsigned char *sp = src;
|
||||
|
||||
while (count--)
|
||||
platform_outb(*sp++, port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__outsw (unsigned long port, const void *src, unsigned long count)
|
||||
{
|
||||
const unsigned short *sp = src;
|
||||
|
||||
while (count--)
|
||||
platform_outw(get_unaligned(sp++), port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__outsl (unsigned long port, const void *src, unsigned long count)
|
||||
{
|
||||
const unsigned int *sp = src;
|
||||
|
||||
while (count--)
|
||||
platform_outl(get_unaligned(sp++), port);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unfortunately, some platforms are broken and do not follow the IA-64 architecture
|
||||
* specification regarding legacy I/O support. Thus, we have to make these operations
|
||||
* platform dependent...
|
||||
*/
|
||||
#define __inb platform_inb
|
||||
#define __inw platform_inw
|
||||
#define __inl platform_inl
|
||||
#define __outb platform_outb
|
||||
#define __outw platform_outw
|
||||
#define __outl platform_outl
|
||||
#define __mmiowb platform_mmiowb
|
||||
|
||||
#define inb(p) __inb(p)
|
||||
#define inw(p) __inw(p)
|
||||
#define inl(p) __inl(p)
|
||||
#define insb(p,d,c) __insb(p,d,c)
|
||||
#define insw(p,d,c) __insw(p,d,c)
|
||||
#define insl(p,d,c) __insl(p,d,c)
|
||||
#define outb(v,p) __outb(v,p)
|
||||
#define outw(v,p) __outw(v,p)
|
||||
#define outl(v,p) __outl(v,p)
|
||||
#define outsb(p,s,c) __outsb(p,s,c)
|
||||
#define outsw(p,s,c) __outsw(p,s,c)
|
||||
#define outsl(p,s,c) __outsl(p,s,c)
|
||||
#define mmiowb() __mmiowb()
|
||||
|
||||
/*
|
||||
* The address passed to these functions are ioremap()ped already.
|
||||
*
|
||||
* We need these to be machine vectors since some platforms don't provide
|
||||
* DMA coherence via PIO reads (PCI drivers and the spec imply that this is
|
||||
* a good idea). Writes are ok though for all existing ia64 platforms (and
|
||||
* hopefully it'll stay that way).
|
||||
*/
|
||||
static inline unsigned char
|
||||
___ia64_readb (const volatile void __iomem *addr)
|
||||
{
|
||||
return *(volatile unsigned char __force *)addr;
|
||||
}
|
||||
|
||||
static inline unsigned short
|
||||
___ia64_readw (const volatile void __iomem *addr)
|
||||
{
|
||||
return *(volatile unsigned short __force *)addr;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
___ia64_readl (const volatile void __iomem *addr)
|
||||
{
|
||||
return *(volatile unsigned int __force *) addr;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
___ia64_readq (const volatile void __iomem *addr)
|
||||
{
|
||||
return *(volatile unsigned long __force *) addr;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__writeb (unsigned char val, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile unsigned char __force *) addr = val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__writew (unsigned short val, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile unsigned short __force *) addr = val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__writel (unsigned int val, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile unsigned int __force *) addr = val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__writeq (unsigned long val, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile unsigned long __force *) addr = val;
|
||||
}
|
||||
|
||||
#define __readb platform_readb
|
||||
#define __readw platform_readw
|
||||
#define __readl platform_readl
|
||||
#define __readq platform_readq
|
||||
#define __readb_relaxed platform_readb_relaxed
|
||||
#define __readw_relaxed platform_readw_relaxed
|
||||
#define __readl_relaxed platform_readl_relaxed
|
||||
#define __readq_relaxed platform_readq_relaxed
|
||||
|
||||
#define readb(a) __readb((a))
|
||||
#define readw(a) __readw((a))
|
||||
#define readl(a) __readl((a))
|
||||
#define readq(a) __readq((a))
|
||||
#define readb_relaxed(a) __readb_relaxed((a))
|
||||
#define readw_relaxed(a) __readw_relaxed((a))
|
||||
#define readl_relaxed(a) __readl_relaxed((a))
|
||||
#define readq_relaxed(a) __readq_relaxed((a))
|
||||
#define __raw_readb readb
|
||||
#define __raw_readw readw
|
||||
#define __raw_readl readl
|
||||
#define __raw_readq readq
|
||||
#define __raw_readb_relaxed readb_relaxed
|
||||
#define __raw_readw_relaxed readw_relaxed
|
||||
#define __raw_readl_relaxed readl_relaxed
|
||||
#define __raw_readq_relaxed readq_relaxed
|
||||
#define writeb(v,a) __writeb((v), (a))
|
||||
#define writew(v,a) __writew((v), (a))
|
||||
#define writel(v,a) __writel((v), (a))
|
||||
#define writeq(v,a) __writeq((v), (a))
|
||||
#define __raw_writeb writeb
|
||||
#define __raw_writew writew
|
||||
#define __raw_writel writel
|
||||
#define __raw_writeq writeq
|
||||
|
||||
#ifndef inb_p
|
||||
# define inb_p inb
|
||||
#endif
|
||||
#ifndef inw_p
|
||||
# define inw_p inw
|
||||
#endif
|
||||
#ifndef inl_p
|
||||
# define inl_p inl
|
||||
#endif
|
||||
|
||||
#ifndef outb_p
|
||||
# define outb_p outb
|
||||
#endif
|
||||
#ifndef outw_p
|
||||
# define outw_p outw
|
||||
#endif
|
||||
#ifndef outl_p
|
||||
# define outl_p outl
|
||||
#endif
|
||||
|
||||
# ifdef __KERNEL__
|
||||
|
||||
extern void __iomem * ioremap(unsigned long offset, unsigned long size);
|
||||
extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
|
||||
extern void iounmap (volatile void __iomem *addr);
|
||||
extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size);
|
||||
#define early_memremap(phys_addr, size) early_ioremap(phys_addr, size)
|
||||
extern void early_iounmap (volatile void __iomem *addr, unsigned long size);
|
||||
#define early_memunmap(addr, size) early_iounmap(addr, size)
|
||||
static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned long size)
|
||||
{
|
||||
return ioremap(phys_addr, size);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* String version of IO memory access ops:
|
||||
*/
|
||||
extern void memcpy_fromio(void *dst, const volatile void __iomem *src, long n);
|
||||
extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
|
||||
extern void memset_io(volatile void __iomem *s, int c, long n);
|
||||
|
||||
# endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_IA64_IO_H */
|
22
arch/ia64/include/asm/iommu.h
Normal file
22
arch/ia64/include/asm/iommu.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef _ASM_IA64_IOMMU_H
|
||||
#define _ASM_IA64_IOMMU_H 1
|
||||
|
||||
#define cpu_has_x2apic 0
|
||||
/* 10 seconds */
|
||||
#define DMAR_OPERATION_TIMEOUT (((cycles_t) local_cpu_data->itc_freq)*10)
|
||||
|
||||
extern void pci_iommu_shutdown(void);
|
||||
extern void no_iommu_init(void);
|
||||
#ifdef CONFIG_INTEL_IOMMU
|
||||
extern int force_iommu, no_iommu;
|
||||
extern int iommu_pass_through;
|
||||
extern int iommu_detected;
|
||||
#else
|
||||
#define iommu_pass_through (0)
|
||||
#define no_iommu (1)
|
||||
#define iommu_detected (0)
|
||||
#endif
|
||||
extern void iommu_dma_init(void);
|
||||
extern void machvec_init(const char *name);
|
||||
|
||||
#endif
|
6
arch/ia64/include/asm/iommu_table.h
Normal file
6
arch/ia64/include/asm/iommu_table.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef _ASM_IA64_IOMMU_TABLE_H
|
||||
#define _ASM_IA64_IOMMU_TABLE_H
|
||||
|
||||
#define IOMMU_INIT_POST(_detect)
|
||||
|
||||
#endif /* _ASM_IA64_IOMMU_TABLE_H */
|
121
arch/ia64/include/asm/iosapic.h
Normal file
121
arch/ia64/include/asm/iosapic.h
Normal file
|
@ -0,0 +1,121 @@
|
|||
#ifndef __ASM_IA64_IOSAPIC_H
|
||||
#define __ASM_IA64_IOSAPIC_H
|
||||
|
||||
#define IOSAPIC_REG_SELECT 0x0
|
||||
#define IOSAPIC_WINDOW 0x10
|
||||
#define IOSAPIC_EOI 0x40
|
||||
|
||||
#define IOSAPIC_VERSION 0x1
|
||||
|
||||
/*
|
||||
* Redirection table entry
|
||||
*/
|
||||
#define IOSAPIC_RTE_LOW(i) (0x10+i*2)
|
||||
#define IOSAPIC_RTE_HIGH(i) (0x11+i*2)
|
||||
|
||||
#define IOSAPIC_DEST_SHIFT 16
|
||||
|
||||
/*
|
||||
* Delivery mode
|
||||
*/
|
||||
#define IOSAPIC_DELIVERY_SHIFT 8
|
||||
#define IOSAPIC_FIXED 0x0
|
||||
#define IOSAPIC_LOWEST_PRIORITY 0x1
|
||||
#define IOSAPIC_PMI 0x2
|
||||
#define IOSAPIC_NMI 0x4
|
||||
#define IOSAPIC_INIT 0x5
|
||||
#define IOSAPIC_EXTINT 0x7
|
||||
|
||||
/*
|
||||
* Interrupt polarity
|
||||
*/
|
||||
#define IOSAPIC_POLARITY_SHIFT 13
|
||||
#define IOSAPIC_POL_HIGH 0
|
||||
#define IOSAPIC_POL_LOW 1
|
||||
|
||||
/*
|
||||
* Trigger mode
|
||||
*/
|
||||
#define IOSAPIC_TRIGGER_SHIFT 15
|
||||
#define IOSAPIC_EDGE 0
|
||||
#define IOSAPIC_LEVEL 1
|
||||
|
||||
/*
|
||||
* Mask bit
|
||||
*/
|
||||
|
||||
#define IOSAPIC_MASK_SHIFT 16
|
||||
#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT)
|
||||
|
||||
#define IOSAPIC_VECTOR_MASK 0xffffff00
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#ifdef CONFIG_IOSAPIC
|
||||
|
||||
#define NR_IOSAPICS 256
|
||||
|
||||
#ifdef CONFIG_PARAVIRT_GUEST
|
||||
#include <asm/paravirt.h>
|
||||
#else
|
||||
#define iosapic_pcat_compat_init ia64_native_iosapic_pcat_compat_init
|
||||
#define __iosapic_read __ia64_native_iosapic_read
|
||||
#define __iosapic_write __ia64_native_iosapic_write
|
||||
#define iosapic_get_irq_chip ia64_native_iosapic_get_irq_chip
|
||||
#endif
|
||||
|
||||
extern void __init ia64_native_iosapic_pcat_compat_init(void);
|
||||
extern struct irq_chip *ia64_native_iosapic_get_irq_chip(unsigned long trigger);
|
||||
|
||||
static inline unsigned int
|
||||
__ia64_native_iosapic_read(char __iomem *iosapic, unsigned int reg)
|
||||
{
|
||||
writel(reg, iosapic + IOSAPIC_REG_SELECT);
|
||||
return readl(iosapic + IOSAPIC_WINDOW);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__ia64_native_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
|
||||
{
|
||||
writel(reg, iosapic + IOSAPIC_REG_SELECT);
|
||||
writel(val, iosapic + IOSAPIC_WINDOW);
|
||||
}
|
||||
|
||||
static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
|
||||
{
|
||||
writel(vector, iosapic + IOSAPIC_EOI);
|
||||
}
|
||||
|
||||
extern void __init iosapic_system_init (int pcat_compat);
|
||||
extern int iosapic_init (unsigned long address, unsigned int gsi_base);
|
||||
extern int iosapic_remove (unsigned int gsi_base);
|
||||
extern int gsi_to_irq (unsigned int gsi);
|
||||
extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
|
||||
unsigned long trigger);
|
||||
extern void iosapic_unregister_intr (unsigned int irq);
|
||||
extern void iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
|
||||
unsigned long polarity,
|
||||
unsigned long trigger);
|
||||
extern int __init iosapic_register_platform_intr (u32 int_type,
|
||||
unsigned int gsi,
|
||||
int pmi_vector,
|
||||
u16 eid, u16 id,
|
||||
unsigned long polarity,
|
||||
unsigned long trigger);
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
extern void map_iosapic_to_node (unsigned int, int);
|
||||
#endif
|
||||
#else
|
||||
#define iosapic_system_init(pcat_compat) do { } while (0)
|
||||
#define iosapic_init(address,gsi_base) (-EINVAL)
|
||||
#define iosapic_remove(gsi_base) (-ENODEV)
|
||||
#define iosapic_register_intr(gsi,polarity,trigger) (gsi)
|
||||
#define iosapic_unregister_intr(irq) do { } while (0)
|
||||
#define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0)
|
||||
#define iosapic_register_platform_intr(type,gsi,pmi,eid,id, \
|
||||
polarity,trigger) (gsi)
|
||||
#endif
|
||||
|
||||
# endif /* !__ASSEMBLY__ */
|
||||
#endif /* __ASM_IA64_IOSAPIC_H */
|
37
arch/ia64/include/asm/irq.h
Normal file
37
arch/ia64/include/asm/irq.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef _ASM_IA64_IRQ_H
|
||||
#define _ASM_IA64_IRQ_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Stephane Eranian <eranian@hpl.hp.com>
|
||||
*
|
||||
* 11/24/98 S.Eranian updated TIMER_IRQ and irq_canonicalize
|
||||
* 01/20/99 S.Eranian added keyboard interrupt
|
||||
* 02/29/00 D.Mosberger moved most things into hw_irq.h
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <generated/nr-irqs.h>
|
||||
|
||||
static __inline__ int
|
||||
irq_canonicalize (int irq)
|
||||
{
|
||||
/*
|
||||
* We do the legacy thing here of pretending that irqs < 16
|
||||
* are 8259 irqs. This really shouldn't be necessary at all,
|
||||
* but we keep it here as serial.c still uses it...
|
||||
*/
|
||||
return ((irq == 2) ? 9 : irq);
|
||||
}
|
||||
|
||||
extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
|
||||
bool is_affinity_mask_valid(const struct cpumask *cpumask);
|
||||
|
||||
#define is_affinity_mask_valid is_affinity_mask_valid
|
||||
|
||||
int create_irq(void);
|
||||
void destroy_irq(unsigned int irq);
|
||||
|
||||
#endif /* _ASM_IA64_IRQ_H */
|
1
arch/ia64/include/asm/irq_regs.h
Normal file
1
arch/ia64/include/asm/irq_regs.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/irq_regs.h>
|
6
arch/ia64/include/asm/irq_remapping.h
Normal file
6
arch/ia64/include/asm/irq_remapping.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifndef __IA64_INTR_REMAPPING_H
|
||||
#define __IA64_INTR_REMAPPING_H
|
||||
#define irq_remapping_enabled 0
|
||||
#define dmar_alloc_hwirq create_irq
|
||||
#define dmar_free_hwirq destroy_irq
|
||||
#endif
|
98
arch/ia64/include/asm/irqflags.h
Normal file
98
arch/ia64/include/asm/irqflags.h
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* IRQ flags defines.
|
||||
*
|
||||
* Copyright (C) 1998-2003 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
|
||||
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
|
||||
*/
|
||||
|
||||
#ifndef _ASM_IA64_IRQFLAGS_H
|
||||
#define _ASM_IA64_IRQFLAGS_H
|
||||
|
||||
#include <asm/pal.h>
|
||||
#include <asm/kregs.h>
|
||||
|
||||
#ifdef CONFIG_IA64_DEBUG_IRQ
|
||||
extern unsigned long last_cli_ip;
|
||||
static inline void arch_maybe_save_ip(unsigned long flags)
|
||||
{
|
||||
if (flags & IA64_PSR_I)
|
||||
last_cli_ip = ia64_getreg(_IA64_REG_IP);
|
||||
}
|
||||
#else
|
||||
#define arch_maybe_save_ip(flags) do {} while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* - clearing psr.i is implicitly serialized (visible by next insn)
|
||||
* - setting psr.i requires data serialization
|
||||
* - we need a stop-bit before reading PSR because we sometimes
|
||||
* write a floating-point register right before reading the PSR
|
||||
* and that writes to PSR.mfl
|
||||
*/
|
||||
|
||||
static inline unsigned long arch_local_save_flags(void)
|
||||
{
|
||||
ia64_stop();
|
||||
#ifdef CONFIG_PARAVIRT
|
||||
return ia64_get_psr_i();
|
||||
#else
|
||||
return ia64_getreg(_IA64_REG_PSR);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned long arch_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags = arch_local_save_flags();
|
||||
|
||||
ia64_stop();
|
||||
ia64_rsm(IA64_PSR_I);
|
||||
arch_maybe_save_ip(flags);
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_disable(void)
|
||||
{
|
||||
#ifdef CONFIG_IA64_DEBUG_IRQ
|
||||
arch_local_irq_save();
|
||||
#else
|
||||
ia64_stop();
|
||||
ia64_rsm(IA64_PSR_I);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_enable(void)
|
||||
{
|
||||
ia64_stop();
|
||||
ia64_ssm(IA64_PSR_I);
|
||||
ia64_srlz_d();
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
#ifdef CONFIG_IA64_DEBUG_IRQ
|
||||
unsigned long old_psr = arch_local_save_flags();
|
||||
#endif
|
||||
ia64_intrin_local_irq_restore(flags & IA64_PSR_I);
|
||||
arch_maybe_save_ip(old_psr & ~flags);
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled_flags(unsigned long flags)
|
||||
{
|
||||
return (flags & IA64_PSR_I) == 0;
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled(void)
|
||||
{
|
||||
return arch_irqs_disabled_flags(arch_local_save_flags());
|
||||
}
|
||||
|
||||
static inline void arch_safe_halt(void)
|
||||
{
|
||||
arch_local_irq_enable();
|
||||
ia64_pal_halt_light(); /* PAL_HALT_LIGHT */
|
||||
}
|
||||
|
||||
|
||||
#endif /* _ASM_IA64_IRQFLAGS_H */
|
57
arch/ia64/include/asm/kdebug.h
Normal file
57
arch/ia64/include/asm/kdebug.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
#ifndef _IA64_KDEBUG_H
|
||||
#define _IA64_KDEBUG_H 1
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Copyright (C) Intel Corporation, 2005
|
||||
*
|
||||
* 2005-Apr Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
|
||||
* <anil.s.keshavamurthy@intel.com> adopted from
|
||||
* include/asm-x86_64/kdebug.h
|
||||
*
|
||||
* 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more
|
||||
* events.
|
||||
*/
|
||||
|
||||
enum die_val {
|
||||
DIE_BREAK = 1,
|
||||
DIE_FAULT,
|
||||
DIE_OOPS,
|
||||
DIE_MACHINE_HALT,
|
||||
DIE_MACHINE_RESTART,
|
||||
DIE_MCA_MONARCH_ENTER,
|
||||
DIE_MCA_MONARCH_PROCESS,
|
||||
DIE_MCA_MONARCH_LEAVE,
|
||||
DIE_MCA_SLAVE_ENTER,
|
||||
DIE_MCA_SLAVE_PROCESS,
|
||||
DIE_MCA_SLAVE_LEAVE,
|
||||
DIE_MCA_RENDZVOUS_ENTER,
|
||||
DIE_MCA_RENDZVOUS_PROCESS,
|
||||
DIE_MCA_RENDZVOUS_LEAVE,
|
||||
DIE_MCA_NEW_TIMEOUT,
|
||||
DIE_INIT_ENTER,
|
||||
DIE_INIT_MONARCH_ENTER,
|
||||
DIE_INIT_MONARCH_PROCESS,
|
||||
DIE_INIT_MONARCH_LEAVE,
|
||||
DIE_INIT_SLAVE_ENTER,
|
||||
DIE_INIT_SLAVE_PROCESS,
|
||||
DIE_INIT_SLAVE_LEAVE,
|
||||
DIE_KDEBUG_ENTER,
|
||||
DIE_KDEBUG_LEAVE,
|
||||
DIE_KDUMP_ENTER,
|
||||
DIE_KDUMP_LEAVE,
|
||||
};
|
||||
|
||||
#endif
|
45
arch/ia64/include/asm/kexec.h
Normal file
45
arch/ia64/include/asm/kexec.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
#ifndef _ASM_IA64_KEXEC_H
|
||||
#define _ASM_IA64_KEXEC_H
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
||||
/* Maximum physical address we can use pages from */
|
||||
#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
|
||||
/* Maximum address we can reach in physical address mode */
|
||||
#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
|
||||
/* Maximum address we can use for the control code buffer */
|
||||
#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
|
||||
|
||||
#define KEXEC_CONTROL_PAGE_SIZE (8192 + 8192 + 4096)
|
||||
|
||||
/* The native architecture */
|
||||
#define KEXEC_ARCH KEXEC_ARCH_IA_64
|
||||
|
||||
#define kexec_flush_icache_page(page) do { \
|
||||
unsigned long page_addr = (unsigned long)page_address(page); \
|
||||
flush_icache_range(page_addr, page_addr + PAGE_SIZE); \
|
||||
} while(0)
|
||||
|
||||
extern struct kimage *ia64_kimage;
|
||||
extern const unsigned int relocate_new_kernel_size;
|
||||
extern void relocate_new_kernel(unsigned long, unsigned long,
|
||||
struct ia64_boot_param *, unsigned long);
|
||||
static inline void
|
||||
crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs)
|
||||
{
|
||||
}
|
||||
extern struct resource efi_memmap_res;
|
||||
extern struct resource boot_param_res;
|
||||
extern void kdump_smp_send_stop(void);
|
||||
extern void kdump_smp_send_init(void);
|
||||
extern void kexec_disable_iosapic(void);
|
||||
extern void crash_save_this_cpu(void);
|
||||
struct rsvd_region;
|
||||
extern unsigned long kdump_find_rsvd_region(unsigned long size,
|
||||
struct rsvd_region *rsvd_regions, int n);
|
||||
extern void kdump_cpu_freeze(struct unw_frame_info *info, void *arg);
|
||||
extern int kdump_status[];
|
||||
extern atomic_t kdump_cpu_freezed;
|
||||
extern atomic_t kdump_in_progress;
|
||||
|
||||
#endif /* _ASM_IA64_KEXEC_H */
|
12
arch/ia64/include/asm/kmap_types.h
Normal file
12
arch/ia64/include/asm/kmap_types.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _ASM_IA64_KMAP_TYPES_H
|
||||
#define _ASM_IA64_KMAP_TYPES_H
|
||||
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
#define __WITH_KM_FENCE
|
||||
#endif
|
||||
|
||||
#include <asm-generic/kmap_types.h>
|
||||
|
||||
#undef __WITH_KM_FENCE
|
||||
|
||||
#endif /* _ASM_IA64_KMAP_TYPES_H */
|
127
arch/ia64/include/asm/kprobes.h
Normal file
127
arch/ia64/include/asm/kprobes.h
Normal file
|
@ -0,0 +1,127 @@
|
|||
#ifndef _ASM_KPROBES_H
|
||||
#define _ASM_KPROBES_H
|
||||
/*
|
||||
* Kernel Probes (KProbes)
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Copyright (C) IBM Corporation, 2002, 2004
|
||||
* Copyright (C) Intel Corporation, 2005
|
||||
*
|
||||
* 2005-Apr Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
|
||||
* <anil.s.keshavamurthy@intel.com> adapted from i386
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <asm/break.h>
|
||||
|
||||
#define __ARCH_WANT_KPROBES_INSN_SLOT
|
||||
#define MAX_INSN_SIZE 2 /* last half is for kprobe-booster */
|
||||
#define BREAK_INST (long)(__IA64_BREAK_KPROBE << 6)
|
||||
#define NOP_M_INST (long)(1<<27)
|
||||
#define BRL_INST(i1, i2) ((long)((0xcL << 37) | /* brl */ \
|
||||
(0x1L << 12) | /* many */ \
|
||||
(((i1) & 1) << 36) | ((i2) << 13))) /* imm */
|
||||
|
||||
typedef union cmp_inst {
|
||||
struct {
|
||||
unsigned long long qp : 6;
|
||||
unsigned long long p1 : 6;
|
||||
unsigned long long c : 1;
|
||||
unsigned long long r2 : 7;
|
||||
unsigned long long r3 : 7;
|
||||
unsigned long long p2 : 6;
|
||||
unsigned long long ta : 1;
|
||||
unsigned long long x2 : 2;
|
||||
unsigned long long tb : 1;
|
||||
unsigned long long opcode : 4;
|
||||
unsigned long long reserved : 23;
|
||||
}f;
|
||||
unsigned long long l;
|
||||
} cmp_inst_t;
|
||||
|
||||
struct kprobe;
|
||||
|
||||
typedef struct _bundle {
|
||||
struct {
|
||||
unsigned long long template : 5;
|
||||
unsigned long long slot0 : 41;
|
||||
unsigned long long slot1_p0 : 64-46;
|
||||
} quad0;
|
||||
struct {
|
||||
unsigned long long slot1_p1 : 41 - (64-46);
|
||||
unsigned long long slot2 : 41;
|
||||
} quad1;
|
||||
} __attribute__((__aligned__(16))) bundle_t;
|
||||
|
||||
struct prev_kprobe {
|
||||
struct kprobe *kp;
|
||||
unsigned long status;
|
||||
};
|
||||
|
||||
#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f)
|
||||
/* per-cpu kprobe control block */
|
||||
#define ARCH_PREV_KPROBE_SZ 2
|
||||
struct kprobe_ctlblk {
|
||||
unsigned long kprobe_status;
|
||||
struct pt_regs jprobe_saved_regs;
|
||||
unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
|
||||
unsigned long *bsp;
|
||||
unsigned long cfm;
|
||||
atomic_t prev_kprobe_index;
|
||||
struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
|
||||
};
|
||||
|
||||
#define kretprobe_blacklist_size 0
|
||||
|
||||
#define SLOT0_OPCODE_SHIFT (37)
|
||||
#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
|
||||
#define SLOT2_OPCODE_SHIFT (37)
|
||||
|
||||
#define INDIRECT_CALL_OPCODE (1)
|
||||
#define IP_RELATIVE_CALL_OPCODE (5)
|
||||
#define IP_RELATIVE_BRANCH_OPCODE (4)
|
||||
#define IP_RELATIVE_PREDICT_OPCODE (7)
|
||||
#define LONG_BRANCH_OPCODE (0xC)
|
||||
#define LONG_CALL_OPCODE (0xD)
|
||||
#define flush_insn_slot(p) do { } while (0)
|
||||
|
||||
typedef struct kprobe_opcode {
|
||||
bundle_t bundle;
|
||||
} kprobe_opcode_t;
|
||||
|
||||
/* Architecture specific copy of original instruction*/
|
||||
struct arch_specific_insn {
|
||||
/* copy of the instruction to be emulated */
|
||||
kprobe_opcode_t *insn;
|
||||
#define INST_FLAG_FIX_RELATIVE_IP_ADDR 1
|
||||
#define INST_FLAG_FIX_BRANCH_REG 2
|
||||
#define INST_FLAG_BREAK_INST 4
|
||||
#define INST_FLAG_BOOSTABLE 8
|
||||
unsigned long inst_flag;
|
||||
unsigned short target_br_reg;
|
||||
unsigned short slot;
|
||||
};
|
||||
|
||||
extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
|
||||
extern int kprobe_exceptions_notify(struct notifier_block *self,
|
||||
unsigned long val, void *data);
|
||||
|
||||
extern void invalidate_stacked_regs(void);
|
||||
extern void flush_register_stack(void);
|
||||
extern void arch_remove_kprobe(struct kprobe *p);
|
||||
|
||||
#endif /* _ASM_KPROBES_H */
|
165
arch/ia64/include/asm/kregs.h
Normal file
165
arch/ia64/include/asm/kregs.h
Normal file
|
@ -0,0 +1,165 @@
|
|||
#ifndef _ASM_IA64_KREGS_H
|
||||
#define _ASM_IA64_KREGS_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001-2002 Hewlett-Packard Co
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
/*
|
||||
* This file defines the kernel register usage convention used by Linux/ia64.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Kernel registers:
|
||||
*/
|
||||
#define IA64_KR_IO_BASE 0 /* ar.k0: legacy I/O base address */
|
||||
#define IA64_KR_TSSD 1 /* ar.k1: IVE uses this as the TSSD */
|
||||
#define IA64_KR_PER_CPU_DATA 3 /* ar.k3: physical per-CPU base */
|
||||
#define IA64_KR_CURRENT_STACK 4 /* ar.k4: what's mapped in IA64_TR_CURRENT_STACK */
|
||||
#define IA64_KR_FPU_OWNER 5 /* ar.k5: fpu-owner (UP only, at the moment) */
|
||||
#define IA64_KR_CURRENT 6 /* ar.k6: "current" task pointer */
|
||||
#define IA64_KR_PT_BASE 7 /* ar.k7: page table base address (physical) */
|
||||
|
||||
#define _IA64_KR_PASTE(x,y) x##y
|
||||
#define _IA64_KR_PREFIX(n) _IA64_KR_PASTE(ar.k, n)
|
||||
#define IA64_KR(n) _IA64_KR_PREFIX(IA64_KR_##n)
|
||||
|
||||
/*
|
||||
* Translation registers:
|
||||
*/
|
||||
#define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */
|
||||
#define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */
|
||||
#define IA64_TR_CURRENT_STACK 1 /* dtr1: maps kernel's memory- & register-stacks */
|
||||
|
||||
#define IA64_TR_ALLOC_BASE 2 /* itr&dtr: Base of dynamic TR resource*/
|
||||
#define IA64_TR_ALLOC_MAX 64 /* Max number for dynamic use*/
|
||||
|
||||
/* Processor status register bits: */
|
||||
#define IA64_PSR_BE_BIT 1
|
||||
#define IA64_PSR_UP_BIT 2
|
||||
#define IA64_PSR_AC_BIT 3
|
||||
#define IA64_PSR_MFL_BIT 4
|
||||
#define IA64_PSR_MFH_BIT 5
|
||||
#define IA64_PSR_IC_BIT 13
|
||||
#define IA64_PSR_I_BIT 14
|
||||
#define IA64_PSR_PK_BIT 15
|
||||
#define IA64_PSR_DT_BIT 17
|
||||
#define IA64_PSR_DFL_BIT 18
|
||||
#define IA64_PSR_DFH_BIT 19
|
||||
#define IA64_PSR_SP_BIT 20
|
||||
#define IA64_PSR_PP_BIT 21
|
||||
#define IA64_PSR_DI_BIT 22
|
||||
#define IA64_PSR_SI_BIT 23
|
||||
#define IA64_PSR_DB_BIT 24
|
||||
#define IA64_PSR_LP_BIT 25
|
||||
#define IA64_PSR_TB_BIT 26
|
||||
#define IA64_PSR_RT_BIT 27
|
||||
/* The following are not affected by save_flags()/restore_flags(): */
|
||||
#define IA64_PSR_CPL0_BIT 32
|
||||
#define IA64_PSR_CPL1_BIT 33
|
||||
#define IA64_PSR_IS_BIT 34
|
||||
#define IA64_PSR_MC_BIT 35
|
||||
#define IA64_PSR_IT_BIT 36
|
||||
#define IA64_PSR_ID_BIT 37
|
||||
#define IA64_PSR_DA_BIT 38
|
||||
#define IA64_PSR_DD_BIT 39
|
||||
#define IA64_PSR_SS_BIT 40
|
||||
#define IA64_PSR_RI_BIT 41
|
||||
#define IA64_PSR_ED_BIT 43
|
||||
#define IA64_PSR_BN_BIT 44
|
||||
#define IA64_PSR_IA_BIT 45
|
||||
|
||||
/* A mask of PSR bits that we generally don't want to inherit across a clone2() or an
|
||||
execve(). Only list flags here that need to be cleared/set for BOTH clone2() and
|
||||
execve(). */
|
||||
#define IA64_PSR_BITS_TO_CLEAR (IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_DB | IA64_PSR_LP | \
|
||||
IA64_PSR_TB | IA64_PSR_ID | IA64_PSR_DA | IA64_PSR_DD | \
|
||||
IA64_PSR_SS | IA64_PSR_ED | IA64_PSR_IA)
|
||||
#define IA64_PSR_BITS_TO_SET (IA64_PSR_DFH | IA64_PSR_SP)
|
||||
|
||||
#define IA64_PSR_BE (__IA64_UL(1) << IA64_PSR_BE_BIT)
|
||||
#define IA64_PSR_UP (__IA64_UL(1) << IA64_PSR_UP_BIT)
|
||||
#define IA64_PSR_AC (__IA64_UL(1) << IA64_PSR_AC_BIT)
|
||||
#define IA64_PSR_MFL (__IA64_UL(1) << IA64_PSR_MFL_BIT)
|
||||
#define IA64_PSR_MFH (__IA64_UL(1) << IA64_PSR_MFH_BIT)
|
||||
#define IA64_PSR_IC (__IA64_UL(1) << IA64_PSR_IC_BIT)
|
||||
#define IA64_PSR_I (__IA64_UL(1) << IA64_PSR_I_BIT)
|
||||
#define IA64_PSR_PK (__IA64_UL(1) << IA64_PSR_PK_BIT)
|
||||
#define IA64_PSR_DT (__IA64_UL(1) << IA64_PSR_DT_BIT)
|
||||
#define IA64_PSR_DFL (__IA64_UL(1) << IA64_PSR_DFL_BIT)
|
||||
#define IA64_PSR_DFH (__IA64_UL(1) << IA64_PSR_DFH_BIT)
|
||||
#define IA64_PSR_SP (__IA64_UL(1) << IA64_PSR_SP_BIT)
|
||||
#define IA64_PSR_PP (__IA64_UL(1) << IA64_PSR_PP_BIT)
|
||||
#define IA64_PSR_DI (__IA64_UL(1) << IA64_PSR_DI_BIT)
|
||||
#define IA64_PSR_SI (__IA64_UL(1) << IA64_PSR_SI_BIT)
|
||||
#define IA64_PSR_DB (__IA64_UL(1) << IA64_PSR_DB_BIT)
|
||||
#define IA64_PSR_LP (__IA64_UL(1) << IA64_PSR_LP_BIT)
|
||||
#define IA64_PSR_TB (__IA64_UL(1) << IA64_PSR_TB_BIT)
|
||||
#define IA64_PSR_RT (__IA64_UL(1) << IA64_PSR_RT_BIT)
|
||||
/* The following are not affected by save_flags()/restore_flags(): */
|
||||
#define IA64_PSR_CPL (__IA64_UL(3) << IA64_PSR_CPL0_BIT)
|
||||
#define IA64_PSR_IS (__IA64_UL(1) << IA64_PSR_IS_BIT)
|
||||
#define IA64_PSR_MC (__IA64_UL(1) << IA64_PSR_MC_BIT)
|
||||
#define IA64_PSR_IT (__IA64_UL(1) << IA64_PSR_IT_BIT)
|
||||
#define IA64_PSR_ID (__IA64_UL(1) << IA64_PSR_ID_BIT)
|
||||
#define IA64_PSR_DA (__IA64_UL(1) << IA64_PSR_DA_BIT)
|
||||
#define IA64_PSR_DD (__IA64_UL(1) << IA64_PSR_DD_BIT)
|
||||
#define IA64_PSR_SS (__IA64_UL(1) << IA64_PSR_SS_BIT)
|
||||
#define IA64_PSR_RI (__IA64_UL(3) << IA64_PSR_RI_BIT)
|
||||
#define IA64_PSR_ED (__IA64_UL(1) << IA64_PSR_ED_BIT)
|
||||
#define IA64_PSR_BN (__IA64_UL(1) << IA64_PSR_BN_BIT)
|
||||
#define IA64_PSR_IA (__IA64_UL(1) << IA64_PSR_IA_BIT)
|
||||
|
||||
/* User mask bits: */
|
||||
#define IA64_PSR_UM (IA64_PSR_BE | IA64_PSR_UP | IA64_PSR_AC | IA64_PSR_MFL | IA64_PSR_MFH)
|
||||
|
||||
/* Default Control Register */
|
||||
#define IA64_DCR_PP_BIT 0 /* privileged performance monitor default */
|
||||
#define IA64_DCR_BE_BIT 1 /* big-endian default */
|
||||
#define IA64_DCR_LC_BIT 2 /* ia32 lock-check enable */
|
||||
#define IA64_DCR_DM_BIT 8 /* defer TLB miss faults */
|
||||
#define IA64_DCR_DP_BIT 9 /* defer page-not-present faults */
|
||||
#define IA64_DCR_DK_BIT 10 /* defer key miss faults */
|
||||
#define IA64_DCR_DX_BIT 11 /* defer key permission faults */
|
||||
#define IA64_DCR_DR_BIT 12 /* defer access right faults */
|
||||
#define IA64_DCR_DA_BIT 13 /* defer access bit faults */
|
||||
#define IA64_DCR_DD_BIT 14 /* defer debug faults */
|
||||
|
||||
#define IA64_DCR_PP (__IA64_UL(1) << IA64_DCR_PP_BIT)
|
||||
#define IA64_DCR_BE (__IA64_UL(1) << IA64_DCR_BE_BIT)
|
||||
#define IA64_DCR_LC (__IA64_UL(1) << IA64_DCR_LC_BIT)
|
||||
#define IA64_DCR_DM (__IA64_UL(1) << IA64_DCR_DM_BIT)
|
||||
#define IA64_DCR_DP (__IA64_UL(1) << IA64_DCR_DP_BIT)
|
||||
#define IA64_DCR_DK (__IA64_UL(1) << IA64_DCR_DK_BIT)
|
||||
#define IA64_DCR_DX (__IA64_UL(1) << IA64_DCR_DX_BIT)
|
||||
#define IA64_DCR_DR (__IA64_UL(1) << IA64_DCR_DR_BIT)
|
||||
#define IA64_DCR_DA (__IA64_UL(1) << IA64_DCR_DA_BIT)
|
||||
#define IA64_DCR_DD (__IA64_UL(1) << IA64_DCR_DD_BIT)
|
||||
|
||||
/* Interrupt Status Register */
|
||||
#define IA64_ISR_X_BIT 32 /* execute access */
|
||||
#define IA64_ISR_W_BIT 33 /* write access */
|
||||
#define IA64_ISR_R_BIT 34 /* read access */
|
||||
#define IA64_ISR_NA_BIT 35 /* non-access */
|
||||
#define IA64_ISR_SP_BIT 36 /* speculative load exception */
|
||||
#define IA64_ISR_RS_BIT 37 /* mandatory register-stack exception */
|
||||
#define IA64_ISR_IR_BIT 38 /* invalid register frame exception */
|
||||
#define IA64_ISR_CODE_MASK 0xf
|
||||
|
||||
#define IA64_ISR_X (__IA64_UL(1) << IA64_ISR_X_BIT)
|
||||
#define IA64_ISR_W (__IA64_UL(1) << IA64_ISR_W_BIT)
|
||||
#define IA64_ISR_R (__IA64_UL(1) << IA64_ISR_R_BIT)
|
||||
#define IA64_ISR_NA (__IA64_UL(1) << IA64_ISR_NA_BIT)
|
||||
#define IA64_ISR_SP (__IA64_UL(1) << IA64_ISR_SP_BIT)
|
||||
#define IA64_ISR_RS (__IA64_UL(1) << IA64_ISR_RS_BIT)
|
||||
#define IA64_ISR_IR (__IA64_UL(1) << IA64_ISR_IR_BIT)
|
||||
|
||||
/* ISR code field for non-access instructions */
|
||||
#define IA64_ISR_CODE_TPA 0
|
||||
#define IA64_ISR_CODE_FC 1
|
||||
#define IA64_ISR_CODE_PROBE 2
|
||||
#define IA64_ISR_CODE_TAK 3
|
||||
#define IA64_ISR_CODE_LFETCH 4
|
||||
#define IA64_ISR_CODE_PROBEF 5
|
||||
|
||||
#endif /* _ASM_IA64_kREGS_H */
|
609
arch/ia64/include/asm/kvm_host.h
Normal file
609
arch/ia64/include/asm/kvm_host.h
Normal file
|
@ -0,0 +1,609 @@
|
|||
/*
|
||||
* kvm_host.h: used for kvm module, and hold ia64-specific sections.
|
||||
*
|
||||
* Copyright (C) 2007, Intel Corporation.
|
||||
*
|
||||
* Xiantao Zhang <xiantao.zhang@intel.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope 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 __ASM_KVM_HOST_H
|
||||
#define __ASM_KVM_HOST_H
|
||||
|
||||
#define KVM_USER_MEM_SLOTS 32
|
||||
|
||||
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
|
||||
#define KVM_IRQCHIP_NUM_PINS KVM_IOAPIC_NUM_PINS
|
||||
|
||||
/* define exit reasons from vmm to kvm*/
|
||||
#define EXIT_REASON_VM_PANIC 0
|
||||
#define EXIT_REASON_MMIO_INSTRUCTION 1
|
||||
#define EXIT_REASON_PAL_CALL 2
|
||||
#define EXIT_REASON_SAL_CALL 3
|
||||
#define EXIT_REASON_SWITCH_RR6 4
|
||||
#define EXIT_REASON_VM_DESTROY 5
|
||||
#define EXIT_REASON_EXTERNAL_INTERRUPT 6
|
||||
#define EXIT_REASON_IPI 7
|
||||
#define EXIT_REASON_PTC_G 8
|
||||
#define EXIT_REASON_DEBUG 20
|
||||
|
||||
/*Define vmm address space and vm data space.*/
|
||||
#define KVM_VMM_SIZE (__IA64_UL_CONST(16)<<20)
|
||||
#define KVM_VMM_SHIFT 24
|
||||
#define KVM_VMM_BASE 0xD000000000000000
|
||||
#define VMM_SIZE (__IA64_UL_CONST(8)<<20)
|
||||
|
||||
/*
|
||||
* Define vm_buffer, used by PAL Services, base address.
|
||||
* Note: vm_buffer is in the VMM-BLOCK, the size must be < 8M
|
||||
*/
|
||||
#define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
|
||||
#define KVM_VM_BUFFER_SIZE (__IA64_UL_CONST(8)<<20)
|
||||
|
||||
/*
|
||||
* kvm guest's data area looks as follow:
|
||||
*
|
||||
* +----------------------+ ------- KVM_VM_DATA_SIZE
|
||||
* | vcpu[n]'s data | | ___________________KVM_STK_OFFSET
|
||||
* | | | / |
|
||||
* | .......... | | /vcpu's struct&stack |
|
||||
* | .......... | | /---------------------|---- 0
|
||||
* | vcpu[5]'s data | | / vpd |
|
||||
* | vcpu[4]'s data | |/-----------------------|
|
||||
* | vcpu[3]'s data | / vtlb |
|
||||
* | vcpu[2]'s data | /|------------------------|
|
||||
* | vcpu[1]'s data |/ | vhpt |
|
||||
* | vcpu[0]'s data |____________________________|
|
||||
* +----------------------+ |
|
||||
* | memory dirty log | |
|
||||
* +----------------------+ |
|
||||
* | vm's data struct | |
|
||||
* +----------------------+ |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | vm's p2m table | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | | |
|
||||
* vm's data->| | | |
|
||||
* +----------------------+ ------- 0
|
||||
* To support large memory, needs to increase the size of p2m.
|
||||
* To support more vcpus, needs to ensure it has enough space to
|
||||
* hold vcpus' data.
|
||||
*/
|
||||
|
||||
#define KVM_VM_DATA_SHIFT 26
|
||||
#define KVM_VM_DATA_SIZE (__IA64_UL_CONST(1) << KVM_VM_DATA_SHIFT)
|
||||
#define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VM_DATA_SIZE)
|
||||
|
||||
#define KVM_P2M_BASE KVM_VM_DATA_BASE
|
||||
#define KVM_P2M_SIZE (__IA64_UL_CONST(24) << 20)
|
||||
|
||||
#define VHPT_SHIFT 16
|
||||
#define VHPT_SIZE (__IA64_UL_CONST(1) << VHPT_SHIFT)
|
||||
#define VHPT_NUM_ENTRIES (__IA64_UL_CONST(1) << (VHPT_SHIFT-5))
|
||||
|
||||
#define VTLB_SHIFT 16
|
||||
#define VTLB_SIZE (__IA64_UL_CONST(1) << VTLB_SHIFT)
|
||||
#define VTLB_NUM_ENTRIES (1UL << (VHPT_SHIFT-5))
|
||||
|
||||
#define VPD_SHIFT 16
|
||||
#define VPD_SIZE (__IA64_UL_CONST(1) << VPD_SHIFT)
|
||||
|
||||
#define VCPU_STRUCT_SHIFT 16
|
||||
#define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT)
|
||||
|
||||
/*
|
||||
* This must match KVM_IA64_VCPU_STACK_{SHIFT,SIZE} arch/ia64/include/asm/kvm.h
|
||||
*/
|
||||
#define KVM_STK_SHIFT 16
|
||||
#define KVM_STK_OFFSET (__IA64_UL_CONST(1)<< KVM_STK_SHIFT)
|
||||
|
||||
#define KVM_VM_STRUCT_SHIFT 19
|
||||
#define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT)
|
||||
|
||||
#define KVM_MEM_DIRY_LOG_SHIFT 19
|
||||
#define KVM_MEM_DIRTY_LOG_SIZE (__IA64_UL_CONST(1) << KVM_MEM_DIRY_LOG_SHIFT)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/*Define the max vcpus and memory for Guests.*/
|
||||
#define KVM_MAX_VCPUS (KVM_VM_DATA_SIZE - KVM_P2M_SIZE - KVM_VM_STRUCT_SIZE -\
|
||||
KVM_MEM_DIRTY_LOG_SIZE) / sizeof(struct kvm_vcpu_data)
|
||||
#define KVM_MAX_MEM_SIZE (KVM_P2M_SIZE >> 3 << PAGE_SHIFT)
|
||||
|
||||
#define VMM_LOG_LEN 256
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/kvm.h>
|
||||
#include <linux/kvm_para.h>
|
||||
#include <linux/kvm_types.h>
|
||||
|
||||
#include <asm/pal.h>
|
||||
#include <asm/sal.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
struct kvm_vcpu_data {
|
||||
char vcpu_vhpt[VHPT_SIZE];
|
||||
char vcpu_vtlb[VTLB_SIZE];
|
||||
char vcpu_vpd[VPD_SIZE];
|
||||
char vcpu_struct[VCPU_STRUCT_SIZE];
|
||||
};
|
||||
|
||||
struct kvm_vm_data {
|
||||
char kvm_p2m[KVM_P2M_SIZE];
|
||||
char kvm_vm_struct[KVM_VM_STRUCT_SIZE];
|
||||
char kvm_mem_dirty_log[KVM_MEM_DIRTY_LOG_SIZE];
|
||||
struct kvm_vcpu_data vcpu_data[KVM_MAX_VCPUS];
|
||||
};
|
||||
|
||||
#define VCPU_BASE(n) (KVM_VM_DATA_BASE + \
|
||||
offsetof(struct kvm_vm_data, vcpu_data[n]))
|
||||
#define KVM_VM_BASE (KVM_VM_DATA_BASE + \
|
||||
offsetof(struct kvm_vm_data, kvm_vm_struct))
|
||||
#define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \
|
||||
offsetof(struct kvm_vm_data, kvm_mem_dirty_log)
|
||||
|
||||
#define VHPT_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vhpt))
|
||||
#define VTLB_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vtlb))
|
||||
#define VPD_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vpd))
|
||||
#define VCPU_STRUCT_BASE(n) (VCPU_BASE(n) + \
|
||||
offsetof(struct kvm_vcpu_data, vcpu_struct))
|
||||
|
||||
/*IO section definitions*/
|
||||
#define IOREQ_READ 1
|
||||
#define IOREQ_WRITE 0
|
||||
|
||||
#define STATE_IOREQ_NONE 0
|
||||
#define STATE_IOREQ_READY 1
|
||||
#define STATE_IOREQ_INPROCESS 2
|
||||
#define STATE_IORESP_READY 3
|
||||
|
||||
/*Guest Physical address layout.*/
|
||||
#define GPFN_MEM (0UL << 60) /* Guest pfn is normal mem */
|
||||
#define GPFN_FRAME_BUFFER (1UL << 60) /* VGA framebuffer */
|
||||
#define GPFN_LOW_MMIO (2UL << 60) /* Low MMIO range */
|
||||
#define GPFN_PIB (3UL << 60) /* PIB base */
|
||||
#define GPFN_IOSAPIC (4UL << 60) /* IOSAPIC base */
|
||||
#define GPFN_LEGACY_IO (5UL << 60) /* Legacy I/O base */
|
||||
#define GPFN_GFW (6UL << 60) /* Guest Firmware */
|
||||
#define GPFN_PHYS_MMIO (7UL << 60) /* Directed MMIO Range */
|
||||
|
||||
#define GPFN_IO_MASK (7UL << 60) /* Guest pfn is I/O type */
|
||||
#define GPFN_INV_MASK (1UL << 63) /* Guest pfn is invalid */
|
||||
#define INVALID_MFN (~0UL)
|
||||
#define MEM_G (1UL << 30)
|
||||
#define MEM_M (1UL << 20)
|
||||
#define MMIO_START (3 * MEM_G)
|
||||
#define MMIO_SIZE (512 * MEM_M)
|
||||
#define VGA_IO_START 0xA0000UL
|
||||
#define VGA_IO_SIZE 0x20000
|
||||
#define LEGACY_IO_START (MMIO_START + MMIO_SIZE)
|
||||
#define LEGACY_IO_SIZE (64 * MEM_M)
|
||||
#define IO_SAPIC_START 0xfec00000UL
|
||||
#define IO_SAPIC_SIZE 0x100000
|
||||
#define PIB_START 0xfee00000UL
|
||||
#define PIB_SIZE 0x200000
|
||||
#define GFW_START (4 * MEM_G - 16 * MEM_M)
|
||||
#define GFW_SIZE (16 * MEM_M)
|
||||
|
||||
/*Deliver mode, defined for ioapic.c*/
|
||||
#define dest_Fixed IOSAPIC_FIXED
|
||||
#define dest_LowestPrio IOSAPIC_LOWEST_PRIORITY
|
||||
|
||||
#define NMI_VECTOR 2
|
||||
#define ExtINT_VECTOR 0
|
||||
#define NULL_VECTOR (-1)
|
||||
#define IA64_SPURIOUS_INT_VECTOR 0x0f
|
||||
|
||||
#define VCPU_LID(v) (((u64)(v)->vcpu_id) << 24)
|
||||
|
||||
/*
|
||||
*Delivery mode
|
||||
*/
|
||||
#define SAPIC_DELIV_SHIFT 8
|
||||
#define SAPIC_FIXED 0x0
|
||||
#define SAPIC_LOWEST_PRIORITY 0x1
|
||||
#define SAPIC_PMI 0x2
|
||||
#define SAPIC_NMI 0x4
|
||||
#define SAPIC_INIT 0x5
|
||||
#define SAPIC_EXTINT 0x7
|
||||
|
||||
/*
|
||||
* vcpu->requests bit members for arch
|
||||
*/
|
||||
#define KVM_REQ_PTC_G 32
|
||||
#define KVM_REQ_RESUME 33
|
||||
|
||||
struct kvm_mmio_req {
|
||||
uint64_t addr; /* physical address */
|
||||
uint64_t size; /* size in bytes */
|
||||
uint64_t data; /* data (or paddr of data) */
|
||||
uint8_t state:4;
|
||||
uint8_t dir:1; /* 1=read, 0=write */
|
||||
};
|
||||
|
||||
/*Pal data struct */
|
||||
struct kvm_pal_call{
|
||||
/*In area*/
|
||||
uint64_t gr28;
|
||||
uint64_t gr29;
|
||||
uint64_t gr30;
|
||||
uint64_t gr31;
|
||||
/*Out area*/
|
||||
struct ia64_pal_retval ret;
|
||||
};
|
||||
|
||||
/* Sal data structure */
|
||||
struct kvm_sal_call{
|
||||
/*In area*/
|
||||
uint64_t in0;
|
||||
uint64_t in1;
|
||||
uint64_t in2;
|
||||
uint64_t in3;
|
||||
uint64_t in4;
|
||||
uint64_t in5;
|
||||
uint64_t in6;
|
||||
uint64_t in7;
|
||||
struct sal_ret_values ret;
|
||||
};
|
||||
|
||||
/*Guest change rr6*/
|
||||
struct kvm_switch_rr6 {
|
||||
uint64_t old_rr;
|
||||
uint64_t new_rr;
|
||||
};
|
||||
|
||||
union ia64_ipi_a{
|
||||
unsigned long val;
|
||||
struct {
|
||||
unsigned long rv : 3;
|
||||
unsigned long ir : 1;
|
||||
unsigned long eid : 8;
|
||||
unsigned long id : 8;
|
||||
unsigned long ib_base : 44;
|
||||
};
|
||||
};
|
||||
|
||||
union ia64_ipi_d {
|
||||
unsigned long val;
|
||||
struct {
|
||||
unsigned long vector : 8;
|
||||
unsigned long dm : 3;
|
||||
unsigned long ig : 53;
|
||||
};
|
||||
};
|
||||
|
||||
/*ipi check exit data*/
|
||||
struct kvm_ipi_data{
|
||||
union ia64_ipi_a addr;
|
||||
union ia64_ipi_d data;
|
||||
};
|
||||
|
||||
/*global purge data*/
|
||||
struct kvm_ptc_g {
|
||||
unsigned long vaddr;
|
||||
unsigned long rr;
|
||||
unsigned long ps;
|
||||
struct kvm_vcpu *vcpu;
|
||||
};
|
||||
|
||||
/*Exit control data */
|
||||
struct exit_ctl_data{
|
||||
uint32_t exit_reason;
|
||||
uint32_t vm_status;
|
||||
union {
|
||||
struct kvm_mmio_req ioreq;
|
||||
struct kvm_pal_call pal_data;
|
||||
struct kvm_sal_call sal_data;
|
||||
struct kvm_switch_rr6 rr_data;
|
||||
struct kvm_ipi_data ipi_data;
|
||||
struct kvm_ptc_g ptc_g_data;
|
||||
} u;
|
||||
};
|
||||
|
||||
union pte_flags {
|
||||
unsigned long val;
|
||||
struct {
|
||||
unsigned long p : 1; /*0 */
|
||||
unsigned long : 1; /* 1 */
|
||||
unsigned long ma : 3; /* 2-4 */
|
||||
unsigned long a : 1; /* 5 */
|
||||
unsigned long d : 1; /* 6 */
|
||||
unsigned long pl : 2; /* 7-8 */
|
||||
unsigned long ar : 3; /* 9-11 */
|
||||
unsigned long ppn : 38; /* 12-49 */
|
||||
unsigned long : 2; /* 50-51 */
|
||||
unsigned long ed : 1; /* 52 */
|
||||
};
|
||||
};
|
||||
|
||||
union ia64_pta {
|
||||
unsigned long val;
|
||||
struct {
|
||||
unsigned long ve : 1;
|
||||
unsigned long reserved0 : 1;
|
||||
unsigned long size : 6;
|
||||
unsigned long vf : 1;
|
||||
unsigned long reserved1 : 6;
|
||||
unsigned long base : 49;
|
||||
};
|
||||
};
|
||||
|
||||
struct thash_cb {
|
||||
/* THASH base information */
|
||||
struct thash_data *hash; /* hash table pointer */
|
||||
union ia64_pta pta;
|
||||
int num;
|
||||
};
|
||||
|
||||
struct kvm_vcpu_stat {
|
||||
u32 halt_wakeup;
|
||||
};
|
||||
|
||||
struct kvm_vcpu_arch {
|
||||
int launched;
|
||||
int last_exit;
|
||||
int last_run_cpu;
|
||||
int vmm_tr_slot;
|
||||
int vm_tr_slot;
|
||||
int sn_rtc_tr_slot;
|
||||
|
||||
#define KVM_MP_STATE_RUNNABLE 0
|
||||
#define KVM_MP_STATE_UNINITIALIZED 1
|
||||
#define KVM_MP_STATE_INIT_RECEIVED 2
|
||||
#define KVM_MP_STATE_HALTED 3
|
||||
int mp_state;
|
||||
|
||||
#define MAX_PTC_G_NUM 3
|
||||
int ptc_g_count;
|
||||
struct kvm_ptc_g ptc_g_data[MAX_PTC_G_NUM];
|
||||
|
||||
/*halt timer to wake up sleepy vcpus*/
|
||||
struct hrtimer hlt_timer;
|
||||
long ht_active;
|
||||
|
||||
struct kvm_lapic *apic; /* kernel irqchip context */
|
||||
struct vpd *vpd;
|
||||
|
||||
/* Exit data for vmm_transition*/
|
||||
struct exit_ctl_data exit_data;
|
||||
|
||||
cpumask_t cache_coherent_map;
|
||||
|
||||
unsigned long vmm_rr;
|
||||
unsigned long host_rr6;
|
||||
unsigned long psbits[8];
|
||||
unsigned long cr_iipa;
|
||||
unsigned long cr_isr;
|
||||
unsigned long vsa_base;
|
||||
unsigned long dirty_log_lock_pa;
|
||||
unsigned long __gp;
|
||||
/* TR and TC. */
|
||||
struct thash_data itrs[NITRS];
|
||||
struct thash_data dtrs[NDTRS];
|
||||
/* Bit is set if there is a tr/tc for the region. */
|
||||
unsigned char itr_regions;
|
||||
unsigned char dtr_regions;
|
||||
unsigned char tc_regions;
|
||||
/* purge all */
|
||||
unsigned long ptce_base;
|
||||
unsigned long ptce_count[2];
|
||||
unsigned long ptce_stride[2];
|
||||
/* itc/itm */
|
||||
unsigned long last_itc;
|
||||
long itc_offset;
|
||||
unsigned long itc_check;
|
||||
unsigned long timer_check;
|
||||
unsigned int timer_pending;
|
||||
unsigned int timer_fired;
|
||||
|
||||
unsigned long vrr[8];
|
||||
unsigned long ibr[8];
|
||||
unsigned long dbr[8];
|
||||
unsigned long insvc[4]; /* Interrupt in service. */
|
||||
unsigned long xtp;
|
||||
|
||||
unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
|
||||
unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
|
||||
unsigned long metaphysical_saved_rr0; /* from kvm_arch */
|
||||
unsigned long metaphysical_saved_rr4; /* from kvm_arch */
|
||||
unsigned long fp_psr; /*used for lazy float register */
|
||||
unsigned long saved_gp;
|
||||
/*for phycial emulation */
|
||||
int mode_flags;
|
||||
struct thash_cb vtlb;
|
||||
struct thash_cb vhpt;
|
||||
char irq_check;
|
||||
char irq_new_pending;
|
||||
|
||||
unsigned long opcode;
|
||||
unsigned long cause;
|
||||
char log_buf[VMM_LOG_LEN];
|
||||
union context host;
|
||||
union context guest;
|
||||
|
||||
char mmio_data[8];
|
||||
};
|
||||
|
||||
struct kvm_vm_stat {
|
||||
u64 remote_tlb_flush;
|
||||
};
|
||||
|
||||
struct kvm_sal_data {
|
||||
unsigned long boot_ip;
|
||||
unsigned long boot_gp;
|
||||
};
|
||||
|
||||
struct kvm_arch_memory_slot {
|
||||
};
|
||||
|
||||
struct kvm_arch {
|
||||
spinlock_t dirty_log_lock;
|
||||
|
||||
unsigned long vm_base;
|
||||
unsigned long metaphysical_rr0;
|
||||
unsigned long metaphysical_rr4;
|
||||
unsigned long vmm_init_rr;
|
||||
|
||||
int is_sn2;
|
||||
|
||||
struct kvm_ioapic *vioapic;
|
||||
struct kvm_vm_stat stat;
|
||||
struct kvm_sal_data rdv_sal_data;
|
||||
|
||||
struct list_head assigned_dev_head;
|
||||
struct iommu_domain *iommu_domain;
|
||||
bool iommu_noncoherent;
|
||||
|
||||
unsigned long irq_sources_bitmap;
|
||||
unsigned long irq_states[KVM_IOAPIC_NUM_PINS];
|
||||
};
|
||||
|
||||
union cpuid3_t {
|
||||
u64 value;
|
||||
struct {
|
||||
u64 number : 8;
|
||||
u64 revision : 8;
|
||||
u64 model : 8;
|
||||
u64 family : 8;
|
||||
u64 archrev : 8;
|
||||
u64 rv : 24;
|
||||
};
|
||||
};
|
||||
|
||||
struct kvm_pt_regs {
|
||||
/* The following registers are saved by SAVE_MIN: */
|
||||
unsigned long b6; /* scratch */
|
||||
unsigned long b7; /* scratch */
|
||||
|
||||
unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
|
||||
unsigned long ar_ssd; /* reserved for future use (scratch) */
|
||||
|
||||
unsigned long r8; /* scratch (return value register 0) */
|
||||
unsigned long r9; /* scratch (return value register 1) */
|
||||
unsigned long r10; /* scratch (return value register 2) */
|
||||
unsigned long r11; /* scratch (return value register 3) */
|
||||
|
||||
unsigned long cr_ipsr; /* interrupted task's psr */
|
||||
unsigned long cr_iip; /* interrupted task's instruction pointer */
|
||||
unsigned long cr_ifs; /* interrupted task's function state */
|
||||
|
||||
unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
|
||||
unsigned long ar_pfs; /* prev function state */
|
||||
unsigned long ar_rsc; /* RSE configuration */
|
||||
/* The following two are valid only if cr_ipsr.cpl > 0: */
|
||||
unsigned long ar_rnat; /* RSE NaT */
|
||||
unsigned long ar_bspstore; /* RSE bspstore */
|
||||
|
||||
unsigned long pr; /* 64 predicate registers (1 bit each) */
|
||||
unsigned long b0; /* return pointer (bp) */
|
||||
unsigned long loadrs; /* size of dirty partition << 16 */
|
||||
|
||||
unsigned long r1; /* the gp pointer */
|
||||
unsigned long r12; /* interrupted task's memory stack pointer */
|
||||
unsigned long r13; /* thread pointer */
|
||||
|
||||
unsigned long ar_fpsr; /* floating point status (preserved) */
|
||||
unsigned long r15; /* scratch */
|
||||
|
||||
/* The remaining registers are NOT saved for system calls. */
|
||||
unsigned long r14; /* scratch */
|
||||
unsigned long r2; /* scratch */
|
||||
unsigned long r3; /* scratch */
|
||||
unsigned long r16; /* scratch */
|
||||
unsigned long r17; /* scratch */
|
||||
unsigned long r18; /* scratch */
|
||||
unsigned long r19; /* scratch */
|
||||
unsigned long r20; /* scratch */
|
||||
unsigned long r21; /* scratch */
|
||||
unsigned long r22; /* scratch */
|
||||
unsigned long r23; /* scratch */
|
||||
unsigned long r24; /* scratch */
|
||||
unsigned long r25; /* scratch */
|
||||
unsigned long r26; /* scratch */
|
||||
unsigned long r27; /* scratch */
|
||||
unsigned long r28; /* scratch */
|
||||
unsigned long r29; /* scratch */
|
||||
unsigned long r30; /* scratch */
|
||||
unsigned long r31; /* scratch */
|
||||
unsigned long ar_ccv; /* compare/exchange value (scratch) */
|
||||
|
||||
/*
|
||||
* Floating point registers that the kernel considers scratch:
|
||||
*/
|
||||
struct ia64_fpreg f6; /* scratch */
|
||||
struct ia64_fpreg f7; /* scratch */
|
||||
struct ia64_fpreg f8; /* scratch */
|
||||
struct ia64_fpreg f9; /* scratch */
|
||||
struct ia64_fpreg f10; /* scratch */
|
||||
struct ia64_fpreg f11; /* scratch */
|
||||
|
||||
unsigned long r4; /* preserved */
|
||||
unsigned long r5; /* preserved */
|
||||
unsigned long r6; /* preserved */
|
||||
unsigned long r7; /* preserved */
|
||||
unsigned long eml_unat; /* used for emulating instruction */
|
||||
unsigned long pad0; /* alignment pad */
|
||||
};
|
||||
|
||||
static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v)
|
||||
{
|
||||
return (struct kvm_pt_regs *) ((unsigned long) v + KVM_STK_OFFSET) - 1;
|
||||
}
|
||||
|
||||
typedef int kvm_vmm_entry(void);
|
||||
typedef void kvm_tramp_entry(union context *host, union context *guest);
|
||||
|
||||
struct kvm_vmm_info{
|
||||
struct module *module;
|
||||
kvm_vmm_entry *vmm_entry;
|
||||
kvm_tramp_entry *tramp_entry;
|
||||
unsigned long vmm_ivt;
|
||||
unsigned long patch_mov_ar;
|
||||
unsigned long patch_mov_ar_sn2;
|
||||
};
|
||||
|
||||
int kvm_highest_pending_irq(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_halt(struct kvm_vcpu *vcpu);
|
||||
int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
|
||||
void kvm_sal_emul(struct kvm_vcpu *vcpu);
|
||||
|
||||
#define __KVM_HAVE_ARCH_VM_ALLOC 1
|
||||
struct kvm *kvm_arch_alloc_vm(void);
|
||||
void kvm_arch_free_vm(struct kvm *kvm);
|
||||
|
||||
static inline void kvm_arch_sync_events(struct kvm *kvm) {}
|
||||
static inline void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) {}
|
||||
static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu) {}
|
||||
static inline void kvm_arch_free_memslot(struct kvm *kvm,
|
||||
struct kvm_memory_slot *free, struct kvm_memory_slot *dont) {}
|
||||
static inline void kvm_arch_memslots_updated(struct kvm *kvm) {}
|
||||
static inline void kvm_arch_commit_memory_region(struct kvm *kvm,
|
||||
struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
enum kvm_mr_change change) {}
|
||||
static inline void kvm_arch_hardware_unsetup(void) {}
|
||||
|
||||
#endif /* __ASSEMBLY__*/
|
||||
|
||||
#endif
|
12
arch/ia64/include/asm/libata-portmap.h
Normal file
12
arch/ia64/include/asm/libata-portmap.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef __ASM_IA64_LIBATA_PORTMAP_H
|
||||
#define __ASM_IA64_LIBATA_PORTMAP_H
|
||||
|
||||
#define ATA_PRIMARY_CMD 0x1F0
|
||||
#define ATA_PRIMARY_CTL 0x3F6
|
||||
#define ATA_PRIMARY_IRQ(dev) isa_irq_to_vector(14)
|
||||
|
||||
#define ATA_SECONDARY_CMD 0x170
|
||||
#define ATA_SECONDARY_CTL 0x376
|
||||
#define ATA_SECONDARY_IRQ(dev) isa_irq_to_vector(15)
|
||||
|
||||
#endif
|
18
arch/ia64/include/asm/linkage.h
Normal file
18
arch/ia64/include/asm/linkage.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef __ASM_LINKAGE_H
|
||||
#define __ASM_LINKAGE_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
|
||||
|
||||
#else
|
||||
|
||||
#include <asm/asmmacro.h>
|
||||
|
||||
#endif
|
||||
|
||||
#define cond_syscall(x) asm(".weak\t" #x "#\n" #x "#\t=\tsys_ni_syscall#")
|
||||
#define SYSCALL_ALIAS(alias, name) \
|
||||
asm ( #alias "# = " #name "#\n\t.globl " #alias "#")
|
||||
|
||||
#endif
|
1
arch/ia64/include/asm/local.h
Normal file
1
arch/ia64/include/asm/local.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/local.h>
|
1
arch/ia64/include/asm/local64.h
Normal file
1
arch/ia64/include/asm/local64.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/local64.h>
|
367
arch/ia64/include/asm/machvec.h
Normal file
367
arch/ia64/include/asm/machvec.h
Normal file
|
@ -0,0 +1,367 @@
|
|||
/*
|
||||
* Machine vector for IA-64.
|
||||
*
|
||||
* Copyright (C) 1999 Silicon Graphics, Inc.
|
||||
* Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
|
||||
* Copyright (C) Vijay Chander <vijay@engr.sgi.com>
|
||||
* Copyright (C) 1999-2001, 2003-2004 Hewlett-Packard Co.
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>
|
||||
*/
|
||||
#ifndef _ASM_IA64_MACHVEC_H
|
||||
#define _ASM_IA64_MACHVEC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* forward declarations: */
|
||||
struct device;
|
||||
struct pt_regs;
|
||||
struct scatterlist;
|
||||
struct page;
|
||||
struct mm_struct;
|
||||
struct pci_bus;
|
||||
struct task_struct;
|
||||
struct pci_dev;
|
||||
struct msi_desc;
|
||||
struct dma_attrs;
|
||||
|
||||
typedef void ia64_mv_setup_t (char **);
|
||||
typedef void ia64_mv_cpu_init_t (void);
|
||||
typedef void ia64_mv_irq_init_t (void);
|
||||
typedef void ia64_mv_send_ipi_t (int, int, int, int);
|
||||
typedef void ia64_mv_timer_interrupt_t (int, void *);
|
||||
typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long);
|
||||
typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
|
||||
typedef u8 ia64_mv_irq_to_vector (int);
|
||||
typedef unsigned int ia64_mv_local_vector_to_irq (u8);
|
||||
typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *);
|
||||
typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
|
||||
u8 size);
|
||||
typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val,
|
||||
u8 size);
|
||||
typedef void ia64_mv_migrate_t(struct task_struct * task);
|
||||
typedef void ia64_mv_pci_fixup_bus_t (struct pci_bus *);
|
||||
typedef void ia64_mv_kernel_launch_event_t(void);
|
||||
|
||||
/* DMA-mapping interface: */
|
||||
typedef void ia64_mv_dma_init (void);
|
||||
typedef u64 ia64_mv_dma_get_required_mask (struct device *);
|
||||
typedef struct dma_map_ops *ia64_mv_dma_get_ops(struct device *);
|
||||
|
||||
/*
|
||||
* WARNING: The legacy I/O space is _architected_. Platforms are
|
||||
* expected to follow this architected model (see Section 10.7 in the
|
||||
* IA-64 Architecture Software Developer's Manual). Unfortunately,
|
||||
* some broken machines do not follow that model, which is why we have
|
||||
* to make the inX/outX operations part of the machine vector.
|
||||
* Platform designers should follow the architected model whenever
|
||||
* possible.
|
||||
*/
|
||||
typedef unsigned int ia64_mv_inb_t (unsigned long);
|
||||
typedef unsigned int ia64_mv_inw_t (unsigned long);
|
||||
typedef unsigned int ia64_mv_inl_t (unsigned long);
|
||||
typedef void ia64_mv_outb_t (unsigned char, unsigned long);
|
||||
typedef void ia64_mv_outw_t (unsigned short, unsigned long);
|
||||
typedef void ia64_mv_outl_t (unsigned int, unsigned long);
|
||||
typedef void ia64_mv_mmiowb_t (void);
|
||||
typedef unsigned char ia64_mv_readb_t (const volatile void __iomem *);
|
||||
typedef unsigned short ia64_mv_readw_t (const volatile void __iomem *);
|
||||
typedef unsigned int ia64_mv_readl_t (const volatile void __iomem *);
|
||||
typedef unsigned long ia64_mv_readq_t (const volatile void __iomem *);
|
||||
typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *);
|
||||
typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
|
||||
typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
|
||||
typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
|
||||
|
||||
typedef int ia64_mv_setup_msi_irq_t (struct pci_dev *pdev, struct msi_desc *);
|
||||
typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
|
||||
|
||||
static inline void
|
||||
machvec_noop (void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
machvec_noop_mm (struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
machvec_noop_task (struct task_struct *task)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
machvec_noop_bus (struct pci_bus *bus)
|
||||
{
|
||||
}
|
||||
|
||||
extern void machvec_setup (char **);
|
||||
extern void machvec_timer_interrupt (int, void *);
|
||||
extern void machvec_tlb_migrate_finish (struct mm_struct *);
|
||||
|
||||
# if defined (CONFIG_IA64_HP_SIM)
|
||||
# include <asm/machvec_hpsim.h>
|
||||
# elif defined (CONFIG_IA64_DIG)
|
||||
# include <asm/machvec_dig.h>
|
||||
# elif defined(CONFIG_IA64_DIG_VTD)
|
||||
# include <asm/machvec_dig_vtd.h>
|
||||
# elif defined (CONFIG_IA64_HP_ZX1)
|
||||
# include <asm/machvec_hpzx1.h>
|
||||
# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB)
|
||||
# include <asm/machvec_hpzx1_swiotlb.h>
|
||||
# elif defined (CONFIG_IA64_SGI_SN2)
|
||||
# include <asm/machvec_sn2.h>
|
||||
# elif defined (CONFIG_IA64_SGI_UV)
|
||||
# include <asm/machvec_uv.h>
|
||||
# elif defined (CONFIG_IA64_GENERIC)
|
||||
|
||||
# ifdef MACHVEC_PLATFORM_HEADER
|
||||
# include MACHVEC_PLATFORM_HEADER
|
||||
# else
|
||||
# define ia64_platform_name ia64_mv.name
|
||||
# define platform_setup ia64_mv.setup
|
||||
# define platform_cpu_init ia64_mv.cpu_init
|
||||
# define platform_irq_init ia64_mv.irq_init
|
||||
# define platform_send_ipi ia64_mv.send_ipi
|
||||
# define platform_timer_interrupt ia64_mv.timer_interrupt
|
||||
# define platform_global_tlb_purge ia64_mv.global_tlb_purge
|
||||
# define platform_tlb_migrate_finish ia64_mv.tlb_migrate_finish
|
||||
# define platform_dma_init ia64_mv.dma_init
|
||||
# define platform_dma_get_required_mask ia64_mv.dma_get_required_mask
|
||||
# define platform_dma_get_ops ia64_mv.dma_get_ops
|
||||
# define platform_irq_to_vector ia64_mv.irq_to_vector
|
||||
# define platform_local_vector_to_irq ia64_mv.local_vector_to_irq
|
||||
# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem
|
||||
# define platform_pci_legacy_read ia64_mv.pci_legacy_read
|
||||
# define platform_pci_legacy_write ia64_mv.pci_legacy_write
|
||||
# define platform_inb ia64_mv.inb
|
||||
# define platform_inw ia64_mv.inw
|
||||
# define platform_inl ia64_mv.inl
|
||||
# define platform_outb ia64_mv.outb
|
||||
# define platform_outw ia64_mv.outw
|
||||
# define platform_outl ia64_mv.outl
|
||||
# define platform_mmiowb ia64_mv.mmiowb
|
||||
# define platform_readb ia64_mv.readb
|
||||
# define platform_readw ia64_mv.readw
|
||||
# define platform_readl ia64_mv.readl
|
||||
# define platform_readq ia64_mv.readq
|
||||
# define platform_readb_relaxed ia64_mv.readb_relaxed
|
||||
# define platform_readw_relaxed ia64_mv.readw_relaxed
|
||||
# define platform_readl_relaxed ia64_mv.readl_relaxed
|
||||
# define platform_readq_relaxed ia64_mv.readq_relaxed
|
||||
# define platform_migrate ia64_mv.migrate
|
||||
# define platform_setup_msi_irq ia64_mv.setup_msi_irq
|
||||
# define platform_teardown_msi_irq ia64_mv.teardown_msi_irq
|
||||
# define platform_pci_fixup_bus ia64_mv.pci_fixup_bus
|
||||
# define platform_kernel_launch_event ia64_mv.kernel_launch_event
|
||||
# endif
|
||||
|
||||
/* __attribute__((__aligned__(16))) is required to make size of the
|
||||
* structure multiple of 16 bytes.
|
||||
* This will fillup the holes created because of section 3.3.1 in
|
||||
* Software Conventions guide.
|
||||
*/
|
||||
struct ia64_machine_vector {
|
||||
const char *name;
|
||||
ia64_mv_setup_t *setup;
|
||||
ia64_mv_cpu_init_t *cpu_init;
|
||||
ia64_mv_irq_init_t *irq_init;
|
||||
ia64_mv_send_ipi_t *send_ipi;
|
||||
ia64_mv_timer_interrupt_t *timer_interrupt;
|
||||
ia64_mv_global_tlb_purge_t *global_tlb_purge;
|
||||
ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish;
|
||||
ia64_mv_dma_init *dma_init;
|
||||
ia64_mv_dma_get_required_mask *dma_get_required_mask;
|
||||
ia64_mv_dma_get_ops *dma_get_ops;
|
||||
ia64_mv_irq_to_vector *irq_to_vector;
|
||||
ia64_mv_local_vector_to_irq *local_vector_to_irq;
|
||||
ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem;
|
||||
ia64_mv_pci_legacy_read_t *pci_legacy_read;
|
||||
ia64_mv_pci_legacy_write_t *pci_legacy_write;
|
||||
ia64_mv_inb_t *inb;
|
||||
ia64_mv_inw_t *inw;
|
||||
ia64_mv_inl_t *inl;
|
||||
ia64_mv_outb_t *outb;
|
||||
ia64_mv_outw_t *outw;
|
||||
ia64_mv_outl_t *outl;
|
||||
ia64_mv_mmiowb_t *mmiowb;
|
||||
ia64_mv_readb_t *readb;
|
||||
ia64_mv_readw_t *readw;
|
||||
ia64_mv_readl_t *readl;
|
||||
ia64_mv_readq_t *readq;
|
||||
ia64_mv_readb_relaxed_t *readb_relaxed;
|
||||
ia64_mv_readw_relaxed_t *readw_relaxed;
|
||||
ia64_mv_readl_relaxed_t *readl_relaxed;
|
||||
ia64_mv_readq_relaxed_t *readq_relaxed;
|
||||
ia64_mv_migrate_t *migrate;
|
||||
ia64_mv_setup_msi_irq_t *setup_msi_irq;
|
||||
ia64_mv_teardown_msi_irq_t *teardown_msi_irq;
|
||||
ia64_mv_pci_fixup_bus_t *pci_fixup_bus;
|
||||
ia64_mv_kernel_launch_event_t *kernel_launch_event;
|
||||
} __attribute__((__aligned__(16))); /* align attrib? see above comment */
|
||||
|
||||
#define MACHVEC_INIT(name) \
|
||||
{ \
|
||||
#name, \
|
||||
platform_setup, \
|
||||
platform_cpu_init, \
|
||||
platform_irq_init, \
|
||||
platform_send_ipi, \
|
||||
platform_timer_interrupt, \
|
||||
platform_global_tlb_purge, \
|
||||
platform_tlb_migrate_finish, \
|
||||
platform_dma_init, \
|
||||
platform_dma_get_required_mask, \
|
||||
platform_dma_get_ops, \
|
||||
platform_irq_to_vector, \
|
||||
platform_local_vector_to_irq, \
|
||||
platform_pci_get_legacy_mem, \
|
||||
platform_pci_legacy_read, \
|
||||
platform_pci_legacy_write, \
|
||||
platform_inb, \
|
||||
platform_inw, \
|
||||
platform_inl, \
|
||||
platform_outb, \
|
||||
platform_outw, \
|
||||
platform_outl, \
|
||||
platform_mmiowb, \
|
||||
platform_readb, \
|
||||
platform_readw, \
|
||||
platform_readl, \
|
||||
platform_readq, \
|
||||
platform_readb_relaxed, \
|
||||
platform_readw_relaxed, \
|
||||
platform_readl_relaxed, \
|
||||
platform_readq_relaxed, \
|
||||
platform_migrate, \
|
||||
platform_setup_msi_irq, \
|
||||
platform_teardown_msi_irq, \
|
||||
platform_pci_fixup_bus, \
|
||||
platform_kernel_launch_event \
|
||||
}
|
||||
|
||||
extern struct ia64_machine_vector ia64_mv;
|
||||
extern void machvec_init (const char *name);
|
||||
extern void machvec_init_from_cmdline(const char *cmdline);
|
||||
|
||||
# else
|
||||
# error Unknown configuration. Update arch/ia64/include/asm/machvec.h.
|
||||
# endif /* CONFIG_IA64_GENERIC */
|
||||
|
||||
extern void swiotlb_dma_init(void);
|
||||
extern struct dma_map_ops *dma_get_ops(struct device *);
|
||||
|
||||
/*
|
||||
* Define default versions so we can extend machvec for new platforms without having
|
||||
* to update the machvec files for all existing platforms.
|
||||
*/
|
||||
#ifndef platform_setup
|
||||
# define platform_setup machvec_setup
|
||||
#endif
|
||||
#ifndef platform_cpu_init
|
||||
# define platform_cpu_init machvec_noop
|
||||
#endif
|
||||
#ifndef platform_irq_init
|
||||
# define platform_irq_init machvec_noop
|
||||
#endif
|
||||
|
||||
#ifndef platform_send_ipi
|
||||
# define platform_send_ipi ia64_send_ipi /* default to architected version */
|
||||
#endif
|
||||
#ifndef platform_timer_interrupt
|
||||
# define platform_timer_interrupt machvec_timer_interrupt
|
||||
#endif
|
||||
#ifndef platform_global_tlb_purge
|
||||
# define platform_global_tlb_purge ia64_global_tlb_purge /* default to architected version */
|
||||
#endif
|
||||
#ifndef platform_tlb_migrate_finish
|
||||
# define platform_tlb_migrate_finish machvec_noop_mm
|
||||
#endif
|
||||
#ifndef platform_kernel_launch_event
|
||||
# define platform_kernel_launch_event machvec_noop
|
||||
#endif
|
||||
#ifndef platform_dma_init
|
||||
# define platform_dma_init swiotlb_dma_init
|
||||
#endif
|
||||
#ifndef platform_dma_get_ops
|
||||
# define platform_dma_get_ops dma_get_ops
|
||||
#endif
|
||||
#ifndef platform_dma_get_required_mask
|
||||
# define platform_dma_get_required_mask ia64_dma_get_required_mask
|
||||
#endif
|
||||
#ifndef platform_irq_to_vector
|
||||
# define platform_irq_to_vector __ia64_irq_to_vector
|
||||
#endif
|
||||
#ifndef platform_local_vector_to_irq
|
||||
# define platform_local_vector_to_irq __ia64_local_vector_to_irq
|
||||
#endif
|
||||
#ifndef platform_pci_get_legacy_mem
|
||||
# define platform_pci_get_legacy_mem ia64_pci_get_legacy_mem
|
||||
#endif
|
||||
#ifndef platform_pci_legacy_read
|
||||
# define platform_pci_legacy_read ia64_pci_legacy_read
|
||||
extern int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size);
|
||||
#endif
|
||||
#ifndef platform_pci_legacy_write
|
||||
# define platform_pci_legacy_write ia64_pci_legacy_write
|
||||
extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size);
|
||||
#endif
|
||||
#ifndef platform_inb
|
||||
# define platform_inb __ia64_inb
|
||||
#endif
|
||||
#ifndef platform_inw
|
||||
# define platform_inw __ia64_inw
|
||||
#endif
|
||||
#ifndef platform_inl
|
||||
# define platform_inl __ia64_inl
|
||||
#endif
|
||||
#ifndef platform_outb
|
||||
# define platform_outb __ia64_outb
|
||||
#endif
|
||||
#ifndef platform_outw
|
||||
# define platform_outw __ia64_outw
|
||||
#endif
|
||||
#ifndef platform_outl
|
||||
# define platform_outl __ia64_outl
|
||||
#endif
|
||||
#ifndef platform_mmiowb
|
||||
# define platform_mmiowb __ia64_mmiowb
|
||||
#endif
|
||||
#ifndef platform_readb
|
||||
# define platform_readb __ia64_readb
|
||||
#endif
|
||||
#ifndef platform_readw
|
||||
# define platform_readw __ia64_readw
|
||||
#endif
|
||||
#ifndef platform_readl
|
||||
# define platform_readl __ia64_readl
|
||||
#endif
|
||||
#ifndef platform_readq
|
||||
# define platform_readq __ia64_readq
|
||||
#endif
|
||||
#ifndef platform_readb_relaxed
|
||||
# define platform_readb_relaxed __ia64_readb_relaxed
|
||||
#endif
|
||||
#ifndef platform_readw_relaxed
|
||||
# define platform_readw_relaxed __ia64_readw_relaxed
|
||||
#endif
|
||||
#ifndef platform_readl_relaxed
|
||||
# define platform_readl_relaxed __ia64_readl_relaxed
|
||||
#endif
|
||||
#ifndef platform_readq_relaxed
|
||||
# define platform_readq_relaxed __ia64_readq_relaxed
|
||||
#endif
|
||||
#ifndef platform_migrate
|
||||
# define platform_migrate machvec_noop_task
|
||||
#endif
|
||||
#ifndef platform_setup_msi_irq
|
||||
# define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL)
|
||||
#endif
|
||||
#ifndef platform_teardown_msi_irq
|
||||
# define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL)
|
||||
#endif
|
||||
#ifndef platform_pci_fixup_bus
|
||||
# define platform_pci_fixup_bus machvec_noop_bus
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_H */
|
16
arch/ia64/include/asm/machvec_dig.h
Normal file
16
arch/ia64/include/asm/machvec_dig.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef _ASM_IA64_MACHVEC_DIG_h
|
||||
#define _ASM_IA64_MACHVEC_DIG_h
|
||||
|
||||
extern ia64_mv_setup_t dig_setup;
|
||||
|
||||
/*
|
||||
* This stuff has dual use!
|
||||
*
|
||||
* For a generic kernel, the macros are used to initialize the
|
||||
* platform's machvec structure. When compiling a non-generic kernel,
|
||||
* the macros are used directly.
|
||||
*/
|
||||
#define ia64_platform_name "dig"
|
||||
#define platform_setup dig_setup
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_DIG_h */
|
18
arch/ia64/include/asm/machvec_dig_vtd.h
Normal file
18
arch/ia64/include/asm/machvec_dig_vtd.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef _ASM_IA64_MACHVEC_DIG_VTD_h
|
||||
#define _ASM_IA64_MACHVEC_DIG_VTD_h
|
||||
|
||||
extern ia64_mv_setup_t dig_setup;
|
||||
extern ia64_mv_dma_init pci_iommu_alloc;
|
||||
|
||||
/*
|
||||
* This stuff has dual use!
|
||||
*
|
||||
* For a generic kernel, the macros are used to initialize the
|
||||
* platform's machvec structure. When compiling a non-generic kernel,
|
||||
* the macros are used directly.
|
||||
*/
|
||||
#define ia64_platform_name "dig_vtd"
|
||||
#define platform_setup dig_setup
|
||||
#define platform_dma_init pci_iommu_alloc
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_DIG_VTD_h */
|
18
arch/ia64/include/asm/machvec_hpsim.h
Normal file
18
arch/ia64/include/asm/machvec_hpsim.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef _ASM_IA64_MACHVEC_HPSIM_h
|
||||
#define _ASM_IA64_MACHVEC_HPSIM_h
|
||||
|
||||
extern ia64_mv_setup_t hpsim_setup;
|
||||
extern ia64_mv_irq_init_t hpsim_irq_init;
|
||||
|
||||
/*
|
||||
* This stuff has dual use!
|
||||
*
|
||||
* For a generic kernel, the macros are used to initialize the
|
||||
* platform's machvec structure. When compiling a non-generic kernel,
|
||||
* the macros are used directly.
|
||||
*/
|
||||
#define ia64_platform_name "hpsim"
|
||||
#define platform_setup hpsim_setup
|
||||
#define platform_irq_init hpsim_irq_init
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_HPSIM_h */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue