Commit 98102e73 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/bk/linux-2.6.8

into intel.com:/home/lenb/src/linux-acpi-test-2.6.8
parents 6a9233c9 915a29ec
......@@ -619,12 +619,7 @@ $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ;
.PHONY: $(vmlinux-dirs)
$(vmlinux-dirs): prepare-all scripts
$(Q)if [ ! -z $$LC_ALL ]; then \
export LANG=$$LC_ALL; \
export LC_ALL= ; \
fi; \
export LC_COLLATE=C; export LC_CTYPE=C; \
$(MAKE) $(build)=$@
$(Q)$(MAKE) $(build)=$@
# Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare-all".
......
......@@ -20,8 +20,10 @@
.type _start, #function
.globl _start
_start: adr r13, data
_start: add lr, pc, #-0x8 @ lr = current load addr
adr r13, data
ldmia r13!, {r4-r6} @ r5 = dest, r6 = length
add r4, r4, lr @ r4 = initrd_start + load addr
bl move @ move the initrd
/*
......
This diff is collapsed.
......@@ -23,9 +23,12 @@ config ARCH_SMDK2410
<http://www.fsforth.de>
config MACH_VR1000
bool "Simtec VR1000"
bool "Thorcom VR1000"
help
Say Y here if you are using the Simtec VR1000 board.
Say Y here if you are using the Thorcom VR1000 board.
This linux port is currently being maintained by Simtec, on behalf
of Thorcom. Any queries, please contact Thorcom first.
endmenu
......
......@@ -101,7 +101,7 @@ void __init smdk2410_init_irq(void)
void __init smdk2410_init_time(void)
{
s3c2401_init_time();
s3c2410_init_time();
}
MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
......
......@@ -11,6 +11,7 @@
* published by the Free Software Foundation.
*
* Modifications:
* 06-Aug-2004 BJD Fixed call to time initialisation
* 12-Jul-2004 BJD Renamed machine
* 16-May-2003 BJD Created initial version
* 16-Aug-2003 BJD Fixed header files and copyright, added URL
......@@ -159,7 +160,7 @@ void __init vr1000_init_irq(void)
void __init vr1000_init_time(void)
{
s3c2401_init_time();
s3c2410_init_time();
}
MACHINE_START(VR1000, "Thorcom-VR1000")
......
......@@ -66,9 +66,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
/* We must not map this if we have highmem enabled */
pte = pte_offset_map(pmd, addr);
printk(", *pte=%08lx", pte_val(*pte));
#ifdef CONFIG_CPU_32
printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE]));
#endif
pte_unmap(pte);
#endif
} while(0);
......
......@@ -24,13 +24,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#ifdef CONFIG_CPU_32
#define TABLE_OFFSET (PTRS_PER_PTE)
#else
#define TABLE_OFFSET 0
#endif
#define TABLE_SIZE ((TABLE_OFFSET + PTRS_PER_PTE) * sizeof(pte_t))
#define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
......@@ -289,14 +283,13 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
*/
reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
#ifdef CONFIG_CPU_32
/*
* Reserve the page tables. These are already in use,
* and can only be in node 0.
*/
reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
PTRS_PER_PGD * sizeof(pgd_t));
#endif
/*
* And don't forget to reserve the allocator bitmap,
* which will be freed later.
......
......@@ -477,6 +477,9 @@ asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
goto out;
if (pos < 0)
goto out;
ret = -ESPIPE;
if (!(file->f_mode & FMODE_PREAD))
goto out;
ret = read(file, buf, count, &pos);
if (ret > 0)
dnotify_parent(file->f_dentry, DN_ACCESS);
......@@ -511,6 +514,10 @@ asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
if (pos < 0)
goto out;
ret = -ESPIPE;
if (!(file->f_mode & FMODE_PWRITE))
goto out;
ret = write(file, buf, count, &pos);
if (ret > 0)
dnotify_parent(file->f_dentry, DN_MODIFY);
......
......@@ -825,39 +825,6 @@ config PROC_DEVICETREE
an image of the device tree that the kernel copies from Open
Firmware. If unsure, say Y here.
config PPC_RTAS
bool "Support for RTAS (RunTime Abstraction Services) in /proc"
depends on PPC_OF && PROC_FS
---help---
When you use this option, you will be able to use RTAS from
userspace.
RTAS stands for RunTime Abstraction Services and should
provide a portable way to access and set system information. This is
commonly used on RS/6000 (pSeries) computers.
You can access RTAS via the special proc file system entry rtas.
Don't confuse this rtas entry with the one in /proc/device-tree/rtas
which is readonly.
If you don't know if you can use RTAS look into
/proc/device-tree/rtas. If there are some entries, it is very likely
that you will be able to use RTAS.
You can do cool things with rtas. To print out information about
various sensors in the system, just do a
$ cat /proc/rtas/sensors
or if you power off your machine at night but want it running when
you enter your office at 7:45 am, do a
# date -d 'tomorrow 7:30' +%s > /proc/rtas/poweron
and shutdown.
If unsure, say Y.
config PREP_RESIDUAL
bool "Support for PReP Residual Data"
depends on PPC_PREP
......
......@@ -22,28 +22,25 @@ endif
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH)
aflags-y += -Iarch/$(ARCH)
cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \
AFLAGS += -Iarch/$(ARCH)
CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
-ffixed-r2 -Wno-uninitialized -mmultiple
CPP = $(CC) -E $(CFLAGS)
CHECK := $(CHECK) -D__powerpc__=1
ifndef CONFIG_E500
cflags-y += -mstring
CFLAGS += -mstring
endif
aflags-$(CONFIG_4xx) += -m405
cflags-$(CONFIG_4xx) += -Wa,-m405
aflags-$(CONFIG_6xx) += -maltivec
cflags-$(CONFIG_6xx) += -Wa,-maltivec
aflags-$(CONFIG_E500) += -me500
cflags-$(CONFIG_E500) += -Wa,-me500
aflags-$(CONFIG_PPC64BRIDGE) += -mppc64bridge
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
AFLAGS += $(aflags-y)
CFLAGS += $(cflags-y)
cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
cpu-as-$(CONFIG_E500) += -Wa,-me500
AFLAGS += $(cpu-as-y)
CFLAGS += $(cpu-as-y)
head-y := arch/ppc/kernel/head.o
head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
......
......@@ -2,16 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
ifdef CONFIG_E500
EXTRA_AFLAGS := -Wa,-me500
endif
extra-$(CONFIG_PPC_STD_MMU) := head.o
extra-$(CONFIG_40x) := head_4xx.o
extra-$(CONFIG_44x) := head_44x.o
......
/*
* Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
*
*
* Dynamic DMA mapping support.
*
* swiped from i386
*
*/
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/pci.h>
#include <asm/io.h>
void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle)
{
void *ret;
int gfp = GFP_ATOMIC;
if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
gfp |= GFP_DMA;
#ifdef CONFIG_NOT_COHERENT_CACHE
ret = consistent_alloc(gfp, size, dma_handle);
#else
ret = (void *)__get_free_pages(gfp, get_order(size));
#endif
if (ret != NULL) {
memset(ret, 0, size);
#ifndef CONFIG_NOT_COHERENT_CACHE
*dma_handle = virt_to_bus(ret);
#endif
}
return ret;
}
void pci_free_consistent(struct pci_dev *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
#ifdef CONFIG_NOT_COHERENT_CACHE
consistent_free(vaddr);
#else
free_pages((unsigned long)vaddr, get_order(size));
#endif
}
......@@ -93,10 +93,14 @@ ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
}
/*
* Configure PPC44x TLB for AS0 exception processing.
* MMU_init_hw does the chip-specific initialization of the MMU hardware.
*/
static void __init
ppc44x_tlb_config(void)
void __init MMU_init_hw(void)
{
flush_instruction_cache();
}
unsigned long __init mmu_mapin_ram(void)
{
unsigned int pinned_tlbs = 1;
int i;
......@@ -124,39 +128,6 @@ ppc44x_tlb_config(void)
unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE;
ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
}
}
/*
* MMU_init_hw does the chip-specific initialization of the MMU hardware.
*/
void __init MMU_init_hw(void)
{
flush_instruction_cache();
ppc44x_tlb_config();
}
/* TODO: Add large page lowmem mapping support */
unsigned long __init mmu_mapin_ram(void)
{
unsigned long v, s, f = _PAGE_GUARDED;
phys_addr_t p;
v = KERNELBASE;
p = PPC_MEMSTART;
for (s = 0; s < total_lowmem; s += PAGE_SIZE) {
if ((char *) v >= _stext && (char *) v < etext)
f |= _PAGE_RAM_TEXT;
else
f |= _PAGE_RAM;
map_page(v, p, f);
v += PAGE_SIZE;
p += PAGE_SIZE;
}
if (ppc_md.progress)
ppc_md.progress("MMU:mmu_mapin_ram done", 0x401);
return s;
return total_lowmem;
}
......@@ -2,10 +2,6 @@
# Makefile for the linux ppc-specific parts of the memory manager.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
obj-y := fault.o init.o mem_pieces.o \
mmu_context.o pgtable.o
......
......@@ -175,6 +175,15 @@ config IBM_OPENBIOS
depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
default y
config PPC4xx_DMA
bool "PPC4xx DMA controller support"
depends on 4xx
config PPC4xx_EDMA
bool
depends on !STB03xxx && PPC4xx_DMA
default y
config PM
bool "Power Management support (EXPERIMENTAL)"
depends on 4xx && EXPERIMENTAL
......
......@@ -64,7 +64,8 @@
#define UART0_IO_BASE (u8 *) 0xE0000200
#define UART1_IO_BASE (u8 *) 0xE0000300
#define BASE_BAUD 33000000/3/16
/* external Epson SG-615P */
#define BASE_BAUD 691200
#define STD_UART_OP(num) \
{ 0, BASE_BAUD, 0, UART##num##_INT, \
......
......@@ -2,13 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_40x
EXTRA_AFLAGS := -Wa,-m405
endif
# Extra CFLAGS so we don't have to do relative includes
CFLAGS_pmac_setup.o += -Iarch/$(ARCH)/mm
......@@ -26,7 +19,6 @@ obj-$(CONFIG_NVRAM) += pmac_nvram.o
obj-$(CONFIG_CPU_FREQ_PMAC) += pmac_cpufreq.o
endif
obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o
obj-$(CONFIG_PPC_RTAS) += error_log.o proc_rtas.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_ADIR) += adir_setup.o adir_pic.o adir_pci.o
obj-$(CONFIG_EST8260) += est8260_setup.o
......
/*
* arch/ppc/kernel/error_log.c
*
* Copyright (c) 2000 Tilmann Bitterberg
* (tilmann@bitterberg.de)
*
* Error processing of errors found by rtas even-scan routine
* which is done with every heartbeat. (chrp_setup.c)
*/
#include <linux/sched.h>
#include <asm/prom.h>
#include "error_log.h"
/* ****************************************************************** */
/*
* EVENT-SCAN
* The whole stuff below here doesn't take any action when it found
* an error, it just prints as much information as possible and
* then its up to the user to decide what to do.
*
* Returns 0 if no errors were found
* Returns 1 if there may be more errors
*/
int ppc_rtas_errorlog_scan(void)
{
const char *_errlog_severity[] = {
#ifdef VERBOSE_ERRORS
"No Error\n\t\
Should require no further information",
"Event\n\t\
This is not really an error, it is an event. I use events\n\t\
to communicate with RTAS back and forth.",
"Warning\n\t\
Indicates a non-state-losing error, either fully recovered\n\t\
by RTAS or not needing recovery. Ignore it.",
"Error sync\n\t\
May only be fatal to a certain program or thread. Recovery\n\t\
and continuation is possible, if I only had a handler for\n\t\
this. Less serious",
"Error\n\t\
Less serious, but still causing a loss of data and state.\n\t\
I can't tell you exactly what to do, You have to decide\n\t\
with help from the target and initiator field, what kind\n\t\
of further actions may take place.",
"Fatal\n\t\
Represent a permanent hardware failure and I believe this\n\t\
affects my overall performance and behaviour. I would not\n\t\
attempt to continue normal operation."
#else
"No Error",
"Event",
"Warning",
"Error sync",
"Error",
"Fatal"
#endif /* VERBOSE_ERRORS */
};
#if 0 /* unused?? */
const char *_errlog_disposition[] = {
#ifdef VERBOSE_ERRORS
"Fully recovered\n\t\
There was an error, but it is fully recovered by RTAS.",
"Limited recovery\n\t\
RTAS was able to recover the state of the machine, but some\n\t\
feature of the machine has been disabled or lost (for example\n\t\
error checking) or performance may suffer.",
"Not recovered\n\t\
Whether RTAS did not try to recover anything or recovery failed:\n\t\
HOUSTON, WE HAVE A PROBLEM!"
#else
"Fully recovered",
"Limited recovery",
"Not recovered"
#endif /* VERBOSE_ERRORS */
};
#endif
const char *_errlog_extended[] = {
#ifdef VERBOSE_ERRORS
"Not present\n\t\
Sad, the RTAS call didn't return an extended error log.",
"Present\n\t\
The extended log is present and hopefully it contains a lot of\n\t\
useful information, which leads to the solution of the problem."
#else
"Not present",
"Present"
#endif /* VERBOSE_ERRORS */
};
const char *_errlog_initiator[] = {
"Unknown or not applicable",
"CPU",
"PCI",
"ISA",
"Memory",
"Power management"
};
const char *_errlog_target[] = {
"Unknown or not applicable",
"CPU",
"PCI",
"ISA",
"Memory",
"Power management"
};
rtas_error_log error_log;
char logdata[1024];
int error;
#if 0 /* unused?? */
int retries = 0; /* if HW error, try 10 times */
#endif
error = call_rtas ("event-scan", 4, 1, (unsigned long *)&error_log,
INTERNAL_ERROR | EPOW_WARNING,
0, __pa(logdata), 1024);
if (error == 1) /* no errors found */
return 0;
if (error == -1) {
printk(KERN_ERR "Unable to get errors. Do you a favor and throw this box away\n");
return 0;
}
if (error_log.version != 1)
printk(KERN_WARNING "Unknown version (%d), please implement me\n",
error_log.version);
switch (error_log.disposition) {
case DISP_FULLY_RECOVERED:
/* there was an error, but everything is fine now */
return 0;
case DISP_NOT_RECOVERED:
printk("We have a really serious Problem!\n");
case DISP_LIMITED_RECOVERY:
printk("Error classification\n");
printk("Severity : %s\n",
ppc_rtas_errorlog_check_severity (error_log));
printk("Initiator : %s\n",
ppc_rtas_errorlog_check_initiator (error_log));
printk("Target : %s\n",
ppc_rtas_errorlog_check_target (error_log));
printk("Type : %s\n",
ppc_rtas_errorlog_check_type (error_log));
printk("Ext. log : %s\n",
ppc_rtas_errorlog_check_extended (error_log));
if (error_log.extended)
ppc_rtas_errorlog_disect_extended (logdata);
return 1;
default:
/* nothing */
break;
}
return 0;
}
/* ****************************************************************** */
const char * ppc_rtas_errorlog_check_type (rtas_error_log error_log)
{
const char *_errlog_type[] = {
"unknown type",
"too many tries failed",
"TCE error",
"RTAS device failed",
"target timed out",
"parity error on data", /* 5 */
"parity error on address",
"parity error on external cache",
"access to invalid address",
"uncorrectable ECC error",
"corrected ECC error" /* 10 */
};
if (error_log.type == TYPE_EPOW)
return "EPOW";
if (error_log.type >= TYPE_PMGM_POWER_SW_ON)
return "PowerMGM Event (not handled right now)";
return _errlog_type[error_log.type];
}
#ifndef __ERROR_LOG_H__
#define __ERROR_LOG_H__
#define VERBOSE_ERRORS 1 /* Maybe I enlarge the kernel too much */
#undef VERBOSE_ERRORS
/* Event classes */
/* XXX: Endianess correct? NOW*/
#define INTERNAL_ERROR 0x80000000 /* set bit 0 */
#define EPOW_WARNING 0x40000000 /* set bit 1 */
#define POWERMGM_EVENTS 0x20000000 /* set bit 2 */
/* event-scan returns */
#define SEVERITY_FATAL 0x5
#define SEVERITY_ERROR 0x4
#define SEVERITY_ERROR_SYNC 0x3
#define SEVERITY_WARNING 0x2
#define SEVERITY_EVENT 0x1
#define SEVERITY_NO_ERROR 0x0
#define DISP_FULLY_RECOVERED 0x0
#define DISP_LIMITED_RECOVERY 0x1
#define DISP_NOT_RECOVERED 0x2
#define PART_PRESENT 0x0
#define PART_NOT_PRESENT 0x1
#define INITIATOR_UNKNOWN 0x0
#define INITIATOR_CPU 0x1
#define INITIATOR_PCI 0x2
#define INITIATOR_ISA 0x3
#define INITIATOR_MEMORY 0x4
#define INITIATOR_POWERMGM 0x5
#define TARGET_UNKNOWN 0x0
#define TARGET_CPU 0x1
#define TARGET_PCI 0x2
#define TARGET_ISA 0x3
#define TARGET_MEMORY 0x4
#define TARGET_POWERMGM 0x5
#define TYPE_RETRY 0x01
#define TYPE_TCE_ERR 0x02
#define TYPE_INTERN_DEV_FAIL 0x03
#define TYPE_TIMEOUT 0x04
#define TYPE_DATA_PARITY 0x05
#define TYPE_ADDR_PARITY 0x06
#define TYPE_CACHE_PARITY 0x07
#define TYPE_ADDR_INVALID 0x08
#define TYPE_ECC_UNCORR 0x09
#define TYPE_ECC_CORR 0x0a
#define TYPE_EPOW 0x40
/* I don't add PowerMGM events right now, this is a different topic */
#define TYPE_PMGM_POWER_SW_ON 0x60
#define TYPE_PMGM_POWER_SW_OFF 0x61
#define TYPE_PMGM_LID_OPEN 0x62
#define TYPE_PMGM_LID_CLOSE 0x63
#define TYPE_PMGM_SLEEP_BTN 0x64
#define TYPE_PMGM_WAKE_BTN 0x65
#define TYPE_PMGM_BATTERY_WARN 0x66
#define TYPE_PMGM_BATTERY_CRIT 0x67
#define TYPE_PMGM_SWITCH_TO_BAT 0x68
#define TYPE_PMGM_SWITCH_TO_AC 0x69
#define TYPE_PMGM_KBD_OR_MOUSE 0x6a
#define TYPE_PMGM_ENCLOS_OPEN 0x6b
#define TYPE_PMGM_ENCLOS_CLOSED 0x6c
#define TYPE_PMGM_RING_INDICATE 0x6d
#define TYPE_PMGM_LAN_ATTENTION 0x6e
#define TYPE_PMGM_TIME_ALARM 0x6f
#define TYPE_PMGM_CONFIG_CHANGE 0x70
#define TYPE_PMGM_SERVICE_PROC 0x71
typedef struct _rtas_error_log {
unsigned long version:8; /* Architectural version */
unsigned long severity:3; /* Severity level of error */
unsigned long disposition:2; /* Degree of recovery */
unsigned long extended:1; /* extended log present? */
unsigned long /* reserved */ :2; /* Reserved for future use */
unsigned long initiator:4; /* Initiator of event */
unsigned long target:4; /* Target of failed operation */
unsigned long type:8; /* General event or error*/
unsigned long extended_log_length:32; /* length in bytes */
} rtas_error_log;
/* ****************************************************************** */
#define ppc_rtas_errorlog_check_severity(x) \
(_errlog_severity[x.severity])
#define ppc_rtas_errorlog_check_target(x) \
(_errlog_target[x.target])
#define ppc_rtas_errorlog_check_initiator(x) \
(_errlog_initiator[x.initiator])
#define ppc_rtas_errorlog_check_extended(x) \
(_errlog_extended[x.extended])
#define ppc_rtas_errorlog_disect_extended(x) \
do { /* implement me */ } while(0)
extern const char * ppc_rtas_errorlog_check_type (rtas_error_log error_log);
extern int ppc_rtas_errorlog_scan(void);
#endif /* __ERROR_LOG_H__ */
This diff is collapsed.
......@@ -2,16 +2,6 @@
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
ifdef CONFIG_E500
EXTRA_AFLAGS := -Wa,-me500
endif
CFLAGS_prom_init.o += -fPIC
CFLAGS_btext.o += -fPIC
......@@ -25,7 +15,8 @@ ifeq ($(CONFIG_4xx),y)
obj-$(CONFIG_4xx) += ppc4xx_pic.o
obj-$(CONFIG_40x) += ppc4xx_setup.o
obj-$(CONFIG_GEN_RTC) += todc_time.o
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
ifeq ($(CONFIG_40x),y)
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -424,8 +424,6 @@ config IRQSTACKS
for handling hard and soft interrupts. This can help avoid
overflowing the process kernel stacks.
endmenu
config SPINLINE
bool "Inline spinlock code at each call site"
depends on SMP && !PPC_SPLPAR && !PPC_ISERIES
......@@ -436,6 +434,8 @@ config SPINLINE
If in doubt, say N.
endmenu
source "security/Kconfig"
source "crypto/Kconfig"
......
......@@ -15,14 +15,11 @@ obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \
obj-$(CONFIG_PPC_OF) += of_device.o
obj-$(CONFIG_PCI) += pci.o pci_dn.o pci_iommu.o
pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_pci_reset.o \
iSeries_IoMmTable.o
pci-obj-$(CONFIG_PPC_PSERIES) += pci_dn.o pci_dma_direct.o
ifdef CONFIG_PPC_ISERIES
obj-$(CONFIG_PCI) += iSeries_pci.o iSeries_pci_reset.o \
iSeries_IoMmTable.o
else
obj-$(CONFIG_PCI) += pci_dma_direct.o
endif
obj-$(CONFIG_PCI) += pci.o pci_iommu.o $(pci-obj-y)
obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
iSeries_VpdInfo.o XmPciLpEvent.o \
......
......@@ -298,8 +298,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
cur_cpu_spec->firmware_features);
}
void
chrp_progress(char *s, unsigned short hex)
void chrp_progress(char *s, unsigned short hex)
{
struct device_node *root;
int width, *p;
......@@ -313,60 +312,55 @@ chrp_progress(char *s, unsigned short hex)
return;
if (max_width == 0) {
if ( (root = find_path_device("/rtas")) &&
if ((root = find_path_device("/rtas")) &&
(p = (unsigned int *)get_property(root,
"ibm,display-line-length",
NULL)) )
NULL)))
max_width = *p;
else
max_width = 0x10;
display_character = rtas_token("display-character");
set_indicator = rtas_token("set-indicator");
}
if (display_character == RTAS_UNKNOWN_SERVICE) {
/* use hex display */
if (set_indicator == RTAS_UNKNOWN_SERVICE)
return;
rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
return;
}
if(display_character == RTAS_UNKNOWN_SERVICE) {
if (display_character == RTAS_UNKNOWN_SERVICE) {
/* use hex display if available */
if(set_indicator != RTAS_UNKNOWN_SERVICE)
if (set_indicator != RTAS_UNKNOWN_SERVICE)
rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
return;
}
spin_lock(&progress_lock);
/* Last write ended with newline, but we didn't print it since
/*
* Last write ended with newline, but we didn't print it since
* it would just clear the bottom line of output. Print it now
* instead.
*
* If no newline is pending, print a CR to start output at the
* beginning of the line.
*/
if(pending_newline) {
if (pending_newline) {
rtas_call(display_character, 1, 1, NULL, '\r');
rtas_call(display_character, 1, 1, NULL, '\n');
pending_newline = 0;
} else
} else {
rtas_call(display_character, 1, 1, NULL, '\r');
}
width = max_width;
os = s;
while (*os) {
if(*os == '\n' || *os == '\r') {
if (*os == '\n' || *os == '\r') {
/* Blank to end of line. */
while(width-- > 0)
while (width-- > 0)
rtas_call(display_character, 1, 1, NULL, ' ');
/* If newline is the last character, save it
* until next call to avoid bumping up the
* display output.
*/
if(*os == '\n' && !os[1]) {
if (*os == '\n' && !os[1]) {
pending_newline = 1;
spin_unlock(&progress_lock);
return;
......@@ -374,7 +368,7 @@ chrp_progress(char *s, unsigned short hex)
/* RTAS wants CR-LF, not just LF */
if(*os == '\n') {
if (*os == '\n') {
rtas_call(display_character, 1, 1, NULL, '\r');
rtas_call(display_character, 1, 1, NULL, '\n');
} else {
......@@ -393,14 +387,14 @@ chrp_progress(char *s, unsigned short hex)
os++;
/* if we overwrite the screen length */
if ( width <= 0 )
while ( (*os != 0) && (*os != '\n') && (*os != '\r') )
if (width <= 0)
while ((*os != 0) && (*os != '\n') && (*os != '\r'))
os++;
}
/* Blank to end of line. */
while ( width-- > 0 )
rtas_call(display_character, 1, 1, NULL, ' ' );
while (width-- > 0)
rtas_call(display_character, 1, 1, NULL, ' ');
spin_unlock(&progress_lock);
}
......
......@@ -618,7 +618,7 @@ void __init eeh_init(void)
info.buid_lo = BUID_LO(buid);
info.buid_hi = BUID_HI(buid);
traverse_pci_devices(phb, early_enable_eeh, NULL, &info);
traverse_pci_devices(phb, early_enable_eeh, &info);
}
if (eeh_subsystem_enabled) {
......
......@@ -194,6 +194,7 @@ syscall_exit_trace_cont:
mtspr SRR0,r7
mtspr SRR1,r8
rfid
b . /* prevent speculative execution */
syscall_enosys:
li r3,-ENOSYS
......@@ -540,7 +541,7 @@ restore:
ld r1,GPR1(r1)
rfid
b .
b . /* prevent speculative execution */
/* Note: this must change if we start using the TIF_NOTIFY_RESUME bit */
do_work:
......@@ -684,6 +685,7 @@ _GLOBAL(enter_rtas)
mtspr SRR0,r5
mtspr SRR1,r6
rfid
b . /* prevent speculative execution */
_STATIC(rtas_return_loc)
/* relocation is off at this point */
......@@ -704,6 +706,7 @@ _STATIC(rtas_return_loc)
mtspr SRR0,r3
mtspr SRR1,r4
rfid
b . /* prevent speculative execution */
_STATIC(rtas_restore_regs)
/* relocation is on at this point */
......
......@@ -221,7 +221,8 @@ exception_marker:
mtspr SRR0,r12; \
mfspr r12,SRR1; /* and SRR1 */ \
mtspr SRR1,r10; \
rfid
rfid; \
b . /* prevent speculative execution */
/*
* This is the start of the interrupt handlers for iSeries
......@@ -302,12 +303,14 @@ exception_marker:
. = n; \
.globl label##_Pseries; \
label##_Pseries: \
HMT_MEDIUM; \
mtspr SPRG1,r13; /* save r13 */ \
EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
#define STD_EXCEPTION_ISERIES(n, label, area) \
.globl label##_Iseries; \
label##_Iseries: \
HMT_MEDIUM; \
mtspr SPRG1,r13; /* save r13 */ \
EXCEPTION_PROLOG_ISERIES_1(area); \
EXCEPTION_PROLOG_ISERIES_2; \
......@@ -316,6 +319,7 @@ label##_Iseries: \
#define MASKABLE_EXCEPTION_ISERIES(n, label) \
.globl label##_Iseries; \
label##_Iseries: \
HMT_MEDIUM; \
mtspr SPRG1,r13; /* save r13 */ \
EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
lbz r10,PACAPROFENABLED(r13); \
......@@ -409,12 +413,14 @@ __start_interrupts:
. = 0x200
_MachineCheckPseries:
HMT_MEDIUM
mtspr SPRG1,r13 /* save r13 */
EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common)
. = 0x300
.globl DataAccess_Pseries
DataAccess_Pseries:
HMT_MEDIUM
mtspr SPRG1,r13
BEGIN_FTR_SECTION
mtspr SPRG2,r12
......@@ -433,6 +439,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
. = 0x380
.globl DataAccessSLB_Pseries
DataAccessSLB_Pseries:
HMT_MEDIUM
mtspr SPRG1,r13
mfspr r13,SPRG3 /* get paca address into r13 */
std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
......@@ -453,12 +460,14 @@ DataAccessSLB_Pseries:
mtspr SRR1,r10
mfspr r3,DAR
rfid
b . /* prevent speculative execution */
STD_EXCEPTION_PSERIES(0x400, InstructionAccess)
. = 0x480
.globl InstructionAccessSLB_Pseries
InstructionAccessSLB_Pseries:
HMT_MEDIUM
mtspr SPRG1,r13
mfspr r13,SPRG3 /* get paca address into r13 */
std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
......@@ -479,6 +488,7 @@ InstructionAccessSLB_Pseries:
mtspr SRR1,r10
mr r3,r11 /* SRR0 is faulting address */
rfid
b . /* prevent speculative execution */
STD_EXCEPTION_PSERIES(0x500, HardwareInterrupt)
STD_EXCEPTION_PSERIES(0x600, Alignment)
......@@ -491,6 +501,7 @@ InstructionAccessSLB_Pseries:
. = 0xc00
.globl SystemCall_Pseries
SystemCall_Pseries:
HMT_MEDIUM
mr r9,r13
mfmsr r10
mfspr r13,SPRG3
......@@ -503,6 +514,7 @@ SystemCall_Pseries:
mfspr r12,SRR1
mtspr SRR1,r10
rfid
b . /* prevent speculative execution */
STD_EXCEPTION_PSERIES(0xd00, SingleStep)
STD_EXCEPTION_PSERIES(0xe00, Trap_0e)
......@@ -727,6 +739,7 @@ HardwareInterrupt_Iseries_masked:
ld r12,PACA_EXGEN+EX_R12(r13)
ld r13,PACA_EXGEN+EX_R13(r13)
rfid
b . /* prevent speculative execution */
#endif
/*
......@@ -742,10 +755,12 @@ fwnmi_data_area:
. = 0x8000
.globl SystemReset_FWNMI
SystemReset_FWNMI:
HMT_MEDIUM
mtspr SPRG1,r13 /* save r13 */
EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, SystemReset_common)
.globl MachineCheck_FWNMI
MachineCheck_FWNMI:
HMT_MEDIUM
mtspr SPRG1,r13 /* save r13 */
EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common)
......@@ -867,6 +882,7 @@ fast_exception_return:
REST_4GPRS(10, r1)
ld r1,GPR1(r1)
rfid
b . /* prevent speculative execution */
unrecov_fer:
bl .save_nvgprs
......@@ -1146,6 +1162,7 @@ _GLOBAL(do_stab_bolted)
ld r12,PACA_EXSLB+EX_R12(r13)
ld r13,PACA_EXSLB+EX_R13(r13)
rfid
b . /* prevent speculative execution */
/*
* r13 points to the PACA, r9 contains the saved CR,
......@@ -1190,6 +1207,7 @@ _GLOBAL(do_slb_miss)
ld r12,PACA_EXSLB+EX_R12(r13)
ld r13,PACA_EXSLB+EX_R13(r13)
rfid
b . /* prevent speculative execution */
unrecov_slb:
EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
......@@ -1295,6 +1313,7 @@ _STATIC(mmu_off)
mtspr SRR1,r3
sync
rfid
b . /* prevent speculative execution */
_GLOBAL(__start_initialization_pSeries)
mr r31,r3 /* save parameters */
mr r30,r4
......@@ -1777,6 +1796,7 @@ _GLOBAL(__secondary_start)
mtspr SRR0,r3
mtspr SRR1,r4
rfid
b . /* prevent speculative execution */
/*
* Running with relocation on at this point. All we want to do is
......@@ -1940,6 +1960,7 @@ _STATIC(start_here_pSeries)
mtspr SRR0,r3
mtspr SRR1,r4
rfid
b . /* prevent speculative execution */
#endif /* CONFIG_PPC_PSERIES */
/* This is where all platforms converge execution */
......
......@@ -143,47 +143,6 @@ EXPORT_SYMBOL(synchronize_irq);
#endif /* CONFIG_SMP */
/* XXX Make this into free_irq() - Anton */
/* This could be promoted to a real free_irq() ... */
static int
do_free_irq(int irq, void* dev_id)
{
irq_desc_t *desc = get_irq_desc(irq);
struct irqaction **p;
unsigned long flags;
spin_lock_irqsave(&desc->lock,flags);
p = &desc->action;
for (;;) {
struct irqaction * action = *p;
if (action) {
struct irqaction **pp = p;
p = &action->next;
if (action->dev_id != dev_id)
continue;
/* Found it - now remove it from the list of entries */
*pp = action->next;
if (!desc->action) {
desc->status |= IRQ_DISABLED;
mask_irq(irq);
}
spin_unlock_irqrestore(&desc->lock,flags);
/* Wait to make sure it's not being used on another CPU */
synchronize_irq(irq);
kfree(action);
return 0;
}
printk("Trying to free free IRQ%d\n",irq);
spin_unlock_irqrestore(&desc->lock,flags);
break;
}
return -ENOENT;
}
int request_irq(unsigned int irq,
irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
......@@ -194,8 +153,7 @@ int request_irq(unsigned int irq,
if (irq >= NR_IRQS)
return -EINVAL;
if (!handler)
/* We could implement really free_irq() instead of that... */
return do_free_irq(irq, dev_id);
return -EINVAL;
action = (struct irqaction *)
kmalloc(sizeof(struct irqaction), GFP_KERNEL);
......@@ -222,7 +180,38 @@ EXPORT_SYMBOL(request_irq);
void free_irq(unsigned int irq, void *dev_id)
{
request_irq(irq, NULL, 0, NULL, dev_id);
irq_desc_t *desc = get_irq_desc(irq);
struct irqaction **p;
unsigned long flags;
spin_lock_irqsave(&desc->lock,flags);
p = &desc->action;
for (;;) {
struct irqaction * action = *p;
if (action) {
struct irqaction **pp = p;
p = &action->next;
if (action->dev_id != dev_id)
continue;
/* Found it - now remove it from the list of entries */
*pp = action->next;
if (!desc->action) {
desc->status |= IRQ_DISABLED;
mask_irq(irq);
}
spin_unlock_irqrestore(&desc->lock,flags);
/* Wait to make sure it's not being used on another CPU */
synchronize_irq(irq);
kfree(action);
return;
}
printk("Trying to free free IRQ%d\n",irq);
spin_unlock_irqrestore(&desc->lock,flags);
break;
}
return;
}
EXPORT_SYMBOL(free_irq);
......
......@@ -600,8 +600,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
BUG(); /* No I/O resource for this PHB? */
if (request_resource(&ioport_resource, res))
printk(KERN_ERR "Failed to request IO"
"on hose %d\n", 0 /* FIXME */);
printk(KERN_ERR "Failed to request IO on "
"PCI domain %d\n", pci_domain_nr(bus));
for (i = 0; i < 3; ++i) {
res = &hose->mem_resources[i];
......@@ -609,8 +610,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
BUG(); /* No memory resource for this PHB? */
bus->resource[i+1] = res;
if (res->flags && request_resource(&iomem_resource, res))
printk(KERN_ERR "Failed to request MEM"
"on hose %d\n", 0 /* FIXME */);
printk(KERN_ERR "Failed to request MEM on "
"PCI domain %d\n",
pci_domain_nr(bus));
}
} else if (pci_probe_only &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
......
......@@ -34,8 +34,8 @@ extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */
*******************************************************************/
struct device_node;
typedef void *(*traverse_func)(struct device_node *me, void *data);
void *traverse_pci_devices(struct device_node *start, traverse_func pre, traverse_func post, void *data);
void *traverse_all_pci_devices(traverse_func pre);
void *traverse_pci_devices(struct device_node *start, traverse_func pre,
void *data);
void pci_devs_phb_init(void);
void pci_fix_bus_sysdata(void);
......
......@@ -19,8 +19,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/delay.h>
......@@ -40,20 +38,20 @@
#include "pci.h"
/* Traverse_func that inits the PCI fields of the device node.
/*
* Traverse_func that inits the PCI fields of the device node.
* NOTE: this *must* be done before read/write config to the device.
*/
static void * __init
update_dn_pci_info(struct device_node *dn, void *data)
static void * __init update_dn_pci_info(struct device_node *dn, void *data)
{
#ifdef CONFIG_PPC_PSERIES
struct pci_controller *phb = (struct pci_controller *)data;
struct pci_controller *phb = data;
u32 *regs;
char *device_type = get_property(dn, "device_type", NULL);
char *model;
dn->phb = phb;
if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", NULL) == 0) {
if (device_type && (strcmp(device_type, "pci") == 0) &&
(get_property(dn, "class-code", NULL) == 0)) {
/* special case for PHB's. Sigh. */
regs = (u32 *)get_property(dn, "bus-range", NULL);
dn->busno = regs[0];
......@@ -72,57 +70,47 @@ update_dn_pci_info(struct device_node *dn, void *data)
dn->devfn = (regs[0] >> 8) & 0xff;
}
}
#endif
return NULL;
}
/******************************************************************
/*
* Traverse a device tree stopping each PCI device in the tree.
* This is done depth first. As each node is processed, a "pre"
* function is called, the children are processed recursively, and
* then a "post" function is called.
* function is called and the children are processed recursively.
*
* The "pre" and "post" funcs return a value. If non-zero
* is returned from the "pre" func, the traversal stops and this
* value is returned. The return value from "post" is not used.
* This return value is useful when using traverse as
* a method of finding a device.
* The "pre" func returns a value. If non-zero is returned from
* the "pre" func, the traversal stops and this value is returned.
* This return value is useful when using traverse as a method of
* finding a device.
*
* NOTE: we do not run the funcs for devices that do not appear to
* NOTE: we do not run the func for devices that do not appear to
* be PCI except for the start node which we assume (this is good
* because the start node is often a phb which may be missing PCI
* properties).
* We use the class-code as an indicator. If we run into
* one of these nodes we also assume its siblings are non-pci for
* performance.
*
******************************************************************/
void *traverse_pci_devices(struct device_node *start, traverse_func pre, traverse_func post, void *data)
*/
void *traverse_pci_devices(struct device_node *start, traverse_func pre,
void *data)
{
struct device_node *dn, *nextdn;
void *ret;
if (pre && (ret = pre(start, data)) != NULL)
if (pre && ((ret = pre(start, data)) != NULL))
return ret;
for (dn = start->child; dn; dn = nextdn) {
nextdn = NULL;
#ifdef CONFIG_PPC_PSERIES
if (get_property(dn, "class-code", NULL)) {
if (pre && (ret = pre(dn, data)) != NULL)
if (pre && ((ret = pre(dn, data)) != NULL))
return ret;
if (dn->child) {
if (dn->child)
/* Depth first...do children */
nextdn = dn->child;
} else if (dn->sibling) {
else if (dn->sibling)
/* ok, try next sibling instead. */
nextdn = dn->sibling;
} else {
/* no more children or siblings...call "post" */
if (post)
post(dn, data);
}
}
#endif
if (!nextdn) {
/* Walk up to next valid sibling. */
do {
......@@ -136,31 +124,35 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, travers
return NULL;
}
/* Same as traverse_pci_devices except this does it for all phbs.
/*
* Same as traverse_pci_devices except this does it for all phbs.
*/
void *traverse_all_pci_devices(traverse_func pre)
static void *traverse_all_pci_devices(traverse_func pre)
{
struct pci_controller* phb;
struct pci_controller *phb;
void *ret;
for (phb=hose_head;phb;phb=phb->next)
if ((ret = traverse_pci_devices((struct device_node *)phb->arch_data, pre, NULL, phb)) != NULL)
for (phb = hose_head; phb; phb = phb->next)
if ((ret = traverse_pci_devices(phb->arch_data, pre, phb))
!= NULL)
return ret;
return NULL;
}
/* Traversal func that looks for a <busno,devfcn> value.
/*
* Traversal func that looks for a <busno,devfcn> value.
* If found, the device_node is returned (thus terminating the traversal).
*/
static void *
is_devfn_node(struct device_node *dn, void *data)
static void *is_devfn_node(struct device_node *dn, void *data)
{
int busno = ((unsigned long)data >> 8) & 0xff;
int devfn = ((unsigned long)data) & 0xff;
return (devfn == dn->devfn && busno == dn->busno) ? dn : NULL;
return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL;
}
/* This is the "slow" path for looking up a device_node from a
/*
* This is the "slow" path for looking up a device_node from a
* pci_dev. It will hunt for the device under its parent's
* phb and then update sysdata for a future fastpath.
*
......@@ -174,14 +166,14 @@ is_devfn_node(struct device_node *dn, void *data)
*/
struct device_node *fetch_dev_dn(struct pci_dev *dev)
{
struct device_node *orig_dn = (struct device_node *)dev->sysdata;
struct device_node *orig_dn = dev->sysdata;
struct pci_controller *phb = orig_dn->phb; /* assume same phb as orig_dn */
struct device_node *phb_dn;
struct device_node *dn;
unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
phb_dn = (struct device_node *)(phb->arch_data);
dn = (struct device_node *)traverse_pci_devices(phb_dn, is_devfn_node, NULL, (void *)searchval);
phb_dn = phb->arch_data;
dn = traverse_pci_devices(phb_dn, is_devfn_node, (void *)searchval);
if (dn) {
dev->sysdata = dn;
/* ToDo: call some device init hook here */
......@@ -191,25 +183,23 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
EXPORT_SYMBOL(fetch_dev_dn);
/******************************************************************
/*
* Actually initialize the phbs.
* The buswalk on this phb has not happened yet.
******************************************************************/
void __init
pci_devs_phb_init(void)
*/
void __init pci_devs_phb_init(void)
{
/* This must be done first so the device nodes have valid pci info! */
traverse_all_pci_devices(update_dn_pci_info);
}
static void __init
pci_fixup_bus_sysdata_list(struct list_head *bus_list)
static void __init pci_fixup_bus_sysdata_list(struct list_head *bus_list)
{
struct list_head *ln;
struct pci_bus *bus;
for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
for (ln = bus_list->next; ln != bus_list; ln = ln->next) {
bus = pci_bus_b(ln);
if (bus->self)
bus->sysdata = bus->self->sysdata;
......@@ -217,7 +207,7 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
}
}
/******************************************************************
/*
* Fixup the bus->sysdata ptrs to point to the bus' device_node.
* This is done late in pcibios_init(). We do this mostly for
* sanity, but pci_dma.c uses these at DMA time so they must be
......@@ -225,9 +215,8 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
* To do this we recurse down the bus hierarchy. Note that PHB's
* have bus->self == NULL, but fortunately bus->sysdata is already
* correct in this case.
******************************************************************/
void __init
pci_fix_bus_sysdata(void)
*/
void __init pci_fix_bus_sysdata(void)
{
pci_fixup_bus_sysdata_list(&pci_root_buses);
}
......@@ -404,7 +404,9 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
break;
}
case PTRACE_GETEVENTMSG:
ret = put_user(child->ptrace_message, (unsigned int __user *) data);
break;
default:
ret = ptrace_request(child, request, addr, data);
......
......@@ -208,8 +208,8 @@ static ssize_t show_##NAME(struct sys_device *dev, char *buf) \
unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \
return sprintf(buf, "%lx\n", val); \
} \
static ssize_t store_##NAME(struct sys_device *dev, const char *buf, \
size_t count) \
static ssize_t __attribute_used__ \
store_##NAME(struct sys_device *dev, const char *buf, size_t count) \
{ \
struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
unsigned long val; \
......
......@@ -27,7 +27,6 @@
#include <asm/naca.h>
#include <asm/rtas.h>
#include <asm/xics.h>
#include <asm/ppcdebug.h>
#include <asm/hvcall.h>
#include <asm/machdep.h>
......@@ -239,13 +238,13 @@ static unsigned int real_irq_to_virt(unsigned int real_irq)
#ifdef CONFIG_SMP
static int get_irq_server(unsigned int irq)
{
cpumask_t cpumask = irq_affinity[irq];
cpumask_t tmp = CPU_MASK_NONE;
unsigned int server;
#ifdef CONFIG_IRQ_ALL_CPUS
/* For the moment only implement delivery to all cpus or one cpu */
if (smp_threads_ready) {
cpumask_t cpumask = irq_affinity[irq];
cpumask_t tmp = CPU_MASK_NONE;
if (cpus_equal(cpumask, CPU_MASK_ALL)) {
server = default_distrib_server;
} else {
......@@ -286,7 +285,7 @@ static void xics_enable_irq(unsigned int virq)
call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
DEFAULT_PRIORITY);
if (call_status != 0) {
printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_set_xive "
printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_set_xive "
"returned %x\n", irq, call_status);
return;
}
......@@ -294,7 +293,7 @@ static void xics_enable_irq(unsigned int virq)
/* Now unmask the interrupt (often a no-op) */
call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq);
if (call_status != 0) {
printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_int_on "
printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_int_on "
"returned %x\n", irq, call_status);
return;
}
......@@ -310,7 +309,7 @@ static void xics_disable_real_irq(unsigned int irq)
call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq);
if (call_status != 0) {
printk(KERN_ERR "xics_disable_real_irq: irq=%x: "
printk(KERN_ERR "xics_disable_real_irq: irq=%d: "
"ibm_int_off returned %x\n", irq, call_status);
return;
}
......@@ -319,7 +318,7 @@ static void xics_disable_real_irq(unsigned int irq)
/* Have to set XIVE to 0xff to be able to remove a slot */
call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff);
if (call_status != 0) {
printk(KERN_ERR "xics_disable_irq: irq=%x: ibm_set_xive(0xff)"
printk(KERN_ERR "xics_disable_irq: irq=%d: ibm_set_xive(0xff)"
" returned %x\n", irq, call_status);
return;
}
......@@ -356,8 +355,6 @@ static void xics_mask_and_ack_irq(unsigned int irq)
}
}
extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq);
int xics_get_irq(struct pt_regs *regs)
{
unsigned int cpu = smp_processor_id();
......@@ -384,7 +381,7 @@ int xics_get_irq(struct pt_regs *regs)
if (irq == NO_IRQ)
irq = real_irq_to_virt_slowpath(vec);
if (irq == NO_IRQ) {
printk(KERN_ERR "Interrupt 0x%x (real) is invalid,"
printk(KERN_ERR "Interrupt %d (real) is invalid,"
" disabling it.\n", vec);
xics_disable_real_irq(vec);
} else
......@@ -395,8 +392,6 @@ int xics_get_irq(struct pt_regs *regs)
#ifdef CONFIG_SMP
extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
{
int cpu = smp_processor_id();
......@@ -469,11 +464,9 @@ void xics_init_IRQ(void)
ibm_int_off = rtas_token("ibm,int-off");
np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation");
if (!np) {
printk(KERN_WARNING "Can't find Interrupt Presentation\n");
udbg_printf("Can't find Interrupt Presentation\n");
while (1);
}
if (!np)
panic("xics_init_IRQ: can't find interrupt presentation");
nextnode:
ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);
if (ireg) {
......@@ -484,11 +477,8 @@ void xics_init_IRQ(void)
}
ireg = (uint *)get_property(np, "reg", &ilen);
if (!ireg) {
printk(KERN_WARNING "Can't find Interrupt Reg Property\n");
udbg_printf("Can't find Interrupt Reg Property\n");
while (1);
}
if (!ireg)
panic("xics_init_IRQ: can't find interrupt reg property");
while (ilen) {
inodes[indx].addr = (unsigned long long)*ireg++ << 32;
......@@ -528,16 +518,14 @@ void xics_init_IRQ(void)
np = of_find_node_by_type(NULL, "interrupt-controller");
if (!np) {
printk(KERN_WARNING "xics: no ISA Interrupt Controller\n");
printk(KERN_WARNING "xics: no ISA interrupt controller\n");
xics_irq_8259_cascade_real = -1;
xics_irq_8259_cascade = -1;
} else {
ireg = (uint *) get_property(np, "interrupts", NULL);
if (!ireg) {
printk(KERN_WARNING "Can't find ISA Interrupts Property\n");
udbg_printf("Can't find ISA Interrupts Property\n");
while (1);
}
if (!ireg)
panic("xics_init_IRQ: can't find ISA interrupts property");
xics_irq_8259_cascade_real = *ireg;
xics_irq_8259_cascade
= virt_irq_create_mapping(xics_irq_8259_cascade_real);
......@@ -558,13 +546,8 @@ void xics_init_IRQ(void)
xics_per_cpu[0] = __ioremap((ulong)intr_base, intr_size,
_PAGE_NO_CACHE);
#endif /* CONFIG_SMP */
#ifdef CONFIG_PPC_PSERIES
/* actually iSeries does not use any of xics...but it has link dependencies
* for now, except this new one...
*/
} else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) {
ops = &pSeriesLP_ops;
#endif
}
xics_8259_pic.enable = i8259_pic.enable;
......@@ -590,7 +573,8 @@ static int __init xics_setup_i8259(void)
xics_irq_8259_cascade != -1) {
if (request_irq(irq_offset_up(xics_irq_8259_cascade),
no_action, 0, "8259 cascade", NULL))
printk(KERN_ERR "xics_init_IRQ: couldn't get 8259 cascade\n");
printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 "
"cascade\n");
i8259_init();
}
return 0;
......@@ -643,7 +627,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
irq, newmask, xics_status[1]);
if (status) {
printk(KERN_ERR "xics_set_affinity irq=%d ibm,set-xive "
printk(KERN_ERR "xics_set_affinity: irq=%d ibm,set-xive "
"returns %d\n", irq, status);
return;
}
......@@ -723,7 +707,7 @@ void xics_migrate_irqs_away(void)
status = rtas_call(ibm_set_xive, 3, 1, NULL, irq,
xics_status[0], xics_status[1]);
if (status)
printk(KERN_ERR "migrate_irqs_away irq=%d "
printk(KERN_ERR "migrate_irqs_away: irq=%d "
"ibm,set-xive returns %d\n",
virq, status);
......
......@@ -181,6 +181,15 @@ config QDIO_PERF_STATS
If unsure, say N.
config QDIO_DEBUG
bool "Extended debugging information"
depends on QDIO
help
Say Y here to get extended debugging output in /proc/s390dbf/qdio...
Warning: this option reduces the performance of the QDIO module.
If unsure, say N.
comment "Misc"
config PREEMPT
......
......@@ -17,6 +17,7 @@
#include <linux/errno.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/smp.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/page-flags.h>
......
......@@ -11,7 +11,6 @@ CONFIG_UID16=y
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
#
# General setup
......@@ -71,6 +70,7 @@ CONFIG_MATHEMU=y
CONFIG_MACHCHK_WARNING=y
CONFIG_QDIO=y
# CONFIG_QDIO_PERF_STATS is not set
# CONFIG_QDIO_DEBUG is not set
#
# Misc
......@@ -93,6 +93,7 @@ CONFIG_NO_IDLE_HZ_INIT=y
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
......@@ -511,7 +512,7 @@ CONFIG_CRYPTO=y
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_AES_GENERIC is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
......
......@@ -214,4 +214,7 @@ struct sigevent32 {
} _sigev_un;
};
extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
extern int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from);
#endif /* _ASM_S390X_S390_H */
......@@ -106,6 +106,53 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
return err;
}
int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from)
{
int err;
u32 tmp;
if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
return -EFAULT;
err = __get_user(to->si_signo, &from->si_signo);
err |= __get_user(to->si_errno, &from->si_errno);
err |= __get_user(to->si_code, &from->si_code);
if (from->si_code < 0)
err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
else {
switch (from->si_code >> 16) {
case __SI_RT >> 16: /* This is not generated by the kernel as of now. */
case __SI_MESGQ >> 16:
err |= __get_user(to->si_int, &from->si_int);
/* fallthrough */
case __SI_KILL >> 16:
err |= __get_user(to->si_pid, &from->si_pid);
err |= __get_user(to->si_uid, &from->si_uid);
break;
case __SI_CHLD >> 16:
err |= __get_user(to->si_pid, &from->si_pid);
err |= __get_user(to->si_uid, &from->si_uid);
err |= __get_user(to->si_utime, &from->si_utime);
err |= __get_user(to->si_stime, &from->si_stime);
err |= __get_user(to->si_status, &from->si_status);
break;
case __SI_FAULT >> 16:
err |= __get_user(tmp, &from->si_addr);
to->si_addr = (void *)(u64) (tmp & PSW32_ADDR_INSN);
break;
case __SI_POLL >> 16:
case __SI_TIMER >> 16:
err |= __get_user(to->si_band, &from->si_band);
err |= __get_user(to->si_fd, &from->si_fd);
break;
default:
break;
}
}
return err;
}
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
......
......@@ -553,6 +553,19 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
copied += sizeof(unsigned int);
}
return 0;
case PTRACE_GETEVENTMSG:
return put_user((__u32) child->ptrace_message,
(unsigned int __user *) data);
case PTRACE_GETSIGINFO:
if (child->last_siginfo == NULL)
return -EINVAL;
return copy_siginfo_to_user32((siginfo_t32 __user *) data,
child->last_siginfo);
case PTRACE_SETSIGINFO:
if (child->last_siginfo == NULL)
return -EINVAL;
return copy_siginfo_from_user32(child->last_siginfo,
(siginfo_t32 __user *) data);
}
return ptrace_request(child, request, addr, data);
}
......
......@@ -19,6 +19,7 @@
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
#include <asm/smp.h>
#include "../../../drivers/s390/net/smsgiucv.h"
......
......@@ -83,6 +83,7 @@ config HW_CONSOLE
config SMP
bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
depends on BROKEN
---help---
This enables support for systems with more than one CPU. If you have
a system with only one CPU, like most personal computers, say N. If
......@@ -221,6 +222,7 @@ config SUN_PM
config SUN4
bool "Support for SUN4 machines (disables SUN4[CDM] support)"
depends on !SMP
help
Say Y here if, and only if, your machine is a sun4. Note that
a kernel compiled with this option will run only on sun4.
......
......@@ -45,6 +45,7 @@ int smp_activated = 0;
volatile int __cpu_number_map[NR_CPUS];
volatile int __cpu_logical_map[NR_CPUS];
cycles_t cacheflush_time = 0; /* XXX */
unsigned long cache_decay_ticks = 100;
cpumask_t cpu_online_map = CPU_MASK_NONE;
cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
......@@ -203,6 +204,11 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
}
}
void smp_reschedule_irq(void)
{
set_need_resched();
}
void smp_flush_page_to_ram(unsigned long page)
{
/* Current theory is that those who call this are the one's
......
......@@ -43,7 +43,6 @@ extern ctxd_t *srmmu_ctx_table_phys;
extern void calibrate_delay(void);
extern volatile int smp_processors_ready;
extern unsigned long cpu_present_map;
extern int smp_num_cpus;
static int smp_highest_cpu;
extern int smp_threads_ready;
......@@ -100,8 +99,6 @@ void __init smp4d_callin(void)
* the SMP initialization the master will be just allowed
* to call the scheduler code.
*/
init_idle();
/* Get our local ticker going. */
smp_setup_percpu_timer();
......@@ -152,7 +149,6 @@ void __init smp4d_callin(void)
extern int cpu_idle(void *unused);
extern void init_IRQ(void);
extern void cpu_panic(void);
extern int start_secondary(void *unused);
/*
* Cycle through the processors asking the PROM to start each one.
......@@ -174,12 +170,12 @@ void __init smp4d_boot_cpus(void)
current_set[0] = NULL;
local_irq_enable();
cpu_present_map = 0;
cpus_clear(cpu_present_map);
/* XXX This whole thing has to go. See sparc64. */
for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
cpu_present_map |= (1<<mid);
SMP_PRINTK(("cpu_present_map %08lx\n", cpu_present_map));
cpu_set(mid, cpu_present_map);
SMP_PRINTK(("cpu_present_map %08lx\n", cpus_addr(cpu_present_map)[0]));
for(i=0; i < NR_CPUS; i++)
__cpu_number_map[i] = -1;
for(i=0; i < NR_CPUS; i++)
......@@ -197,7 +193,7 @@ void __init smp4d_boot_cpus(void)
if(i == boot_cpu_id)
continue;
if(cpu_present_map & (1 << i)) {
if (cpu_isset(i, cpu_present_map)) {
extern unsigned long sun4d_cpu_startup;
unsigned long *entry = &sun4d_cpu_startup;
struct task_struct *p;
......@@ -254,19 +250,19 @@ void __init smp4d_boot_cpus(void)
}
}
if(!(cpu_callin_map[i])) {
cpu_present_map &= ~(1 << i);
cpu_clear(i, cpu_present_map);
__cpu_number_map[i] = -1;
}
}
local_flush_cache_all();
if(cpucount == 0) {
printk("Error: only one Processor found.\n");
cpu_present_map = (1 << hard_smp4d_processor_id());
cpu_present_map = cpumask_of_cpu(hard_smp4d_processor_id());
} else {
unsigned long bogosum = 0;
for(i = 0; i < NR_CPUS; i++) {
if(cpu_present_map & (1 << i)) {
if (cpu_isset(i, cpu_present_map)) {
bogosum += cpu_data(i).udelay_val;
smp_highest_cpu = i;
}
......@@ -346,12 +342,13 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
/* Init receive/complete mapping, plus fire the IPI's off. */
{
register unsigned long mask;
cpumask_t mask;
register int i;
mask = (cpu_present_map & ~(1 << hard_smp4d_processor_id()));
mask = cpumask_of_cpu(hard_smp4d_processor_id());
cpus_andnot(mask, cpu_present_map, mask);
for(i = 0; i <= high; i++) {
if(mask & (1 << i)) {
if (cpu_isset(i, mask)) {
ccall_info.processors_in[i] = 0;
ccall_info.processors_out[i] = 0;
sun4d_send_ipi(i, IRQ_CROSS_CALL);
......@@ -498,11 +495,11 @@ void __init sun4d_init_smp(void)
t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
/* And set btfixup... */
BTFIXUPSET_BLACKBOX(smp_processor_id, smp4d_blackbox_id);
BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4d_blackbox_id);
BTFIXUPSET_BLACKBOX(load_current, smp4d_blackbox_current);
BTFIXUPSET_CALL(smp_cross_call, smp4d_cross_call, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(smp_message_pass, smp4d_message_pass, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM);
for (i = 0; i < NR_CPUS; i++) {
ccall_info.processors_in[i] = 1;
......
......@@ -95,8 +95,6 @@ void __init smp4m_callin(void)
* the SMP initialization the master will be just allowed
* to call the scheduler code.
*/
init_idle();
/* Allow master to continue. */
swap((unsigned long *)&cpu_callin_map[cpuid], 1);
......@@ -126,7 +124,6 @@ void __init smp4m_callin(void)
extern int cpu_idle(void *unused);
extern void init_IRQ(void);
extern void cpu_panic(void);
extern int start_secondary(void *unused);
/*
* Cycle through the processors asking the PROM to start each one.
......@@ -460,9 +457,9 @@ void __init smp4m_blackbox_current(unsigned *addr)
void __init sun4m_init_smp(void)
{
BTFIXUPSET_BLACKBOX(smp_processor_id, smp4m_blackbox_id);
BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4m_blackbox_id);
BTFIXUPSET_BLACKBOX(load_current, smp4m_blackbox_current);
BTFIXUPSET_CALL(smp_cross_call, smp4m_cross_call, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(smp_message_pass, smp4m_message_pass, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM);
}
......@@ -88,8 +88,6 @@ cpu3_startup:
.align 4
smp_do_cpu_idle:
call init_idle
nop
call cpu_idle
mov 0, %o0
......
......@@ -42,124 +42,124 @@ x:
#endif
/* Both these macros have to start with exactly the same insn */
#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
ldd [%src + offset + 0x10], %t4; \
ldd [%src + offset + 0x18], %t6; \
st %t0, [%dst + offset + 0x00]; \
st %t1, [%dst + offset + 0x04]; \
st %t2, [%dst + offset + 0x08]; \
st %t3, [%dst + offset + 0x0c]; \
st %t4, [%dst + offset + 0x10]; \
st %t5, [%dst + offset + 0x14]; \
st %t6, [%dst + offset + 0x18]; \
st %t7, [%dst + offset + 0x1c];
#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
ldd [%src + offset + 0x10], %t4; \
ldd [%src + offset + 0x18], %t6; \
std %t0, [%dst + offset + 0x00]; \
std %t2, [%dst + offset + 0x08]; \
std %t4, [%dst + offset + 0x10]; \
std %t6, [%dst + offset + 0x18];
#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src - offset - 0x10], %t0; \
ldd [%src - offset - 0x08], %t2; \
st %t0, [%dst - offset - 0x10]; \
st %t1, [%dst - offset - 0x0c]; \
st %t2, [%dst - offset - 0x08]; \
st %t3, [%dst - offset - 0x04];
#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src - offset - 0x10], %t0; \
ldd [%src - offset - 0x08], %t2; \
std %t0, [%dst - offset - 0x10]; \
std %t2, [%dst - offset - 0x08];
#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
ldub [%src - offset - 0x02], %t0; \
ldub [%src - offset - 0x01], %t1; \
stb %t0, [%dst - offset - 0x02]; \
stb %t1, [%dst - offset - 0x01];
#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src + (offset) + 0x00], %t0; \
ldd [%src + (offset) + 0x08], %t2; \
ldd [%src + (offset) + 0x10], %t4; \
ldd [%src + (offset) + 0x18], %t6; \
st %t0, [%dst + (offset) + 0x00]; \
st %t1, [%dst + (offset) + 0x04]; \
st %t2, [%dst + (offset) + 0x08]; \
st %t3, [%dst + (offset) + 0x0c]; \
st %t4, [%dst + (offset) + 0x10]; \
st %t5, [%dst + (offset) + 0x14]; \
st %t6, [%dst + (offset) + 0x18]; \
st %t7, [%dst + (offset) + 0x1c];
#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src + (offset) + 0x00], %t0; \
ldd [%src + (offset) + 0x08], %t2; \
ldd [%src + (offset) + 0x10], %t4; \
ldd [%src + (offset) + 0x18], %t6; \
std %t0, [%dst + (offset) + 0x00]; \
std %t2, [%dst + (offset) + 0x08]; \
std %t4, [%dst + (offset) + 0x10]; \
std %t6, [%dst + (offset) + 0x18];
#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src - (offset) - 0x10], %t0; \
ldd [%src - (offset) - 0x08], %t2; \
st %t0, [%dst - (offset) - 0x10]; \
st %t1, [%dst - (offset) - 0x0c]; \
st %t2, [%dst - (offset) - 0x08]; \
st %t3, [%dst - (offset) - 0x04];
#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src - (offset) - 0x10], %t0; \
ldd [%src - (offset) - 0x08], %t2; \
std %t0, [%dst - (offset) - 0x10]; \
std %t2, [%dst - (offset) - 0x08];
#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
ldub [%src - (offset) - 0x02], %t0; \
ldub [%src - (offset) - 0x01], %t1; \
stb %t0, [%dst - (offset) - 0x02]; \
stb %t1, [%dst - (offset) - 0x01];
/* Both these macros have to start with exactly the same insn */
#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src - offset - 0x20], %t0; \
ldd [%src - offset - 0x18], %t2; \
ldd [%src - offset - 0x10], %t4; \
ldd [%src - offset - 0x08], %t6; \
st %t0, [%dst - offset - 0x20]; \
st %t1, [%dst - offset - 0x1c]; \
st %t2, [%dst - offset - 0x18]; \
st %t3, [%dst - offset - 0x14]; \
st %t4, [%dst - offset - 0x10]; \
st %t5, [%dst - offset - 0x0c]; \
st %t6, [%dst - offset - 0x08]; \
st %t7, [%dst - offset - 0x04];
#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src - offset - 0x20], %t0; \
ldd [%src - offset - 0x18], %t2; \
ldd [%src - offset - 0x10], %t4; \
ldd [%src - offset - 0x08], %t6; \
std %t0, [%dst - offset - 0x20]; \
std %t2, [%dst - offset - 0x18]; \
std %t4, [%dst - offset - 0x10]; \
std %t6, [%dst - offset - 0x08];
#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
st %t0, [%dst + offset + 0x00]; \
st %t1, [%dst + offset + 0x04]; \
st %t2, [%dst + offset + 0x08]; \
st %t3, [%dst + offset + 0x0c];
#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
ldub [%src + offset + 0x00], %t0; \
ldub [%src + offset + 0x01], %t1; \
stb %t0, [%dst + offset + 0x00]; \
stb %t1, [%dst + offset + 0x01];
#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
srl %t0, shir, %t5; \
srl %t1, shir, %t6; \
sll %t0, shil, %t0; \
or %t5, %prev, %t5; \
sll %t1, shil, %prev; \
or %t6, %t0, %t0; \
srl %t2, shir, %t1; \
srl %t3, shir, %t6; \
sll %t2, shil, %t2; \
or %t1, %prev, %t1; \
std %t4, [%dst + offset + offset2 - 0x04]; \
std %t0, [%dst + offset + offset2 + 0x04]; \
sll %t3, shil, %prev; \
#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src - (offset) - 0x20], %t0; \
ldd [%src - (offset) - 0x18], %t2; \
ldd [%src - (offset) - 0x10], %t4; \
ldd [%src - (offset) - 0x08], %t6; \
st %t0, [%dst - (offset) - 0x20]; \
st %t1, [%dst - (offset) - 0x1c]; \
st %t2, [%dst - (offset) - 0x18]; \
st %t3, [%dst - (offset) - 0x14]; \
st %t4, [%dst - (offset) - 0x10]; \
st %t5, [%dst - (offset) - 0x0c]; \
st %t6, [%dst - (offset) - 0x08]; \
st %t7, [%dst - (offset) - 0x04];
#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [%src - (offset) - 0x20], %t0; \
ldd [%src - (offset) - 0x18], %t2; \
ldd [%src - (offset) - 0x10], %t4; \
ldd [%src - (offset) - 0x08], %t6; \
std %t0, [%dst - (offset) - 0x20]; \
std %t2, [%dst - (offset) - 0x18]; \
std %t4, [%dst - (offset) - 0x10]; \
std %t6, [%dst - (offset) - 0x08];
#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
ldd [%src + (offset) + 0x00], %t0; \
ldd [%src + (offset) + 0x08], %t2; \
st %t0, [%dst + (offset) + 0x00]; \
st %t1, [%dst + (offset) + 0x04]; \
st %t2, [%dst + (offset) + 0x08]; \
st %t3, [%dst + (offset) + 0x0c];
#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
ldub [%src + (offset) + 0x00], %t0; \
ldub [%src + (offset) + 0x01], %t1; \
stb %t0, [%dst + (offset) + 0x00]; \
stb %t1, [%dst + (offset) + 0x01];
#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
ldd [%src + (offset) + 0x00], %t0; \
ldd [%src + (offset) + 0x08], %t2; \
srl %t0, shir, %t5; \
srl %t1, shir, %t6; \
sll %t0, shil, %t0; \
or %t5, %prev, %t5; \
sll %t1, shil, %prev; \
or %t6, %t0, %t0; \
srl %t2, shir, %t1; \
srl %t3, shir, %t6; \
sll %t2, shil, %t2; \
or %t1, %prev, %t1; \
std %t4, [%dst + (offset) + (offset2) - 0x04]; \
std %t0, [%dst + (offset) + (offset2) + 0x04]; \
sll %t3, shil, %prev; \
or %t6, %t2, %t4;
#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
srl %t0, shir, %t4; \
srl %t1, shir, %t5; \
sll %t0, shil, %t6; \
or %t4, %prev, %t0; \
sll %t1, shil, %prev; \
or %t5, %t6, %t1; \
srl %t2, shir, %t4; \
srl %t3, shir, %t5; \
sll %t2, shil, %t6; \
or %t4, %prev, %t2; \
sll %t3, shil, %prev; \
or %t5, %t6, %t3; \
std %t0, [%dst + offset + offset2 + 0x00]; \
std %t2, [%dst + offset + offset2 + 0x08];
#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
ldd [%src + (offset) + 0x00], %t0; \
ldd [%src + (offset) + 0x08], %t2; \
srl %t0, shir, %t4; \
srl %t1, shir, %t5; \
sll %t0, shil, %t6; \
or %t4, %prev, %t0; \
sll %t1, shil, %prev; \
or %t5, %t6, %t1; \
srl %t2, shir, %t4; \
srl %t3, shir, %t5; \
sll %t2, shil, %t6; \
or %t4, %prev, %t2; \
sll %t3, shil, %prev; \
or %t5, %t6, %t3; \
std %t0, [%dst + (offset) + (offset2) + 0x00]; \
std %t2, [%dst + (offset) + (offset2) + 0x08];
.text
.align 4
......
......@@ -1697,9 +1697,7 @@ static void turbosparc_flush_cache_mm(struct mm_struct *mm)
static void turbosparc_flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
struct mm_struct *mm = vma->vm_mm;
FLUSH_BEGIN(mm)
FLUSH_BEGIN(vma->vm_mm)
flush_user_windows();
turbosparc_idflash_clear();
FLUSH_END
......@@ -1750,9 +1748,7 @@ static void turbosparc_flush_tlb_mm(struct mm_struct *mm)
static void turbosparc_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
struct mm_struct *mm = vma->vm_mm;
FLUSH_BEGIN(mm)
FLUSH_BEGIN(vma->vm_mm)
srmmu_flush_whole_tlb();
FLUSH_END
}
......
......@@ -1026,11 +1026,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
/* check if we should pass this packet */
/* the filter instructions are constructed assuming
a four-byte PPP header on each packet */
{
u_int16_t *p = (u_int16_t *) skb_push(skb, 2);
*p = htons(4); /* indicate outbound in DLT_LINUX_SLL */;
}
*skb_push(skb, 2) = 1;
if (ppp->pass_filter
&& sk_run_filter(skb, ppp->pass_filter,
ppp->pass_len) == 0) {
......@@ -1573,11 +1569,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
/* check if the packet passes the pass and active filters */
/* the filter instructions are constructed assuming
a four-byte PPP header on each packet */
{
u_int16_t *p = (u_int16_t *) skb_push(skb, 2);
*p = 0; /* indicate inbound in DLT_LINUX_SLL */
}
*skb_push(skb, 2) = 0;
if (ppp->pass_filter
&& sk_run_filter(skb, ppp->pass_filter,
ppp->pass_len) == 0) {
......
/*
* drivers/s390/cio/chsc.c
* S/390 common I/O routines -- channel subsystem call
* $Revision: 1.114 $
* $Revision: 1.115 $
*
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
......@@ -906,8 +906,6 @@ new_channel_path(int chpid)
return -ENOMEM;
memset(chp, 0, sizeof(struct channel_path));
chps[chpid] = chp;
/* fill in status, etc. */
chp->id = chpid;
chp->state = 1;
......@@ -922,12 +920,17 @@ new_channel_path(int chpid)
if (ret) {
printk(KERN_WARNING "%s: could not register %02x\n",
__func__, chpid);
return ret;
goto out_free;
}
ret = device_create_file(&chp->dev, &dev_attr_status);
if (ret)
if (ret) {
device_unregister(&chp->dev);
goto out_free;
} else
chps[chpid] = chp;
return ret;
out_free:
kfree(chp);
return ret;
}
......
......@@ -127,10 +127,15 @@ extern int cio_set_options (struct subchannel *, int);
extern int cio_get_options (struct subchannel *);
extern int cio_modify (struct subchannel *);
/* Use with care. */
#ifdef CONFIG_CCW_CONSOLE
extern struct subchannel *cio_probe_console(void);
extern void cio_release_console(void);
extern int cio_is_console(int irq);
extern struct subchannel *cio_get_console_subchannel(void);
#else
#define cio_is_console(irq) 0
#define cio_get_console_subchannel() NULL
#endif
extern int cio_show_msg;
......
......@@ -244,6 +244,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
};
if (notify) {
/* Get device online again. */
cdev->private->state = DEV_STATE_OFFLINE;
ccw_device_online(cdev);
wake_up(&cdev->private->wait_q);
return;
......
This diff is collapsed.
......@@ -348,7 +348,8 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
(irb->scsw.actl & SCSW_ACTL_SUSPENDED)))
ccw_device_path_notoper(cdev);
if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK)) {
if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK) &&
(irb->scsw.dstat & DEV_STAT_CHN_END)) {
cdev->private->irb.esw.esw0.erw.cons = 1;
cdev->private->flags.dosense = 0;
}
......
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.
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