Commit cf3f977a authored by Ben Collins's avatar Ben Collins

Merge http://linux.bkbits.net/linux-2.5

into debian.org:/usr/src/kernel/linux-2.6
parents 443473ed 313c01d3
......@@ -169,51 +169,10 @@ source "fs/Kconfig.binfmt"
endmenu
source "drivers/base/Kconfig"
# source "drivers/mtd/Kconfig"
source "drivers/parport/Kconfig"
# source "drivers/pnp/Kconfig"
source "drivers/block/Kconfig"
source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
source "drivers/md/Kconfig"
source drivers/message/fusion/Kconfig
#source drivers/ieee1394/Kconfig
#source drivers/message/i2o/Kconfig
source "net/Kconfig"
#source "drivers/isdn/Kconfig"
#source "drivers/telephony/Kconfig"
# input before char - char/joystick depends on it. As does USB.
source "drivers/input/Kconfig"
source "drivers/char/Kconfig"
#source "drivers/misc/Kconfig"
source "drivers/media/Kconfig"
source "drivers/Kconfig"
source "fs/Kconfig"
source "drivers/video/Kconfig"
source "sound/Kconfig"
source "drivers/usb/Kconfig"
source "arch/parisc/oprofile/Kconfig"
menu "Kernel hacking"
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,7 @@ extra-y := init_task.o $(head-y) vmlinux.lds.s
AFLAGS_entry.o := -traditional
AFLAGS_pacache.o := -traditional
CFLAGS_ioctl32.o := -Ifs/
obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \
pa7300lc.o syscall.o entry.o sys_parisc.o firmware.o \
......
......@@ -292,5 +292,10 @@ void __flush_dcache_page(struct page *page)
break;
}
}
EXPORT_SYMBOL(__flush_dcache_page);
/* Defined in arch/parisc/kernel/pacache.S */
EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
EXPORT_SYMBOL(flush_kernel_dcache_page);
EXPORT_SYMBOL(flush_data_cache_local);
EXPORT_SYMBOL(flush_kernel_icache_range_asm);
......@@ -560,9 +560,9 @@ static void print_parisc_device(struct parisc_device *dev)
static int count;
print_pa_hwpath(dev, hw_path);
printk(KERN_INFO "%d. %s (%d) at 0x%lx [%s], versions 0x%x, 0x%x, 0x%x",
++count, dev->name, dev->id.hw_type, dev->hpa, hw_path,
dev->id.hversion, dev->id.hversion_rev, dev->id.sversion);
printk(KERN_INFO "%d. %s at 0x%lx [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
++count, dev->name, dev->hpa, hw_path, dev->id.hw_type,
dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
if (dev->num_addrs) {
int k;
......
......@@ -77,13 +77,13 @@
ldil L%KERNEL_PSW, %r1
ldo R%KERNEL_PSW(%r1), %r1
mtctl %r1, %cr22
mtctl %r0, %cr17
mtctl %r0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
ldil L%4f, %r1
ldo R%4f(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* Set IIAOQ tail */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* Set IIAOQ head */
rfir
nop
4:
......
......@@ -541,7 +541,7 @@ EXPORT_SYMBOL(pdc_lan_station_id);
* o cable too long (ie SE scsi 10Mhz won't support 6m length),
* o bus width exported is less than what the interface chip supports.
*/
int pdc_get_initiator( struct hardware_path *hwpath, unsigned char *scsi_id,
int pdc_get_initiator(struct hardware_path *hwpath, unsigned char *scsi_id,
unsigned long *period, char *width, char *mode)
{
int retval;
......@@ -550,20 +550,21 @@ int pdc_get_initiator( struct hardware_path *hwpath, unsigned char *scsi_id,
/* BCJ-XXXX series boxes. E.G. "9000/785/C3000" */
#define IS_SPROCKETS() (strlen(boot_cpu_data.pdc.sys_model_name) == 14 && \
strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785", 9) == 0)
strncmp(boot_cpu_data.pdc.sys_model_name, "9000/785", 8) == 0)
retval = mem_pdc_call(PDC_INITIATOR, PDC_GET_INITIATOR,
__pa(pdc_result), __pa(hwpath));
if (retval < PDC_OK)
goto fail;
if (retval >= PDC_OK) {
*scsi_id = (unsigned char) pdc_result[0];
/* convert Bus speed in Mhz to period (in 1/10 ns) */
switch(pdc_result[1]) {
switch (pdc_result[1]) {
/*
** case 0: driver determines rate
** case -1: Settings are uninitialized.
* case 0: driver determines rate
* case -1: Settings are uninitialized.
*/
case 5: *period = 2000; break;
case 10: *period = 1000; break;
......@@ -573,30 +574,25 @@ int pdc_get_initiator( struct hardware_path *hwpath, unsigned char *scsi_id,
}
/*
** pdc_result[2] PDC suggested SCSI id
** pdc_result[3] PDC suggested SCSI rate
* pdc_result[2] PDC suggested SCSI id
* pdc_result[3] PDC suggested SCSI rate
*/
if (IS_SPROCKETS()) {
/*
** Revisit: PAT PDC do the same thing?
** A500 also exports 50-pin SE SCSI.
** 0 == 8-bit
** 1 == 16-bit
*/
/* 0 == 8-bit, 1 == 16-bit */
*width = (char) pdc_result[4];
/* ...in case someone needs it in the future.
** sym53c8xx.c comments say it can't autodetect
** for 825/825A/875 chips.
** 0 == SE, 1 == HVD, 2 == LVD
* sym53c8xx.c comments say it can't autodetect
* for 825/825A/875 chips.
* 0 == SE, 1 == HVD, 2 == LVD
*/
*mode = (char) pdc_result[5];
}
}
fail:
spin_unlock_irq(&pdc_lock);
return retval >= PDC_OK;
return (retval >= PDC_OK);
}
EXPORT_SYMBOL(pdc_get_initiator);
......
......@@ -772,6 +772,7 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{HPHW_FIO, 0x00D, 0x0007B, 0x0, "Strider-33 Audio"},
{HPHW_FIO, 0x00E, 0x0007B, 0x0, "Trailways-50 Audio"},
{HPHW_FIO, 0x00F, 0x0007B, 0x0, "Trailways-33 Audio"},
{HPHW_FIO, 0x015, 0x0007B, 0x0, "KittyHawk GSY Core Audio"},
{HPHW_FIO, 0x016, 0x0007B, 0x0, "Gecko Audio"},
{HPHW_FIO, 0x019, 0x0007B, 0x0, "Scorpio Sr. Audio"},
{HPHW_FIO, 0x01A, 0x0007B, 0x0, "Anole 64 Audio"},
......@@ -824,6 +825,7 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
{HPHW_FIO, 0x026, 0x0007F, 0x0, "CoralII Jaguar Audio"},
{HPHW_FIO, 0x010, 0x00080, 0x0, "Pace Core HPIB"},
{HPHW_FIO, 0x024, 0x00080, 0x0, "Fast Pace Core HPIB"},
{HPHW_FIO, 0x015, 0x00082, 0x0, "KittyHawk GSY Core SCSI"},
{HPHW_FIO, 0x016, 0x00082, 0x0, "Gecko Core SCSI"},
{HPHW_FIO, 0x01A, 0x00082, 0x0, "Anole 64 Core SCSI"},
{HPHW_FIO, 0x01B, 0x00082, 0x0, "Anole 100 Core SCSI"},
......
......@@ -221,13 +221,13 @@ $install_iva:
** Clear the two-level IIA Space Queue, effectively setting
** Kernel space.
*/
mtctl %r0,%cr17
mtctl %r0,%cr17
mtctl %r0,%cr17 /* Clear IIASQ tail */
mtctl %r0,%cr17 /* Clear IIASQ head */
/* Load RFI target into PC queue */
mtctl %r11,%cr18
mtctl %r11,%cr18 /* IIAOQ head */
ldo 4(%r11),%r11
mtctl %r11,%cr18
mtctl %r11,%cr18 /* IIAOQ tail */
/* Jump to hyperspace */
rfi
......
......@@ -267,13 +267,13 @@ aligned_rfi:
** Clear the two-level IIA Space Queue, effectively setting
** Kernel space.
*/
mtctl %r0,%cr17
mtctl %r0,%cr17
mtctl %r0,%cr17 /* Clear IIASQ tail */
mtctl %r0,%cr17 /* Clear IIASQ head */
/* Load RFI target into PC queue */
mtctl %r11,%cr18
mtctl %r11,%cr18 /* IIAOQ head */
ldo 4(%r11),%r11
mtctl %r11,%cr18
mtctl %r11,%cr18 /* IIAOQ tail */
/* Jump to hyperspace */
rfi
......
......@@ -532,7 +532,12 @@ static void __init system_map_inventory(void)
* Otherwise the machine might crash during iommu setup.
*/
pdc_io_reset();
pdc_io_reset_devices();
/*
* Unfortunately if we reset devices here, serial console
* stops working :-(
*/
/* pdc_io_reset_devices(); */
#endif
for (i = 0; status != PDC_BAD_PROC && status != PDC_NE_MOD; i++) {
......
This diff is collapsed.
......@@ -79,13 +79,13 @@ flush_tlb_all_local:
ldil L%REAL_MODE_PSW, %r1
ldo R%REAL_MODE_PSW(%r1), %r1
mtctl %r1, %cr22
mtctl %r0, %cr17
mtctl %r0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
ldil L%PA(1f),%r1
ldo R%PA(1f)(%r1),%r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
rfi
nop
......@@ -185,13 +185,13 @@ fdtdone:
ldo R%KERNEL_PSW(%r1), %r1
or %r1,%r19,%r1 /* Set I bit if set on entry */
mtctl %r1, %cr22
mtctl %r0, %cr17
mtctl %r0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
ldil L%(2f), %r1
ldo R%(2f)(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
rfi
nop
......@@ -837,13 +837,13 @@ disable_sr_hashing_asm:
ldil L%REAL_MODE_PSW, %r1
ldo R%REAL_MODE_PSW(%r1), %r1
mtctl %r1, %cr22
mtctl %r0, %cr17
mtctl %r0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
ldil L%PA(1f),%r1
ldo R%PA(1f)(%r1),%r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
rfi
nop
......@@ -889,13 +889,13 @@ srdis_done:
ldil L%KERNEL_PSW, %r1
ldo R%KERNEL_PSW(%r1), %r1
mtctl %r1, %cr22
mtctl %r0, %cr17
mtctl %r0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
ldil L%(2f), %r1
ldo R%(2f)(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
rfi
nop
......
......@@ -26,10 +26,6 @@ EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strpbrk);
#include <asm/processor.h>
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(boot_cpu_data);
#include <linux/pm.h>
EXPORT_SYMBOL(pm_power_off);
......@@ -64,15 +60,6 @@ EXPORT_SYMBOL(__memcpy_toio);
EXPORT_SYMBOL(__memcpy_fromio);
EXPORT_SYMBOL(__memset_io);
#include <asm/cache.h>
EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
EXPORT_SYMBOL(flush_kernel_dcache_page);
EXPORT_SYMBOL(flush_data_cache_local);
EXPORT_SYMBOL(flush_kernel_icache_range_asm);
EXPORT_SYMBOL(flush_all_caches);
EXPORT_SYMBOL(dcache_stride);
EXPORT_SYMBOL(flush_cache_all_local);
#include <asm/unistd.h>
extern long sys_open(const char *, int, int);
extern off_t sys_lseek(int, off_t, int);
......
......@@ -2,7 +2,7 @@
* arch/parisc/kernel/pdc_chassis.c
*
* Copyright (C) 2002 Laurent Canet <canetl@esiee.fr>
* Copyright (C) 2002 Thibaut Varene <varenet@esiee.fr>
* Copyright (C) 2002-2003 Thibaut Varene <varenet@esiee.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -35,6 +35,8 @@
#include <asm/pdc_chassis.h>
#include <asm/processor.h>
#ifdef CONFIG_PDC_CHASSIS
static int pdc_chassis_old = 0;
......@@ -102,6 +104,7 @@ static struct notifier_block pdc_chassis_reboot_block = {
.notifier_call = pdc_chassis_reboot_event,
.priority = INT_MAX,
};
#endif /* CONFIG_PDC_CHASSIS */
/**
......@@ -110,16 +113,33 @@ static struct notifier_block pdc_chassis_reboot_block = {
void __init parisc_pdc_chassis_init(void)
{
#ifdef CONFIG_PDC_CHASSIS
int handle = 0;
DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__);
/* Let see if we have something to handle... */
/* Check for PDC_PAT or old LED Panel */
pdc_chassis_checkold();
if (is_pdc_pat()) {
#ifdef __LP64__ /* see pdc_chassis_send_status() */
printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n");
handle = 1;
#endif /* __LP64__ */
}
else if (pdc_chassis_old) {
printk(KERN_INFO "Enabling old style chassis LED panel support.\n");
handle = 1;
}
if (handle) {
/* initialize panic notifier chain */
notifier_chain_register(&panic_notifier_list, &pdc_chassis_panic_block);
/* initialize reboot notifier chain */
register_reboot_notifier(&pdc_chassis_reboot_block);
/* Check for old LED Panel */
pdc_chassis_checkold();
}
#endif /* CONFIG_PDC_CHASSIS */
}
......@@ -128,7 +148,8 @@ void __init parisc_pdc_chassis_init(void)
* and changes the front panel LEDs according to the new system state
* @retval: PDC call return value.
*
* Only machines with 64 bits PDC PAT and E-class are supported atm.
* Only machines with 64 bits PDC PAT and those reported in
* pdc_chassis_checkold() are supported atm.
*
* returns 0 if no error, -1 if no supported PDC is present or invalid message,
* else returns the appropriate PDC error code.
......@@ -140,7 +161,7 @@ int pdc_chassis_send_status(int message)
{
/* Maybe we should do that in an other way ? */
int retval = 0;
#ifdef CONFIG_PDC_CHASSIS
DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message);
#ifdef __LP64__ /* pdc_pat_chassis_send_log is defined only when #ifdef __LP64__ */
......@@ -199,7 +220,7 @@ int pdc_chassis_send_status(int message)
retval = -1;
}
} else retval = -1;
#endif
#endif /* __LP64__ */
#endif /* CONFIG_PDC_CHASSIS */
return retval;
}
......@@ -61,16 +61,6 @@ static struct tty_driver * pdc_console_device (struct console *c, int *index)
*index = c->index ? c->index-1 : fg_console;
return &console_driver;
}
#elif defined(CONFIG_SERIAL_MUX)
#warning CONFIG_SERIAL_MUX
#define PDC_CONSOLE_DEVICE pdc_console_device
#warning "FIXME - should be: static struct tty_driver * pdc_console_device (struct console *c, int *index)"
static kdev_t pdc_console_device (struct console *c, int *index)
{
return mk_kdev(MUX_MAJOR, 0);
}
#else
#define PDC_CONSOLE_DEVICE NULL
#endif
......@@ -105,7 +95,7 @@ static void pdc_console_init_force(void)
void __init pdc_console_init(void)
{
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE) || defined(CONFIG_SERIAL_MUX)
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE)
pdc_console_init_force();
#endif
#ifdef EARLY_BOOTUP_DEBUG
......
......@@ -179,6 +179,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
return __kernel_thread(fn, arg, flags);
}
EXPORT_SYMBOL(kernel_thread);
/*
* Free current thread data structures etc..
......
......@@ -27,14 +27,12 @@
*
*/
#include <linux/config.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/delay.h>
#define PCI_DEBUG
#include <linux/pci.h>
#undef PCI_DEBUG
#include <linux/slab.h>
#include <asm/cache.h>
#include <asm/hardware.h> /* for register_parisc_driver() stuff */
......@@ -45,6 +43,8 @@
#include <asm/parisc-device.h>
struct system_cpuinfo_parisc boot_cpu_data;
EXPORT_SYMBOL(boot_cpu_data);
struct cpuinfo_parisc cpu_data[NR_CPUS];
/*
......@@ -105,11 +105,11 @@ static int __init processor_probe(struct parisc_device *dev)
status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,
dev->mod_index, PA_VIEW, &pa_pdc_cell);
ASSERT(PDC_OK == status);
BUG_ON(PDC_OK != status);
/* verify it's the same as what do_pat_inventory() found */
ASSERT(dev->mod_info == pa_pdc_cell.mod_info);
ASSERT(dev->pmod_loc == pa_pdc_cell.mod_location);
BUG_ON(dev->mod_info != pa_pdc_cell.mod_info);
BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location);
txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */
......@@ -122,7 +122,7 @@ static int __init processor_probe(struct parisc_device *dev)
/* get the cpu number */
status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa);
ASSERT(PDC_OK == status);
BUG_ON(PDC_OK != status);
if (cpu_info.cpu_num >= NR_CPUS) {
printk(KERN_WARNING "IGNORING CPU at 0x%x,"
......
......@@ -154,12 +154,12 @@ rfi_virt2real:
nop
rsm (PSW_SM_Q|PSW_SM_I),%r0 /* disable Q & I bits to load iia queue */
mtctl 0, %cr17 /* space 0 */
mtctl 0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
load32 PA(rfi_v2r_1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
load32 REAL_MODE_PSW, %r1
mtctl %r1, %cr22
rfi
......@@ -191,12 +191,12 @@ rfi_real2virt:
nop
rsm PSW_SM_Q,%r0 /* disable Q bit to load iia queue */
mtctl 0, %cr17 /* space 0 */
mtctl 0, %cr17
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
load32 (rfi_r2v_1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ head */
ldo 4(%r1), %r1
mtctl %r1, %cr18
mtctl %r1, %cr18 /* IIAOQ tail */
load32 KERNEL_PSW, %r1
mtctl %r1, %cr22
rfi
......
This diff is collapsed.
......@@ -10,20 +10,32 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <asm/compat_signal.h>
#include <asm/uaccess.h>
#include "signal32.h"
#include "sys32.h"
struct k_sigaction32 {
struct sigaction32 sa;
};
#define DEBUG_COMPAT_SIG 0
#define DEBUG_COMPAT_SIG_LEVEL 2
#if DEBUG_COMPAT_SIG
#define DBG(LEVEL, ...) \
((DEBUG_COMPAT_SIG_LEVEL >= LEVEL) \
? printk(__VA_ARGS__) : (void) 0)
#else
#define DBG(LEVEL, ...)
#endif
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
static inline void
inline void
sigset_32to64(sigset_t *s64, compat_sigset_t *s32)
{
s64->sig[0] = s32->sig[0] | ((unsigned long)s32->sig[1] << 32);
}
static inline void
inline void
sigset_64to32(compat_sigset_t *s32, sigset_t *s64)
{
s32->sig[0] = s64->sig[0] & 0xffffffffUL;
......@@ -120,16 +132,10 @@ sys32_rt_sigaction(int sig, const struct sigaction32 *act, struct sigaction32 *o
return ret;
}
typedef struct {
unsigned int ss_sp;
int ss_flags;
compat_size_t ss_size;
} stack_t32;
int
do_sigaltstack32 (const stack_t32 *uss32, stack_t32 *uoss32, unsigned long sp)
do_sigaltstack32 (const compat_stack_t *uss32, compat_stack_t *uoss32, unsigned long sp)
{
stack_t32 ss32, oss32;
compat_stack_t ss32, oss32;
stack_t ss, oss;
stack_t *ssp = NULL, *ossp = NULL;
int ret;
......@@ -160,3 +166,218 @@ do_sigaltstack32 (const stack_t32 *uss32, stack_t32 *uoss32, unsigned long sp)
return ret;
}
long
restore_sigcontext32(struct compat_sigcontext *sc, struct compat_regfile * rf,
struct pt_regs *regs)
{
long err = 0;
compat_uint_t compat_reg;
compat_uint_t compat_regt;
int regn;
/* When loading 32-bit values into 64-bit registers make
sure to clear the upper 32-bits */
DBG(2,"restore_sigcontext32: PER_LINUX32 process\n");
DBG(2,"restore_sigcontext32: sc = 0x%p, rf = 0x%p, regs = 0x%p\n", sc, rf, regs);
DBG(2,"restore_sigcontext32: compat_sigcontext is %#lx bytes\n", sizeof(*sc));
for(regn=0; regn < 32; regn++){
err |= __get_user(compat_reg,&sc->sc_gr[regn]);
regs->gr[regn] = compat_reg;
/* Load upper half */
err |= __get_user(compat_regt,&rf->rf_gr[regn]);
regs->gr[regn] = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(3,"restore_sigcontext32: gr%02d = %#lx (%#x / %#x)\n",
regn, regs->gr[regn], compat_regt, compat_reg);
}
DBG(2,"restore_sigcontext32: sc->sc_fr = 0x%p (%#lx)\n",sc->sc_fr, sizeof(sc->sc_fr));
/* XXX: BE WARNED FR's are 64-BIT! */
err |= __copy_from_user(regs->fr, sc->sc_fr, sizeof(regs->fr));
/* Better safe than sorry, pass __get_user two things of
the same size and let gcc do the upward conversion to
64-bits */
err |= __get_user(compat_reg, &sc->sc_iaoq[0]);
/* Load upper half */
err |= __get_user(compat_regt, &rf->rf_iaoq[0]);
regs->iaoq[0] = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(2,"restore_sigcontext32: upper half of iaoq[0] = %#lx\n", compat_regt);
DBG(2,"restore_sigcontext32: sc->sc_iaoq[0] = %p => %#x\n",
&sc->sc_iaoq[0], compat_reg);
err |= __get_user(compat_reg, &sc->sc_iaoq[1]);
/* Load upper half */
err |= __get_user(compat_regt, &rf->rf_iaoq[1]);
regs->iaoq[1] = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(2,"restore_sigcontext32: upper half of iaoq[1] = %#lx\n", compat_regt);
DBG(2,"restore_sigcontext32: sc->sc_iaoq[1] = %p => %#x\n",
&sc->sc_iaoq[1],compat_reg);
DBG(2,"restore_sigcontext32: iaoq is %#lx / %#lx\n",
regs->iaoq[0],regs->iaoq[1]);
err |= __get_user(compat_reg, &sc->sc_iasq[0]);
/* Load the upper half for iasq */
err |= __get_user(compat_regt, &rf->rf_iasq[0]);
regs->iasq[0] = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(2,"restore_sigcontext32: upper half of iasq[0] = %#lx\n", compat_regt);
err |= __get_user(compat_reg, &sc->sc_iasq[1]);
/* Load the upper half for iasq */
err |= __get_user(compat_regt, &rf->rf_iasq[1]);
regs->iasq[1] = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(2,"restore_sigcontext32: upper half of iasq[1] = %#lx\n", compat_regt);
DBG(2,"restore_sigcontext32: iasq is %#lx / %#lx\n",
regs->iasq[0],regs->iasq[1]);
err |= __get_user(compat_reg, &sc->sc_sar);
/* Load the upper half for sar */
err |= __get_user(compat_regt, &rf->rf_sar);
regs->sar = ((u64)compat_regt << 32) | (u64)compat_reg;
DBG(2,"restore_sigcontext32: upper_half & sar = %#lx\n", compat_regt);
DBG(2,"restore_sigcontext32: sar is %#lx\n", regs->sar);
DBG(2,"restore_sigcontext32: r28 is %ld\n", regs->gr[28]);
return err;
}
/*
* Set up the sigcontext structure for this process.
* This is not an easy task if the kernel is 64-bit, it will require
* that we examine the process personality to determine if we need to
* truncate for a 32-bit userspace.
*/
long
setup_sigcontext32(struct compat_sigcontext *sc, struct compat_regfile * rf,
struct pt_regs *regs, int in_syscall)
{
compat_int_t flags = 0;
long err = 0;
compat_uint_t compat_reg;
compat_uint_t compat_regb;
int regn;
if (on_sig_stack((unsigned long) sc))
flags |= PARISC_SC_FLAG_ONSTACK;
if (in_syscall) {
DBG(1,"setup_sigcontext32: in_syscall\n");
flags |= PARISC_SC_FLAG_IN_SYSCALL;
/* Truncate gr31 */
compat_reg = (compat_uint_t)(regs->gr[31]);
/* regs->iaoq is undefined in the syscall return path */
err |= __put_user(compat_reg, &sc->sc_iaoq[0]);
DBG(2,"setup_sigcontext32: sc->sc_iaoq[0] = %p <= %#x\n",
&sc->sc_iaoq[0], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->gr[32] >> 32);
err |= __put_user(compat_reg, &rf->rf_iaoq[0]);
DBG(2,"setup_sigcontext32: upper half iaoq[0] = %#x\n", compat_reg);
compat_reg = (compat_uint_t)(regs->gr[31]+4);
err |= __put_user(compat_reg, &sc->sc_iaoq[1]);
DBG(2,"setup_sigcontext32: sc->sc_iaoq[1] = %p <= %#x\n",
&sc->sc_iaoq[1], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)((regs->gr[32]+4) >> 32);
err |= __put_user(compat_reg, &rf->rf_iaoq[1]);
DBG(2,"setup_sigcontext32: upper half iaoq[1] = %#x\n", compat_reg);
/* Truncate sr3 */
compat_reg = (compat_uint_t)(regs->sr[3]);
err |= __put_user(compat_reg, &sc->sc_iasq[0]);
err |= __put_user(compat_reg, &sc->sc_iasq[1]);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->sr[3] >> 32);
err |= __put_user(compat_reg, &rf->rf_iasq[0]);
err |= __put_user(compat_reg, &rf->rf_iasq[1]);
DBG(2,"setup_sigcontext32: upper half iasq[0] = %#x\n", compat_reg);
DBG(2,"setup_sigcontext32: upper half iasq[1] = %#x\n", compat_reg);
DBG(1,"setup_sigcontext32: iaoq %#lx / %#lx\n",
regs->gr[31], regs->gr[31]+4);
} else {
compat_reg = (compat_uint_t)(regs->iaoq[0]);
err |= __put_user(compat_reg, &sc->sc_iaoq[0]);
DBG(2,"setup_sigcontext32: sc->sc_iaoq[0] = %p <= %#x\n",
&sc->sc_iaoq[0], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->iaoq[0] >> 32);
err |= __put_user(compat_reg, &rf->rf_iaoq[0]);
DBG(2,"setup_sigcontext32: upper half iaoq[0] = %#x\n", compat_reg);
compat_reg = (compat_uint_t)(regs->iaoq[1]);
err |= __put_user(compat_reg, &sc->sc_iaoq[1]);
DBG(2,"setup_sigcontext32: sc->sc_iaoq[1] = %p <= %#x\n",
&sc->sc_iaoq[1], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->iaoq[1] >> 32);
err |= __put_user(compat_reg, &rf->rf_iaoq[1]);
DBG(2,"setup_sigcontext32: upper half iaoq[1] = %#x\n", compat_reg);
compat_reg = (compat_uint_t)(regs->iasq[0]);
err |= __put_user(compat_reg, &sc->sc_iasq[0]);
DBG(2,"setup_sigcontext32: sc->sc_iasq[0] = %p <= %#x\n",
&sc->sc_iasq[0], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->iasq[0] >> 32);
err |= __put_user(compat_reg, &rf->rf_iasq[0]);
DBG(2,"setup_sigcontext32: upper half iasq[0] = %#x\n", compat_reg);
compat_reg = (compat_uint_t)(regs->iasq[1]);
err |= __put_user(compat_reg, &sc->sc_iasq[1]);
DBG(2,"setup_sigcontext32: sc->sc_iasq[1] = %p <= %#x\n",
&sc->sc_iasq[1], compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->iasq[1] >> 32);
err |= __put_user(compat_reg, &rf->rf_iasq[1]);
DBG(2,"setup_sigcontext32: upper half iasq[1] = %#x\n", compat_reg);
/* Print out the IAOQ for debugging */
DBG(1,"setup_sigcontext32: ia0q %#lx / %#lx\n",
regs->iaoq[0], regs->iaoq[1]);
}
err |= __put_user(flags, &sc->sc_flags);
DBG(1,"setup_sigcontext32: Truncating general registers.\n");
for(regn=0; regn < 32; regn++){
/* Truncate a general register */
compat_reg = (compat_uint_t)(regs->gr[regn]);
err |= __put_user(compat_reg, &sc->sc_gr[regn]);
/* Store upper half */
compat_regb = (compat_uint_t)(regs->gr[regn] >> 32);
err |= __put_user(compat_regb, &rf->rf_gr[regn]);
/* DEBUG: Write out the "upper / lower" register data */
DBG(2,"setup_sigcontext32: gr%02d = %#x / %#x\n", regn,
compat_regb, compat_reg);
}
/* Copy the floating point registers (same size)
XXX: BE WARNED FR's are 64-BIT! */
DBG(1,"setup_sigcontext32: Copying from regs to sc, "
"sc->sc_fr size = %#lx, regs->fr size = %#lx\n",
sizeof(regs->fr), sizeof(sc->sc_fr));
err |= __copy_to_user(sc->sc_fr, regs->fr, sizeof(regs->fr));
compat_reg = (compat_uint_t)(regs->sar);
err |= __put_user(compat_reg, &sc->sc_sar);
DBG(2,"setup_sigcontext32: sar is %#x\n", compat_reg);
/* Store upper half */
compat_reg = (compat_uint_t)(regs->sar >> 32);
err |= __put_user(compat_reg, &rf->rf_sar);
DBG(2,"setup_sigcontext32: upper half sar = %#x\n", compat_reg);
DBG(1,"setup_sigcontext32: r28 is %ld\n", regs->gr[28]);
return err;
}
#ifndef _PARISC64_KERNEL_SIGNAL32_H
#define _PARISC64_KERNEL_SIGNAL32_H
#include <linux/compat.h>
#include <asm/compat_signal.h>
#include <asm/compat_rt_sigframe.h>
/* ELF32 signal handling */
struct k_sigaction32 {
struct compat_sigaction sa;
};
void sigset_32to64(sigset_t *s64, compat_sigset_t *s32);
void sigset_64to32(compat_sigset_t *s32, sigset_t *s64);
int do_sigaltstack32 (const compat_stack_t *uss32,
compat_stack_t *uoss32, unsigned long sp);
long restore_sigcontext32(struct compat_sigcontext *sc,
struct compat_regfile *rf,
struct pt_regs *regs);
long setup_sigcontext32(struct compat_sigcontext *sc,
struct compat_regfile *rf,
struct pt_regs *regs, int in_syscall);
#endif
......@@ -257,7 +257,7 @@ ipi_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk(KERN_CRIT "Unknown IPI num on CPU%d: %lu\n",
this_cpu, which);
ops &= ~(1 << which);
return;
return IRQ_NONE;
} /* Switch */
} /* while (ops) */
}
......@@ -326,7 +326,7 @@ int
smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
{
struct smp_call_struct data;
long timeout;
unsigned long timeout;
static spinlock_t lock = SPIN_LOCK_UNLOCKED;
data.func = func;
......@@ -376,6 +376,8 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
return 0;
}
EXPORT_SYMBOL(smp_call_function);
/*
......
......@@ -240,108 +240,6 @@ asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low,
return sys_readahead(fd, (loff_t)high << 32 | low, count);
}
/*
* FIXME, please remove this crap as soon as possible
*
* This is here to fix up broken glibc structures,
* which are already fixed in newer glibcs
*/
#include <linux/msg.h>
#include <linux/sem.h>
#include <linux/shm.h>
#include "sys32.h"
struct broken_ipc_perm
{
key_t key; /* Key. */
uid_t uid; /* Owner's user ID. */
gid_t gid; /* Owner's group ID. */
uid_t cuid; /* Creator's user ID. */
gid_t cgid; /* Creator's group ID. */
unsigned short int mode; /* Read/write permission. */
unsigned short int __pad1;
unsigned short int seq; /* Sequence number. */
unsigned short int __pad2;
unsigned long int __unused1;
unsigned long int __unused2;
};
struct broken_shmid64_ds {
struct broken_ipc_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
#ifndef __LP64__
unsigned int __pad1;
#endif
__kernel_time_t shm_atime; /* last attach time */
#ifndef __LP64__
unsigned int __pad2;
#endif
__kernel_time_t shm_dtime; /* last detach time */
#ifndef __LP64__
unsigned int __pad3;
#endif
__kernel_time_t shm_ctime; /* last change time */
__kernel_pid_t shm_cpid; /* pid of creator */
__kernel_pid_t shm_lpid; /* pid of last operator */
unsigned int shm_nattch; /* no. of current attaches */
unsigned int __unused1;
unsigned int __unused2;
};
static void convert_broken_perm (struct broken_ipc_perm *out, struct ipc64_perm *in)
{
out->key = in->key;
out->uid = in->uid;
out->gid = in->gid;
out->cuid = in->cuid;
out->cgid = in->cgid;
out->mode = in->mode;
out->seq = in->seq;
}
static int copyout_broken_shmid64(struct broken_shmid64_ds *buf, struct shmid64_ds *sbuf)
{
struct broken_shmid64_ds tbuf;
memset(&tbuf, 0, sizeof tbuf);
convert_broken_perm (&tbuf.shm_perm, &sbuf->shm_perm);
tbuf.shm_segsz = sbuf->shm_segsz;
tbuf.shm_atime = sbuf->shm_atime;
tbuf.shm_dtime = sbuf->shm_dtime;
tbuf.shm_ctime = sbuf->shm_ctime;
tbuf.shm_cpid = sbuf->shm_cpid;
tbuf.shm_lpid = sbuf->shm_lpid;
tbuf.shm_nattch = sbuf->shm_nattch;
return copy_to_user(buf, &tbuf, sizeof tbuf) ? -EFAULT : 0;
}
int sys_msgctl_broken(int msqid, int cmd, struct msqid_ds *buf)
{
return sys_msgctl (msqid, cmd & ~IPC_64, buf);
}
int sys_semctl_broken(int semid, int semnum, int cmd, union semun arg)
{
return sys_semctl (semid, semnum, cmd & ~IPC_64, arg);
}
int sys_shmctl_broken(int shmid, int cmd, struct shmid64_ds *buf)
{
struct shmid64_ds sbuf;
int err;
if (cmd & IPC_64) {
cmd &= ~IPC_64;
if (cmd == IPC_STAT || cmd == SHM_STAT) {
KERNEL_SYSCALL(err, sys_shmctl, shmid, cmd, (struct shmid_ds *)&sbuf);
if (err == 0)
err = copyout_broken_shmid64((struct broken_shmid64_ds *)buf, &sbuf);
return err;
}
}
return sys_shmctl (shmid, cmd, (struct shmid_ds *)buf);
}
/*
* This changes the io permissions bitmap in the current task.
*/
......
......@@ -1352,12 +1352,10 @@ asmlinkage int sys32_lseek(unsigned int fd, int offset, unsigned int origin)
return sys_lseek(fd, offset, origin);
}
asmlinkage long sys32_semctl_broken(int semid, int semnum, int cmd, union semun arg)
asmlinkage long sys32_semctl(int semid, int semnum, int cmd, union semun arg)
{
union semun u;
cmd &= ~IPC_64; /* should be removed together with the _broken suffix */
if (cmd == SETVAL) {
/* Ugh. arg is a union of int,ptr,ptr,ptr, so is 8 bytes.
* The int should be in the first 4, but our argument
......
......@@ -28,7 +28,7 @@
#define ENTRY_COMP(_name_) .word sys_##_name_
#endif
ENTRY_SAME(ni_syscall) /* 0 - old "setup()" system call*/
ENTRY_SAME(restart_syscall) /* 0 */
ENTRY_SAME(exit)
ENTRY_SAME(fork_wrapper)
ENTRY_SAME(read)
......@@ -260,15 +260,15 @@
ENTRY_COMP(recvmsg)
ENTRY_SAME(semop) /* 185 */
ENTRY_SAME(semget)
ENTRY_DIFF(semctl_broken)
ENTRY_DIFF(semctl)
ENTRY_DIFF(msgsnd)
ENTRY_DIFF(msgrcv)
ENTRY_SAME(msgget) /* 190 */
ENTRY_SAME(msgctl_broken)
ENTRY_SAME(msgctl)
ENTRY_SAME(shmat_wrapper)
ENTRY_SAME(shmdt)
ENTRY_SAME(shmget)
ENTRY_SAME(shmctl_broken) /* 195 */
ENTRY_SAME(shmctl) /* 195 */
ENTRY_SAME(ni_syscall) /* streams1 */
ENTRY_SAME(ni_syscall) /* streams2 */
ENTRY_SAME(lstat64)
......
......@@ -232,7 +232,6 @@ do_settimeofday (struct timespec *tv)
write_sequnlock_irq(&xtime_lock);
return 0;
}
EXPORT_SYMBOL(do_settimeofday);
/*
......
This diff is collapsed.
This diff is collapsed.
......@@ -132,6 +132,43 @@ $lcfu_zero_loop:
.procend
/*
* unsigned long
* lcopy_in_user(void *to, const void *from, unsigned long n)
*
* Returns 0 for success.
* otherwise, returns number of bytes not transferred.
*/
.export lcopy_in_user,code
lcopy_in_user:
.proc
.callinfo NO_CALLS
.entry
comib,=,n 0,%r24,$lciu_done
get_sr
$lciu_loop:
ldbs,ma 1(%sr1,%r25),%r1
addib,<> -1,%r24,$lciu_loop
1: stbs,ma %r1,1(%sr1,%r26)
$lciu_done:
bv %r0(%r2)
copy %r24,%r28
.exit
2: b $lciu_done
ldo 1(%r24),%r24
.section __ex_table,"a"
#ifdef __LP64__
.dword 1b,(2b-1b)
#else
.word 1b,(2b-1b)
#endif
.previous
.procend
/*
* long lstrncpy_from_user(char *dst, const char *src, long n)
*
......
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