Commit 27e0f0fe authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/net-drivers-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents 5f99d385 d113a0e9
This diff is collapsed.
...@@ -50,7 +50,7 @@ embed_config(bd_t **bdp) ...@@ -50,7 +50,7 @@ embed_config(bd_t **bdp)
{ {
u_char *mp; u_char *mp;
u_char eebuf[128]; u_char eebuf[128];
int i; int i = 8;
bd_t *bd; bd_t *bd;
bd = *bdp; bd = *bdp;
...@@ -62,11 +62,21 @@ embed_config(bd_t **bdp) ...@@ -62,11 +62,21 @@ embed_config(bd_t **bdp)
/* All we are looking for is the Ethernet MAC address. The /* All we are looking for is the Ethernet MAC address. The
* first 8 bytes are 'MOTOROLA', so check for part of that. * first 8 bytes are 'MOTOROLA', so check for part of that.
* Next, the VPD describes a MAC 'packet' as being of type 08
* and size 06. So we look for that and the MAC must follow.
* If there are more than one, we still only care about the first.
* If it's there, assume we have a valid MAC address. If not, * If it's there, assume we have a valid MAC address. If not,
* grab our default one. * grab our default one.
*/ */
if ((*(uint *)eebuf) == 0x4d4f544f) if ((*(uint *)eebuf) == 0x4d4f544f) {
mp = &eebuf[0x4c]; while (i < 127 && !(eebuf[i] == 0x08 && eebuf[i + 1] == 0x06))
i += eebuf[i + 1] + 2; /* skip this packet */
if (i == 127) /* Couldn't find. */
mp = (u_char *)def_enet_addr;
else
mp = &eebuf[i + 2];
}
else else
mp = (u_char *)def_enet_addr; mp = (u_char *)def_enet_addr;
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# #
CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_ISA_DMA=y
...@@ -14,7 +15,8 @@ CONFIG_FORCE_MAX_ZONEORDER=13 ...@@ -14,7 +15,8 @@ CONFIG_FORCE_MAX_ZONEORDER=13
# Code maturity level options # Code maturity level options
# #
CONFIG_EXPERIMENTAL=y CONFIG_EXPERIMENTAL=y
# CONFIG_BROKEN is not set CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
# #
# General setup # General setup
...@@ -33,6 +35,7 @@ CONFIG_EPOLL=y ...@@ -33,6 +35,7 @@ CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_DEADLINE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
# #
# Loadable module support # Loadable module support
...@@ -51,21 +54,23 @@ CONFIG_OBSOLETE_MODPARM=y ...@@ -51,21 +54,23 @@ CONFIG_OBSOLETE_MODPARM=y
CONFIG_PPC_PSERIES=y CONFIG_PPC_PSERIES=y
CONFIG_PPC=y CONFIG_PPC=y
CONFIG_PPC64=y CONFIG_PPC64=y
CONFIG_ALTIVEC=y
# CONFIG_POWER4_ONLY is not set
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_IRQ_ALL_CPUS=y CONFIG_IRQ_ALL_CPUS=y
CONFIG_NR_CPUS=32 CONFIG_NR_CPUS=32
# CONFIG_HMT is not set # CONFIG_HMT is not set
# CONFIG_DISCONTIGMEM is not set # CONFIG_DISCONTIGMEM is not set
# CONFIG_RTAS_FLASH is not set
CONFIG_SCANLOG=y
CONFIG_PPC_RTAS=y CONFIG_PPC_RTAS=y
CONFIG_RTAS_FLASH=m
CONFIG_SCANLOG=m
CONFIG_LPARCFG=y
# #
# General setup # General setup
# #
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set # CONFIG_BINFMT_MISC is not set
CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_LEGACY_PROC=y
...@@ -74,6 +79,10 @@ CONFIG_PCI_NAMES=y ...@@ -74,6 +79,10 @@ CONFIG_PCI_NAMES=y
CONFIG_PROC_DEVICETREE=y CONFIG_PROC_DEVICETREE=y
# CONFIG_CMDLINE_BOOL is not set # CONFIG_CMDLINE_BOOL is not set
#
# Device Drivers
#
# #
# Generic Driver Options # Generic Driver Options
# #
...@@ -117,6 +126,7 @@ CONFIG_BLK_DEV_INITRD=y ...@@ -117,6 +126,7 @@ CONFIG_BLK_DEV_INITRD=y
# SCSI device support # SCSI device support
# #
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y
# #
# SCSI support type (disk, tape, CD-ROM) # SCSI support type (disk, tape, CD-ROM)
...@@ -145,9 +155,9 @@ CONFIG_SCSI_CONSTANTS=y ...@@ -145,9 +155,9 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_SATA is not set
# CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DMX3191D is not set
...@@ -155,18 +165,21 @@ CONFIG_SCSI_CONSTANTS=y ...@@ -155,18 +165,21 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_INIA100 is not set
CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_2=y
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_ISP is not set
# CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLOGIC_1280 is not set
CONFIG_SCSI_QLA2XXX_CONFIG=y
CONFIG_SCSI_QLA2XXX=y
CONFIG_SCSI_QLA21XX=y
CONFIG_SCSI_QLA22XX=y
CONFIG_SCSI_QLA23XX=y
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_NSP32 is not set
...@@ -181,6 +194,7 @@ CONFIG_MD_LINEAR=y ...@@ -181,6 +194,7 @@ CONFIG_MD_LINEAR=y
CONFIG_MD_RAID0=y CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y CONFIG_MD_RAID1=y
CONFIG_MD_RAID5=y CONFIG_MD_RAID5=y
# CONFIG_MD_RAID6 is not set
# CONFIG_MD_MULTIPATH is not set # CONFIG_MD_MULTIPATH is not set
CONFIG_BLK_DEV_DM=y CONFIG_BLK_DEV_DM=y
CONFIG_DM_IOCTL_V4=y CONFIG_DM_IOCTL_V4=y
...@@ -240,7 +254,9 @@ CONFIG_IPV6_SCTP__=y ...@@ -240,7 +254,9 @@ CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set # CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set # CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set # CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set # CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set # CONFIG_X25 is not set
# CONFIG_LAPB is not set # CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set # CONFIG_NET_DIVERT is not set
...@@ -268,7 +284,6 @@ CONFIG_DUMMY=m ...@@ -268,7 +284,6 @@ CONFIG_DUMMY=m
CONFIG_BONDING=m CONFIG_BONDING=m
# CONFIG_EQUALIZER is not set # CONFIG_EQUALIZER is not set
CONFIG_TUN=m CONFIG_TUN=m
# CONFIG_ETHERTAP is not set
# #
# Ethernet (10 or 100Mbit) # Ethernet (10 or 100Mbit)
...@@ -292,6 +307,7 @@ CONFIG_PCNET32=y ...@@ -292,6 +307,7 @@ CONFIG_PCNET32=y
# CONFIG_AMD8111_ETH is not set # CONFIG_AMD8111_ETH is not set
# CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_B44 is not set # CONFIG_B44 is not set
# CONFIG_FORCEDETH is not set
# CONFIG_DGRS is not set # CONFIG_DGRS is not set
# CONFIG_EEPRO100 is not set # CONFIG_EEPRO100 is not set
CONFIG_E100=y CONFIG_E100=y
...@@ -303,7 +319,6 @@ CONFIG_E100=y ...@@ -303,7 +319,6 @@ CONFIG_E100=y
# CONFIG_SIS900 is not set # CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set # CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set # CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set # CONFIG_VIA_RHINE is not set
# #
...@@ -344,10 +359,10 @@ CONFIG_PPPOE=m ...@@ -344,10 +359,10 @@ CONFIG_PPPOE=m
# CONFIG_NET_RADIO is not set # CONFIG_NET_RADIO is not set
# #
# Token Ring devices (depends on LLC=y) # Token Ring devices
# #
# CONFIG_TR is not set
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
# #
...@@ -365,6 +380,11 @@ CONFIG_PPPOE=m ...@@ -365,6 +380,11 @@ CONFIG_PPPOE=m
# #
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
# #
# ISDN subsystem # ISDN subsystem
# #
...@@ -433,6 +453,7 @@ CONFIG_HW_CONSOLE=y ...@@ -433,6 +453,7 @@ CONFIG_HW_CONSOLE=y
# #
CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set
# #
...@@ -444,20 +465,6 @@ CONFIG_UNIX98_PTYS=y ...@@ -444,20 +465,6 @@ CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256 CONFIG_UNIX98_PTY_COUNT=256
CONFIG_HVC_CONSOLE=y CONFIG_HVC_CONSOLE=y
#
# I2C support
#
# CONFIG_I2C is not set
#
# I2C Hardware Sensors Mainboard support
#
#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
# #
# Mice # Mice
# #
...@@ -483,11 +490,15 @@ CONFIG_HVC_CONSOLE=y ...@@ -483,11 +490,15 @@ CONFIG_HVC_CONSOLE=y
# #
# Ftape, the floppy tape device driver # Ftape, the floppy tape device driver
# #
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set # CONFIG_AGP is not set
# CONFIG_DRM is not set # CONFIG_DRM is not set
CONFIG_RAW_DRIVER=y CONFIG_RAW_DRIVER=y
# CONFIG_HANGCHECK_TIMER is not set CONFIG_MAX_RAW_DEVS=256
#
# I2C support
#
# CONFIG_I2C is not set
# #
# Multimedia devices # Multimedia devices
...@@ -499,6 +510,67 @@ CONFIG_RAW_DRIVER=y ...@@ -499,6 +510,67 @@ CONFIG_RAW_DRIVER=y
# #
# CONFIG_DVB is not set # CONFIG_DVB is not set
#
# Graphics support
#
CONFIG_FB=y
# CONFIG_FB_CYBER2000 is not set
CONFIG_FB_OF=y
# CONFIG_FB_CT65550 is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_S3TRIO is not set
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_RIVA is not set
CONFIG_FB_MATROX=y
CONFIG_FB_MATROX_MILLENIUM=y
CONFIG_FB_MATROX_MYSTIQUE=y
CONFIG_FB_MATROX_G450=y
CONFIG_FB_MATROX_G100=y
CONFIG_FB_MATROX_MULTIHEAD=y
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_KYRO is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
# CONFIG_MDA_CONSOLE is not set
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
#
# Logo configuration
#
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
#
# Sound
#
# CONFIG_SOUND is not set
#
# USB support
#
# CONFIG_USB is not set
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_GADGET is not set
# #
# File systems # File systems
# #
...@@ -551,11 +623,14 @@ CONFIG_VFAT_FS=y ...@@ -551,11 +623,14 @@ CONFIG_VFAT_FS=y
# Pseudo filesystems # Pseudo filesystems
# #
CONFIG_PROC_FS=y CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y CONFIG_DEVPTS_FS=y
CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_XATTR=y
# CONFIG_DEVPTS_FS_SECURITY is not set # CONFIG_DEVPTS_FS_SECURITY is not set
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_RAMFS=y CONFIG_RAMFS=y
# #
...@@ -580,6 +655,7 @@ CONFIG_CRAMFS=y ...@@ -580,6 +655,7 @@ CONFIG_CRAMFS=y
CONFIG_NFS_FS=y CONFIG_NFS_FS=y
CONFIG_NFS_V3=y CONFIG_NFS_V3=y
CONFIG_NFS_V4=y CONFIG_NFS_V4=y
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=y CONFIG_NFSD=y
CONFIG_NFSD_V3=y CONFIG_NFSD_V3=y
CONFIG_NFSD_V4=y CONFIG_NFSD_V4=y
...@@ -602,11 +678,11 @@ CONFIG_CIFS=m ...@@ -602,11 +678,11 @@ CONFIG_CIFS=m
# #
# CONFIG_PARTITION_ADVANCED is not set # CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
# #
# Native Language Support # Native Language Support
# #
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_737 is not set
...@@ -646,72 +722,6 @@ CONFIG_NLS_DEFAULT="iso8859-1" ...@@ -646,72 +722,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set # CONFIG_NLS_UTF8 is not set
#
# 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_OF=y
# CONFIG_FB_CT65550 is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_S3TRIO is not set
# CONFIG_FB_VGA16 is not set
# CONFIG_FB_RIVA is not set
CONFIG_FB_MATROX=y
CONFIG_FB_MATROX_MILLENIUM=y
CONFIG_FB_MATROX_MYSTIQUE=y
CONFIG_FB_MATROX_G450=y
CONFIG_FB_MATROX_G100=y
CONFIG_FB_MATROX_MULTIHEAD=y
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
# CONFIG_MDA_CONSOLE is not set
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
#
# Logo configuration
#
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
#
# Sound
#
# CONFIG_SOUND is not set
#
# USB support
#
# CONFIG_USB is not set
# CONFIG_USB_GADGET is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
# #
# Profiling support # Profiling support
# #
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -646,12 +646,14 @@ fast_exception_return: ...@@ -646,12 +646,14 @@ fast_exception_return:
*/ */
.globl DataAccess_common .globl DataAccess_common
DataAccess_common: DataAccess_common:
BEGIN_FTR_SECTION
mfspr r22,DAR mfspr r22,DAR
srdi r22,r22,60 srdi r22,r22,60
cmpi 0,r22,0xc cmpi 0,r22,0xc
/* Segment fault on a bolted segment. Go off and map that segment. */ /* Segment fault on a bolted segment. Go off and map that segment. */
beq- .do_stab_bolted beq- .do_stab_bolted
END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
stab_bolted_user_return: stab_bolted_user_return:
EXCEPTION_PROLOG_COMMON EXCEPTION_PROLOG_COMMON
ld r3,_DSISR(r1) ld r3,_DSISR(r1)
...@@ -661,10 +663,12 @@ stab_bolted_user_return: ...@@ -661,10 +663,12 @@ stab_bolted_user_return:
rlwinm r4,r3,32-23,29,29 /* DSISR_STORE -> _PAGE_RW */ rlwinm r4,r3,32-23,29,29 /* DSISR_STORE -> _PAGE_RW */
ld r3,_DAR(r1) /* into the hash table */ ld r3,_DAR(r1) /* into the hash table */
BEGIN_FTR_SECTION
beq+ 2f /* If so handle it */ beq+ 2f /* If so handle it */
li r4,0x300 /* Trap number */ li r4,0x300 /* Trap number */
bl .do_stab_SI bl .do_stab_SI
b 1f b 1f
END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
2: li r5,0x300 2: li r5,0x300
bl .do_hash_page_DSI /* Try to handle as hpte fault */ bl .do_hash_page_DSI /* Try to handle as hpte fault */
...@@ -690,7 +694,7 @@ DataAccessSLB_common: ...@@ -690,7 +694,7 @@ DataAccessSLB_common:
EXCEPTION_PROLOG_COMMON EXCEPTION_PROLOG_COMMON
ld r3,_DAR(r1) ld r3,_DAR(r1)
li r4,0x380 /* Exception vector */ li r4,0x380 /* Exception vector */
bl .ste_allocate bl .slb_allocate
or. r3,r3,r3 /* Check return code */ or. r3,r3,r3 /* Check return code */
beq fast_exception_return /* Return if we succeeded */ beq fast_exception_return /* Return if we succeeded */
addi r3,r1,STACK_FRAME_OVERHEAD addi r3,r1,STACK_FRAME_OVERHEAD
...@@ -705,12 +709,14 @@ DataAccessSLB_common: ...@@ -705,12 +709,14 @@ DataAccessSLB_common:
InstructionAccess_common: InstructionAccess_common:
EXCEPTION_PROLOG_COMMON EXCEPTION_PROLOG_COMMON
BEGIN_FTR_SECTION
andis. r0,r23,0x0020 /* no ste found? */ andis. r0,r23,0x0020 /* no ste found? */
beq+ 2f beq+ 2f
mr r3,r22 /* SRR0 at interrupt */ mr r3,r22 /* SRR0 at interrupt */
li r4,0x400 /* Trap number */ li r4,0x400 /* Trap number */
bl .do_stab_SI bl .do_stab_SI
b 1f b 1f
END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
2: mr r3,r22 2: mr r3,r22
li r5,0x400 li r5,0x400
...@@ -730,7 +736,7 @@ InstructionAccessSLB_common: ...@@ -730,7 +736,7 @@ InstructionAccessSLB_common:
EXCEPTION_PROLOG_COMMON EXCEPTION_PROLOG_COMMON
mr r3,r22 /* SRR0 = NIA */ mr r3,r22 /* SRR0 = NIA */
li r4,0x480 /* Exception vector */ li r4,0x480 /* Exception vector */
bl .ste_allocate bl .slb_allocate
or. r3,r3,r3 /* Check return code */ or. r3,r3,r3 /* Check return code */
beq+ fast_exception_return /* Return if we succeeded */ beq+ fast_exception_return /* Return if we succeeded */
...@@ -1006,48 +1012,27 @@ _GLOBAL(do_stab_bolted) ...@@ -1006,48 +1012,27 @@ _GLOBAL(do_stab_bolted)
* r20 - r23, SRR0 and SRR1 are saved in the exception frame. * r20 - r23, SRR0 and SRR1 are saved in the exception frame.
* We assume we aren't going to take any exceptions during this procedure. * We assume we aren't going to take any exceptions during this procedure.
*/ */
/* XXX note fix masking in get_kernel_vsid to match */
_GLOBAL(do_slb_bolted) _GLOBAL(do_slb_bolted)
stw r23,EX_CCR(r21) /* save CR in exc. frame */ stw r23,EX_CCR(r21) /* save CR in exc. frame */
/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */ /*
mfspr r21,DAR * We take the next entry, round robin. Previously we tried
rldicl r20,r21,36,32 /* Permits a full 32b of ESID */ * to find a free slot first but that took too long. Unfortunately
rldicr r20,r20,15,48 * we dont have any LRU information to help us choose a slot.
rldicl r21,r21,4,60 */
or r20,r20,r21
li r21,9 /* VSID_RANDOMIZER */
sldi r21,r21,32
oris r21,r21,58231
ori r21,r21,39831
mulld r20,r20,r21
clrldi r20,r20,28 /* r20 = vsid */
/* Search the SLB for a free entry */
li r22,1
1:
slbmfee r23,r22
rldicl r23,r23,37,63
cmpwi r23,0
beq 4f /* Found an invalid entry */
addi r22,r22,1
cmpldi r22,64
blt 1b
/* No free entry - just take the next entry, round-robin */ /* r20 = paca */
/* XXX we should get the number of SLB entries from the naca */ /* use a cpu feature mask if we ever change our slb size */
SLB_NUM_ENTRIES = 64 SLB_NUM_ENTRIES = 64
2: mfspr r21,SPRG3 1: ld r22,PACASTABRR(r20)
ld r22,PACASTABRR(r21) addi r21,r22,1
addi r23,r22,1 cmpdi r21,SLB_NUM_ENTRIES
cmpdi r23,SLB_NUM_ENTRIES blt+ 2f
blt 3f li r21,1 /* dont touch bolted slot 0 */
li r23,1 2: std r21,PACASTABRR(r20)
3: std r23,PACASTABRR(r21)
/* r20 = vsid, r22 = entry */ /* r20 = paca, r22 = entry */
/* /*
* Never cast out the segment for our kernel stack. Since we * Never cast out the segment for our kernel stack. Since we
...@@ -1056,48 +1041,86 @@ SLB_NUM_ENTRIES = 64 ...@@ -1056,48 +1041,86 @@ SLB_NUM_ENTRIES = 64
* which gets invalidated due to a tlbie from another cpu at a * which gets invalidated due to a tlbie from another cpu at a
* non recoverable point (after setting srr0/1) - Anton * non recoverable point (after setting srr0/1) - Anton
*/ */
slbmfee r23,r22 slbmfee r21,r22
srdi r23,r23,28 srdi r21,r21,27
/* /*
* This is incorrect (r1 is not the kernel stack) if we entered * This is incorrect (r1 is not the kernel stack) if we entered
* from userspace but there is no critical window from userspace * from userspace but there is no critical window from userspace
* so this should be OK. Also if we cast out the userspace stack * so this should be OK. Also if we cast out the userspace stack
* segment while in userspace we will fault it straight back in. * segment while in userspace we will fault it straight back in.
*/ */
srdi r21,r1,28 srdi r23,r1,27
cmpd r21,r23 ori r23,r23,1
beq- 2b cmpd r23,r21
beq- 1b
/* Put together the vsid portion of the entry. */ /* r20 = paca, r22 = entry */
4: li r21,0
rldimi r21,r20,12,0 /* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
ori r20,r21,1024 mfspr r21,DAR
ori r20,r20,128 /* set class bit for kernel region */ rldicl r23,r21,36,51
#ifndef CONFIG_PPC_ISERIES sldi r23,r23,15
ori r20,r20,256 /* map kernel region with large ptes */ srdi r21,r21,60
#endif or r23,r23,r21
/* VSID_RANDOMIZER */
li r21,9
sldi r21,r21,32
oris r21,r21,58231
ori r21,r21,39831
/* vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK */
mulld r23,r23,r21
clrldi r23,r23,28
/* r20 = paca, r22 = entry, r23 = vsid */
/* Put together slb word1 */
sldi r23,r23,12
/* Put together the esid portion of the entry. */ BEGIN_FTR_SECTION
mfspr r21,DAR /* Get the new esid */ /* set kp and c bits */
rldicl r21,r21,36,28 /* Permits a full 36b of ESID */ ori r23,r23,0x480
li r23,0 END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE)
rldimi r23,r21,28,0 /* Insert esid */ BEGIN_FTR_SECTION
oris r21,r23,2048 /* valid bit */ /* set kp, l and c bits */
rldimi r21,r22,0,52 /* Insert entry */ ori r23,r23,0x580
END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
/* r20 = paca, r22 = entry, r23 = slb word1 */
/* Put together slb word0 */
mfspr r21,DAR
rldicr r21,r21,0,35 /* get the new esid */
oris r21,r21,2048 /* set valid bit */
rldimi r21,r22,0,52 /* insert entry */
/* r20 = paca, r21 = slb word0, r23 = slb word1 */
/* /*
* No need for an isync before or after this slbmte. The exception * No need for an isync before or after this slbmte. The exception
* we enter with and the rfid we exit with are context synchronizing . * we enter with and the rfid we exit with are context synchronizing .
*/ */
slbmte r20,r21 slbmte r23,r21
/* All done -- return from exception. */ /* All done -- return from exception. */
mfsprg r20,3 /* Load the PACA pointer */
ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */ ld r21,PACAEXCSP(r20) /* Get the exception frame pointer */
addi r21,r21,EXC_FRAME_SIZE addi r21,r21,EXC_FRAME_SIZE
lwz r23,EX_CCR(r21) /* get saved CR */ lwz r23,EX_CCR(r21) /* get saved CR */
/* note that this is almost identical to maskable_exception_exit */ /* note that this is almost identical to maskable_exception_exit */
mtcr r23 /* restore CR */
/*
* Until everyone updates binutils hardwire the POWER4 optimised
* single field mtcrf
*/
#if 0
.machine push
.machine "power4"
mtcrf 0x80,r23
.machine pop
#else
.long 0x7ef80120
#endif
mfmsr r22 mfmsr r22
li r23, MSR_RI li r23, MSR_RI
...@@ -1110,7 +1133,7 @@ SLB_NUM_ENTRIES = 64 ...@@ -1110,7 +1133,7 @@ SLB_NUM_ENTRIES = 64
mtspr SRR1,r23 mtspr SRR1,r23
ld r22,EX_R22(r21) /* restore r22 and r23 */ ld r22,EX_R22(r21) /* restore r22 and r23 */
ld r23,EX_R23(r21) ld r23,EX_R23(r21)
mfspr r20,SPRG2 ld r20,EX_R20(r21)
mfspr r21,SPRG1 mfspr r21,SPRG1
rfid rfid
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
/* Ported to ppc64, August 20, 2001 */ /* Ported to ppc64, August 20, 2001 */
/* End Change Activity */ /* End Change Activity */
/************************************************************************/ /************************************************************************/
#include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/types.h> #include <asm/types.h>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Copyright (c) 2003 Dave Engebretsen * Copyright (c) 2003 Dave Engebretsen
* Will Schmidt willschm@us.ibm.com * Will Schmidt willschm@us.ibm.com
* SPLPAR updates, Copyright (c) 2003 Will Schmidt IBM Corporation. * SPLPAR updates, Copyright (c) 2003 Will Schmidt IBM Corporation.
* Nathan Lynch nathanl@austin.ibm.com
* Added lparcfg_write, Copyright (C) 2004 Nathan Lynch IBM Corporation.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -15,6 +17,7 @@ ...@@ -15,6 +17,7 @@
* keyword - value pairs that specify the configuration of the partition. * keyword - value pairs that specify the configuration of the partition.
*/ */
#include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -33,6 +36,9 @@ static struct proc_dir_entry *proc_ppc64_lparcfg; ...@@ -33,6 +36,9 @@ static struct proc_dir_entry *proc_ppc64_lparcfg;
#define LPARCFG_BUFF_SIZE 4096 #define LPARCFG_BUFF_SIZE 4096
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#define lparcfg_write NULL
static unsigned char e2a(unsigned char x) static unsigned char e2a(unsigned char x)
{ {
switch (x) { switch (x) {
...@@ -326,7 +332,7 @@ static int lparcfg_data(unsigned char *buf, unsigned long size) ...@@ -326,7 +332,7 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
system_potential_processors = get_splpar_potential_characteristics(); system_potential_processors = get_splpar_potential_characteristics();
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"system_active_processors=%d\n", "system_active_processors=%d\n",
(h_resource >> 2*8) && 0xffff); (h_resource >> 2*8) & 0xffff);
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"system_potential_processors=%d\n", "system_potential_processors=%d\n",
system_potential_processors); system_potential_processors);
...@@ -367,22 +373,115 @@ static int lparcfg_data(unsigned char *buf, unsigned long size) ...@@ -367,22 +373,115 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) { if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"pool=%d\n", (h_aggregation >> 0*8)&&0xffff); "pool=%d\n", (h_aggregation >> 0*8)&0xffff);
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"pool_capacity=%d\n", (h_resource >> 3*8) &&0xffff); "pool_capacity=%d\n", (h_resource >> 3*8) &0xffff);
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"group=%d\n", (h_aggregation >> 2*8)&&0xffff); "group=%d\n", (h_aggregation >> 2*8)&0xffff);
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"capped=%d\n", (h_resource >> 6*8)&&0x40); "capped=%d\n", (h_resource >> 6*8)&0x40);
n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n, n += snprintf(buf+n, LPARCFG_BUFF_SIZE - n,
"capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF); "capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF);
} }
return 0; return 0;
} }
/*
* Interface for changing system parameters (variable capacity weight
* and entitled capacity). Format of input is "param_name=value";
* anything after value is ignored. Valid parameters at this time are
* "partition_entitled_capacity" and "capacity_weight". We use
* H_SET_PPP to alter parameters.
*
* This function should be invoked only on systems with
* FW_FEATURE_SPLPAR.
*/
static ssize_t lparcfg_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
{
char *kbuf;
char *tmp;
u64 new_entitled, *new_entitled_ptr = &new_entitled;
u8 new_weight, *new_weight_ptr = &new_weight;
unsigned long current_entitled; /* parameters for h_get_ppp */
unsigned long dummy;
unsigned long resource;
u8 current_weight;
ssize_t retval = -ENOMEM;
kbuf = kmalloc(count, GFP_KERNEL);
if (!kbuf)
goto out;
retval = -EFAULT;
if (copy_from_user(kbuf, buf, count))
goto out;
retval = -EINVAL;
kbuf[count - 1] = '\0';
tmp = strchr(kbuf, '=');
if (!tmp)
goto out;
*tmp++ = '\0';
if (!strcmp(kbuf, "partition_entitled_capacity")) {
char *endp;
*new_entitled_ptr = (u64)simple_strtoul(tmp, &endp, 10);
if (endp == tmp)
goto out;
new_weight_ptr = &current_weight;
} else if (!strcmp(kbuf, "capacity_weight")) {
char *endp;
*new_weight_ptr = (u8)simple_strtoul(tmp, &endp, 10);
if (endp == tmp)
goto out;
new_entitled_ptr = &current_entitled;
} else
goto out;
/* Get our current parameters */
retval = h_get_ppp(&current_entitled, &dummy, &dummy, &resource);
if (retval) {
retval = -EIO;
goto out;
}
current_weight = (resource>>5*8)&0xFF;
pr_debug("%s: current_entitled = %lu, current_weight = %lu\n",
__FUNCTION__, current_entitled, current_weight);
pr_debug("%s: new_entitled = %lu, new_weight = %lu\n",
__FUNCTION__, *new_entitled_ptr, *new_weight_ptr);
retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
*new_weight_ptr);
if (retval == H_Success || retval == H_Constrained) {
retval = count;
} else if (retval == H_Busy) {
retval = -EBUSY;
} else if (retval == H_Hardware) {
retval = -EIO;
} else if (retval == H_Parameter) {
retval = -EINVAL;
} else {
printk(KERN_WARNING "%s: received unknown hv return code %ld",
__FUNCTION__, retval);
retval = -EIO;
}
out:
kfree(kbuf);
return retval;
}
#endif /* CONFIG_PPC_PSERIES */ #endif /* CONFIG_PPC_PSERIES */
...@@ -442,8 +541,15 @@ struct file_operations lparcfg_fops = { ...@@ -442,8 +541,15 @@ struct file_operations lparcfg_fops = {
int __init lparcfg_init(void) int __init lparcfg_init(void)
{ {
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
mode_t mode = S_IRUSR;
/* Allow writing if we have FW_FEATURE_SPLPAR */
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
lparcfg_fops.write = lparcfg_write;
mode |= S_IWUSR;
}
ent = create_proc_entry("ppc64/lparcfg", S_IRUSR, NULL); ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
if (ent) { if (ent) {
ent->proc_fops = &lparcfg_fops; ent->proc_fops = &lparcfg_fops;
ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL); ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL);
......
...@@ -41,7 +41,6 @@ struct systemcfg *systemcfg; ...@@ -41,7 +41,6 @@ struct systemcfg *systemcfg;
.xStab_data = { \ .xStab_data = { \
.real = (asrr), /* Real pointer to segment table */ \ .real = (asrr), /* Real pointer to segment table */ \
.virt = (asrv), /* Virt pointer to segment table */ \ .virt = (asrv), /* Virt pointer to segment table */ \
.next_round_robin = 1 /* Round robin index */ \
}, \ }, \
.lpQueuePtr = (lpq), /* &xItLpQueue, */ \ .lpQueuePtr = (lpq), /* &xItLpQueue, */ \
/* .xRtas = { \ /* .xRtas = { \
......
...@@ -83,7 +83,7 @@ EXPORT_SYMBOL(__up); ...@@ -83,7 +83,7 @@ EXPORT_SYMBOL(__up);
EXPORT_SYMBOL(naca); EXPORT_SYMBOL(naca);
EXPORT_SYMBOL(__down); EXPORT_SYMBOL(__down);
/* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */ EXPORT_SYMBOL(csum_partial);
EXPORT_SYMBOL(csum_partial_copy_generic); EXPORT_SYMBOL(csum_partial_copy_generic);
EXPORT_SYMBOL(ip_fast_csum); EXPORT_SYMBOL(ip_fast_csum);
EXPORT_SYMBOL(csum_tcpudp_magic); EXPORT_SYMBOL(csum_tcpudp_magic);
...@@ -191,12 +191,12 @@ EXPORT_SYMBOL(find_all_nodes); ...@@ -191,12 +191,12 @@ EXPORT_SYMBOL(find_all_nodes);
EXPORT_SYMBOL(get_property); EXPORT_SYMBOL(get_property);
#endif #endif
EXPORT_SYMBOL_NOVERS(memcpy); EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memset); EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memmove); EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(memscan); EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(memcmp); EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memchr);
EXPORT_SYMBOL(abs); EXPORT_SYMBOL(abs);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
* End Change Activity * End Change Activity
*/ */
#include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
......
...@@ -151,7 +151,31 @@ struct task_struct *__switch_to(struct task_struct *prev, ...@@ -151,7 +151,31 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags); local_irq_save(flags);
last = _switch(old_thread, new_thread); last = _switch(old_thread, new_thread);
/*
* force our kernel stack out of the ERAT and SLB, this is to
* avoid the race where we it hangs around in the ERAT but not the
* SLB and the ERAT gets invalidated at just the wrong moment by
* another CPU doing a tlbie.
*
* We definitely dont want to flush our bolted segment, so check
* for that first.
*/
if ((cur_cpu_spec->cpu_features & CPU_FTR_SLB) &&
GET_ESID((unsigned long)_get_SP()) != GET_ESID(PAGE_OFFSET)) {
union {
unsigned long word0;
slb_dword0 data;
} esid_data;
esid_data.word0 = 0;
/* class bit is in valid field for slbie instruction */
esid_data.data.v = 1;
esid_data.data.esid = GET_ESID((unsigned long)_get_SP());
asm volatile("isync; slbie %0; isync" : : "r" (esid_data));
}
local_irq_restore(flags); local_irq_restore(flags);
return last; return last;
} }
......
...@@ -2560,6 +2560,7 @@ int of_remove_node(struct device_node *np) ...@@ -2560,6 +2560,7 @@ int of_remove_node(struct device_node *np)
return 0; return 0;
} }
#ifdef CONFIG_PROC_DEVICETREE
/* /*
* Add a node to /proc/device-tree. * Add a node to /proc/device-tree.
*/ */
...@@ -2592,6 +2593,17 @@ static void remove_node_proc_entries(struct device_node *np) ...@@ -2592,6 +2593,17 @@ static void remove_node_proc_entries(struct device_node *np)
if (np->pde) if (np->pde)
remove_proc_entry(np->pde->name, parent->pde); remove_proc_entry(np->pde->name, parent->pde);
} }
#else /* !CONFIG_PROC_DEVICETREE */
static void add_node_proc_entries(struct device_node *np)
{
return;
}
static void remove_node_proc_entries(struct device_node *np)
{
return;
}
#endif /* CONFIG_PROC_DEVICETREE */
/* /*
* Fix up the uninitialized fields in a new device node: * Fix up the uninitialized fields in a new device node:
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/proc_fs.h> #include <asm/proc_fs.h>
#include <asm/delay.h> #include <asm/delay.h>
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/cputable.h>
#include <asm/sections.h> #include <asm/sections.h>
extern unsigned long klimit; extern unsigned long klimit;
...@@ -430,8 +431,58 @@ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -430,8 +431,58 @@ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
} }
} }
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
static int __init set_preferred_console(void)
{
struct device_node *prom_stdout;
char *name;
/* The user has requested a console so this is already set up. */
if (strstr(cmd_line, "console="))
return -EBUSY;
prom_stdout = find_path_device(of_stdout_device);
if (!prom_stdout)
return -ENODEV;
name = (char *)get_property(prom_stdout, "name", NULL);
if (!name)
return -ENODEV;
if (strcmp(name, "serial") == 0) {
int i;
u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
if (i > 8) {
int offset;
switch (reg[1]) {
case 0x3f8:
offset = 0;
break;
case 0x2f8:
offset = 1;
break;
case 0x898:
offset = 2;
break;
case 0x890:
offset = 3;
break;
default:
/* We dont recognise the serial port */
return -ENODEV;
}
return add_preferred_console("ttyS", offset, NULL);
}
} else if (strcmp(name, "vty") == 0) {
/* pSeries LPAR virtual console */
return add_preferred_console("hvc", 0, NULL);
}
return -ENODEV;
}
console_initcall(set_preferred_console);
int parse_bootinfo(void) int parse_bootinfo(void)
{ {
struct bi_record *rec; struct bi_record *rec;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
......
This diff is collapsed.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -2845,6 +2846,7 @@ long ppc32_timer_create(clockid_t clock, ...@@ -2845,6 +2846,7 @@ long ppc32_timer_create(clockid_t clock,
return -EFAULT; return -EFAULT;
savefs = get_fs(); savefs = get_fs();
set_fs(KERNEL_DS);
err = sys_timer_create(clock, &event, &t); err = sys_timer_create(clock, &event, &t);
set_fs(savefs); set_fs(savefs);
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
#include <linux/config.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* described in the kernel's COPYING file. * described in the kernel's COPYING file.
*/ */
#include <linux/config.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu.h> #include <asm/mmu.h>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com> * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com>
*/ */
#include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -655,10 +654,9 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access, ...@@ -655,10 +654,9 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
unsigned long hpteflags, prpn, flags; unsigned long hpteflags, prpn, flags;
long slot; long slot;
ea &= ~(HPAGE_SIZE-1);
/* We have to find the first hugepte in the batch, since /* We have to find the first hugepte in the batch, since
* that's the one that will store the HPTE flags */ * that's the one that will store the HPTE flags */
ea &= HPAGE_MASK;
ptep = hugepte_offset(mm, ea); ptep = hugepte_offset(mm, ea);
/* Search the Linux page table for a match with va */ /* Search the Linux page table for a match with va */
...@@ -886,10 +884,11 @@ static int __init hugetlb_init(void) ...@@ -886,10 +884,11 @@ static int __init hugetlb_init(void)
spin_unlock(&htlbpage_lock); spin_unlock(&htlbpage_lock);
} }
htlbpage_max = htlbpage_free = htlbpage_total = i; htlbpage_max = htlbpage_free = htlbpage_total = i;
printk("Total HugeTLB memory allocated, %d\n", htlbpage_free); printk(KERN_INFO "Total HugeTLB memory allocated, %d\n",
htlbpage_free);
} else { } else {
htlbpage_max = 0; htlbpage_max = 0;
printk("CPU does not support HugeTLB\n"); printk(KERN_INFO "CPU does not support HugeTLB\n");
} }
return 0; return 0;
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -28,11 +30,14 @@ static inline unsigned int readtb(void) ...@@ -28,11 +30,14 @@ static inline unsigned int readtb(void)
return ret; return ret;
} }
#ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs,
struct tty_struct *tty) struct tty_struct *tty)
{ {
xmon(pt_regs); xmon(pt_regs);
} }
static struct sysrq_key_op sysrq_xmon_op = static struct sysrq_key_op sysrq_xmon_op =
{ {
.handler = sysrq_handle_xmon, .handler = sysrq_handle_xmon,
...@@ -40,11 +45,15 @@ static struct sysrq_key_op sysrq_xmon_op = ...@@ -40,11 +45,15 @@ static struct sysrq_key_op sysrq_xmon_op =
.action_msg = "Entering xmon\n", .action_msg = "Entering xmon\n",
}; };
#endif /* CONFIG_MAGIC_SYSRQ */
void void
xmon_map_scc(void) xmon_map_scc(void)
{ {
#ifdef CONFIG_MAGIC_SYSRQ
/* This maybe isn't the best place to register sysrq 'x' */ /* This maybe isn't the best place to register sysrq 'x' */
__sysrq_put_key_op('x', &sysrq_xmon_op); __sysrq_put_key_op('x', &sysrq_xmon_op);
#endif /* CONFIG_MAGIC_SYSRQ */
} }
int int
......
...@@ -70,3 +70,8 @@ include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ...@@ -70,3 +70,8 @@ include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets) $(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/offsets.h CLEAN_FILES += include/asm-$(ARCH)/offsets.h
# Don't use tabs in echo arguments
define archhelp
echo '* image - Kernel image for IPL ($(boot)/image)'
endef
...@@ -147,6 +147,7 @@ CONFIG_MD_LINEAR=m ...@@ -147,6 +147,7 @@ CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m CONFIG_MD_RAID5=m
# CONFIG_MD_RAID6 is not set
CONFIG_MD_MULTIPATH=m CONFIG_MD_MULTIPATH=m
# CONFIG_BLK_DEV_DM is not set # CONFIG_BLK_DEV_DM is not set
......
...@@ -1912,6 +1912,7 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) ...@@ -1912,6 +1912,7 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
security_bprm_free(&bprm); security_bprm_free(&bprm);
out_mm: out_mm:
if (bprm.mm)
mmdrop(bprm.mm); mmdrop(bprm.mm);
out_file: out_file:
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/ioctl32.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/cpcmd.h> #include <asm/cpcmd.h>
#include <asm/delay.h> #include <asm/delay.h>
...@@ -74,4 +75,5 @@ EXPORT_SYMBOL(console_device); ...@@ -74,4 +75,5 @@ EXPORT_SYMBOL(console_device);
EXPORT_SYMBOL_NOVERS(do_call_softirq); EXPORT_SYMBOL_NOVERS(do_call_softirq);
EXPORT_SYMBOL(sys_wait4); EXPORT_SYMBOL(sys_wait4);
EXPORT_SYMBOL(cpcmd); EXPORT_SYMBOL(cpcmd);
EXPORT_SYMBOL(sys_ioctl);
...@@ -79,8 +79,6 @@ extern unsigned long __init_end; ...@@ -79,8 +79,6 @@ extern unsigned long __init_end;
* paging_init() sets up the page tables * paging_init() sets up the page tables
*/ */
unsigned long last_valid_pfn;
#ifndef CONFIG_ARCH_S390X #ifndef CONFIG_ARCH_S390X
void __init paging_init(void) void __init paging_init(void)
{ {
......
...@@ -32,18 +32,20 @@ typedef struct { ...@@ -32,18 +32,20 @@ typedef struct {
/* N.B.: For SSE we only save %xmm0-%xmm7 even for x86-64, since /* N.B.: For SSE we only save %xmm0-%xmm7 even for x86-64, since
the code doesn't know about the additional x86-64 registers */ the code doesn't know about the additional x86-64 registers */
typedef struct { typedef struct {
unsigned int sarea[8*4]; unsigned int sarea[8*4+2];
unsigned int cr0; unsigned long cr0;
} raid6_sse_save_t __attribute__((aligned(16))); } raid6_sse_save_t __attribute__((aligned(16)));
/* This is for x86-64-specific code which uses all 16 XMM registers */ /* This is for x86-64-specific code which uses all 16 XMM registers */
typedef struct { typedef struct {
unsigned int sarea[16*4]; unsigned int sarea[16*4+2];
unsigned long cr0; unsigned long cr0;
} raid6_sse16_save_t __attribute__((aligned(16))); } raid6_sse16_save_t __attribute__((aligned(16)));
/* On x86-64 the stack is 16-byte aligned */ /* On x86-64 the stack *SHOULD* be 16-byte aligned, but currently this
#define SAREA(x) (x->sarea) is buggy in the kernel and it's only 8-byte aligned in places, so
we need to do this anyway. Sigh. */
#define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15))
#else /* __i386__ */ #else /* __i386__ */
...@@ -60,6 +62,7 @@ typedef struct { ...@@ -60,6 +62,7 @@ typedef struct {
unsigned long cr0; unsigned long cr0;
} raid6_sse_save_t; } raid6_sse_save_t;
/* Find the 16-byte aligned save area */
#define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15)) #define SAREA(x) ((unsigned int *)((((unsigned long)&(x)->sarea)+15) & ~15))
#endif #endif
......
...@@ -315,7 +315,8 @@ sclp_interrupt_handler(struct pt_regs *regs, __u16 code) ...@@ -315,7 +315,8 @@ sclp_interrupt_handler(struct pt_regs *regs, __u16 code)
/* Head queue a read sccb if an event buffer is pending */ /* Head queue a read sccb if an event buffer is pending */
if (evbuf_pending) if (evbuf_pending)
__sclp_unconditional_read(); __sclp_unconditional_read();
/* Now clear the running bit */ /* Now clear the running bit if SCLP indicated a finished SCCB */
if (finished_sccb != 0U)
clear_bit(SCLP_RUNNING, &sclp_status); clear_bit(SCLP_RUNNING, &sclp_status);
spin_unlock(&sclp_lock); spin_unlock(&sclp_lock);
/* and start next request on the queue */ /* and start next request on the queue */
......
...@@ -149,7 +149,8 @@ sclp_console_write(struct console *console, const char *message, ...@@ -149,7 +149,8 @@ sclp_console_write(struct console *console, const char *message,
count -= written; count -= written;
} while (count > 0); } while (count > 0);
/* Setup timer to output current console buffer after 1/10 second */ /* Setup timer to output current console buffer after 1/10 second */
if (sclp_conbuf != NULL && !timer_pending(&sclp_con_timer)) { if (sclp_conbuf != NULL && sclp_chars_in_buffer(sclp_conbuf) != 0 &&
!timer_pending(&sclp_con_timer)) {
init_timer(&sclp_con_timer); init_timer(&sclp_con_timer);
sclp_con_timer.function = sclp_console_timeout; sclp_con_timer.function = sclp_console_timeout;
sclp_con_timer.data = 0UL; sclp_con_timer.data = 0UL;
......
...@@ -274,7 +274,7 @@ sclp_write(struct sclp_buffer *buffer, const unsigned char *msg, int count) ...@@ -274,7 +274,7 @@ sclp_write(struct sclp_buffer *buffer, const unsigned char *msg, int count)
if (buffer->current_line != NULL) if (buffer->current_line != NULL)
sclp_finalize_mto(buffer); sclp_finalize_mto(buffer);
/* skip the rest of the message including the 0 byte */ /* skip the rest of the message including the 0 byte */
i_msg = count; i_msg = count - 1;
break; break;
default: /* no escape character */ default: /* no escape character */
/* do not output unprintable characters */ /* do not output unprintable characters */
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "ctrlchar.h" #include "ctrlchar.h"
...@@ -337,6 +338,9 @@ sclp_tty_write_string(const unsigned char *str, int count) ...@@ -337,6 +338,9 @@ sclp_tty_write_string(const unsigned char *str, int count)
if (sclp_ttybuf == NULL) { if (sclp_ttybuf == NULL) {
while (list_empty(&sclp_tty_pages)) { while (list_empty(&sclp_tty_pages)) {
spin_unlock_irqrestore(&sclp_tty_lock, flags); spin_unlock_irqrestore(&sclp_tty_lock, flags);
if (in_interrupt())
sclp_sync_wait();
else
wait_event(sclp_tty_waitq, wait_event(sclp_tty_waitq,
!list_empty(&sclp_tty_pages)); !list_empty(&sclp_tty_pages));
spin_lock_irqsave(&sclp_tty_lock, flags); spin_lock_irqsave(&sclp_tty_lock, flags);
...@@ -366,7 +370,9 @@ sclp_tty_write_string(const unsigned char *str, int count) ...@@ -366,7 +370,9 @@ sclp_tty_write_string(const unsigned char *str, int count)
} while (count > 0); } while (count > 0);
/* Setup timer to output current console buffer after 1/10 second */ /* Setup timer to output current console buffer after 1/10 second */
if (sclp_ioctls.final_nl) { if (sclp_ioctls.final_nl) {
if (sclp_ttybuf != NULL && !timer_pending(&sclp_tty_timer)) { if (sclp_ttybuf != NULL &&
sclp_chars_in_buffer(sclp_ttybuf) != 0 &&
!timer_pending(&sclp_tty_timer)) {
init_timer(&sclp_tty_timer); init_timer(&sclp_tty_timer);
sclp_tty_timer.function = sclp_tty_timeout; sclp_tty_timer.function = sclp_tty_timeout;
sclp_tty_timer.data = 0UL; sclp_tty_timer.data = 0UL;
...@@ -374,8 +380,14 @@ sclp_tty_write_string(const unsigned char *str, int count) ...@@ -374,8 +380,14 @@ sclp_tty_write_string(const unsigned char *str, int count)
add_timer(&sclp_tty_timer); add_timer(&sclp_tty_timer);
} }
} else { } else {
__sclp_ttybuf_emit(sclp_ttybuf); if (sclp_ttybuf != NULL &&
sclp_chars_in_buffer(sclp_ttybuf) != 0) {
buf = sclp_ttybuf;
sclp_ttybuf = NULL; sclp_ttybuf = NULL;
spin_unlock_irqrestore(&sclp_tty_lock, flags);
__sclp_ttybuf_emit(buf);
spin_lock_irqsave(&sclp_tty_lock, flags);
}
} }
spin_unlock_irqrestore(&sclp_tty_lock, flags); spin_unlock_irqrestore(&sclp_tty_lock, flags);
} }
...@@ -471,7 +483,7 @@ sclp_tty_chars_in_buffer(struct tty_struct *tty) ...@@ -471,7 +483,7 @@ sclp_tty_chars_in_buffer(struct tty_struct *tty)
count = sclp_chars_in_buffer(sclp_ttybuf); count = sclp_chars_in_buffer(sclp_ttybuf);
list_for_each(l, &sclp_tty_outqueue) { list_for_each(l, &sclp_tty_outqueue) {
t = list_entry(l, struct sclp_buffer, list); t = list_entry(l, struct sclp_buffer, list);
count += sclp_chars_in_buffer(sclp_ttybuf); count += sclp_chars_in_buffer(t);
} }
spin_unlock_irqrestore(&sclp_tty_lock, flags); spin_unlock_irqrestore(&sclp_tty_lock, flags);
return count; return count;
......
...@@ -908,3 +908,4 @@ EXPORT_SYMBOL(ccw_driver_register); ...@@ -908,3 +908,4 @@ EXPORT_SYMBOL(ccw_driver_register);
EXPORT_SYMBOL(ccw_driver_unregister); EXPORT_SYMBOL(ccw_driver_unregister);
EXPORT_SYMBOL(get_ccwdev_by_busid); EXPORT_SYMBOL(get_ccwdev_by_busid);
EXPORT_SYMBOL(ccw_bus_type); EXPORT_SYMBOL(ccw_bus_type);
EXPORT_SYMBOL(ccw_device_work);
/* /*
* $Id: ctctty.c,v 1.14 2003/10/06 11:33:33 mschwide Exp $ * $Id: ctctty.c,v 1.15 2004/01/26 10:21:01 mschwide Exp $
* *
* CTC / ESCON network driver, tty interface. * CTC / ESCON network driver, tty interface.
* *
...@@ -759,9 +759,7 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -759,9 +759,7 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
info->line); info->line);
#endif #endif
error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg); error = put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
if (error)
return error; return error;
return 0;
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
#ifdef CTC_DEBUG_MODEM_IOCTL #ifdef CTC_DEBUG_MODEM_IOCTL
printk(KERN_DEBUG "%s%d ioctl TIOCSSOFTCAR\n", CTC_TTY_NAME, printk(KERN_DEBUG "%s%d ioctl TIOCSSOFTCAR\n", CTC_TTY_NAME,
......
...@@ -113,7 +113,7 @@ ehci_hub_descriptor ( ...@@ -113,7 +113,7 @@ ehci_hub_descriptor (
u16 temp; u16 temp;
desc->bDescriptorType = 0x29; desc->bDescriptorType = 0x29;
desc->bPwrOn2PwrGood = 0; /* FIXME: f(system power) */ desc->bPwrOn2PwrGood = 10; /* FIXME: f(system power) */
desc->bHubContrCurrent = 0; desc->bHubContrCurrent = 0;
desc->bNbrPorts = ports; desc->bNbrPorts = ports;
......
...@@ -290,8 +290,8 @@ typedef struct { ...@@ -290,8 +290,8 @@ typedef struct {
#define TODC_TYPE_MC146818_SECONDS 0x00 #define TODC_TYPE_MC146818_SECONDS 0x00
#define TODC_TYPE_MC146818_CNTL_B 0x0a #define TODC_TYPE_MC146818_CNTL_B 0x0a
#define TODC_TYPE_MC146818_CNTL_A 0x0b /* control_a R/W regs */ #define TODC_TYPE_MC146818_CNTL_A 0x0b /* control_a R/W regs */
#define TODC_TYPE_MC146818_WATCHDOG 0x0c #define TODC_TYPE_MC146818_WATCHDOG 0
#define TODC_TYPE_MC146818_INTERRUPTS 0x0d #define TODC_TYPE_MC146818_INTERRUPTS 0x0c
#define TODC_TYPE_MC146818_ALARM_DATE 0xff #define TODC_TYPE_MC146818_ALARM_DATE 0xff
#define TODC_TYPE_MC146818_ALARM_HOUR 0x05 #define TODC_TYPE_MC146818_ALARM_HOUR 0x05
#define TODC_TYPE_MC146818_ALARM_MINUTES 0x03 #define TODC_TYPE_MC146818_ALARM_MINUTES 0x03
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* bugs. * bugs.
* *
*/ */
#ifndef _ASM_PPC64_BUGS_H
#define _ASM_PPC64_BUGS_H
static void check_bugs(void) { static void check_bugs(void) {
} }
#endif /* _ASM_PPC64_BUGS_H */
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#ifndef __ASM_PPC_CPUTABLE_H #ifndef __ASM_PPC_CPUTABLE_H
#define __ASM_PPC_CPUTABLE_H #define __ASM_PPC_CPUTABLE_H
#include <linux/config.h>
/* Exposed to userland CPU features - Must match ppc32 definitions */ /* Exposed to userland CPU features - Must match ppc32 definitions */
#define PPC_FEATURE_32 0x80000000 #define PPC_FEATURE_32 0x80000000
#define PPC_FEATURE_64 0x40000000 #define PPC_FEATURE_64 0x40000000
...@@ -133,10 +135,17 @@ extern firmware_feature_t firmware_features_table[]; ...@@ -133,10 +135,17 @@ extern firmware_feature_t firmware_features_table[];
#define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \ #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \
PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU) PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU)
#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_SLB | CPU_FTR_16M_PAGE | \ #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \
CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \ CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \
CPU_FTR_NODSISRALIGN) CPU_FTR_NODSISRALIGN)
/* iSeries doesn't support large pages */
#ifdef CONFIG_PPC_ISERIES
#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE)
#else
#define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE)
#endif
#define COMMON_PPC64_FW (0) #define COMMON_PPC64_FW (0)
#endif #endif
......
#ifndef _PPC64_HVCALL_H
#define _PPC64_HVCALL_H
#define H_Success 0 #define H_Success 0
#define H_Busy 1 /* Hardware busy -- retry later */ #define H_Busy 1 /* Hardware busy -- retry later */
#define H_Constrained 4 /* Resource request constrained to max allowed */
#define H_Hardware -1 /* Hardware error */ #define H_Hardware -1 /* Hardware error */
#define H_Function -2 /* Function not supported */ #define H_Function -2 /* Function not supported */
#define H_Privilege -3 /* Caller not privileged */ #define H_Privilege -3 /* Caller not privileged */
...@@ -138,3 +141,4 @@ long plpar_hcall_4out(unsigned long opcode, ...@@ -138,3 +141,4 @@ long plpar_hcall_4out(unsigned long opcode,
unsigned long *out3, unsigned long *out3,
unsigned long *out4); unsigned long *out4);
#endif /* _PPC64_HVCALL_H */
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#ifndef _PPC64_MMU_H_ #ifndef _PPC64_MMU_H_
#define _PPC64_MMU_H_ #define _PPC64_MMU_H_
#include <linux/config.h>
#include <asm/page.h> #include <asm/page.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -26,14 +27,6 @@ typedef unsigned long mm_context_t; ...@@ -26,14 +27,6 @@ typedef unsigned long mm_context_t;
#define CONTEXT_LOW_HPAGES 0 #define CONTEXT_LOW_HPAGES 0
#endif #endif
/*
* Define the size of the cache used for segment table entries. The first
* entry is used as a cache pointer, therefore the actual number of entries
* stored is one less than defined here. Do not change this value without
* considering the impact it will have on the layout of the paca in paca.h.
*/
#define STAB_CACHE_SIZE 16
/* /*
* Hardware Segment Lookaside Buffer Entry * Hardware Segment Lookaside Buffer Entry
* This structure has been padded out to two 64b doublewords (actual SLBE's are * This structure has been padded out to two 64b doublewords (actual SLBE's are
......
#ifndef __PPC64_MMU_CONTEXT_H #ifndef __PPC64_MMU_CONTEXT_H
#define __PPC64_MMU_CONTEXT_H #define __PPC64_MMU_CONTEXT_H
#include <linux/config.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -138,6 +139,7 @@ destroy_context(struct mm_struct *mm) ...@@ -138,6 +139,7 @@ destroy_context(struct mm_struct *mm)
} }
extern void flush_stab(struct task_struct *tsk, struct mm_struct *mm); extern void flush_stab(struct task_struct *tsk, struct mm_struct *mm);
extern void flush_slb(struct task_struct *tsk, struct mm_struct *mm);
/* /*
* switch_mm is the entry point called from the architecture independent * switch_mm is the entry point called from the architecture independent
...@@ -153,6 +155,14 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, ...@@ -153,6 +155,14 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
: : ); : : );
#endif /* CONFIG_ALTIVEC */ #endif /* CONFIG_ALTIVEC */
/* No need to flush userspace segments if the mm doesnt change */
if (prev == next)
return;
if (cur_cpu_spec->cpu_features & CPU_FTR_SLB)
flush_slb(tsk, next);
else
flush_stab(tsk, next); flush_stab(tsk, next);
cpu_set(smp_processor_id(), next->cpu_vm_mask); cpu_set(smp_processor_id(), next->cpu_vm_mask);
} }
......
...@@ -63,20 +63,15 @@ struct paca_struct { ...@@ -63,20 +63,15 @@ struct paca_struct {
u16 xPacaIndex; /* Logical processor number 0x18 */ u16 xPacaIndex; /* Logical processor number 0x18 */
u16 xHwProcNum; /* Physical processor number 0x1A */ u16 xHwProcNum; /* Physical processor number 0x1A */
u32 default_decr; /* Default decrementer value 0x1c */ u32 default_decr; /* Default decrementer value 0x1c */
u64 unused1; u64 xKsave; /* Saved Kernel stack addr or zero 0x20 */
u64 xKsave; /* Saved Kernel stack addr or zero 0x28 */ u64 pvr; /* Processor version register 0x28 */
u64 pvr; /* Processor version register 0x30 */ struct ItLpQueue *lpQueuePtr; /* LpQueue handled by this processor 0x30 */
u8 *exception_sp; /* 0x38 */ u64 xTOC; /* Kernel TOC address 0x38 */
STAB xStab_data; /* Segment table information 0x40,0x48,0x50 */
struct ItLpQueue *lpQueuePtr; /* LpQueue handled by this processor 0x40 */ u8 *exception_sp; /* 0x58 */
u64 xTOC; /* Kernel TOC address 0x48 */ u8 xProcEnabled; /* 0x59 */
STAB xStab_data; /* Segment table information 0x50,0x58,0x60 */ u8 prof_enabled; /* 1=iSeries profiling enabled 0x60 */
u8 xSegments[STAB_CACHE_SIZE]; /* Cache of used stab entries 0x68,0x70 */ u8 resv1[30]; /* 0x61-0x7F */
u8 xProcEnabled; /* 1=soft enabled 0x78 */
u8 unused2;
u8 prof_enabled; /* 1=iSeries profiling enabled 0x7A */
u8 stab_cache_pointer;
u8 resv1[4]; /* 0x7B-0x7F */
/*===================================================================================== /*=====================================================================================
* CACHE_LINE_2 0x0080 - 0x00FF * CACHE_LINE_2 0x0080 - 0x00FF
......
#ifndef __ARCH_I386_PERCPU__ #ifndef __ARCH_PPC64_PERCPU__
#define __ARCH_I386_PERCPU__ #define __ARCH_PPC64_PERCPU__
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
#endif /* __ARCH_I386_PERCPU__ */ #endif /* __ARCH_PPC64_PERCPU__ */
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/config.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <asm/processor.h> /* For TASK_SIZE */ #include <asm/processor.h> /* For TASK_SIZE */
#include <asm/mmu.h> #include <asm/mmu.h>
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#ifndef _PPC64_PPC_ASM_H
#define _PPC64_PPC_ASM_H
/* /*
* Macros for storing registers into and loading registers from * Macros for storing registers into and loading registers from
* exception frames. * exception frames.
...@@ -238,3 +240,5 @@ ...@@ -238,3 +240,5 @@
#define vr29 29 #define vr29 29
#define vr30 30 #define vr30 30
#define vr31 31 #define vr31 31
#endif /* _PPC64_PPC_ASM_H */
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/stringify.h> #include <linux/stringify.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/config.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/a.out.h> #include <asm/a.out.h>
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* this archive for more details. * this archive for more details.
*/ */
#ifndef _PPC64_PTRACE_COMMON_H
#define _PPC64_PTRACE_COMMON_H
/* /*
* Set of msr bits that gdb can change on behalf of a process. * Set of msr bits that gdb can change on behalf of a process.
*/ */
...@@ -64,3 +66,5 @@ static inline void clear_single_step(struct task_struct *task) ...@@ -64,3 +66,5 @@ static inline void clear_single_step(struct task_struct *task)
if (regs != NULL) if (regs != NULL)
regs->msr &= ~MSR_SE; regs->msr &= ~MSR_SE;
} }
#endif /* _PPC64_PTRACE_COMMON_H */
/* /*
* include/asm-ppc/serial.h * include/asm-ppc64/serial.h
*/ */
#ifndef _PPC64_SERIAL_H
#define _PPC64_SERIAL_H
#include <linux/config.h> #include <linux/config.h>
...@@ -124,3 +126,5 @@ ...@@ -124,3 +126,5 @@
EXTRA_SERIAL_PORT_DEFNS \ EXTRA_SERIAL_PORT_DEFNS \
HUB6_SERIAL_PORT_DFNS \ HUB6_SERIAL_PORT_DFNS \
MCA_SERIAL_PORT_DFNS MCA_SERIAL_PORT_DFNS
#endif /* _PPC64_SERIAL_H */
#ifndef __ARCH_S390_ATOMIC__ #ifndef __ARCH_S390_ATOMIC__
#define __ARCH_S390_ATOMIC__ #define __ARCH_S390_ATOMIC__
#ifdef __KERNEL__
/* /*
* include/asm-s390/atomic.h * include/asm-s390/atomic.h
* *
...@@ -27,6 +26,8 @@ typedef struct { ...@@ -27,6 +26,8 @@ typedef struct {
} __attribute__ ((aligned (4))) atomic_t; } __attribute__ ((aligned (4))) atomic_t;
#define ATOMIC_INIT(i) { (i) } #define ATOMIC_INIT(i) { (i) }
#ifdef __KERNEL__
#define __CS_LOOP(ptr, op_val, op_string) ({ \ #define __CS_LOOP(ptr, op_val, op_string) ({ \
typeof(ptr->counter) old_val, new_val; \ typeof(ptr->counter) old_val, new_val; \
__asm__ __volatile__(" l %0,0(%3)\n" \ __asm__ __volatile__(" l %0,0(%3)\n" \
...@@ -35,8 +36,10 @@ typedef struct { ...@@ -35,8 +36,10 @@ typedef struct {
" cs %0,%1,0(%3)\n" \ " cs %0,%1,0(%3)\n" \
" jl 0b" \ " jl 0b" \
: "=&d" (old_val), "=&d" (new_val), \ : "=&d" (old_val), "=&d" (new_val), \
"+m" (((atomic_t *)(ptr))->counter) \ "=m" (((atomic_t *)(ptr))->counter) \
: "a" (ptr), "d" (op_val) : "cc" ); \ : "a" (ptr), "d" (op_val), \
"m" (((atomic_t *)(ptr))->counter) \
: "cc", "memory" ); \
new_val; \ new_val; \
}) })
#define atomic_read(v) ((v)->counter) #define atomic_read(v) ((v)->counter)
...@@ -106,8 +109,10 @@ typedef struct { ...@@ -106,8 +109,10 @@ typedef struct {
" csg %0,%1,0(%3)\n" \ " csg %0,%1,0(%3)\n" \
" jl 0b" \ " jl 0b" \
: "=&d" (old_val), "=&d" (new_val), \ : "=&d" (old_val), "=&d" (new_val), \
"+m" (((atomic_t *)(ptr))->counter) \ "=m" (((atomic_t *)(ptr))->counter) \
: "a" (ptr), "d" (op_val) : "cc" ); \ : "a" (ptr), "d" (op_val), \
"m" (((atomic_t *)(ptr))->counter) \
: "cc", "memory" ); \
new_val; \ new_val; \
}) })
#define atomic64_read(v) ((v)->counter) #define atomic64_read(v) ((v)->counter)
...@@ -182,9 +187,9 @@ atomic_compare_and_swap(int expected_oldval,int new_val,atomic_t *v) ...@@ -182,9 +187,9 @@ atomic_compare_and_swap(int expected_oldval,int new_val,atomic_t *v)
" ipm %0\n" " ipm %0\n"
" srl %0,28\n" " srl %0,28\n"
"0:" "0:"
: "=&d" (retval), "+m" (v->counter) : "=&d" (retval), "=m" (v->counter)
: "a" (v), "d" (expected_oldval) , "d" (new_val) : "a" (v), "d" (expected_oldval) , "d" (new_val),
: "cc" ); "m" (v->counter) : "cc", "memory" );
return retval; return retval;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* *
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/compiler.h>
/* /*
* 32 bit bitops format: * 32 bit bitops format:
...@@ -109,6 +110,8 @@ extern const char _sb_findmap[]; ...@@ -109,6 +110,8 @@ extern const char _sb_findmap[];
#endif /* __s390x__ */ #endif /* __s390x__ */
#define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" )
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* /*
* SMP safe set_bit routine based on compare and swap (CS) * SMP safe set_bit routine based on compare and swap (CS)
...@@ -189,6 +192,7 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr) ...@@ -189,6 +192,7 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1)); mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */ /* Do the atomic update. */
__BITOPS_LOOP(old, new, addr, mask, __BITOPS_OR); __BITOPS_LOOP(old, new, addr, mask, __BITOPS_OR);
__BITOPS_BARRIER();
return (old & mask) != 0; return (old & mask) != 0;
} }
...@@ -211,6 +215,7 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr) ...@@ -211,6 +215,7 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
mask = ~(1UL << (nr & (__BITOPS_WORDSIZE - 1))); mask = ~(1UL << (nr & (__BITOPS_WORDSIZE - 1)));
/* Do the atomic update. */ /* Do the atomic update. */
__BITOPS_LOOP(old, new, addr, mask, __BITOPS_AND); __BITOPS_LOOP(old, new, addr, mask, __BITOPS_AND);
__BITOPS_BARRIER();
return (old ^ new) != 0; return (old ^ new) != 0;
} }
...@@ -233,6 +238,7 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr) ...@@ -233,6 +238,7 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1)); mask = 1UL << (nr & (__BITOPS_WORDSIZE - 1));
/* Do the atomic update. */ /* Do the atomic update. */
__BITOPS_LOOP(old, new, addr, mask, __BITOPS_XOR); __BITOPS_LOOP(old, new, addr, mask, __BITOPS_XOR);
__BITOPS_BARRIER();
return (old & mask) != 0; return (old & mask) != 0;
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
...@@ -435,7 +441,7 @@ test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr) ...@@ -435,7 +441,7 @@ test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr)
asm volatile("oc 0(1,%1),0(%2)" asm volatile("oc 0(1,%1),0(%2)"
: "=m" (*(char *) addr) : "=m" (*(char *) addr)
: "a" (addr), "a" (_oi_bitmap + (nr & 7)), : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
"m" (*(char *) addr) : "cc" ); "m" (*(char *) addr) : "cc", "memory" );
return (ch >> (nr & 7)) & 1; return (ch >> (nr & 7)) & 1;
} }
#define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y) #define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y)
...@@ -454,7 +460,7 @@ test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr) ...@@ -454,7 +460,7 @@ test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr)
asm volatile("nc 0(1,%1),0(%2)" asm volatile("nc 0(1,%1),0(%2)"
: "=m" (*(char *) addr) : "=m" (*(char *) addr)
: "a" (addr), "a" (_ni_bitmap + (nr & 7)), : "a" (addr), "a" (_ni_bitmap + (nr & 7)),
"m" (*(char *) addr) : "cc" ); "m" (*(char *) addr) : "cc", "memory" );
return (ch >> (nr & 7)) & 1; return (ch >> (nr & 7)) & 1;
} }
#define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y) #define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y)
...@@ -473,7 +479,7 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr) ...@@ -473,7 +479,7 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
asm volatile("xc 0(1,%1),0(%2)" asm volatile("xc 0(1,%1),0(%2)"
: "=m" (*(char *) addr) : "=m" (*(char *) addr)
: "a" (addr), "a" (_oi_bitmap + (nr & 7)), : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
"m" (*(char *) addr) : "cc" ); "m" (*(char *) addr) : "cc", "memory" );
return (ch >> (nr & 7)) & 1; return (ch >> (nr & 7)) & 1;
} }
#define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y) #define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y)
...@@ -681,59 +687,6 @@ find_next_bit (unsigned long * addr, int size, int offset) ...@@ -681,59 +687,6 @@ find_next_bit (unsigned long * addr, int size, int offset)
return (offset + res); return (offset + res);
} }
/*
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
static inline unsigned long ffz(unsigned long word)
{
unsigned long reg;
int result;
__asm__(" slr %0,%0\n"
" lhi %2,0xff\n"
" tml %1,0xffff\n"
" jno 0f\n"
" ahi %0,16\n"
" srl %1,16\n"
"0: tml %1,0x00ff\n"
" jno 1f\n"
" ahi %0,8\n"
" srl %1,8\n"
"1: nr %1,%2\n"
" ic %1,0(%1,%3)\n"
" alr %0,%1"
: "=&d" (result), "+a" (word), "=&d" (reg)
: "a" (&_zb_findmap) : "cc" );
return result;
}
/*
* __ffs = find first bit in word. Undefined if no bit exists,
* so code should check against 0UL first..
*/
static inline unsigned long __ffs (unsigned long word)
{
unsigned long reg, result;
__asm__(" slr %0,%0\n"
" lhi %2,0xff\n"
" tml %1,0xffff\n"
" jnz 0f\n"
" ahi %0,16\n"
" srl %1,16\n"
"0: tml %1,0x00ff\n"
" jnz 1f\n"
" ahi %0,8\n"
" srl %1,8\n"
"1: nr %1,%2\n"
" ic %1,0(%1,%3)\n"
" alr %0,%1"
: "=&d" (result), "+a" (word), "=&d" (reg)
: "a" (&_sb_findmap) : "cc" );
return result;
}
#else /* __s390x__ */ #else /* __s390x__ */
/* /*
...@@ -910,35 +863,31 @@ find_next_bit (unsigned long * addr, unsigned long size, unsigned long offset) ...@@ -910,35 +863,31 @@ find_next_bit (unsigned long * addr, unsigned long size, unsigned long offset)
return (offset + res); return (offset + res);
} }
#endif /* __s390x__ */
/* /*
* ffz = Find First Zero in word. Undefined if no zero exists, * ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first.. * so code should check against ~0UL first..
*/ */
static inline unsigned long ffz(unsigned long word) static inline unsigned long ffz(unsigned long word)
{ {
unsigned long reg, result; unsigned long bit = 0;
__asm__(" lhi %2,-1\n" #ifdef __s390x__
" slgr %0,%0\n" if (likely((word & 0xffffffff) == 0xffffffff)) {
" clr %1,%2\n" word >>= 32;
" jne 0f\n" bit += 32;
" aghi %0,32\n" }
" srlg %1,%1,32\n" #endif
"0: lghi %2,0xff\n" if (likely((word & 0xffff) == 0xffff)) {
" tmll %1,0xffff\n" word >>= 16;
" jno 1f\n" bit += 16;
" aghi %0,16\n" }
" srlg %1,%1,16\n" if (likely((word & 0xff) == 0xff)) {
"1: tmll %1,0x00ff\n" word >>= 8;
" jno 2f\n" bit += 8;
" aghi %0,8\n" }
" srlg %1,%1,8\n" return bit + _zb_findmap[word & 0xff];
"2: ngr %1,%2\n"
" ic %1,0(%1,%3)\n"
" algr %0,%1"
: "=&d" (result), "+a" (word), "=&d" (reg)
: "a" (&_zb_findmap) : "cc" );
return result;
} }
/* /*
...@@ -947,32 +896,25 @@ static inline unsigned long ffz(unsigned long word) ...@@ -947,32 +896,25 @@ static inline unsigned long ffz(unsigned long word)
*/ */
static inline unsigned long __ffs (unsigned long word) static inline unsigned long __ffs (unsigned long word)
{ {
unsigned long reg, result; unsigned long bit = 0;
__asm__(" slgr %0,%0\n" #ifdef __s390x__
" ltr %1,%1\n" if (likely((word & 0xffffffff) == 0)) {
" jnz 0f\n" word >>= 32;
" aghi %0,32\n" bit += 32;
" srlg %1,%1,32\n" }
"0: lghi %2,0xff\n" #endif
" tmll %1,0xffff\n" if (likely((word & 0xffff) == 0)) {
" jnz 1f\n" word >>= 16;
" aghi %0,16\n" bit += 16;
" srlg %1,%1,16\n" }
"1: tmll %1,0x00ff\n" if (likely((word & 0xff) == 0)) {
" jnz 2f\n" word >>= 8;
" aghi %0,8\n" bit += 8;
" srlg %1,%1,8\n" }
"2: ngr %1,%2\n" return bit + _sb_findmap[word & 0xff];
" ic %1,0(%1,%3)\n"
" algr %0,%1"
: "=&d" (result), "+a" (word), "=&d" (reg)
: "a" (&_sb_findmap) : "cc" );
return result;
} }
#endif /* __s390x__ */
/* /*
* Every architecture must define this function. It's the fastest * Every architecture must define this function. It's the fastest
* way of searching a 140-bit bitmap where the first 100 bits are * way of searching a 140-bit bitmap where the first 100 bits are
...@@ -989,68 +931,12 @@ static inline int sched_find_first_bit(unsigned long *b) ...@@ -989,68 +931,12 @@ static inline int sched_find_first_bit(unsigned long *b)
* the libc and compiler builtin ffs routines, therefore * the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs). * differs in spirit from the above ffz (man ffs).
*/ */
extern inline int ffs (int x) #define ffs(x) generic_ffs(x)
{
int r = 1;
if (x == 0)
return 0;
__asm__(" tml %1,0xffff\n"
" jnz 0f\n"
" srl %1,16\n"
" ahi %0,16\n"
"0: tml %1,0x00ff\n"
" jnz 1f\n"
" srl %1,8\n"
" ahi %0,8\n"
"1: tml %1,0x000f\n"
" jnz 2f\n"
" srl %1,4\n"
" ahi %0,4\n"
"2: tml %1,0x0003\n"
" jnz 3f\n"
" srl %1,2\n"
" ahi %0,2\n"
"3: tml %1,0x0001\n"
" jnz 4f\n"
" ahi %0,1\n"
"4:"
: "=&d" (r), "+d" (x) : : "cc" );
return r;
}
/* /*
* fls: find last bit set. * fls: find last bit set.
*/ */
static __inline__ int fls(int x) #define fls(x) generic_fls(x)
{
int r = 32;
if (x == 0)
return 0;
__asm__(" tmh %1,0xffff\n"
" jz 0f\n"
" sll %1,16\n"
" ahi %0,-16\n"
"0: tmh %1,0xff00\n"
" jz 1f\n"
" sll %1,8\n"
" ahi %0,-8\n"
"1: tmh %1,0xf000\n"
" jz 2f\n"
" sll %1,4\n"
" ahi %0,-4\n"
"2: tmh %1,0xc000\n"
" jz 3f\n"
" sll %1,2\n"
" ahi %0,-2\n"
"3: tmh %1,0x8000\n"
" jz 4f\n"
" ahi %0,-1\n"
"4:"
: "+d" (r), "+d" (x) : : "cc" );
return r;
}
/* /*
* hweightN: returns the hamming weight (i.e. the number * hweightN: returns the hamming weight (i.e. the number
...@@ -1273,11 +1159,16 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) ...@@ -1273,11 +1159,16 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
/* Bitmap functions for the minix filesystem. */ /* Bitmap functions for the minix filesystem. */
/* FIXME !!! */ /* FIXME !!! */
#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr) #define minix_test_and_set_bit(nr,addr) \
#define minix_set_bit(nr,addr) set_bit(nr,addr) test_and_set_bit(nr,(unsigned long *)addr)
#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr) #define minix_set_bit(nr,addr) \
#define minix_test_bit(nr,addr) test_bit(nr,addr) set_bit(nr,(unsigned long *)addr)
#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) #define minix_test_and_clear_bit(nr,addr) \
test_and_clear_bit(nr,(unsigned long *)addr)
#define minix_test_bit(nr,addr) \
test_bit(nr,(unsigned long *)addr)
#define minix_find_first_zero_bit(addr,size) \
find_first_zero_bit(addr,size)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -50,7 +50,7 @@ static __inline__ __u32 ___arch__swab32p(__u32 *x) ...@@ -50,7 +50,7 @@ static __inline__ __u32 ___arch__swab32p(__u32 *x)
" icm %0,4,2(%1)\n" " icm %0,4,2(%1)\n"
" icm %0,2,1(%1)\n" " icm %0,2,1(%1)\n"
" ic %0,0(%1)" " ic %0,0(%1)"
: "=&d" (result) : "a" (x) : "cc" ); : "=&d" (result) : "a" (x), "m" (*x) : "cc" );
#else /* __s390x__ */ #else /* __s390x__ */
" lrv %0,%1" " lrv %0,%1"
: "=d" (result) : "m" (*x) ); : "=d" (result) : "m" (*x) );
...@@ -67,7 +67,7 @@ static __inline__ __u32 ___arch__swab32(__u32 x) ...@@ -67,7 +67,7 @@ static __inline__ __u32 ___arch__swab32(__u32 x)
__asm__ __volatile__ ( __asm__ __volatile__ (
" lrvr %0,%1" " lrvr %0,%1"
: "=d" (result) : "d" (x) ); : "=d" (result) : "d" (x), "m" (x) );
return result; return result;
#endif /* __s390x__ */ #endif /* __s390x__ */
} }
...@@ -85,7 +85,7 @@ static __inline__ __u16 ___arch__swab16p(__u16 *x) ...@@ -85,7 +85,7 @@ static __inline__ __u16 ___arch__swab16p(__u16 *x)
#ifndef __s390x__ #ifndef __s390x__
" icm %0,2,1(%1)\n" " icm %0,2,1(%1)\n"
" ic %0,0(%1)\n" " ic %0,0(%1)\n"
: "=&d" (result) : "a" (x) : "cc" ); : "=&d" (result) : "a" (x), "m" (*x) : "cc" );
#else /* __s390x__ */ #else /* __s390x__ */
" lrvh %0,%1" " lrvh %0,%1"
: "=d" (result) : "m" (*x) ); : "=d" (result) : "m" (*x) );
......
...@@ -42,7 +42,7 @@ csum_partial(const unsigned char * buff, int len, unsigned int sum) ...@@ -42,7 +42,7 @@ csum_partial(const unsigned char * buff, int len, unsigned int sum)
__asm__ __volatile__ ( __asm__ __volatile__ (
"0: cksm %0,%1\n" /* do checksum on longs */ "0: cksm %0,%1\n" /* do checksum on longs */
" jo 0b\n" " jo 0b\n"
: "+&d" (sum), "+&a" (rp) : : "cc" ); : "+&d" (sum), "+&a" (rp) : : "cc", "memory" );
#else /* __s390x__ */ #else /* __s390x__ */
__asm__ __volatile__ ( __asm__ __volatile__ (
" lgr 2,%1\n" /* address in gpr 2 */ " lgr 2,%1\n" /* address in gpr 2 */
...@@ -51,7 +51,7 @@ csum_partial(const unsigned char * buff, int len, unsigned int sum) ...@@ -51,7 +51,7 @@ csum_partial(const unsigned char * buff, int len, unsigned int sum)
" jo 0b\n" " jo 0b\n"
: "+&d" (sum) : "+&d" (sum)
: "d" (buff), "d" (len) : "d" (buff), "d" (len)
: "cc", "2", "3" ); : "cc", "memory", "2", "3" );
#endif /* __s390x__ */ #endif /* __s390x__ */
return sum; return sum;
} }
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
" ahi 1,1\n" \ " ahi 1,1\n" \
"1: st 1,4+%1\n" \ "1: st 1,4+%1\n" \
" lr %0,0" \ " lr %0,0" \
: "=d" (__r), "+m" (__n) \ : "=d" (__r), "=m" (__n) \
: "d" (base) : "0", "1", "2", "cc" ); \ : "d" (base), "m" (__n) : "0", "1", "2", "cc" ); \
(n) = (__n); \ (n) = (__n); \
__r; \ __r; \
}) })
......
...@@ -553,11 +553,15 @@ ptep_clear_flush(struct vm_area_struct *vma, ...@@ -553,11 +553,15 @@ ptep_clear_flush(struct vm_area_struct *vma,
if (!(pte_val(pte) & _PAGE_INVALID)) { if (!(pte_val(pte) & _PAGE_INVALID)) {
/* S390 has 1mb segments, we are emulating 4MB segments */ /* S390 has 1mb segments, we are emulating 4MB segments */
pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00);
__asm__ __volatile__ ("ipte %0,%1" : : "a" (pto), "a" (address)); __asm__ __volatile__ ("ipte %2,%3"
: "=m" (*ptep) : "m" (*ptep),
"a" (pto), "a" (address) );
} }
#else /* __s390x__ */ #else /* __s390x__ */
if (!(pte_val(pte) & _PAGE_INVALID)) if (!(pte_val(pte) & _PAGE_INVALID))
__asm__ __volatile__ ("ipte %0,%1" : : "a" (ptep), "a" (address)); __asm__ __volatile__ ("ipte %2,%3"
: "=m" (*ptep) : "m" (*ptep),
"a" (ptep), "a" (address) );
#endif /* __s390x__ */ #endif /* __s390x__ */
pte_clear(ptep); pte_clear(ptep);
return pte; return pte;
......
...@@ -66,7 +66,7 @@ extern struct task_struct *last_task_used_math; ...@@ -66,7 +66,7 @@ extern struct task_struct *last_task_used_math;
#else /* __s390x__ */ #else /* __s390x__ */
# define TASK_SIZE (0x20000000000UL) # define TASK_SIZE (0x40000000000UL)
# define TASK31_SIZE (0x80000000UL) # define TASK31_SIZE (0x80000000UL)
# define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ # define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
(TASK31_SIZE / 2) : (TASK_SIZE / 2)) (TASK31_SIZE / 2) : (TASK_SIZE / 2))
...@@ -200,14 +200,14 @@ static inline void __load_psw_mask (unsigned long mask) ...@@ -200,14 +200,14 @@ static inline void __load_psw_mask (unsigned long mask)
" st %0,4(%1)\n" " st %0,4(%1)\n"
" lpsw 0(%1)\n" " lpsw 0(%1)\n"
"1:" "1:"
: "=&d" (addr) : "a" (&psw) : "memory", "cc" ); : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" );
#else /* __s390x__ */ #else /* __s390x__ */
asm volatile ( asm volatile (
" larl %0,1f\n" " larl %0,1f\n"
" stg %0,8(%1)\n" " stg %0,8(%1)\n"
" lpswe 0(%1)\n" " lpswe 0(%1)\n"
"1:" "1:"
: "=&d" (addr) : "a" (&psw) : "memory", "cc" ); : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" );
#endif /* __s390x__ */ #endif /* __s390x__ */
} }
...@@ -229,14 +229,16 @@ static inline void enabled_wait(void) ...@@ -229,14 +229,16 @@ static inline void enabled_wait(void)
" oi 4(%1),0x80\n" " oi 4(%1),0x80\n"
" lpsw 0(%1)\n" " lpsw 0(%1)\n"
"1:" "1:"
: "=&a" (reg) : "a" (&wait_psw) : "memory", "cc" ); : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
: "memory", "cc" );
#else /* __s390x__ */ #else /* __s390x__ */
asm volatile ( asm volatile (
" larl %0,0f\n" " larl %0,0f\n"
" stg %0,8(%1)\n" " stg %0,8(%1)\n"
" lpswe 0(%1)\n" " lpswe 0(%1)\n"
"0:" "0:"
: "=&a" (reg) : "a" (&wait_psw) : "memory", "cc" ); : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
: "memory", "cc" );
#endif /* __s390x__ */ #endif /* __s390x__ */
} }
...@@ -247,7 +249,7 @@ static inline void enabled_wait(void) ...@@ -247,7 +249,7 @@ static inline void enabled_wait(void)
static inline void disabled_wait(unsigned long code) static inline void disabled_wait(unsigned long code)
{ {
char psw_buffer[2*sizeof(psw_t)]; char psw_buffer[2*sizeof(psw_t)];
char ctl_buf[4]; unsigned long ctl_buf;
psw_t *dw_psw = (psw_t *)(((unsigned long) &psw_buffer+sizeof(psw_t)-1) psw_t *dw_psw = (psw_t *)(((unsigned long) &psw_buffer+sizeof(psw_t)-1)
& -sizeof(psw_t)); & -sizeof(psw_t));
...@@ -258,9 +260,9 @@ static inline void disabled_wait(unsigned long code) ...@@ -258,9 +260,9 @@ static inline void disabled_wait(unsigned long code)
* the processor is dead afterwards * the processor is dead afterwards
*/ */
#ifndef __s390x__ #ifndef __s390x__
asm volatile (" stctl 0,0,0(%1)\n" asm volatile (" stctl 0,0,0(%2)\n"
" ni 0(%1),0xef\n" /* switch off protection */ " ni 0(%2),0xef\n" /* switch off protection */
" lctl 0,0,0(%1)\n" " lctl 0,0,0(%2)\n"
" stpt 0xd8\n" /* store timer */ " stpt 0xd8\n" /* store timer */
" stckc 0xe0\n" /* store clock comparator */ " stckc 0xe0\n" /* store clock comparator */
" stpx 0x108\n" /* store prefix register */ " stpx 0x108\n" /* store prefix register */
...@@ -271,13 +273,14 @@ static inline void disabled_wait(unsigned long code) ...@@ -271,13 +273,14 @@ static inline void disabled_wait(unsigned long code)
" std 6,0x178\n" /* store f6 */ " std 6,0x178\n" /* store f6 */
" stm 0,15,0x180\n" /* store general registers */ " stm 0,15,0x180\n" /* store general registers */
" stctl 0,15,0x1c0\n" /* store control registers */ " stctl 0,15,0x1c0\n" /* store control registers */
" oi 0(%1),0x10\n" /* fake protection bit */ " oi 0x1c0,0x10\n" /* fake protection bit */
" lpsw 0(%0)" " lpsw 0(%1)"
: : "a" (dw_psw), "a" (&ctl_buf) : "cc" ); : "=m" (ctl_buf)
: "a" (dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" );
#else /* __s390x__ */ #else /* __s390x__ */
asm volatile (" stctg 0,0,0(%1)\n" asm volatile (" stctg 0,0,0(%2)\n"
" ni 4(%1),0xef\n" /* switch off protection */ " ni 4(%2),0xef\n" /* switch off protection */
" lctlg 0,0,0(%1)\n" " lctlg 0,0,0(%2)\n"
" lghi 1,0x1000\n" " lghi 1,0x1000\n"
" stpt 0x328(1)\n" /* store timer */ " stpt 0x328(1)\n" /* store timer */
" stckc 0x330(1)\n" /* store clock comparator */ " stckc 0x330(1)\n" /* store clock comparator */
...@@ -303,8 +306,10 @@ static inline void disabled_wait(unsigned long code) ...@@ -303,8 +306,10 @@ static inline void disabled_wait(unsigned long code)
" stmg 0,15,0x280(1)\n" /* store general registers */ " stmg 0,15,0x280(1)\n" /* store general registers */
" stctg 0,15,0x380(1)\n" /* store control registers */ " stctg 0,15,0x380(1)\n" /* store control registers */
" oi 0x384(1),0x10\n" /* fake protection bit */ " oi 0x384(1),0x10\n" /* fake protection bit */
" lpswe 0(%0)" " lpswe 0(%1)"
: : "a" (dw_psw), "a" (&ctl_buf) : "cc", "0", "1"); : "=m" (ctl_buf)
: "a" (dw_psw), "a" (&ctl_buf),
"m" (dw_psw) : "cc", "0", "1");
#endif /* __s390x__ */ #endif /* __s390x__ */
} }
......
...@@ -102,21 +102,21 @@ static inline void __down_read(struct rw_semaphore *sem) ...@@ -102,21 +102,21 @@ static inline void __down_read(struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" ahi %1,%3\n" " ahi %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" aghi %1,%3\n" " aghi %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) : "a" (&sem->count), "m" (sem->count),
: "cc", "memory" ); "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" );
if (old < 0) if (old < 0)
rwsem_down_read_failed(sem); rwsem_down_read_failed(sem);
} }
...@@ -130,25 +130,25 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) ...@@ -130,25 +130,25 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: ltr %1,%0\n" "0: ltr %1,%0\n"
" jm 1f\n" " jm 1f\n"
" ahi %1,%3\n" " ahi %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b\n" " jl 0b\n"
"1:" "1:"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: ltgr %1,%0\n" "0: ltgr %1,%0\n"
" jm 1f\n" " jm 1f\n"
" aghi %1,%3\n" " aghi %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b\n" " jl 0b\n"
"1:" "1:"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) : "a" (&sem->count), "m" (sem->count),
: "cc", "memory" ); "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" );
return old >= 0 ? 1 : 0; return old >= 0 ? 1 : 0;
} }
...@@ -162,20 +162,20 @@ static inline void __down_write(struct rw_semaphore *sem) ...@@ -162,20 +162,20 @@ static inline void __down_write(struct rw_semaphore *sem)
tmp = RWSEM_ACTIVE_WRITE_BIAS; tmp = RWSEM_ACTIVE_WRITE_BIAS;
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" a %1,%3\n" " a %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" ag %1,%3\n" " ag %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "m" (tmp) : "a" (&sem->count), "m" (sem->count), "m" (tmp)
: "cc", "memory" ); : "cc", "memory" );
if (old != 0) if (old != 0)
rwsem_down_write_failed(sem); rwsem_down_write_failed(sem);
...@@ -190,22 +190,22 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) ...@@ -190,22 +190,22 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%1)\n" " l %0,0(%2)\n"
"0: ltr %0,%0\n" "0: ltr %0,%0\n"
" jnz 1f\n" " jnz 1f\n"
" cs %0,%2,0(%1)\n" " cs %0,%4,0(%2)\n"
" jl 0b\n" " jl 0b\n"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%1)\n" " lg %0,0(%2)\n"
"0: ltgr %0,%0\n" "0: ltgr %0,%0\n"
" jnz 1f\n" " jnz 1f\n"
" csg %0,%2,0(%1)\n" " csg %0,%4,0(%2)\n"
" jl 0b\n" " jl 0b\n"
#endif /* __s390x__ */ #endif /* __s390x__ */
"1:" "1:"
: "=&d" (old) : "=&d" (old), "=m" (sem->count)
: "a" (&sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS) : "a" (&sem->count), "m" (sem->count),
: "cc", "memory" ); "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory" );
return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0; return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0;
} }
...@@ -218,20 +218,21 @@ static inline void __up_read(struct rw_semaphore *sem) ...@@ -218,20 +218,21 @@ static inline void __up_read(struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" ahi %1,%3\n" " ahi %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" aghi %1,%3\n" " aghi %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS) : "a" (&sem->count), "m" (sem->count),
"i" (-RWSEM_ACTIVE_READ_BIAS)
: "cc", "memory" ); : "cc", "memory" );
if (new < 0) if (new < 0)
if ((new & RWSEM_ACTIVE_MASK) == 0) if ((new & RWSEM_ACTIVE_MASK) == 0)
...@@ -248,20 +249,20 @@ static inline void __up_write(struct rw_semaphore *sem) ...@@ -248,20 +249,20 @@ static inline void __up_write(struct rw_semaphore *sem)
tmp = -RWSEM_ACTIVE_WRITE_BIAS; tmp = -RWSEM_ACTIVE_WRITE_BIAS;
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" a %1,%3\n" " a %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" ag %1,%3\n" " ag %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "m" (tmp) : "a" (&sem->count), "m" (sem->count), "m" (tmp)
: "cc", "memory" ); : "cc", "memory" );
if (new < 0) if (new < 0)
if ((new & RWSEM_ACTIVE_MASK) == 0) if ((new & RWSEM_ACTIVE_MASK) == 0)
...@@ -278,20 +279,20 @@ static inline void __downgrade_write(struct rw_semaphore *sem) ...@@ -278,20 +279,20 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
tmp = -RWSEM_WAITING_BIAS; tmp = -RWSEM_WAITING_BIAS;
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" a %1,%3\n" " a %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" ag %1,%3\n" " ag %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "m" (tmp) : "a" (&sem->count), "m" (sem->count), "m" (tmp)
: "cc", "memory" ); : "cc", "memory" );
if (new > 1) if (new > 1)
rwsem_downgrade_wake(sem); rwsem_downgrade_wake(sem);
...@@ -306,20 +307,20 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) ...@@ -306,20 +307,20 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" ar %1,%3\n" " ar %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" agr %1,%3\n" " agr %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "d" (delta) : "a" (&sem->count), "m" (sem->count), "d" (delta)
: "cc", "memory" ); : "cc", "memory" );
} }
...@@ -332,20 +333,20 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) ...@@ -332,20 +333,20 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
__asm__ __volatile__( __asm__ __volatile__(
#ifndef __s390x__ #ifndef __s390x__
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: lr %1,%0\n" "0: lr %1,%0\n"
" ar %1,%3\n" " ar %1,%5\n"
" cs %0,%1,0(%2)\n" " cs %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#else /* __s390x__ */ #else /* __s390x__ */
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: lgr %1,%0\n" "0: lgr %1,%0\n"
" agr %1,%3\n" " agr %1,%5\n"
" csg %0,%1,0(%2)\n" " csg %0,%1,0(%3)\n"
" jl 0b" " jl 0b"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (old), "=&d" (new) : "=&d" (old), "=&d" (new), "=m" (sem->count)
: "a" (&sem->count), "d" (delta) : "a" (&sem->count), "m" (sem->count), "d" (delta)
: "cc", "memory" ); : "cc", "memory" );
return new; return new;
} }
......
...@@ -95,9 +95,9 @@ static inline int down_trylock(struct semaphore * sem) ...@@ -95,9 +95,9 @@ static inline int down_trylock(struct semaphore * sem)
" cs %0,%1,0(%3)\n" " cs %0,%1,0(%3)\n"
" jl 0b\n" " jl 0b\n"
"1:" "1:"
: "=&d" (old_val), "=&d" (new_val), : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter)
"+m" (sem->count.counter) : "a" (&sem->count.counter), "m" (sem->count.counter)
: "a" (&sem->count.counter) : "cc" ); : "cc", "memory" );
return old_val <= 0; return old_val <= 0;
} }
......
...@@ -57,8 +57,9 @@ extern inline void _raw_spin_lock(spinlock_t *lp) ...@@ -57,8 +57,9 @@ extern inline void _raw_spin_lock(spinlock_t *lp)
"1: slr %1,%1\n" "1: slr %1,%1\n"
" cs %1,%0,0(%3)\n" " cs %1,%0,0(%3)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (reg1), "=&d" (reg2), "+m" (lp->lock) : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
: "a" (&lp->lock) : "cc" ); : "a" (&lp->lock), "m" (lp->lock)
: "cc", "memory" );
#else /* __s390x__ */ #else /* __s390x__ */
unsigned long reg1, reg2; unsigned long reg1, reg2;
__asm__ __volatile(" bras %1,1f\n" __asm__ __volatile(" bras %1,1f\n"
...@@ -66,9 +67,9 @@ extern inline void _raw_spin_lock(spinlock_t *lp) ...@@ -66,9 +67,9 @@ extern inline void _raw_spin_lock(spinlock_t *lp)
"1: slr %0,%0\n" "1: slr %0,%0\n"
" cs %0,%1,0(%3)\n" " cs %0,%1,0(%3)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (reg1), "=&d" (reg2), "+m" (lp->lock) : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
: "a" (&lp->lock), "i" (__DIAG44_OPERAND) : "a" (&lp->lock), "i" (__DIAG44_OPERAND),
: "cc" ); "m" (lp->lock) : "cc", "memory" );
#endif /* __s390x__ */ #endif /* __s390x__ */
} }
...@@ -82,8 +83,9 @@ extern inline int _raw_spin_trylock(spinlock_t *lp) ...@@ -82,8 +83,9 @@ extern inline int _raw_spin_trylock(spinlock_t *lp)
__asm__ __volatile(" slr %0,%0\n" __asm__ __volatile(" slr %0,%0\n"
" basr %1,0\n" " basr %1,0\n"
"0: cs %0,%1,0(%3)" "0: cs %0,%1,0(%3)"
: "=&d" (result), "=&d" (reg), "+m" (lp->lock) : "=&d" (result), "=&d" (reg), "=m" (lp->lock)
: "a" (&lp->lock) : "cc" ); : "a" (&lp->lock), "m" (lp->lock)
: "cc", "memory" );
return !result; return !result;
} }
...@@ -93,7 +95,8 @@ extern inline void _raw_spin_unlock(spinlock_t *lp) ...@@ -93,7 +95,8 @@ extern inline void _raw_spin_unlock(spinlock_t *lp)
__asm__ __volatile("cs %0,%3,0(%4)" __asm__ __volatile("cs %0,%3,0(%4)"
: "=d" (old), "=m" (lp->lock) : "=d" (old), "=m" (lp->lock)
: "0" (lp->lock), "d" (0), "a" (lp) : "cc" ); : "0" (lp->lock), "d" (0), "a" (lp)
: "cc", "memory" );
} }
/* /*
...@@ -126,8 +129,8 @@ typedef struct { ...@@ -126,8 +129,8 @@ typedef struct {
" la 3,1(2)\n" /* one more reader */ \ " la 3,1(2)\n" /* one more reader */ \
" cs 2,3,0(%1)\n" /* try to write new value */ \ " cs 2,3,0(%1)\n" /* try to write new value */ \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) : "a" (&(rw)->lock) \ : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#else /* __s390x__ */ #else /* __s390x__ */
#define _raw_read_lock(rw) \ #define _raw_read_lock(rw) \
asm volatile(" lg 2,0(%1)\n" \ asm volatile(" lg 2,0(%1)\n" \
...@@ -137,9 +140,9 @@ typedef struct { ...@@ -137,9 +140,9 @@ typedef struct {
" la 3,1(2)\n" /* one more reader */ \ " la 3,1(2)\n" /* one more reader */ \
" csg 2,3,0(%1)\n" /* try to write new value */ \ " csg 2,3,0(%1)\n" /* try to write new value */ \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) \ : "=m" ((rw)->lock) \
: "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \ : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#endif /* __s390x__ */ #endif /* __s390x__ */
#ifndef __s390x__ #ifndef __s390x__
...@@ -151,8 +154,8 @@ typedef struct { ...@@ -151,8 +154,8 @@ typedef struct {
" ahi 3,-1\n" /* one less reader */ \ " ahi 3,-1\n" /* one less reader */ \
" cs 2,3,0(%1)\n" \ " cs 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) : "a" (&(rw)->lock) \ : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#else /* __s390x__ */ #else /* __s390x__ */
#define _raw_read_unlock(rw) \ #define _raw_read_unlock(rw) \
asm volatile(" lg 2,0(%1)\n" \ asm volatile(" lg 2,0(%1)\n" \
...@@ -162,9 +165,9 @@ typedef struct { ...@@ -162,9 +165,9 @@ typedef struct {
" bctgr 3,0\n" /* one less reader */ \ " bctgr 3,0\n" /* one less reader */ \
" csg 2,3,0(%1)\n" \ " csg 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) \ : "=m" ((rw)->lock) \
: "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \ : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#endif /* __s390x__ */ #endif /* __s390x__ */
#ifndef __s390x__ #ifndef __s390x__
...@@ -176,8 +179,8 @@ typedef struct { ...@@ -176,8 +179,8 @@ typedef struct {
"1: slr 2,2\n" /* old lock value must be 0 */ \ "1: slr 2,2\n" /* old lock value must be 0 */ \
" cs 2,3,0(%1)\n" \ " cs 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) : "a" (&(rw)->lock) \ : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#else /* __s390x__ */ #else /* __s390x__ */
#define _raw_write_lock(rw) \ #define _raw_write_lock(rw) \
asm volatile(" llihh 3,0x8000\n" /* new lock value = 0x80...0 */ \ asm volatile(" llihh 3,0x8000\n" /* new lock value = 0x80...0 */ \
...@@ -186,9 +189,9 @@ typedef struct { ...@@ -186,9 +189,9 @@ typedef struct {
"1: slgr 2,2\n" /* old lock value must be 0 */ \ "1: slgr 2,2\n" /* old lock value must be 0 */ \
" csg 2,3,0(%1)\n" \ " csg 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) \ : "=m" ((rw)->lock) \
: "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \ : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#endif /* __s390x__ */ #endif /* __s390x__ */
#ifndef __s390x__ #ifndef __s390x__
...@@ -200,8 +203,8 @@ typedef struct { ...@@ -200,8 +203,8 @@ typedef struct {
" sll 2,31\n" /* old lock value must be 0x80000000 */ \ " sll 2,31\n" /* old lock value must be 0x80000000 */ \
" cs 2,3,0(%1)\n" \ " cs 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) : "a" (&(rw)->lock) \ : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#else /* __s390x__ */ #else /* __s390x__ */
#define _raw_write_unlock(rw) \ #define _raw_write_unlock(rw) \
asm volatile(" slgr 3,3\n" /* new lock value = 0 */ \ asm volatile(" slgr 3,3\n" /* new lock value = 0 */ \
...@@ -210,9 +213,9 @@ typedef struct { ...@@ -210,9 +213,9 @@ typedef struct {
"1: llihh 2,0x8000\n" /* old lock value must be 0x8..0 */\ "1: llihh 2,0x8000\n" /* old lock value must be 0x8..0 */\
" csg 2,3,0(%1)\n" \ " csg 2,3,0(%1)\n" \
" jl 0b" \ " jl 0b" \
: "+m" ((rw)->lock) \ : "=m" ((rw)->lock) \
: "a" (&(rw)->lock), "i" (__DIAG44_OPERAND) \ : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
: "2", "3", "cc" ) "m" ((rw)->lock) : "2", "3", "cc", "memory" )
#endif /* __s390x__ */ #endif /* __s390x__ */
extern inline int _raw_write_trylock(rwlock_t *rw) extern inline int _raw_write_trylock(rwlock_t *rw)
...@@ -230,8 +233,9 @@ extern inline int _raw_write_trylock(rwlock_t *rw) ...@@ -230,8 +233,9 @@ extern inline int _raw_write_trylock(rwlock_t *rw)
" llihh %1,0x8000\n" " llihh %1,0x8000\n"
"0: csg %0,%1,0(%3)\n" "0: csg %0,%1,0(%3)\n"
#endif /* __s390x__ */ #endif /* __s390x__ */
: "=&d" (result), "=&d" (reg), "+m" (rw->lock) : "=&d" (result), "=&d" (reg), "=m" (rw->lock)
: "a" (&rw->lock) : "cc" ); : "a" (&rw->lock), "m" (rw->lock)
: "cc", "memory" );
return result == 0; return result == 0;
} }
......
...@@ -32,28 +32,28 @@ extern struct task_struct *__switch_to(void *, void *); ...@@ -32,28 +32,28 @@ extern struct task_struct *__switch_to(void *, void *);
static inline void save_fp_regs(s390_fp_regs *fpregs) static inline void save_fp_regs(s390_fp_regs *fpregs)
{ {
asm volatile ( asm volatile (
" std 0,8(%0)\n" " std 0,8(%1)\n"
" std 2,24(%0)\n" " std 2,24(%1)\n"
" std 4,40(%0)\n" " std 4,40(%1)\n"
" std 6,56(%0)" " std 6,56(%1)"
: : "a" (fpregs) : "memory" ); : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" );
if (!MACHINE_HAS_IEEE) if (!MACHINE_HAS_IEEE)
return; return;
asm volatile( asm volatile(
" stfpc 0(%0)\n" " stfpc 0(%1)\n"
" std 1,16(%0)\n" " std 1,16(%1)\n"
" std 3,32(%0)\n" " std 3,32(%1)\n"
" std 5,48(%0)\n" " std 5,48(%1)\n"
" std 7,64(%0)\n" " std 7,64(%1)\n"
" std 8,72(%0)\n" " std 8,72(%1)\n"
" std 9,80(%0)\n" " std 9,80(%1)\n"
" std 10,88(%0)\n" " std 10,88(%1)\n"
" std 11,96(%0)\n" " std 11,96(%1)\n"
" std 12,104(%0)\n" " std 12,104(%1)\n"
" std 13,112(%0)\n" " std 13,112(%1)\n"
" std 14,120(%0)\n" " std 14,120(%1)\n"
" std 15,128(%0)\n" " std 15,128(%1)\n"
: : "a" (fpregs) : "memory" ); : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" );
} }
static inline void restore_fp_regs(s390_fp_regs *fpregs) static inline void restore_fp_regs(s390_fp_regs *fpregs)
...@@ -63,7 +63,7 @@ static inline void restore_fp_regs(s390_fp_regs *fpregs) ...@@ -63,7 +63,7 @@ static inline void restore_fp_regs(s390_fp_regs *fpregs)
" ld 2,24(%0)\n" " ld 2,24(%0)\n"
" ld 4,40(%0)\n" " ld 4,40(%0)\n"
" ld 6,56(%0)" " ld 6,56(%0)"
: : "a" (fpregs)); : : "a" (fpregs), "m" (*fpregs) );
if (!MACHINE_HAS_IEEE) if (!MACHINE_HAS_IEEE)
return; return;
asm volatile( asm volatile(
...@@ -80,7 +80,7 @@ static inline void restore_fp_regs(s390_fp_regs *fpregs) ...@@ -80,7 +80,7 @@ static inline void restore_fp_regs(s390_fp_regs *fpregs)
" ld 13,112(%0)\n" " ld 13,112(%0)\n"
" ld 14,120(%0)\n" " ld 14,120(%0)\n"
" ld 15,128(%0)\n" " ld 15,128(%0)\n"
: : "a" (fpregs)); : : "a" (fpregs), "m" (*fpregs) );
} }
#define switch_to(prev,next,last) do { \ #define switch_to(prev,next,last) do { \
...@@ -107,15 +107,15 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size) ...@@ -107,15 +107,15 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
shift = (3 ^ (addr & 3)) << 3; shift = (3 ^ (addr & 3)) << 3;
addr ^= addr & 3; addr ^= addr & 3;
asm volatile( asm volatile(
" l %0,0(%3)\n" " l %0,0(%4)\n"
"0: lr 0,%0\n" "0: lr 0,%0\n"
" nr 0,%2\n" " nr 0,%3\n"
" or 0,%1\n" " or 0,%2\n"
" cs %0,0,0(%3)\n" " cs %0,0,0(%4)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (old) : "=&d" (old), "=m" (*(int *) addr)
: "d" (x << shift), "d" (~(255 << shift)), "a" (addr) : "d" (x << shift), "d" (~(255 << shift)), "a" (addr),
: "memory", "cc", "0" ); "m" (*(int *) addr) : "memory", "cc", "0" );
x = old >> shift; x = old >> shift;
break; break;
case 2: case 2:
...@@ -123,34 +123,36 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size) ...@@ -123,34 +123,36 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
shift = (2 ^ (addr & 2)) << 3; shift = (2 ^ (addr & 2)) << 3;
addr ^= addr & 2; addr ^= addr & 2;
asm volatile( asm volatile(
" l %0,0(%3)\n" " l %0,0(%4)\n"
"0: lr 0,%0\n" "0: lr 0,%0\n"
" nr 0,%2\n" " nr 0,%3\n"
" or 0,%1\n" " or 0,%2\n"
" cs %0,0,0(%3)\n" " cs %0,0,0(%4)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (old) : "=&d" (old), "=m" (*(int *) addr)
: "d" (x << shift), "d" (~(65535 << shift)), "a" (addr) : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr),
: "memory", "cc", "0" ); "m" (*(int *) addr) : "memory", "cc", "0" );
x = old >> shift; x = old >> shift;
break; break;
case 4: case 4:
asm volatile ( asm volatile (
" l %0,0(%2)\n" " l %0,0(%3)\n"
"0: cs %0,%1,0(%2)\n" "0: cs %0,%2,0(%3)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (old) : "d" (x), "a" (ptr) : "=&d" (old), "=m" (*(int *) ptr)
: "memory", "cc", "0" ); : "d" (x), "a" (ptr), "m" (*(int *) ptr)
: "memory", "cc" );
x = old; x = old;
break; break;
#ifdef __s390x__ #ifdef __s390x__
case 8: case 8:
asm volatile ( asm volatile (
" lg %0,0(%2)\n" " lg %0,0(%3)\n"
"0: csg %0,%1,0(%2)\n" "0: csg %0,%2,0(%3)\n"
" jl 0b\n" " jl 0b\n"
: "=&d" (old) : "d" (x), "a" (ptr) : "=&d" (old), "=m" (*(long *) ptr)
: "memory", "cc", "0" ); : "d" (x), "a" (ptr), "m" (*(long *) ptr)
: "memory", "cc" );
x = old; x = old;
break; break;
#endif /* __s390x__ */ #endif /* __s390x__ */
...@@ -268,7 +270,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) ...@@ -268,7 +270,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
#define local_irq_enable() ({ \ #define local_irq_enable() ({ \
unsigned long __dummy; \ unsigned long __dummy; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"stosm 0(%1),0x03" : "=m" (__dummy) : "a" (&__dummy) ); \ "stosm 0(%1),0x03" \
: "=m" (__dummy) : "a" (&__dummy) : "memory" ); \
}) })
#define local_irq_disable() ({ \ #define local_irq_disable() ({ \
...@@ -279,10 +282,10 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) ...@@ -279,10 +282,10 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
}) })
#define local_save_flags(x) \ #define local_save_flags(x) \
__asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x) ) __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) )
#define local_irq_restore(x) \ #define local_irq_restore(x) \
__asm__ __volatile__("ssm 0(%0)" : : "a" (&x) : "memory") __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory")
#define irqs_disabled() \ #define irqs_disabled() \
({ \ ({ \
...@@ -294,7 +297,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) ...@@ -294,7 +297,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
#ifdef __s390x__ #ifdef __s390x__
#define __load_psw(psw) \ #define __load_psw(psw) \
__asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw) : "cc" ); __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
#define __ctl_load(array, low, high) ({ \ #define __ctl_load(array, low, high) ({ \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
......
...@@ -25,7 +25,7 @@ static inline cycles_t get_cycles(void) ...@@ -25,7 +25,7 @@ static inline cycles_t get_cycles(void)
{ {
cycles_t cycles; cycles_t cycles;
__asm__("stck 0(%0)" : : "a" (&(cycles)) : "memory", "cc"); __asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
return cycles >> 2; return cycles >> 2;
} }
...@@ -33,7 +33,7 @@ static inline unsigned long long get_clock (void) ...@@ -33,7 +33,7 @@ static inline unsigned long long get_clock (void)
{ {
unsigned long long clk; unsigned long long clk;
__asm__("stck 0(%0)" : : "a" (&(clk)) : "memory", "cc"); __asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
return clk; return clk;
} }
......
...@@ -85,7 +85,7 @@ static inline void global_flush_tlb(void) ...@@ -85,7 +85,7 @@ static inline void global_flush_tlb(void)
" slr 2,2\n" " slr 2,2\n"
" slr 3,3\n" " slr 3,3\n"
" csp 2,%0" " csp 2,%0"
: : "a" (addr) : "cc", "2", "3" ); : : "a" (addr), "m" (dummy) : "cc", "2", "3" );
} }
} }
......
...@@ -124,8 +124,8 @@ struct exception_table_entry ...@@ -124,8 +124,8 @@ struct exception_table_entry
"1:\n" \ "1:\n" \
__uaccess_fixup \ __uaccess_fixup \
: "=&d" (err) \ : "=&d" (err) \
: "a" (__to),"a" (__from),"K" (-EFAULT),"0" (0) \ : "a" (__to),"a" (__from),"K" (-EFAULT),"0" (0),\
: "cc" ); \ "m" (x) : "cc" ); \
}) })
#else /* __s390x__ */ #else /* __s390x__ */
......
...@@ -133,8 +133,14 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver); ...@@ -133,8 +133,14 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
*/ */
struct device_node; struct device_node;
extern void proc_device_tree_init(void); extern void proc_device_tree_init(void);
#ifdef CONFIG_PROC_DEVICETREE
extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
#else /* !CONFIG_PROC_DEVICETREE */
static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde)
{
return;
}
#endif /* CONFIG_PROC_DEVICETREE */
/* /*
* proc_rtas.c * proc_rtas.c
*/ */
......
...@@ -403,6 +403,8 @@ void put_files_struct(struct files_struct *files) ...@@ -403,6 +403,8 @@ void put_files_struct(struct files_struct *files)
} }
} }
EXPORT_SYMBOL(put_files_struct);
static inline void __exit_files(struct task_struct *tsk) static inline void __exit_files(struct task_struct *tsk)
{ {
struct files_struct * files = tsk->files; struct files_struct * files = tsk->files;
......
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