Commit 1f421cf6 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64_work
parents a94a71d6 828bb5f4
...@@ -156,6 +156,14 @@ S: University of Calgary ...@@ -156,6 +156,14 @@ S: University of Calgary
S: Calgary, Alberta S: Calgary, Alberta
S: Canada S: Canada
N: Miles Bader
E: miles@gnu.org
D: v850 port (uClinux)
S: NEC Corporation
S: 1753 Shimonumabe, Nakahara-ku
S: Kawasaki 211-8666
S: Japan
N: Ralf Baechle N: Ralf Baechle
E: ralf@gnu.org E: ralf@gnu.org
P: 1024/AF7B30C1 CF 97 C2 CC 6D AE A7 FE C8 BA 9C FC 88 DE 32 C3 P: 1024/AF7B30C1 CF 97 C2 CC 6D AE A7 FE C8 BA 9C FC 88 DE 32 C3
......
...@@ -27,7 +27,7 @@ create_params (unsigned long *buffer) ...@@ -27,7 +27,7 @@ create_params (unsigned long *buffer)
/* Head of the taglist */ /* Head of the taglist */
tag->hdr.tag = ATAG_CORE; tag->hdr.tag = ATAG_CORE;
tag->hdr.size = tag_size(tag_core); tag->hdr.size = tag_size(tag_core);
tag->u.core.flags = FLAG_READONLY; tag->u.core.flags = 1;
tag->u.core.pagesize = PAGE_SIZE; tag->u.core.pagesize = PAGE_SIZE;
tag->u.core.rootdev = 0; tag->u.core.rootdev = 0;
......
...@@ -40,6 +40,7 @@ CONFIG_KMOD=y ...@@ -40,6 +40,7 @@ CONFIG_KMOD=y
# CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_CO285 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_CAMELOT is not set # CONFIG_ARCH_CAMELOT is not set
# CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_FOOTBRIDGE is not set
...@@ -109,6 +110,12 @@ CONFIG_ARCH_SHARK=y ...@@ -109,6 +110,12 @@ CONFIG_ARCH_SHARK=y
# CONFIG_SA1100_USB_CHAR is not set # CONFIG_SA1100_USB_CHAR is not set
# CONFIG_H3600_SLEEVE is not set # CONFIG_H3600_SLEEVE is not set
#
# Intel PXA250/210 Implementations
#
# CONFIG_ARCH_LUBBOCK is not set
# CONFIG_ARCH_PXA_IDP is not set
# #
# CLPS711X/EP721X Implementations # CLPS711X/EP721X Implementations
# #
...@@ -120,6 +127,19 @@ CONFIG_ARCH_SHARK=y ...@@ -120,6 +127,19 @@ CONFIG_ARCH_SHARK=y
# CONFIG_ARCH_FORTUNET is not set # CONFIG_ARCH_FORTUNET is not set
# CONFIG_ARCH_EP7211 is not set # CONFIG_ARCH_EP7211 is not set
# CONFIG_ARCH_EP7212 is not set # CONFIG_ARCH_EP7212 is not set
#
# IOP310 Implementation Options
#
# CONFIG_ARCH_IQ80310 is not set
#
# IOP310 Chipset Features
#
# CONFIG_IOP310_AAU is not set
# CONFIG_IOP310_DMA is not set
# CONFIG_IOP310_MU is not set
# CONFIG_IOP310_PMON is not set
# CONFIG_ARCH_ACORN is not set # CONFIG_ARCH_ACORN is not set
# CONFIG_FOOTBRIDGE is not set # CONFIG_FOOTBRIDGE is not set
# CONFIG_FOOTBRIDGE_HOST is not set # CONFIG_FOOTBRIDGE_HOST is not set
...@@ -159,6 +179,9 @@ CONFIG_PCI_HOST_VIA82C505=y ...@@ -159,6 +179,9 @@ CONFIG_PCI_HOST_VIA82C505=y
CONFIG_ISA=y CONFIG_ISA=y
CONFIG_ISA_DMA=y CONFIG_ISA_DMA=y
# CONFIG_FIQ is not set # CONFIG_FIQ is not set
# CONFIG_ZBOOT_ROM is not set
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_PCI_NAMES is not set # CONFIG_PCI_NAMES is not set
# CONFIG_HOTPLUG is not set # CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set # CONFIG_PCMCIA is not set
...@@ -177,10 +200,11 @@ CONFIG_BINFMT_ELF=y ...@@ -177,10 +200,11 @@ CONFIG_BINFMT_ELF=y
# CONFIG_PREEMPT is not set # CONFIG_PREEMPT is not set
# CONFIG_APM is not set # CONFIG_APM is not set
# CONFIG_ARTHUR is not set # CONFIG_ARTHUR is not set
CONFIG_CMDLINE=""
CONFIG_LEDS=y CONFIG_LEDS=y
CONFIG_LEDS_TIMER=y CONFIG_LEDS_TIMER=y
# CONFIG_LEDS_CPU is not set # CONFIG_LEDS_CPU is not set
# CONFIG_ALIGNMENT_TRAP is not set CONFIG_ALIGNMENT_TRAP=y
# #
# Parallel port support # Parallel port support
...@@ -200,6 +224,11 @@ CONFIG_PARPORT_PC_CML1=y ...@@ -200,6 +224,11 @@ CONFIG_PARPORT_PC_CML1=y
# CONFIG_PARPORT_OTHER is not set # CONFIG_PARPORT_OTHER is not set
# CONFIG_PARPORT_1284 is not set # CONFIG_PARPORT_1284 is not set
#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set
# #
# Plug and Play configuration # Plug and Play configuration
# #
...@@ -217,6 +246,7 @@ CONFIG_PARPORT_PC_CML1=y ...@@ -217,6 +246,7 @@ CONFIG_PARPORT_PC_CML1=y
# CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_CISS_SCSI_TAPE is not set # CONFIG_CISS_SCSI_TAPE is not set
# CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
...@@ -254,7 +284,6 @@ CONFIG_INET=y ...@@ -254,7 +284,6 @@ CONFIG_INET=y
# CONFIG_INET_ECN is not set # CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set # CONFIG_SYN_COOKIES is not set
# CONFIG_IPV6 is not set # CONFIG_IPV6 is not set
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set # CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set # CONFIG_VLAN_8021Q is not set
...@@ -263,6 +292,11 @@ CONFIG_INET=y ...@@ -263,6 +292,11 @@ CONFIG_INET=y
# #
# CONFIG_IPX is not set # CONFIG_IPX is not set
# CONFIG_ATALK is not set # CONFIG_ATALK is not set
#
# Appletalk devices
#
# CONFIG_DEV_APPLETALK is not set
# CONFIG_DECNET is not set # CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set # CONFIG_BRIDGE is not set
# CONFIG_X25 is not set # CONFIG_X25 is not set
...@@ -378,7 +412,7 @@ CONFIG_CS89x0=y ...@@ -378,7 +412,7 @@ CONFIG_CS89x0=y
# CONFIG_WAN is not set # CONFIG_WAN is not set
# #
# "Tulip" family network device support # Tulip family network device support
# #
# CONFIG_NET_TULIP is not set # CONFIG_NET_TULIP is not set
...@@ -393,38 +427,66 @@ CONFIG_CS89x0=y ...@@ -393,38 +427,66 @@ CONFIG_CS89x0=y
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# #
# ATA/IDE/MFM/RLL support # ATA/ATAPI/MFM/RLL support
# #
CONFIG_IDE=y CONFIG_IDE=y
#
# ATA and ATAPI Block devices
#
CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDE=y
#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD_IDE is not set
# CONFIG_BLK_DEV_HD is not set # CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDEDISK=y CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set # CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_IDEDISK_STROKE is not set # CONFIG_IDEDISK_STROKE is not set
# CONFIG_BLK_DEV_IDECS is not set CONFIG_ATAPI=y
CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDETAPE is not set
CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDEFLOPPY=y
# CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_BLK_DEV_IDECS is not set
# #
# IDE chipset support # ATA host controller support
# #
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_CMD640_ENHANCED is not set
# CONFIG_BLK_DEV_ISAPNP is not set # CONFIG_BLK_DEV_ISAPNP is not set
# CONFIG_BLK_DEV_RZ1000 is not set
#
# PCI host controller support
#
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_IDEDMA_PCI is not set
# CONFIG_IDEDMA_PCI_AUTO is not set
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC6280_BURST is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_WDC_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_HPT34X_AUTODMA is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_PIIX is not set
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_PDC202XX is not set
# CONFIG_PDC202XX_BURST is not set
# CONFIG_PDC202XX_FORCE is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_BLK_DEV_SL82C105 is not set # CONFIG_BLK_DEV_SL82C105 is not set
# CONFIG_IDE_CHIPSETS is not set # CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEDMA_IVB is not set
# CONFIG_IDEDMA_AUTO is not set # CONFIG_IDEDMA_AUTO is not set
# CONFIG_BLK_DEV_ATARAID is not set # CONFIG_BLK_DEV_ATARAID is not set
# CONFIG_BLK_DEV_ATARAID_PDC is not set # CONFIG_BLK_DEV_ATARAID_PDC is not set
...@@ -451,6 +513,7 @@ CONFIG_CHR_DEV_SG=m ...@@ -451,6 +513,7 @@ CONFIG_CHR_DEV_SG=m
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
# #
# CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_REPORT_LUNS is not set
# CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set # CONFIG_SCSI_LOGGING is not set
...@@ -462,7 +525,6 @@ CONFIG_CHR_DEV_SG=m ...@@ -462,7 +525,6 @@ CONFIG_CHR_DEV_SG=m
# CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_DPT_I2O is not set
...@@ -522,42 +584,60 @@ CONFIG_CHR_DEV_SG=m ...@@ -522,42 +584,60 @@ CONFIG_CHR_DEV_SG=m
# #
# ISDN subsystem # ISDN subsystem
# #
# CONFIG_ISDN is not set # CONFIG_ISDN_BOOL is not set
# #
# Input device support # Input device support
# #
# CONFIG_INPUT is not set # CONFIG_INPUT is not set
#
# Userland interfaces
#
# CONFIG_INPUT_KEYBDEV is not set # CONFIG_INPUT_KEYBDEV is not set
# CONFIG_INPUT_MOUSEDEV is not set # CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
# CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_TSLIBDEV is not set
# CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set
# CONFIG_INPUT_UINPUT is not set
#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set # CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y CONFIG_SOUND_GAMEPORT=y
# CONFIG_GAMEPORT_NS558 is not set # CONFIG_GAMEPORT_NS558 is not set
# CONFIG_GAMEPORT_L4 is not set # CONFIG_GAMEPORT_L4 is not set
# CONFIG_INPUT_EMU10K1 is not set # CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_PCIGAME is not set # CONFIG_GAMEPORT_VORTEX is not set
# CONFIG_GAMEPORT_FM801 is not set # CONFIG_GAMEPORT_FM801 is not set
# CONFIG_GAMEPORT_CS461x is not set # CONFIG_GAMEPORT_CS461x is not set
# CONFIG_SERIO is not set # CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set
# CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
#
# Input Device Drivers
#
# #
# Character devices # Character devices
# #
CONFIG_VT=y CONFIG_VT=y
CONFIG_VT_CONSOLE=y CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_SERIAL_NONSTANDARD is not set
# #
# Serial drivers # Serial drivers
# #
# CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_CONSOLE is not set CONFIG_SERIAL_8250_CONSOLE=y
# CONFIG_SERIAL_8250_CS is not set
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set
# CONFIG_SERIAL_8250_MANY_PORTS is not set # CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set # CONFIG_SERIAL_8250_SHARE_IRQ is not set
...@@ -568,10 +648,6 @@ CONFIG_SERIAL_CONSOLE=y ...@@ -568,10 +648,6 @@ CONFIG_SERIAL_CONSOLE=y
# #
# Non-8250 serial port support # Non-8250 serial port support
# #
#
# ARM Serial drivers
#
# CONFIG_ATOMWIDE_SERIAL is not set # CONFIG_ATOMWIDE_SERIAL is not set
# CONFIG_DUALSP_SERIAL is not set # CONFIG_DUALSP_SERIAL is not set
# CONFIG_SERIAL_ANAKIN is not set # CONFIG_SERIAL_ANAKIN is not set
...@@ -580,6 +656,7 @@ CONFIG_SERIAL_CONSOLE=y ...@@ -580,6 +656,7 @@ CONFIG_SERIAL_CONSOLE=y
# CONFIG_SERIAL_AMBA_CONSOLE is not set # CONFIG_SERIAL_AMBA_CONSOLE is not set
# CONFIG_SERIAL_CLPS711X is not set # CONFIG_SERIAL_CLPS711X is not set
# CONFIG_SERIAL_CLPS711X_CONSOLE is not set # CONFIG_SERIAL_CLPS711X_CONSOLE is not set
# CONFIG_SERIAL_CLPS711X_OLD_NAME is not set
# CONFIG_SERIAL_21285 is not set # CONFIG_SERIAL_21285 is not set
# CONFIG_SERIAL_21285_OLD is not set # CONFIG_SERIAL_21285_OLD is not set
# CONFIG_SERIAL_21285_CONSOLE is not set # CONFIG_SERIAL_21285_CONSOLE is not set
...@@ -587,6 +664,8 @@ CONFIG_SERIAL_CONSOLE=y ...@@ -587,6 +664,8 @@ CONFIG_SERIAL_CONSOLE=y
# CONFIG_SERIAL_UART00_CONSOLE is not set # CONFIG_SERIAL_UART00_CONSOLE is not set
# CONFIG_SERIAL_SA1100 is not set # CONFIG_SERIAL_SA1100 is not set
# CONFIG_SERIAL_SA1100_CONSOLE is not set # CONFIG_SERIAL_SA1100_CONSOLE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256 CONFIG_UNIX98_PTY_COUNT=256
CONFIG_PRINTER=m CONFIG_PRINTER=m
...@@ -615,17 +694,13 @@ CONFIG_PRINTER=m ...@@ -615,17 +694,13 @@ CONFIG_PRINTER=m
# Mice # Mice
# #
# CONFIG_BUSMOUSE is not set # CONFIG_BUSMOUSE is not set
CONFIG_MOUSE=y
CONFIG_PSMOUSE=y CONFIG_PSMOUSE=y
# CONFIG_82C710_MOUSE is not set
# CONFIG_PC110_PAD is not set
# CONFIG_QIC02_TAPE is not set # CONFIG_QIC02_TAPE is not set
# #
# Watchdog Cards # Watchdog Cards
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_INTEL_RNG is not set
# CONFIG_NVRAM is not set # CONFIG_NVRAM is not set
CONFIG_RTC=y CONFIG_RTC=y
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
...@@ -638,6 +713,7 @@ CONFIG_RTC=y ...@@ -638,6 +713,7 @@ CONFIG_RTC=y
# CONFIG_FTAPE is not set # CONFIG_FTAPE is not set
# CONFIG_AGP is not set # CONFIG_AGP is not set
# CONFIG_DRM is not set # CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set
# #
# Multimedia devices # Multimedia devices
...@@ -648,6 +724,8 @@ CONFIG_RTC=y ...@@ -648,6 +724,8 @@ CONFIG_RTC=y
# File systems # File systems
# #
# CONFIG_QUOTA is not set # CONFIG_QUOTA is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
# CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set # CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set # CONFIG_REISERFS_FS is not set
...@@ -711,6 +789,7 @@ CONFIG_NFS_FS=y ...@@ -711,6 +789,7 @@ CONFIG_NFS_FS=y
# CONFIG_NFSD_TCP is not set # CONFIG_NFSD_TCP is not set
CONFIG_SUNRPC=y CONFIG_SUNRPC=y
CONFIG_LOCKD=y CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
# CONFIG_SMB_FS is not set # CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set # CONFIG_NCP_FS is not set
# CONFIG_NCPFS_PACKET_SIGNING is not set # CONFIG_NCPFS_PACKET_SIGNING is not set
...@@ -741,6 +820,7 @@ CONFIG_MSDOS_PARTITION=y ...@@ -741,6 +820,7 @@ CONFIG_MSDOS_PARTITION=y
# CONFIG_SGI_PARTITION is not set # CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set # CONFIG_SUN_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SMB_NLS is not set # CONFIG_SMB_NLS is not set
CONFIG_NLS=y CONFIG_NLS=y
...@@ -769,6 +849,7 @@ CONFIG_NLS_CODEPAGE_850=y ...@@ -769,6 +849,7 @@ CONFIG_NLS_CODEPAGE_850=y
# CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 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_CODEPAGE_1251 is not set
CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_2 is not set
...@@ -788,8 +869,6 @@ CONFIG_NLS_ISO8859_1=y ...@@ -788,8 +869,6 @@ CONFIG_NLS_ISO8859_1=y
# #
# Console drivers # Console drivers
# #
CONFIG_PC_KEYB=y
CONFIG_PC_KEYMAP=y
# CONFIG_VGA_CONSOLE is not set # CONFIG_VGA_CONSOLE is not set
# #
...@@ -797,7 +876,6 @@ CONFIG_PC_KEYMAP=y ...@@ -797,7 +876,6 @@ CONFIG_PC_KEYMAP=y
# #
CONFIG_FB=y CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y CONFIG_DUMMY_CONSOLE=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_CLGEN is not set # CONFIG_FB_CLGEN is not set
# CONFIG_FB_PM2 is not set # CONFIG_FB_PM2 is not set
# CONFIG_FB_PM3 is not set # CONFIG_FB_PM3 is not set
...@@ -806,6 +884,7 @@ CONFIG_DUMMY_CONSOLE=y ...@@ -806,6 +884,7 @@ CONFIG_DUMMY_CONSOLE=y
# CONFIG_FB_CLPS711X is not set # CONFIG_FB_CLPS711X is not set
# CONFIG_FB_SA1100 is not set # CONFIG_FB_SA1100 is not set
CONFIG_FB_CYBER2000=y CONFIG_FB_CYBER2000=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_MATROX is not set # CONFIG_FB_MATROX is not set
# CONFIG_FB_ATY is not set # CONFIG_FB_ATY is not set
# CONFIG_FB_RADEON is not set # CONFIG_FB_RADEON is not set
...@@ -814,6 +893,8 @@ CONFIG_FB_CYBER2000=y ...@@ -814,6 +893,8 @@ CONFIG_FB_CYBER2000=y
# CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_3DFX is not set # CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 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 # CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set # CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y CONFIG_FBCON_CFB8=y
...@@ -903,6 +984,8 @@ CONFIG_SOUND_SB=m ...@@ -903,6 +984,8 @@ CONFIG_SOUND_SB=m
# Console Switches # Console Switches
# #
# CONFIG_SWITCHES is not set # CONFIG_SWITCHES is not set
# CONFIG_SWITCHES_SA1100 is not set
# CONFIG_SWITCHES_UCB1X00 is not set
# #
# USB support # USB support
...@@ -931,6 +1014,11 @@ CONFIG_DEBUG_USER=y ...@@ -931,6 +1014,11 @@ CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_DC21285_PORT is not set # CONFIG_DEBUG_DC21285_PORT is not set
# CONFIG_DEBUG_CLPS711X_UART2 is not set # CONFIG_DEBUG_CLPS711X_UART2 is not set
#
# Security options
#
CONFIG_SECURITY_CAPABILITIES=y
# #
# Library routines # Library routines
# #
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
...@@ -64,13 +63,13 @@ static void arthur_lcall7(int nr, struct pt_regs *regs) ...@@ -64,13 +63,13 @@ static void arthur_lcall7(int nr, struct pt_regs *regs)
} }
static struct exec_domain arthur_exec_domain = { static struct exec_domain arthur_exec_domain = {
"Arthur", /* name */ .name = "Arthur",
arthur_lcall7, .handler = arthur_lcall7,
PER_RISCOS, PER_RISCOS, .pers_low = PER_RISCOS,
arthur_to_linux_signals, .pers_high = PER_RISCOS,
linux_to_arthur_signals, .signal_map = arthur_to_linux_signals,
THIS_MODULE, .signal_invmap = linux_to_arthur_signals,
NULL /* Nothing after this in the list. */ .module = THIS_MODULE,
}; };
/* /*
...@@ -78,12 +77,12 @@ static struct exec_domain arthur_exec_domain = { ...@@ -78,12 +77,12 @@ static struct exec_domain arthur_exec_domain = {
* processes are using it. * processes are using it.
*/ */
int __init arthur_init(void) static int __init arthur_init(void)
{ {
return register_exec_domain(&arthur_exec_domain); return register_exec_domain(&arthur_exec_domain);
} }
void __exit arthur_exit(void) static void __exit arthur_exit(void)
{ {
unregister_exec_domain(&arthur_exec_domain); unregister_exec_domain(&arthur_exec_domain);
} }
......
...@@ -20,7 +20,7 @@ static int ...@@ -20,7 +20,7 @@ static int
via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where, via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 *value) int size, u32 *value)
{ {
outl(CONFIG_CMD(dev,where),0xCF8); outl(CONFIG_CMD(bus,devfn,where),0xCF8);
switch (size) { switch (size) {
case 1: case 1:
*value=inb(0xCFC + (where&3)); *value=inb(0xCFC + (where&3));
...@@ -36,7 +36,7 @@ via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -36,7 +36,7 @@ via82c505_read_config(struct pci_bus *bus, unsigned int devfn, int where,
} }
static int static int
via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 value) int size, u32 value)
{ {
outl(CONFIG_CMD(bus,devfn,where),0xCF8); outl(CONFIG_CMD(bus,devfn,where),0xCF8);
...@@ -61,8 +61,6 @@ static struct pci_ops via82c505_ops = { ...@@ -61,8 +61,6 @@ static struct pci_ops via82c505_ops = {
void __init via82c505_preinit(void *sysdata) void __init via82c505_preinit(void *sysdata)
{ {
struct pci_bus *bus;
printk(KERN_DEBUG "PCI: VIA 82c505\n"); printk(KERN_DEBUG "PCI: VIA 82c505\n");
if (!request_region(0xA8,2,"via config")) { if (!request_region(0xA8,2,"via config")) {
printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n"); printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n");
......
...@@ -305,7 +305,7 @@ static struct cpufreq_driver sa1110_driver = { ...@@ -305,7 +305,7 @@ static struct cpufreq_driver sa1110_driver = {
.verify = sa11x0_verify_speed, .verify = sa11x0_verify_speed,
.setpolicy = sa1110_setspeed, .setpolicy = sa1110_setspeed,
.policy = &sa1110_policy, .policy = &sa1110_policy,
.cpu_min_freq[0] = 59000, .cpu_min_freq = { 59000, },
}; };
static int __init sa1110_clk_init(void) static int __init sa1110_clk_init(void)
......
...@@ -21,5 +21,5 @@ extern void sa1110_mb_disable(void); ...@@ -21,5 +21,5 @@ extern void sa1110_mb_disable(void);
struct cpufreq_policy; struct cpufreq_policy;
extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz);
extern void sa11x0_verify_speed(struct cpufreq_policy *policy); extern int sa11x0_verify_speed(struct cpufreq_policy *policy);
extern unsigned int sa11x0_getspeed(void); extern unsigned int sa11x0_getspeed(void);
...@@ -31,6 +31,14 @@ ...@@ -31,6 +31,14 @@
#define DPRINTK(...) do { } while (0) #define DPRINTK(...) do { } while (0)
#endif #endif
//#define STATS
#ifdef STATS
#define DO_STATS(X) do { X ; } while (0)
#else
#define DO_STATS(X) do { } while (0)
#endif
/* ************************************************** */
struct safe_buffer { struct safe_buffer {
struct list_head node; struct list_head node;
...@@ -50,10 +58,24 @@ LIST_HEAD(safe_buffers); ...@@ -50,10 +58,24 @@ LIST_HEAD(safe_buffers);
#define SIZE_SMALL 1024 #define SIZE_SMALL 1024
#define SIZE_LARGE (16*1024) #define SIZE_LARGE (4*1024)
static struct pci_pool *small_buffer_pool, *large_buffer_pool; static struct pci_pool *small_buffer_pool, *large_buffer_pool;
#ifdef STATS
static unsigned long sbp_allocs __initdata = 0;
static unsigned long lbp_allocs __initdata = 0;
static unsigned long total_allocs __initdata= 0;
static void print_alloc_stats(void)
{
printk(KERN_INFO
"sa1111_pcibuf: sbp: %lu, lbp: %lu, other: %lu, total: %lu\n",
sbp_allocs, lbp_allocs,
total_allocs - sbp_allocs - lbp_allocs, total_allocs);
}
#endif
static int __init static int __init
create_safe_buffer_pools(void) create_safe_buffer_pools(void)
{ {
...@@ -81,6 +103,10 @@ create_safe_buffer_pools(void) ...@@ -81,6 +103,10 @@ create_safe_buffer_pools(void)
return -1; return -1;
} }
printk(KERN_INFO
"sa1111_pcibuf: buffer sizes: small=%u, large=%u\n",
SIZE_SMALL, SIZE_LARGE);
return 0; return 0;
} }
...@@ -108,6 +134,8 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -108,6 +134,8 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
DPRINTK("%s(ptr=%p, size=%d, direction=%d)\n", DPRINTK("%s(ptr=%p, size=%d, direction=%d)\n",
__func__, ptr, size, direction); __func__, ptr, size, direction);
DO_STATS ( total_allocs++ );
buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC);
if (buf == 0) { if (buf == 0) {
printk(KERN_WARNING "%s: kmalloc failed\n", __func__); printk(KERN_WARNING "%s: kmalloc failed\n", __func__);
...@@ -117,12 +145,14 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -117,12 +145,14 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
if (size <= SIZE_SMALL) { if (size <= SIZE_SMALL) {
pool = small_buffer_pool; pool = small_buffer_pool;
safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
DO_STATS ( sbp_allocs++ );
} else if (size <= SIZE_LARGE) { } else if (size <= SIZE_LARGE) {
pool = large_buffer_pool; pool = large_buffer_pool;
safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr); safe = pci_pool_alloc(pool, GFP_ATOMIC, &safe_dma_addr);
DO_STATS ( lbp_allocs++ );
} else { } else {
printk(KERN_DEBUG
"sa111_pcibuf: resorting to pci_alloc_consistent\n");
pool = 0; pool = 0;
safe = pci_alloc_consistent(SA1111_FAKE_PCIDEV, size, safe = pci_alloc_consistent(SA1111_FAKE_PCIDEV, size,
&safe_dma_addr); &safe_dma_addr);
...@@ -136,6 +166,11 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -136,6 +166,11 @@ alloc_safe_buffer(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
return 0; return 0;
} }
#ifdef STATS
if (total_allocs % 1000 == 0)
print_alloc_stats();
#endif
BUG_ON(sa1111_check_dma_bug(safe_dma_addr)); // paranoia BUG_ON(sa1111_check_dma_bug(safe_dma_addr)); // paranoia
buf->ptr = ptr; buf->ptr = ptr;
...@@ -204,37 +239,39 @@ dma_range_is_safe(dma_addr_t addr, size_t size) ...@@ -204,37 +239,39 @@ dma_range_is_safe(dma_addr_t addr, size_t size)
return ((physaddr + size - 1) < (1<<20)); return ((physaddr + size - 1) < (1<<20));
} }
/* /* ************************************************** */
* see if a buffer address is in an 'unsafe' range. if it is
* allocate a 'safe' buffer and copy the unsafe buffer into it.
* substitute the safe buffer for the unsafe one.
* (basically move the buffer from an unsafe area to a safe one)
*/
dma_addr_t
sa1111_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
{
unsigned long flags;
dma_addr_t dma_addr;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n", #ifdef STATS
__func__, hwdev, ptr, size, direction); static unsigned long map_op_count __initdata = 0;
static unsigned long bounce_count __initdata = 0;
BUG_ON(hwdev != SA1111_FAKE_PCIDEV); static void print_map_stats(void)
BUG_ON(direction == PCI_DMA_NONE); {
printk(KERN_INFO
"sa1111_pcibuf: map_op_count=%lu, bounce_count=%lu\n",
map_op_count, bounce_count);
}
#endif
local_irq_save(flags); static dma_addr_t
map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
{
dma_addr_t dma_addr;
DO_STATS ( map_op_count++ );
dma_addr = virt_to_bus(ptr); dma_addr = virt_to_bus(ptr);
if (!dma_range_is_safe(dma_addr, size)) { if (!dma_range_is_safe(dma_addr, size)) {
struct safe_buffer *buf; struct safe_buffer *buf;
DO_STATS ( bounce_count++ ) ;
buf = alloc_safe_buffer(hwdev, ptr, size, direction); buf = alloc_safe_buffer(hwdev, ptr, size, direction);
if (buf == 0) { if (buf == 0) {
printk(KERN_ERR printk(KERN_ERR
"%s: unable to map unsafe buffer %p!\n", "%s: unable to map unsafe buffer %p!\n",
__func__, ptr); __func__, ptr);
local_irq_restore(flags);
return 0; return 0;
} }
...@@ -256,33 +293,22 @@ sa1111_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) ...@@ -256,33 +293,22 @@ sa1111_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
consistent_sync(ptr, size, direction); consistent_sync(ptr, size, direction);
} }
local_irq_restore(flags); #ifdef STATS
if (map_op_count % 1000 == 0)
print_map_stats();
#endif
return dma_addr; return dma_addr;
} }
/* static void
* see if a mapped address was really a "safe" buffer and if so, copy unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
* the data from the safe buffer back to the unsafe buffer and free up size_t size, int direction)
* the safe buffer. (basically return things back to the way they
* should be)
*/
void
sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size, int direction)
{ {
unsigned long flags;
struct safe_buffer *buf; struct safe_buffer *buf;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n",
__func__, hwdev, (void *) dma_addr, size, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
buf = find_safe_buffer(dma_addr); buf = find_safe_buffer(dma_addr);
if (buf) { if (buf) {
BUG_ON(buf->size != size); BUG_ON(buf->size != size);
BUG_ON(buf->direction != direction); BUG_ON(buf->direction != direction);
...@@ -292,6 +318,9 @@ sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, ...@@ -292,6 +318,9 @@ sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
buf->ptr, (void *) virt_to_bus(buf->ptr), buf->ptr, (void *) virt_to_bus(buf->ptr),
buf->safe, (void *) buf->safe_dma_addr); buf->safe, (void *) buf->safe_dma_addr);
DO_STATS ( bounce_count++ );
if ((direction == PCI_DMA_FROMDEVICE) || if ((direction == PCI_DMA_FROMDEVICE) ||
(direction == PCI_DMA_BIDIRECTIONAL)) { (direction == PCI_DMA_BIDIRECTIONAL)) {
DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n",
...@@ -300,39 +329,16 @@ sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, ...@@ -300,39 +329,16 @@ sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
} }
free_safe_buffer(buf); free_safe_buffer(buf);
} }
local_irq_restore(flags);
} }
int static void
sa1111_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
int nents, int direction)
{
BUG(); /* Not implemented. */
}
void
sa1111_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
int direction)
{
BUG(); /* Not implemented. */
}
void
sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size, int direction) size_t size, int direction)
{ {
unsigned long flags;
struct safe_buffer *buf; struct safe_buffer *buf;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n",
__func__, hwdev, (void *) dma_addr, size, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
local_irq_save(flags);
buf = find_safe_buffer(dma_addr); buf = find_safe_buffer(dma_addr);
if (buf) { if (buf) {
BUG_ON(buf->size != size); BUG_ON(buf->size != size);
BUG_ON(buf->direction != direction); BUG_ON(buf->direction != direction);
...@@ -342,6 +348,8 @@ sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr, ...@@ -342,6 +348,8 @@ sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
buf->ptr, (void *) virt_to_bus(buf->ptr), buf->ptr, (void *) virt_to_bus(buf->ptr),
buf->safe, (void *) buf->safe_dma_addr); buf->safe, (void *) buf->safe_dma_addr);
DO_STATS ( bounce_count++ );
switch (direction) { switch (direction) {
case PCI_DMA_FROMDEVICE: case PCI_DMA_FROMDEVICE:
DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n", DPRINTK("%s: copy back from safe %p, to unsafe %p size %d\n",
...@@ -362,15 +370,159 @@ sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr, ...@@ -362,15 +370,159 @@ sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
} else { } else {
consistent_sync(bus_to_virt(dma_addr), size, direction); consistent_sync(bus_to_virt(dma_addr), size, direction);
} }
}
/* ************************************************** */
/*
* see if a buffer address is in an 'unsafe' range. if it is
* allocate a 'safe' buffer and copy the unsafe buffer into it.
* substitute the safe buffer for the unsafe one.
* (basically move the buffer from an unsafe area to a safe one)
*/
dma_addr_t
sa1111_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
{
unsigned long flags;
dma_addr_t dma_addr;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n",
__func__, hwdev, ptr, size, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
dma_addr = map_single(hwdev, ptr, size, direction);
local_irq_restore(flags);
return dma_addr;
}
/*
* see if a mapped address was really a "safe" buffer and if so, copy
* the data from the safe buffer back to the unsafe buffer and free up
* the safe buffer. (basically return things back to the way they
* should be)
*/
void
sa1111_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size, int direction)
{
unsigned long flags;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n",
__func__, hwdev, (void *) dma_addr, size, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
unmap_single(hwdev, dma_addr, size, direction);
local_irq_restore(flags);
}
int
sa1111_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nents, int direction)
{
unsigned long flags;
int i;
DPRINTK("%s(hwdev=%p,sg=%p,nents=%d,dir=%x)\n",
__func__, hwdev, sg, nents, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
for (i = 0; i < nents; i++, sg++) {
struct page *page = sg->page;
unsigned int offset = sg->offset;
unsigned int length = sg->length;
void *ptr = page_address(page) + offset;
sg->dma_address =
map_single(hwdev, ptr, length, direction);
}
local_irq_restore(flags);
return nents;
}
void
sa1111_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents,
int direction)
{
unsigned long flags;
int i;
DPRINTK("%s(hwdev=%p,sg=%p,nents=%d,dir=%x)\n",
__func__, hwdev, sg, nents, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
for (i = 0; i < nents; i++, sg++) {
dma_addr_t dma_addr = sg->dma_address;
unsigned int length = sg->length;
unmap_single(hwdev, dma_addr, length, direction);
}
local_irq_restore(flags);
}
void
sa1111_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
size_t size, int direction)
{
unsigned long flags;
DPRINTK("%s(hwdev=%p,ptr=%p,size=%d,dir=%x)\n",
__func__, hwdev, (void *) dma_addr, size, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
local_irq_save(flags);
sync_single(hwdev, dma_addr, size, direction);
local_irq_restore(flags); local_irq_restore(flags);
} }
void void
sa1111_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, sa1111_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg,
int nelems, int direction) int nents, int direction)
{ {
BUG(); /* Not implemented. */ unsigned long flags;
int i;
DPRINTK("%s(hwdev=%p,sg=%p,nents=%d,dir=%x)\n",
__func__, hwdev, sg, nents, direction);
BUG_ON(hwdev != SA1111_FAKE_PCIDEV);
BUG_ON(direction == PCI_DMA_NONE);
local_irq_save(flags);
for (i = 0; i < nents; i++, sg++) {
dma_addr_t dma_addr = sg->dma_address;
unsigned int length = sg->length;
sync_single(hwdev, dma_addr, length, direction);
}
local_irq_restore(flags);
} }
EXPORT_SYMBOL(sa1111_map_single); EXPORT_SYMBOL(sa1111_map_single);
...@@ -399,6 +551,11 @@ static void __exit sa1111_pcibuf_exit(void) ...@@ -399,6 +551,11 @@ static void __exit sa1111_pcibuf_exit(void)
{ {
BUG_ON(!list_empty(&safe_buffers)); BUG_ON(!list_empty(&safe_buffers));
#ifdef STATS
print_alloc_stats();
print_map_stats();
#endif
destroy_safe_buffer_pools(); destroy_safe_buffer_pools();
} }
module_exit(sa1111_pcibuf_exit); module_exit(sa1111_pcibuf_exit);
......
...@@ -63,6 +63,8 @@ menu "Processor type and features" ...@@ -63,6 +63,8 @@ menu "Processor type and features"
bool "NA85E2C-FPGA" bool "NA85E2C-FPGA"
config V850E2_ANNA config V850E2_ANNA
bool "Anna" bool "Anna"
config V850E_AS85EP1
bool "AS85EP1"
endchoice endchoice
......
...@@ -22,6 +22,9 @@ CFLAGS += -ffixed-r16 -mno-prolog-function ...@@ -22,6 +22,9 @@ CFLAGS += -ffixed-r16 -mno-prolog-function
CFLAGS += -fno-builtin CFLAGS += -fno-builtin
CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\" CFLAGS += -D__linux__ -DUTS_SYSNAME=\"uClinux\"
LDFLAGS_BLOB := -b binary --oformat elf32-little
OBJCOPY_FLAGS_BLOB := -I binary -O elf32-little -B v850e
HEAD := $(arch_dir)/kernel/head.o $(arch_dir)/kernel/init_task.o HEAD := $(arch_dir)/kernel/head.o $(arch_dir)/kernel/init_task.o
core-y += $(arch_dir)/kernel/ core-y += $(arch_dir)/kernel/
...@@ -40,10 +43,8 @@ core-y += root_fs_image.o ...@@ -40,10 +43,8 @@ core-y += root_fs_image.o
# This results in it being built anew each time, but that's alright. # This results in it being built anew each time, but that's alright.
root_fs_image.o: root_fs_image_force root_fs_image.o: root_fs_image_force
# Note that we use the build-system's objcopy, as the v850 tools are fairly
# old, and don't have the --rename-section option.
root_fs_image_force: $(ROOT_FS_IMAGE) root_fs_image_force: $(ROOT_FS_IMAGE)
objcopy -I binary -O elf32-little -B i386 --rename-section .data=.root,alloc,load,readonly,data,contents $< root_fs_image.o $(OBJCOPY) $(OBJCOPY_FLAGS_BLOB) --rename-section .data=.root,alloc,load,readonly,data,contents $< root_fs_image.o
endif endif
......
...@@ -80,6 +80,11 @@ SECTIONS { ...@@ -80,6 +80,11 @@ SECTIONS {
__root_fs_image_start = . ; __root_fs_image_start = . ;
*(.root) *(.root)
__root_fs_image_end = . ; __root_fs_image_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
} > ROM } > ROM
__rom_copy_src_start = . ; __rom_copy_src_start = . ;
......
...@@ -103,6 +103,12 @@ SECTIONS { ...@@ -103,6 +103,12 @@ SECTIONS {
*(.initcall7.init) *(.initcall7.init)
. = ALIGN (4) ; . = ALIGN (4) ;
___initcall_end = . ; ___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
__init_end = . ; __init_end = . ;
__kram_end = . ; __kram_end = . ;
......
/* Linker script for the NEC AS85EP1 V850E evaluation board
(CONFIG_V850E_AS85EP1). */
/* Note, all symbols are prefixed with an extra `_' for compatibility with
the existing linux sources. */
_jiffies = _jiffies_64 ;
MEMORY {
/* 1MB of internal memory ($BFbB"L?Na(BRAM). */
iMEM0 : ORIGIN = 0, LENGTH = 0x00100000
/* 1MB of static RAM. */
SRAM : ORIGIN = 0x00400000, LENGTH = 0x00100000
/* About 58MB of DRAM. This can actually be at one of two positions,
determined by jump JP3; we have to use the first position because the
second is partially out of processor instruction addressing range
(though in the second position there's actually 64MB available). */
SDRAM : ORIGIN = 0x00600000, LENGTH = 0x039F8000
}
SECTIONS {
.resetv : {
__intv_start = . ;
*(.intv.reset) /* Reset vector */
} > iMEM0
.text : {
__kram_start = . ;
__stext = . ;
*(.text)
*(.exit.text) /* 2.5 convention */
*(.text.exit) /* 2.4 convention */
*(.text.lock)
*(.exitcall.exit)
__real_etext = . ; /* There may be data after here. */
*(.rodata)
. = ALIGN (0x4) ;
*(.kstrtab)
. = ALIGN (4) ;
*(.call_table_data)
*(.call_table_text)
. = ALIGN (16) ; /* Exception table. */
___start___ex_table = . ;
*(__ex_table)
___stop___ex_table = . ;
___start___ksymtab = . ;/* Kernel symbol table. */
*(__ksymtab)
___stop___ksymtab = . ;
. = ALIGN (4) ;
__etext = . ;
} > SRAM
.data ALIGN (0x4) : {
__sdata = . ;
___data_start = . ;
*(.data)
*(.exit.data) /* 2.5 convention */
*(.data.exit) /* 2.4 convention */
. = ALIGN (16) ;
*(.data.cacheline_aligned)
. = ALIGN (0x2000) ;
*(.data.init_task)
. = ALIGN (0x2000) ;
__edata = . ;
} > SRAM
.bss ALIGN (0x4) : {
__sbss = . ;
*(.bss)
*(COMMON)
. = ALIGN (4) ;
__init_stack_end = . ;
__ebss = . ;
} > SRAM
.init ALIGN (4096) : {
__init_start = . ;
*(.init.text) /* 2.5 convention */
*(.init.data)
*(.text.init) /* 2.4 convention */
*(.data.init)
. = ALIGN (16) ;
___setup_start = . ;
*(.init.setup) /* 2.5 convention */
*(.setup.init) /* 2.4 convention */
___setup_end = . ;
___initcall_start = . ;
*(.initcall.init)
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
. = ALIGN (4) ;
___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
/* We stick most of the interrupt vectors here; they'll be
copied into the proper location by the early init code (we
can't put them directly in the right place because of
hardware bugs). The vectors shouldn't need to be
relocated, so we don't have to use `> ... AT> ...' to
split the load/vm addresses (and we can't because of
problems with the loader). */
. = ALIGN (0x10) ;
__intv_copy_src_start = . ;
*(.intv.common) /* Vectors common to all v850e proc. */
*(.intv.mach) /* Machine-specific int. vectors. */
. = ALIGN (0x10) ;
__intv_copy_src_end = . ;
/* This is here so that when we free init memory, the initial
load-area of the interrupt vectors is freed too. */
__init_end = . ;
__kram_end = . ;
__bootmap = . ;
. = . + 4096 ; /* enough for 128MB. */
} > SRAM
/* Where we end up putting the vectors. */
__intv_copy_dst_start = 0x10 ;
__intv_copy_dst_end = __intv_copy_dst_start + (__intv_copy_src_end - __intv_copy_src_start) ;
__intv_end = __intv_copy_dst_end ;
/* Device contents for the root filesystem. */
.root : {
. = ALIGN (4096) ;
__root_fs_image_start = . ;
*(.root)
__root_fs_image_end = . ;
} > SDRAM
}
...@@ -15,11 +15,12 @@ obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ ...@@ -15,11 +15,12 @@ obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \
signal.o irq.o mach.o ptrace.o bug.o signal.o irq.o mach.o ptrace.o bug.o
export-objs += v850_ksyms.o rte_mb_a_pci.o export-objs += v850_ksyms.o rte_mb_a_pci.o
obj-$(CONFIG_MODULES) += v850_ksyms.o obj-$(CONFIG_MODULES) += module.o v850_ksyms.o
# chip-specific code # chip-specific code
obj-$(CONFIG_V850E_MA1) += ma.o nb85e_utils.o nb85e_timer_d.o obj-$(CONFIG_V850E_MA1) += ma.o nb85e_utils.o nb85e_timer_d.o
obj-$(CONFIG_V850E_NB85E) += nb85e_intc.o obj-$(CONFIG_V850E_NB85E) += nb85e_intc.o
obj-$(CONFIG_V850E2_ANNA) += anna.o nb85e_intc.o nb85e_utils.o nb85e_timer_d.o obj-$(CONFIG_V850E2_ANNA) += anna.o nb85e_intc.o nb85e_utils.o nb85e_timer_d.o
obj-$(CONFIG_V850E_AS85EP1) += as85ep1.o nb85e_intc.o nb85e_utils.o nb85e_timer_d.o
# platform-specific code # platform-specific code
obj-$(CONFIG_V850E_SIM) += sim.o simcons.o obj-$(CONFIG_V850E_SIM) += sim.o simcons.o
obj-$(CONFIG_V850E2_SIM85E2C) += sim85e2c.o nb85e_intc.o memcons.o obj-$(CONFIG_V850E2_SIM85E2C) += sim85e2c.o nb85e_intc.o memcons.o
......
...@@ -27,11 +27,14 @@ ...@@ -27,11 +27,14 @@
#include "mach.h" #include "mach.h"
/* SRAM and SDRAM are vaguely contiguous (with a hole in between; see /* SRAM and SDRAM are vaguely contiguous (with a big hole in between; see
mach_reserve_bootmem for details), so just use both as one big area. */ mach_reserve_bootmem for details); use both as one big area. */
#define RAM_START SRAM_ADDR #define RAM_START SRAM_ADDR
#define RAM_END (SDRAM_ADDR + SDRAM_SIZE) #define RAM_END (SDRAM_ADDR + SDRAM_SIZE)
/* The bits of this port are connected to an 8-LED bar-graph. */
#define LEDS_PORT 0
static void anna_led_tick (void); static void anna_led_tick (void);
...@@ -44,7 +47,7 @@ void __init mach_early_init (void) ...@@ -44,7 +47,7 @@ void __init mach_early_init (void)
ANNA_BPC = 0; ANNA_BPC = 0;
ANNA_BSC = 0xAAAA; ANNA_BSC = 0xAAAA;
ANNA_BEC = 0; ANNA_BEC = 0;
ANNA_BHC = 0x00FF; /* icache all memory, dcache none */ ANNA_BHC = 0xFFFF; /* icache all memory, dcache all */
ANNA_BCT(0) = 0xB088; ANNA_BCT(0) = 0xB088;
ANNA_BCT(1) = 0x0008; ANNA_BCT(1) = 0x0008;
ANNA_DWC(0) = 0x0027; ANNA_DWC(0) = 0x0027;
...@@ -60,17 +63,11 @@ void __init mach_early_init (void) ...@@ -60,17 +63,11 @@ void __init mach_early_init (void)
void __init mach_setup (char **cmdline) void __init mach_setup (char **cmdline)
{ {
printk (KERN_INFO
"CPU: %s\n"
"Platform: %s\n",
CPU_MODEL_LONG,
PLATFORM_LONG);
#ifdef CONFIG_V850E_NB85E_UART_CONSOLE #ifdef CONFIG_V850E_NB85E_UART_CONSOLE
nb85e_uart_cons_init (1); nb85e_uart_cons_init (1);
#endif #endif
ANNA_PORT_PM (0) = 0; /* Make all LED pins output pins. */ ANNA_PORT_PM (LEDS_PORT) = 0; /* Make all LED pins output pins. */
mach_tick = anna_led_tick; mach_tick = anna_led_tick;
} }
...@@ -138,7 +135,7 @@ void machine_halt (void) ...@@ -138,7 +135,7 @@ void machine_halt (void)
disable_reset_guard (); disable_reset_guard ();
#endif #endif
local_irq_disable (); /* Ignore all interrupts. */ local_irq_disable (); /* Ignore all interrupts. */
ANNA_PORT_IO(0) = 0xAA; /* Note that we halted. */ ANNA_PORT_IO(LEDS_PORT) = 0xAA; /* Note that we halted. */
for (;;) for (;;)
asm ("halt; nop; nop; nop; nop; nop"); asm ("halt; nop; nop; nop; nop; nop");
} }
...@@ -191,9 +188,9 @@ static void anna_led_tick () ...@@ -191,9 +188,9 @@ static void anna_led_tick ()
if (pos + dir <= max_pos) { if (pos + dir <= max_pos) {
/* Each bit of port 0 has a LED. */ /* Each bit of port 0 has a LED. */
clear_bit (pos, &ANNA_PORT_IO(0)); clear_bit (pos, &ANNA_PORT_IO(LEDS_PORT));
pos += dir; pos += dir;
set_bit (pos, &ANNA_PORT_IO(0)); set_bit (pos, &ANNA_PORT_IO(LEDS_PORT));
} }
} }
......
/*
* arch/v850/kernel/as85ep1.c -- AS85EP1 V850E evaluation chip/board
*
* Copyright (C) 2002 NEC Corporation
* Copyright (C) 2002 Miles Bader <miles@gnu.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*
* Written by Miles Bader <miles@gnu.org>
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/major.h>
#include <linux/irq.h>
#include <asm/machdep.h>
#include <asm/atomic.h>
#include <asm/page.h>
#include <asm/nb85e_timer_d.h>
#include <asm/nb85e_uart.h>
#include "mach.h"
/* SRAM and SDRAM are vaguely contiguous (with a big hole in between; see
mach_reserve_bootmem for details); use both as one big area. */
#define RAM_START SRAM_ADDR
#define RAM_END (SDRAM_ADDR + SDRAM_SIZE)
/* The bits of this port are connected to an 8-LED bar-graph. */
#define LEDS_PORT 4
static void as85ep1_led_tick (void);
extern char _intv_copy_src_start, _intv_copy_src_end;
extern char _intv_copy_dst_start;
void __init mach_early_init (void)
{
const u32 *src;
register u32 *dst asm ("ep");
AS85EP1_CSC(0) = 0x0403;
AS85EP1_BCT(0) = 0xB8B8;
AS85EP1_DWC(0) = 0x0104;
AS85EP1_BCC = 0x0012;
AS85EP1_ASC = 0;
AS85EP1_LBS = 0x00A9;
AS85EP1_RFS(1) = 0x8205;
AS85EP1_RFS(3) = 0x8205;
AS85EP1_SCR(1) = 0x20A9;
AS85EP1_SCR(3) = 0x20A9;
AS85EP1_PORT_PMC(6) = 0xFF; /* A20-25, A0,A1 $BM-8z(B */
AS85EP1_PORT_PMC(7) = 0x0E; /* CS1,2,3 $BM-8z(B */
AS85EP1_PORT_PMC(9) = 0xFF; /* D16-23 $BM-8z(B */
AS85EP1_PORT_PMC(10) = 0xFF; /* D24-31 $BM-8z(B */
AS85EP1_IRAMM = 0x3; /* $BFbB"L?Na(BRAM$B$O!V(Bwrite-mode$B!W$K$J$j$^$9(B */
/* The early chip we have is buggy, so that writing the interrupt
vectors into low RAM may screw up, so for non-ROM kernels, we
only rely on the reset vector being downloaded, and copy the
rest of the interrupt vectors into place here. The specific bug
is that writing address N, where (N & 0x10) == 0x10, will _also_
write to address (N - 0x10). We avoid this (effectively) by
writing in 16-byte chunks backwards from the end. */
src = (u32 *)(((u32)&_intv_copy_src_end - 1) & ~0xF);
dst = (u32 *)&_intv_copy_dst_start
+ (src - (u32 *)&_intv_copy_src_start);
do {
u32 t0 = src[0], t1 = src[1], t2 = src[2], t3 = src[3];
dst[0] = t0; dst[1] = t1; dst[2] = t2; dst[3] = t3;
dst -= 4;
src -= 4;
} while (src > (u32 *)&_intv_copy_src_start);
AS85EP1_IRAMM = 0x0; /* $BFbB"L?Na(BRAM$B$O!V(Bread-mode$B!W$K$J$j$^$9(B */
nb85e_intc_disable_irqs ();
}
void __init mach_setup (char **cmdline)
{
#ifdef CONFIG_V850E_NB85E_UART_CONSOLE
nb85e_uart_cons_init (1);
#endif
AS85EP1_PORT_PMC (LEDS_PORT) = 0; /* Make the LEDs port an I/O port. */
AS85EP1_PORT_PM (LEDS_PORT) = 0; /* Make all the bits output pins. */
mach_tick = as85ep1_led_tick;
ROOT_DEV = MKDEV (BLKMEM_MAJOR, 0);
}
void __init mach_get_physical_ram (unsigned long *ram_start,
unsigned long *ram_len)
{
*ram_start = RAM_START;
*ram_len = RAM_END - RAM_START;
}
void __init mach_reserve_bootmem ()
{
extern char _root_fs_image_start, _root_fs_image_end;
u32 root_fs_image_start = (u32)&_root_fs_image_start;
u32 root_fs_image_end = (u32)&_root_fs_image_end;
/* We can't use the space between SRAM and SDRAM, so prevent the
kernel from trying. */
reserve_bootmem (SRAM_ADDR + SRAM_SIZE,
SDRAM_ADDR - (SRAM_ADDR + SRAM_SIZE));
/* Reserve the memory used by the root filesystem image if it's
in RAM. */
if (root_fs_image_end > root_fs_image_start
&& root_fs_image_start >= RAM_START
&& root_fs_image_start < RAM_END)
reserve_bootmem (root_fs_image_start,
root_fs_image_end - root_fs_image_start);
}
void mach_gettimeofday (struct timeval *tv)
{
tv->tv_sec = 0;
tv->tv_usec = 0;
}
void __init mach_sched_init (struct irqaction *timer_action)
{
/* Start hardware timer. */
nb85e_timer_d_configure (0, HZ);
/* Install timer interrupt handler. */
setup_irq (IRQ_INTCMD(0), timer_action);
}
static struct nb85e_intc_irq_init irq_inits[] = {
{ "IRQ", 0, NUM_MACH_IRQS, 1, 7 },
{ "CCC", IRQ_INTCCC(0), IRQ_INTCCC_NUM, 1, 5 },
{ "CMD", IRQ_INTCMD(0), IRQ_INTCMD_NUM, 1, 5 },
{ "SRE", IRQ_INTSRE(0), IRQ_INTSRE_NUM, 3, 3 },
{ "SR", IRQ_INTSR(0), IRQ_INTSR_NUM, 3, 4 },
{ "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];
void __init mach_init_irqs (void)
{
nb85e_intc_init_irq_types (irq_inits, hw_itypes);
}
void machine_restart (char *__unused)
{
#ifdef CONFIG_RESET_GUARD
disable_reset_guard ();
#endif
asm ("jmp r0"); /* Jump to the reset vector. */
}
void machine_halt (void)
{
#ifdef CONFIG_RESET_GUARD
disable_reset_guard ();
#endif
local_irq_disable (); /* Ignore all interrupts. */
AS85EP1_PORT_IO (LEDS_PORT) = 0xAA; /* Note that we halted. */
for (;;)
asm ("halt; nop; nop; nop; nop; nop");
}
void machine_power_off (void)
{
machine_halt ();
}
/* Called before configuring an on-chip UART. */
void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
{
/* Make the shared uart/port pins be uart pins. */
AS85EP1_PORT_PMC(3) |= (0x5 << chan);
/* The AS85EP1 connects some general-purpose I/O pins on the CPU to
the RTS/CTS lines of UART 1's serial connection. I/O pins P53
and P54 are RTS and CTS respectively. */
if (chan == 1) {
/* Put P53 & P54 in I/O port mode. */
AS85EP1_PORT_PMC(5) &= ~0x18;
/* Make P53 an output, and P54 an input. */
AS85EP1_PORT_PM(5) |= 0x10;
}
}
/* Minimum and maximum bounds for the moving upper LED boundary in the
clock tick display. */
#define MIN_MAX_POS 0
#define MAX_MAX_POS 7
/* There are MAX_MAX_POS^2 - MIN_MAX_POS^2 cycles in the animation, so if
we pick 6 and 0 as above, we get 49 cycles, which is when divided into
the standard 100 value for HZ, gives us an almost 1s total time. */
#define TICKS_PER_FRAME \
(HZ / (MAX_MAX_POS * MAX_MAX_POS - MIN_MAX_POS * MIN_MAX_POS))
static void as85ep1_led_tick ()
{
static unsigned counter = 0;
if (++counter == TICKS_PER_FRAME) {
static int pos = 0, max_pos = MAX_MAX_POS, dir = 1;
if (dir > 0 && pos == max_pos) {
dir = -1;
if (max_pos == MIN_MAX_POS)
max_pos = MAX_MAX_POS;
else
max_pos--;
} else {
if (dir < 0 && pos == 0)
dir = 1;
if (pos + dir <= max_pos) {
/* Each bit of port 0 has a LED. */
set_bit (pos, &AS85EP1_PORT_IO(LEDS_PORT));
pos += dir;
clear_bit (pos, &AS85EP1_PORT_IO(LEDS_PORT));
}
}
counter = 0;
}
}
...@@ -60,3 +60,76 @@ void unexpected_reset (unsigned long ret_addr, unsigned long kmode, ...@@ -60,3 +60,76 @@ void unexpected_reset (unsigned long ret_addr, unsigned long kmode,
machine_halt (); machine_halt ();
} }
#endif /* CONFIG_RESET_GUARD */ #endif /* CONFIG_RESET_GUARD */
struct spec_reg_name {
const char *name;
int gpr;
};
struct spec_reg_name spec_reg_names[] = {
{ "sp", GPR_SP },
{ "gp", GPR_GP },
{ "tp", GPR_TP },
{ "ep", GPR_EP },
{ "lp", GPR_LP },
{ 0, 0 }
};
void show_regs (struct pt_regs *regs)
{
int gpr_base, gpr_offs;
printk (" pc 0x%08lx psw 0x%08lx kernel_mode %d\n",
regs->pc, regs->psw, regs->kernel_mode);
printk (" ctpc 0x%08lx ctpsw 0x%08lx ctbp 0x%08lx\n",
regs->ctpc, regs->ctpsw, regs->ctbp);
for (gpr_base = 0; gpr_base < NUM_GPRS; gpr_base += 4) {
for (gpr_offs = 0; gpr_offs < 4; gpr_offs++) {
int gpr = gpr_base + gpr_offs;
long val = regs->gpr[gpr];
struct spec_reg_name *srn;
for (srn = spec_reg_names; srn->name; srn++)
if (srn->gpr == gpr)
break;
if (srn->name)
printk ("%7s 0x%08lx", srn->name, val);
else
printk (" r%02d 0x%08lx", gpr, val);
}
printk ("\n");
}
}
void show_stack (unsigned long *sp)
{
unsigned long end;
unsigned long addr = (unsigned long)sp;
if (! addr)
addr = stack_addr ();
addr = addr & ~3;
end = (addr + THREAD_SIZE - 1) & THREAD_MASK;
while (addr < end) {
printk ("%8lX: ", addr);
while (addr < end) {
printk (" %8lX", *(unsigned long *)addr);
addr += sizeof (unsigned long);
if (! (addr & 0xF))
break;
}
printk ("\n");
}
}
void dump_stack ()
{
show_stack (0);
}
...@@ -657,6 +657,12 @@ G_ENTRY(irq): ...@@ -657,6 +657,12 @@ G_ENTRY(irq):
shl 16, r6 // clear upper 16 bits shl 16, r6 // clear upper 16 bits
shr 20, r6 // shift back, and remove lower nibble shr 20, r6 // shift back, and remove lower nibble
add -8, r6 // remove bias for irqs add -8, r6 // remove bias for irqs
// If the IRQ index is negative, it's actually one of the exception
// traps below 0x80 (currently, the illegal instruction trap, and
// the `debug trap'). Handle these separately.
bn exception
// Call the high-level interrupt handling code. // Call the high-level interrupt handling code.
jarl CSYM(handle_irq), lp jarl CSYM(handle_irq), lp
// fall through // fall through
...@@ -665,6 +671,23 @@ G_ENTRY(irq): ...@@ -665,6 +671,23 @@ G_ENTRY(irq):
handlers, below). */ handlers, below). */
ret_from_irq: ret_from_irq:
RETURN(IRQ) RETURN(IRQ)
exception:
mov hilo(ret_from_irq), lp // where the handler should return
cmp -2, r6
bne 1f
// illegal instruction exception
addi SIGILL, r0, r6 // Arg 0: signal number
mov CURRENT_TASK, r7 // Arg 1: task
jr CSYM(force_sig) // tail call
1: cmp -1, r6
bne bad_trap_wrapper
// `dbtrap' exception
movea PTO, sp, r6 // Arg 0: user regs
jr CSYM(debug_trap) // tail call
END(irq) END(irq)
...@@ -692,44 +715,7 @@ G_ENTRY(nmi): ...@@ -692,44 +715,7 @@ G_ENTRY(nmi):
jarl CSYM(handle_irq), lp jarl CSYM(handle_irq), lp
RETURN(NMI) RETURN(NMI)
END(nmi0) END(nmi)
/*
* Illegal instruction trap.
*
* The stack-pointer (r3) should have already been saved to the memory
* location ENTRY_SP (the reason for this is that the interrupt vectors may be
* beyond a 22-bit signed offset jump from the actual interrupt handler, and
* this allows them to save the stack-pointer and use that register to do an
* indirect jump).
*/
G_ENTRY(illegal_instruction):
SAVE_STATE (IRQ, r0, ENTRY_SP) // Save registers.
ei
addi SIGILL, r0, r6 // Arg 0: signal number
mov CURRENT_TASK, r7 // Arg 1: task
mov hilo(ret_from_irq), lp // where the handler should return
jr CSYM(force_sig)
END(illegal_instruction)
/*
* `Debug' trap
*
* The stack-pointer (r3) should have already been saved to the memory
* location ENTRY_SP (the reason for this is that the interrupt vectors may be
* beyond a 22-bit signed offset jump from the actual interrupt handler, and
* this allows them to save the stack-pointer and use that register to do an
* indirect jump).
*/
G_ENTRY(dbtrap):
SAVE_STATE (IRQ, r0, ENTRY_SP) // Save registers.
ei
movea PTO, sp, r6 // Arg 0: user regs
mov hilo(ret_from_irq), lp // where the handler should return
jr CSYM(debug_trap)
END(dbtrap)
/* /*
...@@ -771,8 +757,7 @@ C_END(switch_thread) ...@@ -771,8 +757,7 @@ C_END(switch_thread)
.data .data
.align 4 .align 4
.globl CSYM(trap_table) C_DATA(trap_table):
CSYM(trap_table):
.long bad_trap_wrapper // trap 0, doesn't use trap table. .long bad_trap_wrapper // trap 0, doesn't use trap table.
.long syscall_long // trap 1, `long' syscall. .long syscall_long // trap 1, `long' syscall.
.long bad_trap_wrapper .long bad_trap_wrapper
...@@ -789,13 +774,13 @@ CSYM(trap_table): ...@@ -789,13 +774,13 @@ CSYM(trap_table):
.long bad_trap_wrapper .long bad_trap_wrapper
.long bad_trap_wrapper .long bad_trap_wrapper
.long bad_trap_wrapper .long bad_trap_wrapper
C_END(trap_table)
.section .rodata .section .rodata
.align 4 .align 4
.globl CSYM(sys_call_table) C_DATA(sys_call_table):
CSYM(sys_call_table):
.long CSYM(sys_ni_syscall) // 0 - old "setup()" system call .long CSYM(sys_ni_syscall) // 0 - old "setup()" system call
.long CSYM(sys_exit) .long CSYM(sys_exit)
.long sys_fork_wrapper .long sys_fork_wrapper
...@@ -923,10 +908,10 @@ CSYM(sys_call_table): ...@@ -923,10 +908,10 @@ CSYM(sys_call_table):
.long CSYM(sys_adjtimex) .long CSYM(sys_adjtimex)
.long CSYM(sys_ni_syscall) // 125 - sys_mprotect .long CSYM(sys_ni_syscall) // 125 - sys_mprotect
.long CSYM(sys_sigprocmask) .long CSYM(sys_sigprocmask)
.long CSYM(sys_create_module) .long CSYM(sys_ni_syscall) // sys_create_module
.long CSYM(sys_init_module) .long CSYM(sys_init_module)
.long CSYM(sys_delete_module) .long CSYM(sys_delete_module)
.long CSYM(sys_get_kernel_syms) // 130 .long CSYM(sys_ni_syscall) // 130 - sys_get_kernel_syms
.long CSYM(sys_quotactl) .long CSYM(sys_quotactl)
.long CSYM(sys_getpgid) .long CSYM(sys_getpgid)
.long CSYM(sys_fchdir) .long CSYM(sys_fchdir)
...@@ -963,7 +948,7 @@ CSYM(sys_call_table): ...@@ -963,7 +948,7 @@ CSYM(sys_call_table):
.long CSYM(sys_setresuid) .long CSYM(sys_setresuid)
.long CSYM(sys_getresuid) // 165 .long CSYM(sys_getresuid) // 165
.long CSYM(sys_ni_syscall) // for vm86 .long CSYM(sys_ni_syscall) // for vm86
.long CSYM(sys_query_module) .long CSYM(sys_ni_syscall) // sys_query_module
.long CSYM(sys_poll) .long CSYM(sys_poll)
.long CSYM(sys_nfsservctl) .long CSYM(sys_nfsservctl)
.long CSYM(sys_setresgid) // 170 .long CSYM(sys_setresgid) // 170
...@@ -1003,3 +988,4 @@ CSYM(sys_call_table): ...@@ -1003,3 +988,4 @@ CSYM(sys_call_table):
.long CSYM(sys_ni_syscall) // sys_madvise .long CSYM(sys_ni_syscall) // sys_madvise
.space (NR_syscalls-205)*4 .space (NR_syscalls-205)*4
C_END(sys_call_table)
...@@ -73,8 +73,6 @@ void __init mach_early_init (void) ...@@ -73,8 +73,6 @@ void __init mach_early_init (void)
void __init mach_setup (char **cmdline) void __init mach_setup (char **cmdline)
{ {
printk (KERN_INFO "CPU: NEC V850E2 (NA85E2C FPGA implementation)\n");
memcons_setup (); memcons_setup ();
/* Setup up NMI0 to copy the registers to a known memory location. /* Setup up NMI0 to copy the registers to a known memory location.
......
...@@ -14,11 +14,10 @@ ...@@ -14,11 +14,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/sched.h> /* For some unfathomable reason, #include <linux/interrupt.h>
request_irq/free_irq are declared here. */ #include <linux/signal.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/irq.h>
/* The number of shared GINT interrupts. */ /* The number of shared GINT interrupts. */
...@@ -72,7 +71,7 @@ int gbus_int_irq_enabled (unsigned irq) ...@@ -72,7 +71,7 @@ int gbus_int_irq_enabled (unsigned irq)
} }
/* Disable all GBUS irqs. */ /* Disable all GBUS irqs. */
int gbus_int_disable_irqs () void gbus_int_disable_irqs ()
{ {
unsigned w, n; unsigned w, n;
for (w = 0; w < GBUS_INT_NUM_WORDS; w++) for (w = 0; w < GBUS_INT_NUM_WORDS; w++)
...@@ -183,7 +182,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits, ...@@ -183,7 +182,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits,
{ {
struct gbus_int_irq_init *init; struct gbus_int_irq_init *init;
for (init = inits; init->name; init++) { for (init = inits; init->name; init++) {
int i; unsigned i;
struct hw_interrupt_type *hwit = hw_irq_types++; struct hw_interrupt_type *hwit = hw_irq_types++;
hwit->typename = init->name; hwit->typename = init->name;
...@@ -200,7 +199,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits, ...@@ -200,7 +199,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits,
/* Set the interrupt priorities. */ /* Set the interrupt priorities. */
for (i = 0; i < init->num; i++) { for (i = 0; i < init->num; i++) {
int j; unsigned j;
for (j = 0; j < NUM_USED_GINTS; j++) for (j = 0; j < NUM_USED_GINTS; j++)
if (used_gint[j].priority > init->priority) if (used_gint[j].priority > init->priority)
break; break;
...@@ -222,7 +221,7 @@ static struct hw_interrupt_type gint_hw_itypes[NUM_USED_GINTS]; ...@@ -222,7 +221,7 @@ static struct hw_interrupt_type gint_hw_itypes[NUM_USED_GINTS];
/* GBUS interrupts themselves. */ /* GBUS interrupts themselves. */
__init struct gbus_int_irq_init gbus_irq_inits[] = { struct gbus_int_irq_init gbus_irq_inits[] __initdata = {
/* First set defaults. */ /* First set defaults. */
{ "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6}, { "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6},
{ 0 } { 0 }
...@@ -236,7 +235,7 @@ static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; ...@@ -236,7 +235,7 @@ static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS];
/* Initialize GBUS interrupts. */ /* Initialize GBUS interrupts. */
void __init gbus_int_init_irqs (void) void __init gbus_int_init_irqs (void)
{ {
int i; unsigned i;
/* First initialize the shared gint interrupts. */ /* First initialize the shared gint interrupts. */
for (i = 0; i < NUM_USED_GINTS; i++) { for (i = 0; i < NUM_USED_GINTS; i++) {
......
...@@ -118,4 +118,4 @@ C_ENTRY(start): ...@@ -118,4 +118,4 @@ C_ENTRY(start):
// Start Linux kernel. // Start Linux kernel.
mov hilo(CSYM(machine_halt)), lp mov hilo(CSYM(machine_halt)), lp
jr CSYM(start_kernel) jr CSYM(start_kernel)
END(start) C_END(start)
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
JUMP_TO_HANDLER (trap, ENTRY_SP) // TRAP1n JUMP_TO_HANDLER (trap, ENTRY_SP) // TRAP1n
.balign 0x10 .balign 0x10
JUMP_TO_HANDLER (illegal_instruction, ENTRY_SP) // illegal insn trap JUMP_TO_HANDLER (irq, ENTRY_SP) // illegal insn trap
.balign 0x10 .balign 0x10
JUMP_TO_HANDLER (dbtrap, ENTRY_SP) // DBTRAP insn JUMP_TO_HANDLER (irq, ENTRY_SP) // DBTRAP insn
/* Hardware interrupt vectors. */ /* Hardware interrupt vectors. */
......
...@@ -252,7 +252,7 @@ unsigned int handle_irq (int irq, struct pt_regs *regs) ...@@ -252,7 +252,7 @@ unsigned int handle_irq (int irq, struct pt_regs *regs)
unsigned int status; unsigned int status;
irq_enter(); irq_enter();
kstat.irqs[cpu][irq]++; kstat_cpu(cpu).irqs[irq]++;
spin_lock(&desc->lock); spin_lock(&desc->lock);
desc->handler->ack(irq); desc->handler->ack(irq);
/* /*
......
/*
* arch/v850/kernel/module.c -- Architecture-specific module functions
*
* Copyright (C) 2002 NEC Corporation
* Copyright (C) 2002 Miles Bader <miles@gnu.org>
* Copyright (C) 2001 Rusty Russell
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*
* Written by Miles Bader <miles@gnu.org>
*
* Derived in part from arch/ppc/kernel/module.c
*/
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#include <linux/moduleloader.h>
#include <linux/elf.h>
#if 0
#define DEBUGP printk
#else
#define DEBUGP(fmt , ...)
#endif
void *module_alloc (unsigned long size)
{
return size == 0 ? 0 : vmalloc (size);
}
void module_free (struct module *mod, void *module_region)
{
vfree (module_region);
/* FIXME: If module_region == mod->init_region, trim exception
table entries. */
}
int module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
struct module *mod)
{
return 0;
}
/* Count how many different relocations (different symbol, different
addend) */
static unsigned int count_relocs(const Elf32_Rela *rela, unsigned int num)
{
unsigned int i, j, ret = 0;
/* Sure, this is order(n^2), but it's usually short, and not
time critical */
for (i = 0; i < num; i++) {
for (j = 0; j < i; j++) {
/* If this addend appeared before, it's
already been counted */
if (ELF32_R_SYM(rela[i].r_info)
== ELF32_R_SYM(rela[j].r_info)
&& rela[i].r_addend == rela[j].r_addend)
break;
}
if (j == i) ret++;
}
return ret;
}
/* Get the potential trampolines size required of the init and
non-init sections */
static unsigned long get_plt_size(const Elf32_Ehdr *hdr,
const Elf32_Shdr *sechdrs,
const char *secstrings,
int is_init)
{
unsigned long ret = 0;
unsigned i;
/* Everything marked ALLOC (this includes the exported
symbols) */
for (i = 1; i < hdr->e_shnum; i++) {
/* If it's called *.init*, and we're not init, we're
not interested */
if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != 0)
!= is_init)
continue;
if (sechdrs[i].sh_type == SHT_RELA) {
DEBUGP("Found relocations in section %u\n", i);
DEBUGP("Ptr: %p. Number: %u\n",
(void *)hdr + sechdrs[i].sh_offset,
sechdrs[i].sh_size / sizeof(Elf32_Rela));
ret += count_relocs((void *)hdr
+ sechdrs[i].sh_offset,
sechdrs[i].sh_size
/ sizeof(Elf32_Rela))
* sizeof(struct v850_plt_entry);
}
}
return ret;
}
long module_core_size (const Elf32_Ehdr *hdr, const Elf32_Shdr *sechdrs,
const char *secstrings, struct module *mod)
{
mod->arch.core_plt_offset = (mod->core_size + 3) & ~3;
return mod->core_size + get_plt_size (hdr, sechdrs, secstrings, 1);
}
long module_init_size (const Elf32_Ehdr *hdr, const Elf32_Shdr *sechdrs,
const char *secstrings, struct module *mod)
{
mod->arch.init_plt_offset = (mod->init_size + 3) & ~3;
return mod->init_size + get_plt_size (hdr, sechdrs, secstrings, 1);
}
int apply_relocate (Elf32_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relsec,
struct module *mod)
{
printk ("Barf\n");
return -ENOEXEC;
}
/* Set up a trampoline in the PLT to bounce us to the distant function */
static uint32_t do_plt_call(void *location, Elf32_Addr val, struct module *mod)
{
struct v850_plt_entry *entry;
/* Instructions used to do the indirect jump. */
uint32_t tramp[2];
/* We have to trash a register, so we assume that any control
transfer more than 21-bits away must be a function call
(so we can use a call-clobbered register). */
tramp[0] = 0x0621 + ((val & 0xffff) << 16); /* mov sym, r1 ... */
tramp[1] = ((val >> 16) & 0xffff) + 0x610000; /* ...; jmp r1 */
/* Init, or core PLT? */
if (location >= mod->module_core
&& location < mod->module_core + mod->arch.core_plt_offset)
entry = mod->module_core + mod->arch.core_plt_offset;
else
entry = mod->module_init + mod->arch.init_plt_offset;
/* Find this entry, or if that fails, the next avail. entry */
while (entry->tramp[0])
if (entry->tramp[0] == tramp[0] && entry->tramp[1] == tramp[1])
return (uint32_t)entry;
else
entry++;
entry->tramp[0] = tramp[0];
entry->tramp[1] = tramp[1];
return (uint32_t)entry;
}
int apply_relocate_add (Elf32_Shdr *sechdrs, const char *strtab,
unsigned int symindex, unsigned int relsec,
struct module *mod)
{
unsigned int i;
Elf32_Rela *rela = (void *)sechdrs[relsec].sh_offset;
DEBUGP ("Applying relocate section %u to %u\n", relsec,
sechdrs[relsec].sh_info);
for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) {
/* This is where to make the change */
uint32_t *loc
= ((void *)sechdrs[sechdrs[relsec].sh_info].sh_offset
+ rela[i].r_offset);
/* This is the symbol it is referring to */
Elf32_Sym *sym
= ((Elf32_Sym *)sechdrs[symindex].sh_offset
+ ELF32_R_SYM (rela[i].r_info));
uint32_t val = sym->st_value;
if (! val) {
printk (KERN_WARNING "%s: Unknown symbol %s\n",
mod->name, strtab + sym->st_name);
return -ENOENT;
}
val += rela[i].r_addend;
switch (ELF32_R_TYPE (rela[i].r_info)) {
case R_V850_32:
/* We write two shorts instead of a long because even
32-bit insns only need half-word alignment, but
32-bit data writes need to be long-word aligned. */
val += ((uint16_t *)loc)[0];
val += ((uint16_t *)loc)[1] << 16;
((uint16_t *)loc)[0] = val & 0xffff;
((uint16_t *)loc)[1] = (val >> 16) & 0xffff;
break;
case R_V850_22_PCREL:
/* Maybe jump indirectly via a PLT table entry. */
if ((int32_t)(val - (uint32_t)loc) > 0x1fffff
|| (int32_t)(val - (uint32_t)loc) < -0x200000)
val = do_plt_call (loc, val, mod);
val -= (uint32_t)loc;
/* We write two shorts instead of a long because
even 32-bit insns only need half-word alignment,
but 32-bit data writes need to be long-word
aligned. */
((uint16_t *)loc)[0] =
(*(uint16_t *)loc & 0xffc0) /* opcode + reg */
| ((val >> 16) & 0xffc03f); /* offs high */
((uint16_t *)loc)[1] =
(val & 0xffff); /* offs low */
break;
default:
printk (KERN_ERR "module %s: Unknown reloc: %u\n",
mod->name, ELF32_R_TYPE (rela[i].r_info));
return -ENOEXEC;
}
}
return 0;
}
...@@ -33,7 +33,7 @@ void __init nb85e_intc_init_irq_types (struct nb85e_intc_irq_init *inits, ...@@ -33,7 +33,7 @@ void __init nb85e_intc_init_irq_types (struct nb85e_intc_irq_init *inits,
{ {
struct nb85e_intc_irq_init *init; struct nb85e_intc_irq_init *init;
for (init = inits; init->name; init++) { for (init = inits; init->name; init++) {
int i; unsigned i;
struct hw_interrupt_type *hwit = hw_irq_types++; struct hw_interrupt_type *hwit = hw_irq_types++;
hwit->typename = init->name; hwit->typename = init->name;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* include/asm-v850/nb85e_utils.h -- Utility functions associated with * include/asm-v850/nb85e_utils.h -- Utility functions associated with
* the NB85E cpu core * the NB85E cpu core
* *
* Copyright (C) 2001 NEC Corporation * Copyright (C) 2001,02 NEC Corporation
* Copyright (C) 2001 Miles Bader <miles@gnu.org> * Copyright (C) 2001,02 Miles Bader <miles@gnu.org>
* *
* This file is subject to the terms and conditions of the GNU General * This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this * Public License. See the file COPYING in the main directory of this
...@@ -40,7 +40,7 @@ int calc_counter_params (unsigned long base_freq, ...@@ -40,7 +40,7 @@ int calc_counter_params (unsigned long base_freq,
/* Find the lowest clock divider setting that can represent RATE. */ /* Find the lowest clock divider setting that can represent RATE. */
for (_divlog2 = min_divlog2; _divlog2 <= max_divlog2; _divlog2++) { for (_divlog2 = min_divlog2; _divlog2 <= max_divlog2; _divlog2++) {
/* Minimum interrupt rate possible using this divider. */ /* Minimum interrupt rate possible using this divider. */
int min_int_rate unsigned min_int_rate
= (base_freq >> _divlog2) >> counter_size; = (base_freq >> _divlog2) >> counter_size;
if (min_int_rate <= rate) { if (min_int_rate <= rate) {
......
...@@ -58,49 +58,6 @@ void cpu_idle (void) ...@@ -58,49 +58,6 @@ void cpu_idle (void)
(*idle) (); (*idle) ();
} }
struct spec_reg_name {
const char *name;
int gpr;
};
struct spec_reg_name spec_reg_names[] = {
{ "sp", GPR_SP },
{ "gp", GPR_GP },
{ "tp", GPR_TP },
{ "ep", GPR_EP },
{ "lp", GPR_LP },
{ 0, 0 }
};
void show_regs (struct pt_regs *regs)
{
int gpr_base, gpr_offs;
printk (" pc 0x%08lx psw 0x%08lx kernel_mode %d\n",
regs->pc, regs->psw, regs->kernel_mode);
printk (" ctpc 0x%08lx ctpsw 0x%08lx ctbp 0x%08lx\n",
regs->ctpc, regs->ctpsw, regs->ctbp);
for (gpr_base = 0; gpr_base < NUM_GPRS; gpr_base += 4) {
for (gpr_offs = 0; gpr_offs < 4; gpr_offs++) {
int gpr = gpr_base + gpr_offs;
long val = regs->gpr[gpr];
struct spec_reg_name *srn;
for (srn = spec_reg_names; srn->name; srn++)
if (srn->gpr == gpr)
break;
if (srn->name)
printk ("%7s 0x%08lx", srn->name, val);
else
printk (" r%02d 0x%08lx", gpr, val);
}
printk ("\n");
}
}
/* /*
* This is the mechanism for creating a new kernel thread. * This is the mechanism for creating a new kernel thread.
* *
...@@ -231,7 +188,7 @@ int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs) ...@@ -231,7 +188,7 @@ int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs)
are in entry.S). */ are in entry.S). */
int fork_common (int flags, unsigned long new_sp, struct pt_regs *regs) int fork_common (int flags, unsigned long new_sp, struct pt_regs *regs)
{ {
struct task_struct *p = do_fork (flags, new_sp, regs, 0, 0); struct task_struct *p = do_fork (flags, new_sp, regs, 0, 0, 0);
return IS_ERR (p) ? PTR_ERR (p) : p->pid; return IS_ERR (p) ? PTR_ERR (p) : p->pid;
} }
......
...@@ -24,7 +24,7 @@ static int cpuinfo_print (struct seq_file *m, void *v) ...@@ -24,7 +24,7 @@ static int cpuinfo_print (struct seq_file *m, void *v)
#else #else
seq_printf (m, "CPU-Model: %s\n", CPU_MODEL); seq_printf (m, "CPU-Model: %s\n", CPU_MODEL);
#endif #endif
#ifdef CPU_CLOCK_FREQ #ifdef CPU_CLOCK_FREQ
seq_printf (m, "CPU-Clock: %ld (%ld MHz)\n", seq_printf (m, "CPU-Clock: %ld (%ld MHz)\n",
(long)CPU_CLOCK_FREQ, (long)CPU_CLOCK_FREQ,
......
...@@ -60,25 +60,11 @@ void __init mach_early_init (void) ...@@ -60,25 +60,11 @@ void __init mach_early_init (void)
void __init mach_setup (char **cmdline) void __init mach_setup (char **cmdline)
{ {
printk (KERN_INFO
"CPU: %s\n"
"Platform: %s%s\n",
CPU_MODEL_LONG,
PLATFORM_LONG,
#ifdef CONFIG_ROM_KERNEL
""
#elif defined (CONFIG_RTE_CB_MULTI)
" (with Multi ROM monitor)"
#else
" (with ROM monitor)"
#endif
);
/* Probe for Mother-A, and print a message if we find it. */ /* Probe for Mother-A, and print a message if we find it. */
*(volatile long *)MB_A_SRAM_ADDR = 0xDEADBEEF; *(volatile unsigned long *)MB_A_SRAM_ADDR = 0xDEADBEEF;
if (*(volatile long *)MB_A_SRAM_ADDR == 0xDEADBEEF) { if (*(volatile unsigned long *)MB_A_SRAM_ADDR == 0xDEADBEEF) {
*(volatile long *)MB_A_SRAM_ADDR = 0x12345678; *(volatile unsigned long *)MB_A_SRAM_ADDR = 0x12345678;
if (*(volatile long *)MB_A_SRAM_ADDR == 0x12345678) if (*(volatile unsigned long *)MB_A_SRAM_ADDR == 0x12345678)
printk (KERN_INFO printk (KERN_INFO
" NEC SolutionGear/Midas lab" " NEC SolutionGear/Midas lab"
" RTE-MOTHER-A motherboard\n"); " RTE-MOTHER-A motherboard\n");
......
...@@ -109,10 +109,12 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence) ...@@ -109,10 +109,12 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence)
else if (whence == 2) else if (whence == 2)
offs += LED_NUM_DIGITS; /* end-relative */ offs += LED_NUM_DIGITS; /* end-relative */
if (offs >= 0 && offs <= LED_NUM_DIGITS) if (offs < 0 || offs > LED_NUM_DIGITS)
file->f_pos = offs;
else
return -EINVAL; return -EINVAL;
file->f_pos = offs;
return 0;
} }
static struct file_operations leds_fops = { static struct file_operations leds_fops = {
......
...@@ -239,7 +239,7 @@ static void __devinit pcibios_assign_resources (void) ...@@ -239,7 +239,7 @@ static void __devinit pcibios_assign_resources (void)
struct resource *r; struct resource *r;
pci_for_each_dev (dev) { pci_for_each_dev (dev) {
int di_num; unsigned di_num;
unsigned class = dev->class >> 8; unsigned class = dev->class >> 8;
if (class && class != PCI_CLASS_BRIDGE_HOST) { if (class && class != PCI_CLASS_BRIDGE_HOST) {
......
...@@ -78,6 +78,9 @@ void __init setup_arch (char **cmdline) ...@@ -78,6 +78,9 @@ void __init setup_arch (char **cmdline)
/* ... and tell the kernel about it. */ /* ... and tell the kernel about it. */
init_mem_alloc (ram_start, ram_len); init_mem_alloc (ram_start, ram_len);
printk (KERN_INFO "CPU: %s\nPlatform: %s\n",
CPU_MODEL_LONG, PLATFORM_LONG);
/* do machine-specific setups. */ /* do machine-specific setups. */
mach_setup (cmdline); mach_setup (cmdline);
...@@ -267,6 +270,16 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len) ...@@ -267,6 +270,16 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
zones_size[ZONE_DMA] zones_size[ZONE_DMA]
= ADDR_TO_PAGE (ram_len + (ram_start - PAGE_OFFSET)); = ADDR_TO_PAGE (ram_len + (ram_start - PAGE_OFFSET));
/* The allocator is very picky about the address of the first
allocatable page -- it must be at least as aligned as the
maximum allocation -- so try to detect cases where it will get
confused and signal them at compile time (this is a common
problem when porting to a new platform with ). There is a
similar runtime check in free_area_init_core. */
#if ((PAGE_OFFSET >> PAGE_SHIFT) & ((1UL << (MAX_ORDER - 1)) - 1))
#error MAX_ORDER is too large for given PAGE_OFFSET (use CONFIG_FORCE_MAX_ZONEORDER to change it)
#endif
free_area_init_node (0, NODE_DATA(0), 0, zones_size, free_area_init_node (0, NODE_DATA(0), 0, zones_size,
ADDR_TO_PAGE (PAGE_OFFSET), 0); ADDR_TO_PAGE (PAGE_OFFSET), 0);
mem_map = NODE_DATA(0)->node_mem_map; mem_map = NODE_DATA(0)->node_mem_map;
......
...@@ -512,9 +512,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -512,9 +512,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
/* Did we come from a system call? */ /* Did we come from a system call? */
if (PT_REGS_SYSCALL (regs)) { if (PT_REGS_SYSCALL (regs)) {
/* Restart the system call - no handlers present */ /* Restart the system call - no handlers present */
if (regs->gpr[GPR_RVAL] == -ERESTARTNOHAND || if (regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOHAND ||
regs->gpr[GPR_RVAL] == -ERESTARTSYS || regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTSYS ||
regs->gpr[GPR_RVAL] == -ERESTARTNOINTR) { regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOINTR)
{
regs->gpr[12] = PT_REGS_SYSCALL (regs); regs->gpr[12] = PT_REGS_SYSCALL (regs);
regs->pc -= 4; /* Size of `trap 0' insn. */ regs->pc -= 4; /* Size of `trap 0' insn. */
} }
......
...@@ -42,8 +42,6 @@ void __init mach_setup (char **cmdline) ...@@ -42,8 +42,6 @@ void __init mach_setup (char **cmdline)
const char *err; const char *err;
unsigned long root_dev_addr, root_dev_len; unsigned long root_dev_addr, root_dev_len;
printk (KERN_INFO "CPU: NEC V850E (GDB simulator)\n");
simcons_setup (); simcons_setup ();
printk (KERN_INFO "Reading root filesystem: %s", ROOT_FS); printk (KERN_INFO "Reading root filesystem: %s", ROOT_FS);
......
...@@ -79,8 +79,6 @@ void __init mach_early_init (void) ...@@ -79,8 +79,6 @@ void __init mach_early_init (void)
void __init mach_setup (char **cmdline) void __init mach_setup (char **cmdline)
{ {
printk (KERN_INFO "CPU: NEC V850E2 (sim85e2c simulator)\n");
memcons_setup (); memcons_setup ();
} }
......
...@@ -154,5 +154,5 @@ void simcons_setup (void) ...@@ -154,5 +154,5 @@ void simcons_setup (void)
{ {
V850_SIM_SYSCALL (make_raw, 0); V850_SIM_SYSCALL (make_raw, 0);
register_console (&simcons); register_console (&simcons);
printk (KERN_INFO "Console: GDB/v850e simulator stdio\n"); printk (KERN_INFO "Console: GDB V850E simulator stdio\n");
} }
...@@ -27,6 +27,9 @@ EXPORT_SYMBOL (trap_table); ...@@ -27,6 +27,9 @@ EXPORT_SYMBOL (trap_table);
extern void dump_thread (struct pt_regs *, struct user *); extern void dump_thread (struct pt_regs *, struct user *);
EXPORT_SYMBOL (dump_thread); EXPORT_SYMBOL (dump_thread);
EXPORT_SYMBOL (kernel_thread); EXPORT_SYMBOL (kernel_thread);
EXPORT_SYMBOL (enable_irq);
EXPORT_SYMBOL (disable_irq);
EXPORT_SYMBOL (disable_irq_nosync);
EXPORT_SYMBOL (__bug); EXPORT_SYMBOL (__bug);
/* Networking helper routines. */ /* Networking helper routines. */
...@@ -46,7 +49,6 @@ EXPORT_SYMBOL_NOVERS (strchr); ...@@ -46,7 +49,6 @@ EXPORT_SYMBOL_NOVERS (strchr);
EXPORT_SYMBOL_NOVERS (strlen); EXPORT_SYMBOL_NOVERS (strlen);
EXPORT_SYMBOL_NOVERS (strnlen); EXPORT_SYMBOL_NOVERS (strnlen);
EXPORT_SYMBOL_NOVERS (strpbrk); EXPORT_SYMBOL_NOVERS (strpbrk);
EXPORT_SYMBOL_NOVERS (strtok);
EXPORT_SYMBOL_NOVERS (strrchr); EXPORT_SYMBOL_NOVERS (strrchr);
EXPORT_SYMBOL_NOVERS (strstr); EXPORT_SYMBOL_NOVERS (strstr);
EXPORT_SYMBOL_NOVERS (memset); EXPORT_SYMBOL_NOVERS (memset);
......
...@@ -93,6 +93,11 @@ SECTIONS { ...@@ -93,6 +93,11 @@ SECTIONS {
*(.initcall7.init) *(.initcall7.init)
. = ALIGN (4) ; . = ALIGN (4) ;
___initcall_end = . ; ___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
} > SRAM } > SRAM
/* This provides address at which the interrupt vectors are /* This provides address at which the interrupt vectors are
......
...@@ -45,9 +45,14 @@ SECTIONS { ...@@ -45,9 +45,14 @@ SECTIONS {
___stop___ksymtab = . ; ___stop___ksymtab = . ;
. = ALIGN (4) ; . = ALIGN (4) ;
__etext = . ; __etext = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
} > ROM } > ROM
__data_load_start = . ; __rom_copy_src_start = . ;
.data : { .data : {
__kram_start = . ; __kram_start = . ;
......
...@@ -98,10 +98,15 @@ SECTIONS { ...@@ -98,10 +98,15 @@ SECTIONS {
*(.initcall7.init) *(.initcall7.init)
. = ALIGN (4) ; . = ALIGN (4) ;
___initcall_end = . ; ___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
} > SDRAM } > SDRAM
/* This provides address at which the interrupt vectors are /* The address at which the interrupt vectors are initially
initially loaded by the loader. */ loaded by the loader. */
__intv_load_start = ALIGN (0x10) ; __intv_load_start = ALIGN (0x10) ;
/* Interrupt vector space. Because we're using the monitor /* Interrupt vector space. Because we're using the monitor
......
...@@ -96,6 +96,12 @@ SECTIONS { ...@@ -96,6 +96,12 @@ SECTIONS {
*(.initcall7.init) *(.initcall7.init)
. = ALIGN (4) ; . = ALIGN (4) ;
___initcall_end = . ; ___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
__init_end = . ; __init_end = . ;
__kram_end = . ; __kram_end = . ;
......
...@@ -86,6 +86,12 @@ SECTIONS { ...@@ -86,6 +86,12 @@ SECTIONS {
*(.initcall7.init) *(.initcall7.init)
. = ALIGN (4) ; . = ALIGN (4) ;
___initcall_end = . ; ___initcall_end = . ;
. = ALIGN (4) ;
___initramfs_start = . ;
*(.init.ramfs)
___initramfs_end = . ;
__init_end = . ; __init_end = . ;
} > IRAM } > IRAM
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
# endif # endif
#endif #endif
#ifdef CONFIG_V850E_AS85EP1
# include "as85ep1.ld"
#endif
#ifdef CONFIG_RTE_CB_MA1 #ifdef CONFIG_RTE_CB_MA1
# ifdef CONFIG_ROM_KERNEL # ifdef CONFIG_ROM_KERNEL
# include "rte_ma1_cb-rom.ld" # include "rte_ma1_cb-rom.ld"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Makefile for the acorn character device drivers. # Makefile for the acorn character device drivers.
# #
# All the objects that export symbols.
obj-arc := keyb_arc.o defkeymap-acorn.o obj-arc := keyb_arc.o defkeymap-acorn.o
obj-$(CONFIG_ARCH_ACORN) += i2c.o pcf8583.o obj-$(CONFIG_ARCH_ACORN) += i2c.o pcf8583.o
......
...@@ -137,10 +137,10 @@ ...@@ -137,10 +137,10 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/bitops.h> #include <asm/bitops.h>
......
/*
* ARXE SCSI card driver
*
* Copyright (C) 1997-2000 Russell King
*
* Changes to support ARXE 16-bit SCSI card by Stefan Hanske
*/
#ifndef ARXE_SCSI_H
#define ARXE_SCSI_H
#define MANU_ARXE 0x0041
#define PROD_ARXE_SCSI 0x00be
extern int arxescsi_detect (Scsi_Host_Template *);
extern int arxescsi_release (struct Scsi_Host *);
extern const char *arxescsi_info (struct Scsi_Host *);
extern int arxescsi_proc_info (char *buffer, char **start, off_t offset,
int length, int hostno, int inout);
#ifndef NULL
#define NULL ((void *)0)
#endif
#ifndef CAN_QUEUE
/*
* Default queue size
*/
#define CAN_QUEUE 1
#endif
#ifndef CMD_PER_LUN
#define CMD_PER_LUN 1
#endif
#ifndef SCSI_ID
/*
* Default SCSI host ID
*/
#define SCSI_ID 7
#endif
#include <scsi/scsicam.h>
#include "fas216.h"
#define ARXEScsi { \
proc_info: arxescsi_proc_info, \
name: "ARXE SCSI card", \
detect: arxescsi_detect, \
release: arxescsi_release, \
info: arxescsi_info, \
can_queue: CAN_QUEUE, \
this_id: SCSI_ID, \
sg_tablesize: SG_ALL, \
cmd_per_lun: CMD_PER_LUN, \
use_clustering: DISABLE_CLUSTERING, \
command: fas216_command, \
queuecommand: fas216_queue_command, \
eh_host_reset_handler: fas216_eh_host_reset, \
eh_bus_reset_handler: fas216_eh_bus_reset, \
eh_device_reset_handler: fas216_eh_device_reset, \
eh_abort_handler: fas216_eh_abort, \
}
#ifndef HOSTS_C
typedef struct {
FAS216_Info info;
/* other info... */
unsigned int cstatus; /* card status register */
unsigned int dmaarea; /* Pseudo DMA area */
} ARXEScsi_Info;
#define CSTATUS_IRQ (1 << 0)
#define CSTATUS_DRQ (1 << 0)
#endif /* HOSTS_C */
#endif /* ARXE_SCSI_H */
...@@ -23,10 +23,8 @@ ...@@ -23,10 +23,8 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
......
...@@ -29,10 +29,8 @@ ...@@ -29,10 +29,8 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/unistd.h>
#include <linux/stat.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compatmac.h> #include <linux/compatmac.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
...@@ -53,6 +54,7 @@ MODULE_LICENSE("GPL"); ...@@ -53,6 +54,7 @@ MODULE_LICENSE("GPL");
int acpi_ac_add (struct acpi_device *device); int acpi_ac_add (struct acpi_device *device);
int acpi_ac_remove (struct acpi_device *device, int type); int acpi_ac_remove (struct acpi_device *device, int type);
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_ac_driver = { static struct acpi_driver acpi_ac_driver = {
.name = ACPI_AC_DRIVER_NAME, .name = ACPI_AC_DRIVER_NAME,
...@@ -69,6 +71,12 @@ struct acpi_ac { ...@@ -69,6 +71,12 @@ struct acpi_ac {
unsigned long state; unsigned long state;
}; };
static struct file_operations acpi_ac_fops = {
.open = acpi_ac_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
AC Adapter Management AC Adapter Management
...@@ -103,53 +111,40 @@ acpi_ac_get_state ( ...@@ -103,53 +111,40 @@ acpi_ac_get_state (
struct proc_dir_entry *acpi_ac_dir = NULL; struct proc_dir_entry *acpi_ac_dir = NULL;
static int int acpi_ac_seq_show(struct seq_file *seq, void *offset)
acpi_ac_read_state (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_ac *ac = (struct acpi_ac *) data; struct acpi_ac *ac = (struct acpi_ac *) seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_ac_read_state"); ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
if (!ac || (off != 0)) if (!ac)
goto end; return 0;
if (acpi_ac_get_state(ac)) { if (acpi_ac_get_state(ac)) {
p += sprintf(p, "ERROR: Unable to read AC Adapter state\n"); seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
goto end; return 0;
} }
p += sprintf(p, "state: "); seq_puts(seq, "state: ");
switch (ac->state) { switch (ac->state) {
case ACPI_AC_STATUS_OFFLINE: case ACPI_AC_STATUS_OFFLINE:
p += sprintf(p, "off-line\n"); seq_puts(seq, "off-line\n");
break; break;
case ACPI_AC_STATUS_ONLINE: case ACPI_AC_STATUS_ONLINE:
p += sprintf(p, "on-line\n"); seq_puts(seq, "on-line\n");
break; break;
default: default:
p += sprintf(p, "unknown\n"); seq_puts(seq, "unknown\n");
break; break;
} }
end: return 0;
len = (p - page); }
if (len <= off+count) *eof = 1;
*start = page + off; static int acpi_ac_open_fs(struct inode *inode, struct file *file)
len -= off; {
if (len>count) len = count; return single_open(file, acpi_ac_seq_show, PDE(inode)->data);
if (len<0) len = 0;
return_VALUE(len);
} }
static int static int
acpi_ac_add_fs ( acpi_ac_add_fs (
...@@ -174,7 +169,7 @@ acpi_ac_add_fs ( ...@@ -174,7 +169,7 @@ acpi_ac_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_AC_FILE_STATE)); ACPI_AC_FILE_STATE));
else { else {
entry->read_proc = acpi_ac_read_state; entry->proc_fops = &acpi_ac_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compatmac.h> #include <linux/compatmac.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
...@@ -69,6 +70,7 @@ MODULE_LICENSE("GPL"); ...@@ -69,6 +70,7 @@ MODULE_LICENSE("GPL");
int acpi_button_add (struct acpi_device *device); int acpi_button_add (struct acpi_device *device);
int acpi_button_remove (struct acpi_device *device, int type); int acpi_button_remove (struct acpi_device *device, int type);
static int acpi_button_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_button_driver = { static struct acpi_driver acpi_button_driver = {
.name = ACPI_BUTTON_DRIVER_NAME, .name = ACPI_BUTTON_DRIVER_NAME,
...@@ -87,6 +89,12 @@ struct acpi_button { ...@@ -87,6 +89,12 @@ struct acpi_button {
unsigned long pushed; unsigned long pushed;
}; };
static struct file_operations acpi_button_fops = {
.open = acpi_button_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
FS Interface (/proc) FS Interface (/proc)
...@@ -94,39 +102,26 @@ struct acpi_button { ...@@ -94,39 +102,26 @@ struct acpi_button {
static struct proc_dir_entry *acpi_button_dir = NULL; static struct proc_dir_entry *acpi_button_dir = NULL;
static int static int acpi_button_seq_show(struct seq_file *seq, void *offset)
acpi_button_read_info (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_button *button = (struct acpi_button *) data; struct acpi_button *button = (struct acpi_button *) seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_button_read_info"); ACPI_FUNCTION_TRACE("acpi_button_seq_show");
if (!button || !button->device) if (!button || !button->device)
goto end; return 0;
p += sprintf(p, "type: %s\n", seq_printf(seq, "type: %s\n",
acpi_device_name(button->device)); acpi_device_name(button->device));
end: return 0;
len = (p - page);
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_button_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_button_seq_show, PDE(inode)->data);
}
static int static int
acpi_button_add_fs ( acpi_button_add_fs (
struct acpi_device *device) struct acpi_device *device)
...@@ -170,7 +165,7 @@ acpi_button_add_fs ( ...@@ -170,7 +165,7 @@ acpi_button_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_BUTTON_FILE_INFO)); ACPI_BUTTON_FILE_INFO));
else { else {
entry->read_proc = acpi_button_read_info; entry->proc_fops = &acpi_button_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: dsmthdat - control method arguments and local variables * Module Name: dsmthdat - control method arguments and local variables
* $Revision: 64 $ * $Revision: 66 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "acdispat.h" #include "acdispat.h"
#include "amlcode.h" #include "amlcode.h"
#include "acnamesp.h" #include "acnamesp.h"
#include "acinterp.h"
#define _COMPONENT ACPI_DISPATCHER #define _COMPONENT ACPI_DISPATCHER
...@@ -274,6 +275,7 @@ acpi_ds_method_data_get_node ( ...@@ -274,6 +275,7 @@ acpi_ds_method_data_get_node (
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Insert an object onto the method stack at entry Opcode:Index. * DESCRIPTION: Insert an object onto the method stack at entry Opcode:Index.
* Note: There is no "implicit conversion" for locals.
* *
******************************************************************************/ ******************************************************************************/
...@@ -286,11 +288,17 @@ acpi_ds_method_data_set_value ( ...@@ -286,11 +288,17 @@ acpi_ds_method_data_set_value (
{ {
acpi_status status; acpi_status status;
acpi_namespace_node *node; acpi_namespace_node *node;
acpi_operand_object *new_desc = object;
ACPI_FUNCTION_TRACE ("Ds_method_data_set_value"); ACPI_FUNCTION_TRACE ("Ds_method_data_set_value");
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"obj %p op %X, ref count = %d [%s]\n", object,
opcode, object->common.reference_count,
acpi_ut_get_type_name (object->common.type)));
/* Get the namespace node for the arg/local */ /* Get the namespace node for the arg/local */
status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node); status = acpi_ds_method_data_get_node (opcode, index, walk_state, &node);
...@@ -298,14 +306,30 @@ acpi_ds_method_data_set_value ( ...@@ -298,14 +306,30 @@ acpi_ds_method_data_set_value (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Increment ref count so object can't be deleted while installed */ /*
* If the object has just been created and is not attached to anything,
* (the reference count is 1), then we can just store it directly into
* the arg/local. Otherwise, we must copy it.
*/
if (object->common.reference_count > 1) {
status = acpi_ut_copy_iobject_to_iobject (object, &new_desc, walk_state);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
acpi_ut_add_reference (object); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object Copied %p, new %p\n",
object, new_desc));
}
else {
/* Increment ref count so object can't be deleted while installed */
acpi_ut_add_reference (new_desc);
}
/* Install the object into the stack entry */ /* Install the object */
node->object = object; node->object = new_desc;
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (status);
} }
...@@ -560,7 +584,8 @@ acpi_ds_store_object_to_local ( ...@@ -560,7 +584,8 @@ acpi_ds_store_object_to_local (
current_obj_desc = acpi_ns_get_attached_object (node); current_obj_desc = acpi_ns_get_attached_object (node);
if (current_obj_desc == obj_desc) { if (current_obj_desc == obj_desc) {
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", obj_desc)); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n",
obj_desc));
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
...@@ -609,16 +634,12 @@ acpi_ds_store_object_to_local ( ...@@ -609,16 +634,12 @@ acpi_ds_store_object_to_local (
"Arg (%p) is an Obj_ref(Node), storing in node %p\n", "Arg (%p) is an Obj_ref(Node), storing in node %p\n",
obj_desc, current_obj_desc)); obj_desc, current_obj_desc));
/* Detach an existing object from the referenced Node */
acpi_ns_detach_object (current_obj_desc->reference.object);
/* /*
* Store this object into the Node * Store this object to the Node
* (perform the indirect store) * (perform the indirect store)
*/ */
status = acpi_ns_attach_object (current_obj_desc->reference.object, status = acpi_ex_store_object_to_node (obj_desc,
obj_desc, ACPI_GET_OBJECT_TYPE (obj_desc)); current_obj_desc->reference.object, walk_state);
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch * Module Name: evevent - Fixed and General Purpose Even handling and dispatch
* $Revision: 96 $ * $Revision: 99 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -331,11 +331,8 @@ acpi_ev_gpe_initialize (void) ...@@ -331,11 +331,8 @@ acpi_ev_gpe_initialize (void)
* FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need
* to be the same size." * to be the same size."
*/ */
acpi_gbl_gpe_block_info[0].address_space_id = acpi_gbl_FADT->Xgpe0_blk.address_space_id; acpi_gbl_gpe_block_info[0].register_count = 0;
acpi_gbl_gpe_block_info[1].address_space_id = acpi_gbl_FADT->Xgpe1_blk.address_space_id; acpi_gbl_gpe_block_info[1].register_count = 0;
acpi_gbl_gpe_block_info[0].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe0_blk.register_bit_width);
acpi_gbl_gpe_block_info[1].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe1_blk.register_bit_width);
acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->Xgpe0_blk; acpi_gbl_gpe_block_info[0].block_address = &acpi_gbl_FADT->Xgpe0_blk;
acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->Xgpe1_blk; acpi_gbl_gpe_block_info[1].block_address = &acpi_gbl_FADT->Xgpe1_blk;
...@@ -343,28 +340,25 @@ acpi_ev_gpe_initialize (void) ...@@ -343,28 +340,25 @@ acpi_ev_gpe_initialize (void)
acpi_gbl_gpe_block_info[0].block_base_number = 0; acpi_gbl_gpe_block_info[0].block_base_number = 0;
acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base; acpi_gbl_gpe_block_info[1].block_base_number = acpi_gbl_FADT->gpe1_base;
/* Warn and exit if there are no GPE registers */
acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count +
acpi_gbl_gpe_block_info[1].register_count;
if (!acpi_gbl_gpe_register_count) {
ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n"));
return_ACPI_STATUS (AE_OK);
}
/* /*
* Determine the maximum GPE number for this machine. * Determine the maximum GPE number for this machine.
* Note: both GPE0 and GPE1 are optional, and either can exist without * Note: both GPE0 and GPE1 are optional, and either can exist without
* the other * the other.
* If EITHER the register length OR the block address are zero, then that
* particular block is not supported.
*/ */
if (acpi_gbl_gpe_block_info[0].register_count) { if (acpi_gbl_FADT->Xgpe0_blk.register_bit_width && ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe0_blk.address)) {
/* GPE block 0 exists */ /* GPE block 0 exists (has length and address > 0) */
acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1; acpi_gbl_gpe_block_info[0].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe0_blk.register_bit_width);
acpi_gbl_gpe_number_max = ACPI_MUL_8 (acpi_gbl_gpe_block_info[0].register_count) - 1;
} }
if (acpi_gbl_gpe_block_info[1].register_count) { if (acpi_gbl_FADT->Xgpe1_blk.register_bit_width && ACPI_GET_ADDRESS (acpi_gbl_FADT->Xgpe1_blk.address)) {
/* GPE block 1 exists */ /* GPE block 1 exists (has length and address > 0) */
acpi_gbl_gpe_block_info[1].register_count = (u16) ACPI_DIV_16 (acpi_gbl_FADT->Xgpe1_blk.register_bit_width);
/* Check for GPE0/GPE1 overlap (if both banks exist) */ /* Check for GPE0/GPE1 overlap (if both banks exist) */
...@@ -385,6 +379,15 @@ acpi_ev_gpe_initialize (void) ...@@ -385,6 +379,15 @@ acpi_ev_gpe_initialize (void)
(ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1); (ACPI_MUL_8 (acpi_gbl_gpe_block_info[1].register_count) - 1);
} }
/* Warn and exit if there are no GPE registers */
acpi_gbl_gpe_register_count = acpi_gbl_gpe_block_info[0].register_count +
acpi_gbl_gpe_block_info[1].register_count;
if (!acpi_gbl_gpe_register_count) {
ACPI_REPORT_WARNING (("There are no GPE blocks defined in the FADT\n"));
return_ACPI_STATUS (AE_OK);
}
/* Check for Max GPE number out-of-range */ /* Check for Max GPE number out-of-range */
if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) { if (acpi_gbl_gpe_number_max > ACPI_GPE_MAX) {
...@@ -460,8 +463,8 @@ acpi_ev_gpe_initialize (void) ...@@ -460,8 +463,8 @@ acpi_ev_gpe_initialize (void)
+ i + i
+ acpi_gbl_gpe_block_info[gpe_block].register_count)); + acpi_gbl_gpe_block_info[gpe_block].register_count));
gpe_register_info->status_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id; gpe_register_info->status_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].block_address->address_space_id;
gpe_register_info->enable_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].address_space_id; gpe_register_info->enable_address.address_space_id = acpi_gbl_gpe_block_info[gpe_block].block_address->address_space_id;
gpe_register_info->status_address.register_bit_width = 8; gpe_register_info->status_address.register_bit_width = 8;
gpe_register_info->enable_address.register_bit_width = 8; gpe_register_info->enable_address.register_bit_width = 8;
gpe_register_info->status_address.register_bit_offset = 8; gpe_register_info->status_address.register_bit_offset = 8;
...@@ -565,7 +568,7 @@ acpi_ev_save_method_info ( ...@@ -565,7 +568,7 @@ acpi_ev_save_method_info (
/* Extract the name from the object and convert to a string */ /* Extract the name from the object and convert to a string */
ACPI_MOVE_UNALIGNED32_TO_32 (name, ACPI_MOVE_UNALIGNED32_TO_32 (name,
&((acpi_namespace_node *) obj_handle)->name.integer); &((acpi_namespace_node *) obj_handle)->name.integer);
name[ACPI_NAME_SIZE] = 0; name[ACPI_NAME_SIZE] = 0;
/* /*
...@@ -614,8 +617,8 @@ acpi_ev_save_method_info ( ...@@ -614,8 +617,8 @@ acpi_ev_save_method_info (
* Now we can add this information to the Gpe_info block * Now we can add this information to the Gpe_info block
* for use during dispatch of this GPE. * for use during dispatch of this GPE.
*/ */
acpi_gbl_gpe_number_info [gpe_number_index].type = type; acpi_gbl_gpe_number_info [gpe_number_index].type = type;
acpi_gbl_gpe_number_info [gpe_number_index].method_handle = obj_handle; acpi_gbl_gpe_number_info [gpe_number_index].method_node = (acpi_namespace_node *) obj_handle;
/* /*
* Enable the GPE (SCIs should be disabled at this point) * Enable the GPE (SCIs should be disabled at this point)
...@@ -625,7 +628,7 @@ acpi_ev_save_method_info ( ...@@ -625,7 +628,7 @@ acpi_ev_save_method_info (
return (status); return (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %X\n", ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Registered GPE method %s as GPE number %2.2X\n",
name, gpe_number)); name, gpe_number));
return (AE_OK); return (AE_OK);
} }
...@@ -805,15 +808,16 @@ acpi_ev_asynch_execute_gpe_method ( ...@@ -805,15 +808,16 @@ acpi_ev_asynch_execute_gpe_method (
return_VOID; return_VOID;
} }
if (gpe_info.method_handle) { if (gpe_info.method_node) {
/* /*
* Invoke the GPE Method (_Lxx, _Exx): * Invoke the GPE Method (_Lxx, _Exx):
* (Evaluate the _Lxx/_Exx control method that corresponds to this GPE.) * (Evaluate the _Lxx/_Exx control method that corresponds to this GPE.)
*/ */
status = acpi_ns_evaluate_by_handle (gpe_info.method_handle, NULL, NULL); status = acpi_ns_evaluate_by_handle (gpe_info.method_node, NULL, NULL);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("%s while evaluating GPE%X method\n", ACPI_REPORT_ERROR (("%s while evaluating method [%4.4s] for GPE[%2.2X]\n",
acpi_format_exception (status), gpe_number)); acpi_format_exception (status),
gpe_info.method_node->name.ascii, gpe_number));
} }
} }
...@@ -881,7 +885,7 @@ acpi_ev_gpe_dispatch ( ...@@ -881,7 +885,7 @@ acpi_ev_gpe_dispatch (
if (gpe_info->type & ACPI_EVENT_EDGE_TRIGGERED) { if (gpe_info->type & ACPI_EVENT_EDGE_TRIGGERED) {
status = acpi_hw_clear_gpe (gpe_number); status = acpi_hw_clear_gpe (gpe_number);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%X]\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
} }
} }
...@@ -898,14 +902,14 @@ acpi_ev_gpe_dispatch ( ...@@ -898,14 +902,14 @@ acpi_ev_gpe_dispatch (
gpe_info->handler (gpe_info->context); gpe_info->handler (gpe_info->context);
} }
else if (gpe_info->method_handle) { else if (gpe_info->method_node) {
/* /*
* Disable GPE, so it doesn't keep firing before the method has a * Disable GPE, so it doesn't keep firing before the method has a
* chance to run. * chance to run.
*/ */
status = acpi_hw_disable_gpe (gpe_number); status = acpi_hw_disable_gpe (gpe_number);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%X]\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
} }
...@@ -915,13 +919,13 @@ acpi_ev_gpe_dispatch ( ...@@ -915,13 +919,13 @@ acpi_ev_gpe_dispatch (
if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE, if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
acpi_ev_asynch_execute_gpe_method, acpi_ev_asynch_execute_gpe_method,
ACPI_TO_POINTER (gpe_number)))) { ACPI_TO_POINTER (gpe_number)))) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%X], event is disabled\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE[%2.2X], event is disabled\n", gpe_number));
} }
} }
else { else {
/* No handler or method to run! */ /* No handler or method to run! */
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: No handler or method for GPE[%X], disabling event\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: No handler or method for GPE[%2.2X], disabling event\n", gpe_number));
/* /*
* Disable the GPE. The GPE will remain disabled until the ACPI * Disable the GPE. The GPE will remain disabled until the ACPI
...@@ -929,7 +933,7 @@ acpi_ev_gpe_dispatch ( ...@@ -929,7 +933,7 @@ acpi_ev_gpe_dispatch (
*/ */
status = acpi_hw_disable_gpe (gpe_number); status = acpi_hw_disable_gpe (gpe_number);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%X]\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to disable GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
} }
} }
...@@ -940,7 +944,7 @@ acpi_ev_gpe_dispatch ( ...@@ -940,7 +944,7 @@ acpi_ev_gpe_dispatch (
if (gpe_info->type & ACPI_EVENT_LEVEL_TRIGGERED) { if (gpe_info->type & ACPI_EVENT_LEVEL_TRIGGERED) {
status = acpi_hw_clear_gpe (gpe_number); status = acpi_hw_clear_gpe (gpe_number);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%X]\n", gpe_number)); ACPI_REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to clear GPE[%2.2X]\n", gpe_number));
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
} }
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: evrgnini- ACPI Address_space (Op_region) init * Module Name: evrgnini- ACPI Address_space (Op_region) init
* $Revision: 63 $ * $Revision: 64 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -269,6 +269,11 @@ acpi_ev_pci_config_region_setup ( ...@@ -269,6 +269,11 @@ acpi_ev_pci_config_region_setup (
pci_id->bus = ACPI_LOWORD (temp); pci_id->bus = ACPI_LOWORD (temp);
} }
/*
* Complete this device's Pci_id
*/
acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id);
*region_context = pci_id; *region_context = pci_id;
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Name: acconfig.h - Global configuration constants * Name: acconfig.h - Global configuration constants
* $Revision: 118 $ * $Revision: 119 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20021115 #define ACPI_CA_VERSION 0x20021122
/* Version of ACPI supported */ /* Version of ACPI supported */
......
/****************************************************************************** /******************************************************************************
* *
* Name: aclocal.h - Internal data types used across the ACPI subsystem * Name: aclocal.h - Internal data types used across the ACPI subsystem
* $Revision: 179 $ * $Revision: 181 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -301,7 +301,6 @@ typedef struct ...@@ -301,7 +301,6 @@ typedef struct
typedef struct typedef struct
{ {
u8 address_space_id;
acpi_generic_address *block_address; acpi_generic_address *block_address;
u16 register_count; u16 register_count;
u8 block_base_number; u8 block_base_number;
...@@ -330,7 +329,7 @@ typedef struct ...@@ -330,7 +329,7 @@ typedef struct
typedef struct typedef struct
{ {
acpi_handle method_handle; /* Method handle for direct (fast) execution */ acpi_namespace_node *method_node; /* Method node for this GPE level */
acpi_gpe_handler handler; /* Address of handler, if any */ acpi_gpe_handler handler; /* Address of handler, if any */
void *context; /* Context to be passed to handler */ void *context; /* Context to be passed to handler */
u8 type; /* Level or Edge */ u8 type; /* Level or Edge */
......
...@@ -246,6 +246,14 @@ acpi_os_write_pci_configuration ( ...@@ -246,6 +246,14 @@ acpi_os_write_pci_configuration (
acpi_integer value, acpi_integer value,
u32 width); u32 width);
/*
* Interim function needed for PCI IRQ routing
*/
void
acpi_os_derive_pci_id(
acpi_handle rhandle,
acpi_handle chandle,
acpi_pci_id **pci_id);
/* /*
* Miscellaneous * Miscellaneous
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <asm/io.h> #include <asm/io.h>
#include "acpi_bus.h"
#include "acpi.h" #include "acpi.h"
#ifdef CONFIG_ACPI_EFI #ifdef CONFIG_ACPI_EFI
...@@ -483,6 +484,44 @@ acpi_os_write_pci_configuration ( ...@@ -483,6 +484,44 @@ acpi_os_write_pci_configuration (
return (result ? AE_ERROR : AE_OK); return (result ? AE_ERROR : AE_OK);
} }
/* TODO: Rewrite this code!!! */
void
acpi_os_derive_pci_id (
acpi_handle rhandle, /* upper bound */
acpi_handle chandle, /* current node */
acpi_pci_id **id)
{
acpi_handle handle;
acpi_pci_id *pci_id = *id;
acpi_status status;
unsigned long temp;
acpi_object_type type;
u8 tu8;
acpi_get_parent(chandle, &handle);
if (handle != rhandle) {
acpi_os_derive_pci_id(rhandle, handle, &pci_id);
status = acpi_get_type(handle, &type);
if ( (ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE) )
return;
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &temp);
if (ACPI_SUCCESS(status)) {
pci_id->device = ACPI_HIWORD (ACPI_LODWORD (temp));
pci_id->function = ACPI_LOWORD (ACPI_LODWORD (temp));
/* any nicer way to get bus number of bridge ? */
status = acpi_os_read_pci_configuration(pci_id, 0x0e, &tu8, 8);
if (ACPI_SUCCESS(status) && (tu8 & 0x7f) == 1) {
status = acpi_os_read_pci_configuration(pci_id, 0x19, &tu8, 8);
if (ACPI_SUCCESS(status))
pci_id->bus = tu8;
}
}
}
}
#else /*!CONFIG_ACPI_PCI*/ #else /*!CONFIG_ACPI_PCI*/
acpi_status acpi_status
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: psopcode - Parser/Interpreter opcode information table * Module Name: psopcode - Parser/Interpreter opcode information table
* $Revision: 73 $ * $Revision: 74 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -734,7 +734,7 @@ NATIVE_CHAR * ...@@ -734,7 +734,7 @@ NATIVE_CHAR *
acpi_ps_get_opcode_name ( acpi_ps_get_opcode_name (
u16 opcode) u16 opcode)
{ {
#ifdef ACPI_DISASSEMBLER #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
const acpi_opcode_info *op; const acpi_opcode_info *op;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compatmac.h> #include <linux/compatmac.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
...@@ -48,6 +49,7 @@ ACPI_MODULE_NAME ("acpi_power") ...@@ -48,6 +49,7 @@ ACPI_MODULE_NAME ("acpi_power")
int acpi_power_add (struct acpi_device *device); int acpi_power_add (struct acpi_device *device);
int acpi_power_remove (struct acpi_device *device, int type); int acpi_power_remove (struct acpi_device *device, int type);
static int acpi_power_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_power_driver = { static struct acpi_driver acpi_power_driver = {
.name = ACPI_POWER_DRIVER_NAME, .name = ACPI_POWER_DRIVER_NAME,
...@@ -71,6 +73,12 @@ struct acpi_power_resource ...@@ -71,6 +73,12 @@ struct acpi_power_resource
static struct list_head acpi_power_resource_list; static struct list_head acpi_power_resource_list;
static struct file_operations acpi_power_fops = {
.open = acpi_power_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Power Resource Management Power Resource Management
...@@ -379,58 +387,45 @@ acpi_power_transition ( ...@@ -379,58 +387,45 @@ acpi_power_transition (
struct proc_dir_entry *acpi_power_dir = NULL; struct proc_dir_entry *acpi_power_dir = NULL;
static int acpi_power_seq_show(struct seq_file *seq, void *offset)
static int
acpi_power_read_status (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_power_resource *resource = NULL; struct acpi_power_resource *resource = NULL;
char *p = page;
int len;
ACPI_FUNCTION_TRACE("acpi_power_read_status"); ACPI_FUNCTION_TRACE("acpi_power_seq_show");
if (!data || (off != 0)) resource = (struct acpi_power_resource *)seq->private;
goto end;
resource = (struct acpi_power_resource *) data; if (!resource)
goto end;
p += sprintf(p, "state: "); seq_puts(seq, "state: ");
switch (resource->state) { switch (resource->state) {
case ACPI_POWER_RESOURCE_STATE_ON: case ACPI_POWER_RESOURCE_STATE_ON:
p += sprintf(p, "on\n"); seq_puts(seq, "on\n");
break; break;
case ACPI_POWER_RESOURCE_STATE_OFF: case ACPI_POWER_RESOURCE_STATE_OFF:
p += sprintf(p, "off\n"); seq_puts(seq, "off\n");
break; break;
default: default:
p += sprintf(p, "unknown\n"); seq_puts(seq, "unknown\n");
break; break;
} }
p += sprintf(p, "system level: S%d\n", seq_printf(seq, "system level: S%d\n"
resource->system_level); "order: %d\n"
p += sprintf(p, "order: %d\n", "reference count: %d\n",
resource->order); resource->system_level,
p += sprintf(p, "reference count: %d\n", resource->order,
resource->references); resource->references);
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_power_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_power_seq_show, PDE(inode)->data);
}
static int static int
acpi_power_add_fs ( acpi_power_add_fs (
...@@ -458,7 +453,7 @@ acpi_power_add_fs ( ...@@ -458,7 +453,7 @@ acpi_power_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_POWER_FILE_STATUS)); ACPI_POWER_FILE_STATUS));
else { else {
entry->read_proc = acpi_power_read_status; entry->proc_fops = &acpi_power_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <asm/delay.h> #include <asm/delay.h>
#include <linux/compatmac.h> #include <linux/compatmac.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
...@@ -90,6 +91,11 @@ MODULE_LICENSE("GPL"); ...@@ -90,6 +91,11 @@ MODULE_LICENSE("GPL");
static int acpi_processor_add (struct acpi_device *device); static int acpi_processor_add (struct acpi_device *device);
static int acpi_processor_remove (struct acpi_device *device, int type); static int acpi_processor_remove (struct acpi_device *device, int type);
static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
static int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file);
static int acpi_processor_power_open_fs(struct inode *inode, struct file *file);
static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_processor_driver = { static struct acpi_driver acpi_processor_driver = {
.name = ACPI_PROCESSOR_DRIVER_NAME, .name = ACPI_PROCESSOR_DRIVER_NAME,
...@@ -224,6 +230,34 @@ struct acpi_processor_errata { ...@@ -224,6 +230,34 @@ struct acpi_processor_errata {
} piix4; } piix4;
}; };
static struct file_operations acpi_processor_info_fops = {
.open = acpi_processor_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_processor_power_fops = {
.open = acpi_processor_power_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_processor_throttling_fops = {
.open = acpi_processor_throttling_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_processor_limit_fops = {
.open = acpi_processor_limit_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct acpi_processor *processors[NR_CPUS]; static struct acpi_processor *processors[NR_CPUS];
static struct acpi_processor_errata errata; static struct acpi_processor_errata errata;
static void (*pm_idle_save)(void) = NULL; static void (*pm_idle_save)(void) = NULL;
...@@ -231,6 +265,13 @@ static void (*pm_idle_save)(void) = NULL; ...@@ -231,6 +265,13 @@ static void (*pm_idle_save)(void) = NULL;
#ifdef CONFIG_ACPI_PROCESSOR_PERF #ifdef CONFIG_ACPI_PROCESSOR_PERF
static unsigned int cpufreq_usage_count = 0; static unsigned int cpufreq_usage_count = 0;
static struct cpufreq_driver *acpi_cpufreq_driver; static struct cpufreq_driver *acpi_cpufreq_driver;
static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file);
static struct file_operations acpi_processor_perf_fops = {
.open = acpi_processor_perf_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
#endif #endif
...@@ -1884,174 +1925,132 @@ acpi_cpufreq_exit ( ...@@ -1884,174 +1925,132 @@ acpi_cpufreq_exit (
struct proc_dir_entry *acpi_processor_dir = NULL; struct proc_dir_entry *acpi_processor_dir = NULL;
static int static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
acpi_processor_read_info (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_processor_read_info"); ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show");
if (!pr || (off != 0)) if (!pr)
goto end; goto end;
p += sprintf(p, "processor id: %d\n", seq_printf(seq, "processor id: %d\n"
pr->id); "acpi id: %d\n"
"bus mastering control: %s\n"
p += sprintf(p, "acpi id: %d\n", "power management: %s\n"
pr->acpi_id); "throttling control: %s\n"
"performance management: %s\n"
p += sprintf(p, "bus mastering control: %s\n", "limit interface: %s\n",
pr->flags.bm_control ? "yes" : "no"); pr->id,
pr->acpi_id,
p += sprintf(p, "power management: %s\n", pr->flags.bm_control ? "yes" : "no",
pr->flags.power ? "yes" : "no"); pr->flags.power ? "yes" : "no",
pr->flags.throttling ? "yes" : "no",
p += sprintf(p, "throttling control: %s\n", pr->flags.performance ? "yes" : "no",
pr->flags.throttling ? "yes" : "no"); pr->flags.limit ? "yes" : "no");
p += sprintf(p, "performance management: %s\n",
pr->flags.performance ? "yes" : "no");
p += sprintf(p, "limit interface: %s\n",
pr->flags.limit ? "yes" : "no");
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_processor_info_seq_show,
PDE(inode)->data);
}
static int static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
acpi_processor_read_power (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
char *p = page;
int len = 0;
int i = 0; int i = 0;
ACPI_FUNCTION_TRACE("acpi_processor_read_power"); ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");
if (!pr || (off != 0)) if (!pr)
goto end; goto end;
p += sprintf(p, "active state: C%d\n", seq_printf(seq, "active state: C%d\n"
pr->power.state); "default state: C%d\n"
"bus master activity: %08x\n",
p += sprintf(p, "default state: C%d\n", pr->power.state,
pr->power.default_state); pr->power.default_state,
pr->power.bm_activity);
p += sprintf(p, "bus master activity: %08x\n", seq_puts(seq, "states:\n");
pr->power.bm_activity);
p += sprintf(p, "states:\n"); for (i = 1; i < ACPI_C_STATE_COUNT; i++) {
seq_printf(seq, " %cC%d: ",
for (i=1; i<ACPI_C_STATE_COUNT; i++) {
p += sprintf(p, " %cC%d: ",
(i == pr->power.state?'*':' '), i); (i == pr->power.state?'*':' '), i);
if (!pr->power.states[i].valid) { if (!pr->power.states[i].valid) {
p += sprintf(p, "<not supported>\n"); seq_puts(seq, "<not supported>\n");
continue; continue;
} }
if (pr->power.states[i].promotion.state) if (pr->power.states[i].promotion.state)
p += sprintf(p, "promotion[C%d] ", seq_printf(seq, "promotion[C%d] ",
pr->power.states[i].promotion.state); pr->power.states[i].promotion.state);
else else
p += sprintf(p, "promotion[--] "); seq_puts(seq, "promotion[--] ");
if (pr->power.states[i].demotion.state) if (pr->power.states[i].demotion.state)
p += sprintf(p, "demotion[C%d] ", seq_printf(seq, "demotion[C%d] ",
pr->power.states[i].demotion.state); pr->power.states[i].demotion.state);
else else
p += sprintf(p, "demotion[--] "); seq_puts(seq, "demotion[--] ");
p += sprintf(p, "latency[%03d] usage[%08d]\n", seq_printf(seq, "latency[%03d] usage[%08d]\n",
pr->power.states[i].latency, pr->power.states[i].latency,
pr->power.states[i].usage); pr->power.states[i].usage);
} }
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1; }
*start = page + off;
len -= off; static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
if (len>count) len = count; {
if (len<0) len = 0; return single_open(file, acpi_processor_power_seq_show,
PDE(inode)->data);
return_VALUE(len);
} }
#ifdef CONFIG_ACPI_PROCESSOR_PERF #ifdef CONFIG_ACPI_PROCESSOR_PERF
static int static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
acpi_processor_read_performance (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
char *p = page;
int len = 0;
int i = 0; int i = 0;
ACPI_FUNCTION_TRACE("acpi_processor_read_performance"); ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");
if (!pr || (off != 0)) if (!pr)
goto end; goto end;
if (!pr->flags.performance) { if (!pr->flags.performance) {
p += sprintf(p, "<not supported>\n"); seq_puts(seq, "<not supported>\n");
goto end; goto end;
} }
p += sprintf(p, "state count: %d\n", seq_printf(seq, "state count: %d\n"
pr->performance.state_count); "active state: P%d\n",
pr->performance.state_count,
p += sprintf(p, "active state: P%d\n", pr->performance.state);
pr->performance.state);
p += sprintf(p, "states:\n");
for (i=0; i<pr->performance.state_count; i++) seq_puts(seq, "states:\n");
p += sprintf(p, " %cP%d: %d MHz, %d mW, %d uS\n", for (i = 0; i < pr->performance.state_count; i++)
seq_printf(seq, " %cP%d: %d MHz, %d mW, %d uS\n",
(i == pr->performance.state?'*':' '), i, (i == pr->performance.state?'*':' '), i,
(u32) pr->performance.states[i].core_frequency, (u32) pr->performance.states[i].core_frequency,
(u32) pr->performance.states[i].power, (u32) pr->performance.states[i].power,
(u32) pr->performance.states[i].transition_latency); (u32) pr->performance.states[i].transition_latency);
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1; }
*start = page + off;
len -= off; static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
if (len>count) len = count; {
if (len<0) len = 0; return single_open(file, acpi_processor_perf_seq_show,
PDE(inode)->data);
return_VALUE(len);
} }
static int static int
...@@ -2091,63 +2090,49 @@ acpi_processor_write_performance ( ...@@ -2091,63 +2090,49 @@ acpi_processor_write_performance (
} }
#endif #endif
static int acpi_processor_throttling_seq_show(struct seq_file *seq, void *offset)
static int
acpi_processor_read_throttling (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
char *p = page;
int len = 0;
int i = 0; int i = 0;
int result = 0; int result = 0;
ACPI_FUNCTION_TRACE("acpi_processor_read_throttling"); ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");
if (!pr || (off != 0)) if (!pr)
goto end; goto end;
if (!(pr->throttling.state_count > 0)) { if (!(pr->throttling.state_count > 0)) {
p += sprintf(p, "<not supported>\n"); seq_puts(seq, "<not supported>\n");
goto end; goto end;
} }
result = acpi_processor_get_throttling(pr); result = acpi_processor_get_throttling(pr);
if (result) { if (result) {
p += sprintf(p, "Could not determine current throttling state.\n"); seq_puts(seq, "Could not determine current throttling state.\n");
goto end; goto end;
} }
p += sprintf(p, "state count: %d\n", seq_printf(seq, "state count: %d\n"
pr->throttling.state_count); "active state: T%d\n",
pr->throttling.state_count,
p += sprintf(p, "active state: T%d\n", pr->throttling.state);
pr->throttling.state);
p += sprintf(p, "states:\n"); seq_puts(seq, "states:\n");
for (i = 0; i < pr->throttling.state_count; i++)
for (i=0; i<pr->throttling.state_count; i++) seq_printf(seq, " %cT%d: %02d%%\n",
p += sprintf(p, " %cT%d: %02d%%\n",
(i == pr->throttling.state?'*':' '), i, (i == pr->throttling.state?'*':' '), i,
(pr->throttling.states[i].performance?pr->throttling.states[i].performance/10:0)); (pr->throttling.states[i].performance?pr->throttling.states[i].performance/10:0));
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_processor_throttling_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_processor_throttling_seq_show,
PDE(inode)->data);
}
static int static int
acpi_processor_write_throttling ( acpi_processor_write_throttling (
...@@ -2178,53 +2163,38 @@ acpi_processor_write_throttling ( ...@@ -2178,53 +2163,38 @@ acpi_processor_write_throttling (
return_VALUE(count); return_VALUE(count);
} }
static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
static int
acpi_processor_read_limit (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_processor *pr = (struct acpi_processor *) data; struct acpi_processor *pr = (struct acpi_processor *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_processor_read_limit"); ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show");
if (!pr || (off != 0)) if (!pr)
goto end; goto end;
if (!pr->flags.limit) { if (!pr->flags.limit) {
p += sprintf(p, "<not supported>\n"); seq_puts(seq, "<not supported>\n");
goto end; goto end;
} }
p += sprintf(p, "active limit: P%d:T%d\n", seq_printf(seq, "active limit: P%d:T%d\n"
pr->limit.state.px, pr->limit.state.tx); "platform limit: P%d:T0\n"
"user limit: P%d:T%d\n"
p += sprintf(p, "platform limit: P%d:T0\n", "thermal limit: P%d:T%d\n",
pr->flags.performance?pr->performance.platform_limit:0); pr->limit.state.px, pr->limit.state.tx,
pr->flags.performance?pr->performance.platform_limit:0,
p += sprintf(p, "user limit: P%d:T%d\n", pr->limit.user.px, pr->limit.user.tx,
pr->limit.user.px, pr->limit.user.tx); pr->limit.thermal.px, pr->limit.thermal.tx);
p += sprintf(p, "thermal limit: P%d:T%d\n",
pr->limit.thermal.px, pr->limit.thermal.tx);
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_processor_limit_seq_show,
PDE(inode)->data);
}
static int static int
acpi_processor_write_limit ( acpi_processor_write_limit (
...@@ -2304,7 +2274,7 @@ acpi_processor_add_fs ( ...@@ -2304,7 +2274,7 @@ acpi_processor_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_INFO)); ACPI_PROCESSOR_FILE_INFO));
else { else {
entry->read_proc = acpi_processor_read_info; entry->proc_fops = &acpi_processor_info_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -2316,7 +2286,7 @@ acpi_processor_add_fs ( ...@@ -2316,7 +2286,7 @@ acpi_processor_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_POWER)); ACPI_PROCESSOR_FILE_POWER));
else { else {
entry->read_proc = acpi_processor_read_power; entry->proc_fops = &acpi_processor_power_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -2329,7 +2299,7 @@ acpi_processor_add_fs ( ...@@ -2329,7 +2299,7 @@ acpi_processor_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_PERFORMANCE)); ACPI_PROCESSOR_FILE_PERFORMANCE));
else { else {
entry->read_proc = acpi_processor_read_performance; entry->proc_fops = &acpi_processor_perf_fops;
entry->write_proc = acpi_processor_write_performance; entry->write_proc = acpi_processor_write_performance;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -2343,7 +2313,7 @@ acpi_processor_add_fs ( ...@@ -2343,7 +2313,7 @@ acpi_processor_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_THROTTLING)); ACPI_PROCESSOR_FILE_THROTTLING));
else { else {
entry->read_proc = acpi_processor_read_throttling; entry->proc_fops = &acpi_processor_throttling_fops;
entry->write_proc = acpi_processor_write_throttling; entry->write_proc = acpi_processor_write_throttling;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -2356,7 +2326,7 @@ acpi_processor_add_fs ( ...@@ -2356,7 +2326,7 @@ acpi_processor_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_PROCESSOR_FILE_LIMIT)); ACPI_PROCESSOR_FILE_LIMIT));
else { else {
entry->read_proc = acpi_processor_read_limit; entry->proc_fops = &acpi_processor_limit_fops;
entry->write_proc = acpi_processor_write_limit; entry->write_proc = acpi_processor_write_limit;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/seq_file.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/acpi.h> #include <asm/acpi.h>
...@@ -32,8 +33,25 @@ ACPI_MODULE_NAME ("sleep") ...@@ -32,8 +33,25 @@ ACPI_MODULE_NAME ("sleep")
#define ACPI_SYSTEM_FILE_SLEEP "sleep" #define ACPI_SYSTEM_FILE_SLEEP "sleep"
#define ACPI_SYSTEM_FILE_ALARM "alarm" #define ACPI_SYSTEM_FILE_ALARM "alarm"
static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file);
static int acpi_system_alarm_open_fs(struct inode *inode, struct file *file);
static u8 sleep_states[ACPI_S_STATE_COUNT]; static u8 sleep_states[ACPI_S_STATE_COUNT];
static struct file_operations acpi_system_sleep_fops = {
.open = acpi_system_sleep_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_system_alarm_fops = {
.open = acpi_system_alarm_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void static void
acpi_power_off (void) acpi_power_off (void)
{ {
...@@ -271,43 +289,26 @@ acpi_suspend ( ...@@ -271,43 +289,26 @@ acpi_suspend (
return status; return status;
} }
static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset)
static int
acpi_system_read_sleep (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
char *p = page;
int size;
int i; int i;
ACPI_FUNCTION_TRACE("acpi_system_read_sleep"); ACPI_FUNCTION_TRACE("acpi_system_sleep_seq_show");
if (off != 0)
goto end;
for (i = 0; i <= ACPI_STATE_S5; i++) { for (i = 0; i <= ACPI_STATE_S5; i++) {
if (sleep_states[i]) if (sleep_states[i])
p += sprintf(p,"S%d ", i); seq_printf(seq,"S%d ", i);
} }
p += sprintf(p, "\n"); seq_puts(seq, "\n");
end: return 0;
size = (p - page);
if (size <= off+count) *eof = 1;
*start = page + off;
size -= off;
if (size>count) size = count;
if (size<0) size = 0;
return_VALUE(size);
} }
static int acpi_system_sleep_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_system_sleep_seq_show, PDE(inode)->data);
}
static int static int
acpi_system_write_sleep ( acpi_system_write_sleep (
...@@ -349,25 +350,12 @@ acpi_system_write_sleep ( ...@@ -349,25 +350,12 @@ acpi_system_write_sleep (
return_VALUE(count); return_VALUE(count);
} }
static int acpi_system_alarm_seq_show(struct seq_file *seq, void *offset)
static int
acpi_system_read_alarm (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *context)
{ {
char *p = page;
int size = 0;
u32 sec, min, hr; u32 sec, min, hr;
u32 day, mo, yr; u32 day, mo, yr;
ACPI_FUNCTION_TRACE("acpi_system_read_alarm"); ACPI_FUNCTION_TRACE("acpi_system_alarm_seq_show");
if (off != 0)
goto end;
spin_lock(&rtc_lock); spin_lock(&rtc_lock);
...@@ -427,21 +415,19 @@ acpi_system_read_alarm ( ...@@ -427,21 +415,19 @@ acpi_system_read_alarm (
yr += 2000; yr += 2000;
#endif #endif
p += sprintf(p,"%4.4u-", yr); seq_printf(seq,"%4.4u-", yr);
p += (mo > 12) ? sprintf(p, "**-") : sprintf(p, "%2.2u-", mo); (mo > 12) ? seq_puts(seq, "**-") : seq_printf(seq, "%2.2u-", mo);
p += (day > 31) ? sprintf(p, "** ") : sprintf(p, "%2.2u ", day); (day > 31) ? seq_puts(seq, "** ") : seq_printf(seq, "%2.2u ", day);
p += (hr > 23) ? sprintf(p, "**:") : sprintf(p, "%2.2u:", hr); (hr > 23) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", hr);
p += (min > 59) ? sprintf(p, "**:") : sprintf(p, "%2.2u:", min); (min > 59) ? seq_puts(seq, "**:") : seq_printf(seq, "%2.2u:", min);
p += (sec > 59) ? sprintf(p, "**\n") : sprintf(p, "%2.2u\n", sec); (sec > 59) ? seq_puts(seq, "**\n") : seq_printf(seq, "%2.2u\n", sec);
end: return 0;
size = p - page; }
if (size < count) *eof = 1;
else if (size > count) size = count; static int acpi_system_alarm_open_fs(struct inode *inode, struct file *file)
if (size < 0) size = 0; {
*start = page; return single_open(file, acpi_system_alarm_seq_show, PDE(inode)->data);
return_VALUE(size);
} }
...@@ -687,7 +673,7 @@ static int __init acpi_sleep_init(void) ...@@ -687,7 +673,7 @@ static int __init acpi_sleep_init(void)
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_SYSTEM_FILE_SLEEP)); ACPI_SYSTEM_FILE_SLEEP));
else { else {
entry->read_proc = acpi_system_read_sleep; entry->proc_fops = &acpi_system_sleep_fops;
entry->write_proc = acpi_system_write_sleep; entry->write_proc = acpi_system_write_sleep;
} }
...@@ -699,7 +685,7 @@ static int __init acpi_sleep_init(void) ...@@ -699,7 +685,7 @@ static int __init acpi_sleep_init(void)
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_SYSTEM_FILE_ALARM)); ACPI_SYSTEM_FILE_ALARM));
else { else {
entry->read_proc = acpi_system_read_alarm; entry->proc_fops = &acpi_system_alarm_fops;
entry->write_proc = acpi_system_write_alarm; entry->write_proc = acpi_system_write_alarm;
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/seq_file.h>
#include "acpi_bus.h" #include "acpi_bus.h"
#include "acpi_drivers.h" #include "acpi_drivers.h"
...@@ -79,6 +80,11 @@ MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n"); ...@@ -79,6 +80,11 @@ MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
static int acpi_thermal_add (struct acpi_device *device); static int acpi_thermal_add (struct acpi_device *device);
static int acpi_thermal_remove (struct acpi_device *device, int type); static int acpi_thermal_remove (struct acpi_device *device, int type);
static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file);
static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file);
static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file);
static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file);
static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_thermal_driver = { static struct acpi_driver acpi_thermal_driver = {
.name = ACPI_THERMAL_DRIVER_NAME, .name = ACPI_THERMAL_DRIVER_NAME,
...@@ -157,6 +163,40 @@ struct acpi_thermal { ...@@ -157,6 +163,40 @@ struct acpi_thermal {
struct timer_list timer; struct timer_list timer;
}; };
static struct file_operations acpi_thermal_state_fops = {
.open = acpi_thermal_state_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_thermal_temp_fops = {
.open = acpi_thermal_temp_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_thermal_trip_fops = {
.open = acpi_thermal_trip_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_thermal_cooling_fops = {
.open = acpi_thermal_cooling_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations acpi_thermal_polling_fops = {
.open = acpi_thermal_polling_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
Thermal Zone Management Thermal Zone Management
...@@ -720,154 +760,119 @@ acpi_thermal_check ( ...@@ -720,154 +760,119 @@ acpi_thermal_check (
struct proc_dir_entry *acpi_thermal_dir = NULL; struct proc_dir_entry *acpi_thermal_dir = NULL;
static int acpi_thermal_state_seq_show(struct seq_file *seq, void *offset)
static int
acpi_thermal_read_state (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_thermal_read_state"); ACPI_FUNCTION_TRACE("acpi_thermal_state_seq_show");
if (!tz || (off != 0)) if (!tz)
goto end; goto end;
p += sprintf(p, "state: "); seq_puts(seq, "state: ");
if (!tz->state.critical && !tz->state.hot && !tz->state.passive && !tz->state.active) if (!tz->state.critical && !tz->state.hot && !tz->state.passive && !tz->state.active)
p += sprintf(p, "ok\n"); seq_puts(seq, "ok\n");
else { else {
if (tz->state.critical) if (tz->state.critical)
p += sprintf(p, "critical "); seq_puts(seq, "critical ");
if (tz->state.hot) if (tz->state.hot)
p += sprintf(p, "hot "); seq_puts(seq, "hot ");
if (tz->state.passive) if (tz->state.passive)
p += sprintf(p, "passive "); seq_puts(seq, "passive ");
if (tz->state.active) if (tz->state.active)
p += sprintf(p, "active[%d]", tz->state.active_index); seq_printf(seq, "active[%d]", tz->state.active_index);
p += sprintf(p, "\n"); seq_puts(seq, "\n");
} }
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_thermal_state_seq_show, PDE(inode)->data);
}
static int
acpi_thermal_read_temperature ( static int acpi_thermal_temp_seq_show(struct seq_file *seq, void *offset)
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
int result = 0; int result = 0;
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_thermal_read_temperature"); ACPI_FUNCTION_TRACE("acpi_thermal_temp_seq_show");
if (!tz || (off != 0)) if (!tz)
goto end; goto end;
result = acpi_thermal_get_temperature(tz); result = acpi_thermal_get_temperature(tz);
if (result) if (result)
goto end; goto end;
p += sprintf(p, "temperature: %ld C\n", seq_printf(seq, "temperature: %ld C\n",
KELVIN_TO_CELSIUS(tz->temperature)); KELVIN_TO_CELSIUS(tz->temperature));
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_thermal_temp_seq_show, PDE(inode)->data);
}
static int
acpi_thermal_read_trip_points ( static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
char *p = page;
int len = 0;
int i = 0; int i = 0;
int j = 0; int j = 0;
ACPI_FUNCTION_TRACE("acpi_thermal_read_trip_points"); ACPI_FUNCTION_TRACE("acpi_thermal_trip_seq_show");
if (!tz || (off != 0)) if (!tz)
goto end; goto end;
if (tz->trips.critical.flags.valid) if (tz->trips.critical.flags.valid)
p += sprintf(p, "critical (S5): %ld C\n", seq_printf(seq, "critical (S5): %ld C\n",
KELVIN_TO_CELSIUS(tz->trips.critical.temperature)); KELVIN_TO_CELSIUS(tz->trips.critical.temperature));
if (tz->trips.hot.flags.valid) if (tz->trips.hot.flags.valid)
p += sprintf(p, "hot (S4): %ld C\n", seq_printf(seq, "hot (S4): %ld C\n",
KELVIN_TO_CELSIUS(tz->trips.hot.temperature)); KELVIN_TO_CELSIUS(tz->trips.hot.temperature));
if (tz->trips.passive.flags.valid) { if (tz->trips.passive.flags.valid) {
p += sprintf(p, "passive: %ld C: tc1=%lu tc2=%lu tsp=%lu devices=", seq_printf(seq, "passive: %ld C: tc1=%lu tc2=%lu tsp=%lu devices=",
KELVIN_TO_CELSIUS(tz->trips.passive.temperature), KELVIN_TO_CELSIUS(tz->trips.passive.temperature),
tz->trips.passive.tc1, tz->trips.passive.tc1,
tz->trips.passive.tc2, tz->trips.passive.tc2,
tz->trips.passive.tsp); tz->trips.passive.tsp);
for (j=0; j<tz->trips.passive.devices.count; j++) { for (j=0; j<tz->trips.passive.devices.count; j++) {
p += sprintf(p, "0x%p ", tz->trips.passive.devices.handles[j]); seq_printf(seq, "0x%p ", tz->trips.passive.devices.handles[j]);
} }
p += sprintf(p, "\n"); seq_puts(seq, "\n");
} }
for (i=0; i<ACPI_THERMAL_MAX_ACTIVE; i++) { for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
if (!(tz->trips.active[i].flags.valid)) if (!(tz->trips.active[i].flags.valid))
break; break;
p += sprintf(p, "active[%d]: %ld C: devices=", seq_printf(seq, "active[%d]: %ld C: devices=",
i, KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); i, KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
for (j=0; j<tz->trips.active[i].devices.count; j++) for (j = 0; j < tz->trips.active[i].devices.count; j++)
p += sprintf(p, "0x%p ", seq_printf(seq, "0x%p ",
tz->trips.active[i].devices.handles[j]); tz->trips.active[i].devices.handles[j]);
p += sprintf(p, "\n"); seq_puts(seq, "\n");
} }
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_thermal_trip_seq_show, PDE(inode)->data);
}
static int static int
acpi_thermal_write_trip_points ( acpi_thermal_write_trip_points (
...@@ -909,43 +914,32 @@ acpi_thermal_write_trip_points ( ...@@ -909,43 +914,32 @@ acpi_thermal_write_trip_points (
} }
static int static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
acpi_thermal_read_cooling_mode (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_thermal_read_cooling_mode"); ACPI_FUNCTION_TRACE("acpi_thermal_cooling_seq_show");
if (!tz || (off != 0)) if (!tz)
goto end; goto end;
if (!tz->flags.cooling_mode) { if (!tz->flags.cooling_mode) {
p += sprintf(p, "<not supported>\n"); seq_puts(seq, "<not supported>\n");
goto end; goto end;
} }
p += sprintf(p, "cooling mode: %s\n", seq_printf(seq, "cooling mode: %s\n",
tz->cooling_mode?"passive":"active"); tz->cooling_mode?"passive":"active");
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_thermal_cooling_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_thermal_cooling_seq_show,
PDE(inode)->data);
}
static int static int
acpi_thermal_write_cooling_mode ( acpi_thermal_write_cooling_mode (
...@@ -980,43 +974,32 @@ acpi_thermal_write_cooling_mode ( ...@@ -980,43 +974,32 @@ acpi_thermal_write_cooling_mode (
} }
static int static int acpi_thermal_polling_seq_show(struct seq_file *seq, void *offset)
acpi_thermal_read_polling (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
{ {
struct acpi_thermal *tz = (struct acpi_thermal *) data; struct acpi_thermal *tz = (struct acpi_thermal *)seq->private;
char *p = page;
int len = 0;
ACPI_FUNCTION_TRACE("acpi_thermal_read_polling"); ACPI_FUNCTION_TRACE("acpi_thermal_polling_seq_show");
if (!tz || (off != 0)) if (!tz)
goto end; goto end;
if (!tz->polling_frequency) { if (!tz->polling_frequency) {
p += sprintf(p, "<polling disabled>\n"); seq_puts(seq, "<polling disabled>\n");
goto end; goto end;
} }
p += sprintf(p, "polling frequency: %lu seconds\n", seq_printf(seq, "polling frequency: %lu seconds\n",
(tz->polling_frequency / 10)); (tz->polling_frequency / 10));
end: end:
len = (p - page); return 0;
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
} }
static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_thermal_polling_seq_show,
PDE(inode)->data);
}
static int static int
acpi_thermal_write_polling ( acpi_thermal_write_polling (
...@@ -1075,7 +1058,7 @@ acpi_thermal_add_fs ( ...@@ -1075,7 +1058,7 @@ acpi_thermal_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_STATE)); ACPI_THERMAL_FILE_STATE));
else { else {
entry->read_proc = acpi_thermal_read_state; entry->proc_fops = &acpi_thermal_state_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1087,7 +1070,7 @@ acpi_thermal_add_fs ( ...@@ -1087,7 +1070,7 @@ acpi_thermal_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_TEMPERATURE)); ACPI_THERMAL_FILE_TEMPERATURE));
else { else {
entry->read_proc = acpi_thermal_read_temperature; entry->proc_fops = &acpi_thermal_temp_fops;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1099,7 +1082,7 @@ acpi_thermal_add_fs ( ...@@ -1099,7 +1082,7 @@ acpi_thermal_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_POLLING_FREQ)); ACPI_THERMAL_FILE_POLLING_FREQ));
else { else {
entry->read_proc = acpi_thermal_read_trip_points; entry->proc_fops = &acpi_thermal_trip_fops;
entry->write_proc = acpi_thermal_write_trip_points; entry->write_proc = acpi_thermal_write_trip_points;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1112,7 +1095,7 @@ acpi_thermal_add_fs ( ...@@ -1112,7 +1095,7 @@ acpi_thermal_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_COOLING_MODE)); ACPI_THERMAL_FILE_COOLING_MODE));
else { else {
entry->read_proc = acpi_thermal_read_cooling_mode; entry->proc_fops = &acpi_thermal_cooling_fops;
entry->write_proc = acpi_thermal_write_cooling_mode; entry->write_proc = acpi_thermal_write_cooling_mode;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
...@@ -1125,7 +1108,7 @@ acpi_thermal_add_fs ( ...@@ -1125,7 +1108,7 @@ acpi_thermal_add_fs (
"Unable to create '%s' fs entry\n", "Unable to create '%s' fs entry\n",
ACPI_THERMAL_FILE_POLLING_FREQ)); ACPI_THERMAL_FILE_POLLING_FREQ));
else { else {
entry->read_proc = acpi_thermal_read_polling; entry->proc_fops = &acpi_thermal_polling_fops;
entry->write_proc = acpi_thermal_write_polling; entry->write_proc = acpi_thermal_write_polling;
entry->data = acpi_driver_data(device); entry->data = acpi_driver_data(device);
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/version.h> #include <linux/version.h>
#include <acconfig.h> #include <acconfig.h>
...@@ -100,6 +101,47 @@ MODULE_LICENSE("GPL"); ...@@ -100,6 +101,47 @@ MODULE_LICENSE("GPL");
#define HCI_VIDEO_OUT_CRT 0x2 #define HCI_VIDEO_OUT_CRT 0x2
#define HCI_VIDEO_OUT_TV 0x4 #define HCI_VIDEO_OUT_TV 0x4
static int toshiba_lcd_open_fs(struct inode *inode, struct file *file);
static int toshiba_video_open_fs(struct inode *inode, struct file *file);
static int toshiba_fan_open_fs(struct inode *inode, struct file *file);
static int toshiba_keys_open_fs(struct inode *inode, struct file *file);
static int toshiba_version_open_fs(struct inode *inode, struct file *file);
static struct file_operations toshiba_lcd_fops = {
.open = toshiba_lcd_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations toshiba_video_fops = {
.open = toshiba_video_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations toshiba_fan_fops = {
.open = toshiba_fan_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations toshiba_keys_fops = {
.open = toshiba_keys_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static struct file_operations toshiba_version_fops = {
.open = toshiba_version_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* utility /* utility
*/ */
...@@ -126,22 +168,6 @@ snscanf(const char* str, int n, const char* format, ...) ...@@ -126,22 +168,6 @@ snscanf(const char* str, int n, const char* format, ...)
return result; return result;
} }
/* This is the common code at the end of every proc read handler. I don't
* understand it yet.
*/
static int
end_proc_read(const char* p, char* page, off_t off, int count,
char** start, int* eof)
{
int len = (p - page);
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return len;
}
/* acpi interface wrappers /* acpi interface wrappers
*/ */
...@@ -259,29 +285,27 @@ static int key_event_valid; ...@@ -259,29 +285,27 @@ static int key_event_valid;
/* proc file handlers /* proc file handlers
*/ */
static int static int toshiba_lcd_seq_show(struct seq_file *seq, void *offset)
proc_read_lcd(char* page, char** start, off_t off, int count, int* eof,
void* context)
{ {
char* p = page;
u32 hci_result; u32 hci_result;
u32 value; u32 value;
if (off != 0) goto end;
hci_read1(HCI_LCD_BRIGHTNESS, &value, &hci_result); hci_read1(HCI_LCD_BRIGHTNESS, &value, &hci_result);
if (hci_result == HCI_SUCCESS) { if (hci_result == HCI_SUCCESS) {
value = value >> HCI_LCD_BRIGHTNESS_SHIFT; value = value >> HCI_LCD_BRIGHTNESS_SHIFT;
p += sprintf(p, "brightness: %d\n", value); seq_printf(seq, "brightness: %d\n"
p += sprintf(p, "brightness_levels: %d\n", "brightness_levels: %d\n",
HCI_LCD_BRIGHTNESS_LEVELS); value,
} else { HCI_LCD_BRIGHTNESS_LEVELS);
p += sprintf(p, "ERROR\n"); } else
goto end; seq_puts(seq, "ERROR\n");
}
return 0;
}
end: static int toshiba_lcd_open_fs(struct inode *inode, struct file *file)
return end_proc_read(p, page, off, count, start, eof); {
return single_open(file, toshiba_lcd_seq_show, NULL);
} }
static int static int
...@@ -306,31 +330,31 @@ proc_write_lcd(struct file* file, const char* buffer, unsigned long count, ...@@ -306,31 +330,31 @@ proc_write_lcd(struct file* file, const char* buffer, unsigned long count,
return count; return count;
} }
static int static int toshiba_video_seq_show(struct seq_file *seq, void *offset)
proc_read_video(char* page, char** start, off_t off, int count, int* eof,
void* context)
{ {
char* p = page;
u32 hci_result; u32 hci_result;
u32 value; u32 value;
if (off != 0) goto end;
hci_read1(HCI_VIDEO_OUT, &value, &hci_result); hci_read1(HCI_VIDEO_OUT, &value, &hci_result);
if (hci_result == HCI_SUCCESS) { if (hci_result == HCI_SUCCESS) {
int is_lcd = (value & HCI_VIDEO_OUT_LCD) ? 1 : 0; int is_lcd = (value & HCI_VIDEO_OUT_LCD) ? 1 : 0;
int is_crt = (value & HCI_VIDEO_OUT_CRT) ? 1 : 0; int is_crt = (value & HCI_VIDEO_OUT_CRT) ? 1 : 0;
int is_tv = (value & HCI_VIDEO_OUT_TV ) ? 1 : 0; int is_tv = (value & HCI_VIDEO_OUT_TV ) ? 1 : 0;
p += sprintf(p, "lcd_out: %d\n", is_lcd); seq_printf(seq, "lcd_out: %d\n"
p += sprintf(p, "crt_out: %d\n", is_crt); "crt_out: %d\n"
p += sprintf(p, "tv_out: %d\n", is_tv); "tv_out: %d\n",
} else { is_lcd,
p += sprintf(p, "ERROR\n"); is_crt,
goto end; is_tv);
} } else
seq_puts(seq, "ERROR\n");
return 0;
}
end: static int toshiba_video_open_fs(struct inode *inode, struct file *file)
return end_proc_read(p, page, off, count, start, eof); {
return single_open(file, toshiba_video_seq_show, NULL);
} }
static int static int
...@@ -376,27 +400,26 @@ proc_write_video(struct file* file, const char* buffer, unsigned long count, ...@@ -376,27 +400,26 @@ proc_write_video(struct file* file, const char* buffer, unsigned long count,
return count; return count;
} }
static int static int toshiba_fan_seq_show(struct seq_file *seq, void *offset)
proc_read_fan(char* page, char** start, off_t off, int count, int* eof,
void* context)
{ {
char* p = page;
u32 hci_result; u32 hci_result;
u32 value; u32 value;
if (off != 0) goto end;
hci_read1(HCI_FAN, &value, &hci_result); hci_read1(HCI_FAN, &value, &hci_result);
if (hci_result == HCI_SUCCESS) { if (hci_result == HCI_SUCCESS) {
p += sprintf(p, "running: %d\n", (value > 0)); seq_printf(seq, "running: %d\n"
p += sprintf(p, "force_on: %d\n", force_fan); "force_on: %d\n",
} else { (value > 0),
p += sprintf(p, "ERROR\n"); force_fan);
goto end; } else
} seq_puts(seq, "ERROR\n");
return 0;
}
end: static int toshiba_fan_open_fs(struct inode *inode, struct file *file)
return end_proc_read(p, page, off, count, start, eof); {
return single_open(file, toshiba_fan_seq_show, NULL);
} }
static int static int
...@@ -420,16 +443,11 @@ proc_write_fan(struct file* file, const char* buffer, unsigned long count, ...@@ -420,16 +443,11 @@ proc_write_fan(struct file* file, const char* buffer, unsigned long count,
return count; return count;
} }
static int static int toshiba_keys_seq_show(struct seq_file *seq, void *offset)
proc_read_keys(char* page, char** start, off_t off, int count, int* eof,
void* context)
{ {
char* p = page;
u32 hci_result; u32 hci_result;
u32 value; u32 value;
if (off != 0) goto end;
if (!key_event_valid) { if (!key_event_valid) {
hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result); hci_read1(HCI_SYSTEM_EVENT, &value, &hci_result);
if (hci_result == HCI_SUCCESS) { if (hci_result == HCI_SUCCESS) {
...@@ -438,16 +456,23 @@ proc_read_keys(char* page, char** start, off_t off, int count, int* eof, ...@@ -438,16 +456,23 @@ proc_read_keys(char* page, char** start, off_t off, int count, int* eof,
} else if (hci_result == HCI_EMPTY) { } else if (hci_result == HCI_EMPTY) {
/* better luck next time */ /* better luck next time */
} else { } else {
p += sprintf(p, "ERROR\n"); seq_puts(seq, "ERROR\n");
goto end; goto end;
} }
} }
p += sprintf(p, "hotkey_ready: %d\n", key_event_valid); seq_printf(seq, "hotkey_ready: %d\n"
p += sprintf(p, "hotkey: 0x%04x\n", last_key_event); "hotkey: 0x%04x\n",
key_event_valid,
last_key_event);
end: end:
return end_proc_read(p, page, off, count, start, eof); return 0;
}
static int toshiba_keys_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, toshiba_keys_seq_show, NULL);
} }
static int static int
...@@ -466,20 +491,19 @@ proc_write_keys(struct file* file, const char* buffer, unsigned long count, ...@@ -466,20 +491,19 @@ proc_write_keys(struct file* file, const char* buffer, unsigned long count,
return count; return count;
} }
static int static int toshiba_version_seq_show(struct seq_file *seq, void *offset)
proc_read_version(char* page, char** start, off_t off, int count, int* eof,
void* context)
{ {
char* p = page; seq_printf(seq, "driver: %s\n"
"proc_interface: %d\n",
if (off != 0) goto end; TOSHIBA_ACPI_VERSION,
PROC_INTERFACE_VERSION);
p += sprintf(p, "driver: %s\n", TOSHIBA_ACPI_VERSION); return 0;
p += sprintf(p, "proc_interface: %d\n", }
PROC_INTERFACE_VERSION);
end: static int toshiba_version_open_fs(struct inode *inode, struct file *file)
return end_proc_read(p, page, off, count, start, eof); {
return single_open(file, toshiba_version_seq_show, NULL);
} }
/* proc and module init /* proc and module init
...@@ -490,24 +514,38 @@ add_device(void) ...@@ -490,24 +514,38 @@ add_device(void)
{ {
struct proc_dir_entry* proc; struct proc_dir_entry* proc;
proc = create_proc_read_entry(PROC_LCD, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_LCD, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir, proc_read_lcd, 0); toshiba_proc_dir);
if (proc) proc->write_proc = proc_write_lcd; if (proc) {
proc->proc_fops = &toshiba_lcd_fops;
proc->write_proc = proc_write_lcd;
}
proc = create_proc_read_entry(PROC_VIDEO, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_VIDEO, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir, proc_read_video, 0); toshiba_proc_dir);
if (proc) proc->write_proc = proc_write_video; if (proc) {
proc->proc_fops = &toshiba_video_fops;
proc->write_proc = proc_write_video;
}
proc = create_proc_read_entry(PROC_FAN, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_FAN, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir, proc_read_fan, 0); toshiba_proc_dir);
if (proc) proc->write_proc = proc_write_fan; if (proc) {
proc->proc_fops = &toshiba_fan_fops;
proc->write_proc = proc_write_fan;
}
proc = create_proc_read_entry(PROC_KEYS, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_KEYS, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir, proc_read_keys, 0); toshiba_proc_dir);
if (proc) proc->write_proc = proc_write_keys; if (proc) {
proc->proc_fops = &toshiba_keys_fops;
proc->write_proc = proc_write_keys;
}
proc = create_proc_read_entry(PROC_VERSION, S_IFREG | S_IRUGO | S_IWUSR, proc = create_proc_entry(PROC_VERSION, S_IFREG | S_IRUGO | S_IWUSR,
toshiba_proc_dir, proc_read_version, 0); toshiba_proc_dir);
if (proc)
proc->proc_fops = &toshiba_version_fops;
return(AE_OK); return(AE_OK);
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: utcopy - Internal to external object translation utilities * Module Name: utcopy - Internal to external object translation utilities
* $Revision: 105 $ * $Revision: 106 $
* *
*****************************************************************************/ *****************************************************************************/
...@@ -419,7 +419,8 @@ acpi_ut_copy_esimple_to_isimple ( ...@@ -419,7 +419,8 @@ acpi_ut_copy_esimple_to_isimple (
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
internal_object->string.pointer = ACPI_MEM_CALLOCATE ((ACPI_SIZE) external_object->string.length + 1); internal_object->string.pointer =
ACPI_MEM_CALLOCATE ((ACPI_SIZE) external_object->string.length + 1);
if (!internal_object->string.pointer) { if (!internal_object->string.pointer) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
...@@ -434,7 +435,8 @@ acpi_ut_copy_esimple_to_isimple ( ...@@ -434,7 +435,8 @@ acpi_ut_copy_esimple_to_isimple (
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
internal_object->buffer.pointer = ACPI_MEM_CALLOCATE (external_object->buffer.length); internal_object->buffer.pointer =
ACPI_MEM_CALLOCATE (external_object->buffer.length);
if (!internal_object->buffer.pointer) { if (!internal_object->buffer.pointer) {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
...@@ -471,10 +473,10 @@ acpi_ut_copy_esimple_to_isimple ( ...@@ -471,10 +473,10 @@ acpi_ut_copy_esimple_to_isimple (
* FUNCTION: Acpi_ut_copy_epackage_to_ipackage * FUNCTION: Acpi_ut_copy_epackage_to_ipackage
* *
* PARAMETERS: *Internal_object - Pointer to the object we are returning * PARAMETERS: *Internal_object - Pointer to the object we are returning
* *Buffer - Where the object is returned * *Buffer - Where the object is returned
* *Space_used - Where the length of the object is returned * *Space_used - Where the length of the object is returned
* *
* RETURN: Status - the status of the call * RETURN: Status
* *
* DESCRIPTION: This function is called to place a package object in a user * DESCRIPTION: This function is called to place a package object in a user
* buffer. A package object by definition contains other objects. * buffer. A package object by definition contains other objects.
...@@ -607,7 +609,8 @@ acpi_ut_copy_simple_object ( ...@@ -607,7 +609,8 @@ acpi_ut_copy_simple_object (
/* Copy the entire source object over the destination object*/ /* Copy the entire source object over the destination object*/
ACPI_MEMCPY ((char *) dest_desc, (char *) source_desc, sizeof (acpi_operand_object)); ACPI_MEMCPY ((char *) dest_desc, (char *) source_desc,
sizeof (acpi_operand_object));
/* Restore the saved fields */ /* Restore the saved fields */
...@@ -687,26 +690,36 @@ acpi_ut_copy_ielement_to_ielement ( ...@@ -687,26 +690,36 @@ acpi_ut_copy_ielement_to_ielement (
&state->pkg.dest_object->package.elements[this_index]; &state->pkg.dest_object->package.elements[this_index];
switch (object_type) { switch (object_type) {
case 0: case ACPI_COPY_TYPE_SIMPLE:
/* /* A null source object indicates a (legal) null package element */
* This is a simple object, just copy it
*/
target_object = acpi_ut_create_internal_object (ACPI_GET_OBJECT_TYPE (source_object));
if (!target_object) {
return (AE_NO_MEMORY);
}
status = acpi_ut_copy_simple_object (source_object, target_object); if (source_object) {
if (ACPI_FAILURE (status)) { /*
return (status); * This is a simple object, just copy it
*/
target_object = acpi_ut_create_internal_object (
ACPI_GET_OBJECT_TYPE (source_object));
if (!target_object) {
return (AE_NO_MEMORY);
}
status = acpi_ut_copy_simple_object (source_object, target_object);
if (ACPI_FAILURE (status)) {
return (status);
}
*this_target_ptr = target_object;
} }
else {
/* Pass through a null element */
*this_target_ptr = target_object; *this_target_ptr = NULL;
}
break; break;
case 1: case ACPI_COPY_TYPE_PACKAGE:
/* /*
* This object is a package - go down another nesting level * This object is a package - go down another nesting level
...@@ -720,6 +733,17 @@ acpi_ut_copy_ielement_to_ielement ( ...@@ -720,6 +733,17 @@ acpi_ut_copy_ielement_to_ielement (
target_object->package.count = source_object->package.count; target_object->package.count = source_object->package.count;
target_object->common.flags = source_object->common.flags; target_object->common.flags = source_object->common.flags;
/*
* Create the object array
*/
target_object->package.elements =
ACPI_MEM_CALLOCATE (((ACPI_SIZE) source_object->package.count + 1) *
sizeof (void *));
if (!target_object->package.elements) {
ACPI_MEM_FREE (target_object);
return (AE_NO_MEMORY);
}
/* /*
* Pass the new package object back to the package walk routine * Pass the new package object back to the package walk routine
*/ */
......
/******************************************************************************* /*******************************************************************************
* *
* Module Name: utmisc - common utility procedures * Module Name: utmisc - common utility procedures
* $Revision: 86 $ * $Revision: 87 $
* *
******************************************************************************/ ******************************************************************************/
...@@ -475,7 +475,6 @@ acpi_ut_strupr ( ...@@ -475,7 +475,6 @@ acpi_ut_strupr (
string++; string++;
} }
return (src_string); return (src_string);
} }
...@@ -575,7 +574,6 @@ acpi_ut_create_mutex ( ...@@ -575,7 +574,6 @@ acpi_ut_create_mutex (
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
if (!acpi_gbl_acpi_mutex_info[mutex_id].mutex) { if (!acpi_gbl_acpi_mutex_info[mutex_id].mutex) {
status = acpi_os_create_semaphore (1, 1, status = acpi_os_create_semaphore (1, 1,
&acpi_gbl_acpi_mutex_info[mutex_id].mutex); &acpi_gbl_acpi_mutex_info[mutex_id].mutex);
...@@ -613,7 +611,6 @@ acpi_ut_delete_mutex ( ...@@ -613,7 +611,6 @@ acpi_ut_delete_mutex (
return_ACPI_STATUS (AE_BAD_PARAMETER); return_ACPI_STATUS (AE_BAD_PARAMETER);
} }
status = acpi_os_delete_semaphore (acpi_gbl_acpi_mutex_info[mutex_id].mutex); status = acpi_os_delete_semaphore (acpi_gbl_acpi_mutex_info[mutex_id].mutex);
acpi_gbl_acpi_mutex_info[mutex_id].mutex = NULL; acpi_gbl_acpi_mutex_info[mutex_id].mutex = NULL;
...@@ -651,7 +648,6 @@ acpi_ut_acquire_mutex ( ...@@ -651,7 +648,6 @@ acpi_ut_acquire_mutex (
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
this_thread_id = acpi_os_get_thread_id (); this_thread_id = acpi_os_get_thread_id ();
/* /*
...@@ -679,7 +675,6 @@ acpi_ut_acquire_mutex ( ...@@ -679,7 +675,6 @@ acpi_ut_acquire_mutex (
} }
} }
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
"Thread %X attempting to acquire Mutex [%s]\n", "Thread %X attempting to acquire Mutex [%s]\n",
this_thread_id, acpi_ut_get_mutex_name (mutex_id))); this_thread_id, acpi_ut_get_mutex_name (mutex_id)));
...@@ -693,7 +688,6 @@ acpi_ut_acquire_mutex ( ...@@ -693,7 +688,6 @@ acpi_ut_acquire_mutex (
acpi_gbl_acpi_mutex_info[mutex_id].use_count++; acpi_gbl_acpi_mutex_info[mutex_id].use_count++;
acpi_gbl_acpi_mutex_info[mutex_id].owner_id = this_thread_id; acpi_gbl_acpi_mutex_info[mutex_id].owner_id = this_thread_id;
} }
else { else {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n",
this_thread_id, acpi_ut_get_mutex_name (mutex_id), this_thread_id, acpi_ut_get_mutex_name (mutex_id),
...@@ -737,7 +731,6 @@ acpi_ut_release_mutex ( ...@@ -737,7 +731,6 @@ acpi_ut_release_mutex (
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
/* /*
* Mutex must be acquired in order to release it! * Mutex must be acquired in order to release it!
*/ */
...@@ -749,7 +742,6 @@ acpi_ut_release_mutex ( ...@@ -749,7 +742,6 @@ acpi_ut_release_mutex (
return (AE_NOT_ACQUIRED); return (AE_NOT_ACQUIRED);
} }
/* /*
* Deadlock prevention. Check if this thread owns any mutexes of value * Deadlock prevention. Check if this thread owns any mutexes of value
* greater than this one. If so, the thread has violated the mutex * greater than this one. If so, the thread has violated the mutex
...@@ -770,7 +762,6 @@ acpi_ut_release_mutex ( ...@@ -770,7 +762,6 @@ acpi_ut_release_mutex (
} }
} }
/* Mark unlocked FIRST */ /* Mark unlocked FIRST */
acpi_gbl_acpi_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED; acpi_gbl_acpi_mutex_info[mutex_id].owner_id = ACPI_MUTEX_NOT_ACQUIRED;
...@@ -828,7 +819,6 @@ acpi_ut_create_update_state_and_push ( ...@@ -828,7 +819,6 @@ acpi_ut_create_update_state_and_push (
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
acpi_ut_push_generic_state (state_list, state); acpi_ut_push_generic_state (state_list, state);
return (AE_OK); return (AE_OK);
} }
...@@ -866,7 +856,6 @@ acpi_ut_create_pkg_state_and_push ( ...@@ -866,7 +856,6 @@ acpi_ut_create_pkg_state_and_push (
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
acpi_ut_push_generic_state (state_list, state); acpi_ut_push_generic_state (state_list, state);
return (AE_OK); return (AE_OK);
} }
...@@ -1129,7 +1118,6 @@ acpi_ut_create_control_state ( ...@@ -1129,7 +1118,6 @@ acpi_ut_create_control_state (
return_PTR (NULL); return_PTR (NULL);
} }
/* Init fields specific to the control struct */ /* Init fields specific to the control struct */
state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL; state->common.data_type = ACPI_DESC_TYPE_STATE_CONTROL;
...@@ -1224,6 +1212,8 @@ acpi_ut_walk_package_tree ( ...@@ -1224,6 +1212,8 @@ acpi_ut_walk_package_tree (
} }
while (state) { while (state) {
/* Get one element of the package */
this_index = state->pkg.index; this_index = state->pkg.index;
this_source_obj = (acpi_operand_object *) this_source_obj = (acpi_operand_object *)
state->pkg.source_object->package.elements[this_index]; state->pkg.source_object->package.elements[this_index];
...@@ -1324,6 +1314,7 @@ acpi_ut_generate_checksum ( ...@@ -1324,6 +1314,7 @@ acpi_ut_generate_checksum (
u32 i; u32 i;
signed char sum = 0; signed char sum = 0;
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
sum = (signed char) (sum + buffer[i]); sum = (signed char) (sum + buffer[i]);
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/errno.h>
#include "cpu_buffer.h" #include "cpu_buffer.h"
#include "oprof.h" #include "oprof.h"
......
...@@ -6,13 +6,14 @@ ...@@ -6,13 +6,14 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/signal.h>
#include <asm/arch/assabet.h> #include <asm/arch/assabet.h>
#include "sa1100_generic.h" #include "sa1100_generic.h"
......
...@@ -31,40 +31,41 @@ ...@@ -31,40 +31,41 @@
* *
* PCM Vcc: * PCM Vcc:
* *
* PCM Vcc on BadgePAD 4 can be jumpered for 3.3V (short pins 1 and 3 * PCM Vcc on BadgePAD 4 can be jumpered for 3v3 (short pins 1 and 3
* on JP6) or 5V (short pins 3 and 5 on JP6). N.B., 5V supply rail * on JP6) or 5v0 (short pins 3 and 5 on JP6).
* is enabled by the SA-1110's BADGE4_GPIO_PCMEN5V (GPIO 24).
* *
* PCM Vpp: * PCM Vpp:
* *
* PCM Vpp on BadgePAD 4 can be jumpered for 12V (short pins 2 and 4 * PCM Vpp on BadgePAD 4 can be jumpered for 12v0 (short pins 4 and 6
* on JP6) or tied to PCM Vcc (short pins 4 and 6 on JP6). N.B., 12V * on JP6) or tied to PCM Vcc (short pins 2 and 4 on JP6). N.B.,
* operation requires that the power supply actually supply 12V. * 12v0 operation requires that the power supply actually supply 12v0
* via pin 7 of JP7.
* *
* CF Vcc: * CF Vcc:
* *
* CF Vcc on BadgePAD 4 can be jumpered either for 3.3V (short pins 1 * CF Vcc on BadgePAD 4 can be jumpered either for 3v3 (short pins 1
* and 2 on JP10) or 5V (short pins 2 and 3 on JP10). The note above * and 2 on JP10) or 5v0 (short pins 2 and 3 on JP10).
* about the 5V supply rail applies.
* *
* There's no way programmatically to determine how a given board is * Unfortunately there's no way programmatically to determine how a
* jumpered. This code assumes a default jumpering: 5V PCM Vcc (pins * given board is jumpered. This code assumes a default jumpering
* 3 and 5 shorted) and PCM Vpp = PCM Vcc (pins 4 and 6 shorted) and * as described below.
* no jumpering for CF Vcc. If this isn't correct, Override these *
* defaults with a pcmv setup argument: pcmv=<pcm vcc>,<pcm vpp>,<cf * If the defaults aren't correct, you may override them with a pcmv
* vcc>. E.g. pcmv=33,120,50 indicates 3.3V PCM Vcc, 12.0V PCM Vpp, * setup argument: pcmv=<pcm vcc>,<pcm vpp>,<cf vcc>. The units are
* and 5.0V CF Vcc. * tenths of volts; e.g. pcmv=33,120,50 indicates 3v3 PCM Vcc, 12v0
* PCM Vpp, and 5v0 CF Vcc.
* *
*/ */
static int badge4_pcmvcc = 50; static int badge4_pcmvcc = 50; /* pins 3 and 5 jumpered on JP6 */
static int badge4_pcmvpp = 50; static int badge4_pcmvpp = 50; /* pins 2 and 4 jumpered on JP6 */
static int badge4_cfvcc = 33; static int badge4_cfvcc = 33; /* pins 1 and 2 jumpered on JP10 */
static int badge4_pcmcia_init(struct pcmcia_init *init) static int badge4_pcmcia_init(struct pcmcia_init *init)
{ {
printk(KERN_INFO __FUNCTION__ printk(KERN_INFO
": badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n",
__FUNCTION__,
badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc);
return sa1111_pcmcia_init(init); return sa1111_pcmcia_init(init);
...@@ -74,7 +75,7 @@ static int badge4_pcmcia_shutdown(void) ...@@ -74,7 +75,7 @@ static int badge4_pcmcia_shutdown(void)
{ {
int rc = sa1111_pcmcia_shutdown(); int rc = sa1111_pcmcia_shutdown();
/* be sure to disable 5V use */ /* be sure to disable 5v0 use */
badge4_set_5V(BADGE4_5V_PCMCIA_SOCK0, 0); badge4_set_5V(BADGE4_5V_PCMCIA_SOCK0, 0);
badge4_set_5V(BADGE4_5V_PCMCIA_SOCK1, 0); badge4_set_5V(BADGE4_5V_PCMCIA_SOCK1, 0);
...@@ -105,7 +106,8 @@ badge4_pcmcia_configure_socket(const struct pcmcia_configure *conf) ...@@ -105,7 +106,8 @@ badge4_pcmcia_configure_socket(const struct pcmcia_configure *conf)
(conf->vcc != badge4_pcmvcc)) { (conf->vcc != badge4_pcmvcc)) {
complain_about_jumpering(__FUNCTION__, "pcmvcc", complain_about_jumpering(__FUNCTION__, "pcmvcc",
badge4_pcmvcc, conf->vcc); badge4_pcmvcc, conf->vcc);
return -1; // Apply power regardless of the jumpering.
// return -1;
} }
if ((conf->vpp != 0) && if ((conf->vpp != 0) &&
(conf->vpp != badge4_pcmvpp)) { (conf->vpp != badge4_pcmvpp)) {
...@@ -156,7 +158,7 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { ...@@ -156,7 +158,7 @@ static struct pcmcia_low_level badge4_pcmcia_ops = {
.socket_suspend = sa1111_pcmcia_socket_suspend, .socket_suspend = sa1111_pcmcia_socket_suspend,
}; };
int __init pcmcia_badge4_init(void) int pcmcia_badge4_init(void)
{ {
int ret = -ENODEV; int ret = -ENODEV;
...@@ -166,7 +168,7 @@ int __init pcmcia_badge4_init(void) ...@@ -166,7 +168,7 @@ int __init pcmcia_badge4_init(void)
return ret; return ret;
} }
void __exit pcmcia_badge4_exit(void) void __devexit pcmcia_badge4_exit(void)
{ {
sa1100_unregister_pcmcia(&badge4_pcmcia_ops); sa1100_unregister_pcmcia(&badge4_pcmcia_ops);
} }
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -55,8 +55,6 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e ...@@ -55,8 +55,6 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e
unsigned long cardaddr, address; unsigned long cardaddr, address;
int port; int port;
ecard_claim (ec);
info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL); info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -64,6 +62,8 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e ...@@ -64,6 +62,8 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e
memset(info, 0, sizeof(struct serial_card_info)); memset(info, 0, sizeof(struct serial_card_info));
info->num_ports = type->num_ports; info->num_ports = type->num_ports;
ecard_set_drvdata(ec, info);
cardaddr = ecard_address(ec, type->type, type->speed); cardaddr = ecard_address(ec, type->type, type->speed);
for (port = 0; port < info->num_ports; port ++) { for (port = 0; port < info->num_ports; port ++) {
...@@ -98,8 +98,6 @@ static void __devexit serial_card_remove(struct expansion_card *ec) ...@@ -98,8 +98,6 @@ static void __devexit serial_card_remove(struct expansion_card *ec)
} }
kfree(info); kfree(info);
ecard_release(ec);
} }
static struct serial_card_type atomwide_type = { static struct serial_card_type atomwide_type = {
......
...@@ -365,7 +365,7 @@ config SERIAL_SUNSAB ...@@ -365,7 +365,7 @@ config SERIAL_SUNSAB
config V850E_NB85E_UART config V850E_NB85E_UART
bool "NEC V850E on-chip UART support" bool "NEC V850E on-chip UART support"
depends on V850E_NB85E || V850E2_ANNA depends on V850E_NB85E || V850E2_ANNA || V850E_AS85EP1
default y default y
config V850E_NB85E_UART_CONSOLE config V850E_NB85E_UART_CONSOLE
......
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
/* Initial UART state. This may be overridden by machine-dependent headers. */ /* Initial UART state. This may be overridden by machine-dependent headers. */
#ifndef NB85E_UART_INIT_BAUD #ifndef NB85E_UART_INIT_BAUD
#define NB85E_UART_INIT_BAUD 38400 #define NB85E_UART_INIT_BAUD 115200
#endif #endif
#ifndef NB85E_UART_INIT_CFLAGS #ifndef NB85E_UART_INIT_CFLAGS
#define NB85E_UART_INIT_CFLAGS (B38400 | CS8 | CREAD) #define NB85E_UART_INIT_CFLAGS (B115200 | CS8 | CREAD)
#endif #endif
/* A string used for prefixing printed descriptions; since the same UART /* A string used for prefixing printed descriptions; since the same UART
...@@ -304,7 +304,7 @@ void nb85e_uart_tx (struct uart_port *port) ...@@ -304,7 +304,7 @@ void nb85e_uart_tx (struct uart_port *port)
port->icount.tx++; port->icount.tx++;
if (uart_circ_chars_pending (xmit) < WAKEUP_CHARS) if (uart_circ_chars_pending (xmit) < WAKEUP_CHARS)
uart_event (port, EVT_WRITE_WAKEUP); uart_write_wakeup (port);
} }
no_xmit: no_xmit:
......
...@@ -42,6 +42,6 @@ ide_init_default_hwifs(void) ...@@ -42,6 +42,6 @@ ide_init_default_hwifs(void)
ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL); ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
hw.irq = 14; hw.irq = 14;
ide_register_hw(&hw); ide_register_hw(&hw,NULL);
} }
...@@ -7,5 +7,6 @@ ...@@ -7,5 +7,6 @@
#define NR_IRQS 16 #define NR_IRQS 16
#define IRQ_ISA_KEYBOARD 1 #define IRQ_ISA_KEYBOARD 1
#define RTC_IRQ 8
#define AUX_IRQ 12 #define AUX_IRQ 12
#define IRQ_HARDDISK 14 #define IRQ_HARDDISK 14
...@@ -38,6 +38,4 @@ ...@@ -38,6 +38,4 @@
#define __bus_to_virt__is_a_macro #define __bus_to_virt__is_a_macro
#define __bus_to_virt(x) __phys_to_virt(x) #define __bus_to_virt(x) __phys_to_virt(x)
#define isa_virt_to_bus virt_to_bus
#endif #endif
...@@ -3,3 +3,5 @@ ...@@ -3,3 +3,5 @@
* *
* by Alexander Schulz * by Alexander Schulz
*/ */
#define CLOCK_TICK_RATE 1193180
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define ELF_THUMB_OK(x) \ #define ELF_THUMB_OK(x) \
(( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1) || \ (( (elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 1) == 1) || \
(!(elf_hwcap & HWCAP_THUMB) && ((x)->e_entry & 3) == 0)) ((x)->e_entry & 3) == 0)
#define ELF_26BIT_OK(x) \ #define ELF_26BIT_OK(x) \
(( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \ (( (elf_hwcap & HWCAP_26BIT) && (x)->e_flags & EF_ARM_APCS26) || \
......
#ifdef _ASMARM_SUSPEND_H #ifndef _ASMARM_SUSPEND_H
#define _ASMARM_SUSPEND_H #define _ASMARM_SUSPEND_H
#endif #endif
...@@ -127,6 +127,22 @@ extern void anna_uart_pre_configure (unsigned chan, ...@@ -127,6 +127,22 @@ extern void anna_uart_pre_configure (unsigned chan,
unsigned cflags, unsigned baud); unsigned cflags, unsigned baud);
#endif #endif
/* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */
/* CTS for UART channel 1 is pin P37 (bit 7 of port 3). */
#define NB85E_UART_CTS(chan) ((chan) == 1 ? !(ANNA_PORT_IO(3) & 0x80) : 1)
/* RTS for UART channel 1 is pin P07 (bit 7 of port 0). */
#define NB85E_UART_SET_RTS(chan, val) \
do { \
if (chan == 1) { \
unsigned old = ANNA_PORT_IO(0); \
if (val) \
ANNA_PORT_IO(0) = old & ~0x80; \
else \
ANNA_PORT_IO(0) = old | 0x80; \
} \
} while (0)
/* Timer C details. */ /* Timer C details. */
#define NB85E_TIMER_C_BASE_ADDR 0xFFFFF600 #define NB85E_TIMER_C_BASE_ADDR 0xFFFFF600
......
/*
* include/asm-v850/as85ep1.h -- AS85EP1 evaluation CPU chip/board
*
* Copyright (C) 2001,2002 NEC Corporation
* Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
* archive for more details.
*
* Written by Miles Bader <miles@gnu.org>
*/
#ifndef __V850_AS85EP1_H__
#define __V850_AS85EP1_H__
#define CPU_ARCH "v850e"
#define CPU_MODEL "as85ep1"
#define CPU_MODEL_LONG "NEC V850E/AS85EP1"
#define PLATFORM "AS85EP1"
#define PLATFORM_LONG "NEC V850E/AS85EP1 evaluation board"
#define CPU_CLOCK_FREQ 96000000 /* 96MHz */
#define SYS_CLOCK_FREQ CPU_CLOCK_FREQ
/* 1MB of static RAM. */
#define SRAM_ADDR 0x00400000
#define SRAM_SIZE 0x00100000 /* 1MB */
/* About 58MB of DRAM. This can actually be at one of two positions,
determined by jump JP3; we have to use the first position because the
second is partially out of processor instruction addressing range
(though in the second position there's actually 64MB available). */
#define SDRAM_ADDR 0x00600000
#define SDRAM_SIZE 0x039F8000 /* approx 58MB */
/* For <asm/page.h> */
#define PAGE_OFFSET SRAM_ADDR
/* We use on-chip RAM, for a few miscellaneous variables that must be
accessible using a load instruction relative to R0. The AS85EP1 chip
16K of internal RAM located slightly before I/O space. */
#define R0_RAM_ADDR 0xFFFF8000
/* AS85EP1 specific control registers. */
#define AS85EP1_CSC_ADDR(n) (0xFFFFF060 + (n) * 2)
#define AS85EP1_CSC(n) (*(volatile u16 *)AS85EP1_CSC_ADDR(n))
#define AS85EP1_BSC_ADDR 0xFFFFF066
#define AS85EP1_BSC (*(volatile u16 *)AS85EP1_BSC_ADDR)
#define AS85EP1_BCT_ADDR(n) (0xFFFFF480 + (n) * 2)
#define AS85EP1_BCT(n) (*(volatile u16 *)AS85EP1_BCT_ADDR(n))
#define AS85EP1_DWC_ADDR(n) (0xFFFFF484 + (n) * 2)
#define AS85EP1_DWC(n) (*(volatile u16 *)AS85EP1_DWC_ADDR(n))
#define AS85EP1_BCC_ADDR 0xFFFFF488
#define AS85EP1_BCC (*(volatile u16 *)AS85EP1_BCC_ADDR)
#define AS85EP1_ASC_ADDR 0xFFFFF48A
#define AS85EP1_ASC (*(volatile u16 *)AS85EP1_ASC_ADDR)
#define AS85EP1_BCP_ADDR 0xFFFFF48C
#define AS85EP1_BCP (*(volatile u16 *)AS85EP1_BCP_ADDR)
#define AS85EP1_LBS_ADDR 0xFFFFF48E
#define AS85EP1_LBS (*(volatile u16 *)AS85EP1_LBS_ADDR)
#define AS85EP1_BMC_ADDR 0xFFFFF498
#define AS85EP1_BMC (*(volatile u16 *)AS85EP1_BMC_ADDR)
#define AS85EP1_PRC_ADDR 0xFFFFF49A
#define AS85EP1_PRC (*(volatile u16 *)AS85EP1_PRC_ADDR)
#define AS85EP1_SCR_ADDR(n) (0xFFFFF4A0 + (n) * 4)
#define AS85EP1_SCR(n) (*(volatile u16 *)AS85EP1_SCR_ADDR(n))
#define AS85EP1_RFS_ADDR(n) (0xFFFFF4A2 + (n) * 4)
#define AS85EP1_RFS(n) (*(volatile u16 *)AS85EP1_RFS_ADDR(n))
#define AS85EP1_IRAMM_ADDR 0xFFFFF80A
#define AS85EP1_IRAMM (*(volatile u8 *)AS85EP1_IRAMM_ADDR)
/* I/O port P0-P13. */
/* Direct I/O. Bits 0-7 are pins Pn0-Pn7. */
#define AS85EP1_PORT_IO_ADDR(n) (0xFFFFF400 + (n) * 2)
#define AS85EP1_PORT_IO(n) (*(volatile u8 *)AS85EP1_PORT_IO_ADDR(n))
/* Port mode (for direct I/O, 0 = output, 1 = input). */
#define AS85EP1_PORT_PM_ADDR(n) (0xFFFFF420 + (n) * 2)
#define AS85EP1_PORT_PM(n) (*(volatile u8 *)AS85EP1_PORT_PM_ADDR(n))
/* Port mode control (0 = direct I/O mode, 1 = alternative I/O mode). */
#define AS85EP1_PORT_PMC_ADDR(n) (0xFFFFF440 + (n) * 2)
#define AS85EP1_PORT_PMC(n) (*(volatile u8 *)AS85EP1_PORT_PMC_ADDR(n))
/* NB85E-style interrupt system. */
#include <asm/nb85e_intc.h>
/* Hardware-specific interrupt numbers (in the kernel IRQ namespace). */
#define IRQ_INTCCC(n) (0x0C + (n))
#define IRQ_INTCCC_NUM 8
#define IRQ_INTCMD(n) (0x14 + (n)) /* interval timer interrupts 0-5 */
#define IRQ_INTCMD_NUM 6
#define IRQ_INTSRE(n) (0x1E + (n)*3) /* UART 0-1 reception error */
#define IRQ_INTSRE_NUM 2
#define IRQ_INTSR(n) (0x1F + (n)*3) /* UART 0-1 reception completion */
#define IRQ_INTSR_NUM 2
#define IRQ_INTST(n) (0x20 + (n)*3) /* UART 0-1 transmission completion */
#define IRQ_INTST_NUM 2
#define NUM_CPU_IRQS 64
#ifndef __ASSEMBLY__
/* Initialize chip interrupts. */
extern void as85ep1_init_irqs (void);
#endif
/* AS85EP1 UART details (basically the same as the V850E/MA1, but 2 channels). */
#define NB85E_UART_NUM_CHANNELS 2
#define NB85E_UART_BASE_FREQ (SYS_CLOCK_FREQ / 4)
#define NB85E_UART_CHIP_NAME "V850E/NA85E"
/* This is a function that gets called before configuring the UART. */
#define NB85E_UART_PRE_CONFIGURE as85ep1_uart_pre_configure
#ifndef __ASSEMBLY__
extern void as85ep1_uart_pre_configure (unsigned chan,
unsigned cflags, unsigned baud);
#endif
/* This board supports RTS/CTS for the on-chip UART, but only for channel 1. */
/* CTS for UART channel 1 is pin P54 (bit 4 of port 5). */
#define NB85E_UART_CTS(chan) ((chan) == 1 ? !(AS85EP1_PORT_IO(5) & 0x10) : 1)
/* RTS for UART channel 1 is pin P53 (bit 3 of port 5). */
#define NB85E_UART_SET_RTS(chan, val) \
do { \
if (chan == 1) { \
unsigned old = AS85EP1_PORT_IO(5); \
if (val) \
AS85EP1_PORT_IO(5) = old & ~0x8; \
else \
AS85EP1_PORT_IO(5) = old | 0x8; \
} \
} while (0)
/* Timer C details. */
#define NB85E_TIMER_C_BASE_ADDR 0xFFFFF600
/* Timer D details (the AS85EP1 actually has 5 of these; should change later). */
#define NB85E_TIMER_D_BASE_ADDR 0xFFFFF540
#define NB85E_TIMER_D_TMD_BASE_ADDR (NB85E_TIMER_D_BASE_ADDR + 0x0)
#define NB85E_TIMER_D_CMD_BASE_ADDR (NB85E_TIMER_D_BASE_ADDR + 0x2)
#define NB85E_TIMER_D_TMCD_BASE_ADDR (NB85E_TIMER_D_BASE_ADDR + 0x4)
#define NB85E_TIMER_D_BASE_FREQ SYS_CLOCK_FREQ
#define NB85E_TIMER_D_TMCD_CS_MIN 2 /* min 2^2 divider */
/* For <asm/param.h> */
#ifndef HZ
#define HZ 100
#endif
#endif /* __V850_AS85EP1_H__ */
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
.globl name; \ .globl name; \
.type name,@function; \ .type name,@function; \
name name
#define G_DATA(name) \
.globl name; \
.type name,@object; \
name
#define END(name) \ #define END(name) \
.size name,.-name .size name,.-name
...@@ -23,3 +27,6 @@ ...@@ -23,3 +27,6 @@
.align 4; \ .align 4; \
.type name,@function; \ .type name,@function; \
name name
#define L_DATA(name) \
.type name,@object; \
name
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#define C_SYMBOL_NAME(name) macrology_paste(_, name) #define C_SYMBOL_NAME(name) macrology_paste(_, name)
#define C_SYMBOL_STRING(name) macrology_stringify(C_SYMBOL_NAME(name)) #define C_SYMBOL_STRING(name) macrology_stringify(C_SYMBOL_NAME(name))
#define C_ENTRY(name) G_ENTRY(C_SYMBOL_NAME(name)) #define C_ENTRY(name) G_ENTRY(C_SYMBOL_NAME(name))
#define C_DATA(name) G_DATA(C_SYMBOL_NAME(name))
#define C_END(name) END(C_SYMBOL_NAME(name)) #define C_END(name) END(C_SYMBOL_NAME(name))
#endif /* __V850_CLINKAGE_H__ */ #endif /* __V850_CLINKAGE_H__ */
...@@ -19,7 +19,8 @@ typedef struct user_fpu_struct elf_fpregset_t; ...@@ -19,7 +19,8 @@ typedef struct user_fpu_struct elf_fpregset_t;
/* /*
* This is used to ensure we don't load something for the wrong architecture. * This is used to ensure we don't load something for the wrong architecture.
*/ */
#define elf_check_arch(x) ( (x)->e_machine == EM_CYGNUS_V850 ) #define elf_check_arch(x) \
((x)->e_machine == EM_V850 || (x)->e_machine == EM_CYGNUS_V850)
/* /*
* These are used to set parameters in the core dumps. * These are used to set parameters in the core dumps.
......
...@@ -19,8 +19,11 @@ ...@@ -19,8 +19,11 @@
#include <asm/clinkage.h> #include <asm/clinkage.h>
#define CPU_ARCH "v850e2" #define CPU_ARCH "v850e2"
#define CPU_MODEL "FPGA NA85E2C/V850E2" #define CPU_MODEL "v850e2/fpga85e2c"
#define CPU_MODEL_LONG "NEC V850E2/NA85E2C"
#define PLATFORM "fpga85e2c"
#define PLATFORM_LONG "NA85E2C FPGA implementation"
/* `external ram'. */ /* `external ram'. */
......
...@@ -65,7 +65,7 @@ extern void gbus_int_disable_irq (unsigned irq); ...@@ -65,7 +65,7 @@ extern void gbus_int_disable_irq (unsigned irq);
/* Return true if interrupt handling for interrupt IRQ is enabled. */ /* Return true if interrupt handling for interrupt IRQ is enabled. */
extern int gbus_int_irq_enabled (unsigned irq); extern int gbus_int_irq_enabled (unsigned irq);
/* Disable all GBUS irqs. */ /* Disable all GBUS irqs. */
extern int gbus_int_disable_irqs (void); extern void gbus_int_disable_irqs (void);
/* Clear any pending interrupts for IRQ. */ /* Clear any pending interrupts for IRQ. */
extern void gbus_int_clear_pending_irq (unsigned irq); extern void gbus_int_clear_pending_irq (unsigned irq);
/* Return true if interrupt IRQ is pending (but disabled). */ /* Return true if interrupt IRQ is pending (but disabled). */
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/cache.h>
typedef struct { typedef struct {
unsigned int __softirq_pending; unsigned int __softirq_pending;
......
...@@ -52,6 +52,17 @@ typedef void (*irq_handler_t)(int irq, void *data, struct pt_regs *regs); ...@@ -52,6 +52,17 @@ typedef void (*irq_handler_t)(int irq, void *data, struct pt_regs *regs);
interrupt. */ interrupt. */
extern unsigned int handle_irq (int irq, struct pt_regs *regs); extern unsigned int handle_irq (int irq, struct pt_regs *regs);
/* Enable interrupt handling on an irq. */
extern void enable_irq(unsigned int irq);
/* Disable an irq and wait for completion. */
extern void disable_irq (unsigned int irq);
/* Disable an irq without waiting. */
extern void disable_irq_nosync (unsigned int irq);
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __V850_IRQ_H__ */ #endif /* __V850_IRQ_H__ */
...@@ -24,10 +24,13 @@ ...@@ -24,10 +24,13 @@
#include <asm/teg.h> #include <asm/teg.h>
#endif #endif
/* Anna is both a chip _and_ a platform, so put it in the middle... */ /* These are both chips _and_ platforms, so put them in the middle... */
#ifdef CONFIG_V850E2_ANNA #ifdef CONFIG_V850E2_ANNA
#include <asm/anna.h> #include <asm/anna.h>
#endif #endif
#ifdef CONFIG_V850E_AS85EP1
#include <asm/as85ep1.h>
#endif
/* platforms */ /* platforms */
#ifdef CONFIG_RTE_CB_MA1 #ifdef CONFIG_RTE_CB_MA1
......
...@@ -3,20 +3,40 @@ ...@@ -3,20 +3,40 @@
* *
* Copyright (C) 2001,02 NEC Corporation * Copyright (C) 2001,02 NEC Corporation
* Copyright (C) 2001,02 Miles Bader <miles@gnu.org> * Copyright (C) 2001,02 Miles Bader <miles@gnu.org>
* Copyright (C) 2001 Rusty Russell
* *
* This file is subject to the terms and conditions of the GNU General * This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this * Public License. See the file COPYING in the main directory of this
* archive for more details. * archive for more details.
* *
* Written by Miles Bader <miles@gnu.org> * Written by Miles Bader <miles@gnu.org>
*
* Derived in part from include/asm-ppc/module.h
*/ */
#ifndef __V850_MODULE_H__ #ifndef __V850_MODULE_H__
#define __V850_MODULE_H__ #define __V850_MODULE_H__
#define arch_init_modules(x) ((void)0) #define MODULE_SYMBOL_PREFIX "_"
#define module_arch_init(x) (0)
#define module_map(sz) vmalloc (sz) struct v850_plt_entry
#define module_unmap(sz) vfree (sz) {
/* Indirect jump instruction sequence (6-byte mov + 2-byte jr). */
unsigned long tramp[2];
};
struct mod_arch_specific
{
/* How much of the core is actually taken up with core (then
we know the rest is for the PLT). */
unsigned int core_plt_offset;
/* Same for init. */
unsigned int init_plt_offset;
};
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr
#endif /* __V850_MODULE_H__ */ #endif /* __V850_MODULE_H__ */
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
#define NB85E_UART_BRGC_ADDR(n) (NB85E_UART_BASE_ADDR(n) + 0x7) #define NB85E_UART_BRGC_ADDR(n) (NB85E_UART_BASE_ADDR(n) + 0x7)
#endif #endif
#ifndef NB85E_UART_CKSR_MAX_FREQ
#define NB85E_UART_CKSR_MAX_FREQ (25*1000*1000)
#endif
/* UART config registers. */ /* UART config registers. */
#define NB85E_UART_ASIM(n) (*(volatile u8 *)NB85E_UART_ASIM_ADDR(n)) #define NB85E_UART_ASIM(n) (*(volatile u8 *)NB85E_UART_ASIM_ADDR(n))
...@@ -81,7 +84,6 @@ ...@@ -81,7 +84,6 @@
/* UART baud-rate generator control registers. */ /* UART baud-rate generator control registers. */
#define NB85E_UART_CKSR(n) (*(volatile u8 *)NB85E_UART_CKSR_ADDR(n)) #define NB85E_UART_CKSR(n) (*(volatile u8 *)NB85E_UART_CKSR_ADDR(n))
#define NB85E_UART_CKSR_MAX 11 #define NB85E_UART_CKSR_MAX 11
#define NB85E_UART_CKSR_MAX_FREQ (25*1000*1000)
#define NB85E_UART_BRGC(n) (*(volatile u8 *)NB85E_UART_BRGC_ADDR(n)) #define NB85E_UART_BRGC(n) (*(volatile u8 *)NB85E_UART_BRGC_ADDR(n))
......
...@@ -3,4 +3,12 @@ ...@@ -3,4 +3,12 @@
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
/* This is a stupid hack to satisfy some grotty implicit include-file
dependency; basically, <linux/smp.h> uses BUG_ON, which calls BUG, but
doesn't include the necessary headers to define it. In the twisted
festering mess of includes this must all be resolved somehow on other
platforms, but I haven't the faintest idea how, and don't care; here will
do, even though doesn't actually make any sense. */
#include <asm/page.h>
#endif /* __V850_PERCPU_H__ */ #endif /* __V850_PERCPU_H__ */
...@@ -30,6 +30,12 @@ ...@@ -30,6 +30,12 @@
*/ */
#define TASK_SIZE (0xFFFFFFFF) #define TASK_SIZE (0xFFFFFFFF)
/*
* This decides where the kernel will search for a free chunk of vm
* space during mmap's. We won't be using it.
*/
#define TASK_UNMAPPED_BASE 0
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
#define CPU_ARCH "v850e" #define CPU_ARCH "v850e"
#define CPU_MODEL "GDB/v850e simulator" #define CPU_MODEL "v850e"
#define CPU_MODEL_LONG "NEC V850E"
#define PLATFORM "gdb/v850e"
#define PLATFORM_LONG "GDB V850E simulator"
/* We use a wierd value for RAM, not just 0, for testing purposes. /* We use a wierd value for RAM, not just 0, for testing purposes.
......
...@@ -16,8 +16,11 @@ ...@@ -16,8 +16,11 @@
#define __V850_SIM85E2C_H__ #define __V850_SIM85E2C_H__
#define CPU_ARCH "v850e2" #define CPU_ARCH "v850e2"
#define CPU_MODEL "sim85e2c simulator" #define CPU_MODEL "v850e2"
#define CPU_MODEL_LONG "NEC V850E2"
#define PLATFORM "sim85e2c"
#define PLATFORM_LONG "SIM85E2C V850E2 simulator"
/* Various memory areas supported by the simulator. /* Various memory areas supported by the simulator.
......
...@@ -46,13 +46,13 @@ struct stat64 { ...@@ -46,13 +46,13 @@ struct stat64 {
unsigned long __unused4; /* future possible st_blocks high bits */ unsigned long __unused4; /* future possible st_blocks high bits */
unsigned long st_atime; unsigned long st_atime;
unsigned long __unused5; unsigned long st_atime_nsec;
unsigned long st_mtime; unsigned long st_mtime;
unsigned long __unused6; unsigned long st_mtime_nsec;
unsigned long st_ctime; unsigned long st_ctime;
unsigned long __unused7; /* high 32 bits of ctime someday */ unsigned long st_ctime_nsec;
unsigned long __unused8; unsigned long __unused8;
}; };
......
...@@ -239,11 +239,18 @@ ...@@ -239,11 +239,18 @@
#define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14" #define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14"
/* User programs sometimes end up including this header file
(indirectly, via uClibc header files), so I'm a bit nervous just
including <linux/compiler.h>. */
#if !defined(__builtin_expect) && __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif
#define __syscall_return(type, res) \ #define __syscall_return(type, res) \
do { \ do { \
/* user-visible error numbers are in the range -1 - -124: \ /* user-visible error numbers are in the range -1 - -124: \
see <asm-v850/errno.h> */ \ see <asm-v850/errno.h> */ \
if ((unsigned long)(res) >= (unsigned long)(-125)) { \ if (__builtin_expect ((unsigned long)(res) >= (unsigned long)(-125), 0)) { \
errno = -(res); \ errno = -(res); \
res = -1; \ res = -1; \
} \ } \
...@@ -340,6 +347,30 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \ ...@@ -340,6 +347,30 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \
__syscall_return (type, __ret); \ __syscall_return (type, __ret); \
} }
#if __GNUC__ < 3
/* In older versions of gcc, `asm' statements with more than 10
input/output arguments produce a fatal error. To work around this
problem, we use two versions, one for gcc-3.x and one for earlier
versions of gcc (the `earlier gcc' version doesn't work with gcc-3.x
because gcc-3.x doesn't allow clobbers to also be input arguments). */
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
: "=r" (ret), "=r" (syscall) \
: "1" (syscall), \
"r" (a), "r" (b), "r" (c), "r" (d), \
"r" (e), "r" (f) \
: SYSCALL_CLOBBERS, SYSCALL_ARG4, SYSCALL_ARG5);
#else /* __GNUC__ >= 3 */
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
: "=r" (ret), "=r" (syscall), \
"=r" (e), "=r" (f) \
: "1" (syscall), \
"r" (a), "r" (b), "r" (c), "r" (d), \
"2" (e), "3" (f) \
: SYSCALL_CLOBBERS);
#endif
#define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \ #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \
type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
{ \ { \
...@@ -351,13 +382,7 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ ...@@ -351,13 +382,7 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
register etype __f __asm__ (SYSCALL_ARG5) = f; \ register etype __f __asm__ (SYSCALL_ARG5) = f; \
register unsigned long __syscall __asm__ (SYSCALL_NUM) = __NR_##name; \ register unsigned long __syscall __asm__ (SYSCALL_NUM) = __NR_##name; \
register unsigned long __ret __asm__ (SYSCALL_RET); \ register unsigned long __ret __asm__ (SYSCALL_RET); \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ __SYSCALL6_TRAP(__syscall, __ret, __a, __b, __c, __d, __e, __f); \
: "=r" (__ret), "=r" (__syscall), \
"=r" (__e), "=r" (__f) \
: "1" (__syscall), \
"r" (__a), "r" (__b), "r" (__c), "r" (__d), \
"2" (__e), "3" (__f) \
: SYSCALL_CLOBBERS); \
__syscall_return (type, __ret); \ __syscall_return (type, __ret); \
} }
...@@ -398,8 +423,8 @@ extern inline pid_t wait(int * wait_stat) ...@@ -398,8 +423,8 @@ extern inline pid_t wait(int * wait_stat)
/* /*
* "Conditional" syscalls * "Conditional" syscalls
*/ */
#define cond_syscall(name) \ #define cond_syscall(name) \
asm (".weak\t" C_SYMBOL_STRING(name) ";" \ asm (".weak\t" C_SYMBOL_STRING(name) ";" \
".set\t" C_SYMBOL_STRING(name) "," C_SYMBOL_STRING(sys_ni_syscall)); ".set\t" C_SYMBOL_STRING(name) "," C_SYMBOL_STRING(sys_ni_syscall));
#if 0 #if 0
/* This doesn't work if there's a function prototype for NAME visible, /* This doesn't work if there's a function prototype for NAME visible,
......
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
#define PORT_SUNZILOG 38 #define PORT_SUNZILOG 38
#define PORT_SUNSAB 39 #define PORT_SUNSAB 39
/* NEC v850. */
#define PORT_NB85E_UART 40
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/config.h> #include <linux/config.h>
......
...@@ -1189,7 +1189,7 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit *rlim) ...@@ -1189,7 +1189,7 @@ asmlinkage long sys_getrlimit(unsigned int resource, struct rlimit *rlim)
? -EFAULT : 0; ? -EFAULT : 0;
} }
#if !defined(__ia64__) #if !defined(__ia64__) && !defined(CONFIG_V850)
/* /*
* Back compatibility for getrlimit. Needed for some apps. * Back compatibility for getrlimit. Needed for some apps.
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
* Filler routines for DMA buffers * Filler routines for DMA buffers
*/ */
#define __ASSEMBLY__
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment