Commit bd8f3917 authored by Linus Torvalds's avatar Linus Torvalds

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

into evo.osdl.org:/home/torvalds/v2.6/linux
parents 24373335 1b66a76f
Kernel Memory Layout on ARM Linux
Russell King <rmk@arm.linux.org.uk>
April 27, 2003 (2.5.68)
May 21, 2004 (2.6.6)
This document describes the virtual memory layout which the Linux
kernel uses for ARM processors. It indicates which regions are
......@@ -29,32 +29,30 @@ ffff0000 ffff0fff CPU vector page.
CPU supports vector relocation (control
register V bit.)
ffe00000 fffeffff Free for platform use, not recommended.
ffc00000 fffeffff DMA memory mapping region. Memory returned
by the dma_alloc_xxx functions will be
dynamically mapped here.
ffc00000 ffdfffff 2MB consistent memory mapping.
Memory returned by the consistent_alloc
low level function will be dynamically
mapped here.
ff000000 ffbfffff Reserved for future expansion of DMA
mapping region.
ff000000 ffbfffff Free for platform use, not recommended.
VMALLOC_END feffffff Free for platform use, recommended.
VMALLOC_END ff000000 Free for platform use, recommended.
VMALLOC_START VMALLOC_END vmalloc() / ioremap() space.
VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space.
Memory returned by vmalloc/ioremap will
be dynamically placed in this region.
VMALLOC_START may be based upon the value
of the high_memory variable.
PAGE_OFFSET high_memory Kernel direct-mapped RAM region.
PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region.
This maps the platforms RAM, and typically
maps all platform RAM in a 1:1 relationship.
TASK_SIZE PAGE_OFFSET Kernel module space
TASK_SIZE PAGE_OFFSET-1 Kernel module space
Kernel modules inserted via insmod are
placed here using dynamic mappings.
00001000 TASK_SIZE User space mappings
00001000 TASK_SIZE-1 User space mappings
Per-thread mappings are placed here via
the mmap() system call.
......
......@@ -203,20 +203,34 @@ currently-in-progress I/O.
If the filesystem is not called for "sync" and it determines that it
would need to block against in-progress I/O to be able to start new I/O
against the page the filesystem shoud redirty the page (usually with
__set_page_dirty_nobuffers()), then unlock the page and return zero.
against the page the filesystem should redirty the page with
redirty_page_for_writepage(), then unlock the page and return zero.
This may also be done to avoid internal deadlocks, but rarely.
If the filesytem is called for sync then it must wait on any
in-progress I/O and then start new I/O.
The filesystem should unlock the page synchronously, before returning
to the caller. If the page has write I/O underway against it,
writepage() should run SetPageWriteback() against the page prior to
unlocking it. The write I/O completion handler should run
end_page_writeback() against the page.
That is: after 2.5.12, pages which are under writeout are *not* locked.
to the caller.
Unless the filesystem is going to redirty_page_for_writepage(), unlock the page
and return zero, writepage *must* run set_page_writeback() against the page,
followed by unlocking it. Once set_page_writeback() has been run against the
page, write I/O can be submitted and the write I/O completion handler must run
end_page_writeback() once the I/O is complete. If no I/O is submitted, the
filesystem must run end_page_writeback() against the page before returning from
writepage.
That is: after 2.5.12, pages which are under writeout are *not* locked. Note,
if the filesystem needs the page to be locked during writeout, that is ok, too,
the page is allowed to be unlocked at any point in time between the calls to
set_page_writeback() and end_page_writeback().
Note, failure to run either redirty_page_for_writepage() or the combination of
set_page_writeback()/end_page_writeback() on a page submitted to writepage
will leave the page itself marked clean but it will be tagged as dirty in the
radix tree. This incoherency can lead to all sorts of hard-to-debug problems
in the filesystem like having dirty inodes at umount and losing written data.
->sync_page() locking rules are not well-defined - usually it is called
with lock on page, but that is not guaranteed. Considering the currently
......
......@@ -1390,8 +1390,6 @@ S: Maintained
NCP FILESYSTEM
P: Petr Vandrovec
M: vandrove@vc.cvut.cz
P: Volker Lendecke
M: vl@kki.org
L: linware@sh.cvut.cz
S: Maintained
......
......@@ -86,6 +86,20 @@
.macro writeb, rb
strb \rb, [r3, #0]
.endm
#elif defined(CONFIG_ARCH_OMAP)
.macro loadsp, rb
mov \rb, #0xff000000 @ physical base address
add \rb, \rb, #0x00fb0000
#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
add \rb, \rb, #0x00000800
#endif
#ifdef CONFIG_OMAP_LL_DEBUG_UART3
add \rb, \rb, #0x00009000
#endif
.endm
.macro writeb, rb
strb \rb, [r3]
.endm
#else
#error no serial architecture defined
#endif
......
......@@ -253,6 +253,9 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;
if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
goto badframe;
/* Send SIGTRAP if we're single-stepping */
if (current->ptrace & PT_SINGLESTEP) {
ptrace_cancel_bpt(current);
......@@ -402,6 +405,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs)
{
struct rt_sigframe __user *frame = get_sigframe(ka, regs, sizeof(*frame));
stack_t stack;
int err = 0;
if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
......@@ -411,8 +415,14 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
__put_user_error(&frame->uc, &frame->puc, err);
err |= copy_siginfo_to_user(&frame->info, info);
/* Clear all the bits of the ucontext we don't use. */
err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
__put_user_error(0, &frame->uc.uc_flags, err);
__put_user_error(NULL, &frame->uc.uc_link, err);
memset(&stack, 0, sizeof(stack));
stack.ss_sp = (void *)current->sas_ss_sp;
stack.ss_flags = sas_ss_flags(regs->ARM_sp);
stack.ss_size = current->sas_ss_size;
err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
err |= setup_sigcontext(&frame->uc.uc_mcontext, /*&frame->fpstate,*/
regs, set->sig[0]);
......
......@@ -24,7 +24,6 @@ lib-$(CONFIG_ARCH_RPC) += ecard.o io-acorn.o floppydma.o
lib-$(CONFIG_ARCH_CLPS7500) += io-acorn.o
lib-$(CONFIG_ARCH_L7200) += io-acorn.o
lib-$(CONFIG_ARCH_SHARK) += io-shark.o
lib-$(CONFIG_ARCH_CLPS711X) += io-acorn.o
$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
......@@ -17,31 +17,6 @@
.text
.align
.equ diff_pcio_base, PCIO_BASE - IO_BASE
.macro outw2 rd
mov r8, \rd, lsl #16
orr r8, r8, r8, lsr #16
str r8, [r3, r0, lsl #2]
mov r8, \rd, lsr #16
orr r8, r8, r8, lsl #16
str r8, [r3, r0, lsl #2]
.endm
.macro inw2 rd, mask, temp
ldr \rd, [r0]
and \rd, \rd, \mask
ldr \temp, [r0]
orr \rd, \rd, \temp, lsl #16
.endm
.macro addr rd
tst \rd, #0x80000000
mov \rd, \rd, lsl #2
add \rd, \rd, #IO_BASE
addeq \rd, \rd, #diff_pcio_base
.endm
.iosl_warning:
.ascii "<4>insl/outsl not implemented, called from %08lX\0"
.align
......
if ARCH_CLPS711X
menu "CLPS711X/EP721X Implementations"
config ARCH_AUTCPU12
bool "AUTCPU12"
depends on ARCH_CLPS711X
help
Say Y if you intend to run the kernel on the autronix autcpu12
board. This board is based on a Cirrus Logic CS89712.
config ARCH_CDB89712
bool "CDB89712"
depends on ARCH_CLPS711X
help
This is an evaluation board from Cirrus for the CS89712 processor.
The board includes 2 serial ports, Ethernet, IRDA, and expansion
......@@ -18,32 +17,27 @@ config ARCH_CDB89712
config ARCH_CEIVA
bool "CEIVA"
depends on ARCH_CLPS711X
help
Say Y here if you intend to run this kernel on the Ceiva/Polaroid
PhotoMax Digital Picture Frame.
config ARCH_CLEP7312
bool "CLEP7312"
depends on ARCH_CLPS711X
config ARCH_EDB7211
bool "EDB7211"
depends on ARCH_CLPS711X
help
Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
evaluation board.
config ARCH_P720T
bool "P720T"
depends on ARCH_CLPS711X
help
Say Y here if you intend to run this kernel on the ARM Prospector
720T.
config ARCH_FORTUNET
bool "FORTUNET"
depends on ARCH_CLPS711X
# XXX Maybe these should indicate register compatibility
# instead of being mutually exclusive.
......@@ -74,3 +68,4 @@ config EP72XX_ROM_BOOT
endmenu
endif
if ARCH_CAMELOT
menu "Epxa10db"
comment "PLD hotswap support"
depends on ARCH_CAMELOT
config PLD
bool
depends on ARCH_CAMELOT
default y
config PLD_HOTSWAP
bool "Support for PLD device hotplugging (experimental)"
depends on ARCH_CAMELOT && EXPERIMENTAL
depends on EXPERIMENTAL
help
This enables support for the dynamic loading and configuration of
compatible drivers when the contents of the PLD are changed. This
......@@ -21,3 +20,4 @@ config PLD_HOTSWAP
endmenu
endif
if ARCH_FOOTBRIDGE
menu "Footbridge Implementations"
config ARCH_CATS
bool "CATS"
depends on ARCH_FOOTBRIDGE
help
Say Y here if you intend to run this kernel on the CATS.
......@@ -11,7 +11,6 @@ config ARCH_CATS
config ARCH_PERSONAL_SERVER
bool "Compaq Personal Server"
depends on ARCH_FOOTBRIDGE
---help---
Say Y here if you intend to run this kernel on the Compaq
Personal Server.
......@@ -29,7 +28,6 @@ config ARCH_PERSONAL_SERVER
config ARCH_EBSA285_ADDIN
bool "EBSA285 (addin mode)"
depends on ARCH_FOOTBRIDGE
help
Say Y here if you intend to run this kernel on the EBSA285 card
in addin mode.
......@@ -38,7 +36,6 @@ config ARCH_EBSA285_ADDIN
config ARCH_EBSA285_HOST
bool "EBSA285 (host mode)"
depends on ARCH_FOOTBRIDGE
help
Say Y here if you intend to run this kernel on the EBSA285 card
in host ("central function") mode.
......@@ -47,7 +44,6 @@ config ARCH_EBSA285_HOST
config ARCH_NETWINDER
bool "NetWinder"
depends on ARCH_FOOTBRIDGE
help
Say Y here if you intend to run this kernel on the Rebel.COM
NetWinder. Information about this machine can be found at:
......@@ -58,3 +54,4 @@ config ARCH_NETWINDER
endmenu
endif
if ARCH_INTEGRATOR
menu "Integrator Options"
depends on ARCH_INTEGRATOR
config ARCH_INTEGRATOR_AP
bool "Support Integrator/AP and Integrator/PP2 platforms"
......@@ -28,3 +29,5 @@ config INTEGRATOR_IMPD1
module will be called impd1.
endmenu
endif
if ARCH_IOP3XX
menu "IOP3xx Implementation Options"
choice
prompt "IOP3xx System Type"
default ARCH_IQ80310
depends on ARCH_IOP3XX
config ARCH_IQ80310
bool "IQ80310"
......@@ -36,19 +36,20 @@ comment "IOP3xx Chipset Features"
config IOP3XX_AAU
bool "Support Intel IOP3xx Application Accelerator Unit (EXPERIMENTAL)"
depends on ARCH_IOP3XX && EXPERIMENTAL
depends on EXPERIMENTAL
config IOP3XX_DMA
bool "Support Intel IOP3xx DMA (EXPERIMENTAL)"
depends on ARCH_IOP3XX && EXPERIMENTAL
depends on EXPERIMENTAL
config IOP3XX_MU
bool "Support Intel IOP3xx Messaging Unit (EXPERIMENTAL)"
depends on ARCH_IOP3XX && EXPERIMENTAL
depends on EXPERIMENTAL
config IOP3XX_PMON
bool "Support Intel IOP3xx Performance Monitor (EXPERIMENTAL)"
depends on ARCH_IOP3XX && EXPERIMENTAL
depends on EXPERIMENTAL
endmenu
endif
if ARCH_IXP4XX
config ARCH_SUPPORTS_BIG_ENDIAN
bool
depends on ARCH_IXP4XX
default y
menu "Intel IXP4xx Implementation Options"
......@@ -10,7 +10,6 @@ comment "IXP4xx Platforms"
config ARCH_AVILA
bool "Avila"
depends on ARCH_IXP4XX
help
Say 'Y' here if you want your kernel to support the Gateworks
Avila Network Platform. For more information on this platform,
......@@ -18,7 +17,6 @@ config ARCH_AVILA
config ARCH_ADI_COYOTE
bool "Coyote"
depends on ARCH_IXP4XX
help
Say 'Y' here if you want your kernel to support the ADI
Engineering Coyote Gateway Reference Platform. For more
......@@ -26,7 +24,6 @@ config ARCH_ADI_COYOTE
config ARCH_IXDP425
bool "IXDP425"
depends on ARCH_IXP4XX
help
Say 'Y' here if you want your kernel to support Intel's
IXDP425 Development Platform (Also known as Richfield).
......@@ -44,7 +41,6 @@ config ARCH_IXCDP1100
config ARCH_PRPMC1100
bool "PrPMC1100"
depends on ARCH_IXP4XX
help
Say 'Y' here if you want your kernel to support the Motorola
PrPCM1100 Processor Mezanine Module. For more information on
......@@ -62,7 +58,6 @@ comment "IXP4xx Options"
config IXP4XX_INDIRECT_PCI
bool "Use indirect PCI memory access"
depends on ARCH_IXP4XX
help
IXP4xx provides two methods of accessing PCI memory space:
......@@ -87,3 +82,5 @@ config IXP4XX_INDIRECT_PCI
what you need, leave this option unselected.
endmenu
endif
if ARCH_LH7A40X
menu "LH7A40X Implementations"
config MACH_KEV7A400
bool "KEV7A400"
depends on ARCH_LH7A40X
select ARCH_LH7A400
help
Say Y here if you are using the Sharp KEV7A400 development
......@@ -12,9 +12,8 @@ config MACH_KEV7A400
config MACH_LPD7A400
bool "LPD7A400 Card Engine"
depends on ARCH_LH7A40X
select ARCH_LH7A400
select IDE_POLL
# select IDE_POLL
help
Say Y here if you are using Logic Product Development's
LPD7A400 CardEngine. For the time being, the LPD7A400 and
......@@ -22,9 +21,8 @@ config MACH_LPD7A400
config MACH_LPD7A404
bool "LPD7A404 Card Engine"
depends on ARCH_LH7A40X
select ARCH_LH7A404
select IDE_POLL
# select IDE_POLL
help
Say Y here if you are using Logic Product Development's
LPD7A404 CardEngine. For the time being, the LPD7A400 and
......@@ -37,3 +35,5 @@ config ARCH_LH7A404
bool
endmenu
endif
if ARCH_OMAP
menu "TI OMAP Implementations"
comment "OMAP Core Type"
config ARCH_OMAP730
depends on ARCH_OMAP
bool "OMAP730 Based System"
select CPU_ARM926T
config ARCH_OMAP1510
depends on ARCH_OMAP
default y
bool "OMAP1510 Based System"
select CPU_ARM925T
select CPU_DCACHE_WRITETHROUGH
config ARCH_OMAP1610
depends on ARCH_OMAP
bool "OMAP1610 Based System"
select CPU_ARM926T
config ARCH_OMAP5912
depends on ARCH_OMAP
bool "OMAP5912 Based System"
select CPU_ARM926T
......@@ -87,7 +84,6 @@ comment "OMAP Feature Selections"
#config OMAP_BOOT_TAG
# bool "OMAP bootloader information passing"
# depends on ARCH_OMAP
# default n
# help
# Say Y, if you have a bootloader which passes information
......@@ -95,7 +91,6 @@ comment "OMAP Feature Selections"
config OMAP_MUX
bool "OMAP multiplexing support"
depends on ARCH_OMAP
default y
help
Pin multiplexing support for OMAP boards. If your bootloader
......@@ -113,7 +108,6 @@ config OMAP_MUX_DEBUG
choice
prompt "Low-level debug console UART"
depends on ARCH_OMAP
default OMAP_LL_DEBUG_UART1
config OMAP_LL_DEBUG_UART1
......@@ -171,3 +165,5 @@ config OMAP_ARM_30MHZ
Enable 30MHz clock for OMAP CPU. If unsure, say N.
endmenu
endif
......@@ -18,6 +18,7 @@
#include <linux/device.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
......@@ -64,7 +65,7 @@ static void __init omap_generic_map_io(void)
omap_map_io();
}
MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610")
MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610/1710")
MAINTAINER("Tony Lindgren <tony@atomide.com>")
BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
BOOT_PARAMS(0x10000100)
......
......@@ -19,8 +19,10 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/delay.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
......@@ -36,14 +38,14 @@ extern int omap_gpio_init(void);
/* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc innovator1510_io_desc[] __initdata = {
{ OMAP1510P1_FPGA_BASE, OMAP1510P1_FPGA_START, OMAP1510P1_FPGA_SIZE,
{ OMAP1510_FPGA_BASE, OMAP1510_FPGA_START, OMAP1510_FPGA_SIZE,
MT_DEVICE },
};
static struct resource innovator1510_smc91x_resources[] = {
[0] = {
.start = OMAP1510P1_FPGA_ETHR_START, /* Physical */
.end = OMAP1510P1_FPGA_ETHR_START + 16,
.start = OMAP1510_FPGA_ETHR_START, /* Physical */
.end = OMAP1510_FPGA_ETHR_START + 16,
.flags = IORESOURCE_MEM,
},
[1] = {
......@@ -132,12 +134,13 @@ static void __init innovator_map_io(void)
#ifdef CONFIG_ARCH_OMAP1510
if (cpu_is_omap1510()) {
iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
udelay(10); /* Delay needed for FPGA */
/* Dump the Innovator FPGA rev early - useful info for support. */
printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
fpga_read(OMAP1510P1_FPGA_REV_HIGH),
fpga_read(OMAP1510P1_FPGA_REV_LOW),
fpga_read(OMAP1510P1_FPGA_BOARD_REV));
fpga_read(OMAP1510_FPGA_REV_HIGH),
fpga_read(OMAP1510_FPGA_REV_LOW),
fpga_read(OMAP1510_FPGA_BOARD_REV));
}
#endif
#ifdef CONFIG_ARCH_OMAP1610
......
......@@ -31,6 +31,7 @@
#include <linux/device.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
......
......@@ -3,6 +3,9 @@
*
* Modified from board-generic.c
*
* Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
* Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
......@@ -13,6 +16,7 @@
#include <linux/device.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
......@@ -102,7 +106,7 @@ static void __init omap_perseus2_map_io(void)
}
MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
MAINTAINER("Kevin Hilman <k-hilman@ti.com>")
MAINTAINER("Kevin Hilman <kjh@hilman.org>")
BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
BOOT_PARAMS(0x10000100)
MAPIO(omap_perseus2_map_io)
......
......@@ -39,6 +39,7 @@
#include <linux/spinlock.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/mach/irq.h>
......@@ -265,7 +266,7 @@ static void __exit omap_bus_exit(void)
}
}
module_init(omap_bus_init);
postcore_initcall(omap_bus_init);
module_exit(omap_bus_exit);
MODULE_DESCRIPTION("Virtual bus for OMAP");
......
......@@ -84,7 +84,7 @@ static ck_info_t ck_info_table[] = {
}, {
.name = "ck_gen1",
.flags = CK_RATEF | CK_IDLEF,
.rate_reg = CK_DPLL1,
.rate_reg = DPLL_CTL,
.idle_reg = ARM_IDLECT1,
.idle_shift = IDLDPLL_ARM,
.parent = OMAP_CLKIN,
......@@ -629,39 +629,39 @@ init_ck(void)
omap_writew(0x1000, ARM_SYSST);
#if defined(CONFIG_OMAP_ARM_30MHZ)
omap_writew(0x1555, ARM_CKCTL);
omap_writew(0x2290, DPLL_CTL_REG);
omap_writew(0x2290, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_60MHZ)
omap_writew(0x1005, ARM_CKCTL);
omap_writew(0x2290, DPLL_CTL_REG);
omap_writew(0x2290, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_96MHZ)
omap_writew(0x1005, ARM_CKCTL);
omap_writew(0x2410, DPLL_CTL_REG);
omap_writew(0x2410, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_120MHZ)
omap_writew(0x110a, ARM_CKCTL);
omap_writew(0x2510, DPLL_CTL_REG);
omap_writew(0x2510, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_168MHZ)
omap_writew(0x110f, ARM_CKCTL);
omap_writew(0x2710, DPLL_CTL_REG);
omap_writew(0x2710, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_182MHZ) && defined(CONFIG_ARCH_OMAP730)
omap_writew(0x250E, ARM_CKCTL);
omap_writew(0x2710, DPLL_CTL_REG);
omap_writew(0x2710, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_192MHZ) && (defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912))
omap_writew(0x150f, ARM_CKCTL);
if (crystal_type == 2) {
source_clock = 13; /* MHz */
omap_writew(0x2510, DPLL_CTL_REG);
omap_writew(0x2510, DPLL_CTL);
} else
omap_writew(0x2810, DPLL_CTL_REG);
omap_writew(0x2810, DPLL_CTL);
#elif defined(CONFIG_OMAP_ARM_195MHZ) && defined(CONFIG_ARCH_OMAP730)
omap_writew(0x250E, ARM_CKCTL);
omap_writew(0x2790, DPLL_CTL_REG);
omap_writew(0x2790, DPLL_CTL);
#else
#error "OMAP MHZ not set, please run make xconfig"
#endif
#ifdef CONFIG_MACH_OMAP_PERSEUS2
/* Select slicer output as OMAP input clock */
omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL_REG) & ~0x1, OMAP730_PCC_UPLD_CTRL_REG);
omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL);
#endif
/* Turn off some other junk the bootloader might have turned on */
......
......@@ -23,6 +23,58 @@
#include <asm/arch/board.h>
#include <asm/io.h>
/*
* ----------------------------------------------------------------------------
* OMAP revision check
*
* Since we use the cpu_is_omapnnnn() macros, there's a chance that a board
* switches to an updated core. We want to print out the OMAP revision early.
*
* We use the system_serial registers for the revision information so we
* can see it in /proc/cpuinfo.
*
* If the OMAP detection gets more complicated, we may want to expand this
* to store the OMAP version and replace the current cpu_is_omapnnnn() macros.
*
* ----------------------------------------------------------------------------
*/
static void __init omap_check_revision(void)
{
system_serial_high = omap_readl(OMAP_ID_BASE);
system_serial_low = OMAP_ID_REG;
system_rev = (OMAP_ID_REG >> ID_SHIFT) & ID_MASK;
printk("OMAP revision: %d.%d (0x%08x) id: 0x%08x detected as OMAP-",
(system_serial_high >> 20) & 0xf,
(system_serial_high >> 16) & 0xf,
system_serial_high, system_serial_low);
switch (system_rev) {
case OMAP_ID_730:
printk("730\n");
system_rev = 0x730;
break;
case OMAP_ID_1510:
printk("1510\n");
system_rev = 0x1510;
break;
case OMAP_ID_1610:
printk("1610\n");
system_rev = 0x1610;
break;
case OMAP_ID_1710:
printk("1710\n");
system_rev = 0x1710;
break;
case OMAP_ID_5912:
printk("5912/1611B\n");
system_rev = 0x5912;
break;
default:
printk("unknown, please add support!\n");
}
}
/*
* ----------------------------------------------------------------------------
* OMAP I/O mapping
......@@ -64,7 +116,13 @@ static struct map_desc omap1610_io_desc[] __initdata = {
static struct map_desc omap5912_io_desc[] __initdata = {
{ OMAP5912_DSP_BASE, OMAP5912_DSP_START, OMAP5912_DSP_SIZE, MT_DEVICE },
{ OMAP5912_DSPREG_BASE, OMAP5912_DSPREG_START, OMAP5912_DSPREG_SIZE, MT_DEVICE },
{ OMAP5912_SRAM_BASE, OMAP5912_SRAM_START, OMAP5912_SRAM_SIZE, MT_DEVICE }
/*
* The OMAP5912 has 250kByte internal SRAM. Because the mapping is baseed on page
* size (4kByte), it seems that the last 2kByte (=0x800) of the 250kByte are not mapped.
* Add additional 2kByte (0x800) so that the last page is mapped and the last 2kByte
* can be used.
*/
{ OMAP5912_SRAM_BASE, OMAP5912_SRAM_START, OMAP5912_SRAM_SIZE + 0x800, MT_DEVICE }
};
#endif
......@@ -77,6 +135,7 @@ static void __init _omap_map_io(void)
/* We have to initialize the IO space mapping before we can run
* cpu_is_omapxxx() macros. */
iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
omap_check_revision();
#ifdef CONFIG_ARCH_OMAP730
if (cpu_is_omap730()) {
......@@ -102,8 +161,8 @@ static void __init _omap_map_io(void)
/* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
* on a Posted Write in the TIPB Bridge".
*/
omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL_REG);
omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL_REG);
omap_writew(0x0, MPU_PUBLIC_TIPB_CNTL);
omap_writew(0x0, MPU_PRIVATE_TIPB_CNTL);
/* Must init clocks early to assure that timer interrupt works
*/
......
This diff is collapsed.
......@@ -46,11 +46,11 @@ static void fpga_mask_irq(unsigned int irq)
irq -= IH_FPGA_BASE;
if (irq < 8)
__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_LO)
& ~(1 << irq)), OMAP1510P1_FPGA_IMR_LO);
__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO)
& ~(1 << irq)), OMAP1510_FPGA_IMR_LO);
else if (irq < 16)
__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_HI)
& ~(1 << (irq - 8))), OMAP1510P1_FPGA_IMR_HI);
__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
& ~(1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
else
__raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
& ~(1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
......@@ -60,10 +60,10 @@ static void fpga_mask_irq(unsigned int irq)
static inline u32 get_fpga_unmasked_irqs(void)
{
return
((__raw_readb(OMAP1510P1_FPGA_ISR_LO) &
__raw_readb(OMAP1510P1_FPGA_IMR_LO))) |
((__raw_readb(OMAP1510P1_FPGA_ISR_HI) &
__raw_readb(OMAP1510P1_FPGA_IMR_HI)) << 8) |
((__raw_readb(OMAP1510_FPGA_ISR_LO) &
__raw_readb(OMAP1510_FPGA_IMR_LO))) |
((__raw_readb(OMAP1510_FPGA_ISR_HI) &
__raw_readb(OMAP1510_FPGA_IMR_HI)) << 8) |
((__raw_readb(INNOVATOR_FPGA_ISR2) &
__raw_readb(INNOVATOR_FPGA_IMR2)) << 16);
}
......@@ -79,11 +79,11 @@ static void fpga_unmask_irq(unsigned int irq)
irq -= IH_FPGA_BASE;
if (irq < 8)
__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_LO) | (1 << irq)),
OMAP1510P1_FPGA_IMR_LO);
__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)),
OMAP1510_FPGA_IMR_LO);
else if (irq < 16)
__raw_writeb((__raw_readb(OMAP1510P1_FPGA_IMR_HI)
| (1 << (irq - 8))), OMAP1510P1_FPGA_IMR_HI);
__raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_HI)
| (1 << (irq - 8))), OMAP1510_FPGA_IMR_HI);
else
__raw_writeb((__raw_readb(INNOVATOR_FPGA_IMR2)
| (1 << (irq - 16))), INNOVATOR_FPGA_IMR2);
......@@ -166,8 +166,8 @@ void fpga_init_irq(void)
{
int i;
__raw_writeb(0, OMAP1510P1_FPGA_IMR_LO);
__raw_writeb(0, OMAP1510P1_FPGA_IMR_HI);
__raw_writeb(0, OMAP1510_FPGA_IMR_LO);
__raw_writeb(0, OMAP1510_FPGA_IMR_HI);
__raw_writeb(0, INNOVATOR_FPGA_IMR2);
for (i = IH_FPGA_BASE; i < (IH_FPGA_BASE + NR_FPGA_IRQS); i++) {
......
......@@ -22,7 +22,6 @@
#include <asm/irq.h>
#include <asm/arch/irqs.h>
#include <asm/arch/gpio.h>
#include <asm/arch/pm.h>
#include <asm/mach/irq.h>
#include <asm/io.h>
......@@ -79,7 +78,7 @@
#define OMAP730_GPIO_INT_MASK 0x10
#define OMAP730_GPIO_INT_STATUS 0x14
#define OMAP_MPUIO_MASK (~OMAP_MAX_GPIO_LINES & 0xff)
#define OMAP_MPUIO_MASK (~OMAP_MAX_GPIO_LINES & 0xff)
struct gpio_bank {
u32 base;
......@@ -213,12 +212,12 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
reg += OMAP730_GPIO_DIR_CONTROL;
break;
}
l = omap_readl(reg);
l = __raw_readl(reg);
if (is_input)
l |= 1 << gpio;
else
l &= ~(1 << gpio);
omap_writel(l, reg);
__raw_writel(l, reg);
}
void omap_set_gpio_direction(int gpio, int is_input)
......@@ -240,8 +239,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
switch (bank->method) {
case METHOD_MPUIO:
reg += OMAP_MPUIO_OUTPUT_REG;
l = omap_readl(reg);
reg += OMAP_MPUIO_OUTPUT;
l = __raw_readl(reg);
if (enable)
l |= 1 << gpio;
else
......@@ -249,7 +248,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
break;
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DATA_OUTPUT;
l = omap_readl(reg);
l = __raw_readl(reg);
if (enable)
l |= 1 << gpio;
else
......@@ -264,7 +263,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
break;
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DATA_OUTPUT;
l = omap_readl(reg);
l = __raw_readl(reg);
if (enable)
l |= 1 << gpio;
else
......@@ -274,7 +273,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
BUG();
return;
}
omap_writel(l, reg);
__raw_writel(l, reg);
}
void omap_set_gpio_dataout(int gpio, int enable)
......@@ -312,7 +311,7 @@ int omap_get_gpio_datain(int gpio)
BUG();
return -1;
}
return (omap_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
return (__raw_readl(reg) & (1 << get_gpio_index(gpio))) != 0;
}
static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
......@@ -322,22 +321,22 @@ static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
switch (bank->method) {
case METHOD_MPUIO:
reg += OMAP_MPUIO_GPIO_INT_EDGE_REG;
l = omap_readl(reg);
reg += OMAP_MPUIO_GPIO_INT_EDGE;
l = __raw_readl(reg);
if (edge == OMAP_GPIO_RISING_EDGE)
l |= 1 << gpio;
else
l &= ~(1 << gpio);
omap_writel(l, reg);
__raw_writel(l, reg);
break;
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_INT_CONTROL;
l = omap_readl(reg);
l = __raw_readl(reg);
if (edge == OMAP_GPIO_RISING_EDGE)
l |= 1 << gpio;
else
l &= ~(1 << gpio);
omap_writel(l, reg);
__raw_writel(l, reg);
break;
case METHOD_GPIO_1610:
edge &= 0x03;
......@@ -346,19 +345,19 @@ static void _set_gpio_edge_ctrl(struct gpio_bank *bank, int gpio, int edge)
else
reg += OMAP1610_GPIO_EDGE_CTRL1;
gpio &= 0x07;
l = omap_readl(reg);
l = __raw_readl(reg);
l &= ~(3 << (gpio << 1));
l |= edge << (gpio << 1);
omap_writel(l, reg);
__raw_writel(l, reg);
break;
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_CONTROL;
l = omap_readl(reg);
l = __raw_readl(reg);
if (edge == OMAP_GPIO_RISING_EDGE)
l |= 1 << gpio;
else
l &= ~(1 << gpio);
omap_writel(l, reg);
__raw_writel(l, reg);
break;
default:
BUG();
......@@ -385,11 +384,11 @@ static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
switch (bank->method) {
case METHOD_MPUIO:
l = omap_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE_REG);
l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
return (l & (1 << gpio)) ?
OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
case METHOD_GPIO_1510:
l = omap_readl(reg + OMAP1510_GPIO_INT_CONTROL);
l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
return (l & (1 << gpio)) ?
OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
case METHOD_GPIO_1610:
......@@ -397,9 +396,9 @@ static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
reg += OMAP1610_GPIO_EDGE_CTRL2;
else
reg += OMAP1610_GPIO_EDGE_CTRL1;
return (omap_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
case METHOD_GPIO_730:
l = omap_readl(reg + OMAP730_GPIO_INT_CONTROL);
l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
return (l & (1 << gpio)) ?
OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
default:
......@@ -430,7 +429,7 @@ static void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
BUG();
return;
}
omap_writel(1 << get_gpio_index(gpio), reg);
__raw_writel(1 << get_gpio_index(gpio), reg);
}
static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
......@@ -441,7 +440,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
switch (bank->method) {
case METHOD_MPUIO:
reg += OMAP_MPUIO_GPIO_MASKIT;
l = omap_readl(reg);
l = __raw_readl(reg);
if (enable)
l &= ~(1 << gpio);
else
......@@ -449,7 +448,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
break;
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_INT_MASK;
l = omap_readl(reg);
l = __raw_readl(reg);
if (enable)
l &= ~(1 << gpio);
else
......@@ -465,7 +464,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
break;
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_MASK;
l = omap_readl(reg);
l = __raw_readl(reg);
if (enable)
l &= ~(1 << gpio);
else
......@@ -475,7 +474,7 @@ static void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int enable)
BUG();
return;
}
omap_writel(l, reg);
__raw_writel(l, reg);
}
int omap_request_gpio(int gpio)
......@@ -500,7 +499,7 @@ int omap_request_gpio(int gpio)
/* Claim the pin for the ARM */
reg = bank->base + OMAP1510_GPIO_PIN_CONTROL;
omap_writel(omap_readl(reg) | (1 << get_gpio_index(gpio)), reg);
__raw_writel(__raw_readl(reg) | (1 << get_gpio_index(gpio)), reg);
}
#endif
spin_unlock(&bank->lock);
......@@ -564,7 +563,7 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
isr_reg = bank->base + OMAP730_GPIO_INT_STATUS;
#endif
for (;;) {
u32 isr = omap_readl(isr_reg);
u32 isr = __raw_readl(isr_reg);
unsigned int gpio_irq;
if (!isr)
......@@ -587,15 +586,15 @@ static void gpio_ack_irq(unsigned int irq)
#ifdef CONFIG_ARCH_OMAP1510
if (bank->method == METHOD_GPIO_1510)
omap_writew(1 << (gpio & 0x0f), bank->base + OMAP1510_GPIO_INT_STATUS);
__raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1510_GPIO_INT_STATUS);
#endif
#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
if (bank->method == METHOD_GPIO_1610)
omap_writew(1 << (gpio & 0x0f), bank->base + OMAP1610_GPIO_IRQSTATUS1);
__raw_writew(1 << (gpio & 0x0f), bank->base + OMAP1610_GPIO_IRQSTATUS1);
#endif
#ifdef CONFIG_ARCH_OMAP730
if (bank->method == METHOD_GPIO_730)
omap_writel(1 << (gpio & 0x1f), bank->base + OMAP730_GPIO_INT_STATUS);
__raw_writel(1 << (gpio & 0x1f), bank->base + OMAP730_GPIO_INT_STATUS);
#endif
}
......@@ -692,26 +691,27 @@ static int __init _omap_gpio_init(void)
bank = &gpio_bank[i];
bank->reserved_map = 0;
bank->base = IO_ADDRESS(bank->base);
spin_lock_init(&bank->lock);
if (bank->method == METHOD_MPUIO) {
omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
}
#ifdef CONFIG_ARCH_OMAP1510
if (bank->method == METHOD_GPIO_1510) {
omap_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
omap_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
__raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
__raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
}
#endif
#if defined(CONFIG_ARCH_OMAP1610) || defined(CONFIG_ARCH_OMAP5912)
if (bank->method == METHOD_GPIO_1610) {
omap_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
omap_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
__raw_writew(0x0000, bank->base + OMAP1610_GPIO_IRQENABLE1);
__raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
}
#endif
#ifdef CONFIG_ARCH_OMAP730
if (bank->method == METHOD_GPIO_730) {
omap_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
omap_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
__raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
__raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
gpio_count = 32; /* 730 has 32-bit GPIOs */
}
......@@ -730,9 +730,9 @@ static int __init _omap_gpio_init(void)
}
/* Enable system clock for GPIO module.
* The CAM_CLK_CTRL_REG *is* really the right place. */
* The CAM_CLK_CTRL *is* really the right place. */
if (cpu_is_omap1610())
omap_writel(omap_readl(ULPD_CAM_CLK_CTRL_REG) | 0x04, ULPD_CAM_CLK_CTRL_REG);
omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, ULPD_CAM_CLK_CTRL);
return 0;
}
......@@ -748,8 +748,11 @@ int omap_gpio_init(void)
return 0;
}
EXPORT_SYMBOL(omap_gpio_init);
EXPORT_SYMBOL(omap_request_gpio);
EXPORT_SYMBOL(omap_free_gpio);
EXPORT_SYMBOL(omap_set_gpio_direction);
EXPORT_SYMBOL(omap_set_gpio_dataout);
EXPORT_SYMBOL(omap_get_gpio_datain);
EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
arch_initcall(omap_gpio_init);
......@@ -74,9 +74,9 @@ static inline void irq_bank_writel(unsigned long value, int bank, int offset)
static void omap_ack_irq(unsigned int irq)
{
if (irq > 31)
omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG);
omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET);
omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG);
omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET);
}
static void omap_mask_irq(unsigned int irq)
......@@ -84,9 +84,9 @@ static void omap_mask_irq(unsigned int irq)
int bank = IRQ_BANK(irq);
u32 l;
l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR);
l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
l |= 1 << IRQ_BIT(irq);
omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR);
omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
}
static void omap_unmask_irq(unsigned int irq)
......@@ -94,9 +94,9 @@ static void omap_unmask_irq(unsigned int irq)
int bank = IRQ_BANK(irq);
u32 l;
l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR);
l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
l &= ~(1 << IRQ_BIT(irq));
omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR);
omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
}
static void omap_mask_ack_irq(unsigned int irq)
......@@ -121,7 +121,7 @@ static void omap_irq_set_cfg(int irq, int fiq, int priority, int trigger)
/* FIQ is only available on bank 0 interrupts */
fiq = bank ? 0 : (fiq & 0x1);
val = fiq | ((priority & 0x1f) << 2) | ((trigger & 0x1) << 1);
offset = IRQ_ILR0 + IRQ_BIT(irq) * 0x4;
offset = IRQ_ILR0_REG_OFFSET + IRQ_BIT(irq) * 0x4;
irq_bank_writel(val, bank, offset);
}
......@@ -182,13 +182,13 @@ void __init omap_init_irq(void)
/* Mask and clear all interrupts */
for (i = 0; i < irq_bank_count; i++) {
irq_bank_writel(~0x0, i, IRQ_MIR);
irq_bank_writel(0x0, i, IRQ_ITR);
irq_bank_writel(~0x0, i, IRQ_MIR_REG_OFFSET);
irq_bank_writel(0x0, i, IRQ_ITR_REG_OFFSET);
}
/* Clear any pending interrupts */
irq_bank_writel(0x03, 0, IRQ_CONTROL_REG);
irq_bank_writel(0x03, 1, IRQ_CONTROL_REG);
irq_bank_writel(0x03, 0, IRQ_CONTROL_REG_OFFSET);
irq_bank_writel(0x03, 1, IRQ_CONTROL_REG_OFFSET);
/* Install the interrupt handlers for each bank */
for (i = 0; i < irq_bank_count; i++) {
......
......@@ -85,14 +85,6 @@ int ocpi_enable(void)
val &= ~0xff;
omap_writel(val, OCPI_SEC);
val = omap_readl(OCPI_SEC);
val |= 0;
omap_writel(val, OCPI_SEC);
val = omap_readl(OCPI_SINT0);
val |= 0;
omap_writel(val, OCPI_SINT1);
return 0;
}
EXPORT_SYMBOL(ocpi_enable);
......
if ARCH_PXA
menu "Intel PXA2xx Implementations"
choice
prompt "Select target board"
depends on ARCH_PXA
config ARCH_LUBBOCK
bool "Intel DBPXA250 Development Platform"
......@@ -32,3 +32,4 @@ config PXA27x
help
Select code specific to PXA27x variants
endif
if ARCH_S3C2410
menu "S3C2410 Implementations"
config ARCH_BAST
bool "Simtec Electronics BAST (EB2410ITX)"
depends on ARCH_S3C2410
help
Say Y here if you are using the Simtec Electronics EB2410ITX
development board (also known as BAST)
......@@ -11,22 +12,21 @@ config ARCH_BAST
config ARCH_H1940
bool "IPAQ H1940"
depends on ARCH_S3C2410
help
Say Y here if you are using the HP IPAQ H1940
<http://www.handhelds.org/projects/h1940.html>.
config ARCH_SMDK2410
bool "SMDK2410/A9M2410"
depends on ARCH_S3C2410
help
Say Y here if you are using the SMDK2410 or the derived module A9M2410
<http://www.fsforth.de>
config MACH_VR1000
bool "Simtec VR1000"
depends on ARCH_S3C2410
help
Say Y here if you are using the Simtec VR1000 board.
endmenu
endif
if ARCH_SA1100
menu "SA11x0 Implementations"
config SA1100_ASSABET
bool "Assabet"
depends on ARCH_SA1100
help
Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
Microprocessor Development Board (also known as the Assabet).
......@@ -18,7 +18,6 @@ config ASSABET_NEPONSET
config SA1100_ADSBITSY
bool "ADS Bitsy"
depends on ARCH_SA1100
help
Say Y here if you are using Applied Data Systems Intel(R)
StrongARM(R) 1110 based Bitsy, 3 x 5 inches in size, Compaq - IPAQ -
......@@ -28,14 +27,12 @@ config SA1100_ADSBITSY
config SA1100_BRUTUS
bool "Brutus"
depends on ARCH_SA1100
help
Say Y here if you are using the Intel(R) StrongARM(R) SA-1100
Microprocessor Development Board (also known as the Brutus).
config SA1100_CERF
bool "CerfBoard"
depends on ARCH_SA1100
help
The Intrinsyc CerfBoard is based on the StrongARM 1110 (Discontinued).
More information is available at:
......@@ -62,7 +59,6 @@ endchoice
config SA1100_H3100
bool "Compaq iPAQ H3100"
depends on ARCH_SA1100
help
Say Y here if you intend to run this kernel on the Compaq iPAQ
H3100 handheld computer. Information about this machine and the
......@@ -73,7 +69,6 @@ config SA1100_H3100
config SA1100_H3600
bool "Compaq iPAQ H3600/H3700"
depends on ARCH_SA1100
help
Say Y here if you intend to run this kernel on the Compaq iPAQ
H3600 handheld computer. Information about this machine and the
......@@ -84,7 +79,6 @@ config SA1100_H3600
config SA1100_H3800
bool "Compaq iPAQ H3800"
depends on ARCH_SA1100
help
Say Y here if you intend to run this kernel on the Compaq iPAQ H3800
series handheld computer. Information about this machine and the
......@@ -102,7 +96,6 @@ config SA1100_H3XXX
#dep_bool ' Empeg' CONFIG_SA1100_EMPEG $CONFIG_ARCH_SA1100
config SA1100_EXTENEX1
bool "Extenex HandHeld Theater (Squashtail)"
depends on ARCH_SA1100
config SA1100_EXTENEX1_16MB
bool "Support 16 MB of DRAM (not just 8)"
......@@ -110,7 +103,6 @@ config SA1100_EXTENEX1_16MB
config SA1100_FLEXANET
bool "FlexaNet"
depends on ARCH_SA1100
help
Say Y here if you intend to run this kernel on the FlexaNet
handheld instruments. Information about this machine can be
......@@ -118,14 +110,12 @@ config SA1100_FLEXANET
config SA1100_FREEBIRD
bool "FreeBird-v1.1"
depends on ARCH_SA1100
help
Support the FreeBird board used in Coventive embedded products. See
Documentation/arm/SA1100/Freebird for more.
config SA1100_GRAPHICSCLIENT
bool "GraphicsClient Plus"
depends on ARCH_SA1100
help
Say Y here if you are using an Applied Data Systems Intel(R)
StrongARM(R) SA-1100 based Graphics Client SBC. See
......@@ -133,7 +123,6 @@ config SA1100_GRAPHICSCLIENT
config SA1100_GRAPHICSMASTER
bool "GraphicsMaster"
depends on ARCH_SA1100
help
Say Y here if you are using an Applied Data Systems Intel(R)
StrongARM(R) SA-1100 based Graphics Master SBC with SA-1111
......@@ -143,14 +132,12 @@ config SA1100_GRAPHICSMASTER
config SA1100_BADGE4
bool "HP Labs BadgePAD 4"
depends on ARCH_SA1100
help
Say Y here if you want to build a kernel for the HP Laboratories
BadgePAD 4.
config SA1100_JORNADA720
bool "HP Jornada 720"
depends on ARCH_SA1100
help
Say Y here if you want to build a kernel for the HP Jornada 720
handheld computer. See <http://www.hp.com/jornada/products/720>
......@@ -158,14 +145,12 @@ config SA1100_JORNADA720
config SA1100_HACKKIT
bool "HackKit Core CPU Board"
depends on ARCH_SA1100
help
Say Y here to support the HackKit Core CPU Board
<http://hackkit.eletztrick.de>;
config SA1100_HUW_WEBPANEL
bool "HuW WebPanel"
depends on ARCH_SA1100
help
Say Y here to support the HuW Webpanel produced by Hoeft & Wessel
AG. English-language website is at
......@@ -174,7 +159,6 @@ config SA1100_HUW_WEBPANEL
config SA1100_ITSY
bool "Itsy"
depends on ARCH_SA1100
help
Say Y here if you are using the Compaq Itsy experimental pocket
computer. See <http://research.compaq.com/wrl/projects/itsy/> for
......@@ -182,7 +166,6 @@ config SA1100_ITSY
config SA1100_LART
bool "LART"
depends on ARCH_SA1100
help
Say Y here if you are using the Linux Advanced Radio Terminal
(also known as the LART). See <http://www.lart.tudelft.nl/> for
......@@ -190,7 +173,6 @@ config SA1100_LART
config SA1100_NANOENGINE
bool "nanoEngine"
depends on ARCH_SA1100
help
The nanoEngine is a StrongARM 1110-based single board computer
from Bright Star Engineering. More information is available at:
......@@ -201,14 +183,12 @@ config SA1100_NANOENGINE
config SA1100_OMNIMETER
bool "OmniMeter"
depends on ARCH_SA1100
help
Say Y here if you are using the inhand electronics OmniMeter. See
<http://www.inhandelectronics.com/omnimeter.asp> for details.
config SA1100_PANGOLIN
bool "Pangolin"
depends on ARCH_SA1100
help
Pangolin is a StrongARM 1110-based evaluation platform produced
by Dialogue Technology. It has EISA slots for ease of configuration
......@@ -220,7 +200,6 @@ config SA1100_PANGOLIN
config SA1100_PLEB
bool "PLEB"
depends on ARCH_SA1100
help
Say Y here if you are using a Portable Linux Embedded Board
(also known as PLEB). See <http://www.cse.unsw.edu.au/~pleb/>
......@@ -228,7 +207,6 @@ config SA1100_PLEB
config SA1100_PT_SYSTEM3
bool "PT System 3"
depends on ARCH_SA1100
help
Say Y here if you intend to build a kernel suitable to run on
a Pruftechnik Digital Board. For more information see
......@@ -236,7 +214,6 @@ config SA1100_PT_SYSTEM3
config SA1100_SHANNON
bool "Shannon"
depends on ARCH_SA1100
help
The Shannon (also known as a Tuxscreen, and also as a IS2630) was a
limited edition webphone produced by Philips. The Shannon is a SA1100
......@@ -245,7 +222,6 @@ config SA1100_SHANNON
config SA1100_SHERMAN
bool "Sherman"
depends on ARCH_SA1100
help
Say Y here to support the Blazie Engineering `Sherman' StrongARM
1110-based SBC, used primarily in assistance products for the
......@@ -255,7 +231,6 @@ config SA1100_SHERMAN
config SA1100_SIMPAD
bool "Simpad"
depends on ARCH_SA1100
help
The SIEMENS webpad SIMpad is based on the StrongARM 1110. There
are two different versions CL4 and SL4. CL4 has 32MB RAM and 16MB
......@@ -266,7 +241,6 @@ config SA1100_SIMPAD
config SA1100_PFS168
bool "Tulsa"
depends on ARCH_SA1100
help
The Radisys Corp. PFS-168 (aka Tulsa) is an Intel® StrongArm® SA-1110 based
computer which includes the SA-1111 Microprocessor Companion Chip and other
......@@ -276,7 +250,6 @@ config SA1100_PFS168
config SA1100_VICTOR
bool "Victor"
depends on ARCH_SA1100
help
Say Y here if you are using a Visu Aide Intel(R) StrongARM(R)
SA-1100 based Victor Digital Talking Book Reader. See
......@@ -285,14 +258,12 @@ config SA1100_VICTOR
config SA1100_XP860
bool "XP860"
depends on ARCH_SA1100
help
:: Config help missing ::
:: 06 August 2002 ::
config SA1100_YOPY
bool "Yopy"
depends on ARCH_SA1100
help
Say Y here to support the Yopy PDA. Product information at
<http://www.yopy.com/>. See Documentation/arm/SA1100/Yopy
......@@ -300,14 +271,12 @@ config SA1100_YOPY
config SA1100_STORK
bool "Stork"
depends on ARCH_SA1100
help
Say Y here if you intend to run this kernel on the Stork
handheld computer.
#config SA1100_TRIZEPS
# bool "Trizeps"
# depends on ARCH_SA1100
# help
# :: write me ::
......@@ -319,7 +288,6 @@ config SA1100_STORK
config SA1100_SSP
tristate "Generic PIO SSP"
depends on ARCH_SA1100
help
Say Y here to enable support for the generic PIO SSP driver.
This isn't for audio support, but for attached sensors and
......@@ -328,7 +296,6 @@ config SA1100_SSP
config SA1100_USB
tristate "SA1100 USB function support"
depends on ARCH_SA1100
config SA1100_USB_NETLINK
tristate "Support for SA11x0 USB network link function"
......@@ -349,3 +316,4 @@ config H3600_SLEEVE
endmenu
endif
......@@ -65,6 +65,8 @@ config X86_VOYAGER
config X86_NUMAQ
bool "NUMAQ (IBM/Sequent)"
select DISCONTIGMEM
select NUMA
help
This option is used for getting Linux to run on a (IBM/Sequent) NUMA
multiquad box. This changes the way that processors are bootstrapped,
......@@ -548,6 +550,7 @@ config X86_TSC
config X86_MCE
bool "Machine Check Exception"
depends on !X86_VOYAGER
---help---
Machine Check Exception support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, component failure).
......
......@@ -202,7 +202,7 @@ static int __init idle_setup (char *str)
if (!strncmp(str, "poll", 4)) {
printk("using polling idle threads.\n");
pm_idle = poll_idle;
#ifdef CONFIG_SMP
#ifdef CONFIG_X86_SMP
if (smp_num_siblings > 1)
printk("WARNING: polling idle and HT enabled, performance may degrade.\n");
#endif
......
......@@ -50,7 +50,6 @@ struct mip_reg *mip_reg;
struct mip_reg *host_reg;
int mip_port;
unsigned long mip_addr, host_addr;
extern int (*platform_rename_gsi)();
static int __init
es7000_rename_gsi(int ioapic, int gsi)
......
......@@ -502,6 +502,7 @@ ENTRY(fsys_fallback_syscall)
adds r17=-1024,r15
movl r14=sys_call_table
;;
rsm psr.i
shladd r18=r17,3,r14
;;
ld8 r18=[r18] // load normal (heavy-weight) syscall entry-point
......@@ -542,7 +543,7 @@ GLOBAL_ENTRY(fsys_bubble_down)
* to synthesize.
*/
# define PSR_ONE_BITS ((3 << IA64_PSR_CPL0_BIT) | (0x1 << IA64_PSR_RI_BIT) \
| IA64_PSR_BN)
| IA64_PSR_BN | IA64_PSR_I)
invala
movl r8=PSR_ONE_BITS
......
......@@ -91,16 +91,18 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
cmp.geu p6,p7=r19,r17 // (syscall > 0 && syscall < 1024+NR_syscalls)?
;;
(p6) ld8 r18=[r18]
mov r29=psr // read psr (12 cyc load latency)
mov r21=ar.fpsr
add r14=-8,r14 // r14 <- addr of fsys_bubble_down entry
;;
(p6) mov b7=r18
(p6) tbit.z p8,p0=r18,0
(p8) br.dptk.many b7
(p6) rsm psr.i
mov r27=ar.rsc
mov r21=ar.fpsr
mov r26=ar.pfs
;;
mov r29=psr // read psr (12 cyc load latency)
/*
* brl.cond doesn't work as intended because the linker would convert this branch
* into a branch to a PLT. Perhaps there will be a way to avoid this with some
......
......@@ -85,9 +85,10 @@ struct appldata_parameter_list {
*/
static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
void *buffer, size_t *lenp);
void __user *buffer, size_t *lenp);
static int appldata_interval_handler(ctl_table *ctl, int write,
struct file *filp, void *buffer,
struct file *filp,
void __user *buffer,
size_t *lenp);
static struct ctl_table_header *appldata_sysctl_header;
......@@ -192,7 +193,8 @@ static void appldata_tasklet_function(unsigned long data)
* wrapper function for mod_virt_timer(), because smp_call_function_on()
* accepts only one parameter.
*/
static void appldata_mod_vtimer_wrap(struct appldata_mod_vtimer_args *args) {
static void appldata_mod_vtimer_wrap(void *p) {
struct appldata_mod_vtimer_args *args = p;
mod_virt_timer(args->timer, args->expires);
}
......@@ -252,7 +254,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
*/
static int
appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
void *buffer, size_t *lenp)
void __user *buffer, size_t *lenp)
{
int len, i;
char buf[2];
......@@ -309,7 +311,7 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
*/
static int
appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
void *buffer, size_t *lenp)
void __user *buffer, size_t *lenp)
{
int len, i, interval;
char buf[16];
......@@ -347,7 +349,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
appldata_mod_vtimer_args.expires =
per_cpu_interval;
smp_call_function_on(
(void *) appldata_mod_vtimer_wrap,
appldata_mod_vtimer_wrap,
&appldata_mod_vtimer_args,
0, 1, i);
}
......@@ -370,7 +372,7 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
*/
static int
appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
void *buffer, size_t *lenp)
void __user *buffer, size_t *lenp)
{
struct appldata_ops *ops = NULL, *tmp_ops;
int rc, len, found;
......
......@@ -53,7 +53,7 @@ typedef struct
asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
int copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from)
int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
{
int err;
......@@ -130,7 +130,8 @@ sys32_sigsuspend(struct pt_regs * regs,int history0, int history1, old_sigset_t
}
asmlinkage int
sys32_rt_sigsuspend(struct pt_regs * regs,compat_sigset_t *unewset, size_t sigsetsize)
sys32_rt_sigsuspend(struct pt_regs * regs, compat_sigset_t __user *unewset,
size_t sigsetsize)
{
sigset_t saveset, newset;
compat_sigset_t set32;
......@@ -162,11 +163,11 @@ sys32_rt_sigsuspend(struct pt_regs * regs,compat_sigset_t *unewset, size_t sigse
if (do_signal(regs, &saveset))
return -EINTR;
}
}
}
asmlinkage long
sys32_sigaction(int sig, const struct old_sigaction32 *act,
struct old_sigaction32 *oact)
sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
struct old_sigaction32 __user *oact)
{
struct k_sigaction new_ka, old_ka;
int ret;
......@@ -199,9 +200,9 @@ sys32_sigaction(int sig, const struct old_sigaction32 *act,
int
do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact);
asmlinkage long
sys32_rt_sigaction(int sig, const struct sigaction32 *act,
struct sigaction32 *oact, size_t sigsetsize)
asmlinkage long
sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
struct sigaction32 __user *oact, size_t sigsetsize)
{
struct k_sigaction new_ka, old_ka;
int ret;
......@@ -258,7 +259,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 *act,
}
asmlinkage long
sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss,
struct pt_regs *regs)
{
stack_t kss, koss;
int ret, err = 0;
......@@ -275,7 +277,9 @@ sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
}
set_fs (KERNEL_DS);
ret = do_sigaltstack(uss ? &kss : NULL , uoss ? &koss : NULL, regs->gprs[15]);
ret = do_sigaltstack((stack_t __user *) (uss ? &kss : NULL),
(stack_t __user *) (uoss ? &koss : NULL),
regs->gprs[15]);
set_fs (old_fs);
if (!ret && uoss) {
......@@ -290,7 +294,7 @@ sys32_sigaltstack(const stack_t32 *uss, stack_t32 *uoss, struct pt_regs *regs)
return ret;
}
static int save_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
{
_s390_regs_common32 regs32;
int err, i;
......@@ -311,7 +315,7 @@ static int save_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
sizeof(_s390_fp_regs32));
}
static int restore_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
{
_s390_regs_common32 regs32;
int err, i;
......@@ -343,7 +347,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 *sregs)
asmlinkage long sys32_sigreturn(struct pt_regs *regs)
{
sigframe32 *frame = (sigframe32 *)regs->gprs[15];
sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15];
sigset_t set;
if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
......@@ -365,11 +369,11 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs)
badframe:
force_sig(SIGSEGV, current);
return 0;
}
}
asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
{
rt_sigframe32 *frame = (rt_sigframe32 *)regs->gprs[15];
rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15];
sigset_t set;
stack_t st;
__u32 ss_sp;
......@@ -399,8 +403,8 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
set_fs (KERNEL_DS);
do_sigaltstack(&st, NULL, regs->gprs[15]);
set_fs (KERNEL_DS);
do_sigaltstack((stack_t __user *)&st, NULL, regs->gprs[15]);
set_fs (old_fs);
return regs->gprs[2];
......@@ -418,7 +422,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
/*
* Determine which stack to use..
*/
static inline void *
static inline void __user *
get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
{
unsigned long sp;
......@@ -439,7 +443,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
sp = (unsigned long) ka->sa.sa_restorer;
}
return (void *)((sp - frame_size) & -8ul);
return (void __user *)((sp - frame_size) & -8ul);
}
static inline int map_signal(int sig)
......@@ -455,7 +459,7 @@ static inline int map_signal(int sig)
static void setup_frame32(int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs * regs)
{
sigframe32 *frame = get_sigframe(ka, regs, sizeof(sigframe32));
sigframe32 __user *frame = get_sigframe(ka, regs, sizeof(sigframe32));
if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe32)))
goto give_sigsegv;
......@@ -474,12 +478,12 @@ static void setup_frame32(int sig, struct k_sigaction *ka,
} else {
regs->gprs[14] = (__u64) frame->retcode;
if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
(u16 *)(frame->retcode)))
(u16 __user *)(frame->retcode)))
goto give_sigsegv;
}
/* Set up backchain. */
if (__put_user(regs->gprs[15], (unsigned int *) frame))
if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
goto give_sigsegv;
/* Set up registers for signal handler */
......@@ -505,7 +509,7 @@ static void setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs * regs)
{
int err = 0;
rt_sigframe32 *frame = get_sigframe(ka, regs, sizeof(rt_sigframe32));
rt_sigframe32 __user *frame = get_sigframe(ka, regs, sizeof(rt_sigframe32));
if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe32)))
goto give_sigsegv;
......@@ -531,11 +535,11 @@ static void setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
} else {
regs->gprs[14] = (__u64) frame->retcode;
err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
(u16 *)(frame->retcode));
(u16 __user *)(frame->retcode));
}
/* Set up backchain. */
if (__put_user(regs->gprs[15], (unsigned int *) frame))
if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
goto give_sigsegv;
/* Set up registers for signal handler */
......
......@@ -62,9 +62,9 @@ extern void tod_to_timeval(uint64_t todval, struct timeval *xtime);
/* internal function prototyes */
static int debug_init(void);
static ssize_t debug_output(struct file *file, char *user_buf,
static ssize_t debug_output(struct file *file, char __user *user_buf,
size_t user_len, loff_t * offset);
static ssize_t debug_input(struct file *file, const char *user_buf,
static ssize_t debug_input(struct file *file, const char __user *user_buf,
size_t user_len, loff_t * offset);
static int debug_open(struct inode *inode, struct file *file);
static int debug_close(struct inode *inode, struct file *file);
......@@ -74,10 +74,10 @@ static void debug_info_put(debug_info_t *);
static int debug_prolog_level_fn(debug_info_t * id,
struct debug_view *view, char *out_buf);
static int debug_input_level_fn(debug_info_t * id, struct debug_view *view,
struct file *file, const char *user_buf,
struct file *file, const char __user *user_buf,
size_t user_buf_size, loff_t * offset);
static int debug_input_flush_fn(debug_info_t * id, struct debug_view *view,
struct file *file, const char *user_buf,
struct file *file, const char __user *user_buf,
size_t user_buf_size, loff_t * offset);
static int debug_hex_ascii_format_fn(debug_info_t * id, struct debug_view *view,
char *out_buf, const char *in_buf);
......@@ -416,10 +416,10 @@ extern inline int debug_next_entry(file_private_info_t *p_info)
* - copies formated debug entries to the user buffer
*/
static ssize_t debug_output(struct file *file, /* file descriptor */
char *user_buf, /* user buffer */
size_t len, /* length of buffer */
loff_t *offset /* offset in the file */ )
static ssize_t debug_output(struct file *file, /* file descriptor */
char __user *user_buf, /* user buffer */
size_t len, /* length of buffer */
loff_t *offset) /* offset in the file */
{
size_t count = 0;
size_t entry_offset, size = 0;
......@@ -462,7 +462,7 @@ static ssize_t debug_output(struct file *file, /* file descriptor */
*/
static ssize_t debug_input(struct file *file,
const char *user_buf, size_t length,
const char __user *user_buf, size_t length,
loff_t *offset)
{
int rc = 0;
......@@ -942,7 +942,7 @@ static int debug_prolog_level_fn(debug_info_t * id,
*/
static int debug_input_level_fn(debug_info_t * id, struct debug_view *view,
struct file *file, const char *user_buf,
struct file *file, const char __user *user_buf,
size_t in_buf_size, loff_t * offset)
{
char input_buf[1];
......@@ -1004,9 +1004,9 @@ void debug_flush(debug_info_t* id, int area)
/*
* view function: flushes debug areas
*/
static int debug_input_flush_fn(debug_info_t * id, struct debug_view *view,
struct file *file, const char *user_buf,
struct file *file, const char __user *user_buf,
size_t in_buf_size, loff_t * offset)
{
char input_buf[1];
......
......@@ -48,7 +48,8 @@ SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE
_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_RESTART_SVC)
_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
_TIF_RESTART_SVC | _TIF_SINGLE_STEP )
_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
#define BASED(name) name-system_call(%r13)
......@@ -230,6 +231,7 @@ system_call:
lh %r7,0x8a # get svc number from lowcore
sysc_enter:
GET_THREAD_INFO # load pointer to task_struct to R9
sysc_do_svc:
sla %r7,2 # *4 and test for svc 0
bnz BASED(sysc_nr_ok) # svc number > 0
# svc 0: system call number in %r1
......@@ -265,7 +267,6 @@ sysc_work_loop:
bz BASED(sysc_leave) # there is no work to do
#
# One of the work bits is on. Find out which one.
# Checked are: _TIF_SIGPENDING and _TIF_NEED_RESCHED
#
sysc_work:
tm __TI_flags+3(%r9),_TIF_NEED_RESCHED
......@@ -274,6 +275,8 @@ sysc_work:
bo BASED(sysc_sigpending)
tm __TI_flags+3(%r9),_TIF_RESTART_SVC
bo BASED(sysc_restart)
tm __TI_flags+3(%r9),_TIF_SINGLE_STEP
bo BASED(sysc_singlestep)
b BASED(sysc_leave)
#
......@@ -307,6 +310,17 @@ sysc_restart:
lm %r2,%r6,SP_R2(%r15) # load svc arguments
b BASED(sysc_do_restart) # restart svc
#
# _TIF_SINGLE_STEP is set, call do_debugger_trap
#
sysc_singlestep:
ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
la %r2,SP_PTREGS(%r15) # address of register-save area
l %r1,BASED(.Lhandle_per) # load adr. of per handler
la %r14,BASED(sysc_return) # load adr. of system return
br %r1 # branch to do_debugger_trap
__critical_end:
#
......@@ -498,72 +512,15 @@ pgm_per_only:
#
pgm_svcper:
SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
lh %r7,0x8a # get svc number from lowcore
GET_THREAD_INFO # load pointer to task_struct to R9
lh %r7,0x8a # get svc number from lowcore
GET_THREAD_INFO # load pointer to task_struct to R9
l %r1,__TI_task(%r9)
mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
stosm 24(%r15),0x03 # reenable interrupts
sla %r7,2 # *4 and test for svc 0
bnz BASED(pgm_svcstd) # svc number > 0 ?
# svc 0: system call number in %r1
cl %r1,BASED(.Lnr_syscalls)
bnl BASED(pgm_svcstd)
lr %r7,%r1 # copy svc number to %r7
sla %r7,2 # *4
pgm_svcstd:
mvc SP_ARGS(4,%r15),SP_R7(%r15)
tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
l %r8,sys_call_table-system_call(%r7,%r13) # get system call addr.
bnz BASED(pgm_tracesys)
basr %r14,%r8 # call sys_xxxx
st %r2,SP_R2(%r15) # store return value (change R2 on stack)
# ATTENTION: check sys_execve_glue before
# changing anything here !!
pgm_svcret:
tm __TI_flags+3(%r9),_TIF_SIGPENDING
bno BASED(pgm_svcper_nosig)
la %r2,SP_PTREGS(%r15) # load pt_regs
sr %r3,%r3 # clear *oldset
l %r1,BASED(.Ldo_signal)
basr %r14,%r1 # call do_signal
pgm_svcper_nosig:
mvi SP_TRAP+3(%r15),0x28 # set trap indication to pgm check
la %r2,SP_PTREGS(15) # address of register-save area
l %r1,BASED(.Lhandle_per) # load adr. of per handler
la %r14,BASED(sysc_return) # load adr. of system return
br %r1 # branch to do_debugger_trap
#
# call trace before and after sys_call
#
pgm_tracesys:
l %r1,BASED(.Ltrace)
la %r2,SP_PTREGS(%r15) # load pt_regs
la %r3,0
srl %r7,2
st %r7,SP_R2(%r15)
basr %r14,%r1
clc SP_R2(4,%r15),BASED(.Lnr_syscalls)
bnl BASED(pgm_svc_nogo)
l %r7,SP_R2(%r15) # strace changed the syscall
sll %r7,2
l %r8,sys_call_table-system_call(%r7,%r13)
pgm_svc_go:
lm %r3,%r6,SP_R3(%r15)
l %r2,SP_ORIG_R2(%r15)
basr %r14,%r8 # call sys_xxx
st %r2,SP_R2(%r15) # store return value
pgm_svc_nogo:
tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
bz BASED(pgm_svcret)
l %r1,BASED(.Ltrace)
la %r2,SP_PTREGS(%r15) # load pt_regs
la %r3,1
la %r14,BASED(pgm_svcret)
br %r1
oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
stosm 24(%r15),0x03 # reenable interrupts
b BASED(sysc_do_svc)
/*
* IO interrupt handler routine
......
......@@ -48,7 +48,8 @@ SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE
_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_RESTART_SVC)
_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
_TIF_RESTART_SVC | _TIF_SINGLE_STEP )
_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
/*
......@@ -214,6 +215,7 @@ system_call:
llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
sysc_enter:
GET_THREAD_INFO # load pointer to task_struct to R9
sysc_do_svc:
slag %r7,%r7,2 # *4 and test for svc 0
jnz sysc_nr_ok
# svc 0: system call number in %r1
......@@ -257,7 +259,6 @@ sysc_work_loop:
jz sysc_leave # there is no work to do
#
# One of the work bits is on. Find out which one.
# Checked are: _TIF_SIGPENDING and _TIF_NEED_RESCHED
#
sysc_work:
tm __TI_flags+7(%r9),_TIF_NEED_RESCHED
......@@ -266,6 +267,8 @@ sysc_work:
jo sysc_sigpending
tm __TI_flags+7(%r9),_TIF_RESTART_SVC
jo sysc_restart
tm __TI_flags+7(%r9),_TIF_SINGLE_STEP
jo sysc_singlestep
j sysc_leave
#
......@@ -297,6 +300,17 @@ sysc_restart:
lmg %r2,%r6,SP_R2(%r15) # load svc arguments
j sysc_do_restart # restart svc
#
# _TIF_SINGLE_STEP is set, call do_debugger_trap
#
sysc_singlestep:
ni __TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
la %r2,SP_PTREGS(%r15) # address of register-save area
larl %r14,sysc_return # load adr. of system return
jg do_debugger_trap # branch to do_debugger_trap
__critical_end:
#
......@@ -531,76 +545,15 @@ pgm_per_only:
#
pgm_svcper:
SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
GET_THREAD_INFO # load pointer to task_struct to R9
llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
GET_THREAD_INFO # load pointer to task_struct to R9
lg %r1,__TI_task(%r9)
mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
stosm 48(%r15),0x03 # reenable interrupts
slag %r7,%r7,2 # *4 and test for svc 0
jnz pgm_svcstd
# svc 0: system call number in %r1
lghi %r0,NR_syscalls
clr %r1,%r0
slag %r7,%r1,2
pgm_svcstd:
mvc SP_ARGS(8,%r15),SP_R7(%r15)
larl %r10,sys_call_table
#ifdef CONFIG_S390_SUPPORT
tm SP_PSW+3(%r15),0x01 # are we running in 31 bit mode ?
jo pgm_svcper_noemu
larl %r10,sys_call_table_emu # use 31 bit emulation system calls
pgm_svcper_noemu:
#endif
tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
lgf %r8,0(%r7,%r10) # load address of system call routine
jnz pgm_tracesys
basr %r14,%r8 # call sys_xxxx
stg %r2,SP_R2(%r15) # store return value (change R2 on stack)
# ATTENTION: check sys_execve_glue before
# changing anything here !!
pgm_svcret:
tm __TI_flags+7(%r9),_TIF_SIGPENDING
jno pgm_svcper_nosig
la %r2,SP_PTREGS(%r15) # load pt_regs
sgr %r3,%r3 # clear *oldset
brasl %r14,do_signal
pgm_svcper_nosig:
lhi %r0,__LC_PGM_OLD_PSW # set trap indication back to pgm_chk
st %r0,SP_TRAP(%r15)
la %r2,SP_PTREGS(15) # address of register-save area
larl %r14,sysc_return # load adr. of system return
jg do_debugger_trap
#
# call trace before and after sys_call
#
pgm_tracesys:
la %r2,SP_PTREGS(%r15) # load pt_regs
la %r3,0
srlg %r7,%r7,2
stg %r7,SP_R2(%r15)
brasl %r14,syscall_trace
lghi %r0,NR_syscalls
clg %r0,SP_R2(%r15)
jnh pgm_svc_nogo
lg %r7,SP_R2(%r15)
sllg %r7,%r7,2 # strace wants to change the syscall
lgf %r8,0(%r7,%r10)
pgm_svc_go:
lmg %r3,%r6,SP_R3(%r15)
lg %r2,SP_ORIG_R2(%r15)
basr %r14,%r8 # call sys_xxx
stg %r2,SP_R2(%r15) # store return value
pgm_svc_nogo:
tm __TI_flags+7(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
jz pgm_svcret
la %r2,SP_PTREGS(%r15) # load pt_regs
la %r3,1
larl %r14,pgm_svcret # return point is sysc_return
jg syscall_trace
oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
stosm 48(%r15),0x03 # reenable interrupts
j sysc_do_svc
/*
* IO interrupt handler routine
......
......@@ -478,9 +478,80 @@ startup:basr %r13,0 # get base
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
.Lservicecall:
stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
stctl %r0, %r0,.Lcr-.LPG1(%r13) # get cr0
la %r1,0x200 # set bit 22
o %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
st %r1,.Lcr-.LPG1(%r13)
lctl %r0, %r0,.Lcr-.LPG1(%r13) # load modified cr0
mvc __LC_EXT_NEW_PSW(8),.Lpcext-.LPG1(%r13) # set postcall psw
la %r1, .Lsclph-.LPG1(%r13)
a %r1,__LC_EXT_NEW_PSW+4 # set handler
st %r1,__LC_EXT_NEW_PSW+4
la %r4,_pstart-.LPG1(%r13) # %r4 is our index for sccb stuff
la %r1, .Lsccb-PARMAREA(%r4) # our sccb
.insn rre,0xb2200000,%r2,%r1 # service call
ipm %r1
srl %r1,28 # get cc code
xr %r3, %r3
chi %r1,3
be .Lfchunk-.LPG1(%r13) # leave
chi %r1,2
be .Lservicecall-.LPG1(%r13)
lpsw .Lwaitsclp-.LPG1(%r13)
.Lsclph:
lh %r1,.Lsccbr-PARMAREA(%r4)
chi %r1,0x10 # 0x0010 is the sucess code
je .Lprocsccb # let's process the sccb
chi %r1,0x1f0
bne .Lfchunk-.LPG1(%r13) # unhandled error code
c %r2, .Lrcp-.LPG1(%r13) # Did we try Read SCP forced
bne .Lfchunk-.LPG1(%r13) # if no, give up
l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
b .Lservicecall-.LPG1(%r13)
.Lprocsccb:
lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
chi %r1,0x00
jne .Lscnd
l %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
.Lscnd:
xr %r3,%r3 # same logic
ic %r3,.Lscpa1-PARMAREA(%r4)
chi %r3,0x00
jne .Lcompmem
l %r3,.Lscpa2-PARMAREA(%r13)
.Lcompmem:
mr %r2,%r1 # mem in MB on 128-bit
l %r1,.Lonemb-.LPG1(%r13)
mr %r2,%r1 # mem size in bytes in %r3
b .Lfchunk-.LPG1(%r13)
.Lpmask:
.byte 0
.align 8
.Lpcext:.long 0x00080000,0x80000000
.Lcr:
.long 0x00 # place holder for cr0
.Lwaitsclp:
.long 0x020A0000
.long .Lsclph
.Lrcp:
.int 0x00120001 # Read SCP forced code
.Lrcp2:
.int 0x00020001 # Read SCP code
.Lonemb:
.int 0x100000
.Lfchunk:
#
# find memory chunks.
#
lr %r9,%r3 # end of mem
mvc __LC_PGM_NEW_PSW(8),.Lpcmem-.LPG1(%r13)
la %r1,1 # test in increments of 128KB
sll %r1,17
......@@ -488,38 +559,46 @@ startup:basr %r13,0 # get base
slr %r4,%r4 # set start of chunk to zero
slr %r5,%r5 # set end of chunk to zero
slr %r6,%r6 # set access code to zero
la %r10, MEMORY_CHUNKS # number of chunks
.Lloop:
tprot 0(%r5),0 # test protection of first byte
ipm %r7
srl %r7,28
clr %r6,%r7 # compare cc with last access code
be .Lsame-.LPG1(%r13)
clr %r4,%r5 # chunk size > 0?
be .Lsize0-.LPG1(%r13)
st %r4,0(%r3) # store start address of chunk
lr %r0,%r5
slr %r0,%r4
st %r0,4(%r3) # store size of chunk
st %r6,8(%r3) # store type of chunk
la %r3,12(%r3)
lr %r4,%r5 # set start to end
.Lsize0:
lr %r6,%r7 # set access code to last cc
b .Lchkmem-.LPG1(%r13)
.Lsame:
ar %r5,%r1 # add 128KB to end of chunk
bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
.Lchkmem: # > 2GB or tprot got a program check
clr %r4,%r5 # chunk size > 0?
be .Ldonemem-.LPG1(%r13)
be .Lchkloop-.LPG1(%r13)
st %r4,0(%r3) # store start address of chunk
lr %r0,%r5
slr %r0,%r4
st %r0,4(%r3) # store size of chunk
st %r6,8(%r3) # store type of chunk
la %r3,12(%r3)
l %r4,.Lmemsize-.LPG1(%r13) # address of variable memory_size
st %r5,0(%r4) # store last end to memory size
ahi %r10,-1 # update chunk number
.Lchkloop:
lr %r6,%r7 # set access code to last cc
# we got an exception or we're starting a new
# chunk , we must check if we should
# still try to find valid memory (if we detected
# the amount of available storage), and if we
# have chunks left
xr %r0,%r0
clr %r0,%r9 # did we detect memory?
je .Ldonemem # if not, leave
chi %r10,0 # do we have chunks left?
je .Ldonemem
alr %r5,%r1 # add 128KB to end of chunk
lr %r4,%r5 # potential new chunk
clr %r5,%r9 # should we go on?
jl .Lloop
.Ldonemem:
l %r1,.Lmemsize-.LPG1(%r13) # address of variable memory_size
st %r5,0(%r1) # store last end to memory size
l %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags
#
# find out if we are running under VM
......@@ -631,6 +710,23 @@ _pstart:
.byte "root=/dev/ram0 ro"
.byte 0
.org 0x11000
.Lsccb:
.hword 0x1000 # length, one page
.byte 0x00,0x00,0x00
.byte 0x80 # variable response bit set
.Lsccbr:
.hword 0x00 # response code
.Lscpincr1:
.hword 0x00
.Lscpa1:
.byte 0x00
.fill 89,1,0
.Lscpa2:
.int 0x00
.Lscpincr2:
.quad 0x00
.fill 3984,1,0
.org 0x12000
.global _pend
_pend:
......
......@@ -480,12 +480,81 @@ startup:basr %r13,0 # get base
mvcle %r2,%r4,0 # clear mem
jo .-4 # branch back, if not finish
l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
.Lservicecall:
stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
stctg %r0,%r0,.Lcr-.LPG1(%r13) # get cr0
la %r1,0x200 # set bit 22
og %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
stg %r1,.Lcr-.LPG1(%r13)
lctlg %r0,%r0,.Lcr-.LPG1(%r13) # load modified cr0
mvc __LC_EXT_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) # set postcall psw
larl %r1,.Lsclph
stg %r1,__LC_EXT_NEW_PSW+8 # set handler
larl %r4,_pstart # %r4 is our index for sccb stuff
la %r1,.Lsccb-PARMAREA(%r4) # our sccb
.insn rre,0xb2200000,%r2,%r1 # service call
ipm %r1
srl %r1,28 # get cc code
xr %r3,%r3
chi %r1,3
be .Lfchunk-.LPG1(%r13) # leave
chi %r1,2
be .Lservicecall-.LPG1(%r13)
lpsw .Lwaitsclp-.LPG1(%r13)
.Lsclph:
lh %r1,.Lsccbr-PARMAREA(%r4)
chi %r1,0x10 # 0x0010 is the sucess code
je .Lprocsccb # let's process the sccb
chi %r1,0x1f0
bne .Lfchunk-.LPG1(%r13) # unhandled error code
c %r2,.Lrcp-.LPG1(%r13) # Did we try Read SCP forced
bne .Lfchunk-.LPG1(%r13) # if no, give up
l %r2,.Lrcp2-.LPG1(%r13) # try with Read SCP
b .Lservicecall-.LPG1(%r13)
.Lprocsccb:
lh %r1,.Lscpincr1-PARMAREA(%r4) # use this one if != 0
chi %r1,0x00
jne .Lscnd
lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one
.Lscnd:
xr %r3,%r3 # same logic
ic %r3,.Lscpa1-PARMAREA(%r4)
chi %r3,0x00
jne .Lcompmem
l %r3,.Lscpa2-PARMAREA(%r13)
.Lcompmem:
mlgr %r2,%r1 # mem in MB on 128-bit
l %r1,.Lonemb-.LPG1(%r13)
mlgr %r2,%r1 # mem size in bytes in %r3
b .Lfchunk-.LPG1(%r13)
.Lpmask:
.byte 0
.align 8
.Lcr:
.quad 0x00 # place holder for cr0
.Lwaitsclp:
.long 0x020A0000
.quad .Lsclph
.Lrcp:
.int 0x00120001 # Read SCP forced code
.Lrcp2:
.int 0x00020001 # Read SCP code
.Lonemb:
.int 0x100000
.Lfchunk:
# set program check new psw mask
mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13)
#
# find memory chunks.
#
lgr %r9,%r3 # end of mem
larl %r1,.Lchkmem # set program check address
stg %r1,__LC_PGM_NEW_PSW+8
la %r1,1 # test in increments of 128KB
......@@ -494,51 +563,51 @@ startup:basr %r13,0 # get base
slgr %r4,%r4 # set start of chunk to zero
slgr %r5,%r5 # set end of chunk to zero
slr %r6,%r6 # set access code to zero
la %r10,MEMORY_CHUNKS # number of chunks
.Lloop:
tprot 0(%r5),0 # test protection of first byte
ipm %r7
srl %r7,28
clr %r6,%r7 # compare cc with last access code
je .Lsame
clgr %r4,%r5 # chunk size > 0?
je .Lsize0
stg %r4,0(%r3) # store start address of chunk
lgr %r0,%r5
slgr %r0,%r4
stg %r0,8(%r3) # store size of chunk
st %r6,20(%r3) # store type of chunk
la %r3,24(%r3)
lgr %r4,%r5 # set start to end
larl %r8,memory_size
stg %r5,0(%r8) # store memory size
.Lsize0:
lr %r6,%r7 # set access code to last cc
j .Lchkmem
.Lsame:
algr %r5,%r1 # add 128KB to end of chunk
brc 12,.Lloop
# no need to check here,
brc 12,.Lloop # this is the same chunk
.Lchkmem: # > 16EB or tprot got a program check
clgr %r4,%r5 # chunk size > 0?
je .Ldonemem
je .Lchkloop
stg %r4,0(%r3) # store start address of chunk
lgr %r0,%r5
slgr %r0,%r4
stg %r0,8(%r3) # store size of chunk
st %r6,20(%r3) # store type of chunk
la %r3,24(%r3)
lgr %r4,%r5
larl %r8,memory_size
stg %r5,0(%r8) # store memory size
#
# Running native the HSA is located at 2GB and we will get an
# addressing exception trying to access it. We have to restart
# the scan at 2GB to find out if the machine has more than 2GB.
#
ahi %r10,-1 # update chunk number
.Lchkloop:
lr %r6,%r7 # set access code to last cc
# we got an exception or we're starting a new
# chunk , we must check if we should
# still try to find valid memory (if we detected
# the amount of available storage), and if we
# have chunks left
lghi %r4,1
sllg %r4,%r4,31
clgr %r5,%r4
jhe .Ldonemem
lgr %r5,%r4
j .Lloop
je .Lhsaskip
xr %r0, %r0
clgr %r0, %r9 # did we detect memory?
je .Ldonemem # if not, leave
chi %r10, 0 # do we have chunks left?
je .Ldonemem
.Lhsaskip:
algr %r5,%r1 # add 128KB to end of chunk
lgr %r4,%r5 # potential new chunk
clgr %r5,%r9 # should we go on?
jl .Lloop
.Ldonemem:
larl %r12,machine_flags
......@@ -640,6 +709,23 @@ _pstart:
.byte "root=/dev/ram0 ro"
.byte 0
.org 0x11000
.Lsccb:
.hword 0x1000 # length, one page
.byte 0x00,0x00,0x00
.byte 0x80 # variable response bit set
.Lsccbr:
.hword 0x00 # response code
.Lscpincr1:
.hword 0x00
.Lscpa1:
.byte 0x00
.fill 89,1,0
.Lscpa2:
.int 0x00
.Lscpincr2:
.quad 0x00
.fill 3984,1,0
.org 0x12000
.global _pend
_pend:
......
......@@ -16,6 +16,7 @@
*/
#include <linux/config.h>
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -292,12 +293,12 @@ asmlinkage long sys_clone(struct pt_regs regs)
{
unsigned long clone_flags;
unsigned long newsp;
int *parent_tidptr, *child_tidptr;
int __user *parent_tidptr, *child_tidptr;
clone_flags = regs.gprs[3];
newsp = regs.orig_gpr2;
parent_tidptr = (int *) regs.gprs[4];
child_tidptr = (int *) regs.gprs[5];
parent_tidptr = (int __user *) regs.gprs[4];
child_tidptr = (int __user *) regs.gprs[5];
if (!newsp)
newsp = regs.gprs[15];
return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0,
......@@ -328,12 +329,12 @@ asmlinkage long sys_execve(struct pt_regs regs)
int error;
char * filename;
filename = getname((char *) regs.orig_gpr2);
filename = getname((char __user *) regs.orig_gpr2);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
error = do_execve(filename, (char **) regs.gprs[3],
(char **) regs.gprs[4], &regs);
error = do_execve(filename, (char __user * __user *) regs.gprs[3],
(char __user * __user *) regs.gprs[4], &regs);
if (error == 0) {
current->ptrace &= ~PT_DTRACE;
current->thread.fp_regs.fpc = 0;
......
......@@ -19,7 +19,8 @@ static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
return len;
}
static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
static int prof_cpu_mask_write_proc (struct file *file,
const char __user *buffer,
unsigned long count, void *data)
{
cpumask_t *mask = (cpumask_t *)data;
......
......@@ -176,7 +176,7 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
} else
tmp = 0;
return put_user(tmp, (addr_t *) data);
return put_user(tmp, (addr_t __user *) data);
}
/*
......@@ -269,7 +269,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
if (copied != sizeof(tmp))
return -EIO;
return put_user(tmp, (unsigned long *) data);
return put_user(tmp, (unsigned long __user *) data);
case PTRACE_PEEKUSR:
/* read the word at location addr in the USER area. */
......@@ -291,7 +291,8 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
case PTRACE_PEEKUSR_AREA:
case PTRACE_POKEUSR_AREA:
if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
if (copy_from_user(&parea, (void __user *) addr,
sizeof(parea)))
return -EFAULT;
addr = parea.kernel_addr;
data = parea.process_addr;
......@@ -301,7 +302,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data)
ret = peek_user(child, addr, data);
else {
addr_t tmp;
if (get_user (tmp, (addr_t *) data))
if (get_user (tmp, (addr_t __user *) data))
return -EFAULT;
ret = poke_user(child, addr, tmp);
}
......@@ -402,7 +403,7 @@ peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
} else
tmp = 0;
return put_user(tmp, (__u32 *) data);
return put_user(tmp, (__u32 __user *) data);
}
/*
......@@ -509,7 +510,7 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
if (copied != sizeof(tmp))
return -EIO;
return put_user(tmp, (unsigned int *) data);
return put_user(tmp, (unsigned int __user *) data);
case PTRACE_PEEKUSR:
/* read the word at location addr in the USER area. */
......@@ -530,7 +531,8 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
case PTRACE_PEEKUSR_AREA:
case PTRACE_POKEUSR_AREA:
if (copy_from_user(&parea, (void *) addr, sizeof(parea)))
if (copy_from_user(&parea, (void __user *) addr,
sizeof(parea)))
return -EFAULT;
addr = parea.kernel_addr;
data = parea.process_addr;
......@@ -540,7 +542,7 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
ret = peek_user_emu31(child, addr, data);
else {
__u32 tmp;
if (get_user (tmp, (__u32 *) data))
if (get_user (tmp, (__u32 __user *) data))
return -EFAULT;
ret = poke_user_emu31(child, addr, tmp);
}
......
......@@ -44,25 +44,6 @@ EXPORT_SYMBOL(__up);
EXPORT_SYMBOL(__down);
EXPORT_SYMBOL(__down_interruptible);
/*
* string functions
*/
EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(strlen);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strcmp);
EXPORT_SYMBOL_NOVERS(strncat);
EXPORT_SYMBOL_NOVERS(strncmp);
EXPORT_SYMBOL_NOVERS(strncpy);
EXPORT_SYMBOL_NOVERS(strnlen);
EXPORT_SYMBOL_NOVERS(strrchr);
EXPORT_SYMBOL_NOVERS(strstr);
EXPORT_SYMBOL_NOVERS(strpbrk);
EXPORT_SYMBOL_NOVERS(strcpy);
/*
* binfmt_elf loader
*/
......
......@@ -53,7 +53,9 @@ unsigned int console_device = -1;
unsigned int console_irq = -1;
unsigned long memory_size = 0;
unsigned long machine_flags = 0;
struct { unsigned long addr, size, type; } memory_chunk[16] = { { 0 } };
struct {
unsigned long addr, size, type;
} memory_chunk[MEMORY_CHUNKS] = { { 0 } };
#define CHUNK_READ_WRITE 0
#define CHUNK_READ_ONLY 1
int cpus_initialized = 0;
......
......@@ -77,8 +77,9 @@ sys_sigsuspend(struct pt_regs * regs, int history0, int history1,
}
}
asmlinkage int
sys_rt_sigsuspend(struct pt_regs * regs,sigset_t *unewset, size_t sigsetsize)
asmlinkage long
sys_rt_sigsuspend(struct pt_regs *regs, sigset_t __user *unewset,
size_t sigsetsize)
{
sigset_t saveset, newset;
......@@ -105,9 +106,9 @@ sys_rt_sigsuspend(struct pt_regs * regs,sigset_t *unewset, size_t sigsetsize)
}
}
asmlinkage int
sys_sigaction(int sig, const struct old_sigaction *act,
struct old_sigaction *oact)
asmlinkage long
sys_sigaction(int sig, const struct old_sigaction __user *act,
struct old_sigaction __user *oact)
{
struct k_sigaction new_ka, old_ka;
int ret;
......@@ -137,8 +138,9 @@ sys_sigaction(int sig, const struct old_sigaction *act,
return ret;
}
asmlinkage int
sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
asmlinkage long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs)
{
return do_sigaltstack(uss, uoss, regs->gprs[15]);
}
......@@ -146,7 +148,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss, struct pt_regs *regs)
/* Returns non-zero on fault. */
static int save_sigregs(struct pt_regs *regs, _sigregs *sregs)
static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
{
unsigned long old_mask = regs->psw.mask;
int err;
......@@ -175,7 +177,7 @@ static int save_sigregs(struct pt_regs *regs, _sigregs *sregs)
}
/* Returns positive number on error */
static int restore_sigregs(struct pt_regs *regs, _sigregs *sregs)
static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
{
unsigned long old_mask = regs->psw.mask;
int err;
......@@ -208,7 +210,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs *sregs)
asmlinkage long sys_sigreturn(struct pt_regs *regs)
{
sigframe *frame = (sigframe *)regs->gprs[15];
sigframe __user *frame = (sigframe __user *)regs->gprs[15];
sigset_t set;
if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
......@@ -234,7 +236,7 @@ asmlinkage long sys_sigreturn(struct pt_regs *regs)
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
{
rt_sigframe *frame = (rt_sigframe *)regs->gprs[15];
rt_sigframe __user *frame = (rt_sigframe __user *)regs->gprs[15];
sigset_t set;
if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
......@@ -269,7 +271,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
/*
* Determine which stack to use..
*/
static inline void *
static inline void __user *
get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
{
unsigned long sp;
......@@ -290,7 +292,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
sp = (unsigned long) ka->sa.sa_restorer;
}
return (void *)((sp - frame_size) & -8ul);
return (void __user *)((sp - frame_size) & -8ul);
}
static inline int map_signal(int sig)
......@@ -306,7 +308,9 @@ static inline int map_signal(int sig)
static void setup_frame(int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs * regs)
{
sigframe *frame = get_sigframe(ka, regs, sizeof(sigframe));
sigframe __user *frame;
frame = get_sigframe(ka, regs, sizeof(sigframe));
if (!access_ok(VERIFY_WRITE, frame, sizeof(sigframe)))
goto give_sigsegv;
......@@ -326,13 +330,13 @@ static void setup_frame(int sig, struct k_sigaction *ka,
} else {
regs->gprs[14] = (unsigned long)
frame->retcode | PSW_ADDR_AMODE;
if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
(u16 *)(frame->retcode)))
if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
(u16 __user *)(frame->retcode)))
goto give_sigsegv;
}
/* Set up backchain. */
if (__put_user(regs->gprs[15], (addr_t *) frame))
if (__put_user(regs->gprs[15], (addr_t __user *) frame))
goto give_sigsegv;
/* Set up registers for signal handler */
......@@ -358,7 +362,9 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs * regs)
{
int err = 0;
rt_sigframe *frame = get_sigframe(ka, regs, sizeof(rt_sigframe));
rt_sigframe __user *frame;
frame = get_sigframe(ka, regs, sizeof(rt_sigframe));
if (!access_ok(VERIFY_WRITE, frame, sizeof(rt_sigframe)))
goto give_sigsegv;
......@@ -385,12 +391,12 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
} else {
regs->gprs[14] = (unsigned long)
frame->retcode | PSW_ADDR_AMODE;
err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
(u16 *)(frame->retcode));
err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
(u16 __user *)(frame->retcode));
}
/* Set up backchain. */
if (__put_user(regs->gprs[15], (addr_t *) frame))
if (__put_user(regs->gprs[15], (addr_t __user *) frame))
goto give_sigsegv;
/* Set up registers for signal handler */
......
......@@ -37,7 +37,7 @@
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way Unix traditionally does this, though.
*/
asmlinkage long sys_pipe(unsigned long * fildes)
asmlinkage long sys_pipe(unsigned long __user *fildes)
{
int fd[2];
int error;
......@@ -92,7 +92,7 @@ struct mmap_arg_struct {
unsigned long offset;
};
asmlinkage long sys_mmap2(struct mmap_arg_struct *arg)
asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg)
{
struct mmap_arg_struct a;
int error = -EFAULT;
......@@ -104,7 +104,7 @@ asmlinkage long sys_mmap2(struct mmap_arg_struct *arg)
return error;
}
asmlinkage long old_mmap(struct mmap_arg_struct *arg)
asmlinkage long old_mmap(struct mmap_arg_struct __user *arg)
{
struct mmap_arg_struct a;
long error = -EFAULT;
......@@ -128,7 +128,7 @@ struct sel_arg_struct {
struct timeval *tvp;
};
asmlinkage long old_select(struct sel_arg_struct *arg)
asmlinkage long old_select(struct sel_arg_struct __user *arg)
{
struct sel_arg_struct a;
......@@ -145,37 +145,37 @@ asmlinkage long old_select(struct sel_arg_struct *arg)
*
* This is really horribly ugly.
*/
asmlinkage long sys_ipc (uint call, int first, int second,
unsigned long third, void *ptr)
asmlinkage long sys_ipc(uint call, int first, int second,
unsigned long third, void __user *ptr)
{
struct ipc_kludge tmp;
int ret;
switch (call) {
case SEMOP:
return sys_semtimedop (first, (struct sembuf *) ptr, second,
return sys_semtimedop (first, (struct sembuf __user *) ptr, second,
NULL);
case SEMTIMEDOP:
return sys_semtimedop (first, (struct sembuf *) ptr, second,
(const struct timespec *) third);
return sys_semtimedop (first, (struct sembuf __user *) ptr, second,
(const struct timespec __user *) third);
case SEMGET:
return sys_semget (first, second, third);
case SEMCTL: {
union semun fourth;
if (!ptr)
return -EINVAL;
if (get_user(fourth.__pad, (void **) ptr))
if (get_user(fourth.__pad, (void __user * __user *) ptr))
return -EFAULT;
return sys_semctl (first, second, third, fourth);
}
}
case MSGSND:
return sys_msgsnd (first, (struct msgbuf *) ptr,
return sys_msgsnd (first, (struct msgbuf __user *) ptr,
second, third);
break;
case MSGRCV:
if (!ptr)
return -EINVAL;
if (copy_from_user (&tmp, (struct ipc_kludge *) ptr,
if (copy_from_user (&tmp, (struct ipc_kludge __user *) ptr,
sizeof (struct ipc_kludge)))
return -EFAULT;
return sys_msgrcv (first, tmp.msgp,
......@@ -183,33 +183,33 @@ asmlinkage long sys_ipc (uint call, int first, int second,
case MSGGET:
return sys_msgget ((key_t) first, second);
case MSGCTL:
return sys_msgctl (first, second, (struct msqid_ds *) ptr);
return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
case SHMAT: {
ulong raddr;
ret = do_shmat (first, (char *) ptr, second, &raddr);
ret = do_shmat (first, (char __user *) ptr, second, &raddr);
if (ret)
return ret;
return put_user (raddr, (ulong *) third);
return put_user (raddr, (ulong __user *) third);
break;
}
case SHMDT:
return sys_shmdt ((char *)ptr);
case SHMDT:
return sys_shmdt ((char __user *)ptr);
case SHMGET:
return sys_shmget (first, second, third);
case SHMCTL:
return sys_shmctl (first, second,
(struct shmid_ds *) ptr);
(struct shmid_ds __user *) ptr);
default:
return -ENOSYS;
}
return -EINVAL;
}
#ifdef CONFIG_ARCH_S390X
asmlinkage long s390x_newuname(struct new_utsname * name)
asmlinkage long s390x_newuname(struct new_utsname __user *name)
{
int ret = sys_newuname(name);
......@@ -256,7 +256,7 @@ struct fadvise64_64_args {
};
asmlinkage long
s390_fadvise64_64(struct fadvise64_64_args *args)
s390_fadvise64_64(struct fadvise64_64_args __user *args)
{
struct fadvise64_64_args a;
......
......@@ -188,7 +188,7 @@ void show_registers(struct pt_regs *regs)
printk("%s Code: ", mode);
for (i = 0; i < 20; i++) {
unsigned char c;
if (__get_user(c, (char *)(regs->psw.addr + i))) {
if (__get_user(c, (char __user *)(regs->psw.addr + i))) {
printk(" Bad PSW.");
break;
}
......@@ -391,7 +391,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
local_irq_enable();
if (regs->psw.mask & PSW_MASK_PSTATE)
get_user(*((__u16 *) opcode), location);
get_user(*((__u16 *) opcode), (__u16 __user *)location);
else
*((__u16 *)opcode)=*((__u16 *)location);
if (*((__u16 *)opcode)==S390_BREAKPOINT_U16)
......
......@@ -4,6 +4,6 @@
EXTRA_AFLAGS := -traditional
lib-y += delay.o
lib-$(CONFIG_ARCH_S390_31) += memset.o strcmp.o strcpy.o strncpy.o uaccess.o
lib-$(CONFIG_ARCH_S390X) += memset64.o strcmp64.o strcpy64.o strncpy64.o uaccess64.o
lib-y += delay.o string.o
lib-$(CONFIG_ARCH_S390_31) += uaccess.o
lib-$(CONFIG_ARCH_S390X) += uaccess64.o
/*
* arch/s390/lib/memset.S
* S390 fast memset routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address to memory area
* R3 = byte to fill memory with
* R4 = number of bytes to fill
*/
.globl memset
memset:
LTR 4,4
JZ memset_end
LR 0,2 # save pointer to memory area
LR 1,3 # move pad byte to R1
LR 3,4
SR 4,4 # no source for MVCLE, only a pad byte
SR 5,5
MVCLE 2,4,0(1) # thats it, MVCLE is your friend
JO .-4
LR 2,0 # return pointer to mem.
memset_end:
BR 14
/*
* arch/s390/lib/memset.S
* S390 fast memset routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address to memory area
* R3 = byte to fill memory with
* R4 = number of bytes to fill
*/
.globl memset
memset:
LTGR 4,4
JZ memset_end
LGR 0,2 # save pointer to memory area
LGR 1,3 # move pad byte to R1
LGR 3,4
SGR 4,4 # no source for MVCLE, only a pad byte
SGR 5,5
MVCLE 2,4,0(1) # thats it, MVCLE is your friend
JO .-4
LGR 2,0 # return pointer to mem.
memset_end:
BR 14
/*
* arch/s390/lib/strcmp.S
* S390 strcmp routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of compare string
* R3 = address of test string
*/
.globl strcmp
strcmp:
SR 0,0
SR 1,1
CLST 2,3
JO .-4
JE strcmp_equal
IC 0,0(3)
IC 1,0(2)
SR 1,0
strcmp_equal:
LR 2,1
BR 14
/*
* arch/s390/lib/strcmp.S
* S390 strcmp routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of compare string
* R3 = address of test string
*/
.globl strcmp
strcmp:
SGR 0,0
SGR 1,1
CLST 2,3
JO .-4
JE strcmp_equal
IC 0,0(3)
IC 1,0(2)
SGR 1,0
strcmp_equal:
LGR 2,1
BR 14
/*
* arch/s390/kernel/strcpy.S
* S390 strcpy routine
*
* S390 version
* Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of destination
* R3 = address of source string
*/
.globl strcpy
strcpy:
sr %r0,%r0
0: mvst %r2,%r3
jo 0b
br %r14
/*
* arch/s390/kernel/strcpy.S
* S390 strcpy routine
*
* S390 version
* Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of destination
* R3 = address of source string
*/
.globl strcpy
strcpy:
sgr %r0,%r0
0: mvst %r2,%r3
jo 0b
br %r14
/*
* arch/s390/lib/string.c
* Optimized string functions
*
* S390 version
* Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
*/
#define IN_ARCH_STRING_C 1
#include <linux/types.h>
#include <linux/module.h>
/*
* Helper functions to find the end of a string
*/
static inline char *__strend(const char *s)
{
register unsigned long r0 asm("0") = 0;
asm volatile ("0: srst %0,%1\n"
" jo 0b"
: "+d" (r0), "+a" (s) : : "cc" );
return (char *) r0;
}
static inline char *__strnend(const char *s, size_t n)
{
register unsigned long r0 asm("0") = 0;
const char *p = s + n;
asm volatile ("0: srst %0,%1\n"
" jo 0b"
: "+d" (p), "+a" (s) : "d" (r0) : "cc" );
return (char *) p;
}
/**
* strlen - Find the length of a string
* @s: The string to be sized
*
* returns the length of @s
*/
size_t strlen(const char *s)
{
return __strend(s) - s;
}
EXPORT_SYMBOL_NOVERS(strlen);
/**
* strnlen - Find the length of a length-limited string
* @s: The string to be sized
* @n: The maximum number of bytes to search
*
* returns the minimum of the length of @s and @n
*/
size_t strnlen(const char * s, size_t n)
{
return __strnend(s, n) - s;
}
EXPORT_SYMBOL_NOVERS(strnlen);
/**
* strcpy - Copy a %NUL terminated string
* @dest: Where to copy the string to
* @src: Where to copy the string from
*
* returns a pointer to @dest
*/
char *strcpy(char *dest, const char *src)
{
register int r0 asm("0") = 0;
char *ret = dest;
asm volatile ("0: mvst %0,%1\n"
" jo 0b"
: "+&a" (dest), "+&a" (src) : "d" (r0)
: "cc", "memory" );
return ret;
}
EXPORT_SYMBOL_NOVERS(strcpy);
/**
* strlcpy - Copy a %NUL terminated string into a sized buffer
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @size: size of destination buffer
*
* Compatible with *BSD: the result is always a valid
* NUL-terminated string that fits in the buffer (unless,
* of course, the buffer size is zero). It does not pad
* out the result like strncpy() does.
*/
size_t strlcpy(char *dest, const char *src, size_t size)
{
size_t ret = __strend(src) - src;
if (size) {
size_t len = (ret >= size) ? size-1 : ret;
dest[len] = '\0';
__builtin_memcpy(dest, src, len);
}
return ret;
}
EXPORT_SYMBOL_NOVERS(strlcpy);
/**
* strncpy - Copy a length-limited, %NUL-terminated string
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @n: The maximum number of bytes to copy
*
* The result is not %NUL-terminated if the source exceeds
* @n bytes.
*/
char *strncpy(char *dest, const char *src, size_t n)
{
size_t len = __strnend(src, n) - src;
__builtin_memset(dest + len, 0, n - len);
__builtin_memcpy(dest, src, len);
return dest;
}
EXPORT_SYMBOL_NOVERS(strncpy);
/**
* strcat - Append one %NUL-terminated string to another
* @dest: The string to be appended to
* @src: The string to append to it
*
* returns a pointer to @dest
*/
char *strcat(char *dest, const char *src)
{
register int r0 asm("0") = 0;
unsigned long dummy;
char *ret = dest;
asm volatile ("0: srst %0,%1\n"
" jo 0b\n"
"1: mvst %0,%2\n"
" jo 1b"
: "=&a" (dummy), "+a" (dest), "+a" (src)
: "d" (r0), "0" (0UL) : "cc", "memory" );
return ret;
}
EXPORT_SYMBOL_NOVERS(strcat);
/**
* strlcat - Append a length-limited, %NUL-terminated string to another
* @dest: The string to be appended to
* @src: The string to append to it
* @n: The size of the destination buffer.
*/
size_t strlcat(char *dest, const char *src, size_t n)
{
size_t dsize = __strend(dest) - dest;
size_t len = __strend(src) - src;
size_t res = dsize + len;
if (dsize < n) {
dest += dsize;
n -= dsize;
if (len >= n)
len = n - 1;
dest[len] = '\0';
__builtin_memcpy(dest, src, len);
}
return res;
}
EXPORT_SYMBOL_NOVERS(strlcat);
/**
* strncat - Append a length-limited, %NUL-terminated string to another
* @dest: The string to be appended to
* @src: The string to append to it
* @n: The maximum numbers of bytes to copy
*
* returns a pointer to @dest
*
* Note that in contrast to strncpy, strncat ensures the result is
* terminated.
*/
char *strncat(char *dest, const char *src, size_t n)
{
size_t len = __strnend(src, n) - src;
char *p = __strend(dest);
p[len] = '\0';
__builtin_memcpy(p, src, len);
return dest;
}
EXPORT_SYMBOL_NOVERS(strncat);
/**
* strcmp - Compare two strings
* @cs: One string
* @ct: Another string
*
* returns 0 if @cs and @ct are equal,
* < 0 if @cs is less than @ct
* > 0 if @cs is greater than @ct
*/
int strcmp(const char *cs, const char *ct)
{
register int r0 asm("0") = 0;
int ret = 0;
asm volatile ("0: clst %2,%3\n"
" jo 0b\n"
" je 1f\n"
" ic %0,0(%2)\n"
" ic %1,0(%3)\n"
" sr %0,%1\n"
"1:"
: "+d" (ret), "+d" (r0), "+a" (cs), "+a" (ct)
: : "cc" );
return ret;
}
EXPORT_SYMBOL_NOVERS(strcmp);
/**
* strrchr - Find the last occurrence of a character in a string
* @s: The string to be searched
* @c: The character to search for
*/
char * strrchr(const char * s, int c)
{
size_t len = __strend(s) - s;
if (len)
do {
if (s[len] == (char) c)
return (char *) s + len;
} while (--len > 0);
return 0;
}
EXPORT_SYMBOL_NOVERS(strrchr);
/**
* strstr - Find the first substring in a %NUL terminated string
* @s1: The string to be searched
* @s2: The string to search for
*/
char * strstr(const char * s1,const char * s2)
{
int l1, l2;
l2 = __strend(s2) - s2;
if (!l2)
return (char *) s1;
l1 = __strend(s1) - s1;
while (l1-- >= l2) {
register unsigned long r2 asm("2") = (unsigned long) s1;
register unsigned long r3 asm("3") = (unsigned long) l2;
register unsigned long r4 asm("4") = (unsigned long) s2;
register unsigned long r5 asm("5") = (unsigned long) l2;
int cc;
asm volatile ("0: clcle %1,%3,0\n"
" jo 0b\n"
" ipm %0\n"
" srl %0,28"
: "=&d" (cc), "+a" (r2), "+a" (r3),
"+a" (r4), "+a" (r5) : : "cc" );
if (!cc)
return (char *) s1;
s1++;
}
return 0;
}
EXPORT_SYMBOL_NOVERS(strstr);
/**
* memchr - Find a character in an area of memory.
* @s: The memory area
* @c: The byte to search for
* @n: The size of the area.
*
* returns the address of the first occurrence of @c, or %NULL
* if @c is not found
*/
void *memchr(const void *s, int c, size_t n)
{
register int r0 asm("0") = (char) c;
const void *ret = s + n;
asm volatile ("0: srst %0,%1\n"
" jo 0b\n"
" jl 1f\n"
" la %0,0\n"
"1:"
: "+a" (ret), "+&a" (s) : "d" (r0) : "cc" );
return (void *) ret;
}
EXPORT_SYMBOL_NOVERS(memchr);
/**
* memcmp - Compare two areas of memory
* @cs: One area of memory
* @ct: Another area of memory
* @count: The size of the area.
*/
int memcmp(const void *cs, const void *ct, size_t n)
{
register unsigned long r2 asm("2") = (unsigned long) cs;
register unsigned long r3 asm("3") = (unsigned long) n;
register unsigned long r4 asm("4") = (unsigned long) ct;
register unsigned long r5 asm("5") = (unsigned long) n;
int ret;
asm volatile ("0: clcle %1,%3,0\n"
" jo 0b\n"
" ipm %0\n"
" srl %0,28"
: "=&d" (ret), "+a" (r2), "+a" (r3), "+a" (r4), "+a" (r5)
: : "cc" );
if (ret)
ret = *(char *) r2 - *(char *) r4;
return ret;
}
EXPORT_SYMBOL_NOVERS(memcmp);
/**
* memscan - Find a character in an area of memory.
* @s: The memory area
* @c: The byte to search for
* @n: The size of the area.
*
* returns the address of the first occurrence of @c, or 1 byte past
* the area if @c is not found
*/
void *memscan(void *s, int c, size_t n)
{
register int r0 asm("0") = (char) c;
const void *ret = s + n;
asm volatile ("0: srst %0,%1\n"
" jo 0b\n"
: "+a" (ret), "+&a" (s) : "d" (r0) : "cc" );
return (void *) ret;
}
EXPORT_SYMBOL_NOVERS(memscan);
/**
* memcpy - Copy one area of memory to another
* @dest: Where to copy to
* @src: Where to copy from
* @n: The size of the area.
*
* returns a pointer to @dest
*/
void *memcpy(void *dest, const void *src, size_t n)
{
return __builtin_memcpy(dest, src, n);
}
EXPORT_SYMBOL_NOVERS(memcpy);
/**
* bcopy - Copy one area of memory to another
* @src: Where to copy from
* @dest: Where to copy to
* @n: The size of the area.
*
* Note that this is the same as memcpy(), with the arguments reversed.
* memcpy() is the standard, bcopy() is a legacy BSD function.
*/
void bcopy(const void *srcp, void *destp, size_t n)
{
__builtin_memcpy(destp, srcp, n);
}
EXPORT_SYMBOL_NOVERS(bcopy);
/**
* memset - Fill a region of memory with the given value
* @s: Pointer to the start of the area.
* @c: The byte to fill the area with
* @n: The size of the area.
*
* returns a pointer to @s
*/
void *memset(void *s, int c, size_t n)
{
char *xs;
if (c == 0)
return __builtin_memset(s, 0, n);
xs = (char *) s;
if (n > 0)
do {
*xs++ = c;
} while (--n > 0);
return s;
}
EXPORT_SYMBOL_NOVERS(memset);
/*
* missing exports for string functions defined in lib/string.c
*/
EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(strchr);
EXPORT_SYMBOL_NOVERS(strnchr);
EXPORT_SYMBOL_NOVERS(strncmp);
EXPORT_SYMBOL_NOVERS(strpbrk);
/*
* arch/s390/kernel/strncpy.S
* S390 strncpy routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of destination
* R3 = address of source string
* R4 = max number of bytes to copy
*/
.globl strncpy
strncpy:
LR 1,2 # don't touch address in R2
LTR 4,4
JZ strncpy_exit # 0 bytes -> nothing to do
SR 0,0
strncpy_loop:
ICM 0,1,0(3) # ICM sets the cc, IC does not
LA 3,1(3)
STC 0,0(1)
LA 1,1(1)
JZ strncpy_pad # ICM inserted a 0x00
BRCT 4,strncpy_loop # R4 -= 1, jump to strncpy_loop if > 0
strncpy_exit:
BR 14
strncpy_clear:
STC 0,0(1)
LA 1,1(1)
strncpy_pad:
BRCT 4,strncpy_clear
BR 14
/*
* arch/s390/kernel/strncpy.S
* S390 strncpy routine
*
* S390 version
* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
*/
/*
* R2 = address of destination
* R3 = address of source string
* R4 = max number of bytes to copy
*/
.globl strncpy
strncpy:
LGR 1,2 # don't touch address in R2
LTR 4,4
JZ strncpy_exit # 0 bytes -> nothing to do
SGR 0,0
strncpy_loop:
ICM 0,1,0(3) # ICM sets the cc, IC does not
LA 3,1(3)
STC 0,0(1)
LA 1,1(1)
JZ strncpy_pad # ICM inserted a 0x00
BRCTG 4,strncpy_loop # R4 -= 1, jump to strncpy_loop if > 0
strncpy_exit:
BR 14
strncpy_clear:
STC 0,0(1)
LA 1,1(1)
strncpy_pad:
BRCTG 4,strncpy_clear
BR 14
......@@ -154,46 +154,57 @@ __clear_user_asm:
.align 4
.text
.globl __strncpy_from_user_asm
# %r2 = dst, %r3 = src, %r4 = count
# %r2 = count, %r3 = dst, %r4 = src
__strncpy_from_user_asm:
lhi %r0,0
lhi %r1,1
lhi %r5,0
0: mvcp 0(%r1,%r2),0(%r3),%r0
tm 0(%r2),0xff
jz 1f
la %r2,1(%r2)
la %r3,1(%r3)
ahi %r5,1
clr %r5,%r4
jl 0b
1: lr %r2,%r5
lr %r1,%r4
la %r4,0(%r4) # clear high order bit from %r4
la %r2,0(%r2,%r4) # %r2 points to first byte after string
sacf 256
0: srst %r2,%r1
jo 0b
sacf 0
lr %r1,%r2
jh 1f # \0 found in string ?
ahi %r1,1 # include \0 in copy
1: slr %r1,%r4 # %r1 = copy length (without \0)
slr %r2,%r4 # %r2 = return length (including \0)
2: mvcp 0(%r1,%r3),0(%r4),%r0
jnz 3f
br %r14
2: lhi %r2,-EFAULT
3: la %r3,256(%r3)
la %r4,256(%r4)
ahi %r1,-256
mvcp 0(%r1,%r3),0(%r4),%r0
jnz 3b
br %r14
.section __ex_table,"a"
.long 0b,2b
4: sacf 0
lhi %r2,-EFAULT
br %r14
.section __ex_table,"a"
.long 0b,4b
.previous
.align 4
.text
.globl __strnlen_user_asm
# %r2 = src, %r3 = count
# %r2 = count, %r3 = src
__strnlen_user_asm:
lhi %r0,0
lhi %r1,1
lhi %r5,0
0: mvcp 24(%r1,%r15),0(%r2),%r0
ahi %r5,1
tm 24(%r15),0xff
jz 1f
la %r2,1(%r2)
clr %r5,%r3
jl 0b
1: lr %r2,%r5
lr %r1,%r3
la %r3,0(%r3) # clear high order bit from %r4
la %r2,0(%r2,%r3) # %r2 points to first byte after string
sacf 256
0: srst %r2,%r1
jo 0b
sacf 0
jh 1f # \0 found in string ?
ahi %r2,1 # strnlen_user result includes the \0
1: slr %r2,%r3
br %r14
2: lhi %r2,-EFAULT
2: sacf 0
lhi %r2,-EFAULT
br %r14
.section __ex_table,"a"
.section __ex_table,"a"
.long 0b,2b
.previous
......@@ -152,46 +152,55 @@ __clear_user_asm:
.align 4
.text
.globl __strncpy_from_user_asm
# %r2 = dst, %r3 = src, %r4 = count
# %r2 = count, %r3 = dst, %r4 = src
__strncpy_from_user_asm:
lghi %r0,0
lghi %r1,1
lghi %r5,0
0: mvcp 0(%r1,%r2),0(%r3),%r0
tm 0(%r2),0xff
jz 1f
la %r2,1(%r2)
la %r3,1(%r3)
aghi %r5,1
clgr %r5,%r4
jl 0b
1: lgr %r2,%r5
lgr %r1,%r4
la %r2,0(%r2,%r4) # %r2 points to first byte after string
sacf 256
0: srst %r2,%r1
jo 0b
sacf 0
lgr %r1,%r2
jh 1f # \0 found in string ?
aghi %r1,1 # include \0 in copy
1: slgr %r1,%r4 # %r1 = copy length (without \0)
slgr %r2,%r4 # %r2 = return length (including \0)
2: mvcp 0(%r1,%r3),0(%r4),%r0
jnz 3f
br %r14
2: lghi %r2,-EFAULT
3: la %r3,256(%r3)
la %r4,256(%r4)
aghi %r1,-256
mvcp 0(%r1,%r3),0(%r4),%r0
jnz 3b
br %r14
.section __ex_table,"a"
.quad 0b,2b
4: sacf 0
lghi %r2,-EFAULT
br %r14
.section __ex_table,"a"
.quad 0b,4b
.previous
.align 4
.text
.globl __strnlen_user_asm
# %r2 = src, %r3 = count
# %r2 = count, %r3 = src
__strnlen_user_asm:
lghi %r0,0
lghi %r1,1
lghi %r5,0
0: mvcp 24(%r1,%r15),0(%r2),%r0
aghi %r5,1
tm 24(%r15),0xff
jz 1f
la %r2,1(%r2)
clgr %r5,%r3
jl 0b
1: lgr %r2,%r5
lgr %r1,%r3
la %r2,0(%r2,%r3) # %r2 points to first byte after string
sacf 256
0: srst %r2,%r1
jo 0b
sacf 0
jh 1f # \0 found in string ?
aghi %r2,1 # strnlen_user result includes the \0
1: slgr %r2,%r3
br %r14
2: lghi %r2,-EFAULT
2: sacf 0
lghi %r2,-EFAULT
br %r14
.section __ex_table,"a"
.section __ex_table,"a"
.quad 0b,2b
.previous
......@@ -55,7 +55,9 @@ struct dcss_segment {
static spinlock_t dcss_lock = SPIN_LOCK_UNLOCKED;
static struct list_head dcss_list = LIST_HEAD_INIT(dcss_list);
extern struct {unsigned long addr, size, type;} memory_chunk[16];
extern struct {
unsigned long addr, size, type;
} memory_chunk[MEMORY_CHUNKS];
/*
* Create the 8 bytes, ebcdic VM segment name from
......@@ -258,16 +260,16 @@ int segment_load(char *name, int segtype, unsigned long *addr,
shared segment */
dcss_diag_query(dcss_name, &rwattr, &shattr, &segstart, &segend);
/* does segment collide with main memory? */
for (i=0; i<16; i++) {
if (memory_chunk[i].type != 0)
continue;
if (memory_chunk[i].addr > segend)
continue;
if (memory_chunk[i].addr + memory_chunk[i].size <= segstart)
continue;
spin_unlock(&dcss_lock);
return -ENOENT;
}
for (i=0; i < MEMORY_CHUNKS; i++) {
if (memory_chunk[i].type != 0)
continue;
if (memory_chunk[i].addr > segend)
continue;
if (memory_chunk[i].addr + memory_chunk[i].size <= segstart)
continue;
spin_unlock(&dcss_lock);
return -ENOENT;
}
/* or does it collide with other (loaded) segments? */
list_for_each(l, &dcss_list) {
tmp = list_entry(l, struct dcss_segment, list);
......
......@@ -134,5 +134,5 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
void iounmap(void *addr)
{
if (addr > high_memory)
return vfree(addr);
vfree(addr);
}
......@@ -25,7 +25,8 @@
#define NR_BANKS 5
static int mce_disabled __initdata;
/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic */
/* 0: always panic, 1: panic if deadlock possible, 2: try to avoid panic,
3: never panic or exit (for testing only) */
static int tolerant = 1;
static int banks;
static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
......@@ -105,7 +106,10 @@ static void mce_panic(char *msg, struct mce *backup, unsigned long start)
}
if (backup)
print_mce(backup);
panic(msg);
if (tolerant >= 3)
printk("Fake panic: %s\n", msg);
else
panic(msg);
}
static int mce_available(struct cpuinfo_x86 *c)
......@@ -151,23 +155,30 @@ void do_machine_check(struct pt_regs * regs, long error_code)
if (!bank[i])
continue;
/* Did this bank cause the exception? */
/* XXX: check more flags */
if ((m.status & MCI_STATUS_PCC)) {
panicm = m;
} else {
m.rip = 0;
m.cs = 0;
}
m.misc = 0;
m.addr = 0;
rdmsrl(MSR_IA32_MC0_STATUS + i*4, m.status);
if ((m.status & MCI_STATUS_VAL) == 0)
continue;
/* Should be implied by the banks check above, but
check it anyways */
if ((m.status & MCI_STATUS_EN) == 0)
continue;
/* Did this bank cause the exception? */
/* Assume that the bank with uncorrectable errors did it,
and that there is only a single one. */
if (m.status & MCI_STATUS_UC) {
panicm = m;
} else {
m.rip = 0;
m.cs = 0;
}
nowayout |= !!(m.status & (MCI_STATUS_OVER|MCI_STATUS_PCC));
/* In theory _OVER could be a nowayout too, but
assume any overflowed errors were no fatal. */
nowayout |= !!(m.status & MCI_STATUS_PCC);
kill_it |= !!(m.status & MCI_STATUS_UC);
m.bank = i;
......@@ -206,7 +217,8 @@ void do_machine_check(struct pt_regs * regs, long error_code)
/* do_exit takes an awful lot of locks and has as slight risk
of deadlocking. If you don't want that don't set tolerant >= 2 */
do_exit(SIGBUS);
if (tolerant < 3)
do_exit(SIGBUS);
}
}
......
......@@ -211,7 +211,8 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
int unhandled_signal(struct task_struct *tsk, int sig)
{
/* Warn for strace, but not for gdb */
if ((tsk->ptrace & (PT_PTRACED|PT_TRACESYSGOOD)) == PT_PTRACED)
if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
(tsk->ptrace & PT_PTRACED))
return 0;
return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
(tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
......@@ -374,7 +375,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
(address >> 32))
return;
if (exception_trace && !unhandled_signal(tsk, SIGSEGV)) {
if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {
printk(KERN_INFO
"%s[%d]: segfault at %016lx rip %016lx rsp %016lx error %lx\n",
tsk->comm, tsk->pid, address, regs->rip,
......
......@@ -108,8 +108,21 @@ static void make_page_uptodate(struct page *page)
struct buffer_head *head = bh;
do {
if (!buffer_uptodate(bh))
if (!buffer_uptodate(bh)) {
memset(bh->b_data, 0, bh->b_size);
/*
* akpm: I'm totally undecided about this. The
* buffer has just been magically brought "up to
* date", but nobody should want to be reading
* it anyway, because it hasn't been used for
* anything yet. It is still in a "not read
* from disk yet" state.
*
* But non-uptodate buffers against an uptodate
* page are against the rules. So do it anyway.
*/
set_buffer_uptodate(bh);
}
} while ((bh = bh->b_this_page) != head);
} else {
memset(page_address(page), 0, PAGE_CACHE_SIZE);
......
......@@ -104,9 +104,12 @@ reset_netjet_s(struct IsdnCardState *cs)
cs->hw.njet.ctrl_reg = 0xff; /* Reset On */
byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
mdelay(10);
cs->hw.njet.ctrl_reg = 0x00; /* Reset Off and status read clear */
/* now edge triggered for TJ320 GE 13/07/00 */
/* see comment in IRQ function */
if (cs->subtyp) /* TJ320 */
cs->hw.njet.ctrl_reg = 0x40; /* Reset Off and status read clear */
else
cs->hw.njet.ctrl_reg = 0x00; /* Reset Off and status read clear */
byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
mdelay(10);
cs->hw.njet.auxd = 0;
......@@ -151,7 +154,7 @@ static struct pci_dev *dev_netjet __initdata = NULL;
int __init
setup_netjet_s(struct IsdnCard *card)
{
int bytecnt;
int bytecnt,cfg;
struct IsdnCardState *cs = card->cs;
char tmp[64];
......@@ -183,6 +186,15 @@ setup_netjet_s(struct IsdnCard *card)
printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
return(0);
}
/* the TJ300 and TJ320 must be detected, the IRQ handling is different
* unfortunatly the chips use the same device ID, but the TJ320 has
* the bit20 in status PCI cfg register set
*/
pci_read_config_dword(dev_netjet, 0x04, &cfg);
if (cfg & 0x00100000)
cs->subtyp = 1; /* TJ320 */
else
cs->subtyp = 0; /* TJ300 */
/* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
if ((dev_netjet->subsystem_vendor == 0x55) &&
(dev_netjet->subsystem_device == 0x02)) {
......@@ -240,8 +252,8 @@ setup_netjet_s(struct IsdnCard *card)
bytecnt = 256;
printk(KERN_INFO
"NETjet-S: PCI card configured at %#lx IRQ %d\n",
cs->hw.njet.base, cs->irq);
"NETjet-S: %s card configured at %#lx IRQ %d\n",
cs->subtyp ? "TJ320" : "TJ300", cs->hw.njet.base, cs->irq);
if (!request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn")) {
printk(KERN_WARNING
"HiSax: %s config port %#lx-%#lx already in use\n",
......
......@@ -58,7 +58,7 @@ static int
dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args)
{
struct dasd_device *device;
struct cmbdata * __user udata;
struct cmbdata __user *udata;
struct cmbdata data;
size_t size;
int ret;
......@@ -66,7 +66,7 @@ dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args)
device = bdev->bd_disk->private_data;
if (!device)
return -EINVAL;
udata = (void *) args;
udata = (void __user *) args;
size = _IOC_SIZE(no);
if (!access_ok(VERIFY_WRITE, udata, size))
......
......@@ -1289,7 +1289,7 @@ dasd_eckd_performance(struct block_device *bdev, int no, long args)
/* Prepare for Read Subsystem Data */
prssdp = (struct dasd_psf_prssd_data *) cqr->data;
stats = (struct dasd_rssd_perf_stats_t *) (prssdp + 1);
rc = copy_to_user((long *) args, (long *) stats,
rc = copy_to_user((long __user *) args, (long *) stats,
sizeof(struct dasd_rssd_perf_stats_t));
}
dasd_sfree_request(cqr, cqr->device);
......@@ -1319,10 +1319,10 @@ dasd_eckd_get_attrib (struct block_device *bdev, int no, long args)
private = (struct dasd_eckd_private *) device->private;
attrib = private->attrib;
rc = copy_to_user((long *) args, (long *) &attrib,
rc = copy_to_user((long __user *) args, (long *) &attrib,
sizeof (struct attrib_data_t));
return rc;
}
......@@ -1346,7 +1346,7 @@ dasd_eckd_set_attrib(struct block_device *bdev, int no, long args)
if (device == NULL)
return -ENODEV;
if (copy_from_user(&attrib, (void *) args,
if (copy_from_user(&attrib, (void __user *) args,
sizeof (struct attrib_data_t))) {
return -EFAULT;
}
......
......@@ -120,7 +120,7 @@ static int
dasd_ioctl_api_version(struct block_device *bdev, int no, long args)
{
int ver = DASD_API_VERSION;
return put_user(ver, (int *) args);
return put_user(ver, (int __user *) args);
}
/*
......@@ -305,7 +305,7 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args)
return -ENODEV;
if (test_bit(DASD_FLAG_RO, &device->flags))
return -EROFS;
if (copy_from_user(&fdata, (void *) args,
if (copy_from_user(&fdata, (void __user *) args,
sizeof (struct format_data_t)))
return -EFAULT;
if (bdev != bdev->bd_contains) {
......@@ -348,7 +348,7 @@ dasd_ioctl_read_profile(struct block_device *bdev, int no, long args)
if (device == NULL)
return -ENODEV;
if (copy_to_user((long *) args, (long *) &device->profile,
if (copy_to_user((long __user *) args, (long *) &device->profile,
sizeof (struct dasd_profile_info_t)))
return -EFAULT;
return 0;
......@@ -441,9 +441,9 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev),
flags);
}
rc = 0;
if (copy_to_user((long *) args, (long *) dasd_info,
if (copy_to_user((long __user *) args, (long *) dasd_info,
((no == (unsigned int) BIODASDINFO2) ?
sizeof (struct dasd_information2_t) :
sizeof (struct dasd_information_t))))
......@@ -466,7 +466,7 @@ dasd_ioctl_set_ro(struct block_device *bdev, int no, long args)
if (bdev != bdev->bd_contains)
// ro setting is not allowed for partitions
return -EINVAL;
if (get_user(intval, (int *) args))
if (get_user(intval, (int __user *) args))
return -EFAULT;
device = bdev->bd_disk->private_data;
if (device == NULL)
......@@ -499,7 +499,7 @@ dasd_ioctl_getgeo(struct block_device *bdev, int no, long args)
geo = (struct hd_geometry) {};
device->discipline->fill_geometry(device, &geo);
geo.start = get_start_sect(bdev) >> device->s2b_shift;
if (copy_to_user((struct hd_geometry *) args, &geo,
if (copy_to_user((struct hd_geometry __user *) args, &geo,
sizeof (struct hd_geometry)))
return -EFAULT;
......
......@@ -30,7 +30,7 @@ static struct proc_dir_entry *dasd_devices_entry = NULL;
static struct proc_dir_entry *dasd_statistics_entry = NULL;
static inline char *
dasd_get_user_string(const char *user_buf, size_t user_len)
dasd_get_user_string(const char __user *user_buf, size_t user_len)
{
char *buffer;
......@@ -239,7 +239,7 @@ dasd_statistics_read(char *page, char **start, off_t off,
}
static int
dasd_statistics_write(struct file *file, const char *user_buf,
dasd_statistics_write(struct file *file, const char __user *user_buf,
unsigned long user_len, void *data)
{
#ifdef CONFIG_DASD_PROFILE
......
......@@ -155,7 +155,7 @@ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
{
int cc;
__asm__ __volatile(
__asm__ __volatile__ (
" lhi %0,2\n" /* return unused cc 2 if pgin traps */
" .insn rre,0xb22e0000,%1,%2\n" /* pgin %1,%2 */
"0: ipm %0\n"
......@@ -203,7 +203,7 @@ static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
{
int cc;
__asm__ __volatile(
__asm__ __volatile__ (
" lhi %0,2\n" /* return unused cc 2 if pgout traps */
" .insn rre,0xb22f0000,%1,%2\n" /* pgout %1,%2 */
"0: ipm %0\n"
......@@ -332,16 +332,16 @@ static int xpram_make_request(request_queue_t *q, struct bio *bio)
static int xpram_ioctl (struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
struct hd_geometry *geo;
struct hd_geometry __user *geo;
unsigned long size;
if (cmd != HDIO_GETGEO)
if (cmd != HDIO_GETGEO)
return -EINVAL;
/*
* get geometry: we have to fake one... trim the size to a
* multiple of 64 (32k): tell we have 16 sectors, 4 heads,
* whatever cylinders. Tell also that data starts at sector. 4.
*/
geo = (struct hd_geometry *) arg;
geo = (struct hd_geometry __user *) arg;
size = (xpram_pages * 8) & ~0x3f;
put_user(size >> 6, &geo->cylinders);
put_user(4, &geo->heads);
......@@ -423,7 +423,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
return 0;
}
static struct request_queue xpram_queue;
static struct request_queue *xpram_queue;
static int __init xpram_setup_blkdev(void)
{
......@@ -450,8 +450,13 @@ static int __init xpram_setup_blkdev(void)
* Assign the other needed values: make request function, sizes and
* hardsect size. All the minor devices feature the same value.
*/
blk_queue_make_request(&xpram_queue, xpram_make_request);
blk_queue_hardsect_size(&xpram_queue, 4096);
xpram_queue = blk_alloc_queue(GFP_KERNEL);
if (!xpram_queue) {
rc = -ENOMEM;
goto out_unreg;
}
blk_queue_make_request(xpram_queue, xpram_make_request);
blk_queue_hardsect_size(xpram_queue, 4096);
/*
* Setup device structures.
......@@ -467,7 +472,7 @@ static int __init xpram_setup_blkdev(void)
disk->first_minor = i;
disk->fops = &xpram_devops;
disk->private_data = &xpram_devices[i];
disk->queue = &xpram_queue;
disk->queue = xpram_queue;
sprintf(disk->disk_name, "slram%d", i);
sprintf(disk->devfs_name, "slram/%d", i);
set_capacity(disk, xpram_sizes[i] << 1);
......@@ -475,6 +480,9 @@ static int __init xpram_setup_blkdev(void)
}
return 0;
out_unreg:
devfs_remove("slram");
unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
out:
while (i--)
put_disk(xpram_disks[i]);
......@@ -493,6 +501,7 @@ static void __exit xpram_exit(void)
}
unregister_blkdev(XPRAM_MAJOR, XPRAM_NAME);
devfs_remove("slram");
blk_cleanup_queue(xpram_queue);
sysdev_unregister(&xpram_sys_device);
sysdev_class_unregister(&xpram_sysclass);
}
......
......@@ -1002,7 +1002,8 @@ tty3215_write(struct tty_struct * tty, int from_user,
ret = 0;
while (count > 0) {
length = count < 80 ? count : 80;
length -= copy_from_user(raw->ubuffer, buf, length);
length -= copy_from_user(raw->ubuffer,
(const unsigned char __user *)buf, length);
if (length == 0) {
if (!ret)
ret = -EFAULT;
......
......@@ -338,7 +338,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
* Ioctl stuff.
*/
static int
do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry *user_kbe,
do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe,
int cmd, int perm)
{
struct kbentry tmp;
......@@ -410,7 +410,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry *user_kbe,
}
static int
do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry *u_kbs,
do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs,
int cmd, int perm)
{
unsigned char kb_func;
......@@ -464,9 +464,12 @@ int
kbd_ioctl(struct kbd_data *kbd, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct kbdiacrs *a;
struct kbdiacrs __user *a;
void __user *argp;
int ct, perm;
argp = (void __user *)arg;
/*
* To have permissions to do most of the vt ioctls, we either have
* to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
......@@ -474,15 +477,15 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file,
perm = current->signal->tty == kbd->tty || capable(CAP_SYS_TTY_CONFIG);
switch (cmd) {
case KDGKBTYPE:
return put_user(KB_101, (char*) arg);
return put_user(KB_101, (char __user *)argp);
case KDGKBENT:
case KDSKBENT:
return do_kdsk_ioctl(kbd, (struct kbentry *)arg, cmd, perm);
return do_kdsk_ioctl(kbd, argp, cmd, perm);
case KDGKBSENT:
case KDSKBSENT:
return do_kdgkb_ioctl(kbd, (struct kbsentry *)arg, cmd, perm);
return do_kdgkb_ioctl(kbd, argp, cmd, perm);
case KDGKBDIACR:
a = (struct kbdiacrs *) arg;
a = argp;
if (put_user(kbd->accent_table_size, &a->kb_cnt))
return -EFAULT;
......@@ -492,7 +495,7 @@ kbd_ioctl(struct kbd_data *kbd, struct file *file,
return -EFAULT;
return 0;
case KDSKBDIACR:
a = (struct kbdiacrs *) arg;
a = argp;
if (!perm)
return -EPERM;
if (get_user(ct, &a->kb_cnt))
......
......@@ -112,46 +112,46 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
switch (cmd) {
case TIOCSCLPSHTAB:
/* set width of horizontal tab */
if (get_user(sclp_ioctls.htab, (unsigned short *) arg))
if (get_user(sclp_ioctls.htab, (unsigned short __user *) arg))
rc = -EFAULT;
else
check = 1;
break;
case TIOCSCLPGHTAB:
/* get width of horizontal tab */
if (put_user(sclp_ioctls.htab, (unsigned short *) arg))
if (put_user(sclp_ioctls.htab, (unsigned short __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSECHO:
/* enable/disable echo of input */
if (get_user(sclp_ioctls.echo, (unsigned char *) arg))
if (get_user(sclp_ioctls.echo, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPGECHO:
/* Is echo of input enabled ? */
if (put_user(sclp_ioctls.echo, (unsigned char *) arg))
if (put_user(sclp_ioctls.echo, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSCOLS:
/* set number of columns for output */
if (get_user(sclp_ioctls.columns, (unsigned short *) arg))
if (get_user(sclp_ioctls.columns, (unsigned short __user *) arg))
rc = -EFAULT;
else
check = 1;
break;
case TIOCSCLPGCOLS:
/* get number of columns for output */
if (put_user(sclp_ioctls.columns, (unsigned short *) arg))
if (put_user(sclp_ioctls.columns, (unsigned short __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSNL:
/* enable/disable writing without final new line character */
if (get_user(sclp_ioctls.final_nl, (signed char *) arg))
if (get_user(sclp_ioctls.final_nl, (signed char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPGNL:
/* Is writing without final new line character enabled ? */
if (put_user(sclp_ioctls.final_nl, (signed char *) arg))
if (put_user(sclp_ioctls.final_nl, (signed char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSOBUF:
......@@ -160,7 +160,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
* up to next 4kB boundary and stored as number of SCCBs
* (4kB Buffers) limitation: 256 x 4kB
*/
if (get_user(obuf, (unsigned int *) arg) == 0) {
if (get_user(obuf, (unsigned int __user *) arg) == 0) {
if (obuf & 0xFFF)
sclp_ioctls.max_sccb = (obuf >> 12) + 1;
else
......@@ -171,22 +171,22 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
case TIOCSCLPGOBUF:
/* get the maximum buffers size for output */
obuf = sclp_ioctls.max_sccb << 12;
if (put_user(obuf, (unsigned int *) arg))
if (put_user(obuf, (unsigned int __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPGKBUF:
/* get the number of buffers got from kernel at startup */
if (put_user(sclp_ioctls.kmem_sccb, (unsigned short *) arg))
if (put_user(sclp_ioctls.kmem_sccb, (unsigned short __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSCASE:
/* enable/disable conversion from upper to lower case */
if (get_user(sclp_ioctls.tolower, (unsigned char *) arg))
if (get_user(sclp_ioctls.tolower, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPGCASE:
/* Is conversion from upper to lower case of input enabled? */
if (put_user(sclp_ioctls.tolower, (unsigned char *) arg))
if (put_user(sclp_ioctls.tolower, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSDELIM:
......@@ -194,7 +194,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
* set special character used for separating upper and
* lower case, 0x00 disables this feature
*/
if (get_user(sclp_ioctls.delim, (unsigned char *) arg))
if (get_user(sclp_ioctls.delim, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPGDELIM:
......@@ -202,7 +202,7 @@ sclp_tty_ioctl(struct tty_struct *tty, struct file * file,
* get special character used for separating upper and
* lower case, 0x00 disables this feature
*/
if (put_user(sclp_ioctls.delim, (unsigned char *) arg))
if (put_user(sclp_ioctls.delim, (unsigned char __user *) arg))
rc = -EFAULT;
break;
case TIOCSCLPSINIT:
......@@ -415,7 +415,8 @@ sclp_tty_write(struct tty_struct *tty, int from_user,
while (count > 0) {
length = count < SCLP_TTY_BUF_SIZE ?
count : SCLP_TTY_BUF_SIZE;
length -= copy_from_user(sclp_tty_chars, buf, length);
length -= copy_from_user(sclp_tty_chars,
(const unsigned char __user *)buf, length);
if (length == 0) {
if (!ret)
ret = -EFAULT;
......
......@@ -490,7 +490,8 @@ sclp_vt220_write(struct tty_struct *tty, int from_user,
while (count > 0) {
length = count < SCLP_VT220_BUF_SIZE ?
count : SCLP_VT220_BUF_SIZE;
length -= copy_from_user(tty->driver_data, buf, length);
length -= copy_from_user(tty->driver_data,
(const unsigned char __user *)buf, length);
if (length == 0) {
if (!ret)
return -EFAULT;
......
......@@ -32,7 +32,7 @@ struct gendisk;
#ifdef DBF_LIKE_HELL
#define DBF_LH(level, str, ...) \
do { \
debug_sprintf_event(tape_dbf_area, level, str, ## __VA_ARGS__); \
debug_sprintf_event(TAPE_DBF_AREA, level, str, ## __VA_ARGS__); \
} while (0)
#else
#define DBF_LH(level, str, ...) do {} while(0)
......@@ -43,12 +43,12 @@ do { \
*/
#define DBF_EVENT(d_level, d_str...) \
do { \
debug_sprintf_event(tape_dbf_area, d_level, d_str); \
debug_sprintf_event(TAPE_DBF_AREA, d_level, d_str); \
} while (0)
#define DBF_EXCEPTION(d_level, d_str...) \
do { \
debug_sprintf_exception(tape_dbf_area, d_level, d_str); \
debug_sprintf_exception(TAPE_DBF_AREA, d_level, d_str); \
} while (0)
#define TAPE_VERSION_MAJOR 2
......@@ -313,7 +313,7 @@ extern void tape_dump_sense_dbf(struct tape_device *, struct tape_request *,
extern void tape_med_state_set(struct tape_device *, enum tape_medium_state);
/* The debug area */
extern debug_info_t *tape_dbf_area;
extern debug_info_t *TAPE_DBF_AREA;
/* functions for building ccws */
static inline struct ccw1 *
......
......@@ -15,11 +15,19 @@
#include <linux/bio.h>
#include <linux/workqueue.h>
#define TAPE_DBF_AREA tape_34xx_dbf
#include "tape.h"
#include "tape_std.h"
#define PRINTK_HEADER "TAPE_34XX: "
/*
* Pointer to debug area.
*/
debug_info_t *TAPE_DBF_AREA = NULL;
EXPORT_SYMBOL(TAPE_DBF_AREA);
enum tape_34xx_type {
tape_3480,
tape_3490,
......@@ -885,7 +893,7 @@ tape_34xx_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg)
if (cmd == TAPE390_DISPLAY) {
struct display_struct disp;
if (copy_from_user(&disp, (char *) arg, sizeof(disp)) != 0)
if (copy_from_user(&disp, (char __user *) arg, sizeof(disp)) != 0)
return -EFAULT;
return tape_std_display(device, &disp);
......@@ -1343,7 +1351,13 @@ tape_34xx_init (void)
{
int rc;
DBF_EVENT(3, "34xx init: $Revision: 1.20 $\n");
TAPE_DBF_AREA = debug_register ( "tape_34xx", 1, 2, 4*sizeof(long));
debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view);
#ifdef DBF_LIKE_HELL
debug_set_level(TAPE_DBF_AREA, 6);
#endif
DBF_EVENT(3, "34xx init: $Revision: 1.21 $\n");
/* Register driver for 3480/3490 tapes. */
rc = ccw_driver_register(&tape_34xx_driver);
if (rc)
......@@ -1357,12 +1371,14 @@ static void
tape_34xx_exit(void)
{
ccw_driver_unregister(&tape_34xx_driver);
debug_unregister(TAPE_DBF_AREA);
}
MODULE_DEVICE_TABLE(ccw, tape_34xx_ids);
MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH");
MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape "
"device driver ($Revision: 1.20 $)");
"device driver ($Revision: 1.21 $)");
MODULE_LICENSE("GPL");
module_init(tape_34xx_init);
......
......@@ -19,6 +19,8 @@
#include <asm/debug.h>
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
#define PRINTK_HEADER "TAPE_BLOCK: "
......
......@@ -18,6 +18,8 @@
#include <asm/uaccess.h>
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
#include "tape_std.h"
#include "tape_class.h"
......@@ -29,8 +31,8 @@
/*
* file operation structure for tape character frontend
*/
static ssize_t tapechar_read(struct file *, char *, size_t, loff_t *);
static ssize_t tapechar_write(struct file *, const char *, size_t, loff_t *);
static ssize_t tapechar_read(struct file *, char __user *, size_t, loff_t *);
static ssize_t tapechar_write(struct file *, const char __user *, size_t, loff_t *);
static int tapechar_open(struct inode *,struct file *);
static int tapechar_release(struct inode *,struct file *);
static int tapechar_ioctl(struct inode *, struct file *, unsigned int,
......@@ -134,7 +136,7 @@ tapechar_check_idalbuffer(struct tape_device *device, size_t block_size)
* Tape device read function
*/
ssize_t
tapechar_read (struct file *filp, char *data, size_t count, loff_t *ppos)
tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
{
struct tape_device *device;
struct tape_request *request;
......@@ -208,7 +210,7 @@ tapechar_read (struct file *filp, char *data, size_t count, loff_t *ppos)
* Tape device write function
*/
ssize_t
tapechar_write(struct file *filp, const char *data, size_t count, loff_t *ppos)
tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t *ppos)
{
struct tape_device *device;
struct tape_request *request;
......@@ -389,7 +391,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
if (no == MTIOCTOP) {
struct mtop op;
if (copy_from_user(&op, (char *) data, sizeof(op)) != 0)
if (copy_from_user(&op, (char __user *) data, sizeof(op)) != 0)
return -EFAULT;
if (op.mt_count < 0)
return -EINVAL;
......@@ -436,7 +438,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
if (rc < 0)
return rc;
pos.mt_blkno = rc;
if (copy_to_user((char *) data, &pos, sizeof(pos)) != 0)
if (copy_to_user((char __user *) data, &pos, sizeof(pos)) != 0)
return -EFAULT;
return 0;
}
......@@ -466,7 +468,7 @@ tapechar_ioctl(struct inode *inp, struct file *filp,
get.mt_blkno = rc;
}
if (copy_to_user((char *) data, &get, sizeof(get)) != 0)
if (copy_to_user((char __user *) data, &get, sizeof(get)) != 0)
return -EFAULT;
return 0;
......
......@@ -20,6 +20,8 @@
#include <asm/types.h> // for variable types
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
#include "tape_std.h"
......@@ -39,7 +41,8 @@ static rwlock_t tape_device_lock = RW_LOCK_UNLOCKED;
/*
* Pointer to debug area.
*/
debug_info_t *tape_dbf_area = NULL;
debug_info_t *TAPE_DBF_AREA = NULL;
EXPORT_SYMBOL(TAPE_DBF_AREA);
/*
* Printable strings for tape enumerations.
......@@ -1176,12 +1179,12 @@ tape_mtop(struct tape_device *device, int mt_op, int mt_count)
static int
tape_init (void)
{
tape_dbf_area = debug_register ( "tape", 1, 2, 4*sizeof(long));
debug_register_view(tape_dbf_area, &debug_sprintf_view);
TAPE_DBF_AREA = debug_register ( "tape", 1, 2, 4*sizeof(long));
debug_register_view(TAPE_DBF_AREA, &debug_sprintf_view);
#ifdef DBF_LIKE_HELL
debug_set_level(tape_dbf_area, 6);
debug_set_level(TAPE_DBF_AREA, 6);
#endif
DBF_EVENT(3, "tape init: ($Revision: 1.49 $)\n");
DBF_EVENT(3, "tape init: ($Revision: 1.50 $)\n");
tape_proc_init();
tapechar_init ();
tapeblock_init ();
......@@ -1200,19 +1203,18 @@ tape_exit(void)
tapechar_exit();
tapeblock_exit();
tape_proc_cleanup();
debug_unregister (tape_dbf_area);
debug_unregister (TAPE_DBF_AREA);
}
MODULE_AUTHOR("(C) 2001 IBM Deutschland Entwicklung GmbH by Carsten Otte and "
"Michael Holzheu (cotte@de.ibm.com,holzheu@de.ibm.com)");
MODULE_DESCRIPTION("Linux on zSeries channel attached "
"tape device driver ($Revision: 1.49 $)");
"tape device driver ($Revision: 1.50 $)");
MODULE_LICENSE("GPL");
module_init(tape_init);
module_exit(tape_exit);
EXPORT_SYMBOL(tape_dbf_area);
EXPORT_SYMBOL(tape_generic_remove);
EXPORT_SYMBOL(tape_generic_probe);
EXPORT_SYMBOL(tape_generic_online);
......
......@@ -16,6 +16,8 @@
#include <linux/vmalloc.h>
#include <linux/seq_file.h>
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
#define PRINTK_HEADER "TAPE_PROC: "
......
......@@ -22,6 +22,8 @@
#include <asm/ebcdic.h>
#include <asm/tape390.h>
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
#include "tape_std.h"
......
......@@ -308,7 +308,7 @@ static int cio_ignore_read (char *page, char **start, off_t off,
return len;
}
static int cio_ignore_write (struct file *file, const char *user_buf,
static int cio_ignore_write(struct file *file, const char __user *user_buf,
unsigned long user_len, void *data)
{
char *buf;
......
/*
* drivers/s390/cio/chsc.c
* S/390 common I/O routines -- channel subsystem call
* $Revision: 1.111 $
* $Revision: 1.112 $
*
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
......@@ -24,7 +24,6 @@
#include "ioasm.h"
#include "chsc.h"
#define CHPID_LONGS (256 / (8 * sizeof(long))) /* 256 chpids */
static struct channel_path *chps[NR_CHPIDS];
static void *sei_page;
......
......@@ -23,5 +23,4 @@ extern struct channel_path *chps[];
extern void s390_process_css( void );
extern void chsc_validate_chpids(struct subchannel *);
extern void chpid_is_actually_online(int);
extern int is_chpid_online(int);
#endif
/*
* drivers/s390/cio/device.c
* bus driver for ccw devices
* $Revision: 1.119 $
* $Revision: 1.120 $
*
* Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
......@@ -526,7 +526,8 @@ get_disc_ccwdev_by_devno(unsigned int devno, struct ccw_device *sibling)
cdev = to_ccwdev(dev);
if ((cdev->private->state == DEV_STATE_DISCONNECTED) &&
(cdev->private->devno == devno) &&
(!strncmp(cdev->dev.bus_id, sibling->dev.bus_id, 4))) {
(!strncmp(cdev->dev.bus_id, sibling->dev.bus_id,
BUS_ID_SIZE))) {
cdev->private->state = DEV_STATE_NOT_OPER;
break;
}
......
......@@ -1071,103 +1071,103 @@ ccw_device_bug(struct ccw_device *cdev, enum dev_event dev_event)
* device statemachine
*/
fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
[DEV_STATE_NOT_OPER] {
[DEV_EVENT_NOTOPER] ccw_device_nop,
[DEV_EVENT_INTERRUPT] ccw_device_bug,
[DEV_EVENT_TIMEOUT] ccw_device_nop,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_NOT_OPER] = {
[DEV_EVENT_NOTOPER] = ccw_device_nop,
[DEV_EVENT_INTERRUPT] = ccw_device_bug,
[DEV_EVENT_TIMEOUT] = ccw_device_nop,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_SENSE_PGID] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_sense_pgid_irq,
[DEV_EVENT_TIMEOUT] ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_SENSE_PGID] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_sense_pgid_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_SENSE_ID] {
[DEV_EVENT_NOTOPER] ccw_device_recog_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_sense_id_irq,
[DEV_EVENT_TIMEOUT] ccw_device_recog_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_SENSE_ID] = {
[DEV_EVENT_NOTOPER] = ccw_device_recog_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_sense_id_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_recog_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_OFFLINE] {
[DEV_EVENT_NOTOPER] ccw_device_offline_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_offline_irq,
[DEV_EVENT_TIMEOUT] ccw_device_nop,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_OFFLINE] = {
[DEV_EVENT_NOTOPER] = ccw_device_offline_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_offline_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_nop,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_VERIFY] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_verify_irq,
[DEV_EVENT_TIMEOUT] ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_VERIFY] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_verify_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_ONLINE] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_irq,
[DEV_EVENT_TIMEOUT] ccw_device_online_timeout,
[DEV_EVENT_VERIFY] ccw_device_online_verify,
[DEV_STATE_ONLINE] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_online_timeout,
[DEV_EVENT_VERIFY] = ccw_device_online_verify,
},
[DEV_STATE_W4SENSE] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_w4sense,
[DEV_EVENT_TIMEOUT] ccw_device_nop,
[DEV_EVENT_VERIFY] ccw_device_online_verify,
[DEV_STATE_W4SENSE] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_w4sense,
[DEV_EVENT_TIMEOUT] = ccw_device_nop,
[DEV_EVENT_VERIFY] = ccw_device_online_verify,
},
[DEV_STATE_DISBAND_PGID] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_disband_irq,
[DEV_EVENT_TIMEOUT] ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_DISBAND_PGID] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_disband_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_onoff_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_BOXED] {
[DEV_EVENT_NOTOPER] ccw_device_offline_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_stlck_done,
[DEV_EVENT_TIMEOUT] ccw_device_stlck_done,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_BOXED] = {
[DEV_EVENT_NOTOPER] = ccw_device_offline_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_stlck_done,
[DEV_EVENT_TIMEOUT] = ccw_device_stlck_done,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
/* states to wait for i/o completion before doing something */
[DEV_STATE_CLEAR_VERIFY] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_clear_verify,
[DEV_EVENT_TIMEOUT] ccw_device_nop,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_CLEAR_VERIFY] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_clear_verify,
[DEV_EVENT_TIMEOUT] = ccw_device_nop,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_TIMEOUT_KILL] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_killing_irq,
[DEV_EVENT_TIMEOUT] ccw_device_killing_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop, //FIXME
[DEV_STATE_TIMEOUT_KILL] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_killing_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_killing_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop, //FIXME
},
[DEV_STATE_WAIT4IO] {
[DEV_EVENT_NOTOPER] ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_wait4io_irq,
[DEV_EVENT_TIMEOUT] ccw_device_wait4io_timeout,
[DEV_EVENT_VERIFY] ccw_device_wait4io_verify,
[DEV_STATE_WAIT4IO] = {
[DEV_EVENT_NOTOPER] = ccw_device_online_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_wait4io_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_wait4io_timeout,
[DEV_EVENT_VERIFY] = ccw_device_wait4io_verify,
},
[DEV_STATE_QUIESCE] {
[DEV_EVENT_NOTOPER] ccw_device_quiesce_done,
[DEV_EVENT_INTERRUPT] ccw_device_quiesce_done,
[DEV_EVENT_TIMEOUT] ccw_device_quiesce_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_QUIESCE] = {
[DEV_EVENT_NOTOPER] = ccw_device_quiesce_done,
[DEV_EVENT_INTERRUPT] = ccw_device_quiesce_done,
[DEV_EVENT_TIMEOUT] = ccw_device_quiesce_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
/* special states for devices gone not operational */
[DEV_STATE_DISCONNECTED] {
[DEV_EVENT_NOTOPER] ccw_device_nop,
[DEV_EVENT_INTERRUPT] ccw_device_start_id,
[DEV_EVENT_TIMEOUT] ccw_device_bug,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_DISCONNECTED] = {
[DEV_EVENT_NOTOPER] = ccw_device_nop,
[DEV_EVENT_INTERRUPT] = ccw_device_start_id,
[DEV_EVENT_TIMEOUT] = ccw_device_bug,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_DISCONNECTED_SENSE_ID] {
[DEV_EVENT_NOTOPER] ccw_device_recog_notoper,
[DEV_EVENT_INTERRUPT] ccw_device_sense_id_irq,
[DEV_EVENT_TIMEOUT] ccw_device_recog_timeout,
[DEV_EVENT_VERIFY] ccw_device_nop,
[DEV_STATE_DISCONNECTED_SENSE_ID] = {
[DEV_EVENT_NOTOPER] = ccw_device_recog_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_sense_id_irq,
[DEV_EVENT_TIMEOUT] = ccw_device_recog_timeout,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_CMFCHANGE] {
[DEV_EVENT_NOTOPER] ccw_device_change_cmfstate,
[DEV_EVENT_INTERRUPT] ccw_device_change_cmfstate,
[DEV_EVENT_TIMEOUT] ccw_device_change_cmfstate,
[DEV_EVENT_VERIFY] ccw_device_change_cmfstate,
[DEV_STATE_CMFCHANGE] = {
[DEV_EVENT_NOTOPER] = ccw_device_change_cmfstate,
[DEV_EVENT_INTERRUPT] = ccw_device_change_cmfstate,
[DEV_EVENT_TIMEOUT] = ccw_device_change_cmfstate,
[DEV_EVENT_VERIFY] = ccw_device_change_cmfstate,
},
};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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