Commit 064c7c35 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] PA-RISC update

 - __PAGE_OFFSET is 0x10000000 (Randolph Chung)
 - PA8800 support (Grant Grundler)
 - debuglocks (Thibaut Varene)
 - PDC chassis disabling (Thibaut Varene)
 - Distinguish between Dinos in request_irq (Thibaut Varene)
 - Document interrupt registers (Randolph Chung)
 - Revamp CONFIG_DISCONTIGMEM support (Randolph Chung)
 - Remove STI console warning and special casing (Randolph Chung)
 - n4000 defconfig (Randolph Chung)
 - iosapic fixes (Bjorn Helgaas)
 - Fix a bug in entry.S where pa_dbit_lock was being trashed (Randolph Chung)
 - SMP support (Randolph Chung, Grant Grundler, James Bottomley)
 - Clear the pte in the fault handler (Joel Soete)
 - Change _exit prototype (Carlos O'Donell)
 - Better unwinding support (Randolph Chung)
 - GCC 3.4 fixes (Carlos O'Donell, Randolph Chung)
parent 401f0fbd
......@@ -7,7 +7,7 @@ linux/parisc.
A lot of the assembly code currently runs in real mode, which means
absolute addresses are used instead of virtual addresses as in the
rest of the kernel. To translate an absolute address to a virtual
address you can lookup in System.map, add __PAGE_OFFSET (0xc0000000
address you can lookup in System.map, add __PAGE_OFFSET (0x10000000
currently).
......@@ -21,7 +21,7 @@ the I/O range); the System Responder address is the address real-mode
code tried to access.
Typical values for the System Responder address are addresses larger
than __PAGE_OFFSET (0xc0000000) which mean a virtual address didn't
than __PAGE_OFFSET (0x10000000) which mean a virtual address didn't
get translated to a physical address before real-mode code tried to
access it.
......
......@@ -4,8 +4,6 @@ Register Usage for Linux/PA-RISC
General Registers as specified by ABI
FPU Registers must not be used in kernel mode
Control Registers
CR 0 (Recovery Counter) used for ptrace
......@@ -13,11 +11,15 @@ CR 1-CR 7(undefined) unused
CR 8 (Protection ID) per-process value*
CR 9, 12, 13 (PIDS) unused
CR10 (CCR) lazy FPU saving*
CR11 as specified by ABI
CR11 as specified by ABI (SAR)
CR14 (interruption vector) initialized to fault_vector
CR15 (EIEM) initialized to all ones*
CR16 (Interval Timer) read for cycle count/write starts Interval Tmr
CR17-CR22 interruption parameters
CR19 Interrupt Instruction Register
CR20 Interrupt Space Register
CR21 Interrupt Offset Register
CR22 Interrupt PSW
CR23 (EIRR) read for pending interrupts/write clears bits
CR24 (TR 0) Kernel Space Page Directory Pointer
CR25 (TR 1) User Space Page Directory Pointer
......
......@@ -136,6 +136,20 @@ config SMP
If you don't know what to do here, say N.
config HOTPLUG_CPU
bool
default y if SMP
select HOTPLUG
config DISCONTIGMEM
bool "Discontiguous memory support (EXPERIMENTAL)"
depends on EXPERIMENTAL
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 PREEMPT
bool
# bool "Preemptible Kernel"
......@@ -204,6 +218,24 @@ config MAGIC_SYSRQ
keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does.
config DEBUG_SPINLOCK
bool "Spinlock debugging"
depends on DEBUG_KERNEL
help
Say Y here and build SMP to catch missing spinlock initialization
and certain other kinds of spinlock errors commonly made. This is
best used in conjunction with the NMI watchdog so that spinlock
deadlocks are also debuggable.
config DEBUG_RWLOCK
bool "Read-write spinlock debugging"
depends on DEBUG_KERNEL && SMP
help
If you say Y here then read-write lock processing will count how many
times it has tried to get the lock and issue an error message after
too many attempts. If you suspect a rwlock problem or a kernel
hacker asks for this option then say Y. Otherwise say N.
config FRAME_POINTER
bool "Compile the kernel with frame pointers"
help
......
......@@ -20,19 +20,23 @@ CONFIG_BROKEN_ON_SMP=y
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=16
CONFIG_HOTPLUG=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
#
......@@ -51,11 +55,12 @@ CONFIG_KMOD=y
# CONFIG_PA7000 is not set
# CONFIG_PA7100LC is not set
# CONFIG_PA7200 is not set
# CONFIG_PA7300LC is not set
CONFIG_PA8X00=y
CONFIG_PA20=y
CONFIG_PREFETCH=y
CONFIG_PARISC64=y
CONFIG_64BIT=y
# CONFIG_PDC_NARROW is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_COMPAT=y
......@@ -71,8 +76,8 @@ CONFIG_PCI_LBA=y
CONFIG_IOSAPIC=y
CONFIG_IOMMU_SBA=y
# CONFIG_SUPERIO is not set
CONFIG_CHASSIS_LCD_LED=y
# CONFIG_PDC_CHASSIS is not set
# CONFIG_CHASSIS_LCD_LED is not set
CONFIG_PDC_CHASSIS=y
#
# PCMCIA/CardBus support
......@@ -168,7 +173,7 @@ CONFIG_SCSI_REPORT_LUNS=y
# SCSI Transport Attributes
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
CONFIG_SCSI_FC_ATTRS=m
#
# SCSI low-level drivers
......@@ -197,6 +202,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
CONFIG_SCSI_SYM53C8XX_IOMAPPED=y
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_QLOGIC_ISP is not set
......@@ -219,6 +225,7 @@ CONFIG_SCSI_DEBUG=m
#
# CONFIG_PCMCIA_FDOMAIN is not set
# CONFIG_PCMCIA_QLOGIC is not set
# CONFIG_PCMCIA_SYM53C500 is not set
#
# Multi-device support (RAID and LVM)
......@@ -249,6 +256,7 @@ CONFIG_FUSION_CTL=m
#
# I2O device support
#
# CONFIG_I2O is not set
#
# Networking support
......@@ -284,8 +292,6 @@ CONFIG_INET_ESP=m
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
......@@ -345,6 +351,8 @@ CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set
CONFIG_IP_NF_TARGET_NOTRACK=m
CONFIG_IP_NF_RAW=m
CONFIG_XFRM=y
CONFIG_XFRM_USER=m
......@@ -353,7 +361,9 @@ CONFIG_XFRM_USER=m
#
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
CONFIG_LLC=m
CONFIG_LLC2=m
# CONFIG_IPX is not set
......@@ -374,18 +384,23 @@ CONFIG_LLC2=m
# Network testing
#
CONFIG_NET_PKTGEN=m
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
CONFIG_DUMMY=m
CONFIG_BONDING=m
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
# CONFIG_ETHERTAP is not set
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
#
# Ethernet (10 or 100Mbit)
#
......@@ -432,7 +447,6 @@ CONFIG_8139TOO=m
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_8139_RXBUF_IDX=1
# CONFIG_SIS900 is not set
CONFIG_EPIC100=m
# CONFIG_SUNDANCE is not set
......@@ -451,7 +465,6 @@ CONFIG_E1000_NAPI=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SIS190 is not set
# CONFIG_SK98LIN is not set
CONFIG_TIGON3=m
......@@ -460,17 +473,13 @@ CONFIG_TIGON3=m
#
CONFIG_IXGB=m
CONFIG_IXGB_NAPI=y
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
# CONFIG_PPPOE is not set
# CONFIG_SLIP is not set
CONFIG_S2IO=m
CONFIG_S2IO_NAPI=y
#
# Token Ring devices
#
# CONFIG_TR is not set
#
# Wireless LAN (non-hamradio)
......@@ -512,19 +521,6 @@ CONFIG_AIRO_CS=m
# CONFIG_PRISM54 is not set
CONFIG_NET_WIRELESS=y
#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# PCMCIA network device support
#
......@@ -539,21 +535,23 @@ CONFIG_PCMCIA_XIRC2PS=m
# CONFIG_PCMCIA_AXNET is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Bluetooth support
# Wan interfaces
#
# CONFIG_BT is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
# CONFIG_PPPOE is not set
# CONFIG_SLIP is not set
# CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
#
# ISDN subsystem
......@@ -750,6 +748,7 @@ CONFIG_VFAT_FS=m
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVPTS_FS_XATTR is not set
# CONFIG_TMPFS is not set
......@@ -798,7 +797,6 @@ CONFIG_SMB_NLS_REMOTE="cp437"
CONFIG_CIFS=m
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set
#
......@@ -891,11 +889,13 @@ CONFIG_CRYPTO_CAST6=m
# CONFIG_CRYPTO_ARC4 is not set
CONFIG_CRYPTO_DEFLATE=m
# CONFIG_CRYPTO_MICHAEL_MIC is not set
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_TEST=m
#
# Library routines
#
CONFIG_CRC32=y
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
......@@ -21,16 +21,20 @@ CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=15
# CONFIG_HOTPLUG is not set
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
#
......@@ -45,8 +49,9 @@ CONFIG_OBSOLETE_MODPARM=y
# Processor type and features
#
# CONFIG_PA7000 is not set
# CONFIG_PA7100LC is not set
CONFIG_PA7200=y
CONFIG_PA7100LC=y
# CONFIG_PA7200 is not set
# CONFIG_PA7300LC is not set
# CONFIG_PA8X00 is not set
CONFIG_PA11=y
# CONFIG_64BIT is not set
......@@ -70,7 +75,7 @@ CONFIG_PCI_LEGACY_PROC=y
CONFIG_PCI_NAMES=y
CONFIG_GSC_DINO=y
# CONFIG_PCI_LBA is not set
# CONFIG_CHASSIS_LCD_LED is not set
CONFIG_CHASSIS_LCD_LED=y
# CONFIG_PDC_CHASSIS is not set
#
......@@ -86,6 +91,7 @@ CONFIG_BINFMT_ELF=y
#
# Generic Driver Options
#
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_DEBUG_DRIVER=y
#
......@@ -121,7 +127,7 @@ CONFIG_PARPORT_GSC=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=y
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_CARMEL=y
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_RAM is not set
#
......@@ -149,7 +155,6 @@ CONFIG_CHR_DEV_SG=y
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_REPORT_LUNS is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
......@@ -163,6 +168,7 @@ CONFIG_SCSI_SPI_ATTRS=y
# SCSI low-level drivers
#
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_7000FASST is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AHA152X is not set
......@@ -171,11 +177,10 @@ CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
......@@ -197,6 +202,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_ZALON is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PSI240I is not set
......@@ -278,10 +284,10 @@ CONFIG_IP_PNP_BOOTP=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
......@@ -290,21 +296,27 @@ CONFIG_IP_PNP_BOOTP=y
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
# CONFIG_NET_CLS_ROUTE is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
#
# Ethernet (10 or 100Mbit)
......@@ -351,15 +363,12 @@ CONFIG_TULIP=y
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=y
# CONFIG_PPP_FILTER is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_PPP_DEFLATE is not set
# CONFIG_PPP_BSDCOMP is not set
# CONFIG_SLIP is not set
# CONFIG_S2IO is not set
#
# Token Ring devices
#
# CONFIG_TR is not set
#
# Wireless LAN (non-hamradio)
......@@ -384,33 +393,20 @@ CONFIG_NET_RADIO=y
#
CONFIG_NET_WIRELESS=y
#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_FDDI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=y
# CONFIG_PPP_FILTER is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_PPP_DEFLATE is not set
# CONFIG_PPP_BSDCOMP is not set
# CONFIG_SLIP is not set
# CONFIG_NET_FC is not set
#
# ISDN subsystem
......@@ -473,7 +469,6 @@ CONFIG_INPUT_MOUSE=y
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_UINPUT is not set
# CONFIG_HP_SDC_RTC is not set
......@@ -542,6 +537,11 @@ CONFIG_GEN_RTC=y
#
# CONFIG_I2C is not set
#
# Dallas's 1-wire bus
#
# CONFIG_W1 is not set
#
# Misc devices
#
......@@ -560,8 +560,10 @@ CONFIG_GEN_RTC=y
# Graphics support
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_STI=y
# CONFIG_FB_RIVA is not set
......@@ -587,7 +589,6 @@ CONFIG_DUMMY_CONSOLE_COLUMNS=160
CONFIG_DUMMY_CONSOLE_ROWS=64
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_PCI_CONSOLE=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
......@@ -645,7 +646,8 @@ CONFIG_JOLIET=y
#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set
#
......@@ -653,6 +655,7 @@ CONFIG_JOLIET=y
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
# CONFIG_HUGETLB_PAGE is not set
......@@ -662,6 +665,7 @@ CONFIG_RAMFS=y
# Miscellaneous filesystems
#
# CONFIG_HFSPLUS_FS is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
......@@ -676,6 +680,7 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_TCP=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
......@@ -720,6 +725,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
......@@ -741,6 +747,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_INFO is not set
......@@ -770,12 +777,16 @@ CONFIG_CRYPTO=y
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_TEST is not set
#
# Library routines
#
# CONFIG_CRC_CCITT is not set
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set
......@@ -20,19 +20,23 @@ CONFIG_BROKEN_ON_SMP=y
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=16
CONFIG_HOTPLUG=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
#
......@@ -51,8 +55,10 @@ CONFIG_KMOD=y
# CONFIG_PA7000 is not set
# CONFIG_PA7100LC is not set
# CONFIG_PA7200 is not set
# CONFIG_PA7300LC is not set
CONFIG_PA8X00=y
CONFIG_PA20=y
CONFIG_PREFETCH=y
# CONFIG_PARISC64 is not set
# CONFIG_64BIT is not set
# CONFIG_SMP is not set
......@@ -70,7 +76,7 @@ CONFIG_PCI_LBA=y
CONFIG_IOSAPIC=y
CONFIG_IOMMU_SBA=y
CONFIG_SUPERIO=y
# CONFIG_CHASSIS_LCD_LED is not set
CONFIG_CHASSIS_LCD_LED=y
# CONFIG_PDC_CHASSIS is not set
#
......@@ -185,6 +191,7 @@ CONFIG_BLK_DEV_SIIMAGE=m
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_IDE_ARM is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
# CONFIG_IDEDMA_AUTO is not set
......@@ -218,7 +225,7 @@ CONFIG_SCSI_REPORT_LUNS=y
# SCSI Transport Attributes
#
CONFIG_SCSI_SPI_ATTRS=y
# CONFIG_SCSI_FC_ATTRS is not set
CONFIG_SCSI_FC_ATTRS=m
#
# SCSI low-level drivers
......@@ -236,7 +243,9 @@ CONFIG_SCSI_SATA=y
# CONFIG_SCSI_SATA_SVW is not set
CONFIG_SCSI_ATA_PIIX=m
CONFIG_SCSI_SATA_PROMISE=m
# CONFIG_SCSI_SATA_SX4 is not set
CONFIG_SCSI_SATA_SIL=m
# CONFIG_SCSI_SATA_SIS is not set
CONFIG_SCSI_SATA_VIA=m
# CONFIG_SCSI_SATA_VITESSE is not set
# CONFIG_SCSI_BUSLOGIC is not set
......@@ -254,6 +263,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
# CONFIG_SCSI_IPR is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_QLOGIC_ISP is not set
......@@ -279,6 +289,7 @@ CONFIG_SCSI_DEBUG=m
# CONFIG_PCMCIA_FDOMAIN is not set
# CONFIG_PCMCIA_NINJA_SCSI is not set
CONFIG_PCMCIA_QLOGIC=m
# CONFIG_PCMCIA_SYM53C500 is not set
#
# Multi-device support (RAID and LVM)
......@@ -346,8 +357,6 @@ CONFIG_INET_ESP=m
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_DEBUG=y
......@@ -407,6 +416,7 @@ CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m
CONFIG_IP_NF_COMPAT_IPCHAINS=m
CONFIG_IP_NF_COMPAT_IPFWADM=m
# CONFIG_IP_NF_RAW is not set
CONFIG_XFRM=y
CONFIG_XFRM_USER=m
......@@ -415,7 +425,9 @@ CONFIG_XFRM_USER=m
#
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
CONFIG_LLC=m
CONFIG_LLC2=m
# CONFIG_IPX is not set
......@@ -436,18 +448,23 @@ CONFIG_LLC2=m
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
CONFIG_NETDEVICES=y
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
CONFIG_DUMMY=m
CONFIG_BONDING=m
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
# CONFIG_ETHERTAP is not set
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
#
# Ethernet (10 or 100Mbit)
#
......@@ -493,7 +510,6 @@ CONFIG_8139TOO=m
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_8139_RXBUF_IDX=1
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
......@@ -512,7 +528,6 @@ CONFIG_E1000=m
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SIS190 is not set
# CONFIG_SK98LIN is not set
CONFIG_TIGON3=m
......@@ -521,36 +536,17 @@ CONFIG_TIGON3=m
#
CONFIG_IXGB=y
CONFIG_IXGB_NAPI=y
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPPOE=m
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set
# CONFIG_S2IO is not set
#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
#
# Wan interfaces
# Wireless LAN (non-hamradio)
#
# CONFIG_WAN is not set
# CONFIG_NET_RADIO is not set
#
# PCMCIA network device support
......@@ -566,21 +562,23 @@ CONFIG_PCMCIA_XIRC2PS=m
CONFIG_PCMCIA_AXNET=m
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Bluetooth support
# Wan interfaces
#
# CONFIG_BT is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPPOE=m
# CONFIG_SLIP is not set
# CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set
#
# ISDN subsystem
......@@ -727,6 +725,7 @@ CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_ASILIANT is not set
# CONFIG_FB_IMSTT is not set
CONFIG_FB_STI=y
# CONFIG_FB_RIVA is not set
......@@ -833,6 +832,7 @@ CONFIG_USB_WACOM=m
CONFIG_USB_KBTAB=m
# CONFIG_USB_POWERMATE is not set
# CONFIG_USB_MTOUCH is not set
# CONFIG_USB_EGALAX is not set
# CONFIG_USB_XPAD is not set
# CONFIG_USB_ATI_REMOTE is not set
......@@ -881,6 +881,8 @@ CONFIG_USB_HPUSBSCSI=m
CONFIG_USB_LEGOTOWER=m
# CONFIG_USB_LCD is not set
# CONFIG_USB_LED is not set
# CONFIG_USB_CYTHERM is not set
# CONFIG_USB_PHIDGETSERVO is not set
# CONFIG_USB_TEST is not set
#
......@@ -931,6 +933,7 @@ CONFIG_VFAT_FS=m
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
......@@ -976,7 +979,6 @@ CONFIG_SUNRPC=y
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set
#
......@@ -1069,11 +1071,13 @@ CONFIG_CRYPTO_CAST6=m
# CONFIG_CRYPTO_ARC4 is not set
CONFIG_CRYPTO_DEFLATE=m
# CONFIG_CRYPTO_MICHAEL_MIC is not set
CONFIG_CRYPTO_CRC32C=m
CONFIG_CRYPTO_TEST=m
#
# Library routines
#
CONFIG_CRC32=y
CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
This diff is collapsed.
......@@ -888,6 +888,8 @@ CONFIG_OPROFILE=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_RWLOCK is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -69,7 +69,7 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
{
struct page *page = pte_page(pte);
if (VALID_PAGE(page) && page_mapping(page) &&
if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
test_bit(PG_dcache_dirty, &page->flags)) {
flush_kernel_dcache_page(page_address(page));
......@@ -82,10 +82,11 @@ show_cache_info(struct seq_file *m)
{
seq_printf(m, "I-cache\t\t: %ld KB\n",
cache_info.ic_size/1024 );
seq_printf(m, "D-cache\t\t: %ld KB (%s)%s\n",
seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n",
cache_info.dc_size/1024,
(cache_info.dc_conf.cc_wt ? "WT":"WB"),
(cache_info.dc_conf.cc_sh ? " - shared I/D":"")
(cache_info.dc_conf.cc_sh ? ", shared I/D":""),
(cache_info.dc_conf.cc_assoc)
);
seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
......@@ -123,46 +124,55 @@ parisc_cache_init(void)
panic("parisc_cache_init: pdc_cache_info failed");
#if 0
printk(KERN_DEBUG "ic_size %lx dc_size %lx it_size %lx pdc_cache_info %d*long pdc_cache_cf %d\n",
printk("ic_size %lx dc_size %lx it_size %lx\n",
cache_info.ic_size,
cache_info.dc_size,
cache_info.it_size,
sizeof (struct pdc_cache_info) / sizeof (long),
sizeof (struct pdc_cache_cf)
);
cache_info.it_size);
printk(KERN_DEBUG "dc base %x dc stride %x dc count %x dc loop %d\n",
printk("DC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
cache_info.dc_base,
cache_info.dc_stride,
cache_info.dc_count,
cache_info.dc_loop);
printk(KERN_DEBUG "dc conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n",
printk("dc_conf = 0x%lx alias %d blk %d line %d shift %d\n",
*(unsigned long *) (&cache_info.dc_conf),
cache_info.dc_conf.cc_alias,
cache_info.dc_conf.cc_block,
cache_info.dc_conf.cc_line,
cache_info.dc_conf.cc_shift);
printk(" wt %d sh %d cst %d assoc %d\n",
cache_info.dc_conf.cc_wt,
cache_info.dc_conf.cc_sh,
cache_info.dc_conf.cc_cst,
cache_info.dc_conf.cc_assoc);
printk(KERN_DEBUG "ic conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n",
printk("IC base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
cache_info.ic_base,
cache_info.ic_stride,
cache_info.ic_count,
cache_info.ic_loop);
printk("ic_conf = 0x%lx alias %d blk %d line %d shift %d\n",
*(unsigned long *) (&cache_info.ic_conf),
cache_info.ic_conf.cc_alias,
cache_info.ic_conf.cc_block,
cache_info.ic_conf.cc_line,
cache_info.ic_conf.cc_shift);
printk(" wt %d sh %d cst %d assoc %d\n",
cache_info.ic_conf.cc_wt,
cache_info.ic_conf.cc_sh,
cache_info.ic_conf.cc_cst,
cache_info.ic_conf.cc_assoc);
printk(KERN_DEBUG "dt conf: sh %d page %d cst %d aid %d pad1 %d \n",
printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
cache_info.dt_conf.tc_sh,
cache_info.dt_conf.tc_page,
cache_info.dt_conf.tc_cst,
cache_info.dt_conf.tc_aid,
cache_info.dt_conf.tc_pad1);
printk(KERN_DEBUG "it conf: sh %d page %d cst %d aid %d pad1 %d \n",
printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
cache_info.it_conf.tc_sh,
cache_info.it_conf.tc_page,
cache_info.it_conf.tc_cst,
......@@ -179,10 +189,14 @@ parisc_cache_init(void)
split_tlb = 1;
}
dcache_stride = (1 << (cache_info.dc_conf.cc_block + 3)) *
cache_info.dc_conf.cc_line;
icache_stride = (1 << (cache_info.ic_conf.cc_block + 3)) *
cache_info.ic_conf.cc_line;
/* "New and Improved" version from Jim Hull
* (1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift))
*/
#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift))
dcache_stride = CAFL_STRIDE(cache_info.dc_conf);
icache_stride = CAFL_STRIDE(cache_info.ic_conf);
#undef CAFL_STRIDE
#ifndef CONFIG_PA20
if (pdc_btlb_info(&btlb_info) < 0) {
memset(&btlb_info, 0, sizeof btlb_info);
......@@ -191,8 +205,8 @@ parisc_cache_init(void)
if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) ==
PDC_MODEL_NVA_UNSUPPORTED) {
printk(KERN_WARNING "Only equivalent aliasing supported\n");
#ifndef CONFIG_SMP
printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n");
#if 0
panic("SMP kernel required to avoid non-equivalent aliasing");
#endif
}
......@@ -228,7 +242,7 @@ void disable_sr_hashing(void)
disable_sr_hashing_asm(srhash_type);
}
void __flush_dcache_page(struct page *page)
void flush_dcache_page(struct page *page)
{
struct address_space *mapping = page_mapping(page);
struct vm_area_struct *mpnt = NULL;
......@@ -236,6 +250,14 @@ void __flush_dcache_page(struct page *page)
unsigned long offset;
unsigned long addr;
pgoff_t pgoff;
pte_t *pte;
unsigned long pfn = page_to_pfn(page);
if (mapping && !mapping_mapped(mapping)) {
set_bit(PG_dcache_dirty, &page->flags);
return;
}
flush_kernel_dcache_page(page_address(page));
......@@ -262,7 +284,14 @@ void __flush_dcache_page(struct page *page)
* isn't there, there's no point exciting the
* nadtlb handler into a nullification frenzy */
if (!translation_exists(mpnt, addr))
if(!(pte = translation_exists(mpnt, addr)))
continue;
/* make sure we really have this page: the private
* mappings may cover this area but have COW'd this
* particular page */
if(pte_pfn(*pte) != pfn)
continue;
__flush_cache_page(mpnt, addr);
......@@ -271,7 +300,7 @@ void __flush_dcache_page(struct page *page)
}
flush_dcache_mmap_unlock(mapping);
}
EXPORT_SYMBOL(__flush_dcache_page);
EXPORT_SYMBOL(flush_dcache_page);
/* Defined in arch/parisc/kernel/pacache.S */
EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
......
......@@ -455,8 +455,9 @@
/* Look up a PTE in a 2-Level scheme (faulting at each
* level if the entry isn't present
*
* NOTE: we use ldw even for LP64 because our pte
* and pmd are allocated <4GB */
* NOTE: we use ldw even for LP64, since the short pointers
* can address up to 1TB
*/
.macro L2_ptep pmd,pte,index,va,fault
#if PT_NLEVELS == 3
EXTR \va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
......@@ -466,8 +467,15 @@
DEP %r0,31,PAGE_SHIFT,\pmd /* clear offset */
copy %r0,\pte
ldw,s \index(\pmd),\pmd
bb,>=,n \pmd,_PxD_PRESENT_BIT,\fault
DEP %r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
copy \pmd,%r9
#ifdef __LP64__
shld %r9,PxD_VALUE_SHIFT,\pmd
#else
shlw %r9,PxD_VALUE_SHIFT,\pmd
#endif
EXTR \va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
bb,>=,n \pmd,_PAGE_PRESENT_BIT,\fault
DEP %r0,31,PAGE_SHIFT,\pmd /* clear offset */
shladd \index,BITS_PER_PTE_ENTRY,\pmd,\pmd
LDREG %r0(\pmd),\pte /* pmd is now pte */
......@@ -489,10 +497,14 @@
copy %r0,\pte
extrd,u,*= \va,31,32,%r0
ldw,s \index(\pgd),\pgd
extrd,u,*= \va,31,32,%r0
bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault
extrd,u,*= \va,31,32,%r0
shld \pgd,PxD_VALUE_SHIFT,\index
extrd,u,*= \va,31,32,%r0
copy \index,\pgd
extrd,u,*<> \va,31,32,%r0
ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd
extrd,u,*= \va,31,32,%r0
bb,>=,n \pgd,_PAGE_PRESENT_BIT,\fault
L2_ptep \pgd,\pte,\index,\va,\fault
.endm
......@@ -507,7 +519,7 @@
/* Set the dirty bit (and accessed bit). No need to be
* clever, this is only used from the dirty fault */
.macro update_dirty ptep,pte,tmp,tmp1
.macro update_dirty ptep,pte,tmp
ldi _PAGE_ACCESSED|_PAGE_DIRTY,\tmp
or \tmp,\pte,\pte
STREG \pte,0(\ptep)
......@@ -783,7 +795,7 @@ __kernel_thread:
ret_from_kernel_thread:
/* Call schedule_tail first though */
bl schedule_tail, %r2
BL schedule_tail, %r2
nop
LDREG TI_TASK-THREAD_SZ_ALGN(%r30), %r1
......@@ -1441,14 +1453,14 @@ nadtlb_emulate:
and %r9,%r16,%r17
cmpb,<>,n %r16,%r17,nadtlb_fault /* Not fdc,fic,pdc */
bb,>=,n %r9,26,nadtlb_nullify /* m bit not set, just nullify */
b,l get_register,%r25
BL get_register,%r25
extrw,u %r9,15,5,%r8 /* Get index register # */
CMPIB=,n -1,%r1,nadtlb_fault /* have to use slow path */
copy %r1,%r24
b,l get_register,%r25
BL get_register,%r25
extrw,u %r9,10,5,%r8 /* Get base register # */
CMPIB=,n -1,%r1,nadtlb_fault /* have to use slow path */
b,l set_register,%r25
BL set_register,%r25
add,l %r1,%r24,%r1 /* doesn't affect c/b bits */
nadtlb_nullify:
......@@ -1548,7 +1560,7 @@ dbit_spin_20w:
dbit_nolock_20w:
#endif
update_dirty ptp,pte,t0,t1
update_dirty ptp,pte,t1
make_insert_tlb spc,pte,prot
......@@ -1585,7 +1597,7 @@ dbit_spin_11:
dbit_nolock_11:
#endif
update_dirty ptp,pte,t0,t1
update_dirty ptp,pte,t1
make_insert_tlb_11 spc,pte,prot
......@@ -1626,11 +1638,11 @@ dbit_spin_20:
dbit_nolock_20:
#endif
update_dirty ptp,pte,t0,t1
update_dirty ptp,pte,t1
make_insert_tlb spc,pte,prot
f_extend pte,t0
f_extend pte,t1
idtlbt pte,prot
......
......@@ -65,6 +65,7 @@
#include <asm/page.h>
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/system.h>
#include <asm/processor.h> /* for boot_cpu_data */
......@@ -176,6 +177,8 @@ void __init set_firmware_width(void)
*/
void pdc_emergency_unlock(void)
{
/* Spinlock DEBUG code freaks out if we unconditionally unlock */
if (spin_is_locked(&pdc_lock))
spin_unlock(&pdc_lock);
}
......@@ -234,11 +237,11 @@ int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_inf
#ifdef __LP64__
int pdc_pat_chassis_send_log(unsigned long state, unsigned long data)
{
int retval = 0;
if (!is_pdc_pat())
return -1;
int retval = 0;
spin_lock_irq(&pdc_lock);
retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data));
spin_unlock_irq(&pdc_lock);
......@@ -1146,6 +1149,49 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
return retval;
}
/**
* pdc_pat_io_pci_cfg_read - Read PCI configuration space.
* @pci_addr: PCI configuration space address for which the read request is being made.
* @pci_size: Size of read in bytes. Valid values are 1, 2, and 4.
* @mem_addr: Pointer to return memory buffer.
*
*/
int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
{
int retval;
spin_lock_irq(&pdc_lock);
retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ,
__pa(pdc_result), pci_addr, pci_size);
switch(pci_size) {
case 1: *(u8 *) mem_addr = (u8) pdc_result[0];
case 2: *(u16 *)mem_addr = (u16) pdc_result[0];
case 4: *(u32 *)mem_addr = (u32) pdc_result[0];
}
spin_unlock_irq(&pdc_lock);
return retval;
}
/**
* pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges.
* @pci_addr: PCI configuration space address for which the write request is being made.
* @pci_size: Size of write in bytes. Valid values are 1, 2, and 4.
* @value: Pointer to 1, 2, or 4 byte value in low order end of argument to be
* written to PCI Config space.
*
*/
int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val)
{
int retval;
spin_lock_irq(&pdc_lock);
retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE,
pci_addr, pci_size, val);
spin_unlock_irq(&pdc_lock);
return retval;
}
#endif /* __LP64__ */
......@@ -1230,29 +1276,29 @@ struct wide_stack {
long real64_call(unsigned long fn, ...)
{
va_list args;
extern struct wide_stack real_stack;
extern struct wide_stack real64_stack __attribute__ ((alias ("real_stack")));
extern unsigned long real64_call_asm(unsigned long *,
unsigned long *,
unsigned long);
va_start(args, fn);
real_stack.arg0 = va_arg(args, unsigned long);
real_stack.arg1 = va_arg(args, unsigned long);
real_stack.arg2 = va_arg(args, unsigned long);
real_stack.arg3 = va_arg(args, unsigned long);
real_stack.arg4 = va_arg(args, unsigned long);
real_stack.arg5 = va_arg(args, unsigned long);
real_stack.arg6 = va_arg(args, unsigned long);
real_stack.arg7 = va_arg(args, unsigned long);
real_stack.arg8 = va_arg(args, unsigned long);
real_stack.arg9 = va_arg(args, unsigned long);
real_stack.arg10 = va_arg(args, unsigned long);
real_stack.arg11 = va_arg(args, unsigned long);
real_stack.arg12 = va_arg(args, unsigned long);
real_stack.arg13 = va_arg(args, unsigned long);
real64_stack.arg0 = va_arg(args, unsigned long);
real64_stack.arg1 = va_arg(args, unsigned long);
real64_stack.arg2 = va_arg(args, unsigned long);
real64_stack.arg3 = va_arg(args, unsigned long);
real64_stack.arg4 = va_arg(args, unsigned long);
real64_stack.arg5 = va_arg(args, unsigned long);
real64_stack.arg6 = va_arg(args, unsigned long);
real64_stack.arg7 = va_arg(args, unsigned long);
real64_stack.arg8 = va_arg(args, unsigned long);
real64_stack.arg9 = va_arg(args, unsigned long);
real64_stack.arg10 = va_arg(args, unsigned long);
real64_stack.arg11 = va_arg(args, unsigned long);
real64_stack.arg12 = va_arg(args, unsigned long);
real64_stack.arg13 = va_arg(args, unsigned long);
va_end(args);
return real64_call_asm(&real_stack.sp, &real_stack.arg0, fn);
return real64_call_asm(&real64_stack.sp, &real64_stack.arg0, fn);
}
#endif /* __LP64__ */
......
......@@ -263,6 +263,17 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{HPHW_NPROC,0x67E,0x4,0x81,"Hitachi Tiny 80"},
{HPHW_NPROC,0x67F,0x4,0x81,"Hitachi Tiny 64"},
{HPHW_NPROC,0x700,0x4,0x91,"NEC Aska Processor"},
{HPHW_NPROC,0x880,0x4,0x91,"Orca Mako"},
{HPHW_NPROC,0x881,0x4,0x91,"Everest Mako"},
{HPHW_NPROC,0x882,0x4,0x91,"Rainier/Medel Mako Slow"},
{HPHW_NPROC,0x883,0x4,0x91,"Rainier/Medel Mako Fast"},
{HPHW_NPROC,0x884,0x4,0x91,"Mt. Hamilton"},
{HPHW_NPROC,0x885,0x4,0x91,"Mt. Hamilton DC-"},
{HPHW_NPROC,0x886,0x4,0x91,"Storm Peak Slow DC-"},
{HPHW_NPROC,0x887,0x4,0x91,"Storm Peak Slow"},
{HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"},
{HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"},
{HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak"},
{HPHW_A_DIRECT, 0x004, 0x0000D, 0x00, "Arrakis MUX"},
{HPHW_A_DIRECT, 0x005, 0x0000D, 0x00, "Dyun Kiuh MUX"},
{HPHW_A_DIRECT, 0x006, 0x0000D, 0x00, "Baat Kiuh AP/MUX (40299B)"},
......@@ -535,14 +546,17 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{HPHW_BCPORT, 0x800, 0x0000C, 0x10, "DEW BC Merced Port"},
{HPHW_BCPORT, 0x801, 0x0000C, 0x10, "SMC Bus Interface Merced Bus0"},
{HPHW_BCPORT, 0x802, 0x0000C, 0x10, "SMC Bus INterface Merced Bus1"},
{HPHW_BCPORT, 0x803, 0x0000C, 0x10, "IKE I/O Bus Converter Merced Port"},
{HPHW_BCPORT, 0x781, 0x0000C, 0x00, "IKE I/O Bus Converter Ropes Port"},
{HPHW_BCPORT, 0x804, 0x0000C, 0x10, "REO I/O Bus Converter Merced Port"},
{HPHW_BCPORT, 0x782, 0x0000C, 0x00, "REO I/O Bus Converter Ropes Port"},
{HPHW_BCPORT, 0x803, 0x0000C, 0x10, "IKE I/O BC Merced Port"},
{HPHW_BCPORT, 0x781, 0x0000C, 0x00, "IKE I/O BC Ropes Port"},
{HPHW_BCPORT, 0x804, 0x0000C, 0x10, "REO I/O BC Merced Port"},
{HPHW_BCPORT, 0x782, 0x0000C, 0x00, "REO I/O BC Ropes Port"},
{HPHW_BCPORT, 0x784, 0x0000C, 0x00, "Pluto I/O BC Ropes Port"},
{HPHW_BRIDGE, 0x680, 0x0000A, 0x00, "Dino PCI Bridge"},
{HPHW_BRIDGE, 0x682, 0x0000A, 0x00, "Cujo PCI Bridge"},
{HPHW_BRIDGE, 0x782, 0x0000A, 0x00, "Elroy PCI Bridge"},
{HPHW_BRIDGE, 0x583, 0x000A5, 0x00, "Saga PCI Bridge"},
{HPHW_BRIDGE, 0x783, 0x0000A, 0x00, "Mercury PCI Bridge"},
{HPHW_BRIDGE, 0x784, 0x0000A, 0x00, "Quicksilver AGP Bridge"},
{HPHW_B_DMA, 0x004, 0x00018, 0x00, "Parallel I/O"},
{HPHW_B_DMA, 0x004, 0x00019, 0x00, "Parallel RDB"},
{HPHW_B_DMA, 0x004, 0x00020, 0x80, "MID_BUS PSI"},
......@@ -1181,15 +1195,18 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{HPHW_IOA, 0x581, 0x0000B, 0x10, "Uturn-IOA BC Runway Port"},
{HPHW_IOA, 0x582, 0x0000B, 0x10, "Astro BC Runway Port"},
{HPHW_IOA, 0x700, 0x0000B, 0x00, "NEC-IOS BC System Bus Port"},
{HPHW_IOA, 0x880, 0x0000C, 0x10, "Pluto BC McKinley Port"},
{HPHW_MEMORY, 0x002, 0x00008, 0x00, "MID_BUS"},
{HPHW_MEMORY, 0x063, 0x00009, 0x00, "712/132 L2 Upgrade"},
{HPHW_MEMORY, 0x064, 0x00009, 0x00, "712/160 L2 Upgrade"},
{HPHW_MEMORY, 0x065, 0x00009, 0x00, "715/132 L2 Upgrade"},
{HPHW_MEMORY, 0x066, 0x00009, 0x00, "715/160 L2 Upgrade"},
{HPHW_MEMORY, 0x0AF, 0x00009, 0x00, "Everest Mako Memory"},
{HPHW_OTHER, 0x004, 0x00030, 0x00, "Master"},
{HPHW_OTHER, 0x004, 0x00034, 0x00, "Slave"},
{HPHW_OTHER, 0x004, 0x00038, 0x00, "EDU"},
{HPHW_OTHER, 0x004, 0x00049, 0x00, "LGB Control"},
{HPHW_MC, 0x004, 0x000C0, 0x00, "BMC IPMI Mgmt Ctlr"},
{HPHW_FAULTY, 0, } /* Special Marker for last entry */
};
......@@ -1290,7 +1307,7 @@ char *cpu_name_version[][2] = {
[pcxw] { "PA8500 (PCX-W)", "2.0" },
[pcxw_] { "PA8600 (PCX-W+)", "2.0" },
[pcxw2] { "PA8700 (PCX-W2)", "2.0" },
[mako] { "PA8800 (MAKO)", "2.0" }
[mako] { "PA8800 (Mako)", "2.0" }
};
const char * __init
......
......@@ -76,7 +76,8 @@ $bss_loop:
/* Initialize startup VM. Just map first 8 MB of memory */
ldil L%PA(pg0),%r1
ldo R%PA(pg0)(%r1),%r1
ldo _PAGE_TABLE(%r1),%r3
shr %r1,PxD_VALUE_SHIFT,%r3
ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
ldil L%PA(swapper_pg_dir),%r4
ldo R%PA(swapper_pg_dir)(%r4),%r4
......@@ -86,7 +87,7 @@ $bss_loop:
ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
1:
stw %r3,0(%r4)
ldo ASM_PAGE_SIZE(%r3),%r3
ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
addib,> -1,%r1,1b
ldo ASM_PGD_ENTRY_SIZE(%r4),%r4
......@@ -266,6 +267,8 @@ smp_slave_stext:
ldil L%PA(smp_init_current_idle_task),%sp
ldo R%PA(smp_init_current_idle_task)(%sp),%sp
ldw 0(%sp),%sp /* load task address */
tophys_r1 %sp
ldw TASK_THREAD_INFO(%sp), %sp
mtctl %sp,%cr30 /* store in cr30 */
addil L%THREAD_SZ_ALGN,%sp /* stack is above task */
ldo R%THREAD_SZ_ALGN(%r1),%sp
......
......@@ -80,7 +80,8 @@ $bss_loop:
ldil L%PA(pmd0),%r5
ldo R%PA(pmd0)(%r5),%r5
ldo _PAGE_TABLE(%r5),%r3
shrd %r5,PxD_VALUE_SHIFT,%r3
ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
ldil L%PA(swapper_pg_dir),%r4
ldo R%PA(swapper_pg_dir)(%r4),%r4
......@@ -90,12 +91,13 @@ $bss_loop:
stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
ldo _PAGE_TABLE(%r1),%r3
shrd %r1,PxD_VALUE_SHIFT,%r3
ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r5
ldi ASM_PT_INITIAL,%r1
1:
stw %r3,0(%r5)
ldo ASM_PAGE_SIZE(%r3),%r3
ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
addib,> -1,%r1,1b
ldo ASM_PMD_ENTRY_SIZE(%r5),%r5
......@@ -299,6 +301,7 @@ smp_slave_stext:
/* Initialize the SP - monarch sets up smp_init_current_idle_task */
load32 PA(smp_init_current_idle_task),%sp
ldd 0(%sp),%sp /* load task address */
tophys_r1 %sp
ldd TASK_THREAD_INFO(%sp), %sp
mtctl %sp,%cr30 /* store in cr30 */
ldo THREAD_SZ_ALGN(%sp),%sp
......
......@@ -25,7 +25,9 @@
#include <linux/mm.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/mmzone.h>
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/parisc-device.h>
......
......@@ -121,12 +121,6 @@ struct irqaction cpu_irq_actions[IRQ_PER_REGION] = {
#endif
};
struct irq_region_ops cpu_irq_ops = {
.disable_irq = disable_cpu_irq,
.enable_irq = enable_cpu_irq,
.mask_irq = unmask_cpu_irq,
.unmask_irq = unmask_cpu_irq
};
struct irq_region cpu0_irq_region = {
.ops = {
......@@ -200,8 +194,8 @@ void enable_irq(int irq)
{
struct irq_region *region;
DBG_IRQ(irq, ("enable_irq(%d) %d+%d eiem 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
DBG_IRQ(irq, ("enable_irq(%d) %d+%d EIRR 0x%lx EIEM 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), mfctl(23), mfctl(15)));
irq = irq_canonicalize(irq);
region = irq_region[IRQ_REGION(irq)];
......@@ -221,6 +215,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_puts(p, " ");
#ifdef CONFIG_SMP
for (i = 0; i < NR_CPUS; i++)
if (cpu_online(i))
#endif
seq_printf(p, " CPU%02d ", i);
......@@ -250,6 +245,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%3d: ", irq_no);
#ifdef CONFIG_SMP
for (; j < NR_CPUS; j++)
if (cpu_online(j))
#endif
seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq_no]);
......@@ -338,7 +334,8 @@ txn_alloc_addr(int virt_irq)
next_cpu++; /* assign to "next" CPU we want this bugger on */
/* validate entry */
while ((next_cpu < NR_CPUS) && !cpu_data[next_cpu].txn_addr)
while ((next_cpu < NR_CPUS) && (!cpu_data[next_cpu].txn_addr ||
!cpu_online(next_cpu)))
next_cpu++;
if (next_cpu >= NR_CPUS)
......@@ -390,7 +387,7 @@ void do_irq(struct irqaction *action, int irq, struct pt_regs * regs)
irq_enter();
++kstat_cpu(cpu).irqs[irq];
DBG_IRQ(irq, ("do_irq(%d) %d+%d\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq)));
DBG_IRQ(irq, ("do_irq(%d) %d+%d eiem 0x%lx\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
for (; action; action = action->next) {
#ifdef PARISC_IRQ_CR16_COUNTS
......@@ -460,7 +457,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
#ifdef DEBUG_IRQ
if (eirr_val != (1UL << MAX_CPU_IRQ))
printk(KERN_DEBUG "do_cpu_irq_mask %x\n", eirr_val);
printk(KERN_DEBUG "do_cpu_irq_mask 0x%x & 0x%x\n", eirr_val, cpu_eiem);
#endif
/* Work our way from MSb to LSb...same order we alloc EIRs */
......@@ -865,7 +862,7 @@ EXPORT_SYMBOL(probe_irq_mask);
void __init init_IRQ(void)
{
local_irq_disable(); /* PARANOID - should already be disabled */
mtctl(-1L, 23); /* EIRR : clear all pending external intr */
mtctl(~0UL, 23); /* EIRR : clear all pending external intr */
#ifdef CONFIG_SMP
if (!cpu_eiem)
cpu_eiem = EIEM_MASK(IPI_IRQ) | EIEM_MASK(TIMER_IRQ);
......
......@@ -173,3 +173,9 @@ EXPORT_SYMBOL(__moddi3);
extern void $$dyncall(void);
EXPORT_SYMBOL($$dyncall);
#endif
#ifdef CONFIG_DISCONTIGMEM
#include <asm/mmzone.h>
EXPORT_SYMBOL(node_data);
EXPORT_SYMBOL(pfnnid_map);
#endif
......@@ -32,6 +32,19 @@
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
#ifdef DEBUG_PCI
#undef ASSERT
#define ASSERT(expr) \
if(!(expr)) { \
printk("\n%s:%d: Assertion " #expr " failed!\n", \
__FILE__, __LINE__); \
panic(#expr); \
}
#else
#define ASSERT(expr)
#endif
static struct proc_dir_entry * proc_gsc_root = NULL;
static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
static unsigned long pcxl_used_bytes = 0;
......
......@@ -2,7 +2,7 @@
* interfaces to log Chassis Codes via PDC (firmware)
*
* Copyright (C) 2002 Laurent Canet <canetl@esiee.fr>
* Copyright (C) 2002-2003 Thibaut Varene <varenet@esiee.fr>
* Copyright (C) 2002-2004 Thibaut VARENE <varenet@esiee.fr>
*
* 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
......@@ -33,10 +33,28 @@
#include <asm/pdc_chassis.h>
#include <asm/processor.h>
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#ifdef CONFIG_PDC_CHASSIS
static int pdc_chassis_old = 0;
static unsigned int pdc_chassis_enabled = 1;
/**
* pdc_chassis_setup() - Enable/disable pdc_chassis code at boot time.
* @str configuration param: 0 to disable chassis log
* @return 1
*/
static int __init pdc_chassis_setup(char *str)
{
/*panic_timeout = simple_strtoul(str, NULL, 0);*/
get_option(&str, &pdc_chassis_enabled);
return 1;
}
__setup("pdcchassis=", pdc_chassis_setup);
/**
......@@ -114,17 +132,15 @@ void __init parisc_pdc_chassis_init(void)
{
#ifdef CONFIG_PDC_CHASSIS
int handle = 0;
if (pdc_chassis_enabled) {
DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__);
/* Let see if we have something to handle... */
/* Check for PDC_PAT or old LED Panel */
pdc_chassis_checkold();
if (is_pdc_pat()) {
#ifdef __LP64__ /* see pdc_chassis_send_status() */
printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n");
handle = 1;
#endif /* __LP64__ */
}
else if (pdc_chassis_old) {
printk(KERN_INFO "Enabling old style chassis LED panel support.\n");
......@@ -138,6 +154,7 @@ void __init parisc_pdc_chassis_init(void)
/* initialize reboot notifier chain */
register_reboot_notifier(&pdc_chassis_reboot_block);
}
}
#endif /* CONFIG_PDC_CHASSIS */
}
......@@ -161,9 +178,11 @@ int pdc_chassis_send_status(int message)
/* Maybe we should do that in an other way ? */
int retval = 0;
#ifdef CONFIG_PDC_CHASSIS
if (pdc_chassis_enabled) {
DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message);
#ifdef __LP64__ /* pdc_pat_chassis_send_log is defined only when #ifdef __LP64__ */
#ifdef CONFIG_PARISC64
if (is_pdc_pat()) {
switch(message) {
case PDC_CHASSIS_DIRECT_BSTART:
......@@ -219,7 +238,8 @@ int pdc_chassis_send_status(int message)
retval = -1;
}
} else retval = -1;
#endif /* __LP64__ */
#endif /* CONFIG_PARISC64 */
} /* if (pdc_chassis_enabled) */
#endif /* CONFIG_PDC_CHASSIS */
return retval;
}
......@@ -380,18 +380,14 @@ get_wchan(struct task_struct *p)
/*
* These bracket the sleeping functions..
*/
# define first_sched ((unsigned long) scheduling_functions_start_here)
# define last_sched ((unsigned long) scheduling_functions_end_here)
unwind_frame_init_from_blocked_task(&info, p);
do {
if (unwind_once(&info) < 0)
return 0;
ip = info.ip;
if (ip < first_sched || ip >= last_sched)
if (!in_sched_functions(ip))
return ip;
} while (count++ < 16);
return 0;
# undef first_sched
# undef last_sched
}
......@@ -33,12 +33,14 @@
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/cpu.h>
#include <asm/cache.h>
#include <asm/hardware.h> /* for register_parisc_driver() stuff */
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/irq.h> /* for struct irq_region */
#include <asm/parisc-device.h>
......@@ -187,6 +189,17 @@ static int __init processor_probe(struct parisc_device *dev)
cpu_irq_actions[cpuid] = actions;
}
#endif
/*
* Bring this CPU up now! (ignore bootstrap cpuid == 0)
*/
#ifdef CONFIG_SMP
if (cpuid) {
cpu_set(cpuid, cpu_present_map);
cpu_up(cpuid);
}
#endif
return 0;
}
......
......@@ -12,8 +12,12 @@
.section .bss
.export real_stack
.export real32_stack
.export real64_stack
.align 64
real_stack:
real32_stack:
real64_stack:
.block 8192
#ifdef __LP64__
......
......@@ -51,6 +51,8 @@ char command_line[COMMAND_LINE_SIZE];
/* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
struct proc_dir_entry * proc_runway_root = NULL;
struct proc_dir_entry * proc_gsc_root = NULL;
struct proc_dir_entry * proc_mckinley_root = NULL;
void __init setup_cmdline(char **cmdline_p)
{
......@@ -206,12 +208,17 @@ static void __init parisc_proc_mkdir(void)
case pcxw:
case pcxw_:
case pcxw2:
case mako: /* XXX : this is really mckinley bus */
if (NULL == proc_runway_root)
{
proc_runway_root = proc_mkdir("bus/runway", 0);
}
break;
case mako:
if (NULL == proc_mckinley_root)
{
proc_mckinley_root = proc_mkdir("bus/mckinley", 0);
}
break;
default:
/* FIXME: this was added to prevent the compiler
* complaining about missing pcx, pcxs and pcxt
......
......@@ -54,18 +54,27 @@
#define kDEBUG 0
spinlock_t pa_dbit_lock = SPIN_LOCK_UNLOCKED;
spinlock_t smp_lock = SPIN_LOCK_UNLOCKED;
volatile struct task_struct *smp_init_current_idle_task;
static volatile int cpu_now_booting = 0; /* track which CPU is booting */
static int parisc_max_cpus = -1; /* Command line */
unsigned long cache_decay_ticks; /* declared by include/linux/sched.h */
static int parisc_max_cpus = 1;
/* online cpus are ones that we've managed to bring up completely
* possible cpus are all valid cpu
* present cpus are all detected cpu
*
* On startup we bring up the "possible" cpus. Since we discover
* CPUs later, we add them as hotplug, so the possible cpu mask is
* empty in the beginning.
*/
cpumask_t cpu_online_map = CPU_MASK_NONE; /* Bitmap of online CPUs */
cpumask_t cpu_possible_map = CPU_MASK_NONE; /* Bitmap of Present CPUs */
cpumask_t cpu_possible_map = CPU_MASK_ALL; /* Bitmap of Present CPUs */
EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(cpu_possible_map);
......@@ -289,7 +298,7 @@ send_IPI_allbutself(enum ipi_message_type op)
{
int i;
for (i = 0; i < parisc_max_cpus; i++) {
for (i = 0; i < NR_CPUS; i++) {
if (cpu_online(i) && i != smp_processor_id())
send_IPI_single(i, op);
}
......@@ -325,6 +334,9 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
unsigned long timeout;
static spinlock_t lock = SPIN_LOCK_UNLOCKED;
if (num_online_cpus() < 2)
return 0;
/* Can deadlock when called with interrupts disabled */
WARN_ON(irqs_disabled());
......@@ -377,35 +389,6 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
EXPORT_SYMBOL(smp_call_function);
/*
* Setup routine for controlling SMP activation
*
* Command-line option of "nosmp" or "maxcpus=0" will disable SMP
* activation entirely (the MPS table probe still happens, though).
*
* Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
* greater than 0, limits the maximum number of CPUs activated in
* SMP mode to <NUM>.
*/
static int __init nosmp(char *str)
{
parisc_max_cpus = 0;
return 1;
}
__setup("nosmp", nosmp);
static int __init maxcpus(char *str)
{
get_option(&str, &parisc_max_cpus);
return 1;
}
__setup("maxcpus=", maxcpus);
/*
* Flush all other CPU's tlb and then mine. Do this with on_each_cpu()
* as we want to ensure all TLB's flushed before proceeding.
......@@ -502,7 +485,6 @@ void __init smp_callin(void)
panic("smp_callin() AAAAaaaaahhhh....\n");
}
#if 0
/*
* Create the idle task for a new Slave CPU. DO NOT use kernel_thread()
* because that could end up calling schedule(). If it did, the new idle
......@@ -524,7 +506,7 @@ static struct task_struct *fork_by_hand(void)
/*
* Bring one cpu online.
*/
int __init smp_boot_one_cpu(int cpuid, int cpunum)
int __init smp_boot_one_cpu(int cpuid)
{
struct task_struct *idle;
long timeout;
......@@ -544,14 +526,14 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
panic("SMP: fork failed for CPU:%d", cpuid);
wake_up_forked_process(idle);
init_idle(idle, cpunum);
init_idle(idle, cpuid);
unhash_process(idle);
idle->thread_info->cpu = cpunum;
idle->thread_info->cpu = cpuid;
/* Let _start know what logical CPU we're booting
** (offset into init_tasks[],cpu_data[])
*/
cpu_now_booting = cpunum;
cpu_now_booting = cpuid;
/*
** boot strap code needs to know the task address since
......@@ -560,11 +542,18 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
smp_init_current_idle_task = idle ;
mb();
printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa);
/*
** This gets PDC to release the CPU from a very tight loop.
** See MEM_RENDEZ comments in head.S.
**
** From the PA-RISC 2.0 Firmware Architecture Reference Specification:
** "The MEM_RENDEZ vector specifies the location of OS_RENDEZ which
** is executed after receiving the rendezvous signal (an interrupt to
** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the
** contents of memory are valid."
*/
__raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpunum].hpa);
__raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpuid].hpa);
mb();
/*
......@@ -573,7 +562,7 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
* Once the "monarch CPU" sees the bit change, it can move on.
*/
for (timeout = 0; timeout < 10000; timeout++) {
if(cpu_online(cpunum)) {
if(cpu_online(cpuid)) {
/* Which implies Slave has started up */
cpu_now_booting = 0;
smp_init_current_idle_task = NULL;
......@@ -592,16 +581,14 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
alive:
/* Remember the Slave data */
#if (kDEBUG>=100)
printk(KERN_DEBUG "SMP: CPU:%d (num %d) came alive after %ld _us\n",
cpuid, cpunum, timeout * 100);
printk(KERN_DEBUG "SMP: CPU:%d came alive after %ld _us\n",
cpuid, timeout * 100);
#endif /* kDEBUG */
#ifdef ENTRY_SYS_CPUS
cpu_data[cpunum].state = STATE_RUNNING;
cpu_data[cpuid].state = STATE_RUNNING;
#endif
return 0;
}
#endif
void __devinit smp_prepare_boot_cpu(void)
{
......@@ -612,15 +599,10 @@ void __devinit smp_prepare_boot_cpu(void)
#endif
/* Setup BSP mappings */
printk(KERN_DEBUG "SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
init_task.thread_info->cpu = bootstrap_processor;
current->thread_info->cpu = bootstrap_processor;
printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
cpu_set(bootstrap_processor, cpu_online_map);
cpu_set(bootstrap_processor, cpu_possible_map);
/* Mark Boostrap processor as present */
current->active_mm = &init_mm;
cpu_set(bootstrap_processor, cpu_present_map);
cache_decay_ticks = HZ/100; /* FIXME very rough. */
}
......@@ -633,15 +615,12 @@ void __devinit smp_prepare_boot_cpu(void)
*/
void __init smp_prepare_cpus(unsigned int max_cpus)
{
cpus_clear(cpu_present_map);
cpu_set(0, cpu_present_map);
if (max_cpus != -1)
printk(KERN_INFO "SMP: Limited to %d CPUs\n", max_cpus);
printk(KERN_INFO "SMP: Monarch CPU activated (%lu.%02lu BogoMIPS)\n",
(cpu_data[0].loops_per_jiffy + 25) / 5000,
((cpu_data[0].loops_per_jiffy + 25) / 50) % 100);
return;
parisc_max_cpus = max_cpus;
if (!max_cpus)
printk(KERN_INFO "SMP mode deactivated.\n");
}
......@@ -653,6 +632,9 @@ void smp_cpus_done(unsigned int cpu_max)
int __devinit __cpu_up(unsigned int cpu)
{
if (cpu != 0 && cpu < parisc_max_cpus)
smp_boot_one_cpu(cpu);
return cpu_online(cpu) ? 0 : -ENOSYS;
}
......
......@@ -206,9 +206,10 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
asmlinkage long sys32_time(compat_time_t *tloc)
{
struct timeval tv;
compat_time_t now32;
do_gettimeofday(&tv);
compat_time_t now32 = tv.tv_sec;
now32 = tv.tv_sec;
if (tloc)
if (put_user(now32, tloc))
......@@ -344,7 +345,7 @@ filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
((char *) dirent) += reclen;
dirent = (struct linux32_dirent *)((char *)dirent + reclen);
buf->current_dir = dirent;
buf->count -= reclen;
return 0;
......
......@@ -38,12 +38,17 @@
#include <asm/smp.h>
#include <asm/pdc.h>
#include <asm/pdc_chassis.h>
#include <asm/unwind.h>
#include "../math-emu/math-emu.h" /* for handle_fpe() */
#define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */
/* dumped to the console via printk) */
#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
spinlock_t pa_dbit_lock = SPIN_LOCK_UNLOCKED;
#endif
int printbinary(char *buf, unsigned long x, int nbits)
{
unsigned long mask = 1UL << (nbits - 1);
......@@ -125,73 +130,37 @@ void show_regs(struct pt_regs *regs)
void dump_stack(void)
{
unsigned long stack;
show_trace(current, &stack);
show_stack(NULL, NULL);
}
EXPORT_SYMBOL(dump_stack);
#ifndef __LP64__
static int kstack_depth_to_print = 64 * 4;
#else
static int kstack_depth_to_print = 128 * 4;
#endif
void show_stack(struct task_struct *task, unsigned long *sp)
void show_stack(struct task_struct *task, unsigned long *s)
{
unsigned long *stack;
int i;
/*
* debugging aid: "show_stack(NULL);" prints the
* back trace for this cpu.
*/
if (task==NULL)
sp = (unsigned long*)&sp;
else if(sp == NULL)
sp = (unsigned long*)task->thread.regs.ksp;
stack = sp;
printk("\n" KERN_CRIT "Stack Dump:\n");
printk(KERN_CRIT " " RFMT ": ", (unsigned long) stack);
for (i=0; i < kstack_depth_to_print; i++) {
if (((long) stack & (THREAD_SIZE-1)) == 0)
break;
if (i && ((i & 0x03) == 0))
printk("\n" KERN_CRIT " " RFMT ": ",
(unsigned long) stack);
printk(RFMT " ", *stack--);
int i = 1;
struct unwind_frame_info info;
if (!task) {
unsigned long sp, ip, rp;
HERE:
asm volatile ("copy %%r30, %0" : "=r"(sp));
ip = (unsigned long)&&HERE;
rp = (unsigned long)__builtin_return_address(0);
unwind_frame_init(&info, current, sp, ip, rp);
} else {
unwind_frame_init_from_blocked_task(&info, task);
}
printk("\n" KERN_CRIT "\n");
show_trace(task, sp);
}
printk("Backtrace:\n");
while (i <= 16) {
if (unwind_once(&info) < 0 || info.ip == 0)
break;
void show_trace(struct task_struct *task, unsigned long *stack)
{
unsigned long *startstack;
unsigned long addr;
int i;
startstack = (unsigned long *)((unsigned long)stack & ~(THREAD_SIZE - 1));
i = 1;
stack = (long *)((long)(stack + 32) &~ (FRAME_SIZE-1)); /* Align */
printk("Kernel addresses on the stack:\n");
while (stack > startstack) {
stack -= 16; /* Stack frames are a multiple of 16 words */
addr = stack[16 - RP_OFFSET / sizeof(long)];
/*
* If the address is either in the text segment of the
* kernel, or in the region which contains vmalloc'ed
* memory, it *may* be the address of a calling
* routine; if so, print it so that someone tracing
* down the cause of the crash will be able to figure
* out the call path that was taken.
*/
if (__kernel_text_address(addr)) {
printk(" [<" RFMT ">] ", addr);
if (__kernel_text_address(info.ip)) {
printk(" [<" RFMT ">] ", info.ip);
#ifdef CONFIG_KALLSYMS
print_symbol("%s\n", addr);
print_symbol("%s\n", info.ip);
#else
if ((i & 0x03) == 0)
printk("\n");
......
......@@ -8,18 +8,6 @@
* understand what is happening here
*/
/*
* J. David Anglin writes:
*
* "You have to adjust the current sp to that at the begining of the function.
* There can be up to two stack additions to allocate the frame in the
* prologue. Similar things happen in the epilogue. In the presence of
* interrupts, you have to be concerned about where you are in the function
* and what stack adjustments have taken place."
*
* For now these cases are not handled, but they should be!
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
......@@ -36,8 +24,8 @@
#define dbg(x...)
#endif
extern const struct unwind_table_entry __start___unwind[];
extern const struct unwind_table_entry __stop___unwind[];
extern struct unwind_table_entry __start___unwind[];
extern struct unwind_table_entry __stop___unwind[];
static spinlock_t unwind_lock;
/*
......@@ -55,8 +43,6 @@ find_unwind_entry_in_table(const struct unwind_table *table, unsigned long addr)
const struct unwind_table_entry *e = 0;
unsigned long lo, hi, mid;
addr -= table->base_addr;
for (lo = 0, hi = table->length; lo < hi; )
{
mid = (lo + hi) / 2;
......@@ -97,10 +83,11 @@ find_unwind_entry(unsigned long addr)
static void
unwind_table_init(struct unwind_table *table, const char *name,
unsigned long base_addr, unsigned long gp,
const void *table_start, const void *table_end)
void *table_start, void *table_end)
{
const struct unwind_table_entry *start = table_start;
const struct unwind_table_entry *end = table_end - 1;
struct unwind_table_entry *start = table_start;
struct unwind_table_entry *end =
(struct unwind_table_entry *)table_end - 1;
table->name = name;
table->base_addr = base_addr;
......@@ -108,14 +95,19 @@ unwind_table_init(struct unwind_table *table, const char *name,
table->start = base_addr + start->region_start;
table->end = base_addr + end->region_end;
table->table = (struct unwind_table_entry *)table_start;
table->length = end - start;
table->length = end - start + 1;
table->next = NULL;
for (; start <= end; start++) {
start->region_start += base_addr;
start->region_end += base_addr;
}
}
void *
unwind_table_add(const char *name, unsigned long base_addr,
unsigned long gp,
const void *start, const void *end)
void *start, void *end)
{
struct unwind_table *table;
unsigned long flags;
......@@ -206,6 +198,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
sp = info->prev_sp;
} while (info->prev_ip < (unsigned long)_stext ||
info->prev_ip > (unsigned long)_etext);
dbg("analyzing func @ %lx with no unwind info, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
} else {
dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, Save_RP = %d size = %u\n",
......@@ -225,42 +219,57 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
/* ldo X(sp), sp, or stwm X,D(sp) */
frame_size += (insn & 0x1 ? -1 << 13 : 0) |
((insn & 0x3fff) >> 1);
dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
} else if ((insn & 0xffe00008) == 0x7ec00008) {
/* std,ma X,D(sp) */
frame_size += (insn & 0x1 ? -1 << 13 : 0) |
(((insn >> 4) & 0x3ff) << 3);
dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
} else if (insn == 0x6bc23fd9) {
/* stw rp,-20(sp) */
rpoffset = 20;
looking_for_rp = 0;
dbg("analyzing func @ %lx, insn=stw rp,-20(sp) @ %lx\n", info->ip, npc);
} else if (insn == 0x0fc212c1) {
/* std rp,-16(sr0,sp) */
rpoffset = 16;
looking_for_rp = 0;
dbg("analyzing func @ %lx, insn=std rp,-16(sp) @ %lx\n", info->ip, npc);
}
}
info->prev_sp = info->sp - frame_size;
if (rpoffset)
info->prev_ip = *(unsigned long *)(info->prev_sp - rpoffset);
info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
info->prev_ip = info->rp;
info->rp = 0;
dbg("analyzing func @ %lx, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
}
}
void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t,
struct pt_regs *regs)
unsigned long sp, unsigned long ip, unsigned long rp)
{
memset(info, 0, sizeof(struct unwind_frame_info));
info->t = t;
info->sp = regs->ksp;
info->ip = regs->kpc;
info->sp = sp;
info->ip = ip;
info->rp = rp;
dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", (int)t->pid, info->sp, info->ip);
dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", t ? (int)t->pid : 0, info->sp, info->ip);
}
void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t)
{
struct pt_regs *regs = &t->thread.regs;
unwind_frame_init(info, t, regs);
unwind_frame_init(info, t, regs->ksp, regs->kpc, 0);
}
void unwind_frame_init_running(struct unwind_frame_info *info, struct pt_regs *regs)
{
unwind_frame_init(info, current, regs->gr[30], regs->iaoq[0],
regs->gr[2]);
}
int unwind_once(struct unwind_frame_info *next_frame)
......
......@@ -3,3 +3,5 @@
#
lib-y := lusercopy.o bitops.o checksum.o io.o memset.o
lib-$(CONFIG_SMP) += debuglocks.o
......@@ -34,26 +34,26 @@ unsigned long __xchg64(unsigned long x, unsigned long *ptr)
unsigned long __xchg32(int x, int *ptr)
{
unsigned long flags;
unsigned long temp;
long temp;
atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
(long) temp = (long) *ptr; /* XXX - sign extension wanted? */
temp = (long) *ptr; /* XXX - sign extension wanted? */
*ptr = x;
atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return temp;
return (unsigned long)temp;
}
unsigned long __xchg8(char x, char *ptr)
{
unsigned long flags;
unsigned long temp;
long temp;
atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
(long) temp = (long) *ptr; /* XXX - sign extension wanted? */
temp = (long) *ptr; /* XXX - sign extension wanted? */
*ptr = x;
atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return temp;
return (unsigned long)temp;
}
......
/*
* Debugging versions of SMP locking primitives.
*
* Copyright (C) 2004 Thibaut VARENE <varenet@esiee.fr>
*
* Some code stollen from alpha & sparc64 ;)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/hardirq.h> /* in_interrupt() */
#undef INIT_STUCK
#define INIT_STUCK 1L << 30
#ifdef CONFIG_DEBUG_SPINLOCK
void _dbg_spin_lock(spinlock_t * lock, const char *base_file, int line_no)
{
volatile unsigned int *a;
long stuck = INIT_STUCK;
void *inline_pc = __builtin_return_address(0);
unsigned long started = jiffies;
int printed = 0;
int cpu = smp_processor_id();
try_again:
/* Do the actual locking */
/* <T-Bone> ggg: we can't get stuck on the outter loop?
* <ggg> T-Bone: We can hit the outer loop
* alot if multiple CPUs are constantly racing for a lock
* and the backplane is NOT fair about which CPU sees
* the update first. But it won't hang since every failed
* attempt will drop us back into the inner loop and
* decrement `stuck'.
* <ggg> K-class and some of the others are NOT fair in the HW
* implementation so we could see false positives.
* But fixing the lock contention is easier than
* fixing the HW to be fair.
* <tausq> __ldcw() returns 1 if we get the lock; otherwise we
* spin until the value of the lock changes, or we time out.
*/
a = __ldcw_align(lock);
while (stuck && (__ldcw(a) == 0))
while ((*a == 0) && --stuck);
if (unlikely(stuck <= 0)) {
printk(KERN_WARNING
"%s:%d: spin_lock(%s/%p) stuck in %s at %p(%d)"
" owned by %s:%d in %s at %p(%d)\n",
base_file, line_no, lock->module, lock,
current->comm, inline_pc, cpu,
lock->bfile, lock->bline, lock->task->comm,
lock->previous, lock->oncpu);
stuck = INIT_STUCK;
printed = 1;
goto try_again;
}
/* Exiting. Got the lock. */
lock->oncpu = cpu;
lock->previous = inline_pc;
lock->task = current;
lock->bfile = (char *)base_file;
lock->bline = line_no;
if (unlikely(printed)) {
printk(KERN_WARNING
"%s:%d: spin_lock grabbed in %s at %p(%d) %ld ticks\n",
base_file, line_no, current->comm, inline_pc,
cpu, jiffies - started);
}
}
void _dbg_spin_unlock(spinlock_t * lock, const char *base_file, int line_no)
{
CHECK_LOCK(lock);
volatile unsigned int *a = __ldcw_align(lock);
if (unlikely((*a != 0) && lock->babble)) {
lock->babble--;
printk(KERN_WARNING
"%s:%d: spin_unlock(%s:%p) not locked\n",
base_file, line_no, lock->module, lock);
}
*a = 1;
}
int _dbg_spin_trylock(spinlock_t * lock, const char *base_file, int line_no)
{
int ret;
volatile unsigned int *a = __ldcw_align(lock);
if ((ret = (__ldcw(a) != 0))) {
lock->oncpu = smp_processor_id();
lock->previous = __builtin_return_address(0);
lock->task = current;
} else {
lock->bfile = (char *)base_file;
lock->bline = line_no;
}
return ret;
}
#endif /* CONFIG_DEBUG_SPINLOCK */
#ifdef CONFIG_DEBUG_RWLOCK
/* Interrupts trouble detailed explanation, thx Grant:
*
* o writer (wants to modify data) attempts to acquire the rwlock
* o He gets the write lock.
* o Interupts are still enabled, we take an interrupt with the
* write still holding the lock.
* o interrupt handler tries to acquire the rwlock for read.
* o deadlock since the writer can't release it at this point.
*
* In general, any use of spinlocks that competes between "base"
* level and interrupt level code will risk deadlock. Interrupts
* need to be disabled in the base level routines to avoid it.
* Or more precisely, only the IRQ the base level routine
* is competing with for the lock. But it's more efficient/faster
* to just disable all interrupts on that CPU to guarantee
* once it gets the lock it can release it quickly too.
*/
void _dbg_write_lock(rwlock_t *rw, const char *bfile, int bline)
{
void *inline_pc = __builtin_return_address(0);
unsigned long started = jiffies;
long stuck = INIT_STUCK;
int printed = 0;
int cpu = smp_processor_id();
if(unlikely(in_interrupt())) { /* acquiring write lock in interrupt context, bad idea */
printk(KERN_WARNING "write_lock caller: %s:%d, IRQs enabled,\n", bfile, bline);
BUG();
}
/* Note: if interrupts are disabled (which is most likely), the printk
will never show on the console. We might need a polling method to flush
the dmesg buffer anyhow. */
retry:
_raw_spin_lock(&rw->lock);
if(rw->counter != 0) {
/* this basically never happens */
_raw_spin_unlock(&rw->lock);
stuck--;
if ((unlikely(stuck <= 0)) && (rw->counter < 0)) {
printk(KERN_WARNING
"%s:%d: write_lock stuck on writer"
" in %s at %p(%d) %ld ticks\n",
bfile, bline, current->comm, inline_pc,
cpu, jiffies - started);
stuck = INIT_STUCK;
printed = 1;
}
else if (unlikely(stuck <= 0)) {
printk(KERN_WARNING
"%s:%d: write_lock stuck on reader"
" in %s at %p(%d) %ld ticks\n",
bfile, bline, current->comm, inline_pc,
cpu, jiffies - started);
stuck = INIT_STUCK;
printed = 1;
}
while(rw->counter != 0);
goto retry;
}
/* got it. now leave without unlocking */
rw->counter = -1; /* remember we are locked */
if (unlikely(printed)) {
printk(KERN_WARNING
"%s:%d: write_lock grabbed in %s at %p(%d) %ld ticks\n",
bfile, bline, current->comm, inline_pc,
cpu, jiffies - started);
}
}
void _dbg_read_lock(rwlock_t * rw, const char *bfile, int bline)
{
#if 0
void *inline_pc = __builtin_return_address(0);
unsigned long started = jiffies;
int cpu = smp_processor_id();
#endif
unsigned long flags;
local_irq_save(flags);
_raw_spin_lock(&rw->lock);
rw->counter++;
#if 0
printk(KERN_WARNING
"%s:%d: read_lock grabbed in %s at %p(%d) %ld ticks\n",
bfile, bline, current->comm, inline_pc,
cpu, jiffies - started);
#endif
_raw_spin_unlock(&rw->lock);
local_irq_restore(flags);
}
#endif /* CONFIG_DEBUG_RWLOCK */
This diff is collapsed.
......@@ -5,6 +5,7 @@
* Copyright 1999 SuSE GmbH
* changed by Philipp Rumpf
* Copyright 1999 Philipp Rumpf (prumpf@tux.org)
* Copyright 2004 Randolph Chung (tausq@debian.org)
*
*/
......@@ -23,6 +24,7 @@
#include <asm/pgalloc.h>
#include <asm/tlb.h>
#include <asm/pdc_chassis.h>
#include <asm/mmzone.h>
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
......@@ -32,10 +34,9 @@ extern char _end; /* end of BSS, defined by linker */
extern char __init_begin, __init_end;
#ifdef CONFIG_DISCONTIGMEM
struct node_map_data node_data[MAX_PHYSMEM_RANGES];
bootmem_data_t bmem_data[MAX_PHYSMEM_RANGES];
unsigned char *chunkmap;
unsigned int maxchunkmap;
struct node_map_data node_data[MAX_NUMNODES];
bootmem_data_t bmem_data[MAX_NUMNODES];
unsigned char pfnnid_map[PFNNID_MAP_MAX];
#endif
static struct resource data_resource = {
......@@ -119,21 +120,6 @@ static void __init setup_bootmem(void)
disable_sr_hashing(); /* Turn off space register hashing */
#ifdef CONFIG_DISCONTIGMEM
/*
* The below is still true as of 2.4.2. If this is ever fixed,
* we can remove this warning!
*/
printk(KERN_WARNING "\n\n");
printk(KERN_WARNING "CONFIG_DISCONTIGMEM is enabled, which is probably a mistake. This\n");
printk(KERN_WARNING "option can lead to heavy swapping, even when there are gigabytes\n");
printk(KERN_WARNING "of free memory.\n\n");
#endif
#ifdef __LP64__
#ifndef CONFIG_DISCONTIGMEM
/*
* Sort the ranges. Since the number of ranges is typically
* small, and performance is not an issue here, just do
......@@ -160,11 +146,10 @@ static void __init setup_bootmem(void)
}
}
#ifndef CONFIG_DISCONTIGMEM
/*
* Throw out ranges that are too far apart (controlled by
* MAX_GAP). If CONFIG_DISCONTIGMEM wasn't implemented so
* poorly, we would recommend enabling that option, but,
* until it is fixed, this is the best way to go.
* MAX_GAP).
*/
for (i = 1; i < npmem_ranges; i++) {
......@@ -172,6 +157,11 @@ static void __init setup_bootmem(void)
(pmem_ranges[i-1].start_pfn +
pmem_ranges[i-1].pages) > MAX_GAP) {
npmem_ranges = i;
printk("Large gap in memory detected (%ld pages). "
"Consider turning on CONFIG_DISCONTIGMEM\n",
pmem_ranges[i].start_pfn -
(pmem_ranges[i-1].start_pfn +
pmem_ranges[i-1].pages));
break;
}
}
......@@ -194,8 +184,6 @@ static void __init setup_bootmem(void)
}
}
#endif /* __LP64__ */
sysram_resource_count = npmem_ranges;
for (i = 0; i < sysram_resource_count; i++) {
struct resource *res = &sysram_resources[i];
......@@ -218,6 +206,7 @@ static void __init setup_bootmem(void)
mem_limit_func(); /* check for "mem=" argument */
mem_max = 0;
num_physpages = 0;
for (i = 0; i < npmem_ranges; i++) {
unsigned long rsize;
......@@ -232,15 +221,16 @@ static void __init setup_bootmem(void)
npmem_ranges = i + 1;
mem_max = mem_limit;
}
num_physpages += pmem_ranges[i].pages;
break;
}
num_physpages += pmem_ranges[i].pages;
mem_max += rsize;
}
printk(KERN_INFO "Total Memory: %ld Mb\n",mem_max >> 20);
#ifndef CONFIG_DISCONTIGMEM
/* Merge the ranges, keeping track of the holes */
{
......@@ -272,9 +262,18 @@ static void __init setup_bootmem(void)
bootmap_start_pfn = PAGE_ALIGN(__pa((unsigned long) &_end)) >> PAGE_SHIFT;
#ifdef CONFIG_DISCONTIGMEM
for (i = 0; i < MAX_PHYSMEM_RANGES; i++) {
memset(NODE_DATA(i), 0, sizeof(pg_data_t));
NODE_DATA(i)->bdata = &bmem_data[i];
}
memset(pfnnid_map, 0xff, sizeof(pfnnid_map));
numnodes = npmem_ranges;
for (i = 0; i < npmem_ranges; i++)
node_data[i].pg_data.bdata = &bmem_data[i];
node_set_online(i);
#endif
/*
* Initialize and free the full range of memory in each range.
* Note that the only writing these routines do are to the bootmap,
......@@ -443,16 +442,20 @@ unsigned long pcxl_dma_start;
void __init mem_init(void)
{
int i;
high_memory = __va((max_pfn << PAGE_SHIFT));
max_mapnr = (virt_to_page(high_memory - 1) - mem_map) + 1;
num_physpages = 0;
mem_map = zone_table[0]->zone_mem_map;
#ifndef CONFIG_DISCONTIGMEM
max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
mem_map = zone_table[ZONE_DMA]->zone_mem_map;
totalram_pages += free_all_bootmem();
#else
{
int i;
for (i = 0; i < npmem_ranges; i++)
num_physpages += free_all_bootmem_node(NODE_DATA(i));
totalram_pages = num_physpages;
totalram_pages += free_all_bootmem_node(NODE_DATA(i));
}
#endif
printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10));
......@@ -486,6 +489,7 @@ void show_mem(void)
show_free_areas();
printk(KERN_INFO "Free swap: %6ldkB\n",
nr_swap_pages<<(PAGE_SHIFT-10));
#ifndef CONFIG_DISCONTIGMEM
i = max_mapnr;
while (i-- > 0) {
total++;
......@@ -493,15 +497,55 @@ void show_mem(void)
reserved++;
else if (PageSwapCache(mem_map+i))
cached++;
else if (!atomic_read(&mem_map[i].count))
else if (!page_count(&mem_map[i]))
free++;
else
shared += atomic_read(&mem_map[i].count) - 1;
shared += page_count(&mem_map[i]) - 1;
}
#else
for (i = 0; i < npmem_ranges; i++) {
int j;
for (j = node_start_pfn(i); j < node_end_pfn(i); j++) {
struct page *p;
p = node_mem_map(i) + j - node_start_pfn(i);
total++;
if (PageReserved(p))
reserved++;
else if (PageSwapCache(p))
cached++;
else if (!page_count(p))
free++;
else
shared += page_count(p) - 1;
}
}
#endif
printk(KERN_INFO "%d pages of RAM\n", total);
printk(KERN_INFO "%d reserved pages\n", reserved);
printk(KERN_INFO "%d pages shared\n", shared);
printk(KERN_INFO "%d pages swap cached\n", cached);
#ifdef CONFIG_DISCONTIGMEM
{
struct zonelist *zl;
int i, j, k;
for (i = 0; i < npmem_ranges; i++) {
for (j = 0; j < MAX_NR_ZONES; j++) {
zl = NODE_DATA(i)->node_zonelists + j;
printk("Zone list for zone %d on node %d: ", j, i);
for (k = 0; zl->zones[k] != NULL; k++)
printk("[%d/%s] ", zl->zones[k]->zone_pgdat->node_id, zl->zones[k]->name);
printk("\n");
}
}
}
#endif
}
......@@ -544,7 +588,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
#if PTRS_PER_PMD == 1
pmd = (pmd_t *)__pa(pg_dir);
#else
pmd = (pmd_t *) (PAGE_MASK & pgd_val(*pg_dir));
pmd = (pmd_t *)pgd_address(*pg_dir);
/*
* pmd is physical at this point
......@@ -555,7 +599,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
pmd = (pmd_t *) __pa(pmd);
}
pgd_val(*pg_dir) = _PAGE_TABLE | (unsigned long) pmd;
pgd_populate(NULL, pg_dir, __va(pmd));
#endif
pg_dir++;
......@@ -568,15 +612,14 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
* pg_table is physical at this point
*/
pg_table = (pte_t *) (PAGE_MASK & pmd_val(*pmd));
pg_table = (pte_t *)pmd_address(*pmd);
if (!pg_table) {
pg_table = (pte_t *)
alloc_bootmem_low_pages_node(NODE_DATA(0),PAGE_SIZE);
pg_table = (pte_t *) __pa(pg_table);
}
pmd_val(*pmd) = _PAGE_TABLE |
(unsigned long) pg_table;
pmd_populate_kernel(NULL, pmd, __va(pg_table));
/* now change pg_table to kernel virtual addresses */
......@@ -584,8 +627,6 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
for (tmp2 = start_pte; tmp2 < PTRS_PER_PTE; tmp2++,pg_table++) {
pte_t pte;
#if !defined(CONFIG_STI_CONSOLE)
#warning STI console should explicitly allocate executable pages but does not
/*
* Map the fault vector writable so we can
* write the HPMC checksum.
......@@ -595,7 +636,6 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
&& address != gw_addr)
pte = __mk_pte(address, PAGE_KERNEL_RO);
else
#endif
pte = __mk_pte(address, pgprot);
if (address >= end_paddr)
......@@ -758,61 +798,26 @@ void __init paging_init(void)
flush_tlb_all_local();
for (i = 0; i < npmem_ranges; i++) {
unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0, };
unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0 };
/* We have an IOMMU, so all memory can go into a single
ZONE_DMA zone. */
zones_size[ZONE_DMA] = pmem_ranges[i].pages;
free_area_init_node(i,NODE_DATA(i),NULL,zones_size,
(pmem_ranges[i].start_pfn << PAGE_SHIFT),0);
}
pmem_ranges[i].start_pfn, 0);
#ifdef CONFIG_DISCONTIGMEM
/*
* Initialize support for virt_to_page() macro.
*
* Note that MAX_ADDRESS is the largest virtual address that
* we can map. However, since we map all physical memory into
* the kernel address space, it also has an effect on the maximum
* physical address we can map (MAX_ADDRESS - PAGE_OFFSET).
*/
maxchunkmap = MAX_ADDRESS >> CHUNKSHIFT;
chunkmap = (unsigned char *)alloc_bootmem(maxchunkmap);
for (i = 0; i < maxchunkmap; i++)
chunkmap[i] = BADCHUNK;
for (i = 0; i < npmem_ranges; i++) {
ADJ_NODE_MEM_MAP(i) = NODE_MEM_MAP(i) - pmem_ranges[i].start_pfn;
{
unsigned long chunk_paddr;
unsigned long end_paddr;
int chunknum;
chunk_paddr = (pmem_ranges[i].start_pfn << PAGE_SHIFT);
end_paddr = chunk_paddr + (pmem_ranges[i].pages << PAGE_SHIFT);
chunk_paddr &= CHUNKMASK;
chunknum = (int)CHUNKNUM(chunk_paddr);
while (chunk_paddr < end_paddr) {
if (chunknum >= maxchunkmap)
goto badchunkmap1;
if (chunkmap[chunknum] != BADCHUNK)
goto badchunkmap2;
chunkmap[chunknum] = (unsigned char)i;
chunk_paddr += CHUNKSZ;
chunknum++;
}
int j;
for (j = (node_start_pfn(i) >> PFNNID_SHIFT);
j <= (node_end_pfn(i) >> PFNNID_SHIFT);
j++) {
pfnnid_map[j] = i;
}
}
return;
badchunkmap1:
panic("paging_init: Physical address exceeds maximum address space!\n");
badchunkmap2:
panic("paging_init: Collision in chunk map array. CHUNKSZ needs to be smaller\n");
#endif
}
}
#ifdef CONFIG_PA20
......
......@@ -932,13 +932,16 @@ dino_driver_callback(struct parisc_device *dev)
struct dino_device *dino_dev; // Dino specific control struct
const char *version = "unknown";
const int name_len = 32;
char hw_path[64];
char *name;
int is_cujo = 0;
struct pci_bus *bus;
name = kmalloc(name_len, GFP_KERNEL);
if(name)
snprintf(name, name_len, "Dino %s", dev->dev.bus_id);
if(name) {
print_pa_hwpath(dev, hw_path);
snprintf(name, name_len, "Dino [%s]", hw_path);
}
else
name = "Dino";
......
......@@ -49,7 +49,15 @@ iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents,
sg_dma_len(startsg) = 0;
dma_offset = (unsigned long) pide & ~IOVP_MASK;
n_mappings++;
#if defined(ZX1_SUPPORT)
/* Pluto IOMMU IO Virt Address is not zero based */
sg_dma_address(dma_sg) = pide | ioc->ibase;
#else
/* SBA, ccio, and dino are zero based.
* Trying to save a few CPU cycles for most users.
*/
sg_dma_address(dma_sg) = pide;
#endif
pdirp = &(ioc->pdir_base[pide >> IOVP_SHIFT]);
prefetchw(pdirp);
}
......
......@@ -169,10 +169,11 @@
#include <asm/byteorder.h> /* get in-line asm for swab */
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/page.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/io.h> /* gsc_read/write functions */
#include <asm/io.h> /* read/write functions */
#ifdef CONFIG_SUPERIO
#include <asm/superio.h>
#endif
......@@ -223,19 +224,7 @@ assert_failed (char *a, char *f, int l)
#endif
#define READ_U8(addr) gsc_readb(addr)
#define READ_U16(addr) le16_to_cpu(gsc_readw((u16 *) (addr)))
#define READ_U32(addr) le32_to_cpu(gsc_readl((u32 *) (addr)))
#define READ_REG16(addr) gsc_readw((u16 *) (addr))
#define READ_REG32(addr) gsc_readl((u32 *) (addr))
#define WRITE_U8(value, addr) gsc_writeb(value, addr)
#define WRITE_U16(value, addr) gsc_writew(cpu_to_le16(value), (u16 *) (addr))
#define WRITE_U32(value, addr) gsc_writel(cpu_to_le32(value), (u32 *) (addr))
#define WRITE_REG16(value, addr) gsc_writew(value, (u16 *) (addr))
#define WRITE_REG32(value, addr) gsc_writel(value, (u32 *) (addr))
#define IOSAPIC_REG_SELECT 0
#define IOSAPIC_REG_SELECT 0x00
#define IOSAPIC_REG_WINDOW 0x10
#define IOSAPIC_REG_EOI 0x40
......@@ -244,8 +233,19 @@ assert_failed (char *a, char *f, int l)
#define IOSAPIC_IRDT_ENTRY(idx) (0x10+(idx)*2)
#define IOSAPIC_IRDT_ENTRY_HI(idx) (0x11+(idx)*2)
static inline unsigned int iosapic_read(unsigned long iosapic, unsigned int reg)
{
writel(reg, iosapic + IOSAPIC_REG_SELECT);
return readl(iosapic + IOSAPIC_REG_WINDOW);
}
static inline void iosapic_write(unsigned long iosapic, unsigned int reg, u32 val)
{
writel(reg, iosapic + IOSAPIC_REG_SELECT);
writel(val, iosapic + IOSAPIC_REG_WINDOW);
}
/*
** FIXME: revisit which GFP flags we should really be using.
** GFP_KERNEL includes __GFP_WAIT flag and that may not
** be acceptable. Since this is boot time, we shouldn't have
** to wait ever and this code should (will?) never get called
......@@ -261,15 +261,12 @@ assert_failed (char *a, char *f, int l)
#define IOSAPIC_VERSION_MASK 0x000000ff
#define IOSAPIC_VERSION_SHIFT 0x0
#define IOSAPIC_VERSION(ver) \
(int) ((ver & IOSAPIC_VERSION_MASK) >> IOSAPIC_VERSION_SHIFT)
#define IOSAPIC_VERSION(ver) ((int) (ver & IOSAPIC_VERSION_MASK))
#define IOSAPIC_MAX_ENTRY_MASK 0x00ff0000
#define IOSAPIC_MAX_ENTRY_SHIFT 0x10
#define IOSAPIC_IRDT_MAX_ENTRY(ver) \
(int) ((ver&IOSAPIC_MAX_ENTRY_MASK) >> IOSAPIC_MAX_ENTRY_SHIFT)
(int) (((ver) & IOSAPIC_MAX_ENTRY_MASK) >> IOSAPIC_MAX_ENTRY_SHIFT)
/* bits in the "low" I/O Sapic IRdT entry */
#define IOSAPIC_IRDT_ENABLE 0x10000
......@@ -281,9 +278,6 @@ assert_failed (char *a, char *f, int l)
#define IOSAPIC_IRDT_ID_EID_SHIFT 0x10
#define IOSAPIC_EOI(eoi_addr, eoi_data) gsc_writel(eoi_data, eoi_addr)
static struct iosapic_info *iosapic_list;
static spinlock_t iosapic_lock;
static int iosapic_count;
......@@ -403,14 +397,14 @@ iosapic_load_irt(unsigned long cell_num, struct irt_entry **irt)
struct irt_entry *p = table;
int i;
printk(KERN_DEBUG MODULE_NAME " Interrupt Routing Table (cell %ld)\n", cell_num);
printk(KERN_DEBUG MODULE_NAME " start = 0x%p num_entries %ld entry_size %d\n",
printk(MODULE_NAME " Interrupt Routing Table (cell %ld)\n", cell_num);
printk(MODULE_NAME " start = 0x%p num_entries %ld entry_size %d\n",
table,
num_entries,
(int) sizeof(struct irt_entry));
for (i = 0 ; i < num_entries ; i++, p++) {
printk(KERN_DEBUG MODULE_NAME " %02x %02x %02x %02x %02x %02x %02x %02x %08x%08x\n",
printk(MODULE_NAME " %02x %02x %02x %02x %02x %02x %02x %02x %08x%08x\n",
p->entry_type, p->entry_length, p->interrupt_type,
p->polarity_trigger, p->src_bus_irq_devno, p->src_bus_id,
p->src_seg_id, p->dest_iosapic_intin,
......@@ -608,22 +602,26 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
static irqreturn_t
iosapic_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
struct vector_info *vi = (struct vector_info *)dev_id;
struct vector_info *vi = (struct vector_info *) dev_id;
extern void do_irq(struct irqaction *a, int i, struct pt_regs *p);
int irq_num = vi->iosapic->isi_region->data.irqbase + vi->irqline;
DBG("iosapic_interrupt(): irq %d line %d eoi %p\n",
irq, vi->irqline, vi->eoi_addr);
DBG("iosapic_interrupt(): irq %d line %d eoi 0x%p 0x%x\n",
irq, vi->irqline, vi->eoi_addr, vi->eoi_data);
/* Do NOT need to mask/unmask IRQ. processor is already masked. */
/* FIXME: Need to mask/unmask? processor IRQ is already masked... */
do_irq(&vi->iosapic->isi_region->action[vi->irqline], irq_num, regs);
/*
** PARISC only supports PCI devices below I/O SAPIC.
** PCI only supports level triggered in order to share IRQ lines.
** I/O SAPIC must always issue EOI.
** ergo I/O SAPIC must always issue EOI on parisc.
**
** i386/ia64 support ISA devices and have to deal with
** edge-triggered interrupts too.
*/
IOSAPIC_EOI(vi->eoi_addr, vi->eoi_data);
__raw_writel(vi->eoi_data, vi->eoi_addr);
return IRQ_HANDLED;
}
......@@ -715,8 +713,7 @@ iosapic_fixup_irq(void *isi_obj, struct pci_dev *pcidev)
ASSERT(tmp == 0);
vi->eoi_addr = (u32 *) (isi->isi_hpa + IOSAPIC_REG_EOI);
vi->eoi_data = cpu_to_le32(vi->irqline);
vi->eoi_data = cpu_to_le32(vi->txn_data);
ASSERT(NULL != isi->isi_region);
DBG_IRT("iosapic_fixup_irq() %d:%d %x %x line %d irq %d\n",
......@@ -733,13 +730,8 @@ iosapic_rd_irt_entry(struct vector_info *vi , u32 *dp0, u32 *dp1)
struct iosapic_info *isp = vi->iosapic;
u8 idx = vi->irqline;
/* point the window register to the lower word */
WRITE_U32(IOSAPIC_IRDT_ENTRY(idx), isp->isi_hpa+IOSAPIC_REG_SELECT);
*dp0 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
/* point the window register to the higher word */
WRITE_U32(IOSAPIC_IRDT_ENTRY_HI(idx), isp->isi_hpa+IOSAPIC_REG_SELECT);
*dp1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
*dp0 = iosapic_read(isp->isi_hpa, IOSAPIC_IRDT_ENTRY(idx));
*dp1 = iosapic_read(isp->isi_hpa, IOSAPIC_IRDT_ENTRY_HI(idx));
}
......@@ -750,24 +742,20 @@ iosapic_wr_irt_entry(struct vector_info *vi, u32 dp0, u32 dp1)
ASSERT(NULL != isp);
ASSERT(0 != isp->isi_hpa);
DBG_IRT("iosapic_wr_irt_entry(): irq %d hpa %p WINDOW %p 0x%x 0x%x\n",
DBG_IRT("iosapic_wr_irt_entry(): irq %d hpa %p 0x%x 0x%x\n",
vi->irqline,
isp->isi_hpa, isp->isi_hpa+IOSAPIC_REG_WINDOW,
isp->isi_hpa,
dp0, dp1);
/* point the window register to the lower word */
WRITE_U32(IOSAPIC_IRDT_ENTRY(vi->irqline), isp->isi_hpa+IOSAPIC_REG_SELECT);
WRITE_U32( dp0, isp->isi_hpa+IOSAPIC_REG_WINDOW);
iosapic_write(isp->isi_hpa, IOSAPIC_IRDT_ENTRY(vi->irqline), dp0);
/* Read the window register to flush the writes down to HW */
dp0 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
dp0 = readl(isp->isi_hpa+IOSAPIC_REG_WINDOW);
/* point the window register to the higher word */
WRITE_U32(IOSAPIC_IRDT_ENTRY_HI(vi->irqline), isp->isi_hpa+IOSAPIC_REG_SELECT);
WRITE_U32( dp1, isp->isi_hpa+IOSAPIC_REG_WINDOW);
iosapic_write(isp->isi_hpa, IOSAPIC_IRDT_ENTRY_HI(vi->irqline), dp1);
/* Read the window register to flush the writes down to HW */
dp1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
dp1 = readl(isp->isi_hpa+IOSAPIC_REG_WINDOW);
}
......@@ -882,12 +870,12 @@ iosapic_enable_irq(void *dev, int irq)
iosapic_set_irt_data(vi, &d0, &d1);
iosapic_wr_irt_entry(vi, d0, d1);
#ifdef DEBUG_IOSAPIC_IRT
{
u32 *t = (u32 *) ((ulong) vi->eoi_addr & ~0xffUL);
printk("iosapic_enable_irq(): regs %p", vi->eoi_addr);
while (t < vi->eoi_addr) printk(" %x", READ_U32(t++));
for ( ; t < vi->eoi_addr; t++)
printk(" %x", readl(t));
printk("\n");
}
......@@ -896,11 +884,7 @@ printk("iosapic_enable_irq(): sel ");
struct iosapic_info *isp = vi->iosapic;
for (d0=0x10; d0<0x1e; d0++) {
/* point the window register to the lower word */
WRITE_U32(d0, isp->isi_hpa+IOSAPIC_REG_SELECT);
/* read the word */
d1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
d1 = iosapic_read(isp->isi_hpa, d0);
printk(" %x", d1);
}
}
......@@ -908,13 +892,12 @@ printk("\n");
#endif
/*
** KLUGE: IRQ should not be asserted when Drivers enabling their IRQ.
** PCI supports level triggered in order to share IRQ lines.
**
** Issueing I/O SAPIC an EOI causes an interrupt iff IRQ line is
** asserted.
** Issueing I/O SAPIC an EOI causes an interrupt IFF IRQ line is
** asserted. IRQ generally should not be asserted when a driver
** enables their IRQ. It can lead to "interesting" race conditions
** in the driver initialization sequence.
*/
IOSAPIC_EOI(vi->eoi_addr, vi->eoi_data);
__raw_writel(vi->eoi_data, vi->eoi_addr);
}
......@@ -949,11 +932,7 @@ iosapic_rd_version(struct iosapic_info *isi)
ASSERT(isi);
ASSERT(isi->isi_hpa);
/* point window to the version register */
WRITE_U32(IOSAPIC_REG_VERSION, isi->isi_hpa+IOSAPIC_REG_SELECT);
/* now read the version register */
return (READ_U32(isi->isi_hpa+IOSAPIC_REG_WINDOW));
return iosapic_read(isi->isi_hpa, IOSAPIC_REG_VERSION);
}
......
......@@ -34,7 +34,6 @@
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/init.h> /* for __init and __devinit */
/* #define PCI_DEBUG enable ASSERT */
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/slab.h>
......@@ -43,6 +42,7 @@
#include <asm/byteorder.h>
#include <asm/irq.h> /* for struct irq_region support */
#include <asm/pdc.h>
#include <asm/pdcpat.h>
#include <asm/page.h>
#include <asm/segment.h>
#include <asm/system.h>
......@@ -89,6 +89,19 @@
#define DBG_PAT(x...)
#endif
#ifdef DEBUG_LBA
#undef ASSERT
#define ASSERT(expr) \
if(!(expr)) { \
printk("\n%s:%d: Assertion " #expr " failed!\n", \
__FILE__, __LINE__); \
panic(#expr); \
}
#else
#define ASSERT(expr)
#endif
/*
** Config accessor functions only pass in the 8-bit bus number and not
** the 8-bit "PCI Segment" number. Each LBA will be assigned a PCI bus
......@@ -159,6 +172,8 @@
#define LBA_HINT_CFG 0x0310
#define LBA_HINT_BASE 0x0380 /* 14 registers at every 8 bytes. */
#define LBA_BUS_MODE 0x0620
/* ERROR regs are needed for config cycle kluges */
#define LBA_ERROR_CONFIG 0x0680
#define LBA_SMART_MODE 0x20
......@@ -168,12 +183,31 @@
#define LBA_IOSAPIC_BASE 0x800 /* Offset of IRQ logic */
/* non-postable I/O port space, densely packed */
#ifdef __LP64__
#ifdef CONFIG_PARISC64
#define LBA_ASTRO_PORT_BASE (0xfffffffffee00000UL)
#else
#define LBA_ASTRO_PORT_BASE (0xfee00000UL)
#endif
#define ELROY_HVERS 0x782
#define MERCURY_HVERS 0x783
#define QUICKSILVER_HVERS 0x784
static inline int IS_ELROY(struct parisc_device *d)
{
return (d->id.hversion == ELROY_HVERS);
}
static inline int IS_MERCURY(struct parisc_device *d)
{
return (d->id.hversion == MERCURY_HVERS);
}
static inline int IS_QUICKSILVER(struct parisc_device *d)
{
return (d->id.hversion == QUICKSILVER_HVERS);
}
/*
** lba_device: Per instance Elroy data structure
......@@ -184,7 +218,7 @@ struct lba_device {
spinlock_t lba_lock;
void *iosapic_obj;
#ifdef __LP64__
#ifdef CONFIG_PARISC64
unsigned long iop_base; /* PA_VIEW - for IO port accessor funcs */
#endif
......@@ -288,11 +322,6 @@ lba_device_present( u8 bus, u8 dfn, struct lba_device *d)
{
u8 first_bus = d->hba.hba_bus->secondary;
u8 last_sub_bus = d->hba.hba_bus->subordinate;
#if 0
/* FIXME - see below in this function */
u8 dev = PCI_SLOT(dfn);
u8 func = PCI_FUNC(dfn);
#endif
ASSERT(bus >= first_bus);
ASSERT(bus <= last_sub_bus);
......@@ -306,19 +335,7 @@ lba_device_present( u8 bus, u8 dfn, struct lba_device *d)
return(FALSE);
}
#if 0
/*
** FIXME: Need to implement code to fill the devices bitmap based
** on contents of the local pci_bus tree "data base".
** pci_register_ops() walks the bus for us and builds the tree.
** For now, always do the config cycle.
*/
bus -= first_bus;
return (((d->devices[bus][dev]) >> func) & 0x1);
#else
return TRUE;
#endif
}
......@@ -503,6 +520,43 @@ lba_rd_cfg(struct lba_device *d, u32 tok, u8 reg, u32 size)
return(data);
}
#ifdef CONFIG_PARISC64
#define pat_cfg_addr(bus, devfn, addr) (((bus) << 16) | ((devfn) << 8) | (addr))
static int pat_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
{
int tok = pat_cfg_addr(bus->number, devfn, pos);
u32 tmp;
int ret = pdc_pat_io_pci_cfg_read(tok, size, &tmp);
DBG_CFG("%s(%d:%d.%d+0x%02x) -> 0x%x %d\n", __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), pos, tmp, ret);
switch (size) {
case 1: *data = (u8) tmp; return (tmp == (u8) ~0);
case 2: *data = (u16) tmp; return (tmp == (u16) ~0);
case 4: *data = (u32) tmp; return (tmp == (u32) ~0);
}
*data = ~0;
return (ret);
}
static int pat_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
{
int tok = pat_cfg_addr(bus->number, devfn, pos);
int ret = pdc_pat_io_pci_cfg_write(tok, size, data);
DBG_CFG("%s(%d:%d.%d+0x%02x, 0x%lx/%d)\n", __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), pos, data, size);
return (ret);
}
static struct pci_ops pat_cfg_ops = {
.read = pat_cfg_read,
.write = pat_cfg_write,
};
#else
/* keep the compiler from complaining about undeclared variables */
#define pat_cfg_ops lba_cfg_ops
#endif
static int lba_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
{
......@@ -610,6 +664,7 @@ static int lba_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int s
}
DBG_CFG("%s(%x+%2x) = 0x%x (c)\n", __FUNCTION__, tok, pos, data);
/* Basic Algorithm */
LBA_CFG_TR4_ADDR_SETUP(d, tok | pos);
switch(size) {
......@@ -639,7 +694,7 @@ lba_bios_init(void)
}
#ifdef __LP64__
#ifdef CONFIG_PARISC64
/*
** Determine if a device is already configured.
......@@ -677,6 +732,8 @@ lba_claim_dev_resources(struct pci_dev *dev)
}
}
}
#else
#define lba_claim_dev_resources(dev)
#endif
......@@ -734,7 +791,7 @@ lba_fixup_bus(struct pci_bus *bus)
lba_dump_res(&iomem_resource, 2);
}
#ifdef __LP64__
#ifdef CONFIG_PARISC64
if (ldev->hba.gmmio_space.flags) {
err = request_resource(&iomem_resource, &(ldev->hba.gmmio_space));
if (err < 0) {
......@@ -792,12 +849,10 @@ lba_fixup_bus(struct pci_bus *bus)
bus->bridge_ctl &= ~(status & PCI_STATUS_FAST_BACK);
#endif
#ifdef __LP64__
if (is_pdc_pat()) {
/* Claim resources for PDC's devices */
lba_claim_dev_resources(dev);
}
#endif
/*
** P2PB's have no IRQs. ignore them.
......@@ -925,7 +980,7 @@ static struct pci_port_ops lba_astro_port_ops = {
};
#ifdef __LP64__
#ifdef CONFIG_PARISC64
#define PIOP_TO_GMMIO(lba, addr) \
((lba)->iop_base + (((addr)&0xFFFC)<<10) + ((addr)&3))
......@@ -1093,7 +1148,11 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
}
}
}
#endif /* __LP64__ */
#else
/* keep compiler from complaining about missing declarations */
#define lba_pat_port_ops lba_astro_port_ops
#define lba_pat_resources(pa_dev, lba_dev)
#endif /* CONFIG_PARISC64 */
static void
......@@ -1103,7 +1162,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
unsigned long rsize;
int lba_num;
#ifdef __LP64__
#ifdef CONFIG_PARISC64
/*
** Sign extend all BAR values on "legacy" platforms.
** "Sprockets" PDC (Forte/Allegro) initializes everything
......@@ -1237,7 +1296,7 @@ lba_hw_init(struct lba_device *d)
printk("\n");
#endif /* DEBUG_LBA_PAT */
#ifdef __LP64__
#ifdef CONFIG_PARISC64
/*
* FIXME add support for PDC_PAT_IO "Get slot status" - OLAR support
* Only N-Class and up can really make use of Get slot status.
......@@ -1317,7 +1376,7 @@ lba_common_init(struct lba_device *lba_dev)
** have work to do.
*/
static int __init
lba_driver_callback(struct parisc_device *dev)
lba_driver_probe(struct parisc_device *dev)
{
struct lba_device *lba_dev;
struct pci_bus *lba_bus;
......@@ -1327,8 +1386,9 @@ lba_driver_callback(struct parisc_device *dev)
/* Read HW Rev First */
func_class = READ_REG32(dev->hpa + LBA_FCLASS);
func_class &= 0xf;
if (IS_ELROY(dev)) {
func_class &= 0xf;
switch (func_class) {
case 0: version = "TR1.0"; break;
case 1: version = "TR2.0"; break;
......@@ -1338,14 +1398,24 @@ lba_driver_callback(struct parisc_device *dev)
case 5: version = "TR4.0"; break;
default: version = "TR4+";
}
printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
MODULE_NAME, version, func_class & 0xf, dev->hpa);
/* Just in case we find some prototypes... */
} else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) {
func_class &= 0xff;
version = kmalloc(6, GFP_KERNEL);
sprintf(version,"TR%d.%d",(func_class >> 4),(func_class & 0xf));
/* We could use one printk for both and have it outside,
* but for the mask for func_class.
*/
printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
MODULE_NAME, version, func_class & 0xff, dev->hpa);
}
if (func_class < 2) {
printk(KERN_WARNING "Can't support LBA older than TR2.1 "
"- continuing under adversity.\n");
printk(KERN_WARNING "Can't support LBA older than TR2.1"
" - continuing under adversity.\n");
}
/*
......@@ -1388,16 +1458,12 @@ lba_driver_callback(struct parisc_device *dev)
/* ---------- Third : setup I/O Port and MMIO resources --------- */
#ifdef __LP64__
if (is_pdc_pat()) {
/* PDC PAT firmware uses PIOP region of GMMIO space. */
pci_port = &lba_pat_port_ops;
/* Go ask PDC PAT what resources this LBA has */
lba_pat_resources(dev, lba_dev);
} else
#endif
{
} else {
/* Sprockets PDC uses NPIOP region */
pci_port = &lba_astro_port_ops;
......@@ -1412,9 +1478,9 @@ lba_driver_callback(struct parisc_device *dev)
dev->dev.platform_data = lba_dev;
lba_bus = lba_dev->hba.hba_bus =
pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
&lba_cfg_ops, NULL);
is_pdc_pat() ? &pat_cfg_ops : &lba_cfg_ops,
NULL);
#ifdef __LP64__
if (is_pdc_pat()) {
/* assign resources to un-initialized devices */
DBG_PAT("LBA pci_bus_assign_resources()\n");
......@@ -1427,7 +1493,6 @@ lba_driver_callback(struct parisc_device *dev)
lba_dump_res(&lba_dev->hba.lmmio_space, 2);
#endif
}
#endif
/*
** Once PCI register ops has walked the bus, access to config
......@@ -1443,14 +1508,16 @@ lba_driver_callback(struct parisc_device *dev)
}
static struct parisc_device_id lba_tbl[] = {
{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, 0x782, 0xa },
{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, ELROY_HVERS, 0xa },
{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, MERCURY_HVERS, 0xa },
{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, QUICKSILVER_HVERS, 0xa },
{ 0, }
};
static struct parisc_driver lba_driver = {
.name = MODULE_NAME,
.id_table = lba_tbl,
.probe = lba_driver_callback,
.probe = lba_driver_probe,
};
/*
......
......@@ -157,13 +157,13 @@ static int led_proc_read(char *page, char **start, off_t off, int count,
static int led_proc_write(struct file *file, const char *buf,
unsigned long count, void *data)
{
char *cur, lbuf[count];
char *cur, lbuf[count + 1];
int d;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
memset(lbuf, 0, count);
memset(lbuf, 0, count + 1);
if (copy_from_user(lbuf, buf, count))
return -EFAULT;
......@@ -197,7 +197,7 @@ static int led_proc_write(struct file *file, const char *buf,
break;
case LED_HASLCD:
while (*cur && cur[strlen(cur)-1] == '\n')
if (*cur && cur[strlen(cur)-1] == '\n')
cur[strlen(cur)-1] = 0;
if (*cur == 0)
cur = lcd_text_default;
......
This diff is collapsed.
......@@ -419,7 +419,9 @@ superio_serial_init(void)
{
#ifdef CONFIG_SERIAL_8250
int retval;
#ifdef CONFIG_SERIAL_8250_CONSOLE
extern void serial8250_console_init(void); /* drivers/serial/8250.c */
#endif
if (!sio_dev.irq_region)
return; /* superio not present */
......@@ -438,7 +440,9 @@ superio_serial_init(void)
return;
}
#ifdef CONFIG_SERIAL_8250_CONSOLE
serial8250_console_init();
#endif
serial[1].iobase = sio_dev.sp2_base;
serial[1].irq = sio_dev.irq_region->data.irqbase + SP2_IRQ;
......
......@@ -24,6 +24,7 @@
#ifdef __LP64__
#define LDREG ldd
#define STREG std
#define LDREGX ldd,s
#define LDREGM ldd,mb
#define STREGM std,ma
#define RP_OFFSET 16
......@@ -31,12 +32,19 @@
#else
#define LDREG ldw
#define STREG stw
#define LDREGX ldwx,s
#define LDREGM ldwm
#define STREGM stwm
#define RP_OFFSET 20
#define FRAME_SIZE 64
#endif
#ifdef CONFIG_PA20
#define BL b,l
#else
#define BL bl
#endif
#ifdef __ASSEMBLY__
#ifdef __LP64__
......@@ -110,6 +118,16 @@
depd,z \r, 63-\sa, 64-\sa, \t
.endm
/* Shift Right - note the r and t can NOT be the same! */
.macro shr r, sa, t
extru \r, 31-\sa, 32-\sa, \t
.endm
/* pa20w version of shift right */
.macro shrd r, sa, t
extrd,u \r, 63-\sa, 64-\sa, \t
.endm
/* load 32-bit 'value' into 'reg' compensating for the ldil
* sign-extension when running in wide mode.
* WARNING!! neither 'value' nor 'reg' can be expressions
......
......@@ -30,7 +30,7 @@
#define smp_mb__before_clear_bit() smp_mb()
#define smp_mb__after_clear_bit() smp_mb()
static __inline__ void set_bit(int nr, void * address)
static __inline__ void set_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -43,7 +43,7 @@ static __inline__ void set_bit(int nr, void * address)
atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
}
static __inline__ void __set_bit(int nr, void * address)
static __inline__ void __set_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -53,7 +53,7 @@ static __inline__ void __set_bit(int nr, void * address)
*addr |= mask;
}
static __inline__ void clear_bit(int nr, void * address)
static __inline__ void clear_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -66,7 +66,7 @@ static __inline__ void clear_bit(int nr, void * address)
atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
}
static __inline__ void __clear_bit(unsigned long nr, volatile void * address)
static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -76,7 +76,7 @@ static __inline__ void __clear_bit(unsigned long nr, volatile void * address)
*addr &= ~mask;
}
static __inline__ void change_bit(int nr, void * address)
static __inline__ void change_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -89,7 +89,7 @@ static __inline__ void change_bit(int nr, void * address)
atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
}
static __inline__ void __change_bit(int nr, void * address)
static __inline__ void __change_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -99,7 +99,7 @@ static __inline__ void __change_bit(int nr, void * address)
*addr ^= mask;
}
static __inline__ int test_and_set_bit(int nr, void * address)
static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -116,7 +116,7 @@ static __inline__ int test_and_set_bit(int nr, void * address)
return oldbit;
}
static __inline__ int __test_and_set_bit(int nr, void * address)
static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -130,7 +130,7 @@ static __inline__ int __test_and_set_bit(int nr, void * address)
return oldbit;
}
static __inline__ int test_and_clear_bit(int nr, void * address)
static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -147,7 +147,7 @@ static __inline__ int test_and_clear_bit(int nr, void * address)
return oldbit;
}
static __inline__ int __test_and_clear_bit(int nr, void * address)
static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -161,7 +161,7 @@ static __inline__ int __test_and_clear_bit(int nr, void * address)
return oldbit;
}
static __inline__ int test_and_change_bit(int nr, void * address)
static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -178,7 +178,7 @@ static __inline__ int test_and_change_bit(int nr, void * address)
return oldbit;
}
static __inline__ int __test_and_change_bit(int nr, void * address)
static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
......@@ -192,10 +192,10 @@ static __inline__ int __test_and_change_bit(int nr, void * address)
return oldbit;
}
static __inline__ int test_bit(int nr, const void *address)
static __inline__ int test_bit(int nr, const volatile unsigned long *address)
{
unsigned long mask;
unsigned long *addr = (unsigned long *) address;
const unsigned long *addr = (const unsigned long *)address;
addr += (nr >> SHIFT_PER_LONG);
mask = 1L << CHOP_SHIFTCOUNT(nr);
......@@ -322,7 +322,7 @@ static __inline__ int fls(int x)
* unlikely to be set. It's guaranteed that at least one of the 140
* bits is cleared.
*/
static inline int sched_find_first_bit(unsigned long *b)
static inline int sched_find_first_bit(const unsigned long *b)
{
#ifndef __LP64__
if (unlikely(b[0]))
......@@ -354,9 +354,9 @@ static inline int sched_find_first_bit(unsigned long *b)
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
static __inline__ unsigned long find_next_zero_bit(void * addr, unsigned long size, unsigned long offset)
static __inline__ unsigned long find_next_zero_bit(const void * addr, unsigned long size, unsigned long offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> SHIFT_PER_LONG);
const unsigned long * p = ((unsigned long *) addr) + (offset >> SHIFT_PER_LONG);
unsigned long result = offset & ~(BITS_PER_LONG-1);
unsigned long tmp;
......@@ -389,9 +389,9 @@ static __inline__ unsigned long find_next_zero_bit(void * addr, unsigned long si
return result + ffz(tmp);
}
static __inline__ unsigned long find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset)
static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset)
{
unsigned long *p = addr + (offset >> 6);
const unsigned long *p = addr + (offset >> 6);
unsigned long result = offset & ~(BITS_PER_LONG-1);
unsigned long tmp;
......@@ -446,15 +446,15 @@ static __inline__ unsigned long find_next_bit(unsigned long *addr, unsigned long
* disabling interrupts.
*/
#ifdef __LP64__
#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 0x38, addr)
#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x38, addr)
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 0x38, addr)
#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, addr)
#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
#else
#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 0x18, addr)
#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x18, addr)
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 0x18, addr)
#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, addr)
#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
#define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
#endif
#endif /* __KERNEL__ */
......
This diff is collapsed.
......@@ -4,6 +4,7 @@
#include <linux/mm.h>
#include <linux/config.h>
#include <asm/cacheflush.h>
#include <asm/scatterlist.h>
/* See Documentation/DMA-mapping.txt */
struct hppa_dma_ops {
......
......@@ -97,6 +97,7 @@ struct bc_module {
#define HPHW_IOA 12
#define HPHW_BRIDGE 13
#define HPHW_FABRIC 14
#define HPHW_MC 15
#define HPHW_FAULTY 31
......
......@@ -24,11 +24,6 @@ extern unsigned long parisc_vmerge_max_size;
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
/*
* Change "struct page" to physical address.
*/
#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
/* Memory mapped IO */
extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
......
This diff is collapsed.
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#include <linux/config.h>
/* Max 8 Nodes */
#define NODES_SHIFT 3
#endif /* _ASM_MAX_NUMNODES_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -958,9 +958,9 @@ static inline int close(int fd)
return sys_close(fd);
}
static inline int _exit(int exitcode)
static inline void _exit(int exitcode)
{
return sys_exit(exitcode);
sys_exit(exitcode);
}
static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment