Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
cf3f977a
Commit
cf3f977a
authored
Dec 30, 2003
by
Ben Collins
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux.bkbits.net/linux-2.5
into debian.org:/usr/src/kernel/linux-2.6
parents
443473ed
313c01d3
Changes
40
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
2094 additions
and
2907 deletions
+2094
-2907
arch/parisc/Kconfig
arch/parisc/Kconfig
+1
-42
arch/parisc/configs/712_defconfig
arch/parisc/configs/712_defconfig
+637
-0
arch/parisc/defconfig
arch/parisc/defconfig
+291
-161
arch/parisc/kernel/Makefile
arch/parisc/kernel/Makefile
+1
-0
arch/parisc/kernel/cache.c
arch/parisc/kernel/cache.c
+6
-1
arch/parisc/kernel/drivers.c
arch/parisc/kernel/drivers.c
+3
-3
arch/parisc/kernel/entry.S
arch/parisc/kernel/entry.S
+4
-4
arch/parisc/kernel/firmware.c
arch/parisc/kernel/firmware.c
+30
-34
arch/parisc/kernel/hardware.c
arch/parisc/kernel/hardware.c
+2
-0
arch/parisc/kernel/head.S
arch/parisc/kernel/head.S
+4
-4
arch/parisc/kernel/head64.S
arch/parisc/kernel/head64.S
+4
-4
arch/parisc/kernel/inventory.c
arch/parisc/kernel/inventory.c
+6
-1
arch/parisc/kernel/ioctl32.c
arch/parisc/kernel/ioctl32.c
+11
-2022
arch/parisc/kernel/pacache.S
arch/parisc/kernel/pacache.S
+16
-16
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/kernel/parisc_ksyms.c
+0
-13
arch/parisc/kernel/pdc_chassis.c
arch/parisc/kernel/pdc_chassis.c
+33
-12
arch/parisc/kernel/pdc_cons.c
arch/parisc/kernel/pdc_cons.c
+1
-11
arch/parisc/kernel/process.c
arch/parisc/kernel/process.c
+1
-0
arch/parisc/kernel/processor.c
arch/parisc/kernel/processor.c
+10
-10
arch/parisc/kernel/real2.S
arch/parisc/kernel/real2.S
+8
-8
arch/parisc/kernel/signal.c
arch/parisc/kernel/signal.c
+218
-126
arch/parisc/kernel/signal32.c
arch/parisc/kernel/signal32.c
+234
-13
arch/parisc/kernel/signal32.h
arch/parisc/kernel/signal32.h
+25
-0
arch/parisc/kernel/smp.c
arch/parisc/kernel/smp.c
+4
-2
arch/parisc/kernel/sys_parisc.c
arch/parisc/kernel/sys_parisc.c
+0
-102
arch/parisc/kernel/sys_parisc32.c
arch/parisc/kernel/sys_parisc32.c
+1
-3
arch/parisc/kernel/syscall_table.S
arch/parisc/kernel/syscall_table.S
+4
-4
arch/parisc/kernel/time.c
arch/parisc/kernel/time.c
+0
-1
arch/parisc/kernel/traps.c
arch/parisc/kernel/traps.c
+45
-11
arch/parisc/kernel/unaligned.c
arch/parisc/kernel/unaligned.c
+215
-133
arch/parisc/lib/lusercopy.S
arch/parisc/lib/lusercopy.S
+37
-0
drivers/parisc/Kconfig
drivers/parisc/Kconfig
+15
-2
drivers/parisc/ccio-dma.c
drivers/parisc/ccio-dma.c
+79
-87
drivers/parisc/dino.c
drivers/parisc/dino.c
+101
-14
drivers/parisc/led.c
drivers/parisc/led.c
+0
-1
drivers/parisc/superio.c
drivers/parisc/superio.c
+26
-40
include/asm-parisc/dma-mapping.h
include/asm-parisc/dma-mapping.h
+4
-8
include/asm-parisc/uaccess.h
include/asm-parisc/uaccess.h
+12
-9
include/asm-parisc/ucontext.h
include/asm-parisc/ucontext.h
+4
-4
include/asm-parisc/unistd.h
include/asm-parisc/unistd.h
+1
-1
No files found.
arch/parisc/Kconfig
View file @
cf3f977a
...
...
@@ -169,51 +169,10 @@ source "fs/Kconfig.binfmt"
endmenu
source "drivers/base/Kconfig"
# source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig"
# source "drivers/pnp/Kconfig"
source "drivers/block/Kconfig"
source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
source "drivers/md/Kconfig"
source drivers/message/fusion/Kconfig
#source drivers/ieee1394/Kconfig
#source drivers/message/i2o/Kconfig
source "net/Kconfig"
#source "drivers/isdn/Kconfig"
#source "drivers/telephony/Kconfig"
# input before char - char/joystick depends on it. As does USB.
source "drivers/input/Kconfig"
source "drivers/char/Kconfig"
#source "drivers/misc/Kconfig"
source "drivers/media/Kconfig"
source "drivers/Kconfig"
source "fs/Kconfig"
source "drivers/video/Kconfig"
source "sound/Kconfig"
source "drivers/usb/Kconfig"
source "arch/parisc/oprofile/Kconfig"
menu "Kernel hacking"
...
...
arch/parisc/configs/712_defconfig
0 → 100644
View file @
cf3f977a
#
# Automatically generated make config: don't edit
#
CONFIG_PARISC=y
CONFIG_MMU=y
CONFIG_STACK_GROWSUP=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
#
# Code maturity level options
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
CONFIG_BROKEN_ON_SMP=y
#
# General setup
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=15
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_KMOD is not set
#
# Processor type and features
#
# CONFIG_PA7000 is not set
CONFIG_PA7100LC=y
# CONFIG_PA7200 is not set
# CONFIG_PA8X00 is not set
CONFIG_PA11=y
# CONFIG_64BIT is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_HPUX is not set
#
# Bus options (PCI, PCMCIA, EISA, GSC, ISA)
#
CONFIG_GSC=y
# CONFIG_HPPB is not set
# CONFIG_IOMMU_CCIO is not set
CONFIG_GSC_LASI=y
CONFIG_GSC_WAX=y
# CONFIG_EISA is not set
# CONFIG_PCI is not set
# CONFIG_CHASSIS_LCD_LED is not set
# CONFIG_PDC_CHASSIS is not set
# CONFIG_HOTPLUG is not set
#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
#
# Device Drivers
#
#
# Generic Driver Options
#
#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set
#
# Parallel port support
#
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
CONFIG_PARPORT_PC_CML1=y
# CONFIG_PARPORT_SERIAL is not set
CONFIG_PARPORT_GSC=y
# CONFIG_PARPORT_OTHER is not set
# CONFIG_PARPORT_1284 is not set
#
# Plug and Play support
#
# CONFIG_PNP is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_PARIDE is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=y
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set
#
# SCSI device support
#
CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CHR_DEV_SG=y
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_REPORT_LUNS is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
#
# SCSI low-level drivers
#
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
CONFIG_SCSI_LASI700=y
CONFIG_53C700_MEM_MAPPED=y
CONFIG_53C700_LE_ON_BE=y
# CONFIG_SCSI_ZALON is not set
# CONFIG_SCSI_DEBUG is not set
#
# Multi-device support (RAID and LVM)
#
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=y
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
CONFIG_MD_RAID5=y
# CONFIG_MD_MULTIPATH is not set
# CONFIG_BLK_DEV_DM is not set
#
# Fusion MPT device support
#
# CONFIG_FUSION is not set
#
# I2O device support
#
#
# Networking support
#
CONFIG_NET=y
#
# Networking options
#
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_NETLINK_DEV=y
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_MROUTE is not set
CONFIG_INET_ECN=y
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
CONFIG_LASI_82596=y
#
# Ethernet (1000 Mbit)
#
#
# Ethernet (10000 Mbit)
#
# CONFIG_PLIP is not set
CONFIG_PPP=y
# CONFIG_PPP_FILTER is not set
# CONFIG_PPP_ASYNC is not set
# CONFIG_PPP_SYNC_TTY is not set
# CONFIG_PPP_DEFLATE is not set
# CONFIG_PPP_BSDCOMP is not set
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
CONFIG_NET_RADIO=y
#
# Obsolete Wireless cards support (pre-802.11)
#
# CONFIG_STRIP is not set
#
# Token Ring devices
#
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set
#
# Telephony Support
#
# CONFIG_PHONE is not set
#
# Input device support
#
CONFIG_INPUT=y
#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_HP_SDC is not set
#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ATKBD is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_HIL_OLD is not set
CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_UINPUT is not set
CONFIG_INPUT_GSC=y
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_MULTIPORT is not set
# CONFIG_SERIAL_8250_RSA is not set
#
# Non-8250 serial port support
#
# CONFIG_SERIAL_MUX is not set
# CONFIG_PDC_CONSOLE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
CONFIG_PRINTER=y
# CONFIG_LP_CONSOLE is not set
# CONFIG_PPDEV is not set
# CONFIG_TIPAR is not set
#
# I2C support
#
# CONFIG_I2C is not set
#
# I2C Algorithms
#
#
# I2C Hardware Bus support
#
#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set
#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set
#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
CONFIG_GEN_RTC=y
# CONFIG_GEN_RTC_X is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set
#
# Graphics support
#
CONFIG_FB=y
CONFIG_FB_STI=y
# CONFIG_FB_VIRTUAL is not set
#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
# CONFIG_MDA_CONSOLE is not set
CONFIG_STI_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=160
CONFIG_DUMMY_CONSOLE_ROWS=64
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_PCI_CONSOLE=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
#
# Logo configuration
#
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y
CONFIG_LOGO_PARISC_CLUT224=y
#
# Sound
#
# CONFIG_SOUND is not set
#
# USB support
#
#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
# CONFIG_UDF_FS is not set
#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_DEVPTS_FS=y
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
#
# Miscellaneous filesystems
#
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
CONFIG_SUNRPC=y
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_INFO is not set
#
# Security options
#
CONFIG_SECURITY=y
# CONFIG_SECURITY_NETWORK is not set
CONFIG_SECURITY_CAPABILITIES=y
# CONFIG_SECURITY_SELINUX is not set
#
# Cryptographic options
#
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_TEST is not set
#
# Library routines
#
# CONFIG_CRC32 is not set
arch/parisc/defconfig
View file @
cf3f977a
...
...
@@ -3,7 +3,6 @@
#
CONFIG_PARISC=y
CONFIG_MMU=y
CONFIG_SWAP=y
CONFIG_STACK_GROWSUP=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
...
...
@@ -11,20 +10,27 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
CONFIG_BROKEN_ON_SMP=y
#
# General setup
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_LOG_BUF_SHIFT_17 is not set
# CONFIG_LOG_BUF_SHIFT_16 is not set
CONFIG_LOG_BUF_SHIFT_15=y
# CONFIG_LOG_BUF_SHIFT_14 is not set
# CONFIG_LOG_BUF_SHIFT_13 is not set
# CONFIG_LOG_BUF_SHIFT_12 is not set
CONFIG_LOG_BUF_SHIFT=15
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
#
# Loadable module support
...
...
@@ -34,6 +40,15 @@ CONFIG_LOG_BUF_SHIFT=15
#
# Processor type and features
#
CONFIG_PA7000=y
# CONFIG_PA7100LC is not set
# CONFIG_PA7200 is not set
# CONFIG_PA8X00 is not set
CONFIG_PA11=y
# CONFIG_64BIT is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_HPUX is not set
#
# Bus options (PCI, PCMCIA, EISA, GSC, ISA)
...
...
@@ -44,6 +59,8 @@ CONFIG_IOMMU_CCIO=y
CONFIG_GSC_LASI=y
CONFIG_GSC_WAX=y
CONFIG_EISA=y
CONFIG_EISA_NAMES=y
# CONFIG_ISA is not set
CONFIG_PCI=y
CONFIG_PCI_LEGACY_PROC=y
CONFIG_PCI_NAMES=y
...
...
@@ -52,16 +69,29 @@ CONFIG_PCI_LBA=y
CONFIG_IOSAPIC=y
CONFIG_IOMMU_SBA=y
CONFIG_SUPERIO=y
# CONFIG_CHASSIS_LCD_LED is not set
CONFIG_CHASSIS_LCD_LED=y
CONFIG_PDC_CHASSIS=y
# CONFIG_HOTPLUG is not set
#
# Executable file formats
#
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_SOM=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
#
# Device Drivers
#
#
# Generic Driver Options
#
#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set
#
# Parallel port support
#
...
...
@@ -75,6 +105,11 @@ CONFIG_PARPORT_GSC=y
# CONFIG_PARPORT_OTHER is not set
# CONFIG_PARPORT_1284 is not set
#
# Plug and Play support
#
# CONFIG_PNP is not set
#
# Block devices
#
...
...
@@ -85,20 +120,22 @@ CONFIG_PARPORT_GSC=y
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=y
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
#
# ATA/
IDE
/MFM/RLL support
# ATA/
ATAPI
/MFM/RLL support
#
# CONFIG_IDE is not set
#
# SCSI support
# SCSI
device
support
#
CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
...
...
@@ -128,22 +165,17 @@ CONFIG_CHR_DEV_SG=y
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_SATA is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_DMA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_GENERIC_NCR5380 is not set
# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
...
...
@@ -160,15 +192,11 @@ CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
CONFIG_SCSI_NCR53C8XX_SYNC=20
# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT 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_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_SIM710 is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set
...
...
@@ -184,6 +212,21 @@ CONFIG_MD_RAID5=y
# CONFIG_MD_MULTIPATH is not set
# CONFIG_BLK_DEV_DM is not set
#
# Fusion MPT device support
#
# CONFIG_FUSION is not set
#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
# CONFIG_IEEE1394 is not set
#
# I2O device support
#
# CONFIG_I2O is not set
#
# Networking support
#
...
...
@@ -195,8 +238,6 @@ CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_NETLINK_DEV=y
# CONFIG_NETFILTER is not set
CONFIG_FILTER=y
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
...
...
@@ -213,8 +254,12 @@ CONFIG_IP_PNP_BOOTP=y
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_XFRM_USER is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_IPV6 is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
#
# SCTP Configuration (EXPERIMENTAL)
...
...
@@ -223,9 +268,9 @@ CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_
DECNET
is not set
# CONFIG_
BRIDGE
is not set
# CONFIG_LLC
2
is not set
# CONFIG_
IPX
is not set
# CONFIG_
ATALK
is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
...
...
@@ -259,6 +304,7 @@ CONFIG_NETDEVICES=y
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
CONFIG_LASI_82596=y
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
...
...
@@ -311,8 +357,14 @@ CONFIG_DL2K=y
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SIS190 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set
#
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
...
...
@@ -323,19 +375,23 @@ CONFIG_DL2K=y
# Wireless LAN (non-hamradio)
#
CONFIG_NET_RADIO=y
#
# Obsolete Wireless cards support (pre-802.11)
#
# CONFIG_STRIP is not set
# CONFIG_AIRONET4500 is not set
#
# Wireless ISA/PCI cards support
# Wireless
802.11b
ISA/PCI cards support
#
CONFIG_AIRO=y
# CONFIG_HERMES is not set
CONFIG_NET_WIRELESS=y
#
# Token Ring devices
(depends on LLC=y)
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set
...
...
@@ -345,11 +401,31 @@ CONFIG_NET_WIRELESS=y
#
# CONFIG_WAN is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set
#
# Telephony Support
#
# CONFIG_PHONE is not set
#
# Input device support
#
...
...
@@ -358,7 +434,10 @@ CONFIG_INPUT=y
#
# Userland interfaces
#
# CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
...
...
@@ -370,11 +449,12 @@ CONFIG_INPUT_EVDEV=y
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
# CONFIG_SERIO_I8042 is not set
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
CONFIG_HP_SDC=y
# CONFIG_HIL_MLC is not set
# CONFIG_SERIO_PCIPS2 is not set
#
# Input Device Drivers
...
...
@@ -384,11 +464,10 @@ CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_HIL is not set
# CONFIG_KEYBOARD_HIL
_OLD
is not set
CONFIG_INPUT_MOUSE=y
# CONFIG_MOUSE_PS2 is not set
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_HIL is not set
CONFIG_INPUT_JOYSTICK=y
# CONFIG_JOYSTICK_IFORCE is not set
# CONFIG_JOYSTICK_WARRIOR is not set
...
...
@@ -407,7 +486,7 @@ CONFIG_INPUT_MISC=y
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_UINPUT is not set
CONFIG_INPUT_GSC=y
# CONFIG_HP_SDC_RTC is not set
CONFIG_HP_SDC_RTC=y
#
# Character devices
...
...
@@ -422,6 +501,7 @@ CONFIG_HW_CONSOLE=y
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
...
...
@@ -432,8 +512,8 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
#
# Non-8250 serial port support
#
CONFIG_SERIAL_MUX=y
CONFIG_SERIAL_MUX_CONSOLE=y
# CONFIG_SERIAL_MUX is not set
# CONFIG_PDC_CONSOLE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
...
...
@@ -449,12 +529,17 @@ CONFIG_PRINTER=y
# CONFIG_I2C is not set
#
# I2C Hardware Sensors Mainboard support
# I2C Algorithms
#
#
# I2C Hardware Bus support
#
#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
#
# Mice
...
...
@@ -462,12 +547,16 @@ CONFIG_PRINTER=y
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set
#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set
#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
CONFIG_GEN_RTC=y
# CONFIG_GEN_RTC_X is not set
# CONFIG_DTLK is not set
...
...
@@ -488,126 +577,17 @@ CONFIG_GEN_RTC=y
# CONFIG_VIDEO_DEV is not set
#
# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_FAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_TMPFS is not set
CONFIG_RAMFS=y
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
# CONFIG_JFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_XFS_FS is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
CONFIG_NFSD_TCP=y
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
# CONFIG_CIFS is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_AFS_FS is not set
#
# Partition Types
# Digital Video Broadcasting Devices
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
# CONFIG_DVB is not set
#
# Graphics support
#
CONFIG_FB=y
# CONFIG_FB_CLGEN is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_STI is not set
CONFIG_FB_STI=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
...
...
@@ -618,7 +598,6 @@ CONFIG_FB=y
# 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
#
...
...
@@ -632,11 +611,15 @@ CONFIG_DUMMY_CONSOLE_ROWS=64
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_PCI_CONSOLE=y
# CONFIG_FBCON_ADVANCED is not set
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
#
# Logo configuration
#
# CONFIG_LOGO is not set
#
# Sound
#
...
...
@@ -651,6 +634,7 @@ CONFIG_SOUND=y
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set
# CONFIG_SOUND_HARMONY is not set
#
# USB support
...
...
@@ -694,6 +678,7 @@ CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_MOUSE is not set
# CONFIG_USB_AIPTEK is not set
# CONFIG_USB_WACOM is not set
# CONFIG_USB_KBTAB is not set
# CONFIG_USB_POWERMATE is not set
# CONFIG_USB_XPAD is not set
...
...
@@ -718,7 +703,6 @@ CONFIG_USB_OHCI_HCD=y
# USB Network adaptors
#
# CONFIG_USB_CATC is not set
# CONFIG_USB_CDCETHER is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
...
...
@@ -742,11 +726,140 @@ CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_BRLVGER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_GADGET is not set
#
#
Bluetooth support
#
File systems
#
# CONFIG_BT is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
# CONFIG_ZISOFS is not set
# CONFIG_UDF_FS is not set
#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_NTFS_FS is not set
#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y
#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
CONFIG_NFSD_TCP=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_GSS is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_NLS=y
#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
#
# Profiling support
...
...
@@ -760,7 +873,8 @@ CONFIG_OPROFILE=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_KALLSYMS is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_INFO is not set
#
# Security options
...
...
@@ -770,9 +884,25 @@ CONFIG_MAGIC_SYSRQ=y
#
# Cryptographic options
#
# CONFIG_CRYPTO is not set
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_TEST is not set
#
# Library routines
#
# CONFIG_CRC32 is not set
CONFIG_CRC32=y
arch/parisc/kernel/Makefile
View file @
cf3f977a
...
...
@@ -8,6 +8,7 @@ extra-y := init_task.o $(head-y) vmlinux.lds.s
AFLAGS_entry.o
:=
-traditional
AFLAGS_pacache.o
:=
-traditional
CFLAGS_ioctl32.o
:=
-Ifs
/
obj-y
:=
cache.o pacache.o setup.o traps.o time.o irq.o
\
pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o
\
...
...
arch/parisc/kernel/cache.c
View file @
cf3f977a
...
...
@@ -292,5 +292,10 @@ void __flush_dcache_page(struct page *page)
break
;
}
}
EXPORT_SYMBOL
(
__flush_dcache_page
);
/* Defined in arch/parisc/kernel/pacache.S */
EXPORT_SYMBOL
(
flush_kernel_dcache_range_asm
);
EXPORT_SYMBOL
(
flush_kernel_dcache_page
);
EXPORT_SYMBOL
(
flush_data_cache_local
);
EXPORT_SYMBOL
(
flush_kernel_icache_range_asm
);
arch/parisc/kernel/drivers.c
View file @
cf3f977a
...
...
@@ -560,9 +560,9 @@ static void print_parisc_device(struct parisc_device *dev)
static
int
count
;
print_pa_hwpath
(
dev
,
hw_path
);
printk
(
KERN_INFO
"%d. %s
(%d) at 0x%lx [%s], versions 0x%x, 0x%x, 0x%x
"
,
++
count
,
dev
->
name
,
dev
->
id
.
hw_type
,
dev
->
hpa
,
hw_path
,
dev
->
id
.
hversion
,
dev
->
id
.
hversion_rev
,
dev
->
id
.
sversion
);
printk
(
KERN_INFO
"%d. %s
at 0x%lx [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }
"
,
++
count
,
dev
->
name
,
dev
->
hpa
,
hw_path
,
dev
->
id
.
hw_type
,
dev
->
id
.
hversion
_rev
,
dev
->
id
.
hversion
,
dev
->
id
.
sversion
);
if
(
dev
->
num_addrs
)
{
int
k
;
...
...
arch/parisc/kernel/entry.S
View file @
cf3f977a
...
...
@@ -77,13 +77,13 @@
ldil
L
%
KERNEL_PSW
,
%
r1
ldo
R
%
KERNEL_PSW
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr22
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
ldil
L
%4f
,
%
r1
ldo
R
%4f
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
Set
IIAOQ
tail
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
Set
IIAOQ
head
*/
rfir
nop
4
:
...
...
arch/parisc/kernel/firmware.c
View file @
cf3f977a
...
...
@@ -541,7 +541,7 @@ EXPORT_SYMBOL(pdc_lan_station_id);
* o cable too long (ie SE scsi 10Mhz won't support 6m length),
* o bus width exported is less than what the interface chip supports.
*/
int
pdc_get_initiator
(
struct
hardware_path
*
hwpath
,
unsigned
char
*
scsi_id
,
int
pdc_get_initiator
(
struct
hardware_path
*
hwpath
,
unsigned
char
*
scsi_id
,
unsigned
long
*
period
,
char
*
width
,
char
*
mode
)
{
int
retval
;
...
...
@@ -550,20 +550,21 @@ int pdc_get_initiator( struct hardware_path *hwpath, unsigned char *scsi_id,
/* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */
#define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \
strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785",
9
) == 0)
strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785",
8
) == 0)
retval
=
mem_pdc_call
(
PDC_INITIATOR
,
PDC_GET_INITIATOR
,
__pa
(
pdc_result
),
__pa
(
hwpath
));
if
(
retval
<
PDC_OK
)
goto
fail
;
if
(
retval
>=
PDC_OK
)
{
*
scsi_id
=
(
unsigned
char
)
pdc_result
[
0
];
/* convert Bus speed in Mhz to period (in 1/10 ns) */
switch
(
pdc_result
[
1
])
{
switch
(
pdc_result
[
1
])
{
/*
*
* case 0: driver determines rate
*
* case -1: Settings are uninitialized.
* case 0: driver determines rate
* case -1: Settings are uninitialized.
*/
case
5
:
*
period
=
2000
;
break
;
case
10
:
*
period
=
1000
;
break
;
...
...
@@ -573,30 +574,25 @@ int pdc_get_initiator( struct hardware_path *hwpath, unsigned char *scsi_id,
}
/*
*
* pdc_result[2] PDC suggested SCSI id
*
* pdc_result[3] PDC suggested SCSI rate
* pdc_result[2] PDC suggested SCSI id
* pdc_result[3] PDC suggested SCSI rate
*/
if
(
IS_SPROCKETS
())
{
/*
** Revisit: PAT PDC do the same thing?
** A500 also exports 50-pin SE SCSI.
** 0 == 8-bit
** 1 == 16-bit
*/
/* 0 == 8-bit, 1 == 16-bit */
*
width
=
(
char
)
pdc_result
[
4
];
/* ...in case someone needs it in the future.
*
* sym53c8xx.c comments say it can't autodetect
*
* for 825/825A/875 chips.
*
* 0 == SE, 1 == HVD, 2 == LVD
* sym53c8xx.c comments say it can't autodetect
* for 825/825A/875 chips.
* 0 == SE, 1 == HVD, 2 == LVD
*/
*
mode
=
(
char
)
pdc_result
[
5
];
}
}
fail:
spin_unlock_irq
(
&
pdc_lock
);
return
retval
>=
PDC_OK
;
return
(
retval
>=
PDC_OK
)
;
}
EXPORT_SYMBOL
(
pdc_get_initiator
);
...
...
arch/parisc/kernel/hardware.c
View file @
cf3f977a
...
...
@@ -772,6 +772,7 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{
HPHW_FIO
,
0x00D
,
0x0007B
,
0x0
,
"Strider-33 Audio"
},
{
HPHW_FIO
,
0x00E
,
0x0007B
,
0x0
,
"Trailways-50 Audio"
},
{
HPHW_FIO
,
0x00F
,
0x0007B
,
0x0
,
"Trailways-33 Audio"
},
{
HPHW_FIO
,
0x015
,
0x0007B
,
0x0
,
"KittyHawk GSY Core Audio"
},
{
HPHW_FIO
,
0x016
,
0x0007B
,
0x0
,
"Gecko Audio"
},
{
HPHW_FIO
,
0x019
,
0x0007B
,
0x0
,
"Scorpio Sr. Audio"
},
{
HPHW_FIO
,
0x01A
,
0x0007B
,
0x0
,
"Anole 64 Audio"
},
...
...
@@ -824,6 +825,7 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{
HPHW_FIO
,
0x026
,
0x0007F
,
0x0
,
"CoralII Jaguar Audio"
},
{
HPHW_FIO
,
0x010
,
0x00080
,
0x0
,
"Pace Core HPIB"
},
{
HPHW_FIO
,
0x024
,
0x00080
,
0x0
,
"Fast Pace Core HPIB"
},
{
HPHW_FIO
,
0x015
,
0x00082
,
0x0
,
"KittyHawk GSY Core SCSI"
},
{
HPHW_FIO
,
0x016
,
0x00082
,
0x0
,
"Gecko Core SCSI"
},
{
HPHW_FIO
,
0x01A
,
0x00082
,
0x0
,
"Anole 64 Core SCSI"
},
{
HPHW_FIO
,
0x01B
,
0x00082
,
0x0
,
"Anole 100 Core SCSI"
},
...
...
arch/parisc/kernel/head.S
View file @
cf3f977a
...
...
@@ -221,13 +221,13 @@ $install_iva:
*
*
Clear
the
two
-
level
IIA
Space
Queue
,
effectively
setting
*
*
Kernel
space
.
*/
mtctl
%
r0
,%
cr17
mtctl
%
r0
,%
cr17
mtctl
%
r0
,%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,%
cr17
/*
Clear
IIASQ
head
*/
/
*
Load
RFI
target
into
PC
queue
*/
mtctl
%
r11
,%
cr18
mtctl
%
r11
,%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r11
),%
r11
mtctl
%
r11
,%
cr18
mtctl
%
r11
,%
cr18
/*
IIAOQ
tail
*/
/
*
Jump
to
hyperspace
*/
rfi
...
...
arch/parisc/kernel/head64.S
View file @
cf3f977a
...
...
@@ -267,13 +267,13 @@ aligned_rfi:
*
*
Clear
the
two
-
level
IIA
Space
Queue
,
effectively
setting
*
*
Kernel
space
.
*/
mtctl
%
r0
,%
cr17
mtctl
%
r0
,%
cr17
mtctl
%
r0
,%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,%
cr17
/*
Clear
IIASQ
head
*/
/
*
Load
RFI
target
into
PC
queue
*/
mtctl
%
r11
,%
cr18
mtctl
%
r11
,%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r11
),%
r11
mtctl
%
r11
,%
cr18
mtctl
%
r11
,%
cr18
/*
IIAOQ
tail
*/
/
*
Jump
to
hyperspace
*/
rfi
...
...
arch/parisc/kernel/inventory.c
View file @
cf3f977a
...
...
@@ -532,7 +532,12 @@ static void __init system_map_inventory(void)
* Otherwise the machine might crash during iommu setup.
*/
pdc_io_reset
();
pdc_io_reset_devices
();
/*
* Unfortunately if we reset devices here, serial console
* stops working :-(
*/
/* pdc_io_reset_devices(); */
#endif
for
(
i
=
0
;
status
!=
PDC_BAD_PROC
&&
status
!=
PDC_NE_MOD
;
i
++
)
{
...
...
arch/parisc/kernel/ioctl32.c
View file @
cf3f977a
...
...
@@ -8,1783 +8,21 @@
* ioctls.
*/
#include <linux/config.h>
#include <linux/compat.h>
#include <linux/ioctl.h>
#include <linux/ioctl32.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/ioctl.h>
#include <linux/if.h>
#include <linux/slab.h>
#include <linux/hdreg.h>
#include <linux/raid/md.h>
#include <linux/kd.h>
#include <linux/route.h>
#include <linux/skbuff.h>
#include <linux/netlink.h>
#include <linux/vt.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/fd.h>
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#include <linux/if_pppox.h>
#include <linux/if_tun.h>
#include <linux/mtio.h>
#include <linux/cdrom.h>
#include <linux/loop.h>
#include <linux/auto_fs4.h>
#include <linux/devfs_fs.h>
#include <linux/ncp_fs.h>
#include <linux/tty.h>
#include <linux/vt_kern.h>
#include <linux/fb.h>
#include <linux/ext2_fs.h>
#include <linux/videodev.h>
#include <linux/netdevice.h>
#include <linux/raw.h>
#include <linux/smb_fs.h>
#include <linux/blkpg.h>
#include <linux/elevator.h>
#include <linux/rtc.h>
#include <linux/pci.h>
#include <linux/serial.h>
#include <linux/watchdog.h>
#include <net/sock.h>
/* siocdevprivate_ioctl */
#include <scsi/scsi.h>
/* Ugly hack. */
#undef __KERNEL__
#include <scsi/scsi_ioctl.h>
#define __KERNEL__
#include <scsi/sg.h>
#include <linux/raid/md_u.h>
#include <linux/dm-ioctl.h>
#include <asm/types.h>
#include <asm/uaccess.h>
#include <asm/perf.h>
#include <linux/ethtool.h>
#include <linux/soundcard.h>
#include <linux/lp.h>
#include <linux/atm.h>
#include <linux/atmarp.h>
#include <linux/atmclip.h>
#include <linux/atmdev.h>
#include <linux/atmioc.h>
#include <linux/atmlec.h>
#include <linux/atmmpc.h>
#include <linux/atmsvc.h>
#include <linux/atm_tcp.h>
#include <linux/sonet.h>
#include <linux/atm_suni.h>
#include <linux/mtd/mtd.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci.h>
#include <linux/usb.h>
#include <linux/usbdevice_fs.h>
#include <linux/nbd.h>
#include <linux/random.h>
#define INCLUDES
#include "compat_ioctl.c"
#include <asm/perf.h>
#include <asm/ioctls.h>
#define CODE
#include "compat_ioctl.c"
/* Use this to get at 32-bit user passed pointers.
See sys_sparc32.c for description about these. */
#define A(__x) ((unsigned long)(__x))
/* The same for use with copy_from_user() and copy_to_user(). */
#define B(__x) ((void *)(unsigned long)(__x))
/* Aiee. Someone does not find a difference between int and long */
#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
#define EXT2_IOC32_GETVERSION _IOR('v', 1, int)
#define EXT2_IOC32_SETVERSION _IOW('v', 2, int)
static
int
w_long
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
int
err
;
unsigned
long
val
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
val
);
set_fs
(
old_fs
);
if
(
!
err
&&
put_user
(
val
,
(
u32
*
)
arg
))
return
-
EFAULT
;
return
err
;
}
static
int
rw_long
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
int
err
;
unsigned
long
val
;
if
(
get_user
(
val
,
(
u32
*
)
arg
))
return
-
EFAULT
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
val
);
set_fs
(
old_fs
);
if
(
!
err
&&
put_user
(
val
,
(
u32
*
)
arg
))
return
-
EFAULT
;
return
err
;
}
static
int
do_ext2_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
/* These are just misnamed, they actually get/put from/to user an int */
switch
(
cmd
)
{
case
EXT2_IOC32_GETFLAGS
:
cmd
=
EXT2_IOC_GETFLAGS
;
break
;
case
EXT2_IOC32_SETFLAGS
:
cmd
=
EXT2_IOC_SETFLAGS
;
break
;
case
EXT2_IOC32_GETVERSION
:
cmd
=
EXT2_IOC_GETVERSION
;
break
;
case
EXT2_IOC32_SETVERSION
:
cmd
=
EXT2_IOC_SETVERSION
;
break
;
}
return
sys_ioctl
(
fd
,
cmd
,
arg
);
}
static
int
do_siocgstamp
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
compat_timeval
*
up
=
(
struct
compat_timeval
*
)
arg
;
struct
timeval
ktv
;
mm_segment_t
old_fs
=
get_fs
();
int
err
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
ktv
);
set_fs
(
old_fs
);
if
(
!
err
)
{
err
=
put_user
(
ktv
.
tv_sec
,
&
up
->
tv_sec
);
err
|=
__put_user
(
ktv
.
tv_usec
,
&
up
->
tv_usec
);
}
return
err
;
}
struct
ifmap32
{
u32
mem_start
;
u32
mem_end
;
unsigned
short
base_addr
;
unsigned
char
irq
;
unsigned
char
dma
;
unsigned
char
port
;
};
struct
ifreq32
{
#define IFHWADDRLEN 6
#define IFNAMSIZ 16
union
{
char
ifrn_name
[
IFNAMSIZ
];
/* if name, e.g. "en0" */
}
ifr_ifrn
;
union
{
struct
sockaddr
ifru_addr
;
struct
sockaddr
ifru_dstaddr
;
struct
sockaddr
ifru_broadaddr
;
struct
sockaddr
ifru_netmask
;
struct
sockaddr
ifru_hwaddr
;
short
ifru_flags
;
int
ifru_ivalue
;
int
ifru_mtu
;
struct
ifmap32
ifru_map
;
char
ifru_slave
[
IFNAMSIZ
];
/* Just fits the size */
char
ifru_newname
[
IFNAMSIZ
];
compat_caddr_t
ifru_data
;
}
ifr_ifru
;
};
struct
ifconf32
{
int
ifc_len
;
/* size of buffer */
compat_caddr_t
ifcbuf
;
};
static
int
dev_ifname32
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
net_device
*
dev
;
struct
ifreq32
ifr32
;
int
err
;
if
(
copy_from_user
(
&
ifr32
,
(
struct
ifreq32
*
)
arg
,
sizeof
(
struct
ifreq32
)))
return
-
EFAULT
;
dev
=
dev_get_by_index
(
ifr32
.
ifr_ifindex
);
if
(
!
dev
)
return
-
ENODEV
;
strcpy
(
ifr32
.
ifr_name
,
dev
->
name
);
dev_put
(
dev
);
err
=
copy_to_user
((
struct
ifreq32
*
)
arg
,
&
ifr32
,
sizeof
(
struct
ifreq32
));
return
(
err
?
-
EFAULT
:
0
);
}
static
inline
int
dev_ifconf
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
ifconf32
ifc32
;
struct
ifconf
ifc
;
struct
ifreq32
*
ifr32
;
struct
ifreq
*
ifr
;
mm_segment_t
old_fs
;
unsigned
int
i
,
j
;
int
err
;
if
(
copy_from_user
(
&
ifc32
,
(
struct
ifconf32
*
)
arg
,
sizeof
(
struct
ifconf32
)))
return
-
EFAULT
;
if
(
ifc32
.
ifcbuf
==
0
)
{
ifc32
.
ifc_len
=
0
;
ifc
.
ifc_len
=
0
;
ifc
.
ifc_buf
=
NULL
;
}
else
{
ifc
.
ifc_len
=
((
ifc32
.
ifc_len
/
sizeof
(
struct
ifreq32
))
+
1
)
*
sizeof
(
struct
ifreq
);
ifc
.
ifc_buf
=
kmalloc
(
ifc
.
ifc_len
,
GFP_KERNEL
);
if
(
!
ifc
.
ifc_buf
)
return
-
ENOMEM
;
}
ifr
=
ifc
.
ifc_req
;
ifr32
=
(
struct
ifreq32
*
)
A
(
ifc32
.
ifcbuf
);
for
(
i
=
0
;
i
<
ifc32
.
ifc_len
;
i
+=
sizeof
(
struct
ifreq32
))
{
if
(
copy_from_user
(
ifr
++
,
ifr32
++
,
sizeof
(
struct
ifreq32
)))
{
kfree
(
ifc
.
ifc_buf
);
return
-
EFAULT
;
}
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
SIOCGIFCONF
,
(
unsigned
long
)
&
ifc
);
set_fs
(
old_fs
);
if
(
!
err
)
{
ifr
=
ifc
.
ifc_req
;
ifr32
=
(
struct
ifreq32
*
)
A
(
ifc32
.
ifcbuf
);
for
(
i
=
0
,
j
=
0
;
i
<
ifc32
.
ifc_len
&&
j
<
ifc
.
ifc_len
;
i
+=
sizeof
(
struct
ifreq32
),
j
+=
sizeof
(
struct
ifreq
))
{
if
(
copy_to_user
(
ifr32
++
,
ifr
++
,
sizeof
(
struct
ifreq32
)))
{
err
=
-
EFAULT
;
break
;
}
}
if
(
!
err
)
{
if
(
i
<=
ifc32
.
ifc_len
)
ifc32
.
ifc_len
=
i
;
else
ifc32
.
ifc_len
=
i
-
sizeof
(
struct
ifreq32
);
if
(
copy_to_user
((
struct
ifconf32
*
)
arg
,
&
ifc32
,
sizeof
(
struct
ifconf32
)))
err
=
-
EFAULT
;
}
}
if
(
ifc
.
ifc_buf
!=
NULL
)
kfree
(
ifc
.
ifc_buf
);
return
err
;
}
static
int
dev_ifsioc
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
ifreq
ifr
;
mm_segment_t
old_fs
;
int
err
;
switch
(
cmd
)
{
case
SIOCSIFMAP
:
err
=
copy_from_user
(
&
ifr
,
(
struct
ifreq32
*
)
arg
,
sizeof
(
ifr
.
ifr_name
));
err
|=
__get_user
(
ifr
.
ifr_map
.
mem_start
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
mem_start
));
err
|=
__get_user
(
ifr
.
ifr_map
.
mem_end
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
mem_end
));
err
|=
__get_user
(
ifr
.
ifr_map
.
base_addr
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
base_addr
));
err
|=
__get_user
(
ifr
.
ifr_map
.
irq
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
irq
));
err
|=
__get_user
(
ifr
.
ifr_map
.
dma
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
dma
));
err
|=
__get_user
(
ifr
.
ifr_map
.
port
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
port
));
if
(
err
)
return
-
EFAULT
;
break
;
case
SIOCGPPPSTATS
:
case
SIOCGPPPCSTATS
:
case
SIOCGPPPVER
:
case
SIOCETHTOOL
:
if
(
copy_from_user
(
&
ifr
,
(
struct
ifreq32
*
)
arg
,
sizeof
(
struct
ifreq32
)))
return
-
EFAULT
;
ifr
.
ifr_data
=
(
__kernel_caddr_t
)
get_zeroed_page
(
GFP_KERNEL
);
if
(
!
ifr
.
ifr_data
)
return
-
EAGAIN
;
if
(
cmd
==
SIOCETHTOOL
)
{
u32
data
;
__get_user
(
data
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_data
));
if
(
copy_from_user
(
ifr
.
ifr_data
,
(
char
*
)
A
(
data
),
sizeof
(
struct
ethtool_cmd
)))
{
free_page
((
unsigned
long
)
ifr
.
ifr_data
);
return
-
EFAULT
;
}
}
break
;
default:
if
(
copy_from_user
(
&
ifr
,
(
struct
ifreq32
*
)
arg
,
sizeof
(
struct
ifreq32
)))
return
-
EFAULT
;
break
;
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
ifr
);
set_fs
(
old_fs
);
if
(
!
err
)
{
switch
(
cmd
)
{
case
SIOCGIFFLAGS
:
case
SIOCGIFMETRIC
:
case
SIOCGIFMTU
:
case
SIOCGIFMEM
:
case
SIOCGIFHWADDR
:
case
SIOCGIFINDEX
:
case
SIOCGIFADDR
:
case
SIOCGIFBRDADDR
:
case
SIOCGIFDSTADDR
:
case
SIOCGIFNETMASK
:
case
SIOCGIFTXQLEN
:
if
(
copy_to_user
((
struct
ifreq32
*
)
arg
,
&
ifr
,
sizeof
(
struct
ifreq32
)))
return
-
EFAULT
;
break
;
case
SIOCGPPPSTATS
:
case
SIOCGPPPCSTATS
:
case
SIOCGPPPVER
:
case
SIOCETHTOOL
:
{
u32
data
;
int
len
;
__get_user
(
data
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_data
));
if
(
cmd
==
SIOCETHTOOL
)
len
=
sizeof
(
struct
ethtool_cmd
);
if
(
cmd
==
SIOCGPPPVER
)
len
=
strlen
((
char
*
)
ifr
.
ifr_data
)
+
1
;
else
if
(
cmd
==
SIOCGPPPCSTATS
)
len
=
sizeof
(
struct
ppp_comp_stats
);
else
len
=
sizeof
(
struct
ppp_stats
);
len
=
copy_to_user
((
char
*
)
A
(
data
),
ifr
.
ifr_data
,
len
);
free_page
((
unsigned
long
)
ifr
.
ifr_data
);
if
(
len
)
return
-
EFAULT
;
break
;
}
case
SIOCGIFMAP
:
err
=
copy_to_user
((
struct
ifreq32
*
)
arg
,
&
ifr
,
sizeof
(
ifr
.
ifr_name
));
err
|=
__put_user
(
ifr
.
ifr_map
.
mem_start
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
mem_start
));
err
|=
__put_user
(
ifr
.
ifr_map
.
mem_end
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
mem_end
));
err
|=
__put_user
(
ifr
.
ifr_map
.
base_addr
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
base_addr
));
err
|=
__put_user
(
ifr
.
ifr_map
.
irq
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
irq
));
err
|=
__put_user
(
ifr
.
ifr_map
.
dma
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
dma
));
err
|=
__put_user
(
ifr
.
ifr_map
.
port
,
&
(((
struct
ifreq32
*
)
arg
)
->
ifr_ifru
.
ifru_map
.
port
));
if
(
err
)
err
=
-
EFAULT
;
break
;
}
}
return
err
;
}
struct
rtentry32
{
u32
rt_pad1
;
struct
sockaddr
rt_dst
;
/* target address */
struct
sockaddr
rt_gateway
;
/* gateway addr (RTF_GATEWAY) */
struct
sockaddr
rt_genmask
;
/* target network mask (IP) */
unsigned
short
rt_flags
;
short
rt_pad2
;
u32
rt_pad3
;
unsigned
char
rt_tos
;
unsigned
char
rt_class
;
short
rt_pad4
;
short
rt_metric
;
/* +1 for binary compatibility! */
/* char * */
u32
rt_dev
;
/* forcing the device at add */
u32
rt_mtu
;
/* per route MTU/Window */
u32
rt_window
;
/* Window clamping */
unsigned
short
rt_irtt
;
/* Initial RTT */
};
static
inline
int
routing_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
rtentry
r
;
char
devname
[
16
];
u32
rtdev
;
int
ret
;
mm_segment_t
old_fs
=
get_fs
();
ret
=
copy_from_user
(
&
r
.
rt_dst
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_dst
),
3
*
sizeof
(
struct
sockaddr
));
ret
|=
__get_user
(
r
.
rt_flags
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_flags
));
ret
|=
__get_user
(
r
.
rt_metric
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_metric
));
ret
|=
__get_user
(
r
.
rt_mtu
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_mtu
));
ret
|=
__get_user
(
r
.
rt_window
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_window
));
ret
|=
__get_user
(
r
.
rt_irtt
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_irtt
));
ret
|=
__get_user
(
rtdev
,
&
(((
struct
rtentry32
*
)
arg
)
->
rt_dev
));
if
(
rtdev
)
{
ret
|=
copy_from_user
(
devname
,
(
char
*
)
A
(
rtdev
),
15
);
r
.
rt_dev
=
devname
;
devname
[
15
]
=
0
;
}
else
r
.
rt_dev
=
0
;
if
(
ret
)
return
-
EFAULT
;
set_fs
(
KERNEL_DS
);
ret
=
sys_ioctl
(
fd
,
cmd
,
(
long
)
&
r
);
set_fs
(
old_fs
);
return
ret
;
}
struct
hd_geometry32
{
unsigned
char
heads
;
unsigned
char
sectors
;
unsigned
short
cylinders
;
u32
start
;
};
static
inline
int
hdio_getgeo
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
hd_geometry
geo
;
int
err
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
HDIO_GETGEO
,
(
unsigned
long
)
&
geo
);
set_fs
(
old_fs
);
if
(
!
err
)
{
err
=
copy_to_user
((
struct
hd_geometry32
*
)
arg
,
&
geo
,
4
);
err
|=
__put_user
(
geo
.
start
,
&
(((
struct
hd_geometry32
*
)
arg
)
->
start
));
}
return
err
?
-
EFAULT
:
0
;
}
#if 0
/* looks like SPARC only - eg sbus video */
struct fbcmap32 {
int index; /* first element (0 origin) */
int count;
u32 red;
u32 green;
u32 blue;
};
static inline int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct fbcmap f;
int ret;
char red[256], green[256], blue[256];
u32 r, g, b;
mm_segment_t old_fs = get_fs();
ret = get_user(f.index, &(((struct fbcmap32 *)arg)->index));
ret |= __get_user(f.count, &(((struct fbcmap32 *)arg)->count));
ret |= __get_user(r, &(((struct fbcmap32 *)arg)->red));
ret |= __get_user(g, &(((struct fbcmap32 *)arg)->green));
ret |= __get_user(b, &(((struct fbcmap32 *)arg)->blue));
if (ret)
return -EFAULT;
if ((f.index < 0) || (f.index > 255)) return -EINVAL;
if (f.index + f.count > 256)
f.count = 256 - f.index;
if (cmd == FBIOPUTCMAP32) {
ret = copy_from_user (red, (char *)A(r), f.count);
ret |= copy_from_user (green, (char *)A(g), f.count);
ret |= copy_from_user (blue, (char *)A(b), f.count);
if (ret)
return -EFAULT;
}
f.red = red; f.green = green; f.blue = blue;
set_fs (KERNEL_DS);
ret = sys_ioctl (fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (long)&f);
set_fs (old_fs);
if (!ret && cmd == FBIOGETCMAP32) {
ret = copy_to_user ((char *)A(r), red, f.count);
ret |= copy_to_user ((char *)A(g), green, f.count);
ret |= copy_to_user ((char *)A(b), blue, f.count);
}
return ret ? -EFAULT : 0;
}
struct fbcursor32 {
short set; /* what to set, choose from the list above */
short enable; /* cursor on/off */
struct fbcurpos pos; /* cursor position */
struct fbcurpos hot; /* cursor hot spot */
struct fbcmap32 cmap; /* color map info */
struct fbcurpos size; /* cursor bit map size */
u32 image; /* cursor image bits */
u32 mask; /* cursor mask bits */
};
static inline int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct fbcursor f;
int ret;
char red[2], green[2], blue[2];
char image[128], mask[128];
u32 r, g, b;
u32 m, i;
mm_segment_t old_fs = get_fs();
ret = copy_from_user (&f, (struct fbcursor32 *)arg, 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
ret |= __get_user(f.size.fbx, &(((struct fbcursor32 *)arg)->size.fbx));
ret |= __get_user(f.size.fby, &(((struct fbcursor32 *)arg)->size.fby));
ret |= __get_user(f.cmap.index, &(((struct fbcursor32 *)arg)->cmap.index));
ret |= __get_user(f.cmap.count, &(((struct fbcursor32 *)arg)->cmap.count));
ret |= __get_user(r, &(((struct fbcursor32 *)arg)->cmap.red));
ret |= __get_user(g, &(((struct fbcursor32 *)arg)->cmap.green));
ret |= __get_user(b, &(((struct fbcursor32 *)arg)->cmap.blue));
ret |= __get_user(m, &(((struct fbcursor32 *)arg)->mask));
ret |= __get_user(i, &(((struct fbcursor32 *)arg)->image));
if (ret)
return -EFAULT;
if (f.set & FB_CUR_SETCMAP) {
if ((uint) f.size.fby > 32)
return -EINVAL;
ret = copy_from_user (mask, (char *)A(m), f.size.fby * 4);
ret |= copy_from_user (image, (char *)A(i), f.size.fby * 4);
if (ret)
return -EFAULT;
f.image = image; f.mask = mask;
}
if (f.set & FB_CUR_SETCMAP) {
ret = copy_from_user (red, (char *)A(r), 2);
ret |= copy_from_user (green, (char *)A(g), 2);
ret |= copy_from_user (blue, (char *)A(b), 2);
if (ret)
return -EFAULT;
f.cmap.red = red; f.cmap.green = green; f.cmap.blue = blue;
}
set_fs (KERNEL_DS);
ret = sys_ioctl (fd, FBIOSCURSOR, (long)&f);
set_fs (old_fs);
return ret;
}
#endif /* 0 */
struct
fb_fix_screeninfo32
{
char
id
[
16
];
compat_caddr_t
smem_start
;
__u32
smem_len
;
__u32
type
;
__u32
type_aux
;
__u32
visual
;
__u16
xpanstep
;
__u16
ypanstep
;
__u16
ywrapstep
;
__u32
line_length
;
compat_caddr_t
mmio_start
;
__u32
mmio_len
;
__u32
accel
;
__u16
reserved
[
3
];
};
struct
fb_cmap32
{
__u32
start
;
__u32
len
;
compat_caddr_t
red
;
compat_caddr_t
green
;
compat_caddr_t
blue
;
compat_caddr_t
transp
;
};
static
int
fb_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
u32
red
=
0
,
green
=
0
,
blue
=
0
,
transp
=
0
;
struct
fb_fix_screeninfo
fix
;
struct
fb_cmap
cmap
;
void
*
karg
;
int
err
=
0
;
memset
(
&
cmap
,
0
,
sizeof
(
cmap
));
switch
(
cmd
)
{
case
FBIOGET_FSCREENINFO
:
karg
=
&
fix
;
break
;
case
FBIOGETCMAP
:
case
FBIOPUTCMAP
:
karg
=
&
cmap
;
err
=
__get_user
(
cmap
.
start
,
&
((
struct
fb_cmap32
*
)
arg
)
->
start
);
err
|=
__get_user
(
cmap
.
len
,
&
((
struct
fb_cmap32
*
)
arg
)
->
len
);
err
|=
__get_user
(
red
,
&
((
struct
fb_cmap32
*
)
arg
)
->
red
);
err
|=
__get_user
(
green
,
&
((
struct
fb_cmap32
*
)
arg
)
->
green
);
err
|=
__get_user
(
blue
,
&
((
struct
fb_cmap32
*
)
arg
)
->
blue
);
err
|=
__get_user
(
transp
,
&
((
struct
fb_cmap32
*
)
arg
)
->
transp
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
err
=
-
ENOMEM
;
cmap
.
red
=
kmalloc
(
cmap
.
len
*
sizeof
(
__u16
),
GFP_KERNEL
);
if
(
!
cmap
.
red
)
goto
out
;
cmap
.
green
=
kmalloc
(
cmap
.
len
*
sizeof
(
__u16
),
GFP_KERNEL
);
if
(
!
cmap
.
green
)
goto
out
;
cmap
.
blue
=
kmalloc
(
cmap
.
len
*
sizeof
(
__u16
),
GFP_KERNEL
);
if
(
!
cmap
.
blue
)
goto
out
;
if
(
transp
)
{
cmap
.
transp
=
kmalloc
(
cmap
.
len
*
sizeof
(
__u16
),
GFP_KERNEL
);
if
(
!
cmap
.
transp
)
goto
out
;
}
if
(
cmd
==
FBIOGETCMAP
)
break
;
err
=
__copy_from_user
(
cmap
.
red
,
(
char
*
)
A
(
red
),
cmap
.
len
*
sizeof
(
__u16
));
err
|=
__copy_from_user
(
cmap
.
green
,
(
char
*
)
A
(
green
),
cmap
.
len
*
sizeof
(
__u16
));
err
|=
__copy_from_user
(
cmap
.
blue
,
(
char
*
)
A
(
blue
),
cmap
.
len
*
sizeof
(
__u16
));
if
(
cmap
.
transp
)
err
|=
__copy_from_user
(
cmap
.
transp
,
(
char
*
)
A
(
transp
),
cmap
.
len
*
sizeof
(
__u16
));
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
break
;
default:
do
{
static
int
count
=
0
;
if
(
++
count
<=
20
)
printk
(
KERN_WARNING
"%s: Unknown fb ioctl cmd fd(%d) "
"cmd(%08x) arg(%08lx)
\n
"
,
__FUNCTION__
,
fd
,
cmd
,
arg
);
}
while
(
0
);
return
-
ENOSYS
;
}
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
karg
);
set_fs
(
old_fs
);
if
(
err
)
goto
out
;
switch
(
cmd
)
{
struct
fb_fix_screeninfo32
fix32
;
case
FBIOGET_FSCREENINFO
:
memset
(
&
fix32
,
0
,
sizeof
(
fix32
));
memcpy
(
fix32
.
id
,
fix
.
id
,
sizeof
(
fix32
.
id
));
fix32
.
smem_start
=
(
__u32
)(
unsigned
long
)
fix
.
smem_start
;
fix32
.
smem_len
=
fix
.
smem_len
;
fix32
.
type
=
fix
.
type
;
fix32
.
type_aux
=
fix
.
type_aux
;
fix32
.
visual
=
fix
.
visual
;
fix32
.
xpanstep
=
fix
.
xpanstep
;
fix32
.
ypanstep
=
fix
.
ypanstep
;
fix32
.
ywrapstep
=
fix
.
ywrapstep
;
fix32
.
line_length
=
fix
.
line_length
;
fix32
.
mmio_start
=
(
__u32
)(
unsigned
long
)
fix
.
mmio_start
;
fix32
.
mmio_len
=
fix
.
mmio_len
;
fix32
.
accel
=
fix
.
accel
;
memcpy
(
fix32
.
reserved
,
fix
.
reserved
,
sizeof
(
fix32
.
reserved
));
err
=
__copy_to_user
((
void
*
)
arg
,
(
const
void
*
)
&
fix32
,
sizeof
(
fix32
));
printk
(
"fix : %lx %x %x %x %x %x %x %x %x %lx %x %x
\n
"
,
fix
.
smem_start
,
fix
.
smem_len
,
fix
.
type
,
fix
.
type_aux
,
fix
.
visual
,
fix
.
xpanstep
,
fix
.
ypanstep
,
fix
.
ywrapstep
,
fix
.
line_length
,
fix
.
mmio_start
,
fix
.
mmio_len
,
fix
.
accel
);
printk
(
"fix32: %x %x %x %x %x %x %x %x %x %x %x %x
\n
"
,
fix32
.
smem_start
,
fix32
.
smem_len
,
fix32
.
type
,
fix32
.
type_aux
,
fix32
.
visual
,
fix32
.
xpanstep
,
fix32
.
ypanstep
,
fix32
.
ywrapstep
,
fix32
.
line_length
,
fix32
.
mmio_start
,
fix32
.
mmio_len
,
fix32
.
accel
);
break
;
case
FBIOGETCMAP
:
err
=
__copy_to_user
((
char
*
)
A
(
red
),
cmap
.
red
,
cmap
.
len
*
sizeof
(
__u16
));
err
|=
__copy_to_user
((
char
*
)
A
(
green
),
cmap
.
blue
,
cmap
.
len
*
sizeof
(
__u16
));
err
|=
__copy_to_user
((
char
*
)
A
(
blue
),
cmap
.
blue
,
cmap
.
len
*
sizeof
(
__u16
));
if
(
cmap
.
transp
)
err
|=
__copy_to_user
((
char
*
)
A
(
transp
),
cmap
.
transp
,
cmap
.
len
*
sizeof
(
__u16
));
break
;
case
FBIOPUTCMAP
:
break
;
}
if
(
err
)
err
=
-
EFAULT
;
out:
if
(
cmap
.
red
)
kfree
(
cmap
.
red
);
if
(
cmap
.
green
)
kfree
(
cmap
.
green
);
if
(
cmap
.
blue
)
kfree
(
cmap
.
blue
);
if
(
cmap
.
transp
)
kfree
(
cmap
.
transp
);
return
err
;
}
static
int
hdio_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
unsigned
long
kval
;
unsigned
int
*
uvp
;
int
error
;
set_fs
(
KERNEL_DS
);
error
=
sys_ioctl
(
fd
,
cmd
,
(
long
)
&
kval
);
set_fs
(
old_fs
);
if
(
error
==
0
)
{
uvp
=
(
unsigned
int
*
)
arg
;
if
(
put_user
(
kval
,
uvp
))
error
=
-
EFAULT
;
}
return
error
;
}
struct
floppy_struct32
{
unsigned
int
size
;
unsigned
int
sect
;
unsigned
int
head
;
unsigned
int
track
;
unsigned
int
stretch
;
unsigned
char
gap
;
unsigned
char
rate
;
unsigned
char
spec1
;
unsigned
char
fmt_gap
;
const
compat_caddr_t
name
;
};
struct
floppy_drive_params32
{
char
cmos
;
u32
max_dtr
;
u32
hlt
;
u32
hut
;
u32
srt
;
u32
spinup
;
u32
spindown
;
unsigned
char
spindown_offset
;
unsigned
char
select_delay
;
unsigned
char
rps
;
unsigned
char
tracks
;
u32
timeout
;
unsigned
char
interleave_sect
;
struct
floppy_max_errors
max_errors
;
char
flags
;
char
read_track
;
short
autodetect
[
8
];
int
checkfreq
;
int
native_format
;
};
struct
floppy_drive_struct32
{
signed
char
flags
;
u32
spinup_date
;
u32
select_date
;
u32
first_read_date
;
short
probed_format
;
short
track
;
short
maxblock
;
short
maxtrack
;
int
generation
;
int
keep_data
;
int
fd_ref
;
int
fd_device
;
int
last_checked
;
compat_caddr_t
dmabuf
;
int
bufblocks
;
};
struct
floppy_fdc_state32
{
int
spec1
;
int
spec2
;
int
dtr
;
unsigned
char
version
;
unsigned
char
dor
;
u32
address
;
unsigned
int
rawcmd
:
2
;
unsigned
int
reset
:
1
;
unsigned
int
need_configure
:
1
;
unsigned
int
perp_mode
:
2
;
unsigned
int
has_fifo
:
1
;
unsigned
int
driver_version
;
unsigned
char
track
[
4
];
};
struct
floppy_write_errors32
{
unsigned
int
write_errors
;
u32
first_error_sector
;
int
first_error_generation
;
u32
last_error_sector
;
int
last_error_generation
;
unsigned
int
badness
;
};
#define FDSETPRM32 _IOW(2, 0x42, struct floppy_struct32)
#define FDDEFPRM32 _IOW(2, 0x43, struct floppy_struct32)
#define FDGETPRM32 _IOR(2, 0x04, struct floppy_struct32)
#define FDSETDRVPRM32 _IOW(2, 0x90, struct floppy_drive_params32)
#define FDGETDRVPRM32 _IOR(2, 0x11, struct floppy_drive_params32)
#define FDGETDRVSTAT32 _IOR(2, 0x12, struct floppy_drive_struct32)
#define FDPOLLDRVSTAT32 _IOR(2, 0x13, struct floppy_drive_struct32)
#define FDGETFDCSTAT32 _IOR(2, 0x15, struct floppy_fdc_state32)
#define FDWERRORGET32 _IOR(2, 0x17, struct floppy_write_errors32)
static
struct
{
unsigned
int
cmd32
;
unsigned
int
cmd
;
}
fd_ioctl_trans_table
[]
=
{
{
FDSETPRM32
,
FDSETPRM
},
{
FDDEFPRM32
,
FDDEFPRM
},
{
FDGETPRM32
,
FDGETPRM
},
{
FDSETDRVPRM32
,
FDSETDRVPRM
},
{
FDGETDRVPRM32
,
FDGETDRVPRM
},
{
FDGETDRVSTAT32
,
FDGETDRVSTAT
},
{
FDPOLLDRVSTAT32
,
FDPOLLDRVSTAT
},
{
FDGETFDCSTAT32
,
FDGETFDCSTAT
},
{
FDWERRORGET32
,
FDWERRORGET
}
};
#define NR_FD_IOCTL_TRANS (sizeof(fd_ioctl_trans_table)/sizeof(fd_ioctl_trans_table[0]))
static
int
fd_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
void
*
karg
=
NULL
;
unsigned
int
kcmd
=
0
;
int
i
,
err
;
for
(
i
=
0
;
i
<
NR_FD_IOCTL_TRANS
;
i
++
)
if
(
cmd
==
fd_ioctl_trans_table
[
i
].
cmd32
)
{
kcmd
=
fd_ioctl_trans_table
[
i
].
cmd
;
break
;
}
if
(
!
kcmd
)
return
-
EINVAL
;
switch
(
cmd
)
{
case
FDSETPRM32
:
case
FDDEFPRM32
:
case
FDGETPRM32
:
{
struct
floppy_struct
*
f
;
f
=
karg
=
kmalloc
(
sizeof
(
struct
floppy_struct
),
GFP_KERNEL
);
if
(
!
karg
)
return
-
ENOMEM
;
if
(
cmd
==
FDGETPRM32
)
break
;
err
=
__get_user
(
f
->
size
,
&
((
struct
floppy_struct32
*
)
arg
)
->
size
);
err
|=
__get_user
(
f
->
sect
,
&
((
struct
floppy_struct32
*
)
arg
)
->
sect
);
err
|=
__get_user
(
f
->
head
,
&
((
struct
floppy_struct32
*
)
arg
)
->
head
);
err
|=
__get_user
(
f
->
track
,
&
((
struct
floppy_struct32
*
)
arg
)
->
track
);
err
|=
__get_user
(
f
->
stretch
,
&
((
struct
floppy_struct32
*
)
arg
)
->
stretch
);
err
|=
__get_user
(
f
->
gap
,
&
((
struct
floppy_struct32
*
)
arg
)
->
gap
);
err
|=
__get_user
(
f
->
rate
,
&
((
struct
floppy_struct32
*
)
arg
)
->
rate
);
err
|=
__get_user
(
f
->
spec1
,
&
((
struct
floppy_struct32
*
)
arg
)
->
spec1
);
err
|=
__get_user
(
f
->
fmt_gap
,
&
((
struct
floppy_struct32
*
)
arg
)
->
fmt_gap
);
err
|=
__get_user
((
u64
)
f
->
name
,
&
((
struct
floppy_struct32
*
)
arg
)
->
name
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
break
;
}
case
FDSETDRVPRM32
:
case
FDGETDRVPRM32
:
{
struct
floppy_drive_params
*
f
;
f
=
karg
=
kmalloc
(
sizeof
(
struct
floppy_drive_params
),
GFP_KERNEL
);
if
(
!
karg
)
return
-
ENOMEM
;
if
(
cmd
==
FDGETDRVPRM32
)
break
;
err
=
__get_user
(
f
->
cmos
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
cmos
);
err
|=
__get_user
(
f
->
max_dtr
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
max_dtr
);
err
|=
__get_user
(
f
->
hlt
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
hlt
);
err
|=
__get_user
(
f
->
hut
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
hut
);
err
|=
__get_user
(
f
->
srt
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
srt
);
err
|=
__get_user
(
f
->
spinup
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spinup
);
err
|=
__get_user
(
f
->
spindown
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spindown
);
err
|=
__get_user
(
f
->
spindown_offset
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spindown_offset
);
err
|=
__get_user
(
f
->
select_delay
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
select_delay
);
err
|=
__get_user
(
f
->
rps
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
rps
);
err
|=
__get_user
(
f
->
tracks
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
tracks
);
err
|=
__get_user
(
f
->
timeout
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
timeout
);
err
|=
__get_user
(
f
->
interleave_sect
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
interleave_sect
);
err
|=
__copy_from_user
(
&
f
->
max_errors
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
max_errors
,
sizeof
(
f
->
max_errors
));
err
|=
__get_user
(
f
->
flags
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
flags
);
err
|=
__get_user
(
f
->
read_track
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
read_track
);
err
|=
__copy_from_user
(
f
->
autodetect
,
((
struct
floppy_drive_params32
*
)
arg
)
->
autodetect
,
sizeof
(
f
->
autodetect
));
err
|=
__get_user
(
f
->
checkfreq
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
checkfreq
);
err
|=
__get_user
(
f
->
native_format
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
native_format
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
break
;
}
case
FDGETDRVSTAT32
:
case
FDPOLLDRVSTAT32
:
karg
=
kmalloc
(
sizeof
(
struct
floppy_drive_struct
),
GFP_KERNEL
);
if
(
!
karg
)
return
-
ENOMEM
;
break
;
case
FDGETFDCSTAT32
:
karg
=
kmalloc
(
sizeof
(
struct
floppy_fdc_state
),
GFP_KERNEL
);
if
(
!
karg
)
return
-
ENOMEM
;
break
;
case
FDWERRORGET32
:
karg
=
kmalloc
(
sizeof
(
struct
floppy_write_errors
),
GFP_KERNEL
);
if
(
!
karg
)
return
-
ENOMEM
;
break
;
default:
return
-
EINVAL
;
}
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
kcmd
,
(
unsigned
long
)
karg
);
set_fs
(
old_fs
);
if
(
err
)
goto
out
;
switch
(
cmd
)
{
case
FDGETPRM32
:
{
struct
floppy_struct
*
f
=
karg
;
err
=
__put_user
(
f
->
size
,
&
((
struct
floppy_struct32
*
)
arg
)
->
size
);
err
|=
__put_user
(
f
->
sect
,
&
((
struct
floppy_struct32
*
)
arg
)
->
sect
);
err
|=
__put_user
(
f
->
head
,
&
((
struct
floppy_struct32
*
)
arg
)
->
head
);
err
|=
__put_user
(
f
->
track
,
&
((
struct
floppy_struct32
*
)
arg
)
->
track
);
err
|=
__put_user
(
f
->
stretch
,
&
((
struct
floppy_struct32
*
)
arg
)
->
stretch
);
err
|=
__put_user
(
f
->
gap
,
&
((
struct
floppy_struct32
*
)
arg
)
->
gap
);
err
|=
__put_user
(
f
->
rate
,
&
((
struct
floppy_struct32
*
)
arg
)
->
rate
);
err
|=
__put_user
(
f
->
spec1
,
&
((
struct
floppy_struct32
*
)
arg
)
->
spec1
);
err
|=
__put_user
(
f
->
fmt_gap
,
&
((
struct
floppy_struct32
*
)
arg
)
->
fmt_gap
);
err
|=
__put_user
((
u64
)
f
->
name
,
&
((
struct
floppy_struct32
*
)
arg
)
->
name
);
break
;
}
case
FDGETDRVPRM32
:
{
struct
floppy_drive_params
*
f
=
karg
;
err
=
__put_user
(
f
->
cmos
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
cmos
);
err
|=
__put_user
(
f
->
max_dtr
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
max_dtr
);
err
|=
__put_user
(
f
->
hlt
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
hlt
);
err
|=
__put_user
(
f
->
hut
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
hut
);
err
|=
__put_user
(
f
->
srt
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
srt
);
err
|=
__put_user
(
f
->
spinup
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spinup
);
err
|=
__put_user
(
f
->
spindown
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spindown
);
err
|=
__put_user
(
f
->
spindown_offset
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
spindown_offset
);
err
|=
__put_user
(
f
->
select_delay
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
select_delay
);
err
|=
__put_user
(
f
->
rps
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
rps
);
err
|=
__put_user
(
f
->
tracks
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
tracks
);
err
|=
__put_user
(
f
->
timeout
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
timeout
);
err
|=
__put_user
(
f
->
interleave_sect
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
interleave_sect
);
err
|=
__copy_to_user
(
&
((
struct
floppy_drive_params32
*
)
arg
)
->
max_errors
,
&
f
->
max_errors
,
sizeof
(
f
->
max_errors
));
err
|=
__put_user
(
f
->
flags
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
flags
);
err
|=
__put_user
(
f
->
read_track
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
read_track
);
err
|=
__copy_to_user
(((
struct
floppy_drive_params32
*
)
arg
)
->
autodetect
,
f
->
autodetect
,
sizeof
(
f
->
autodetect
));
err
|=
__put_user
(
f
->
checkfreq
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
checkfreq
);
err
|=
__put_user
(
f
->
native_format
,
&
((
struct
floppy_drive_params32
*
)
arg
)
->
native_format
);
break
;
}
case
FDGETDRVSTAT32
:
case
FDPOLLDRVSTAT32
:
{
struct
floppy_drive_struct
*
f
=
karg
;
err
=
__put_user
(
f
->
flags
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
flags
);
err
|=
__put_user
(
f
->
spinup_date
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
spinup_date
);
err
|=
__put_user
(
f
->
select_date
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
select_date
);
err
|=
__put_user
(
f
->
first_read_date
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
first_read_date
);
err
|=
__put_user
(
f
->
probed_format
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
probed_format
);
err
|=
__put_user
(
f
->
track
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
track
);
err
|=
__put_user
(
f
->
maxblock
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
maxblock
);
err
|=
__put_user
(
f
->
maxtrack
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
maxtrack
);
err
|=
__put_user
(
f
->
generation
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
generation
);
err
|=
__put_user
(
f
->
keep_data
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
keep_data
);
err
|=
__put_user
(
f
->
fd_ref
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
fd_ref
);
err
|=
__put_user
(
f
->
fd_device
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
fd_device
);
err
|=
__put_user
(
f
->
last_checked
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
last_checked
);
err
|=
__put_user
((
u64
)
f
->
dmabuf
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
dmabuf
);
err
|=
__put_user
((
u64
)
f
->
bufblocks
,
&
((
struct
floppy_drive_struct32
*
)
arg
)
->
bufblocks
);
break
;
}
case
FDGETFDCSTAT32
:
{
struct
floppy_fdc_state
*
f
=
karg
;
err
=
__put_user
(
f
->
spec1
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
spec1
);
err
|=
__put_user
(
f
->
spec2
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
spec2
);
err
|=
__put_user
(
f
->
dtr
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
dtr
);
err
|=
__put_user
(
f
->
version
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
version
);
err
|=
__put_user
(
f
->
dor
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
dor
);
err
|=
__put_user
(
f
->
address
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
address
);
err
|=
__copy_to_user
((
char
*
)
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
address
+
sizeof
(((
struct
floppy_fdc_state32
*
)
arg
)
->
address
),
(
char
*
)
&
f
->
address
+
sizeof
(
f
->
address
),
sizeof
(
int
));
err
|=
__put_user
(
f
->
driver_version
,
&
((
struct
floppy_fdc_state32
*
)
arg
)
->
driver_version
);
err
|=
__copy_to_user
(((
struct
floppy_fdc_state32
*
)
arg
)
->
track
,
f
->
track
,
sizeof
(
f
->
track
));
break
;
}
case
FDWERRORGET32
:
{
struct
floppy_write_errors
*
f
=
karg
;
err
=
__put_user
(
f
->
write_errors
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
write_errors
);
err
|=
__put_user
(
f
->
first_error_sector
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
first_error_sector
);
err
|=
__put_user
(
f
->
first_error_generation
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
first_error_generation
);
err
|=
__put_user
(
f
->
last_error_sector
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
last_error_sector
);
err
|=
__put_user
(
f
->
last_error_generation
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
last_error_generation
);
err
|=
__put_user
(
f
->
badness
,
&
((
struct
floppy_write_errors32
*
)
arg
)
->
badness
);
break
;
}
default:
break
;
}
if
(
err
)
err
=
-
EFAULT
;
out:
if
(
karg
)
kfree
(
karg
);
return
err
;
}
struct
ppp_option_data32
{
compat_caddr_t
ptr
;
__u32
length
;
int
transmit
;
};
#define PPPIOCSCOMPRESS32 _IOW('t', 77, struct ppp_option_data32)
struct
ppp_idle32
{
compat_time_t
xmit_idle
;
compat_time_t
recv_idle
;
};
#define PPPIOCGIDLE32 _IOR('t', 63, struct ppp_idle32)
static
int
ppp_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
ppp_option_data32
data32
;
struct
ppp_option_data
data
;
struct
ppp_idle32
idle32
;
struct
ppp_idle
idle
;
unsigned
int
kcmd
;
void
*
karg
;
int
err
=
0
;
switch
(
cmd
)
{
case
PPPIOCGIDLE32
:
kcmd
=
PPPIOCGIDLE
;
karg
=
&
idle
;
break
;
case
PPPIOCSCOMPRESS32
:
if
(
copy_from_user
(
&
data32
,
(
struct
ppp_option_data32
*
)
arg
,
sizeof
(
struct
ppp_option_data32
)))
return
-
EFAULT
;
data
.
ptr
=
kmalloc
(
data32
.
length
,
GFP_KERNEL
);
if
(
!
data
.
ptr
)
return
-
ENOMEM
;
if
(
copy_from_user
(
data
.
ptr
,
(
__u8
*
)
A
(
data32
.
ptr
),
data32
.
length
))
{
kfree
(
data
.
ptr
);
return
-
EFAULT
;
}
data
.
length
=
data32
.
length
;
data
.
transmit
=
data32
.
transmit
;
kcmd
=
PPPIOCSCOMPRESS
;
karg
=
&
data
;
break
;
default:
do
{
static
int
count
=
0
;
if
(
++
count
<=
20
)
printk
(
KERN_WARNING
"ppp_ioctl: Unknown cmd fd(%d) "
"cmd(%08x) arg(%08x)
\n
"
,
(
int
)
fd
,
(
unsigned
int
)
cmd
,
(
unsigned
int
)
arg
);
}
while
(
0
);
return
-
EINVAL
;
}
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
kcmd
,
(
unsigned
long
)
karg
);
set_fs
(
old_fs
);
switch
(
cmd
)
{
case
PPPIOCGIDLE32
:
if
(
err
)
return
err
;
idle32
.
xmit_idle
=
idle
.
xmit_idle
;
idle32
.
recv_idle
=
idle
.
recv_idle
;
if
(
copy_to_user
((
struct
ppp_idle32
*
)
arg
,
&
idle32
,
sizeof
(
struct
ppp_idle32
)))
return
-
EFAULT
;
break
;
case
PPPIOCSCOMPRESS32
:
kfree
(
data
.
ptr
);
break
;
default:
break
;
}
return
err
;
}
struct
mtget32
{
__u32
mt_type
;
__u32
mt_resid
;
__u32
mt_dsreg
;
__u32
mt_gstat
;
__u32
mt_erreg
;
compat_daddr_t
mt_fileno
;
compat_daddr_t
mt_blkno
;
};
#define MTIOCGET32 _IOR('m', 2, struct mtget32)
struct
mtpos32
{
__u32
mt_blkno
;
};
#define MTIOCPOS32 _IOR('m', 3, struct mtpos32)
struct
mtconfiginfo32
{
__u32
mt_type
;
__u32
ifc_type
;
__u16
irqnr
;
__u16
dmanr
;
__u16
port
;
__u32
debug
;
__u32
have_dens
:
1
;
__u32
have_bsf
:
1
;
__u32
have_fsr
:
1
;
__u32
have_bsr
:
1
;
__u32
have_eod
:
1
;
__u32
have_seek
:
1
;
__u32
have_tell
:
1
;
__u32
have_ras1
:
1
;
__u32
have_ras2
:
1
;
__u32
have_ras3
:
1
;
__u32
have_qfa
:
1
;
__u32
pad1
:
5
;
char
reserved
[
10
];
};
#define MTIOCGETCONFIG32 _IOR('m', 4, struct mtconfiginfo32)
#define MTIOCSETCONFIG32 _IOW('m', 5, struct mtconfiginfo32)
static
int
mt_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
mtconfiginfo
info
;
struct
mtget
get
;
struct
mtpos
pos
;
unsigned
long
kcmd
;
void
*
karg
;
int
err
=
0
;
switch
(
cmd
)
{
case
MTIOCPOS32
:
kcmd
=
MTIOCPOS
;
karg
=
&
pos
;
break
;
case
MTIOCGET32
:
kcmd
=
MTIOCGET
;
karg
=
&
get
;
break
;
case
MTIOCGETCONFIG32
:
kcmd
=
MTIOCGETCONFIG
;
karg
=
&
info
;
break
;
case
MTIOCSETCONFIG32
:
kcmd
=
MTIOCSETCONFIG
;
karg
=
&
info
;
err
=
__get_user
(
info
.
mt_type
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
mt_type
);
err
|=
__get_user
(
info
.
ifc_type
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
ifc_type
);
err
|=
__get_user
(
info
.
irqnr
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
irqnr
);
err
|=
__get_user
(
info
.
dmanr
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
dmanr
);
err
|=
__get_user
(
info
.
port
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
port
);
err
|=
__get_user
(
info
.
debug
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
debug
);
err
|=
__copy_from_user
((
char
*
)
&
info
.
debug
+
sizeof
(
info
.
debug
),
(
char
*
)
&
((
struct
mtconfiginfo32
*
)
arg
)
->
debug
+
sizeof
(((
struct
mtconfiginfo32
*
)
arg
)
->
debug
),
sizeof
(
__u32
));
if
(
err
)
return
-
EFAULT
;
break
;
default:
do
{
static
int
count
=
0
;
if
(
++
count
<=
20
)
printk
(
KERN_WARNING
"mt_ioctl: Unknown cmd fd(%d) "
"cmd(%08x) arg(%08x)
\n
"
,
(
int
)
fd
,
(
unsigned
int
)
cmd
,
(
unsigned
int
)
arg
);
}
while
(
0
);
return
-
EINVAL
;
}
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
kcmd
,
(
unsigned
long
)
karg
);
set_fs
(
old_fs
);
if
(
err
)
return
err
;
switch
(
cmd
)
{
case
MTIOCPOS32
:
err
=
__put_user
(
pos
.
mt_blkno
,
&
((
struct
mtpos32
*
)
arg
)
->
mt_blkno
);
break
;
case
MTIOCGET32
:
err
=
__put_user
(
get
.
mt_type
,
&
((
struct
mtget32
*
)
arg
)
->
mt_type
);
err
|=
__put_user
(
get
.
mt_resid
,
&
((
struct
mtget32
*
)
arg
)
->
mt_resid
);
err
|=
__put_user
(
get
.
mt_dsreg
,
&
((
struct
mtget32
*
)
arg
)
->
mt_dsreg
);
err
|=
__put_user
(
get
.
mt_gstat
,
&
((
struct
mtget32
*
)
arg
)
->
mt_gstat
);
err
|=
__put_user
(
get
.
mt_erreg
,
&
((
struct
mtget32
*
)
arg
)
->
mt_erreg
);
err
|=
__put_user
(
get
.
mt_fileno
,
&
((
struct
mtget32
*
)
arg
)
->
mt_fileno
);
err
|=
__put_user
(
get
.
mt_blkno
,
&
((
struct
mtget32
*
)
arg
)
->
mt_blkno
);
break
;
case
MTIOCGETCONFIG32
:
err
=
__put_user
(
info
.
mt_type
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
mt_type
);
err
|=
__put_user
(
info
.
ifc_type
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
ifc_type
);
err
|=
__put_user
(
info
.
irqnr
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
irqnr
);
err
|=
__put_user
(
info
.
dmanr
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
dmanr
);
err
|=
__put_user
(
info
.
port
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
port
);
err
|=
__put_user
(
info
.
debug
,
&
((
struct
mtconfiginfo32
*
)
arg
)
->
debug
);
err
|=
__copy_to_user
((
char
*
)
&
((
struct
mtconfiginfo32
*
)
arg
)
->
debug
+
sizeof
(((
struct
mtconfiginfo32
*
)
arg
)
->
debug
),
(
char
*
)
&
info
.
debug
+
sizeof
(
info
.
debug
),
sizeof
(
__u32
));
break
;
case
MTIOCSETCONFIG32
:
break
;
}
return
err
?
-
EFAULT
:
0
;
}
struct
cdrom_read32
{
int
cdread_lba
;
compat_caddr_t
cdread_bufaddr
;
int
cdread_buflen
;
};
struct
cdrom_read_audio32
{
union
cdrom_addr
addr
;
u_char
addr_format
;
int
nframes
;
compat_caddr_t
buf
;
};
struct
cdrom_generic_command32
{
unsigned
char
cmd
[
CDROM_PACKET_SIZE
];
compat_caddr_t
buffer
;
unsigned
int
buflen
;
int
stat
;
compat_caddr_t
sense
;
compat_caddr_t
reserved
[
3
];
};
static
int
cdrom_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
cdrom_read
cdread
;
struct
cdrom_read_audio
cdreadaudio
;
struct
cdrom_generic_command
cgc
;
compat_caddr_t
addr
;
char
*
data
=
0
;
void
*
karg
;
int
err
=
0
;
switch
(
cmd
)
{
case
CDROMREADMODE2
:
case
CDROMREADMODE1
:
case
CDROMREADRAW
:
case
CDROMREADCOOKED
:
karg
=
&
cdread
;
err
=
__get_user
(
cdread
.
cdread_lba
,
&
((
struct
cdrom_read32
*
)
arg
)
->
cdread_lba
);
err
|=
__get_user
(
addr
,
&
((
struct
cdrom_read32
*
)
arg
)
->
cdread_bufaddr
);
err
|=
__get_user
(
cdread
.
cdread_buflen
,
&
((
struct
cdrom_read32
*
)
arg
)
->
cdread_buflen
);
if
(
err
)
return
-
EFAULT
;
data
=
kmalloc
(
cdread
.
cdread_buflen
,
GFP_KERNEL
);
if
(
!
data
)
return
-
ENOMEM
;
cdread
.
cdread_bufaddr
=
data
;
break
;
case
CDROMREADAUDIO
:
karg
=
&
cdreadaudio
;
err
=
copy_from_user
(
&
cdreadaudio
.
addr
,
&
((
struct
cdrom_read_audio32
*
)
arg
)
->
addr
,
sizeof
(
cdreadaudio
.
addr
));
err
|=
__get_user
(
cdreadaudio
.
addr_format
,
&
((
struct
cdrom_read_audio32
*
)
arg
)
->
addr_format
);
err
|=
__get_user
(
cdreadaudio
.
nframes
,
&
((
struct
cdrom_read_audio32
*
)
arg
)
->
nframes
);
err
|=
__get_user
(
addr
,
&
((
struct
cdrom_read_audio32
*
)
arg
)
->
buf
);
if
(
err
)
return
-
EFAULT
;
data
=
kmalloc
(
cdreadaudio
.
nframes
*
2352
,
GFP_KERNEL
);
if
(
!
data
)
return
-
ENOMEM
;
cdreadaudio
.
buf
=
data
;
break
;
case
CDROM_SEND_PACKET
:
karg
=
&
cgc
;
err
=
copy_from_user
(
cgc
.
cmd
,
&
((
struct
cdrom_generic_command32
*
)
arg
)
->
cmd
,
sizeof
(
cgc
.
cmd
));
err
|=
__get_user
(
addr
,
&
((
struct
cdrom_generic_command32
*
)
arg
)
->
buffer
);
err
|=
__get_user
(
cgc
.
buflen
,
&
((
struct
cdrom_generic_command32
*
)
arg
)
->
buflen
);
if
(
err
)
return
-
EFAULT
;
if
((
data
=
kmalloc
(
cgc
.
buflen
,
GFP_KERNEL
))
==
NULL
)
return
-
ENOMEM
;
cgc
.
buffer
=
data
;
break
;
default:
do
{
static
int
count
=
0
;
if
(
++
count
<=
20
)
printk
(
KERN_WARNING
"cdrom_ioctl: Unknown cmd fd(%d) "
"cmd(%08x) arg(%08x)
\n
"
,
(
int
)
fd
,
(
unsigned
int
)
cmd
,
(
unsigned
int
)
arg
);
}
while
(
0
);
return
-
EINVAL
;
}
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
karg
);
set_fs
(
old_fs
);
if
(
err
)
goto
out
;
switch
(
cmd
)
{
case
CDROMREADMODE2
:
case
CDROMREADMODE1
:
case
CDROMREADRAW
:
case
CDROMREADCOOKED
:
err
=
copy_to_user
((
char
*
)
A
(
addr
),
data
,
cdread
.
cdread_buflen
);
break
;
case
CDROMREADAUDIO
:
err
=
copy_to_user
((
char
*
)
A
(
addr
),
data
,
cdreadaudio
.
nframes
*
2352
);
break
;
case
CDROM_SEND_PACKET
:
err
=
copy_to_user
((
char
*
)
A
(
addr
),
data
,
cgc
.
buflen
);
break
;
default:
break
;
}
out:
if
(
data
)
kfree
(
data
);
return
err
?
-
EFAULT
:
0
;
}
struct
loop_info32
{
int
lo_number
;
/* ioctl r/o */
compat_dev_t
lo_device
;
/* ioctl r/o */
unsigned
int
lo_inode
;
/* ioctl r/o */
compat_dev_t
lo_rdevice
;
/* ioctl r/o */
int
lo_offset
;
int
lo_encrypt_type
;
int
lo_encrypt_key_size
;
/* ioctl w/o */
int
lo_flags
;
/* ioctl r/o */
char
lo_name
[
LO_NAME_SIZE
];
unsigned
char
lo_encrypt_key
[
LO_KEY_SIZE
];
/* ioctl w/o */
unsigned
int
lo_init
[
2
];
char
reserved
[
4
];
};
static
int
loop_status
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
mm_segment_t
old_fs
=
get_fs
();
struct
loop_info
l
;
int
err
=
-
EINVAL
;
switch
(
cmd
)
{
case
LOOP_SET_STATUS
:
err
=
get_user
(
l
.
lo_number
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_number
);
err
|=
__get_user
(
l
.
lo_device
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_device
);
err
|=
__get_user
(
l
.
lo_inode
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_inode
);
err
|=
__get_user
(
l
.
lo_rdevice
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_rdevice
);
err
|=
__copy_from_user
((
char
*
)
&
l
.
lo_offset
,
(
char
*
)
&
((
struct
loop_info32
*
)
arg
)
->
lo_offset
,
8
+
(
unsigned
long
)
l
.
lo_init
-
(
unsigned
long
)
&
l
.
lo_offset
);
if
(
err
)
{
err
=
-
EFAULT
;
}
else
{
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
l
);
set_fs
(
old_fs
);
}
break
;
case
LOOP_GET_STATUS
:
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
l
);
set_fs
(
old_fs
);
if
(
!
err
)
{
err
=
put_user
(
l
.
lo_number
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_number
);
err
|=
__put_user
(
l
.
lo_device
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_device
);
err
|=
__put_user
(
l
.
lo_inode
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_inode
);
err
|=
__put_user
(
l
.
lo_rdevice
,
&
((
struct
loop_info32
*
)
arg
)
->
lo_rdevice
);
err
|=
__copy_to_user
((
char
*
)
&
((
struct
loop_info32
*
)
arg
)
->
lo_offset
,
(
char
*
)
&
l
.
lo_offset
,
(
unsigned
long
)
l
.
lo_init
-
(
unsigned
long
)
&
l
.
lo_offset
);
if
(
err
)
err
=
-
EFAULT
;
}
break
;
default:
{
static
int
count
=
0
;
if
(
++
count
<=
20
)
printk
(
KERN_WARNING
"%s: Unknown loop ioctl cmd, fd(%d) "
"cmd(%08x) arg(%08lx)
\n
"
,
__FUNCTION__
,
fd
,
cmd
,
arg
);
}
}
return
err
;
}
#ifdef CONFIG_VT
extern
int
tty_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
static
int
vt_check
(
struct
file
*
file
)
{
struct
tty_struct
*
tty
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
if
(
file
->
f_op
->
ioctl
!=
tty_ioctl
)
return
-
EINVAL
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_ioctl"
))
return
-
EINVAL
;
if
(
tty
->
driver
->
ioctl
!=
vt_ioctl
)
return
-
EINVAL
;
/*
* To have permissions to do most of the vt ioctls, we either have
* to be the owner of the tty, or have CAP_SYS_TTY_CONFIG
*/
if
(
current
->
tty
==
tty
||
capable
(
CAP_SYS_TTY_CONFIG
))
return
1
;
return
0
;
}
struct
consolefontdesc32
{
unsigned
short
charcount
;
/* characters in font (256 or 512) */
unsigned
short
charheight
;
/* scan lines per character (1-32) */
u32
chardata
;
/* font data in expanded form */
};
static
int
do_fontx_ioctl
(
unsigned
int
fd
,
int
cmd
,
struct
consolefontdesc32
*
user_cfd
,
struct
file
*
file
)
{
struct
consolefontdesc
cfdarg
;
struct
console_font_op
op
;
int
i
,
perm
;
perm
=
vt_check
(
file
);
if
(
perm
<
0
)
return
perm
;
if
(
copy_from_user
(
&
cfdarg
,
user_cfd
,
sizeof
(
struct
consolefontdesc32
)))
return
-
EFAULT
;
cfdarg
.
chardata
=
(
unsigned
char
*
)
A
(((
struct
consolefontdesc32
*
)
&
cfdarg
)
->
chardata
);
switch
(
cmd
)
{
case
PIO_FONTX
:
if
(
!
perm
)
return
-
EPERM
;
op
.
op
=
KD_FONT_OP_SET
;
op
.
flags
=
0
;
op
.
width
=
8
;
op
.
height
=
cfdarg
.
charheight
;
op
.
charcount
=
cfdarg
.
charcount
;
op
.
data
=
cfdarg
.
chardata
;
return
con_font_op
(
fg_console
,
&
op
);
case
GIO_FONTX
:
if
(
!
cfdarg
.
chardata
)
return
0
;
op
.
op
=
KD_FONT_OP_GET
;
op
.
flags
=
0
;
op
.
width
=
8
;
op
.
height
=
cfdarg
.
charheight
;
op
.
charcount
=
cfdarg
.
charcount
;
op
.
data
=
cfdarg
.
chardata
;
i
=
con_font_op
(
fg_console
,
&
op
);
if
(
i
)
return
i
;
cfdarg
.
charheight
=
op
.
height
;
cfdarg
.
charcount
=
op
.
charcount
;
((
struct
consolefontdesc32
*
)
&
cfdarg
)
->
chardata
=
(
unsigned
long
)
cfdarg
.
chardata
;
if
(
copy_to_user
(
user_cfd
,
&
cfdarg
,
sizeof
(
struct
consolefontdesc32
)))
return
-
EFAULT
;
return
0
;
}
return
-
EINVAL
;
}
struct
console_font_op32
{
unsigned
int
op
;
/* operation code KD_FONT_OP_* */
unsigned
int
flags
;
/* KD_FONT_FLAG_* */
unsigned
int
width
,
height
;
/* font size */
unsigned
int
charcount
;
u32
data
;
/* font data with height fixed to 32 */
};
static
int
do_kdfontop_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
struct
console_font_op32
*
fontop
,
struct
file
*
file
)
{
struct
console_font_op
op
;
int
perm
=
vt_check
(
file
),
i
;
struct
vt_struct
*
vt
;
if
(
perm
<
0
)
return
perm
;
if
(
copy_from_user
(
&
op
,
(
void
*
)
fontop
,
sizeof
(
struct
console_font_op32
)))
return
-
EFAULT
;
if
(
!
perm
&&
op
.
op
!=
KD_FONT_OP_GET
)
return
-
EPERM
;
op
.
data
=
(
unsigned
char
*
)
A
(((
struct
console_font_op32
*
)
&
op
)
->
data
);
op
.
flags
|=
KD_FONT_FLAG_OLD
;
vt
=
(
struct
vt_struct
*
)((
struct
tty_struct
*
)
file
->
private_data
)
->
driver_data
;
i
=
con_font_op
(
vt
->
vc_num
,
&
op
);
if
(
i
)
return
i
;
((
struct
console_font_op32
*
)
&
op
)
->
data
=
(
unsigned
long
)
op
.
data
;
if
(
copy_to_user
((
void
*
)
fontop
,
&
op
,
sizeof
(
struct
console_font_op32
)))
return
-
EFAULT
;
return
0
;
}
struct
unimapdesc32
{
unsigned
short
entry_ct
;
u32
entries
;
};
static
int
do_unimap_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
struct
unimapdesc32
*
user_ud
,
struct
file
*
file
)
{
struct
unimapdesc32
tmp
;
int
perm
=
vt_check
(
file
);
if
(
perm
<
0
)
return
perm
;
if
(
copy_from_user
(
&
tmp
,
user_ud
,
sizeof
tmp
))
return
-
EFAULT
;
switch
(
cmd
)
{
case
PIO_UNIMAP
:
if
(
!
perm
)
return
-
EPERM
;
return
con_set_unimap
(
fg_console
,
tmp
.
entry_ct
,
(
struct
unipair
*
)
A
(
tmp
.
entries
));
case
GIO_UNIMAP
:
return
con_get_unimap
(
fg_console
,
tmp
.
entry_ct
,
&
(
user_ud
->
entry_ct
),
(
struct
unipair
*
)
A
(
tmp
.
entries
));
}
return
0
;
}
#endif
#if 0
static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long arg)
{
mm_segment_t old_fs = get_fs();
__kernel_uid_t kuid;
int err;
cmd = SMB_IOC_GETMOUNTUID;
set_fs(KERNEL_DS);
err = sys_ioctl(fd, cmd, (unsigned long)&kuid);
set_fs(old_fs);
if (err >= 0)
err = put_user(kuid, (compat_uid_t *)arg);
return err;
}
#endif
struct
atmif_sioc32
{
int
number
;
int
length
;
compat_caddr_t
arg
;
};
struct
atm_iobuf32
{
int
length
;
compat_caddr_t
buffer
;
};
#define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32)
#define ATM_GETNAMES32 _IOW('a', ATMIOC_ITF+3, struct atm_iobuf32)
#define ATM_GETTYPE32 _IOW('a', ATMIOC_ITF+4, struct atmif_sioc32)
#define ATM_GETESI32 _IOW('a', ATMIOC_ITF+5, struct atmif_sioc32)
#define ATM_GETADDR32 _IOW('a', ATMIOC_ITF+6, struct atmif_sioc32)
#define ATM_RSTADDR32 _IOW('a', ATMIOC_ITF+7, struct atmif_sioc32)
#define ATM_ADDADDR32 _IOW('a', ATMIOC_ITF+8, struct atmif_sioc32)
#define ATM_DELADDR32 _IOW('a', ATMIOC_ITF+9, struct atmif_sioc32)
#define ATM_GETCIRANGE32 _IOW('a', ATMIOC_ITF+10, struct atmif_sioc32)
#define ATM_SETCIRANGE32 _IOW('a', ATMIOC_ITF+11, struct atmif_sioc32)
#define ATM_SETESI32 _IOW('a', ATMIOC_ITF+12, struct atmif_sioc32)
#define ATM_SETESIF32 _IOW('a', ATMIOC_ITF+13, struct atmif_sioc32)
#define ATM_GETSTAT32 _IOW('a', ATMIOC_SARCOM+0, struct atmif_sioc32)
#define ATM_GETSTATZ32 _IOW('a', ATMIOC_SARCOM+1, struct atmif_sioc32)
#define ATM_GETLOOP32 _IOW('a', ATMIOC_SARCOM+2, struct atmif_sioc32)
#define ATM_SETLOOP32 _IOW('a', ATMIOC_SARCOM+3, struct atmif_sioc32)
#define ATM_QUERYLOOP32 _IOW('a', ATMIOC_SARCOM+4, struct atmif_sioc32)
static
struct
{
unsigned
int
cmd32
;
unsigned
int
cmd
;
}
atm_ioctl_map
[]
=
{
{
ATM_GETLINKRATE32
,
ATM_GETLINKRATE
},
{
ATM_GETNAMES32
,
ATM_GETNAMES
},
{
ATM_GETTYPE32
,
ATM_GETTYPE
},
{
ATM_GETESI32
,
ATM_GETESI
},
{
ATM_GETADDR32
,
ATM_GETADDR
},
{
ATM_RSTADDR32
,
ATM_RSTADDR
},
{
ATM_ADDADDR32
,
ATM_ADDADDR
},
{
ATM_DELADDR32
,
ATM_DELADDR
},
{
ATM_GETCIRANGE32
,
ATM_GETCIRANGE
},
{
ATM_SETCIRANGE32
,
ATM_SETCIRANGE
},
{
ATM_SETESI32
,
ATM_SETESI
},
{
ATM_SETESIF32
,
ATM_SETESIF
},
{
ATM_GETSTAT32
,
ATM_GETSTAT
},
{
ATM_GETSTATZ32
,
ATM_GETSTATZ
},
{
ATM_GETLOOP32
,
ATM_GETLOOP
},
{
ATM_SETLOOP32
,
ATM_SETLOOP
},
{
ATM_QUERYLOOP32
,
ATM_QUERYLOOP
}
};
#define NR_ATM_IOCTL (sizeof(atm_ioctl_map)/sizeof(atm_ioctl_map[0]))
static
int
do_atm_iobuf
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
atm_iobuf32
iobuf32
;
struct
atm_iobuf
iobuf
=
{
0
,
NULL
};
mm_segment_t
old_fs
;
int
err
;
err
=
copy_from_user
(
&
iobuf32
,
(
struct
atm_iobuf32
*
)
arg
,
sizeof
(
struct
atm_iobuf32
));
if
(
err
)
return
-
EFAULT
;
iobuf
.
length
=
iobuf32
.
length
;
if
(
iobuf32
.
buffer
==
(
compat_caddr_t
)
NULL
||
iobuf32
.
length
==
0
)
{
iobuf
.
buffer
=
(
void
*
)(
unsigned
long
)
iobuf32
.
buffer
;
}
else
{
iobuf
.
buffer
=
kmalloc
(
iobuf
.
length
,
GFP_KERNEL
);
if
(
iobuf
.
buffer
==
NULL
)
{
err
=
-
ENOMEM
;
goto
out
;
}
err
=
copy_from_user
(
iobuf
.
buffer
,
B
(
iobuf32
.
buffer
),
iobuf
.
length
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
iobuf
);
set_fs
(
old_fs
);
if
(
err
)
goto
out
;
if
(
iobuf
.
buffer
&&
iobuf
.
length
>
0
)
{
err
=
copy_to_user
(
B
(
iobuf32
.
buffer
),
iobuf
.
buffer
,
iobuf
.
length
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
}
err
=
__put_user
(
iobuf
.
length
,
&
(((
struct
atm_iobuf32
*
)
arg
)
->
length
));
out:
if
(
iobuf32
.
buffer
&&
iobuf32
.
length
>
0
)
kfree
(
iobuf
.
buffer
);
return
err
;
}
static
int
do_atmif_sioc
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
atmif_sioc32
sioc32
;
struct
atmif_sioc
sioc
=
{
0
,
0
,
NULL
};
mm_segment_t
old_fs
;
int
err
;
err
=
copy_from_user
(
&
sioc32
,
(
struct
atmif_sioc32
*
)
arg
,
sizeof
(
struct
atmif_sioc32
));
if
(
err
)
return
-
EFAULT
;
sioc
.
number
=
sioc32
.
number
;
sioc
.
length
=
sioc32
.
length
;
if
(
sioc32
.
arg
==
(
compat_caddr_t
)
NULL
||
sioc32
.
length
==
0
)
{
sioc
.
arg
=
(
void
*
)(
unsigned
long
)
sioc32
.
arg
;
}
else
{
sioc
.
arg
=
kmalloc
(
sioc
.
length
,
GFP_KERNEL
);
if
(
sioc
.
arg
==
NULL
)
{
err
=
-
ENOMEM
;
goto
out
;
}
err
=
copy_from_user
(
sioc
.
arg
,
B
(
sioc32
.
arg
),
sioc32
.
length
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
}
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
sioc
);
set_fs
(
old_fs
);
if
(
err
)
{
goto
out
;
}
if
(
sioc
.
arg
&&
sioc
.
length
>
0
)
{
err
=
copy_to_user
(
B
(
sioc32
.
arg
),
sioc
.
arg
,
sioc
.
length
);
if
(
err
)
{
err
=
-
EFAULT
;
goto
out
;
}
}
err
=
__put_user
(
sioc
.
length
,
&
(((
struct
atmif_sioc32
*
)
arg
)
->
length
));
out:
if
(
sioc32
.
arg
&&
sioc32
.
length
>
0
)
kfree
(
sioc
.
arg
);
return
err
;
}
static
int
do_atm_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd32
,
unsigned
long
arg
)
{
int
i
;
unsigned
int
cmd
=
0
;
switch
(
cmd32
)
{
case
SONET_GETSTAT
:
case
SONET_GETSTATZ
:
case
SONET_GETDIAG
:
case
SONET_SETDIAG
:
case
SONET_CLRDIAG
:
case
SONET_SETFRAMING
:
case
SONET_GETFRAMING
:
case
SONET_GETFRSENSE
:
return
do_atmif_sioc
(
fd
,
cmd32
,
arg
);
}
for
(
i
=
0
;
i
<
NR_ATM_IOCTL
;
i
++
)
{
if
(
cmd32
==
atm_ioctl_map
[
i
].
cmd32
)
{
cmd
=
atm_ioctl_map
[
i
].
cmd
;
break
;
}
}
if
(
i
==
NR_ATM_IOCTL
)
{
return
-
EINVAL
;
}
switch
(
cmd
)
{
case
ATM_GETNAMES
:
return
do_atm_iobuf
(
fd
,
cmd
,
arg
);
case
ATM_GETLINKRATE
:
case
ATM_GETTYPE
:
case
ATM_GETESI
:
case
ATM_GETADDR
:
case
ATM_RSTADDR
:
case
ATM_ADDADDR
:
case
ATM_DELADDR
:
case
ATM_GETCIRANGE
:
case
ATM_SETCIRANGE
:
case
ATM_SETESI
:
case
ATM_SETESIF
:
case
ATM_GETSTAT
:
case
ATM_GETSTATZ
:
case
ATM_GETLOOP
:
case
ATM_SETLOOP
:
case
ATM_QUERYLOOP
:
return
do_atmif_sioc
(
fd
,
cmd
,
arg
);
}
return
-
EINVAL
;
}
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
/* This really belongs in include/linux/drm.h -DaveM */
#include "../../../drivers/char/drm/drm.h"
...
...
@@ -2323,137 +561,6 @@ static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
#endif
static
int
ret_einval
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
-
EINVAL
;
}
static
int
broken_blkgetsize
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
/* The mkswap binary hard codes it to Intel value :-((( */
return
w_long
(
fd
,
BLKGETSIZE
,
arg
);
}
struct
blkpg_ioctl_arg32
{
int
op
;
int
flags
;
int
datalen
;
u32
data
;
};
static
int
blkpg_ioctl_trans
(
unsigned
int
fd
,
unsigned
int
cmd
,
struct
blkpg_ioctl_arg32
*
arg
)
{
struct
blkpg_ioctl_arg
a
;
struct
blkpg_partition
p
;
int
err
;
mm_segment_t
old_fs
=
get_fs
();
err
=
get_user
(
a
.
op
,
&
arg
->
op
);
err
|=
__get_user
(
a
.
flags
,
&
arg
->
flags
);
err
|=
__get_user
(
a
.
datalen
,
&
arg
->
datalen
);
err
|=
__get_user
((
long
)
a
.
data
,
&
arg
->
data
);
if
(
err
)
return
err
;
switch
(
a
.
op
)
{
case
BLKPG_ADD_PARTITION
:
case
BLKPG_DEL_PARTITION
:
if
(
a
.
datalen
<
sizeof
(
struct
blkpg_partition
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
p
,
a
.
data
,
sizeof
(
struct
blkpg_partition
)))
return
-
EFAULT
;
a
.
data
=
&
p
;
set_fs
(
KERNEL_DS
);
err
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
a
);
set_fs
(
old_fs
);
default:
return
-
EINVAL
;
}
return
err
;
}
/* Fix sizeof(sizeof()) breakage */
#define BLKBSZGET_32 _IOR(0x12,112,int)
#define BLKBSZSET_32 _IOW(0x12,113,int)
#define BLKGETSIZE64_32 _IOR(0x12,114,int)
static
int
do_blkbszget
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
sys_ioctl
(
fd
,
BLKBSZGET
,
arg
);
}
static
int
do_blkbszset
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
sys_ioctl
(
fd
,
BLKBSZSET
,
arg
);
}
static
int
do_blkgetsize64
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
sys_ioctl
(
fd
,
BLKGETSIZE64
,
arg
);
}
static
int
ioc_settimeout
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
rw_long
(
fd
,
AUTOFS_IOC_SETTIMEOUT
,
arg
);
}
/* USB to be done */
struct
serial_struct32
{
int
type
;
int
line
;
unsigned
int
port
;
int
irq
;
int
flags
;
int
xmit_fifo_size
;
int
custom_divisor
;
int
baud_base
;
unsigned
short
close_delay
;
char
io_type
;
char
reserved_char
[
1
];
int
hub6
;
unsigned
short
closing_wait
;
/* time to wait before closing */
unsigned
short
closing_wait2
;
/* no longer used... */
unsigned
int
iomem_base
;
/* char * really */
unsigned
short
iomem_reg_shift
;
unsigned
int
port_high
;
int
reserved
[
1
];
};
static
int
do_tiocgserial
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
serial_struct
ss
;
int
ret
;
struct
serial_struct32
*
uptr
=
(
struct
serial_struct32
*
)
arg
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_ioctl
(
fd
,
cmd
,
(
unsigned
long
)
&
ss
);
set_fs
(
old_fs
);
if
(
!
ret
)
{
/* structs match up to iomem_base */
ret
=
copy_to_user
(
uptr
,
&
ss
,
sizeof
(
struct
serial_struct32
));
ret
|=
put_user
(
ss
.
iomem_base
,
&
uptr
->
iomem_base
);
ret
|=
put_user
(
ss
.
iomem_reg_shift
,
&
uptr
->
iomem_reg_shift
);
ret
|=
put_user
(
ss
.
port_high
,
&
uptr
->
port_high
);
if
(
ret
)
ret
=
-
EFAULT
;
}
return
ret
;
}
int
siocdevprivate_ioctl
(
unsigned
int
fd
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
err
=
sys_ioctl
(
fd
,
cmd
,
arg
);
if
((
unsigned
)
err
>
-
4095
)
printk
(
KERN_WARNING
"ioctl(%d, 0x%x, %p) -- SIOCDEVPRIVATE-based ioctls aren't really
\n
"
"supported, though some will work by accident.
\n
"
,
fd
,
cmd
,
(
void
*
)
arg
);
return
err
;
}
#define HANDLE_IOCTL(cmd, handler) { cmd, (ioctl_trans_handler_t)handler, 0 },
#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl)
...
...
@@ -2463,6 +570,9 @@ int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
IOCTL_TABLE_START
#include <linux/compat_ioctl.h>
#define DECLARES
#include "compat_ioctl.c"
/* Might be moved to compat_ioctl.h with some ifdefs... */
COMPATIBLE_IOCTL
(
TIOCSTART
)
COMPATIBLE_IOCTL
(
TIOCSTOP
)
...
...
@@ -2474,132 +584,10 @@ COMPATIBLE_IOCTL(PA_PERF_OFF)
COMPATIBLE_IOCTL
(
PA_PERF_VERSION
)
/* And these ioctls need translation */
HANDLE_IOCTL
(
TIOCGSERIAL
,
do_tiocgserial
)
HANDLE_IOCTL
(
SIOCGIFNAME
,
dev_ifname32
)
HANDLE_IOCTL
(
SIOCGIFCONF
,
dev_ifconf
)
HANDLE_IOCTL
(
SIOCGIFFLAGS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFFLAGS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFMETRIC
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFMETRIC
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFMTU
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFMTU
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFMEM
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFMEM
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFHWADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFHWADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCADDMULTI
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCDELMULTI
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFINDEX
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFMAP
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFMAP
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFBRDADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFBRDADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFDSTADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFDSTADDR
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFNETMASK
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFNETMASK
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFPFLAGS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFPFLAGS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGPPPSTATS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGPPPCSTATS
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGPPPVER
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCGIFTXQLEN
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCSIFTXQLEN
,
dev_ifsioc
)
HANDLE_IOCTL
(
SIOCADDRT
,
routing_ioctl
)
HANDLE_IOCTL
(
SIOCDELRT
,
routing_ioctl
)
/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
HANDLE_IOCTL
(
SIOCRTMSG
,
ret_einval
)
HANDLE_IOCTL
(
SIOCGSTAMP
,
do_siocgstamp
)
HANDLE_IOCTL
(
HDIO_GETGEO
,
hdio_getgeo
)
HANDLE_IOCTL
(
BLKGETSIZE
,
w_long
)
HANDLE_IOCTL
(
0x1260
,
broken_blkgetsize
)
HANDLE_IOCTL
(
BLKSECTGET
,
w_long
)
HANDLE_IOCTL
(
BLKPG
,
blkpg_ioctl_trans
)
/* take care of sizeof(sizeof()) breakage */
/* block stuff */
HANDLE_IOCTL
(
BLKBSZGET_32
,
do_blkbszget
)
HANDLE_IOCTL
(
BLKBSZSET_32
,
do_blkbszset
)
HANDLE_IOCTL
(
BLKGETSIZE64_32
,
do_blkgetsize64
)
HANDLE_IOCTL
(
FBIOGET_FSCREENINFO
,
fb_ioctl_trans
)
HANDLE_IOCTL
(
FBIOGETCMAP
,
fb_ioctl_trans
)
HANDLE_IOCTL
(
FBIOPUTCMAP
,
fb_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_UNMASKINTR
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_DMA
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_32BIT
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_MULTCOUNT
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_NOWERR
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
HDIO_GET_NICE
,
hdio_ioctl_trans
)
HANDLE_IOCTL
(
FDSETPRM32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDDEFPRM32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDGETPRM32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDSETDRVPRM32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDGETDRVPRM32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDGETDRVSTAT32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDPOLLDRVSTAT32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDGETFDCSTAT32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
FDWERRORGET32
,
fd_ioctl_trans
)
HANDLE_IOCTL
(
PPPIOCGIDLE32
,
ppp_ioctl_trans
)
HANDLE_IOCTL
(
PPPIOCSCOMPRESS32
,
ppp_ioctl_trans
)
HANDLE_IOCTL
(
MTIOCGET32
,
mt_ioctl_trans
)
HANDLE_IOCTL
(
MTIOCPOS32
,
mt_ioctl_trans
)
HANDLE_IOCTL
(
MTIOCGETCONFIG32
,
mt_ioctl_trans
)
HANDLE_IOCTL
(
MTIOCSETCONFIG32
,
mt_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADMODE2
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADMODE1
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADRAW
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADCOOKED
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADAUDIO
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROMREADALL
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
CDROM_SEND_PACKET
,
cdrom_ioctl_trans
)
HANDLE_IOCTL
(
LOOP_SET_STATUS
,
loop_status
)
HANDLE_IOCTL
(
LOOP_GET_STATUS
,
loop_status
)
#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
HANDLE_IOCTL
(
AUTOFS_IOC_SETTIMEOUT32
,
ioc_settimeout
)
#ifdef CONFIG_VT
HANDLE_IOCTL
(
PIO_FONTX
,
do_fontx_ioctl
)
HANDLE_IOCTL
(
GIO_FONTX
,
do_fontx_ioctl
)
HANDLE_IOCTL
(
PIO_UNIMAP
,
do_unimap_ioctl
)
HANDLE_IOCTL
(
GIO_UNIMAP
,
do_unimap_ioctl
)
HANDLE_IOCTL
(
KDFONTOP
,
do_kdfontop_ioctl
)
#endif
HANDLE_IOCTL
(
EXT2_IOC32_GETFLAGS
,
do_ext2_ioctl
)
HANDLE_IOCTL
(
EXT2_IOC32_SETFLAGS
,
do_ext2_ioctl
)
HANDLE_IOCTL
(
EXT2_IOC32_GETVERSION
,
do_ext2_ioctl
)
HANDLE_IOCTL
(
EXT2_IOC32_SETVERSION
,
do_ext2_ioctl
)
#if 0
/* One SMB ioctl needs translations. */
#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid)
#endif
HANDLE_IOCTL
(
ATM_GETLINKRATE32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETNAMES32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETTYPE32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETESI32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETADDR32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_RSTADDR32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_ADDADDR32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_DELADDR32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETCIRANGE32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_SETCIRANGE32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_SETESI32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_SETESIF32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETSTAT32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETSTATZ32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_GETLOOP32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_SETLOOP32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
ATM_QUERYLOOP32
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_GETSTAT
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_GETSTATZ
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_GETDIAG
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_SETDIAG
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_CLRDIAG
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_SETFRAMING
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_GETFRAMING
,
do_atm_ioctl
)
HANDLE_IOCTL
(
SONET_GETFRSENSE
,
do_atm_ioctl
)
#if defined(CONFIG_GEN_RTC)
COMPATIBLE_IOCTL
(
RTC_AIE_ON
)
COMPATIBLE_IOCTL
(
RTC_AIE_OFF
)
...
...
@@ -2618,6 +606,7 @@ COMPATIBLE_IOCTL(RTC_IRQP_SET)
HANDLE_IOCTL
(
RTC_EPOCH_READ
,
w_long
)
COMPATIBLE_IOCTL
(
RTC_EPOCH_SET
)
#endif
#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
HANDLE_IOCTL
(
DRM32_IOCTL_VERSION
,
drm32_version
);
HANDLE_IOCTL
(
DRM32_IOCTL_GET_UNIQUE
,
drm32_getsetunique
);
...
...
arch/parisc/kernel/pacache.S
View file @
cf3f977a
...
...
@@ -79,13 +79,13 @@ flush_tlb_all_local:
ldil
L
%
REAL_MODE_PSW
,
%
r1
ldo
R
%
REAL_MODE_PSW
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr22
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
ldil
L
%
PA
(
1
f
),%
r1
ldo
R
%
PA
(
1
f
)(%
r1
),%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
rfi
nop
...
...
@@ -185,13 +185,13 @@ fdtdone:
ldo
R
%
KERNEL_PSW
(%
r1
),
%
r1
or
%
r1
,%
r19
,%
r1
/*
Set
I
bit
if
set
on
entry
*/
mtctl
%
r1
,
%
cr22
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
ldil
L
%(
2
f
),
%
r1
ldo
R
%(
2
f
)(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
rfi
nop
...
...
@@ -837,13 +837,13 @@ disable_sr_hashing_asm:
ldil
L
%
REAL_MODE_PSW
,
%
r1
ldo
R
%
REAL_MODE_PSW
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr22
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
ldil
L
%
PA
(
1
f
),%
r1
ldo
R
%
PA
(
1
f
)(%
r1
),%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
rfi
nop
...
...
@@ -889,13 +889,13 @@ srdis_done:
ldil
L
%
KERNEL_PSW
,
%
r1
ldo
R
%
KERNEL_PSW
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr22
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
ldil
L
%(
2
f
),
%
r1
ldo
R
%(
2
f
)(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
rfi
nop
...
...
arch/parisc/kernel/parisc_ksyms.c
View file @
cf3f977a
...
...
@@ -26,10 +26,6 @@ EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL
(
strstr
);
EXPORT_SYMBOL
(
strpbrk
);
#include <asm/processor.h>
EXPORT_SYMBOL
(
kernel_thread
);
EXPORT_SYMBOL
(
boot_cpu_data
);
#include <linux/pm.h>
EXPORT_SYMBOL
(
pm_power_off
);
...
...
@@ -64,15 +60,6 @@ EXPORT_SYMBOL(__memcpy_toio);
EXPORT_SYMBOL
(
__memcpy_fromio
);
EXPORT_SYMBOL
(
__memset_io
);
#include <asm/cache.h>
EXPORT_SYMBOL
(
flush_kernel_dcache_range_asm
);
EXPORT_SYMBOL
(
flush_kernel_dcache_page
);
EXPORT_SYMBOL
(
flush_data_cache_local
);
EXPORT_SYMBOL
(
flush_kernel_icache_range_asm
);
EXPORT_SYMBOL
(
flush_all_caches
);
EXPORT_SYMBOL
(
dcache_stride
);
EXPORT_SYMBOL
(
flush_cache_all_local
);
#include <asm/unistd.h>
extern
long
sys_open
(
const
char
*
,
int
,
int
);
extern
off_t
sys_lseek
(
int
,
off_t
,
int
);
...
...
arch/parisc/kernel/pdc_chassis.c
View file @
cf3f977a
...
...
@@ -2,7 +2,7 @@
* arch/parisc/kernel/pdc_chassis.c
*
* Copyright (C) 2002 Laurent Canet <canetl@esiee.fr>
* Copyright (C) 2002 Thibaut Varene <varenet@esiee.fr>
* Copyright (C) 2002
-2003
Thibaut Varene <varenet@esiee.fr>
*
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -35,6 +35,8 @@
#include <asm/pdc_chassis.h>
#include <asm/processor.h>
#ifdef CONFIG_PDC_CHASSIS
static
int
pdc_chassis_old
=
0
;
...
...
@@ -102,6 +104,7 @@ static struct notifier_block pdc_chassis_reboot_block = {
.
notifier_call
=
pdc_chassis_reboot_event
,
.
priority
=
INT_MAX
,
};
#endif
/* CONFIG_PDC_CHASSIS */
/**
...
...
@@ -110,16 +113,33 @@ static struct notifier_block pdc_chassis_reboot_block = {
void
__init
parisc_pdc_chassis_init
(
void
)
{
#ifdef CONFIG_PDC_CHASSIS
int
handle
=
0
;
DPRINTK
(
KERN_DEBUG
"%s: parisc_pdc_chassis_init()
\n
"
,
__FILE__
);
/* Let see if we have something to handle... */
/* Check for PDC_PAT or old LED Panel */
pdc_chassis_checkold
();
if
(
is_pdc_pat
())
{
#ifdef __LP64__
/* see pdc_chassis_send_status() */
printk
(
KERN_INFO
"Enabling PDC_PAT chassis codes support.
\n
"
);
handle
=
1
;
#endif
/* __LP64__ */
}
else
if
(
pdc_chassis_old
)
{
printk
(
KERN_INFO
"Enabling old style chassis LED panel support.
\n
"
);
handle
=
1
;
}
if
(
handle
)
{
/* initialize panic notifier chain */
notifier_chain_register
(
&
panic_notifier_list
,
&
pdc_chassis_panic_block
);
/* initialize reboot notifier chain */
register_reboot_notifier
(
&
pdc_chassis_reboot_block
);
/* Check for old LED Panel */
pdc_chassis_checkold
();
}
#endif
/* CONFIG_PDC_CHASSIS */
}
...
...
@@ -128,7 +148,8 @@ void __init parisc_pdc_chassis_init(void)
* and changes the front panel LEDs according to the new system state
* @retval: PDC call return value.
*
* Only machines with 64 bits PDC PAT and E-class are supported atm.
* Only machines with 64 bits PDC PAT and those reported in
* pdc_chassis_checkold() are supported atm.
*
* returns 0 if no error, -1 if no supported PDC is present or invalid message,
* else returns the appropriate PDC error code.
...
...
@@ -140,7 +161,7 @@ int pdc_chassis_send_status(int message)
{
/* Maybe we should do that in an other way ? */
int
retval
=
0
;
#ifdef CONFIG_PDC_CHASSIS
DPRINTK
(
KERN_DEBUG
"%s: pdc_chassis_send_status(%d)
\n
"
,
__FILE__
,
message
);
#ifdef __LP64__
/* pdc_pat_chassis_send_log is defined only when #ifdef __LP64__ */
...
...
@@ -199,7 +220,7 @@ int pdc_chassis_send_status(int message)
retval
=
-
1
;
}
}
else
retval
=
-
1
;
#endif
#endif
/* __LP64__ */
#endif
/* CONFIG_PDC_CHASSIS */
return
retval
;
}
arch/parisc/kernel/pdc_cons.c
View file @
cf3f977a
...
...
@@ -61,16 +61,6 @@ static struct tty_driver * pdc_console_device (struct console *c, int *index)
*
index
=
c
->
index
?
c
->
index
-
1
:
fg_console
;
return
&
console_driver
;
}
#elif defined(CONFIG_SERIAL_MUX)
#warning CONFIG_SERIAL_MUX
#define PDC_CONSOLE_DEVICE pdc_console_device
#warning "FIXME - should be: static struct tty_driver * pdc_console_device (struct console *c, int *index)"
static
kdev_t
pdc_console_device
(
struct
console
*
c
,
int
*
index
)
{
return
mk_kdev
(
MUX_MAJOR
,
0
);
}
#else
#define PDC_CONSOLE_DEVICE NULL
#endif
...
...
@@ -105,7 +95,7 @@ static void pdc_console_init_force(void)
void
__init
pdc_console_init
(
void
)
{
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE)
|| defined(CONFIG_SERIAL_MUX)
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE)
pdc_console_init_force
();
#endif
#ifdef EARLY_BOOTUP_DEBUG
...
...
arch/parisc/kernel/process.c
View file @
cf3f977a
...
...
@@ -179,6 +179,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
return
__kernel_thread
(
fn
,
arg
,
flags
);
}
EXPORT_SYMBOL
(
kernel_thread
);
/*
* Free current thread data structures etc..
...
...
arch/parisc/kernel/processor.c
View file @
cf3f977a
...
...
@@ -27,14 +27,12 @@
*
*/
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/
slab
.h>
#include <linux/
module
.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/delay.h>
#define PCI_DEBUG
#include <linux/pci.h>
#undef PCI_DEBUG
#include <linux/slab.h>
#include <asm/cache.h>
#include <asm/hardware.h>
/* for register_parisc_driver() stuff */
...
...
@@ -45,6 +43,8 @@
#include <asm/parisc-device.h>
struct
system_cpuinfo_parisc
boot_cpu_data
;
EXPORT_SYMBOL
(
boot_cpu_data
);
struct
cpuinfo_parisc
cpu_data
[
NR_CPUS
];
/*
...
...
@@ -105,11 +105,11 @@ static int __init processor_probe(struct parisc_device *dev)
status
=
pdc_pat_cell_module
(
&
bytecnt
,
dev
->
pcell_loc
,
dev
->
mod_index
,
PA_VIEW
,
&
pa_pdc_cell
);
ASSERT
(
PDC_OK
=
=
status
);
BUG_ON
(
PDC_OK
!
=
status
);
/* verify it's the same as what do_pat_inventory() found */
ASSERT
(
dev
->
mod_info
=
=
pa_pdc_cell
.
mod_info
);
ASSERT
(
dev
->
pmod_loc
=
=
pa_pdc_cell
.
mod_location
);
BUG_ON
(
dev
->
mod_info
!
=
pa_pdc_cell
.
mod_info
);
BUG_ON
(
dev
->
pmod_loc
!
=
pa_pdc_cell
.
mod_location
);
txn_addr
=
pa_pdc_cell
.
mod
[
0
];
/* id_eid for IO sapic */
...
...
@@ -122,7 +122,7 @@ static int __init processor_probe(struct parisc_device *dev)
/* get the cpu number */
status
=
pdc_pat_cpu_get_number
(
&
cpu_info
,
dev
->
hpa
);
ASSERT
(
PDC_OK
=
=
status
);
BUG_ON
(
PDC_OK
!
=
status
);
if
(
cpu_info
.
cpu_num
>=
NR_CPUS
)
{
printk
(
KERN_WARNING
"IGNORING CPU at 0x%x,"
...
...
arch/parisc/kernel/real2.S
View file @
cf3f977a
...
...
@@ -154,12 +154,12 @@ rfi_virt2real:
nop
rsm
(
PSW_SM_Q
|
PSW_SM_I
),%
r0
/*
disable
Q
&
I
bits
to
load
iia
queue
*/
mtctl
0
,
%
cr17
/*
space
0
*/
mtctl
0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
load32
PA
(
rfi_v2r_1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
load32
REAL_MODE_PSW
,
%
r1
mtctl
%
r1
,
%
cr22
rfi
...
...
@@ -191,12 +191,12 @@ rfi_real2virt:
nop
rsm
PSW_SM_Q
,%
r0
/*
disable
Q
bit
to
load
iia
queue
*/
mtctl
0
,
%
cr17
/*
space
0
*/
mtctl
0
,
%
cr17
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
tail
*/
mtctl
%
r0
,
%
cr17
/*
Clear
IIASQ
head
*/
load32
(
rfi_r2v_1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
head
*/
ldo
4
(%
r1
),
%
r1
mtctl
%
r1
,
%
cr18
mtctl
%
r1
,
%
cr18
/*
IIAOQ
tail
*/
load32
KERNEL_PSW
,
%
r1
mtctl
%
r1
,
%
cr22
rfi
...
...
arch/parisc/kernel/signal.c
View file @
cf3f977a
...
...
@@ -33,14 +33,23 @@
#include <asm/pgalloc.h>
#include <asm/cacheflush.h>
#ifdef CONFIG_COMPAT
#include <linux/compat.h>
#include "signal32.h"
#endif
#define DEBUG_SIG 0
#define DEBUG_SIG_LEVEL 2
#if DEBUG_SIG
#define DBG(x) printk x
#define DBG(LEVEL, ...) \
((DEBUG_SIG_LEVEL >= LEVEL) \
? printk(__VA_ARGS__) : (void) 0)
#else
#define DBG(
x
)
#define DBG(
LEVEL, ...
)
#endif
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
/* gcc will complain if a pointer is cast to an integer of different
...
...
@@ -52,43 +61,6 @@
int
do_signal
(
sigset_t
*
oldset
,
struct
pt_regs
*
regs
,
int
in_syscall
);
int
copy_siginfo_to_user
(
siginfo_t
*
to
,
siginfo_t
*
from
)
{
if
(
from
->
si_code
<
0
)
return
__copy_to_user
(
to
,
from
,
sizeof
(
siginfo_t
));
else
{
int
err
;
/*
* If you change siginfo_t structure, please be sure
* this code is fixed accordingly. It should never
* copy any pad contained in the structure to avoid
* security leaks, but must copy the generic 3 ints
* plus the relevant union member.
*/
err
=
__put_user
(
from
->
si_signo
,
&
to
->
si_signo
);
err
|=
__put_user
(
from
->
si_errno
,
&
to
->
si_errno
);
err
|=
__put_user
((
short
)
from
->
si_code
,
&
to
->
si_code
);
switch
(
from
->
si_code
>>
16
)
{
case
__SI_FAULT
>>
16
:
/* FIXME: should we put the interruption code here? */
case
__SI_POLL
>>
16
:
err
|=
__put_user
(
from
->
si_addr
,
&
to
->
si_addr
);
break
;
case
__SI_CHLD
>>
16
:
err
|=
__put_user
(
from
->
si_utime
,
&
to
->
si_utime
);
err
|=
__put_user
(
from
->
si_stime
,
&
to
->
si_stime
);
err
|=
__put_user
(
from
->
si_status
,
&
to
->
si_status
);
default:
err
|=
__put_user
(
from
->
si_uid
,
&
to
->
si_uid
);
err
|=
__put_user
(
from
->
si_pid
,
&
to
->
si_pid
);
break
;
/* case __SI_RT: This is not generated by the kernel as of now. */
}
return
err
;
}
}
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
...
...
@@ -101,26 +73,27 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs *regs)
{
sigset_t
saveset
,
newset
;
#ifdef __LP64__
/* XXX FIXME -- assumes 32-bit user app! */
compat_sigset_t
newset32
;
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
){
/* XXX: Don't preclude handling different sized sigset_t's. */
if
(
sigsetsize
!=
sizeof
(
compat_sigset_t
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
newset32
,
(
compat_sigset_t
*
)
unewset
,
sizeof
(
newset32
)))
return
-
EFAULT
;
sigset_32to64
(
&
newset
,
&
newset32
);
newset
.
sig
[
0
]
=
newset32
.
sig
[
0
]
|
((
unsigned
long
)
newset32
.
sig
[
1
]
<<
32
);
#e
lse
}
else
#e
ndif
{
/* XXX: Don't preclude handling different sized sigset_t's. */
if
(
sigsetsize
!=
sizeof
(
sigset_t
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
newset
,
unewset
,
sizeof
(
newset
)))
return
-
EFAULT
;
#endif
}
sigdelsetmask
(
&
newset
,
~
_BLOCKABLE
);
spin_lock_irq
(
&
current
->
sighand
->
siglock
);
...
...
@@ -161,7 +134,9 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs)
err
|=
__copy_from_user
(
regs
->
iaoq
,
sc
->
sc_iaoq
,
sizeof
(
regs
->
iaoq
));
err
|=
__copy_from_user
(
regs
->
iasq
,
sc
->
sc_iasq
,
sizeof
(
regs
->
iasq
));
err
|=
__get_user
(
regs
->
sar
,
&
sc
->
sc_sar
);
DBG
((
"restore_sigcontext: r28 is %ld
\n
"
,
regs
->
gr
[
28
]));
DBG
(
2
,
"restore_sigcontext: iaoq is 0x%#lx / 0x%#lx
\n
"
,
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
]);
DBG
(
2
,
"restore_sigcontext: r28 is %ld
\n
"
,
regs
->
gr
[
28
]);
return
err
;
}
...
...
@@ -174,6 +149,9 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
unsigned
long
usp
=
(
regs
->
gr
[
30
]
&
~
(
0x01UL
));
unsigned
long
sigframe_size
=
PARISC_RT_SIGFRAME_SIZE
;
#ifdef __LP64__
compat_sigset_t
compat_set
;
struct
compat_rt_sigframe
*
compat_frame
;
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
)
sigframe_size
=
PARISC_RT_SIGFRAME_SIZE32
;
#endif
...
...
@@ -182,10 +160,22 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
/* Unwind the user stack to get the rt_sigframe structure. */
frame
=
(
struct
rt_sigframe
*
)
(
usp
-
sigframe_size
);
DBG
((
"in sys_rt_sigreturn, frame is %p
\n
"
,
frame
));
DBG
(
2
,
"sys_rt_sigreturn: frame is %p
\n
"
,
frame
);
#ifdef __LP64__
compat_frame
=
(
struct
compat_rt_sigframe
*
)
frame
;
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
){
DBG
(
2
,
"sys_rt_sigreturn: ELF32 process.
\n
"
);
if
(
__copy_from_user
(
&
compat_set
,
&
compat_frame
->
uc
.
uc_sigmask
,
sizeof
(
compat_set
)))
goto
give_sigsegv
;
sigset_32to64
(
&
set
,
&
compat_set
);
}
else
#endif
{
if
(
__copy_from_user
(
&
set
,
&
frame
->
uc
.
uc_sigmask
,
sizeof
(
set
)))
goto
give_sigsegv
;
}
sigdelsetmask
(
&
set
,
~
_BLOCKABLE
);
spin_lock_irq
(
&
current
->
sighand
->
siglock
);
...
...
@@ -194,17 +184,32 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
spin_unlock_irq
(
&
current
->
sighand
->
siglock
);
/* Good thing we saved the old gr[30], eh? */
#ifdef __LP64__
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
){
DBG
(
1
,
"sys_rt_sigreturn: compat_frame->uc.uc_mcontext 0x%p
\n
"
,
&
compat_frame
->
uc
.
uc_mcontext
);
// FIXME: Load upper half from register file
if
(
restore_sigcontext32
(
&
compat_frame
->
uc
.
uc_mcontext
,
&
compat_frame
->
regs
,
regs
))
goto
give_sigsegv
;
DBG
(
1
,
"sys_rt_sigreturn: usp %#08lx stack 0x%p
\n
"
,
usp
,
&
compat_frame
->
uc
.
uc_stack
);
if
(
do_sigaltstack32
(
&
compat_frame
->
uc
.
uc_stack
,
NULL
,
usp
)
==
-
EFAULT
)
goto
give_sigsegv
;
}
else
#endif
{
DBG
(
1
,
"sys_rt_sigreturn: frame->uc.uc_mcontext 0x%p
\n
"
,
&
frame
->
uc
.
uc_mcontext
);
if
(
restore_sigcontext
(
&
frame
->
uc
.
uc_mcontext
,
regs
))
goto
give_sigsegv
;
DBG
((
"usp: %#08lx stack %p"
,
usp
,
&
frame
->
uc
.
uc_stack
));
/* I don't know why everyone else assumes they can call this
with a pointer to a stack_t on the kernel stack. That
makes no sense. Anyway we'll do it like m68k, since we
also are using segmentation in the same way as them. */
DBG
(
1
,
"sys_rt_sigreturn: usp %#08lx stack 0x%p
\n
"
,
usp
,
&
frame
->
uc
.
uc_stack
);
if
(
do_sigaltstack
(
&
frame
->
uc
.
uc_stack
,
NULL
,
usp
)
==
-
EFAULT
)
goto
give_sigsegv
;
}
/* If we are on the syscall path IAOQ will not be restored, and
* if we are on the interrupt path we must not corrupt gr31.
...
...
@@ -212,14 +217,13 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
if
(
in_syscall
)
regs
->
gr
[
31
]
=
regs
->
iaoq
[
0
];
#if DEBUG_SIG
DBG
((
"returning to %#lx
\n
"
,
regs
->
iaoq
[
0
]));
DBG
((
"in sys_rt_sigreturn:
\n
"
));
DBG
(
1
,
"sys_rt_sigreturn: returning to %#lx, DUMPING REGS:
\n
"
,
regs
->
iaoq
[
0
]);
show_regs
(
regs
);
#endif
return
;
give_sigsegv:
DBG
(
(
"sys_rt_sigreturn sending SIGSEGV
\n
"
)
);
DBG
(
1
,
"sys_rt_sigreturn: Sending SIGSEGV
\n
"
);
si
.
si_signo
=
SIGSEGV
;
si
.
si_errno
=
0
;
si
.
si_code
=
SI_KERNEL
;
...
...
@@ -237,9 +241,16 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
static
inline
void
*
get_sigframe
(
struct
k_sigaction
*
ka
,
unsigned
long
sp
,
size_t
frame_size
)
{
/*FIXME: ELF32 vs. ELF64 has different frame_size, but since we
don't use the parameter it doesn't matter */
DBG
(
1
,
"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx
\n
"
,
(
unsigned
long
)
ka
,
sp
,
frame_size
);
if
((
ka
->
sa
.
sa_flags
&
SA_ONSTACK
)
!=
0
&&
!
on_sig_stack
(
sp
))
sp
=
current
->
sas_ss_sp
;
/* Stacks grow up! */
DBG
(
1
,
"get_sigframe: Returning sp = %#lx
\n
"
,
(
unsigned
long
)
sp
);
return
(
void
*
)
sp
;
/* Stacks grow up. Fun. */
}
...
...
@@ -259,20 +270,20 @@ setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, int in_syscall)
err
|=
__put_user
(
regs
->
gr
[
31
]
+
4
,
&
sc
->
sc_iaoq
[
1
]);
err
|=
__put_user
(
regs
->
sr
[
3
],
&
sc
->
sc_iasq
[
0
]);
err
|=
__put_user
(
regs
->
sr
[
3
],
&
sc
->
sc_iasq
[
1
]);
DBG
(
(
"setup_sigcontext: iaoq %#lx/%#lx
\n
"
,
regs
->
gr
[
31
],
regs
->
gr
[
31
]
)
);
DBG
(
1
,
"setup_sigcontext: iaoq %#lx / %#lx (in syscall)
\n
"
,
regs
->
gr
[
31
],
regs
->
gr
[
31
]
+
4
);
}
else
{
err
|=
__copy_to_user
(
sc
->
sc_iaoq
,
regs
->
iaoq
,
sizeof
(
regs
->
iaoq
));
err
|=
__copy_to_user
(
sc
->
sc_iasq
,
regs
->
iasq
,
sizeof
(
regs
->
iasq
));
DBG
(
(
"setup_sigcontext: iaoq %#lx/%#lx
\n
"
,
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
])
)
;
DBG
(
1
,
"setup_sigcontext: iaoq %#lx / %#lx (not in syscall)
\n
"
,
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
]);
}
err
|=
__put_user
(
flags
,
&
sc
->
sc_flags
);
err
|=
__copy_to_user
(
sc
->
sc_gr
,
regs
->
gr
,
sizeof
(
regs
->
gr
));
err
|=
__copy_to_user
(
sc
->
sc_fr
,
regs
->
fr
,
sizeof
(
regs
->
fr
));
err
|=
__put_user
(
regs
->
sar
,
&
sc
->
sc_sar
);
DBG
(
(
"setup_sigcontext: r28 is %ld
\n
"
,
regs
->
gr
[
28
])
);
DBG
(
1
,
"setup_sigcontext: r28 is %ld
\n
"
,
regs
->
gr
[
28
]
);
return
err
;
}
...
...
@@ -286,46 +297,85 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
unsigned
long
haddr
,
sigframe_size
;
struct
siginfo
si
;
int
err
=
0
;
#ifdef __LP64__
compat_int_t
compat_val
;
struct
compat_rt_sigframe
*
compat_frame
;
compat_sigset_t
compat_set
;
#endif
usp
=
(
regs
->
gr
[
30
]
&
~
(
0x01UL
));
/*FIXME: frame_size parameter is unused, remove it. */
frame
=
get_sigframe
(
ka
,
usp
,
sizeof
(
*
frame
));
DBG
((
"setup_rt_frame 1: frame %p info %p
\n
"
,
frame
,
info
));
DBG
(
1
,
"SETUP_RT_FRAME: START
\n
"
);
DBG
(
1
,
"setup_rt_frame: frame %p info %p
\n
"
,
frame
,
info
);
err
|=
__copy_to_user
(
&
frame
->
info
,
info
,
sizeof
(
siginfo_t
));
#ifdef __LP64__
compat_frame
=
(
struct
compat_rt_sigframe
*
)
frame
;
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
)
{
DBG
(
1
,
"setup_rt_frame: frame->info = 0x%p
\n
"
,
&
compat_frame
->
info
);
err
|=
compat_copy_siginfo_to_user
(
&
compat_frame
->
info
,
info
);
DBG
(
1
,
"SETUP_RT_FRAME: 1
\n
"
);
compat_val
=
(
compat_int_t
)
current
->
sas_ss_sp
;
err
|=
__put_user
(
compat_val
,
&
compat_frame
->
uc
.
uc_stack
.
ss_sp
);
DBG
(
1
,
"SETUP_RT_FRAME: 2
\n
"
);
compat_val
=
(
compat_int_t
)
current
->
sas_ss_size
;
err
|=
__put_user
(
compat_val
,
&
compat_frame
->
uc
.
uc_stack
.
ss_size
);
DBG
(
1
,
"SETUP_RT_FRAME: 3
\n
"
);
compat_val
=
sas_ss_flags
(
regs
->
gr
[
30
]);
err
|=
__put_user
(
compat_val
,
&
compat_frame
->
uc
.
uc_stack
.
ss_flags
);
DBG
(
1
,
"setup_rt_frame: frame->uc = 0x%p
\n
"
,
&
compat_frame
->
uc
);
DBG
(
1
,
"setup_rt_frame: frame->uc.uc_mcontext = 0x%p
\n
"
,
&
compat_frame
->
uc
.
uc_mcontext
);
err
|=
setup_sigcontext32
(
&
compat_frame
->
uc
.
uc_mcontext
,
&
compat_frame
->
regs
,
regs
,
in_syscall
);
sigset_64to32
(
&
compat_set
,
set
);
err
|=
__copy_to_user
(
&
compat_frame
->
uc
.
uc_sigmask
,
&
compat_set
,
sizeof
(
compat_set
));
}
else
#endif
{
DBG
(
1
,
"setup_rt_frame: frame->info = 0x%p
\n
"
,
&
frame
->
info
);
err
|=
copy_siginfo_to_user
(
&
frame
->
info
,
info
);
err
|=
__put_user
(
current
->
sas_ss_sp
,
&
frame
->
uc
.
uc_stack
.
ss_sp
);
err
|=
__put_user
(
current
->
sas_ss_size
,
&
frame
->
uc
.
uc_stack
.
ss_size
);
err
|=
__put_user
(
sas_ss_flags
(
regs
->
gr
[
30
]),
&
frame
->
uc
.
uc_stack
.
ss_flags
);
DBG
(
1
,
"setup_rt_frame: frame->uc = 0x%p
\n
"
,
&
frame
->
uc
);
DBG
(
1
,
"setup_rt_frame: frame->uc.uc_mcontext = 0x%p
\n
"
,
&
frame
->
uc
.
uc_mcontext
);
err
|=
setup_sigcontext
(
&
frame
->
uc
.
uc_mcontext
,
regs
,
in_syscall
);
/* FIXME: Should probably be converted aswell for the compat case */
err
|=
__copy_to_user
(
&
frame
->
uc
.
uc_sigmask
,
set
,
sizeof
(
*
set
));
}
if
(
err
)
goto
give_sigsegv
;
/* Set up to return from userspace. If provided, use a stub
already in userspace. */
err
|=
__put_user
(
in_syscall
?
INSN_LDI_R25_1
:
INSN_LDI_R25_0
,
&
frame
->
tramp
[
0
]);
err
|=
__put_user
(
INSN_LDI_R20
,
&
frame
->
tramp
[
1
]);
err
|=
__put_user
(
INSN_BLE_SR2_R0
,
&
frame
->
tramp
[
2
]);
err
|=
__put_user
(
INSN_NOP
,
&
frame
->
tramp
[
3
]);
&
frame
->
tramp
[
SIGRETURN_TRAMP
+
0
]);
err
|=
__put_user
(
INSN_LDI_R20
,
&
frame
->
tramp
[
SIGRETURN_TRAMP
+
1
]);
err
|=
__put_user
(
INSN_BLE_SR2_R0
,
&
frame
->
tramp
[
SIGRETURN_TRAMP
+
2
]);
err
|=
__put_user
(
INSN_NOP
,
&
frame
->
tramp
[
SIGRETURN_TRAMP
+
3
]);
#if DEBUG_SIG
/* Assert that we're flushing in the correct space... */
{
int
sid
;
asm
(
"mfsp %%sr3,%0"
:
"=r"
(
sid
));
DBG
(
(
"f
lushing 64 bytes at space %#x offset %p
\n
"
,
sid
,
frame
->
tramp
)
)
;
DBG
(
1
,
"setup_rt_frame: F
lushing 64 bytes at space %#x offset %p
\n
"
,
sid
,
frame
->
tramp
);
}
#endif
flush_user_dcache_range
((
unsigned
long
)
&
frame
->
tramp
[
0
],
(
unsigned
long
)
&
frame
->
tramp
[
4
]);
flush_user_icache_range
((
unsigned
long
)
&
frame
->
tramp
[
0
],
(
unsigned
long
)
&
frame
->
tramp
[
4
]);
flush_user_dcache_range
((
unsigned
long
)
&
frame
->
tramp
[
SIGRETURN_TRAMP
],
(
unsigned
long
)
&
frame
->
tramp
[
TRAMP_SIZE
]);
flush_user_icache_range
((
unsigned
long
)
&
frame
->
tramp
[
SIGRETURN_TRAMP
],
(
unsigned
long
)
&
frame
->
tramp
[
TRAMP_SIZE
]);
rp
=
(
unsigned
long
)
frame
->
tramp
;
rp
=
(
unsigned
long
)
&
frame
->
tramp
[
SIGRETURN_TRAMP
]
;
if
(
err
)
goto
give_sigsegv
;
...
...
@@ -359,8 +409,8 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
haddr
=
fdesc
.
addr
;
regs
->
gr
[
19
]
=
fdesc
.
gp
;
DBG
(
(
"
64 bit signal, exe=%#lx, r19=%#lx, in_syscall=%d
\n
"
,
haddr
,
regs
->
gr
[
19
],
in_syscall
)
)
;
DBG
(
1
,
"setup_rt_frame:
64 bit signal, exe=%#lx, r19=%#lx, in_syscall=%d
\n
"
,
haddr
,
regs
->
gr
[
19
],
in_syscall
);
}
#endif
...
...
@@ -391,24 +441,33 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
regs
->
gr
[
2
]
=
rp
;
/* userland return pointer */
regs
->
gr
[
26
]
=
sig
;
/* signal number */
#ifdef __LP64__
if
(
personality
(
current
->
personality
)
==
PER_LINUX32
){
regs
->
gr
[
25
]
=
A
(
&
compat_frame
->
info
);
/* siginfo pointer */
regs
->
gr
[
24
]
=
A
(
&
compat_frame
->
uc
);
/* ucontext pointer */
}
else
#endif
{
regs
->
gr
[
25
]
=
A
(
&
frame
->
info
);
/* siginfo pointer */
regs
->
gr
[
24
]
=
A
(
&
frame
->
uc
);
/* ucontext pointer */
}
DBG
(
(
"making sigreturn frame: %#lx + %#
x = %#lx
\n
"
,
DBG
(
1
,
"setup_rt_frame: making sigreturn frame: %#lx + %#l
x = %#lx
\n
"
,
regs
->
gr
[
30
],
sigframe_size
,
regs
->
gr
[
30
]
+
sigframe_size
)
)
;
regs
->
gr
[
30
]
+
sigframe_size
);
/* Raise the user stack pointer to make a proper call frame. */
regs
->
gr
[
30
]
=
(
A
(
frame
)
+
sigframe_size
);
DBG
(
(
"SIG deliver (%s:%d):
frame=0x%p sp=%#lx iaoq=%#lx/%#lx rp=%#lx
\n
"
,
DBG
(
1
,
"setup_rt_frame: sig deliver (%s,%d)
frame=0x%p sp=%#lx iaoq=%#lx/%#lx rp=%#lx
\n
"
,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
gr
[
30
],
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
],
rp
)
)
;
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
],
rp
);
return
1
;
give_sigsegv:
DBG
(
(
"setup_rt_frame sending SIGSEGV
\n
"
)
);
DBG
(
1
,
"setup_rt_frame: sending SIGSEGV
\n
"
);
if
(
sig
==
SIGSEGV
)
ka
->
sa
.
sa_handler
=
SIG_DFL
;
si
.
si_signo
=
SIGSEGV
;
...
...
@@ -431,8 +490,8 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
{
struct
k_sigaction
*
ka
=
&
current
->
sighand
->
action
[
sig
-
1
];
DBG
(
(
"handle_signal(sig=%ld, ka=%p, info=%p, oldset=%p, regs=%p)
\n
"
,
sig
,
ka
,
info
,
oldset
,
regs
)
)
;
DBG
(
1
,
"handle_signal: sig=%ld, ka=%p, info=%p, oldset=%p, regs=%p
\n
"
,
sig
,
ka
,
info
,
oldset
,
regs
);
/* Set up the stack frame */
if
(
!
setup_rt_frame
(
sig
,
ka
,
info
,
oldset
,
regs
,
in_syscall
))
...
...
@@ -470,8 +529,8 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
struct
k_sigaction
*
ka
;
int
signr
;
DBG
(
(
"do_signal(oldset=0x%p, regs=0x%p, sr7 %#lx, pending %d
, in_syscall=%d
\n
"
,
oldset
,
regs
,
regs
->
sr
[
7
],
current
->
sigpending
,
in_syscall
)
);
DBG
(
1
,
"
\n
do_signal: oldset=0x%p, regs=0x%p, sr7 %#lx
, in_syscall=%d
\n
"
,
oldset
,
regs
,
regs
->
sr
[
7
],
in_syscall
);
/* Everyone else checks to see if they are in kernel mode at
this point and exits if that's the case. I'm not sure why
...
...
@@ -481,11 +540,13 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
if
(
!
oldset
)
oldset
=
&
current
->
blocked
;
DBG
(
(
"do_signal: oldset %08lx:
%08lx
\n
"
,
oldset
->
sig
[
0
],
oldset
->
sig
[
1
])
)
;
DBG
(
1
,
"do_signal: oldset %08lx /
%08lx
\n
"
,
oldset
->
sig
[
0
],
oldset
->
sig
[
1
]);
signr
=
get_signal_to_deliver
(
&
info
,
regs
,
NULL
);
DBG
(
3
,
"do_signal: signr = %d, regs->gr[28] = %ld
\n
"
,
signr
,
regs
->
gr
[
28
]);
if
(
signr
>
0
)
{
/* Restart a system call if necessary. */
if
(
in_syscall
)
{
...
...
@@ -494,14 +555,14 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
case
-
ERESTART_RESTARTBLOCK
:
current_thread_info
()
->
restart_block
.
fn
=
do_no_restart_syscall
;
case
-
ERESTARTNOHAND
:
DBG
(
(
"ERESTARTNOHAND: returning -EINTR
\n
"
)
);
DBG
(
1
,
"ERESTARTNOHAND: returning -EINTR
\n
"
);
regs
->
gr
[
28
]
=
-
EINTR
;
break
;
case
-
ERESTARTSYS
:
ka
=
&
current
->
sighand
->
action
[
signr
-
1
];
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
{
DBG
(
(
"ERESTARTSYS: putting -EINTR
\n
"
)
);
DBG
(
1
,
"ERESTARTSYS: putting -EINTR
\n
"
);
regs
->
gr
[
28
]
=
-
EINTR
;
break
;
}
...
...
@@ -520,9 +581,8 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
delivery failed, we need to continue to iterate in
this loop so we can deliver the SIGSEGV... */
if
(
handle_signal
(
signr
,
&
info
,
oldset
,
regs
,
in_syscall
))
{
DBG
((
KERN_DEBUG
"Exiting do_signal (success), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
]));
DBG
(
1
,
KERN_DEBUG
"do_signal: Exit (success), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
]);
return
1
;
}
}
...
...
@@ -530,8 +590,40 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
/* Did we come from a system call? */
if
(
in_syscall
)
{
/* Restart the system call - no handlers present */
if
(
regs
->
gr
[
28
]
==
-
ERESTART_RESTARTBLOCK
||
regs
->
gr
[
28
]
==
-
ERESTARTNOHAND
||
if
(
regs
->
gr
[
28
]
==
-
ERESTART_RESTARTBLOCK
)
{
unsigned
int
*
usp
=
(
unsigned
int
*
)
regs
->
gr
[
30
];
/* Setup a trampoline to restart the syscall
* with __NR_restart_syscall
*
* 0: <return address (orig r31)>
* 4: <2nd half for 64-bit>
* 8: ldw 0(%sp), %r31
* 12: be 0x100(%sr2, %r0)
* 16: ldi __NR_restart_syscall, %r20
*/
#ifndef __LP64__
put_user
(
regs
->
gr
[
31
],
&
usp
[
0
]);
put_user
(
0x0fc0109f
,
&
usp
[
2
]);
#else
put_user
(
regs
->
gr
[
31
]
>>
32
,
&
usp
[
0
]);
put_user
(
regs
->
gr
[
31
]
&
0xffffffff
,
&
usp
[
1
]);
put_user
(
0x0fc010df
,
&
usp
[
2
]);
#endif
put_user
(
0xe0008200
,
&
usp
[
3
]);
put_user
(
0x34140000
,
&
usp
[
4
]);
/* Stack is 64-byte aligned, and we only
* need to flush 1 cache line */
asm
(
"fdc 0(%%sr3, %0)
\n
"
"fic 0(%%sr3, %0)
\n
"
"sync
\n
"
:
:
"r"
(
regs
->
gr
[
30
]));
regs
->
gr
[
31
]
=
regs
->
gr
[
30
]
+
8
;
/* Preserve original r28. */
regs
->
gr
[
28
]
=
regs
->
orig_r28
;
}
else
if
(
regs
->
gr
[
28
]
==
-
ERESTARTNOHAND
||
regs
->
gr
[
28
]
==
-
ERESTARTSYS
||
regs
->
gr
[
28
]
==
-
ERESTARTNOINTR
)
{
/* Hooray for delayed branching. We don't
...
...
@@ -544,8 +636,8 @@ do_signal(sigset_t *oldset, struct pt_regs *regs, int in_syscall)
}
}
DBG
(
(
"Exiting do_signal
(not delivered), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
])
)
;
DBG
(
1
,
"do_signal: Exit
(not delivered), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
]);
return
0
;
}
arch/parisc/kernel/signal32.c
View file @
cf3f977a
...
...
@@ -10,20 +10,32 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <asm/compat_signal.h>
#include <asm/uaccess.h>
#include "signal32.h"
#include "sys32.h"
struct
k_sigaction32
{
struct
sigaction32
sa
;
};
#define DEBUG_COMPAT_SIG 0
#define DEBUG_COMPAT_SIG_LEVEL 2
#if DEBUG_COMPAT_SIG
#define DBG(LEVEL, ...) \
((DEBUG_COMPAT_SIG_LEVEL >= LEVEL) \
? printk(__VA_ARGS__) : (void) 0)
#else
#define DBG(LEVEL, ...)
#endif
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
static
inline
void
inline
void
sigset_32to64
(
sigset_t
*
s64
,
compat_sigset_t
*
s32
)
{
s64
->
sig
[
0
]
=
s32
->
sig
[
0
]
|
((
unsigned
long
)
s32
->
sig
[
1
]
<<
32
);
}
static
inline
void
inline
void
sigset_64to32
(
compat_sigset_t
*
s32
,
sigset_t
*
s64
)
{
s32
->
sig
[
0
]
=
s64
->
sig
[
0
]
&
0xffffffffUL
;
...
...
@@ -120,16 +132,10 @@ sys32_rt_sigaction(int sig, const struct sigaction32 *act, struct sigaction32 *o
return
ret
;
}
typedef
struct
{
unsigned
int
ss_sp
;
int
ss_flags
;
compat_size_t
ss_size
;
}
stack_t32
;
int
do_sigaltstack32
(
const
stack_t32
*
uss32
,
stack_t32
*
uoss32
,
unsigned
long
sp
)
do_sigaltstack32
(
const
compat_stack_t
*
uss32
,
compat_stack_t
*
uoss32
,
unsigned
long
sp
)
{
stack_t32
ss32
,
oss32
;
compat_stack_t
ss32
,
oss32
;
stack_t
ss
,
oss
;
stack_t
*
ssp
=
NULL
,
*
ossp
=
NULL
;
int
ret
;
...
...
@@ -160,3 +166,218 @@ do_sigaltstack32 (const stack_t32 *uss32, stack_t32 *uoss32, unsigned long sp)
return
ret
;
}
long
restore_sigcontext32
(
struct
compat_sigcontext
*
sc
,
struct
compat_regfile
*
rf
,
struct
pt_regs
*
regs
)
{
long
err
=
0
;
compat_uint_t
compat_reg
;
compat_uint_t
compat_regt
;
int
regn
;
/* When loading 32-bit values into 64-bit registers make
sure to clear the upper 32-bits */
DBG
(
2
,
"restore_sigcontext32: PER_LINUX32 process
\n
"
);
DBG
(
2
,
"restore_sigcontext32: sc = 0x%p, rf = 0x%p, regs = 0x%p
\n
"
,
sc
,
rf
,
regs
);
DBG
(
2
,
"restore_sigcontext32: compat_sigcontext is %#lx bytes
\n
"
,
sizeof
(
*
sc
));
for
(
regn
=
0
;
regn
<
32
;
regn
++
){
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_gr
[
regn
]);
regs
->
gr
[
regn
]
=
compat_reg
;
/* Load upper half */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_gr
[
regn
]);
regs
->
gr
[
regn
]
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
3
,
"restore_sigcontext32: gr%02d = %#lx (%#x / %#x)
\n
"
,
regn
,
regs
->
gr
[
regn
],
compat_regt
,
compat_reg
);
}
DBG
(
2
,
"restore_sigcontext32: sc->sc_fr = 0x%p (%#lx)
\n
"
,
sc
->
sc_fr
,
sizeof
(
sc
->
sc_fr
));
/* XXX: BE WARNED FR's are 64-BIT! */
err
|=
__copy_from_user
(
regs
->
fr
,
sc
->
sc_fr
,
sizeof
(
regs
->
fr
));
/* Better safe than sorry, pass __get_user two things of
the same size and let gcc do the upward conversion to
64-bits */
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
0
]);
/* Load upper half */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_iaoq
[
0
]);
regs
->
iaoq
[
0
]
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
2
,
"restore_sigcontext32: upper half of iaoq[0] = %#lx
\n
"
,
compat_regt
);
DBG
(
2
,
"restore_sigcontext32: sc->sc_iaoq[0] = %p => %#x
\n
"
,
&
sc
->
sc_iaoq
[
0
],
compat_reg
);
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
1
]);
/* Load upper half */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_iaoq
[
1
]);
regs
->
iaoq
[
1
]
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
2
,
"restore_sigcontext32: upper half of iaoq[1] = %#lx
\n
"
,
compat_regt
);
DBG
(
2
,
"restore_sigcontext32: sc->sc_iaoq[1] = %p => %#x
\n
"
,
&
sc
->
sc_iaoq
[
1
],
compat_reg
);
DBG
(
2
,
"restore_sigcontext32: iaoq is %#lx / %#lx
\n
"
,
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
]);
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_iasq
[
0
]);
/* Load the upper half for iasq */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_iasq
[
0
]);
regs
->
iasq
[
0
]
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
2
,
"restore_sigcontext32: upper half of iasq[0] = %#lx
\n
"
,
compat_regt
);
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_iasq
[
1
]);
/* Load the upper half for iasq */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_iasq
[
1
]);
regs
->
iasq
[
1
]
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
2
,
"restore_sigcontext32: upper half of iasq[1] = %#lx
\n
"
,
compat_regt
);
DBG
(
2
,
"restore_sigcontext32: iasq is %#lx / %#lx
\n
"
,
regs
->
iasq
[
0
],
regs
->
iasq
[
1
]);
err
|=
__get_user
(
compat_reg
,
&
sc
->
sc_sar
);
/* Load the upper half for sar */
err
|=
__get_user
(
compat_regt
,
&
rf
->
rf_sar
);
regs
->
sar
=
((
u64
)
compat_regt
<<
32
)
|
(
u64
)
compat_reg
;
DBG
(
2
,
"restore_sigcontext32: upper_half & sar = %#lx
\n
"
,
compat_regt
);
DBG
(
2
,
"restore_sigcontext32: sar is %#lx
\n
"
,
regs
->
sar
);
DBG
(
2
,
"restore_sigcontext32: r28 is %ld
\n
"
,
regs
->
gr
[
28
]);
return
err
;
}
/*
* Set up the sigcontext structure for this process.
* This is not an easy task if the kernel is 64-bit, it will require
* that we examine the process personality to determine if we need to
* truncate for a 32-bit userspace.
*/
long
setup_sigcontext32
(
struct
compat_sigcontext
*
sc
,
struct
compat_regfile
*
rf
,
struct
pt_regs
*
regs
,
int
in_syscall
)
{
compat_int_t
flags
=
0
;
long
err
=
0
;
compat_uint_t
compat_reg
;
compat_uint_t
compat_regb
;
int
regn
;
if
(
on_sig_stack
((
unsigned
long
)
sc
))
flags
|=
PARISC_SC_FLAG_ONSTACK
;
if
(
in_syscall
)
{
DBG
(
1
,
"setup_sigcontext32: in_syscall
\n
"
);
flags
|=
PARISC_SC_FLAG_IN_SYSCALL
;
/* Truncate gr31 */
compat_reg
=
(
compat_uint_t
)(
regs
->
gr
[
31
]);
/* regs->iaoq is undefined in the syscall return path */
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iaoq[0] = %p <= %#x
\n
"
,
&
sc
->
sc_iaoq
[
0
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
gr
[
32
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iaoq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: upper half iaoq[0] = %#x
\n
"
,
compat_reg
);
compat_reg
=
(
compat_uint_t
)(
regs
->
gr
[
31
]
+
4
);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iaoq[1] = %p <= %#x
\n
"
,
&
sc
->
sc_iaoq
[
1
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)((
regs
->
gr
[
32
]
+
4
)
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iaoq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: upper half iaoq[1] = %#x
\n
"
,
compat_reg
);
/* Truncate sr3 */
compat_reg
=
(
compat_uint_t
)(
regs
->
sr
[
3
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iasq
[
0
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iasq
[
1
]);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
sr
[
3
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iasq
[
0
]);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iasq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: upper half iasq[0] = %#x
\n
"
,
compat_reg
);
DBG
(
2
,
"setup_sigcontext32: upper half iasq[1] = %#x
\n
"
,
compat_reg
);
DBG
(
1
,
"setup_sigcontext32: iaoq %#lx / %#lx
\n
"
,
regs
->
gr
[
31
],
regs
->
gr
[
31
]
+
4
);
}
else
{
compat_reg
=
(
compat_uint_t
)(
regs
->
iaoq
[
0
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iaoq[0] = %p <= %#x
\n
"
,
&
sc
->
sc_iaoq
[
0
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
iaoq
[
0
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iaoq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: upper half iaoq[0] = %#x
\n
"
,
compat_reg
);
compat_reg
=
(
compat_uint_t
)(
regs
->
iaoq
[
1
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iaoq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iaoq[1] = %p <= %#x
\n
"
,
&
sc
->
sc_iaoq
[
1
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
iaoq
[
1
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iaoq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: upper half iaoq[1] = %#x
\n
"
,
compat_reg
);
compat_reg
=
(
compat_uint_t
)(
regs
->
iasq
[
0
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iasq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iasq[0] = %p <= %#x
\n
"
,
&
sc
->
sc_iasq
[
0
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
iasq
[
0
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iasq
[
0
]);
DBG
(
2
,
"setup_sigcontext32: upper half iasq[0] = %#x
\n
"
,
compat_reg
);
compat_reg
=
(
compat_uint_t
)(
regs
->
iasq
[
1
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_iasq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: sc->sc_iasq[1] = %p <= %#x
\n
"
,
&
sc
->
sc_iasq
[
1
],
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
iasq
[
1
]
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_iasq
[
1
]);
DBG
(
2
,
"setup_sigcontext32: upper half iasq[1] = %#x
\n
"
,
compat_reg
);
/* Print out the IAOQ for debugging */
DBG
(
1
,
"setup_sigcontext32: ia0q %#lx / %#lx
\n
"
,
regs
->
iaoq
[
0
],
regs
->
iaoq
[
1
]);
}
err
|=
__put_user
(
flags
,
&
sc
->
sc_flags
);
DBG
(
1
,
"setup_sigcontext32: Truncating general registers.
\n
"
);
for
(
regn
=
0
;
regn
<
32
;
regn
++
){
/* Truncate a general register */
compat_reg
=
(
compat_uint_t
)(
regs
->
gr
[
regn
]);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_gr
[
regn
]);
/* Store upper half */
compat_regb
=
(
compat_uint_t
)(
regs
->
gr
[
regn
]
>>
32
);
err
|=
__put_user
(
compat_regb
,
&
rf
->
rf_gr
[
regn
]);
/* DEBUG: Write out the "upper / lower" register data */
DBG
(
2
,
"setup_sigcontext32: gr%02d = %#x / %#x
\n
"
,
regn
,
compat_regb
,
compat_reg
);
}
/* Copy the floating point registers (same size)
XXX: BE WARNED FR's are 64-BIT! */
DBG
(
1
,
"setup_sigcontext32: Copying from regs to sc, "
"sc->sc_fr size = %#lx, regs->fr size = %#lx
\n
"
,
sizeof
(
regs
->
fr
),
sizeof
(
sc
->
sc_fr
));
err
|=
__copy_to_user
(
sc
->
sc_fr
,
regs
->
fr
,
sizeof
(
regs
->
fr
));
compat_reg
=
(
compat_uint_t
)(
regs
->
sar
);
err
|=
__put_user
(
compat_reg
,
&
sc
->
sc_sar
);
DBG
(
2
,
"setup_sigcontext32: sar is %#x
\n
"
,
compat_reg
);
/* Store upper half */
compat_reg
=
(
compat_uint_t
)(
regs
->
sar
>>
32
);
err
|=
__put_user
(
compat_reg
,
&
rf
->
rf_sar
);
DBG
(
2
,
"setup_sigcontext32: upper half sar = %#x
\n
"
,
compat_reg
);
DBG
(
1
,
"setup_sigcontext32: r28 is %ld
\n
"
,
regs
->
gr
[
28
]);
return
err
;
}
arch/parisc/kernel/signal32.h
0 → 100644
View file @
cf3f977a
#ifndef _PARISC64_KERNEL_SIGNAL32_H
#define _PARISC64_KERNEL_SIGNAL32_H
#include <linux/compat.h>
#include <asm/compat_signal.h>
#include <asm/compat_rt_sigframe.h>
/* ELF32 signal handling */
struct
k_sigaction32
{
struct
compat_sigaction
sa
;
};
void
sigset_32to64
(
sigset_t
*
s64
,
compat_sigset_t
*
s32
);
void
sigset_64to32
(
compat_sigset_t
*
s32
,
sigset_t
*
s64
);
int
do_sigaltstack32
(
const
compat_stack_t
*
uss32
,
compat_stack_t
*
uoss32
,
unsigned
long
sp
);
long
restore_sigcontext32
(
struct
compat_sigcontext
*
sc
,
struct
compat_regfile
*
rf
,
struct
pt_regs
*
regs
);
long
setup_sigcontext32
(
struct
compat_sigcontext
*
sc
,
struct
compat_regfile
*
rf
,
struct
pt_regs
*
regs
,
int
in_syscall
);
#endif
arch/parisc/kernel/smp.c
View file @
cf3f977a
...
...
@@ -257,7 +257,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk
(
KERN_CRIT
"Unknown IPI num on CPU%d: %lu
\n
"
,
this_cpu
,
which
);
ops
&=
~
(
1
<<
which
);
return
;
return
IRQ_NONE
;
}
/* Switch */
}
/* while (ops) */
}
...
...
@@ -326,7 +326,7 @@ int
smp_call_function
(
void
(
*
func
)
(
void
*
info
),
void
*
info
,
int
retry
,
int
wait
)
{
struct
smp_call_struct
data
;
long
timeout
;
unsigned
long
timeout
;
static
spinlock_t
lock
=
SPIN_LOCK_UNLOCKED
;
data
.
func
=
func
;
...
...
@@ -376,6 +376,8 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
return
0
;
}
EXPORT_SYMBOL
(
smp_call_function
);
/*
...
...
arch/parisc/kernel/sys_parisc.c
View file @
cf3f977a
...
...
@@ -240,108 +240,6 @@ asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low,
return
sys_readahead
(
fd
,
(
loff_t
)
high
<<
32
|
low
,
count
);
}
/*
* FIXME, please remove this crap as soon as possible
*
* This is here to fix up broken glibc structures,
* which are already fixed in newer glibcs
*/
#include <linux/msg.h>
#include <linux/sem.h>
#include <linux/shm.h>
#include "sys32.h"
struct
broken_ipc_perm
{
key_t
key
;
/* Key. */
uid_t
uid
;
/* Owner's user ID. */
gid_t
gid
;
/* Owner's group ID. */
uid_t
cuid
;
/* Creator's user ID. */
gid_t
cgid
;
/* Creator's group ID. */
unsigned
short
int
mode
;
/* Read/write permission. */
unsigned
short
int
__pad1
;
unsigned
short
int
seq
;
/* Sequence number. */
unsigned
short
int
__pad2
;
unsigned
long
int
__unused1
;
unsigned
long
int
__unused2
;
};
struct
broken_shmid64_ds
{
struct
broken_ipc_perm
shm_perm
;
/* operation perms */
size_t
shm_segsz
;
/* size of segment (bytes) */
#ifndef __LP64__
unsigned
int
__pad1
;
#endif
__kernel_time_t
shm_atime
;
/* last attach time */
#ifndef __LP64__
unsigned
int
__pad2
;
#endif
__kernel_time_t
shm_dtime
;
/* last detach time */
#ifndef __LP64__
unsigned
int
__pad3
;
#endif
__kernel_time_t
shm_ctime
;
/* last change time */
__kernel_pid_t
shm_cpid
;
/* pid of creator */
__kernel_pid_t
shm_lpid
;
/* pid of last operator */
unsigned
int
shm_nattch
;
/* no. of current attaches */
unsigned
int
__unused1
;
unsigned
int
__unused2
;
};
static
void
convert_broken_perm
(
struct
broken_ipc_perm
*
out
,
struct
ipc64_perm
*
in
)
{
out
->
key
=
in
->
key
;
out
->
uid
=
in
->
uid
;
out
->
gid
=
in
->
gid
;
out
->
cuid
=
in
->
cuid
;
out
->
cgid
=
in
->
cgid
;
out
->
mode
=
in
->
mode
;
out
->
seq
=
in
->
seq
;
}
static
int
copyout_broken_shmid64
(
struct
broken_shmid64_ds
*
buf
,
struct
shmid64_ds
*
sbuf
)
{
struct
broken_shmid64_ds
tbuf
;
memset
(
&
tbuf
,
0
,
sizeof
tbuf
);
convert_broken_perm
(
&
tbuf
.
shm_perm
,
&
sbuf
->
shm_perm
);
tbuf
.
shm_segsz
=
sbuf
->
shm_segsz
;
tbuf
.
shm_atime
=
sbuf
->
shm_atime
;
tbuf
.
shm_dtime
=
sbuf
->
shm_dtime
;
tbuf
.
shm_ctime
=
sbuf
->
shm_ctime
;
tbuf
.
shm_cpid
=
sbuf
->
shm_cpid
;
tbuf
.
shm_lpid
=
sbuf
->
shm_lpid
;
tbuf
.
shm_nattch
=
sbuf
->
shm_nattch
;
return
copy_to_user
(
buf
,
&
tbuf
,
sizeof
tbuf
)
?
-
EFAULT
:
0
;
}
int
sys_msgctl_broken
(
int
msqid
,
int
cmd
,
struct
msqid_ds
*
buf
)
{
return
sys_msgctl
(
msqid
,
cmd
&
~
IPC_64
,
buf
);
}
int
sys_semctl_broken
(
int
semid
,
int
semnum
,
int
cmd
,
union
semun
arg
)
{
return
sys_semctl
(
semid
,
semnum
,
cmd
&
~
IPC_64
,
arg
);
}
int
sys_shmctl_broken
(
int
shmid
,
int
cmd
,
struct
shmid64_ds
*
buf
)
{
struct
shmid64_ds
sbuf
;
int
err
;
if
(
cmd
&
IPC_64
)
{
cmd
&=
~
IPC_64
;
if
(
cmd
==
IPC_STAT
||
cmd
==
SHM_STAT
)
{
KERNEL_SYSCALL
(
err
,
sys_shmctl
,
shmid
,
cmd
,
(
struct
shmid_ds
*
)
&
sbuf
);
if
(
err
==
0
)
err
=
copyout_broken_shmid64
((
struct
broken_shmid64_ds
*
)
buf
,
&
sbuf
);
return
err
;
}
}
return
sys_shmctl
(
shmid
,
cmd
,
(
struct
shmid_ds
*
)
buf
);
}
/*
* This changes the io permissions bitmap in the current task.
*/
...
...
arch/parisc/kernel/sys_parisc32.c
View file @
cf3f977a
...
...
@@ -1352,12 +1352,10 @@ asmlinkage int sys32_lseek(unsigned int fd, int offset, unsigned int origin)
return
sys_lseek
(
fd
,
offset
,
origin
);
}
asmlinkage
long
sys32_semctl
_broken
(
int
semid
,
int
semnum
,
int
cmd
,
union
semun
arg
)
asmlinkage
long
sys32_semctl
(
int
semid
,
int
semnum
,
int
cmd
,
union
semun
arg
)
{
union
semun
u
;
cmd
&=
~
IPC_64
;
/* should be removed together with the _broken suffix */
if
(
cmd
==
SETVAL
)
{
/* Ugh. arg is a union of int,ptr,ptr,ptr, so is 8 bytes.
* The int should be in the first 4, but our argument
...
...
arch/parisc/kernel/syscall_table.S
View file @
cf3f977a
...
...
@@ -28,7 +28,7 @@
#define ENTRY_COMP(_name_) .word sys_##_name_
#endif
ENTRY_SAME
(
ni_syscall
)
/*
0
-
old
"setup()"
system
call
*/
ENTRY_SAME
(
restart_syscall
)
/*
0
*/
ENTRY_SAME
(
exit
)
ENTRY_SAME
(
fork_wrapper
)
ENTRY_SAME
(
read
)
...
...
@@ -260,15 +260,15 @@
ENTRY_COMP
(
recvmsg
)
ENTRY_SAME
(
semop
)
/*
185
*/
ENTRY_SAME
(
semget
)
ENTRY_DIFF
(
semctl
_broken
)
ENTRY_DIFF
(
semctl
)
ENTRY_DIFF
(
msgsnd
)
ENTRY_DIFF
(
msgrcv
)
ENTRY_SAME
(
msgget
)
/*
190
*/
ENTRY_SAME
(
msgctl
_broken
)
ENTRY_SAME
(
msgctl
)
ENTRY_SAME
(
shmat_wrapper
)
ENTRY_SAME
(
shmdt
)
ENTRY_SAME
(
shmget
)
ENTRY_SAME
(
shmctl
_broken
)
/*
195
*/
ENTRY_SAME
(
shmctl
)
/*
195
*/
ENTRY_SAME
(
ni_syscall
)
/*
streams1
*/
ENTRY_SAME
(
ni_syscall
)
/*
streams2
*/
ENTRY_SAME
(
lstat64
)
...
...
arch/parisc/kernel/time.c
View file @
cf3f977a
...
...
@@ -232,7 +232,6 @@ do_settimeofday (struct timespec *tv)
write_sequnlock_irq
(
&
xtime_lock
);
return
0
;
}
EXPORT_SYMBOL
(
do_settimeofday
);
/*
...
...
arch/parisc/kernel/traps.c
View file @
cf3f977a
...
...
@@ -430,8 +430,18 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o
if
(
!
console_drivers
)
pdc_console_restart
();
if
(
code
==
1
)
/* Not all paths will gutter the processor... */
switch
(
code
){
case
1
:
transfer_pim_to_trap_frame
(
regs
);
break
;
default:
/* Fall through */
break
;
}
show_stack
(
NULL
,
(
unsigned
long
*
)
regs
->
gr
[
30
]);
...
...
@@ -447,6 +457,7 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o
* system will shut down immediately right here. */
pdc_soft_power_button
(
0
);
/* Gutter the processor! */
for
(;;)
;
}
...
...
@@ -558,19 +569,44 @@ void handle_interruption(int code, struct pt_regs *regs)
force_sig_info
(
SIGFPE
,
&
si
,
current
);
return
;
case
13
:
/* Conditional Trap
The condition succees in an instruction which traps
on condition */
if
(
user_mode
(
regs
)){
si
.
si_signo
=
SIGFPE
;
/* Set to zero, and let the userspace app figure it out from
the insn pointed to by si_addr */
si
.
si_code
=
0
;
si
.
si_addr
=
(
void
*
)
regs
->
iaoq
[
0
];
force_sig_info
(
SIGFPE
,
&
si
,
current
);
return
;
}
else
/* The kernel doesn't want to handle condition codes */
break
;
case
14
:
/* Assist Exception Trap, i.e. floating point exception. */
die_if_kernel
(
"Floating point exception"
,
regs
,
0
);
/* quiet */
handle_fpe
(
regs
);
return
;
case
15
:
/* Data TLB miss fault/Data page fault */
/* Fall through */
case
16
:
/* Non-access instruction TLB miss fault */
/* The instruction TLB entry needed for the target address of the FIC
is absent, and hardware can't find it, so we get to cleanup */
/* Fall through */
case
17
:
/* Non-access data TLB miss fault/Non-access data page fault */
/* TODO: Still need to add slow path emulation code here */
pdc_chassis_send_status
(
PDC_CHASSIS_DIRECT_PANIC
);
/* TODO: Understand what is meant by the TODO listed
above this one. (Carlos) */
fault_address
=
regs
->
ior
;
parisc_terminate
(
"Non access data tlb fault!"
,
regs
,
code
,
fault_address
);
fault_space
=
regs
->
isr
;
break
;
case
18
:
/* PCXS only -- later cpu's split this into types 26,27 & 28 */
...
...
@@ -580,9 +616,8 @@ void handle_interruption(int code, struct pt_regs *regs)
return
;
}
/* Fall Through */
case
15
:
/* Data TLB miss fault/Data page fault */
case
26
:
/* PCXL: Data memory access rights trap */
case
26
:
/* PCXL: Data memory access rights trap */
fault_address
=
regs
->
ior
;
fault_space
=
regs
->
isr
;
break
;
...
...
@@ -638,7 +673,6 @@ void handle_interruption(int code, struct pt_regs *regs)
up_read
(
&
current
->
mm
->
mmap_sem
);
}
/* Fall Through */
case
27
:
/* Data memory protection ID trap */
die_if_kernel
(
"Protection id trap"
,
regs
,
code
);
...
...
arch/parisc/kernel/unaligned.c
View file @
cf3f977a
...
...
@@ -21,27 +21,8 @@
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/atomic.h>
#include <asm/smp.h>
#include <asm/pdc.h>
/* #define DEBUG_UNALIGNED 1 */
...
...
@@ -93,13 +74,17 @@
#define OPCODE_STDA OPCODE1(0x03,1,0xf)
#define OPCODE_FLDWX OPCODE1(0x09,0,0x0)
#define OPCODE_FSTWX OPCODE1(0x09,0,0x4)
#define OPCODE_FLDWXR OPCODE1(0x09,0,0x1)
#define OPCODE_FSTWX OPCODE1(0x09,0,0x8)
#define OPCODE_FSTWXR OPCODE1(0x09,0,0x9)
#define OPCODE_FLDWS OPCODE1(0x09,1,0x0)
#define OPCODE_FSTWS OPCODE1(0x09,1,0x4)
#define OPCODE_FLDWSR OPCODE1(0x09,1,0x1)
#define OPCODE_FSTWS OPCODE1(0x09,1,0x8)
#define OPCODE_FSTWSR OPCODE1(0x09,1,0x9)
#define OPCODE_FLDDX OPCODE1(0x0b,0,0x0)
#define OPCODE_FSTDX OPCODE1(0x0b,0,0x
4
)
#define OPCODE_FSTDX OPCODE1(0x0b,0,0x
8
)
#define OPCODE_FLDDS OPCODE1(0x0b,1,0x0)
#define OPCODE_FSTDS OPCODE1(0x0b,1,0x
4
)
#define OPCODE_FSTDS OPCODE1(0x0b,1,0x
8
)
#define OPCODE_LDD_L OPCODE2(0x14,0)
#define OPCODE_FLDD_L OPCODE2(0x14,1)
...
...
@@ -128,6 +113,9 @@
#define IM5_3(i) IM((i),5)
#define IM14(i) IM((i),14)
#define ERR_NOTHANDLED -1
#define ERR_PAGEFAULT -2
int
unaligned_enabled
=
1
;
void
die_if_kernel
(
char
*
str
,
struct
pt_regs
*
regs
,
long
err
);
...
...
@@ -136,16 +124,28 @@ static int emulate_ldh(struct pt_regs *regs, int toreg)
{
unsigned
long
saddr
=
regs
->
ior
;
unsigned
long
val
=
0
;
int
ret
;
DPRINTF
(
"load "
RFMT
":"
RFMT
" to r%d for 2 bytes
\n
"
,
regs
->
isr
,
regs
->
ior
,
toreg
);
__asm__
__volatile__
(
" mtsp %3, %%sr1
\n
"
" ldbs 0(%%sr1,%2), %%r20
\n
"
" ldbs 1(%%sr1,%2), %0
\n
"
"depw %%r20, 23, 24, %0
\n
"
:
"=r"
(
val
)
" mtsp %4, %%sr1
\n
"
"1: ldbs 0(%%sr1,%3), %%r20
\n
"
"2: ldbs 1(%%sr1,%3), %0
\n
"
" depw %%r20, 23, 24, %0
\n
"
" cmpclr,= %%r0, %%r0, %1
\n
"
"3: ldo -2(%%r0), %1
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(3b-1b)
\n
"
" .dword 2b,(3b-2b)
\n
"
#else
" .word 1b,(3b-1b)
\n
"
" .word 2b,(3b-2b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
val
),
"=r"
(
ret
)
:
"0"
(
val
),
"r"
(
saddr
),
"r"
(
regs
->
isr
)
:
"r20"
);
...
...
@@ -154,26 +154,39 @@ static int emulate_ldh(struct pt_regs *regs, int toreg)
if
(
toreg
)
regs
->
gr
[
toreg
]
=
val
;
return
0
;
return
ret
;
}
static
int
emulate_ldw
(
struct
pt_regs
*
regs
,
int
toreg
,
int
flop
)
{
unsigned
long
saddr
=
regs
->
ior
;
unsigned
long
val
=
0
;
int
ret
;
DPRINTF
(
"load "
RFMT
":"
RFMT
" to r%d for 4 bytes
\n
"
,
regs
->
isr
,
regs
->
ior
,
toreg
);
__asm__
__volatile__
(
" zdep %
2
,28,2,%%r19
\n
"
/* r19=(ofs&3)*8 */
" mtsp %
3
, %%sr1
\n
"
" depw %%r0,31,2,%
2
\n
"
"
ldw 0(%%sr1,%2
),%0
\n
"
"
ldw 4(%%sr1,%2
),%%r20
\n
"
" zdep %
3
,28,2,%%r19
\n
"
/* r19=(ofs&3)*8 */
" mtsp %
4
, %%sr1
\n
"
" depw %%r0,31,2,%
3
\n
"
"
1: ldw 0(%%sr1,%3
),%0
\n
"
"
2: ldw 4(%%sr1,%3
),%%r20
\n
"
" subi 32,%%r19,%%r19
\n
"
" mtctl %%r19,11
\n
"
" vshd %0,%%r20,%0
\n
"
:
"=r"
(
val
)
" cmpclr,= %%r0, %%r0, %1
\n
"
"3: ldo -2(%%r0), %1
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(3b-1b)
\n
"
" .dword 2b,(3b-2b)
\n
"
#else
" .word 1b,(3b-1b)
\n
"
" .word 2b,(3b-2b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
val
),
"=r"
(
ret
)
:
"0"
(
val
),
"r"
(
saddr
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
);
...
...
@@ -184,12 +197,13 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop)
else
if
(
toreg
)
regs
->
gr
[
toreg
]
=
val
;
return
0
;
return
ret
;
}
static
int
emulate_ldd
(
struct
pt_regs
*
regs
,
int
toreg
,
int
flop
)
{
unsigned
long
saddr
=
regs
->
ior
;
__u64
val
=
0
;
int
ret
;
DPRINTF
(
"load "
RFMT
":"
RFMT
" to r%d for 8 bytes
\n
"
,
regs
->
isr
,
regs
->
ior
,
toreg
);
...
...
@@ -200,51 +214,77 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop)
return
-
1
;
#endif
__asm__
__volatile__
(
" depd,z %
2
,60,3,%%r19
\n
"
/* r19=(ofs&7)*8 */
" mtsp %
3
, %%sr1
\n
"
" depd %%r0,63,3,%
2
\n
"
"
ldd 0(%%sr1,%2
),%0
\n
"
"
ldd 8(%%sr1,%2
),%%r20
\n
"
" depd,z %
3
,60,3,%%r19
\n
"
/* r19=(ofs&7)*8 */
" mtsp %
4
, %%sr1
\n
"
" depd %%r0,63,3,%
3
\n
"
"
1: ldd 0(%%sr1,%3
),%0
\n
"
"
2: ldd 8(%%sr1,%3
),%%r20
\n
"
" subi 64,%%r19,%%r19
\n
"
" mtsar %%r19
\n
"
" shrpd %0,%%r20,%%sar,%0
\n
"
:
"=r"
(
val
)
" cmpclr,= %%r0, %%r0, %1
\n
"
"3: ldo -2(%%r0), %1
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(3b-1b)
\n
"
" .dword 2b,(3b-2b)
\n
"
#else
" .word 1b,(3b-1b)
\n
"
" .word 2b,(3b-2b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
val
),
"=r"
(
ret
)
:
"0"
(
val
),
"r"
(
saddr
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
);
#else
{
unsigned
long
valh
=
0
,
vall
=
0
;
__asm__
__volatile__
(
" zdep %
4
,29,2,%%r19
\n
"
/* r19=(ofs&3)*8 */
" mtsp %
5
, %%sr1
\n
"
" dep %%r0,31,2,%
4
\n
"
" ldw 0(%%sr1,%5),%0
\n
"
" ldw 4(%%sr1,%5),%1
\n
"
" ldw 8(%%sr1,%5),%%r20
\n
"
" zdep %
5
,29,2,%%r19
\n
"
/* r19=(ofs&3)*8 */
" mtsp %
6
, %%sr1
\n
"
" dep %%r0,31,2,%
5
\n
"
"
1:
ldw 0(%%sr1,%5),%0
\n
"
"
2:
ldw 4(%%sr1,%5),%1
\n
"
"
3:
ldw 8(%%sr1,%5),%%r20
\n
"
" subi 32,%%r19,%%r19
\n
"
" mtsar %%r19
\n
"
" vshd %0,%1,%0
\n
"
" vshd %1,%%r20,%1
\n
"
:
"=r"
(
valh
),
"=r"
(
vall
)
" cmpclr,= %%r0, %%r0, %2
\n
"
"4: ldo -2(%%r0), %2
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(4b-1b)
\n
"
" .dword 2b,(4b-2b)
\n
"
" .dword 3b,(4b-3b)
\n
"
#else
" .word 1b,(4b-1b)
\n
"
" .word 2b,(4b-2b)
\n
"
" .word 3b,(4b-3b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
valh
),
"=r"
(
vall
),
"=r"
(
ret
)
:
"0"
(
valh
),
"1"
(
vall
),
"r"
(
saddr
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
);
val
=
((
__u64
)
valh
<<
32
)
|
(
__u64
)
vall
;
}
#endif
DPRINTF
(
"val = 0x
"
RFMT
"
\n
"
,
val
);
DPRINTF
(
"val = 0x
llx
\n
"
,
val
);
if
(
flop
)
regs
->
fr
[
toreg
]
=
val
;
else
if
(
toreg
)
regs
->
gr
[
toreg
]
=
val
;
return
0
;
return
ret
;
}
static
int
emulate_sth
(
struct
pt_regs
*
regs
,
int
frreg
)
{
unsigned
long
val
=
regs
->
gr
[
frreg
];
int
ret
;
if
(
!
frreg
)
val
=
0
;
...
...
@@ -252,19 +292,32 @@ static int emulate_sth(struct pt_regs *regs, int frreg)
val
,
regs
->
isr
,
regs
->
ior
);
__asm__
__volatile__
(
" mtsp %2, %%sr1
\n
"
" extrw,u %0, 23, 8, %%r19
\n
"
" stb %0, 1(%%sr1, %1)
\n
"
" stb %%r19, 0(%%sr1, %1)
\n
"
:
" mtsp %3, %%sr1
\n
"
" extrw,u %1, 23, 8, %%r19
\n
"
"1: stb %1, 1(%%sr1, %2)
\n
"
"2: stb %%r19, 0(%%sr1, %2)
\n
"
" cmpclr,= %%r0, %%r0, %0
\n
"
"3: ldo -2(%%r0), %0
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(3b-1b)
\n
"
" .dword 2b,(3b-2b)
\n
"
#else
" .word 1b,(3b-1b)
\n
"
" .word 2b,(3b-2b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
ret
)
:
"r"
(
val
),
"r"
(
regs
->
ior
),
"r"
(
regs
->
isr
)
:
"r19"
);
return
0
;
return
ret
;
}
static
int
emulate_stw
(
struct
pt_regs
*
regs
,
int
frreg
,
int
flop
)
{
unsigned
long
val
;
int
ret
;
if
(
flop
)
val
=
((
__u32
*
)(
regs
->
fr
))[
frreg
];
...
...
@@ -278,22 +331,33 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
__asm__
__volatile__
(
" mtsp %
2
, %%sr1
\n
"
" zdep %
1
, 28, 2, %%r19
\n
"
" dep %%r0, 31, 2, %
1
\n
"
" mtsp %
3
, %%sr1
\n
"
" zdep %
2
, 28, 2, %%r19
\n
"
" dep %%r0, 31, 2, %
2
\n
"
" mtsar %%r19
\n
"
" depwi,z -2, %%sar, 32, %%r19
\n
"
"
ldw 0(%%sr1,%1
),%%r20
\n
"
"
ldw 4(%%sr1,%1
),%%r21
\n
"
" vshd %%r0, %
0
, %%r22
\n
"
" vshd %
0
, %%r0, %%r1
\n
"
"
1: ldw 0(%%sr1,%2
),%%r20
\n
"
"
2: ldw 4(%%sr1,%2
),%%r21
\n
"
" vshd %%r0, %
1
, %%r22
\n
"
" vshd %
1
, %%r0, %%r1
\n
"
" and %%r20, %%r19, %%r20
\n
"
" andcm %%r21, %%r19, %%r21
\n
"
" or %%r22, %%r20, %%r20
\n
"
" or %%r1, %%r21, %%r21
\n
"
" stw %%r20,0(%%sr1,%1)
\n
"
" stw %%r21,4(%%sr1,%1)
\n
"
:
" stw %%r20,0(%%sr1,%2)
\n
"
" stw %%r21,4(%%sr1,%2)
\n
"
" cmpclr,= %%r0, %%r0, %0
\n
"
"3: ldo -2(%%r0), %0
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(3b-1b)
\n
"
" .dword 2b,(3b-2b)
\n
"
#else
" .word 1b,(3b-1b)
\n
"
" .word 2b,(3b-2b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
ret
)
:
"r"
(
val
),
"r"
(
regs
->
ior
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
,
"r21"
,
"r22"
,
"r1"
);
...
...
@@ -302,6 +366,7 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
static
int
emulate_std
(
struct
pt_regs
*
regs
,
int
frreg
,
int
flop
)
{
__u64
val
;
int
ret
;
if
(
flop
)
val
=
regs
->
fr
[
frreg
];
...
...
@@ -310,7 +375,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
else
val
=
0
;
DPRINTF
(
"store r%d (0x
"
%
016ll
x
"
) to "
RFMT
":"
RFMT
" for 8 bytes
\n
"
,
frreg
,
DPRINTF
(
"store r%d (0x
%016llx
) to "
RFMT
":"
RFMT
" for 8 bytes
\n
"
,
frreg
,
val
,
regs
->
isr
,
regs
->
ior
);
#ifdef CONFIG_PA20
...
...
@@ -319,52 +384,84 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
return
-
1
;
#endif
__asm__
__volatile__
(
" mtsp %
2
, %%sr1
\n
"
" depd,z %
1
, 60, 3, %%r19
\n
"
" depd %%r0, 63, 3, %
1
\n
"
" mtsp %
3
, %%sr1
\n
"
" depd,z %
2
, 60, 3, %%r19
\n
"
" depd %%r0, 63, 3, %
2
\n
"
" mtsar %%r19
\n
"
" depdi,z -2, %%sar, 64, %%r19
\n
"
"
ldd 0(%%sr1,%1
),%%r20
\n
"
"
ldd 8(%%sr1,%1
),%%r21
\n
"
" shrpd %%r0, %
0
, %%sar, %%r22
\n
"
" shrpd %
0
, %%r0, %%sar, %%r1
\n
"
"
1: ldd 0(%%sr1,%2
),%%r20
\n
"
"
2: ldd 8(%%sr1,%2
),%%r21
\n
"
" shrpd %%r0, %
1
, %%sar, %%r22
\n
"
" shrpd %
1
, %%r0, %%sar, %%r1
\n
"
" and %%r20, %%r19, %%r20
\n
"
" andcm %%r21, %%r19, %%r21
\n
"
" or %%r22, %%r20, %%r20
\n
"
" or %%r1, %%r21, %%r21
\n
"
" std %%r20,0(%%sr1,%1)
\n
"
" std %%r21,8(%%sr1,%1)
\n
"
:
"3: std %%r20,0(%%sr1,%2)
\n
"
"4: std %%r21,8(%%sr1,%2)
\n
"
" cmpclr,= %%r0, %%r0, %0
\n
"
"5: ldo -2(%%r0), %0
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(5b-1b)
\n
"
" .dword 2b,(5b-2b)
\n
"
" .dword 3b,(5b-3b)
\n
"
" .dword 4b,(5b-4b)
\n
"
#else
" .word 1b,(5b-1b)
\n
"
" .word 2b,(5b-2b)
\n
"
" .word 3b,(5b-3b)
\n
"
" .word 4b,(5b-4b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
ret
)
:
"r"
(
val
),
"r"
(
regs
->
ior
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
,
"r21"
,
"r22"
,
"r1"
);
#else
{
unsigned
long
valh
=
(
val
>>
32
),
vall
=
(
val
&
0xffffffffl
);
__asm__
__volatile__
(
" mtsp %
3
, %%sr1
\n
"
" zdep %
1
, 29, 2, %%r19
\n
"
" dep %%r0, 31, 2, %
1
\n
"
" mtsp %
4
, %%sr1
\n
"
" zdep %
2
, 29, 2, %%r19
\n
"
" dep %%r0, 31, 2, %
2
\n
"
" mtsar %%r19
\n
"
" zvdepi -2, 32, %%r19
\n
"
"
ldw 0(%%sr1,%2
),%%r20
\n
"
"
ldw 8(%%sr1,%2
),%%r21
\n
"
" vshd %
0, %1
, %%r1
\n
"
" vshd %%r0, %
0, %0
\n
"
" vshd %
1, %%r0, %1
\n
"
"
1: ldw 0(%%sr1,%3
),%%r20
\n
"
"
2: ldw 8(%%sr1,%3
),%%r21
\n
"
" vshd %
1, %2
, %%r1
\n
"
" vshd %%r0, %
1, %1
\n
"
" vshd %
2, %%r0, %2
\n
"
" and %%r20, %%r19, %%r20
\n
"
" andcm %%r21, %%r19, %%r21
\n
"
" or %0, %%r20, %0
\n
"
" or %1, %%r21, %1
\n
"
" stw %0,0(%%sr1,%2)
\n
"
" stw %%r1,4(%%sr1,%2)
\n
"
" stw %1,8(%%sr1,%2)
\n
"
:
" or %1, %%r20, %1
\n
"
" or %2, %%r21, %2
\n
"
"3: stw %1,0(%%sr1,%1)
\n
"
"4: stw %%r1,4(%%sr1,%3)
\n
"
"5: stw %2,8(%%sr1,%3)
\n
"
" cmpclr,= %%r0, %%r0, %0
\n
"
"6: ldo -2(%%r0), %0
\n
"
" .section __ex_table,
\"
a
\"\n
"
#ifdef __LP64__
" .dword 1b,(6b-1b)
\n
"
" .dword 2b,(6b-2b)
\n
"
" .dword 3b,(6b-3b)
\n
"
" .dword 4b,(6b-4b)
\n
"
" .dword 5b,(6b-5b)
\n
"
#else
" .word 1b,(6b-1b)
\n
"
" .word 2b,(6b-2b)
\n
"
" .word 3b,(6b-3b)
\n
"
" .word 4b,(6b-4b)
\n
"
" .word 5b,(6b-5b)
\n
"
#endif
" .previous
\n
"
:
"=r"
(
ret
)
:
"r"
(
valh
),
"r"
(
vall
),
"r"
(
regs
->
ior
),
"r"
(
regs
->
isr
)
:
"r19"
,
"r20"
,
"r21"
,
"r1"
);
}
#endif
return
0
;
return
ret
;
}
void
handle_unaligned
(
struct
pt_regs
*
regs
)
...
...
@@ -373,41 +470,10 @@ void handle_unaligned(struct pt_regs *regs)
static
unsigned
long
last_time
=
0
;
unsigned
long
newbase
=
R1
(
regs
->
iir
)
?
regs
->
gr
[
R1
(
regs
->
iir
)]
:
0
;
int
modify
=
0
;
int
ret
=
-
1
;
int
ret
=
ERR_NOTHANDLED
;
struct
siginfo
si
;
register
int
flop
=
0
;
/* true if this is a flop */
/* if the unaligned access is inside the kernel:
* if the access is caused by a syscall, then we fault the calling
* user process
*/
if
(
!
user_mode
(
regs
))
{
const
struct
exception_table_entry
*
fix
;
/* see if the offending code have its own
* exception handler
*/
fix
=
search_exception_tables
(
regs
->
iaoq
[
0
]);
if
(
fix
)
{
/* lower bits of fix->skip are flags
* upper bits are the handler addr
*/
if
(
fix
->
skip
&
1
)
regs
->
gr
[
8
]
=
-
EFAULT
;
if
(
fix
->
skip
&
2
)
regs
->
gr
[
9
]
=
0
;
regs
->
iaoq
[
0
]
+=
((
fix
->
skip
)
&
~
3
);
regs
->
iaoq
[
1
]
=
regs
->
iaoq
[
0
]
+
4
;
regs
->
gr
[
0
]
&=
~
PSW_B
;
return
;
}
}
/* log a message with pacing */
if
(
user_mode
(
regs
))
{
...
...
@@ -541,6 +607,8 @@ void handle_unaligned(struct pt_regs *regs)
case
OPCODE_FLDWX
:
case
OPCODE_FLDWS
:
case
OPCODE_FLDWXR
:
case
OPCODE_FLDWSR
:
flop
=
1
;
ret
=
emulate_ldw
(
regs
,
FR3
(
regs
->
iir
),
1
);
break
;
...
...
@@ -553,6 +621,8 @@ void handle_unaligned(struct pt_regs *regs)
case
OPCODE_FSTWX
:
case
OPCODE_FSTWS
:
case
OPCODE_FSTWXR
:
case
OPCODE_FSTWSR
:
flop
=
1
;
ret
=
emulate_stw
(
regs
,
FR3
(
regs
->
iir
),
1
);
break
;
...
...
@@ -567,7 +637,7 @@ void handle_unaligned(struct pt_regs *regs)
case
OPCODE_LDCW_I
:
case
OPCODE_LDCD_S
:
case
OPCODE_LDCW_S
:
ret
=
-
1
;
/* "undefined", but lets kill them. */
ret
=
ERR_NOTHANDLED
;
/* "undefined", but lets kill them. */
break
;
}
#ifdef CONFIG_PA20
...
...
@@ -632,7 +702,7 @@ void handle_unaligned(struct pt_regs *regs)
regs
->
gr
[
R1
(
regs
->
iir
)]
=
newbase
;
if
(
ret
<
0
)
if
(
ret
==
ERR_NOTHANDLED
)
printk
(
KERN_CRIT
"Not-handled unaligned insn 0x%08lx
\n
"
,
regs
->
iir
);
DPRINTF
(
"ret = %d
\n
"
,
ret
);
...
...
@@ -641,6 +711,17 @@ void handle_unaligned(struct pt_regs *regs)
{
printk
(
KERN_CRIT
"Unaligned handler failed, ret = %d
\n
"
,
ret
);
die_if_kernel
(
"Unaligned data reference"
,
regs
,
28
);
if
(
ret
==
ERR_PAGEFAULT
)
{
si
.
si_signo
=
SIGSEGV
;
si
.
si_errno
=
0
;
si
.
si_code
=
SEGV_MAPERR
;
si
.
si_addr
=
(
void
*
)
regs
->
ior
;
force_sig_info
(
SIGSEGV
,
&
si
,
current
);
}
else
{
force_sigbus:
/* couldn't handle it ... */
si
.
si_signo
=
SIGBUS
;
...
...
@@ -648,6 +729,7 @@ void handle_unaligned(struct pt_regs *regs)
si
.
si_code
=
BUS_ADRALN
;
si
.
si_addr
=
(
void
*
)
regs
->
ior
;
force_sig_info
(
SIGBUS
,
&
si
,
current
);
}
return
;
}
...
...
arch/parisc/lib/lusercopy.S
View file @
cf3f977a
...
...
@@ -132,6 +132,43 @@ $lcfu_zero_loop:
.
procend
/
*
*
unsigned
long
*
lcopy_in_user
(
void
*
to
,
const
void
*
from
,
unsigned
long
n
)
*
*
Returns
0
for
success
.
*
otherwise
,
returns
number
of
bytes
not
transferred
.
*/
.
export
lcopy_in_user
,
code
lcopy_in_user
:
.
proc
.
callinfo
NO_CALLS
.
entry
comib
,=,
n
0
,%
r24
,
$lciu_done
get_sr
$lciu_loop
:
ldbs
,
ma
1
(%
sr1
,%
r25
),%
r1
addib
,<>
-
1
,%
r24
,
$lciu_loop
1
:
stbs
,
ma
%
r1
,
1
(%
sr1
,%
r26
)
$lciu_done
:
bv
%
r0
(%
r2
)
copy
%
r24
,%
r28
.
exit
2
:
b
$lciu_done
ldo
1
(%
r24
),%
r24
.
section
__ex_table
,
"a"
#ifdef __LP64__
.
dword
1
b
,(
2
b
-
1
b
)
#else
.
word
1
b
,(
2
b
-
1
b
)
#endif
.
previous
.
procend
/
*
*
long
lstrncpy_from_user
(
char
*
dst
,
const
char
*
src
,
long
n
)
*
...
...
drivers/parisc/Kconfig
View file @
cf3f977a
...
...
@@ -109,7 +109,7 @@ config IOMMU_SBA
config SUPERIO
bool "SuperIO (SuckyIO) support"
depends on PCI
depends on PCI
_LBA
default y
help
Say Y here to support the SuperIO chip found in Bxxxx, C3xxx and
...
...
@@ -124,7 +124,20 @@ config CHASSIS_LCD_LED
Disk/Network activities LEDs on some PA-RISC machines,
or support for the LCD that can be found on recent material.
This has nothing to do with LED State support for A, J and E class.
This has nothing to do with LED State support for A and E class.
If unsure, say Y.
config PDC_CHASSIS
bool "PDC chassis State Panel support"
default y
help
Say Y here if you want to enable support for the LED State front
panel as found on E class, and support for the GSP Virtual Front
Panel (LED State and message logging) as found on high end
servers such as A, L and N-class.
This has nothing to do with Chassis LCD and LED support.
If unsure, say Y.
...
...
drivers/parisc/ccio-dma.c
View file @
cf3f977a
...
...
@@ -483,7 +483,7 @@ typedef unsigned long space_t;
*/
#define IOPDIR_VALID 0x01UL
#define HINT_SAFE_DMA 0x02UL
/* used for pci_alloc_consistent() pages */
#ifdef CONFIG_
ISA
/* EISA support really */
#ifdef CONFIG_
EISA
#define HINT_STOP_MOST 0x04UL
/* LSL support */
#else
#define HINT_STOP_MOST 0x00UL
/* only needed for "some EISA devices" */
...
...
@@ -1312,8 +1312,8 @@ static struct ioc * ccio_find_ioc(int hw_path)
* ccio_get_iommu - Find the iommu which controls this device
* @dev: The parisc device.
*
* This function searches through the register
d IOMMU's and returns the
*
appropriate IOMMU for the device based upon the device
s hardware path.
* This function searches through the register
ed IOMMU's and returns
*
the appropriate IOMMU for the device based on it
s hardware path.
*/
void
*
ccio_get_iommu
(
const
struct
parisc_device
*
dev
)
{
...
...
@@ -1509,12 +1509,13 @@ ccio_init_resource(struct resource *res, char *name, unsigned long ioaddr)
{
int
result
;
res
->
parent
=
NULL
;
res
->
flags
=
IORESOURCE_MEM
;
res
->
start
=
(
unsigned
long
)(
signed
)
__raw_readl
(
ioaddr
)
<<
16
;
res
->
end
=
(
unsigned
long
)(
signed
)
(
__raw_readl
(
ioaddr
+
4
)
<<
16
)
-
1
;
res
->
name
=
name
;
if
(
res
->
end
+
1
==
res
->
start
)
return
;
res
->
name
=
name
;
result
=
request_resource
(
&
iomem_resource
,
res
);
if
(
result
<
0
)
{
printk
(
KERN_ERR
"%s: failed to claim CCIO bus address space (%08lx,%08lx)
\n
"
,
...
...
@@ -1534,120 +1535,111 @@ static void __init ccio_init_resources(struct ioc *ioc)
(
unsigned
long
)
&
ioc
->
ioc_hpa
->
io_io_low_hv
);
}
static
int
expand_resource
(
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
align
)
static
int
new_ioc_area
(
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
)
{
struct
resource
*
temp_res
;
unsigned
long
start
=
res
->
start
;
unsigned
long
end
;
/* see if we can expand above */
end
=
(
res
->
end
+
size
+
align
-
1
)
&
~
(
align
-
1
);;
temp_res
=
__request_region
(
res
->
parent
,
res
->
end
,
end
-
res
->
end
,
"expansion"
);
if
(
!
temp_res
)
{
/* now try below */
start
=
((
res
->
start
-
size
+
align
)
&
~
(
align
-
1
))
-
align
;
end
=
res
->
end
;
temp_res
=
__request_region
(
res
->
parent
,
start
,
size
,
"expansion"
);
if
(
!
temp_res
)
{
return
-
ENOMEM
;
}
}
release_resource
(
temp_res
);
temp_res
=
res
->
parent
;
release_resource
(
res
);
res
->
start
=
start
;
res
->
end
=
end
;
/* This could be caused by some sort of race. Basically, if
* this tripped something stole the region we just reserved
* and then released to check for expansion */
BUG_ON
(
request_resource
(
temp_res
,
res
)
!=
0
);
if
(
max
<=
min
)
return
-
EBUSY
;
res
->
start
=
(
max
-
size
+
1
)
&~
(
align
-
1
);
res
->
end
=
res
->
start
+
size
;
if
(
!
request_resource
(
&
iomem_resource
,
res
))
return
0
;
return
new_ioc_area
(
res
,
size
,
min
,
max
-
size
,
align
);
}
static
void
expand_ioc_area
(
struct
resource
*
parent
,
struct
ioc
*
ioc
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
)
static
int
expand_ioc_area
(
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
)
{
if
(
ioc
==
NULL
)
/* no IOC, so nothing to expand */
return
;
unsigned
long
start
,
len
;
if
(
expand_resource
(
parent
,
size
,
align
)
!=
0
)
{
printk
(
KERN_ERR
"Unable to expand %s window by 0x%lx
\n
"
,
parent
->
name
,
size
);
return
;
if
(
!
res
->
parent
)
return
new_ioc_area
(
res
,
size
,
min
,
max
,
align
);
start
=
(
res
->
start
-
size
)
&~
(
align
-
1
);
len
=
res
->
end
-
start
+
1
;
if
(
start
>=
min
)
{
if
(
!
adjust_resource
(
res
,
start
,
len
))
return
0
;
}
start
=
res
->
start
;
len
=
((
size
+
res
->
end
+
align
)
&~
(
align
-
1
))
-
start
;
if
(
start
+
len
<=
max
)
{
if
(
!
adjust_resource
(
res
,
start
,
len
))
return
0
;
}
/* OK, we have the memory, now expand the window */
if
(
parent
==
&
ioc
->
mmio_region
[
0
])
{
return
-
EBUSY
;
}
/*
* Dino calls this function. Beware that we may get called on systems
* which have no IOC (725, B180, C160L, etc) but do have a Dino.
* So it's legal to find no parent IOC.
*
* Some other issues: one of the resources in the ioc may be unassigned.
*/
int
ccio_allocate_resource
(
const
struct
parisc_device
*
dev
,
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
)
{
struct
resource
*
parent
=
&
iomem_resource
;
struct
ioc
*
ioc
=
ccio_get_iommu
(
dev
);
if
(
!
ioc
)
goto
out
;
parent
=
ioc
->
mmio_region
;
if
(
parent
->
parent
&&
!
allocate_resource
(
parent
,
res
,
size
,
min
,
max
,
align
,
NULL
,
NULL
))
return
0
;
if
((
parent
+
1
)
->
parent
&&
!
allocate_resource
(
parent
+
1
,
res
,
size
,
min
,
max
,
align
,
NULL
,
NULL
))
return
0
;
if
(
!
expand_ioc_area
(
parent
,
size
,
min
,
max
,
align
))
{
__raw_writel
(((
parent
->
start
)
>>
16
)
|
0xffff0000
,
(
unsigned
long
)
&
(
ioc
->
ioc_hpa
->
io_io_low
));
__raw_writel
(((
parent
->
end
)
>>
16
)
|
0xffff0000
,
(
unsigned
long
)
&
(
ioc
->
ioc_hpa
->
io_io_high
));
}
else
if
(
parent
==
&
ioc
->
mmio_region
[
1
])
{
}
else
if
(
!
expand_ioc_area
(
parent
+
1
,
size
,
min
,
max
,
align
))
{
parent
++
;
__raw_writel
(((
parent
->
start
)
>>
16
)
|
0xffff0000
,
(
unsigned
long
)
&
(
ioc
->
ioc_hpa
->
io_io_low_hv
));
__raw_writel
(((
parent
->
end
)
>>
16
)
|
0xffff0000
,
(
unsigned
long
)
&
(
ioc
->
ioc_hpa
->
io_io_high_hv
));
}
else
{
/* This should be impossible. It means
* expand_ioc_area got called with a resource that
* didn't belong to the ioc
*/
BUG
();
return
-
EBUSY
;
}
out:
return
allocate_resource
(
parent
,
res
,
size
,
min
,
max
,
align
,
NULL
,
NULL
);
}
static
struct
resource
*
ccio_get_resource
(
struct
ioc
*
ioc
,
const
struct
parisc_device
*
dev
)
int
ccio_request_resource
(
const
struct
parisc_device
*
dev
,
struct
resource
*
res
)
{
struct
resource
*
parent
;
struct
ioc
*
ioc
=
ccio_get_iommu
(
dev
);
if
(
!
ioc
)
{
return
&
iomem_resource
;
parent
=
&
iomem_resource
;
}
else
if
((
ioc
->
mmio_region
->
start
<=
dev
->
hpa
)
&&
(
dev
->
hpa
<
ioc
->
mmio_region
->
end
))
{
return
ioc
->
mmio_region
;
parent
=
ioc
->
mmio_region
;
}
else
if
(((
ioc
->
mmio_region
+
1
)
->
start
<=
dev
->
hpa
)
&&
(
dev
->
hpa
<
(
ioc
->
mmio_region
+
1
)
->
end
))
{
return
ioc
->
mmio_region
+
1
;
parent
=
ioc
->
mmio_region
+
1
;
}
else
{
return
NULL
;
}
}
int
ccio_allocate_resource
(
const
struct
parisc_device
*
dev
,
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
,
void
(
*
alignf
)(
void
*
,
struct
resource
*
,
unsigned
long
,
unsigned
long
),
void
*
alignf_data
)
{
struct
ioc
*
ioc
=
ccio_get_iommu
(
dev
);
struct
resource
*
parent
=
ccio_get_resource
(
ioc
,
dev
);
if
(
!
parent
)
return
-
EBUSY
;
if
(
!
allocate_resource
(
parent
,
res
,
size
,
min
,
max
,
align
,
alignf
,
alignf_data
))
return
0
;
expand_ioc_area
(
parent
,
ioc
,
size
,
min
,
max
,
align
);
return
allocate_resource
(
parent
,
res
,
size
,
min
,
max
,
align
,
alignf
,
alignf_data
);
}
int
ccio_request_resource
(
const
struct
parisc_device
*
dev
,
struct
resource
*
res
)
{
struct
ioc
*
ioc
=
ccio_get_iommu
(
dev
);
struct
resource
*
parent
=
ccio_get_resource
(
ioc
,
dev
);
}
return
request_resource
(
parent
,
res
);
}
/**
* ccio_probe - Determine if ccio should claim this device.
* @dev: The device which has been found
...
...
drivers/parisc/dino.c
View file @
cf3f977a
...
...
@@ -165,6 +165,13 @@ struct dino_device
#define DINO_CFG_TOK(bus,dfn,pos) ((u32) ((bus)<<16 | (dfn)<<8 | (pos)))
/*
* keep the current highest bus count to assist in allocating busses. This
* tries to keep a global bus count total so that when we discover an
* entirely new bus, it can be given a unique bus number.
*/
static
int
dino_current_bus
=
0
;
static
int
dino_cfg_read
(
struct
pci_bus
*
bus
,
unsigned
int
devfn
,
int
where
,
int
size
,
u32
*
val
)
{
...
...
@@ -478,8 +485,7 @@ dino_card_setup(struct pci_bus *bus, unsigned long base_addr)
if
(
ccio_allocate_resource
(
dino_dev
->
hba
.
dev
,
res
,
_8MB
,
F_EXTEND
(
0xf0000000UL
)
|
_8MB
,
F_EXTEND
(
0xffffffffUL
)
&~
_8MB
,
_8MB
,
NULL
,
NULL
)
<
0
)
{
F_EXTEND
(
0xffffffffUL
)
&~
_8MB
,
_8MB
)
<
0
)
{
struct
list_head
*
ln
,
*
tmp_ln
;
printk
(
KERN_ERR
"Dino: cannot attach bus %s
\n
"
,
...
...
@@ -505,8 +511,6 @@ dino_card_setup(struct pci_bus *bus, unsigned long base_addr)
DBG
(
"DINO GSC WRITE i=%d, start=%lx, dino addr = %lx
\n
"
,
i
,
res
->
start
,
base_addr
+
DINO_IO_ADDR_EN
);
gsc_writel
(
1
<<
i
,
base_addr
+
DINO_IO_ADDR_EN
);
pci_bus_assign_resources
(
bus
);
}
static
void
__init
...
...
@@ -547,6 +551,9 @@ dino_card_fixup(struct pci_dev *dev)
dino_cfg_write
(
dev
->
bus
,
dev
->
devfn
,
PCI_INTERRUPT_LINE
,
1
,
dev
->
irq
);
}
/* The alignment contraints for PCI bridges under dino */
#define DINO_BRIDGE_ALIGN 0x100000
static
void
__init
dino_fixup_bus
(
struct
pci_bus
*
bus
)
...
...
@@ -560,13 +567,48 @@ dino_fixup_bus(struct pci_bus *bus)
__FUNCTION__
,
bus
,
bus
->
secondary
,
bus
->
dev
->
platform_data
);
/* Firmware doesn't set up card-mode dino, so we have to */
if
(
is_card_dino
(
&
dino_dev
->
hba
.
dev
->
id
))
if
(
is_card_dino
(
&
dino_dev
->
hba
.
dev
->
id
))
{
dino_card_setup
(
bus
,
dino_dev
->
hba
.
base_addr
);
}
else
if
(
bus
->
parent
==
NULL
)
{
/* must have a dino above it, reparent the resources
* into the dino window */
bus
->
resource
[
0
]
=
&
(
dino_dev
->
hba
.
io_space
);
bus
->
resource
[
1
]
=
&
(
dino_dev
->
hba
.
lmmio_space
);
}
else
if
(
bus
->
self
)
{
int
i
;
/* If this is a PCI-PCI Bridge, read the window registers etc */
if
(
bus
->
self
)
pci_read_bridge_bases
(
bus
);
for
(
i
=
0
;
i
<
PCI_NUM_RESOURCES
;
i
++
)
{
if
((
bus
->
self
->
resource
[
i
].
flags
&
(
IORESOURCE_IO
|
IORESOURCE_MEM
))
==
0
)
continue
;
if
(
bus
->
self
->
resource
[
i
].
flags
&
IORESOURCE_MEM
)
{
/* There's a quirk to alignment of
* bridge memory resources: the start
* is the alignment and start-end is
* the size. However, firmware will
* have assigned start and end, so we
* need to take this into account */
bus
->
self
->
resource
[
i
].
end
=
bus
->
self
->
resource
[
i
].
end
-
bus
->
self
->
resource
[
i
].
start
+
DINO_BRIDGE_ALIGN
;
bus
->
self
->
resource
[
i
].
start
=
DINO_BRIDGE_ALIGN
;
}
DBG
(
"DEBUG %s assigning %d [0x%lx,0x%lx]
\n
"
,
bus
->
self
->
dev
.
bus_id
,
i
,
bus
->
self
->
resource
[
i
].
start
,
bus
->
self
->
resource
[
i
].
end
);
pci_assign_resource
(
bus
->
self
,
i
);
DBG
(
"DEBUG %s after assign %d [0x%lx,0x%lx]
\n
"
,
bus
->
self
->
dev
.
bus_id
,
i
,
bus
->
self
->
resource
[
i
].
start
,
bus
->
self
->
resource
[
i
].
end
);
}
}
list_for_each
(
ln
,
&
bus
->
devices
)
{
int
i
;
...
...
@@ -596,9 +638,39 @@ dino_fixup_bus(struct pci_bus *bus)
}
#endif
}
/* null out the ROM resource if there is one (we don't
* care about an expansion rom on parisc, since it
* usually contains (x86) bios code) */
dev
->
resource
[
PCI_ROM_RESOURCE
].
flags
=
0
;
dev
->
resource
[
PCI_ROM_RESOURCE
].
start
=
0
;
dev
->
resource
[
PCI_ROM_RESOURCE
].
end
=
0
;
if
(
dev
->
irq
==
255
)
{
#ifdef DINO_FIX_UNASSIGNED_INTERRUPTS
/* This code tries to assign an unassigned
* interrupt. Leave it disabled unless you
* *really* know what you're doing since the
* pin<->interrupt line mapping varies by bus
* and machine */
u32
irq_pin
;
dino_cfg_read
(
dev
->
bus
,
dev
->
devfn
,
PCI_INTERRUPT_PIN
,
1
,
&
irq_pin
);
dev
->
irq
=
(
irq_pin
+
PCI_SLOT
(
dev
->
devfn
)
-
1
)
%
4
;
dino_cfg_write
(
dev
->
bus
,
dev
->
devfn
,
PCI_INTERRUPT_LINE
,
1
,
dev
->
irq
);
dev
->
irq
+=
dino_dev
->
dino_region
->
data
.
irqbase
printk
(
KERN_WARNING
"Device %s has undefined IRQ, setting to %d
\n
"
,
dev
->
slot_name
,
irq_pin
);
#else
dev
->
irq
=
65535
;
printk
(
KERN_WARNING
"Device %s has unassigned IRQ
\n
"
,
dev
->
slot_name
);
#endif
}
else
{
/* Adjust INT_LINE for that busses region */
dev
->
irq
=
dino_dev
->
dino_region
->
data
.
irqbase
+
dev
->
irq
;
dev
->
irq
+=
dino_dev
->
dino_region
->
data
.
irqbase
;
}
}
}
...
...
@@ -827,6 +899,7 @@ dino_driver_callback(struct parisc_device *dev)
const
int
name_len
=
32
;
char
*
name
;
int
is_cujo
=
0
;
struct
pci_bus
*
bus
;
name
=
kmalloc
(
name_len
,
GFP_KERNEL
);
if
(
name
)
...
...
@@ -912,9 +985,20 @@ dino_driver_callback(struct parisc_device *dev)
** It's not used to avoid chicken/egg problems
** with configuration accessor functions.
*/
dino_dev
->
hba
.
hba_bus
=
pci_scan_bus_parented
(
&
dev
->
dev
,
dino_dev
->
hba
.
hba_num
,
bus
=
pci_scan_bus_parented
(
&
dev
->
dev
,
dino_current_bus
,
&
dino_cfg_ops
,
NULL
);
if
(
bus
)
{
/* This code *depends* on scanning being single threaded
* if it isn't, this global bus number count will fail
*/
dino_current_bus
=
bus
->
subordinate
+
1
;
pci_bus_assign_resources
(
bus
);
}
else
{
printk
(
KERN_ERR
"ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)
\n
"
,
dev
->
dev
.
bus_id
,
dino_current_bus
);
/* increment the bus number in case of duplicates */
dino_current_bus
++
;
}
dino_dev
->
hba
.
hba_bus
=
bus
;
return
0
;
}
...
...
@@ -923,10 +1007,13 @@ dino_driver_callback(struct parisc_device *dev)
* the same sversion as Dino, so we have to check hversion as well.
* Unfortunately, the J2240 PDC reports the wrong hversion for the first
* Dino, so we have to test for Dino, Cujo and Dino-in-a-J2240.
* For card-mode Dino, most machines report an sversion of 9D. But 715
* and 725 firmware misreport it as 0x08080 for no adequately explained
* reason.
*/
static
struct
parisc_device_id
dino_tbl
[]
=
{
{
HPHW_A_DMA
,
HVERSION_REV_ANY_ID
,
0x004
,
0x0009D
},
/* Card-mode Dino.
*/
{
HPHW_A_DMA
,
HVERSION_REV_ANY_ID
,
0x444
,
0x08080
},
/* Same card in a 715. Bug?
*/
{
HPHW_A_DMA
,
HVERSION_REV_ANY_ID
,
0x004
,
0x0009D
},
/* Card-mode Dino
*/
{
HPHW_A_DMA
,
HVERSION_REV_ANY_ID
,
HVERSION_ANY_ID
,
0x08080
},
/* XXX
*/
{
HPHW_BRIDGE
,
HVERSION_REV_ANY_ID
,
0x680
,
0xa
},
/* Bridge-mode Dino */
{
HPHW_BRIDGE
,
HVERSION_REV_ANY_ID
,
0x682
,
0xa
},
/* Bridge-mode Cujo */
{
HPHW_BRIDGE
,
HVERSION_REV_ANY_ID
,
0x05d
,
0xa
},
/* Dino in a J2240 */
...
...
drivers/parisc/led.c
View file @
cf3f977a
...
...
@@ -441,7 +441,6 @@ static __inline__ int led_get_diskio_activity(void)
#if HZ==100
#define NORMALIZED_COUNT(count) (count)
#else
#warning "Untested situation HZ != 100 !!"
#define NORMALIZED_COUNT(count) (count/(HZ/100))
#endif
...
...
drivers/parisc/superio.c
View file @
cf3f977a
...
...
@@ -65,7 +65,9 @@
#include <linux/ioport.h>
#include <linux/parport.h>
#include <linux/parport_pc.h>
#include <linux/serial_reg.h>
#include <linux/termios.h>
#include <linux/tty.h>
#include <linux/serial_core.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/irq.h>
...
...
@@ -387,11 +389,27 @@ int superio_fixup_irq(struct pci_dev *pcidev)
return
(
sio_dev
.
irq_region
->
data
.
irqbase
+
local_irq
);
}
static
struct
uart_port
serial
[]
=
{
{
.
iotype
=
UPIO_PORT
,
.
line
=
0
,
.
type
=
PORT_16550A
,
.
uartclk
=
115200
*
16
,
.
fifosize
=
16
,
},
{
.
iotype
=
UPIO_PORT
,
.
line
=
1
,
.
type
=
PORT_16550A
,
.
uartclk
=
115200
*
16
,
.
fifosize
=
16
,
}
};
void
__devinit
superio_serial_init
(
void
)
{
#ifdef CONFIG_SERIAL_8250
struct
serial_struct
*
serial
;
int
retval
;
if
(
!
sio_dev
.
irq_region
)
...
...
@@ -400,47 +418,15 @@ superio_serial_init(void)
if
(
!
sio_dev
.
iosapic_irq_enabled
)
superio_init
(
&
sio_dev
);
serial
=
kmalloc
(
2
*
sizeof
(
struct
serial_struct
),
GFP_KERNEL
);
if
(
!
serial
)
{
printk
(
KERN_WARNING
"SuperIO: Could not get memory for serial struct.
\n
"
);
return
;
}
serial
[
0
].
iobase
=
sio_dev
.
sp1_base
;
retval
=
early_serial_setup
(
&
serial
[
0
]);
memset
(
serial
,
0
,
2
*
sizeof
(
struct
serial_struct
));
serial
->
type
=
PORT_16550A
;
serial
->
line
=
0
;
serial
->
port
=
sio_dev
.
sp1_base
;
serial
->
port_high
=
0
;
serial
->
irq
=
sio_dev
.
irq_region
->
data
.
irqbase
+
SP1_IRQ
;
serial
->
io_type
=
SERIAL_IO_PORT
;
serial
->
flags
=
0
;
serial
->
xmit_fifo_size
=
16
;
serial
->
custom_divisor
=
0
;
serial
->
baud_base
=
115200
;
retval
=
register_serial
(
serial
);
if
(
retval
<
0
)
{
if
(
retval
<
0
)
printk
(
KERN_WARNING
"SuperIO: Register Serial #0 failed.
\n
"
);
kfree
(
serial
);
return
;
}
serial
++
;
serial
->
type
=
PORT_16550A
;
serial
->
line
=
1
;
serial
->
port
=
sio_dev
.
sp2_base
;
serial
->
port_high
=
0
;
serial
->
irq
=
sio_dev
.
irq_region
->
data
.
irqbase
+
SP2_IRQ
;
serial
->
io_type
=
SERIAL_IO_PORT
;
serial
->
flags
=
0
;
serial
->
xmit_fifo_size
=
16
;
serial
->
custom_divisor
=
0
;
serial
->
baud_base
=
115200
;
serial
[
1
].
iobase
=
sio_dev
.
sp2_base
;
retval
=
early_serial_setup
(
&
serial
[
1
]);
retval
=
register_serial
(
serial
);
if
(
retval
<
0
)
printk
(
KERN_WARNING
"SuperIO: Register Serial #1 failed.
\n
"
);
#endif
/* CONFIG_SERIAL_8250 */
...
...
@@ -543,5 +529,5 @@ static void __exit superio_exit(void)
*
* FIXME: does this break the superio console?
*/
late_initcall
(
superio_modinit
);
module_init
(
superio_modinit
);
module_exit
(
superio_exit
);
include/asm-parisc/dma-mapping.h
View file @
cf3f977a
...
...
@@ -5,9 +5,7 @@
#include <linux/config.h>
#include <asm/cacheflush.h>
/*
** See Documentation/DMA-mapping.txt
*/
/* See Documentation/DMA-mapping.txt */
struct
hppa_dma_ops
{
int
(
*
dma_supported
)(
struct
device
*
dev
,
u64
mask
);
void
*
(
*
alloc_consistent
)(
struct
device
*
dev
,
size_t
size
,
dma_addr_t
*
iova
,
int
flag
);
...
...
@@ -208,15 +206,13 @@ int ccio_request_resource(const struct parisc_device *dev,
struct
resource
*
res
);
int
ccio_allocate_resource
(
const
struct
parisc_device
*
dev
,
struct
resource
*
res
,
unsigned
long
size
,
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
,
void
(
*
alignf
)(
void
*
,
struct
resource
*
,
unsigned
long
,
unsigned
long
),
void
*
alignf_data
);
unsigned
long
min
,
unsigned
long
max
,
unsigned
long
align
);
#else
/* !CONFIG_IOMMU_CCIO */
#define ccio_get_iommu(dev) NULL
#define ccio_request_resource(dev, res) request_resource(&iomem_resource, res)
#define ccio_allocate_resource(dev, res, size, min, max, align
, alignf, data
) \
#define ccio_allocate_resource(dev, res, size, min, max, align) \
allocate_resource(&iomem_resource, res, size, min, max, \
align,
alignf, data
)
align,
NULL, NULL
)
#endif
/* !CONFIG_IOMMU_CCIO */
#ifdef CONFIG_IOMMU_SBA
...
...
include/asm-parisc/uaccess.h
View file @
cf3f977a
...
...
@@ -42,8 +42,8 @@ extern int __put_user_bad(void);
#if BITS_PER_LONG == 32
#define LDD_KERNEL(ptr) __get_kernel_bad();
#define LDD_USER(ptr) __get_user_bad();
#define STD_KERNEL(x, ptr)
__put_kernel_asm64((u32)
x,ptr)
#define STD_USER(x, ptr)
__put_user_asm64((u32)
x,ptr)
#define STD_KERNEL(x, ptr)
__put_kernel_asm64(
x,ptr)
#define STD_USER(x, ptr)
__put_user_asm64(
x,ptr)
#else
#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr)
#define LDD_USER(ptr) __get_user_asm("ldd",ptr)
...
...
@@ -256,11 +256,12 @@ static inline void __put_user_asm64(u64 x, void *ptr)
* Complex access routines -- external declarations
*/
extern
unsigned
long
lcopy_to_user
(
void
*
,
const
void
*
,
unsigned
long
);
extern
unsigned
long
lcopy_from_user
(
void
*
,
const
void
*
,
unsigned
long
);
extern
long
lstrncpy_from_user
(
char
*
,
const
char
*
,
long
);
extern
unsigned
lclear_user
(
void
*
,
unsigned
long
);
extern
long
lstrnlen_user
(
const
char
*
,
long
);
extern
unsigned
long
lcopy_to_user
(
void
__user
*
,
const
void
*
,
unsigned
long
);
extern
unsigned
long
lcopy_from_user
(
void
*
,
const
void
__user
*
,
unsigned
long
);
extern
unsigned
long
lcopy_in_user
(
void
__user
*
,
const
void
__user
*
,
unsigned
long
);
extern
long
lstrncpy_from_user
(
char
*
,
const
char
__user
*
,
long
);
extern
unsigned
lclear_user
(
void
__user
*
,
unsigned
long
);
extern
long
lstrnlen_user
(
const
char
__user
*
,
long
);
/*
* Complex access routines -- macros
...
...
@@ -276,5 +277,7 @@ extern long lstrnlen_user(const char *,long);
#define __copy_from_user lcopy_from_user
#define copy_to_user lcopy_to_user
#define __copy_to_user lcopy_to_user
#define copy_in_user lcopy_in_user
#define __copy_in_user lcopy_in_user
#endif
/* __PARISC_UACCESS_H */
include/asm-parisc/ucontext.h
View file @
cf3f977a
#ifndef _ASMPARISC_UCONTEXT_H
#define _ASMPARISC_UCONTEXT_H
#ifndef _ASM
_
PARISC_UCONTEXT_H
#define _ASM
_
PARISC_UCONTEXT_H
struct
ucontext
{
unsigned
long
uc_flags
;
unsigned
int
uc_flags
;
struct
ucontext
*
uc_link
;
stack_t
uc_stack
;
struct
sigcontext
uc_mcontext
;
sigset_t
uc_sigmask
;
/* mask last for extensibility */
};
#endif
/* !_ASMPARISC_UCONTEXT_H */
#endif
/* !_ASM
_
PARISC_UCONTEXT_H */
include/asm-parisc/unistd.h
View file @
cf3f977a
...
...
@@ -490,7 +490,7 @@
*/
#define __NR_Linux 0
#define __NR_
syscall
(__NR_Linux + 0)
#define __NR_
restart_syscall
(__NR_Linux + 0)
#define __NR_exit (__NR_Linux + 1)
#define __NR_fork (__NR_Linux + 2)
#define __NR_read (__NR_Linux + 3)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment