Commit db2ee205 authored by Linus Torvalds's avatar Linus Torvalds

Merge

parents 03cd9c23 19250aed
...@@ -4,40 +4,40 @@ ...@@ -4,40 +4,40 @@
platform. This document provides information specific to IA-64 platform. This document provides information specific to IA-64
ONLY, to get additional information about the Linux kernel also ONLY, to get additional information about the Linux kernel also
read the original Linux README provided with the kernel. read the original Linux README provided with the kernel.
INSTALLING the kernel: INSTALLING the kernel:
- IA-64 kernel installation is the same as the other platforms, see - IA-64 kernel installation is the same as the other platforms, see
original README for details. original README for details.
SOFTWARE REQUIREMENTS SOFTWARE REQUIREMENTS
Compiling and running this kernel requires an IA-64 compliant GCC Compiling and running this kernel requires an IA-64 compliant GCC
compiler. And various software packages also compiled with an compiler. And various software packages also compiled with an
IA-64 compliant GCC compiler. IA-64 compliant GCC compiler.
CONFIGURING the kernel: CONFIGURING the kernel:
Configuration is the same, see original README for details. Configuration is the same, see original README for details.
COMPILING the kernel: COMPILING the kernel:
- Compiling this kernel doesn't differ from other platform so read - Compiling this kernel doesn't differ from other platform so read
the original README for details BUT make sure you have an IA-64 the original README for details BUT make sure you have an IA-64
compliant GCC compiler. compliant GCC compiler.
IA-64 SPECIFICS IA-64 SPECIFICS
- General issues: - General issues:
o Hardly any performance tuning has been done. Obvious targets o Hardly any performance tuning has been done. Obvious targets
include the library routines (IP checksum, etc.). Less include the library routines (IP checksum, etc.). Less
obvious targets include making sure we don't flush the TLB obvious targets include making sure we don't flush the TLB
needlessly, etc. needlessly, etc.
o SMP locks cleanup/optimization o SMP locks cleanup/optimization
o IA32 support. Currently experimental. It mostly works. o IA32 support. Currently experimental. It mostly works.
This diff is collapsed.
...@@ -768,6 +768,9 @@ source "arch/ia64/hp/sim/Kconfig" ...@@ -768,6 +768,9 @@ source "arch/ia64/hp/sim/Kconfig"
menu "Kernel hacking" menu "Kernel hacking"
config FSYS
bool "Light-weight system-call support (via epc)"
choice choice
prompt "Physical memory granularity" prompt "Physical memory granularity"
default IA64_GRANULE_64MB default IA64_GRANULE_64MB
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# License. See the file "COPYING" in the main directory of this archive # License. See the file "COPYING" in the main directory of this archive
# for more details. # for more details.
# #
# Copyright (C) 1998-2002 by David Mosberger-Tang <davidm@hpl.hp.com> # Copyright (C) 1998-2003 by David Mosberger-Tang <davidm@hpl.hp.com>
# #
NM := $(CROSS_COMPILE)nm -B NM := $(CROSS_COMPILE)nm -B
...@@ -23,6 +23,16 @@ CFLAGS_KERNEL := -mconstant-gp ...@@ -23,6 +23,16 @@ CFLAGS_KERNEL := -mconstant-gp
GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.') GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
GAS_STATUS=$(shell arch/ia64/scripts/check-gas $(CC))
ifeq ($(GAS_STATUS),buggy)
$(error Sorry, you need a newer version of the assember, one that is built from \
a source-tree that post-dates 18-Dec-2002. You can find a pre-compiled \
static binary of such an assembler at: \
\
ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
endif
ifneq ($(GCC_VERSION),2) ifneq ($(GCC_VERSION),2)
cflags-y += -frename-registers --param max-inline-insns=5000 cflags-y += -frename-registers --param max-inline-insns=5000
endif endif
...@@ -48,25 +58,36 @@ drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/ ...@@ -48,25 +58,36 @@ drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/
drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
drivers-$(CONFIG_IA64_SGI_SN) += arch/ia64/sn/fakeprom/ drivers-$(CONFIG_IA64_SGI_SN) += arch/ia64/sn/fakeprom/
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/boot $(1) boot := arch/ia64/boot
maketool =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/tools $(1) tools := arch/ia64/tools
.PHONY: boot compressed include/asm-ia64/offsets.h .PHONY: boot compressed include/asm-ia64/offsets.h
all compressed: vmlinux.gz all: vmlinux
compressed: vmlinux.gz
vmlinux.gz: vmlinux vmlinux.gz: vmlinux
$(call makeboot,vmlinux.gz) $(Q)$(MAKE) $(build)=$(boot) vmlinux.gz
check: vmlinux
arch/ia64/scripts/unwcheck.sh vmlinux
archclean: archclean:
$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/ia64/boot $(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=$(tools)
CLEAN_FILES += include/asm-ia64/offsets.h vmlinux.gz bootloader CLEAN_FILES += include/asm-ia64/offsets.h vmlinux.gz bootloader
prepare: include/asm-ia64/offsets.h prepare: include/asm-ia64/offsets.h
boot: lib/lib.a vmlinux boot: lib/lib.a vmlinux
$(call makeboot,$@) $(Q)$(MAKE) $(build)=$(boot) $@
include/asm-ia64/offsets.h: include/asm include/linux/version.h include/config/MARKER include/asm-ia64/offsets.h: include/asm include/linux/version.h include/config/MARKER
$(call maketool,$@) $(Q)$(MAKE) $(build)=$(tools) $@
define archhelp
echo ' compressed - Build compressed kernel image'
echo ' boot - Build vmlinux and bootloader for Ski simulator'
endef
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (C) 1999 Intel Corp. * Copyright (C) 1999 Intel Corp.
* Copyright (C) 1999, 2001 Hewlett-Packard Co * Copyright (C) 1999, 2001 Hewlett-Packard Co
* Copyright (C) 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com> * Copyright (C) 1999, 2001, 2003 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com> * Copyright (C) 1999 Vijay Chander <vijay@engr.sgi.com>
...@@ -56,7 +56,7 @@ dig_setup (char **cmdline_p) ...@@ -56,7 +56,7 @@ dig_setup (char **cmdline_p)
if (!ia64_boot_param->console_info.num_rows if (!ia64_boot_param->console_info.num_rows
|| !ia64_boot_param->console_info.num_cols) || !ia64_boot_param->console_info.num_cols)
{ {
printk("dig_setup: warning: invalid screen-info, guessing 80x25\n"); printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n");
orig_x = 0; orig_x = 0;
orig_y = 0; orig_y = 0;
num_cols = 80; num_cols = 80;
......
...@@ -288,20 +288,19 @@ sba_dump_pdir_entry(struct ioc *ioc, char *msg, uint pide) ...@@ -288,20 +288,19 @@ sba_dump_pdir_entry(struct ioc *ioc, char *msg, uint pide)
unsigned long *rptr = (unsigned long *) &(ioc->res_map[(pide >>3) & ~(sizeof(unsigned long) - 1)]); unsigned long *rptr = (unsigned long *) &(ioc->res_map[(pide >>3) & ~(sizeof(unsigned long) - 1)]);
uint rcnt; uint rcnt;
/* printk(KERN_DEBUG "SBA: %s rp %p bit %d rval 0x%lx\n", */ printk(KERN_DEBUG "SBA: %s rp %p bit %d rval 0x%lx\n",
printk("SBA: %s rp %p bit %d rval 0x%lx\n",
msg, rptr, pide & (BITS_PER_LONG - 1), *rptr); msg, rptr, pide & (BITS_PER_LONG - 1), *rptr);
rcnt = 0; rcnt = 0;
while (rcnt < BITS_PER_LONG) { while (rcnt < BITS_PER_LONG) {
printk("%s %2d %p %016Lx\n", printk(KERN_DEBUG "%s %2d %p %016Lx\n",
(rcnt == (pide & (BITS_PER_LONG - 1))) (rcnt == (pide & (BITS_PER_LONG - 1)))
? " -->" : " ", ? " -->" : " ",
rcnt, ptr, *ptr ); rcnt, ptr, *ptr );
rcnt++; rcnt++;
ptr++; ptr++;
} }
printk("%s", msg); printk(KERN_DEBUG "%s", msg);
} }
...@@ -363,11 +362,9 @@ static void ...@@ -363,11 +362,9 @@ static void
sba_dump_sg(struct ioc *ioc, struct scatterlist *startsg, int nents) sba_dump_sg(struct ioc *ioc, struct scatterlist *startsg, int nents)
{ {
while (nents-- > 0) { while (nents-- > 0) {
printk(" %d : DMA %08lx/%05x CPU %p\n", printk(KERN_DEBUG " %d : DMA %08lx/%05x CPU %p\n", nents,
nents, (unsigned long) sba_sg_iova(startsg), sba_sg_iova_len(startsg),
(unsigned long) sba_sg_iova(startsg), sba_sg_address(startsg));
sba_sg_iova_len(startsg),
sba_sg_address(startsg));
startsg++; startsg++;
} }
} }
...@@ -1451,9 +1448,10 @@ sba_common_init(struct sba_device *sba_dev) ...@@ -1451,9 +1448,10 @@ sba_common_init(struct sba_device *sba_dev)
sba_dev->ioc[i].res_map; sba_dev->ioc[i].res_map;
} else { } else {
u64 reserved_iov; u64 reserved_iov;
/* Yet another 1.x hack */ /* Yet another 1.x hack */
printk("zx1 1.x: Starting resource hint offset into IOV space to avoid initial zero value IOVA\n"); printk(KERN_DEBUG "zx1 1.x: Starting resource hint offset into "
"IOV space to avoid initial zero value IOVA\n");
sba_dev->ioc[i].res_hint = (unsigned long *) sba_dev->ioc[i].res_hint = (unsigned long *)
&(sba_dev->ioc[i].res_map[L1_CACHE_BYTES]); &(sba_dev->ioc[i].res_map[L1_CACHE_BYTES]);
...@@ -1632,7 +1630,7 @@ void __init sba_init(void) ...@@ -1632,7 +1630,7 @@ void __init sba_init(void)
device->slot_name, hpa); device->slot_name, hpa);
if ((hw_rev & 0xFF) < 0x20) { if ((hw_rev & 0xFF) < 0x20) {
printk("%s: SBA rev less than 2.0 not supported", DRIVER_NAME); printk(KERN_INFO "%s: SBA rev less than 2.0 not supported", DRIVER_NAME);
return; return;
} }
......
/* /*
* Simulated Ethernet Driver * Simulated Ethernet Driver
* *
* Copyright (C) 1999-2001 Hewlett-Packard Co * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -116,7 +116,7 @@ simeth_probe (void) ...@@ -116,7 +116,7 @@ simeth_probe (void)
{ {
int r; int r;
printk("simeth: v%s\n", simeth_version); printk(KERN_INFO "simeth: v%s\n", simeth_version);
r = simeth_probe1(); r = simeth_probe1();
...@@ -235,7 +235,8 @@ simeth_probe1(void) ...@@ -235,7 +235,8 @@ simeth_probe1(void)
/* Fill in the fields of the device structure with ethernet-generic values. */ /* Fill in the fields of the device structure with ethernet-generic values. */
ether_setup(dev); ether_setup(dev);
printk("%s: hosteth=%s simfd=%d, HwAddr", dev->name, simeth_device, local->simfd); printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
dev->name, simeth_device, local->simfd);
for(i = 0; i < ETH_ALEN; i++) { for(i = 0; i < ETH_ALEN; i++) {
printk(" %2.2x", dev->dev_addr[i]); printk(" %2.2x", dev->dev_addr[i]);
} }
...@@ -251,7 +252,7 @@ static int ...@@ -251,7 +252,7 @@ static int
simeth_open(struct net_device *dev) simeth_open(struct net_device *dev)
{ {
if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) { if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) {
printk ("simeth: unable to get IRQ %d.\n", dev->irq); printk(KERN_WARNING "simeth: unable to get IRQ %d.\n", dev->irq);
return -EAGAIN; return -EAGAIN;
} }
...@@ -312,11 +313,12 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr) ...@@ -312,11 +313,12 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
if (strcmp(dev->name, ifa->ifa_label) == 0) break; if (strcmp(dev->name, ifa->ifa_label) == 0) break;
} }
if ( ifa == NULL ) { if ( ifa == NULL ) {
printk("simeth_open: can't find device %s's ifa\n", dev->name); printk(KERN_ERR "simeth_open: can't find device %s's ifa\n", dev->name);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
printk("simeth_device_event: %s ipaddr=0x%x\n", dev->name, htonl(ifa->ifa_local)); printk(KERN_INFO "simeth_device_event: %s ipaddr=0x%x\n",
dev->name, htonl(ifa->ifa_local));
/* /*
* XXX Fix me * XXX Fix me
...@@ -330,7 +332,8 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr) ...@@ -330,7 +332,8 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)): netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)):
netdev_detach(local->simfd); netdev_detach(local->simfd);
printk("simeth: netdev_attach/detach: event=%s ->%d\n", event == NETDEV_UP ? "attach":"detach", r); printk(KERN_INFO "simeth: netdev_attach/detach: event=%s ->%d\n",
event == NETDEV_UP ? "attach":"detach", r);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
...@@ -460,7 +463,8 @@ simeth_rx(struct net_device *dev) ...@@ -460,7 +463,8 @@ simeth_rx(struct net_device *dev)
*/ */
len = netdev_read(local->simfd, skb->data, SIMETH_FRAME_SIZE); len = netdev_read(local->simfd, skb->data, SIMETH_FRAME_SIZE);
if ( len == 0 ) { if ( len == 0 ) {
if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n", dev->name, SIMETH_RECV_MAX-rcv_count); if ( simeth_debug > 0 ) printk(KERN_WARNING "%s: count=%d netdev_read=0\n",
dev->name, SIMETH_RECV_MAX-rcv_count);
break; break;
} }
#if 0 #if 0
......
/* /*
* Simulated SCSI driver. * Simulated SCSI driver.
* *
* Copyright (C) 1999, 2001-2002 Hewlett-Packard Co * Copyright (C) 1999, 2001-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
...@@ -87,7 +87,8 @@ simscsi_setup (char *s) ...@@ -87,7 +87,8 @@ simscsi_setup (char *s)
{ {
/* XXX Fix me we may need to strcpy() ? */ /* XXX Fix me we may need to strcpy() ? */
if (strlen(s) > MAX_ROOT_LEN) { if (strlen(s) > MAX_ROOT_LEN) {
printk("simscsi_setup: prefix too long---using default %s\n", simscsi_root); printk(KERN_ERR "simscsi_setup: prefix too long---using default %s\n",
simscsi_root);
} }
simscsi_root = s; simscsi_root = s;
return 1; return 1;
...@@ -354,7 +355,7 @@ simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *)) ...@@ -354,7 +355,7 @@ simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *))
break; break;
case START_STOP: case START_STOP:
printk("START_STOP\n"); printk(KERN_ERR "START_STOP\n");
break; break;
default: default:
...@@ -380,7 +381,7 @@ simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *)) ...@@ -380,7 +381,7 @@ simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *))
int int
simscsi_host_reset (Scsi_Cmnd *sc) simscsi_host_reset (Scsi_Cmnd *sc)
{ {
printk ("simscsi_host_reset: not implemented\n"); printk(KERN_ERR "simscsi_host_reset: not implemented\n");
return 0; return 0;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* case means sys_sim.c console (goes via the simulator). The code hereafter * case means sys_sim.c console (goes via the simulator). The code hereafter
* is completely leveraged from the serial.c driver. * is completely leveraged from the serial.c driver.
* *
* Copyright (C) 1999-2000, 2002 Hewlett-Packard Co * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* *
...@@ -195,7 +195,7 @@ static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) ...@@ -195,7 +195,7 @@ static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs)
*/ */
info = IRQ_ports[irq]; info = IRQ_ports[irq];
if (!info || !info->tty) { if (!info || !info->tty) {
printk("simrs_interrupt_single: info|tty=0 info=%p problem\n", info); printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info);
return; return;
} }
/* /*
...@@ -219,13 +219,13 @@ static DECLARE_TASK_QUEUE(tq_serial); /* used to be at the top of the file */ ...@@ -219,13 +219,13 @@ static DECLARE_TASK_QUEUE(tq_serial); /* used to be at the top of the file */
static void do_serial_bh(void) static void do_serial_bh(void)
{ {
run_task_queue(&tq_serial); run_task_queue(&tq_serial);
printk("do_serial_bh: called\n"); printk(KERN_ERR "do_serial_bh: called\n");
} }
#endif #endif
static void do_softint(void *private_) static void do_softint(void *private_)
{ {
printk("simserial: do_softint called\n"); printk(KERN_ERR "simserial: do_softint called\n");
} }
static void rs_put_char(struct tty_struct *tty, unsigned char ch) static void rs_put_char(struct tty_struct *tty, unsigned char ch)
...@@ -439,7 +439,7 @@ static void rs_throttle(struct tty_struct * tty) ...@@ -439,7 +439,7 @@ static void rs_throttle(struct tty_struct * tty)
{ {
if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty)); if (I_IXOFF(tty)) rs_send_xchar(tty, STOP_CHAR(tty));
printk("simrs_throttle called\n"); printk(KERN_INFO "simrs_throttle called\n");
} }
static void rs_unthrottle(struct tty_struct * tty) static void rs_unthrottle(struct tty_struct * tty)
...@@ -452,7 +452,7 @@ static void rs_unthrottle(struct tty_struct * tty) ...@@ -452,7 +452,7 @@ static void rs_unthrottle(struct tty_struct * tty)
else else
rs_send_xchar(tty, START_CHAR(tty)); rs_send_xchar(tty, START_CHAR(tty));
} }
printk("simrs_unthrottle called\n"); printk(KERN_INFO "simrs_unthrottle called\n");
} }
/* /*
...@@ -474,29 +474,29 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -474,29 +474,29 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
switch (cmd) { switch (cmd) {
case TIOCMGET: case TIOCMGET:
printk("rs_ioctl: TIOCMGET called\n"); printk(KERN_INFO "rs_ioctl: TIOCMGET called\n");
return -EINVAL; return -EINVAL;
case TIOCMBIS: case TIOCMBIS:
case TIOCMBIC: case TIOCMBIC:
case TIOCMSET: case TIOCMSET:
printk("rs_ioctl: TIOCMBIS/BIC/SET called\n"); printk(KERN_INFO "rs_ioctl: TIOCMBIS/BIC/SET called\n");
return -EINVAL; return -EINVAL;
case TIOCGSERIAL: case TIOCGSERIAL:
printk("simrs_ioctl TIOCGSERIAL called\n"); printk(KERN_INFO "simrs_ioctl TIOCGSERIAL called\n");
return 0; return 0;
case TIOCSSERIAL: case TIOCSSERIAL:
printk("simrs_ioctl TIOCSSERIAL called\n"); printk(KERN_INFO "simrs_ioctl TIOCSSERIAL called\n");
return 0; return 0;
case TIOCSERCONFIG: case TIOCSERCONFIG:
printk("rs_ioctl: TIOCSERCONFIG called\n"); printk(KERN_INFO "rs_ioctl: TIOCSERCONFIG called\n");
return -EINVAL; return -EINVAL;
case TIOCSERGETLSR: /* Get line status register */ case TIOCSERGETLSR: /* Get line status register */
printk("rs_ioctl: TIOCSERGETLSR called\n"); printk(KERN_INFO "rs_ioctl: TIOCSERGETLSR called\n");
return -EINVAL; return -EINVAL;
case TIOCSERGSTRUCT: case TIOCSERGSTRUCT:
printk("rs_ioctl: TIOCSERGSTRUCT called\n"); printk(KERN_INFO "rs_ioctl: TIOCSERGSTRUCT called\n");
#if 0 #if 0
if (copy_to_user((struct async_struct *) arg, if (copy_to_user((struct async_struct *) arg,
info, sizeof(struct async_struct))) info, sizeof(struct async_struct)))
...@@ -511,7 +511,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -511,7 +511,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
* Caller should use TIOCGICOUNT to see which one it was * Caller should use TIOCGICOUNT to see which one it was
*/ */
case TIOCMIWAIT: case TIOCMIWAIT:
printk("rs_ioctl: TIOCMIWAIT: called\n"); printk(KERN_INFO "rs_ioctl: TIOCMIWAIT: called\n");
return 0; return 0;
/* /*
* Get counter of input serial line interrupts (DCD,RI,DSR,CTS) * Get counter of input serial line interrupts (DCD,RI,DSR,CTS)
...@@ -520,13 +520,13 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -520,13 +520,13 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
* RI where only 0->1 is counted. * RI where only 0->1 is counted.
*/ */
case TIOCGICOUNT: case TIOCGICOUNT:
printk("rs_ioctl: TIOCGICOUNT called\n"); printk(KERN_INFO "rs_ioctl: TIOCGICOUNT called\n");
return 0; return 0;
case TIOCSERGWILD: case TIOCSERGWILD:
case TIOCSERSWILD: case TIOCSERSWILD:
/* "setserial -W" is called in Debian boot */ /* "setserial -W" is called in Debian boot */
printk ("TIOCSER?WILD ioctl obsolete, ignored.\n"); printk (KERN_INFO "TIOCSER?WILD ioctl obsolete, ignored.\n");
return 0; return 0;
default: default:
...@@ -596,7 +596,7 @@ static void shutdown(struct async_struct * info) ...@@ -596,7 +596,7 @@ static void shutdown(struct async_struct * info)
IRQ_T(info), "serial", NULL); IRQ_T(info), "serial", NULL);
if (retval) if (retval)
printk("serial shutdown: request_irq: error %d" printk(KERN_ERR "serial shutdown: request_irq: error %d"
" Couldn't reacquire IRQ.\n", retval); " Couldn't reacquire IRQ.\n", retval);
} else } else
free_irq(state->irq, NULL); free_irq(state->irq, NULL);
...@@ -654,12 +654,12 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -654,12 +654,12 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
* one, we've got real problems, since it means the * one, we've got real problems, since it means the
* serial port won't be shutdown. * serial port won't be shutdown.
*/ */
printk("rs_close: bad serial port count; tty->count is 1, " printk(KERN_ERR "rs_close: bad serial port count; tty->count is 1, "
"state->count is %d\n", state->count); "state->count is %d\n", state->count);
state->count = 1; state->count = 1;
} }
if (--state->count < 0) { if (--state->count < 0) {
printk("rs_close: bad serial port count for ttys%d: %d\n", printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n",
info->line, state->count); info->line, state->count);
state->count = 0; state->count = 0;
} }
...@@ -1013,7 +1013,7 @@ static int rs_read_proc(char *page, char **start, off_t off, int count, ...@@ -1013,7 +1013,7 @@ static int rs_read_proc(char *page, char **start, off_t off, int count,
static inline void show_serial_version(void) static inline void show_serial_version(void)
{ {
printk(KERN_INFO "%s version %s with", serial_name, serial_version); printk(KERN_INFO "%s version %s with", serial_name, serial_version);
printk(" no serial options enabled\n"); printk(KERN_INFO " no serial options enabled\n");
} }
/* /*
......
/* /*
* Misc. support for HP zx1 chipset support * Misc. support for HP zx1 chipset support
* *
* Copyright (C) 2002 Hewlett-Packard Co * Copyright (C) 2002-2003 Hewlett-Packard Co
* Copyright (C) 2002 Alex Williamson <alex_williamson@hp.com> * Alex Williamson <alex_williamson@hp.com>
* Copyright (C) 2002 Bjorn Helgaas <bjorn_helgaas@hp.com> * Bjorn Helgaas <bjorn_helgaas@hp.com>
*/ */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/iosapic.h> #include <asm/iosapic.h>
extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, acpi_object_list *, extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, struct acpi_object_list *,
unsigned long *); unsigned long *);
#define PFX "hpzx1: " #define PFX "hpzx1: "
...@@ -190,31 +190,31 @@ hpzx1_fake_pci_dev(char *name, unsigned int busnum, unsigned long addr, unsigned ...@@ -190,31 +190,31 @@ hpzx1_fake_pci_dev(char *name, unsigned int busnum, unsigned long addr, unsigned
hpzx1_devices++; hpzx1_devices++;
} }
typedef struct { struct acpi_hp_vendor_long {
u8 guid_id; u8 guid_id;
u8 guid[16]; u8 guid[16];
u8 csr_base[8]; u8 csr_base[8];
u8 csr_length[8]; u8 csr_length[8];
} acpi_hp_vendor_long; };
#define HP_CCSR_LENGTH 0x21 #define HP_CCSR_LENGTH 0x21
#define HP_CCSR_TYPE 0x2 #define HP_CCSR_TYPE 0x2
#define HP_CCSR_GUID EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, \ #define HP_CCSR_GUID EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, \
0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad) 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
extern acpi_status acpi_get_crs(acpi_handle, acpi_buffer *); extern acpi_status acpi_get_crs(acpi_handle, struct acpi_buffer *);
extern acpi_resource *acpi_get_crs_next(acpi_buffer *, int *); extern struct acpi_resource *acpi_get_crs_next(struct acpi_buffer *, int *);
extern acpi_resource_data *acpi_get_crs_type(acpi_buffer *, int *, int); extern union acpi_resource_data *acpi_get_crs_type(struct acpi_buffer *, int *, int);
extern void acpi_dispose_crs(acpi_buffer *); extern void acpi_dispose_crs(struct acpi_buffer *);
static acpi_status static acpi_status
hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length) hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
{ {
int i, offset = 0; int i, offset = 0;
acpi_status status; acpi_status status;
acpi_buffer buf; struct acpi_buffer buf;
acpi_resource_vendor *res; struct acpi_resource_vendor *res;
acpi_hp_vendor_long *hp_res; struct acpi_hp_vendor_long *hp_res;
efi_guid_t vendor_guid; efi_guid_t vendor_guid;
*csr_base = 0; *csr_base = 0;
...@@ -226,14 +226,14 @@ hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length) ...@@ -226,14 +226,14 @@ hp_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
return status; return status;
} }
res = (acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR); res = (struct acpi_resource_vendor *)acpi_get_crs_type(&buf, &offset, ACPI_RSTYPE_VENDOR);
if (!res) { if (!res) {
printk(KERN_ERR PFX "Failed to find config space for device\n"); printk(KERN_ERR PFX "Failed to find config space for device\n");
acpi_dispose_crs(&buf); acpi_dispose_crs(&buf);
return AE_NOT_FOUND; return AE_NOT_FOUND;
} }
hp_res = (acpi_hp_vendor_long *)(res->reserved); hp_res = (struct acpi_hp_vendor_long *)(res->reserved);
if (res->length != HP_CCSR_LENGTH || hp_res->guid_id != HP_CCSR_TYPE) { if (res->length != HP_CCSR_LENGTH || hp_res->guid_id != HP_CCSR_TYPE) {
printk(KERN_ERR PFX "Unknown Vendor data\n"); printk(KERN_ERR PFX "Unknown Vendor data\n");
...@@ -288,7 +288,7 @@ hpzx1_lba_probe(acpi_handle obj, u32 depth, void *context, void **ret) ...@@ -288,7 +288,7 @@ hpzx1_lba_probe(acpi_handle obj, u32 depth, void *context, void **ret)
{ {
u64 csr_base = 0, csr_length = 0; u64 csr_base = 0, csr_length = 0;
acpi_status status; acpi_status status;
NATIVE_UINT busnum; acpi_native_uint busnum;
char *name = context; char *name = context;
char fullname[32]; char fullname[32];
......
...@@ -44,7 +44,6 @@ extern void put_dirty_page (struct task_struct * tsk, struct page *page, unsigne ...@@ -44,7 +44,6 @@ extern void put_dirty_page (struct task_struct * tsk, struct page *page, unsigne
static void elf32_set_personality (void); static void elf32_set_personality (void);
#define ELF_PLAT_INIT(_r) ia64_elf32_init(_r)
#define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm) #define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm)
#define elf_map elf32_map #define elf_map elf32_map
......
...@@ -95,12 +95,19 @@ END(sys32_sigsuspend) ...@@ -95,12 +95,19 @@ END(sys32_sigsuspend)
GLOBAL_ENTRY(ia32_ret_from_clone) GLOBAL_ENTRY(ia32_ret_from_clone)
PT_REGS_UNWIND_INFO(0) PT_REGS_UNWIND_INFO(0)
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
{ /*
* Some versions of gas generate bad unwind info if the first instruction of a
* procedure doesn't go into the first slot of a bundle. This is a workaround.
*/
nop.m 0
nop.i 0
/* /*
* We need to call schedule_tail() to complete the scheduling process. * We need to call schedule_tail() to complete the scheduling process.
* Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the * Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the
* address of the previously executing task. * address of the previously executing task.
*/ */
br.call.sptk.many rp=ia64_invoke_schedule_tail br.call.sptk.many rp=ia64_invoke_schedule_tail
}
.ret1: .ret1:
#endif #endif
adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
...@@ -264,7 +271,7 @@ ia32_syscall_table: ...@@ -264,7 +271,7 @@ ia32_syscall_table:
data8 sys_setreuid /* 16-bit version */ /* 70 */ data8 sys_setreuid /* 16-bit version */ /* 70 */
data8 sys_setregid /* 16-bit version */ data8 sys_setregid /* 16-bit version */
data8 sys32_sigsuspend data8 sys32_sigsuspend
data8 sys32_sigpending data8 compat_sys_sigpending
data8 sys_sethostname data8 sys_sethostname
data8 sys32_setrlimit /* 75 */ data8 sys32_setrlimit /* 75 */
data8 sys32_old_getrlimit data8 sys32_old_getrlimit
...@@ -290,8 +297,8 @@ ia32_syscall_table: ...@@ -290,8 +297,8 @@ ia32_syscall_table:
data8 sys_getpriority data8 sys_getpriority
data8 sys_setpriority data8 sys_setpriority
data8 sys32_ni_syscall /* old profil syscall holder */ data8 sys32_ni_syscall /* old profil syscall holder */
data8 sys32_statfs data8 compat_sys_statfs
data8 sys32_fstatfs /* 100 */ data8 compat_sys_fstatfs /* 100 */
data8 sys32_ioperm data8 sys32_ioperm
data8 sys32_socketcall data8 sys32_socketcall
data8 sys_syslog data8 sys_syslog
...@@ -317,7 +324,7 @@ ia32_syscall_table: ...@@ -317,7 +324,7 @@ ia32_syscall_table:
data8 sys32_modify_ldt data8 sys32_modify_ldt
data8 sys32_ni_syscall /* adjtimex */ data8 sys32_ni_syscall /* adjtimex */
data8 sys32_mprotect /* 125 */ data8 sys32_mprotect /* 125 */
data8 sys32_sigprocmask data8 compat_sys_sigprocmask
data8 sys32_ni_syscall /* create_module */ data8 sys32_ni_syscall /* create_module */
data8 sys32_ni_syscall /* init_module */ data8 sys32_ni_syscall /* init_module */
data8 sys32_ni_syscall /* delete_module */ data8 sys32_ni_syscall /* delete_module */
......
...@@ -510,6 +510,6 @@ sys32_ioctl (unsigned int fd, unsigned int cmd, unsigned int arg) ...@@ -510,6 +510,6 @@ sys32_ioctl (unsigned int fd, unsigned int cmd, unsigned int arg)
return(sg_ioctl_trans(fd, cmd, arg)); return(sg_ioctl_trans(fd, cmd, arg));
} }
printk("%x:unimplemented IA32 ioctl system call\n", cmd); printk(KERN_ERR "%x:unimplemented IA32 ioctl system call\n", cmd);
return -EINVAL; return -EINVAL;
} }
...@@ -56,7 +56,7 @@ struct sigframe_ia32 ...@@ -56,7 +56,7 @@ struct sigframe_ia32
int sig; int sig;
struct sigcontext_ia32 sc; struct sigcontext_ia32 sc;
struct _fpstate_ia32 fpstate; struct _fpstate_ia32 fpstate;
unsigned int extramask[_IA32_NSIG_WORDS-1]; unsigned int extramask[_COMPAT_NSIG_WORDS-1];
char retcode[8]; char retcode[8];
}; };
...@@ -463,7 +463,7 @@ sigact_set_handler (struct k_sigaction *sa, unsigned int handler, unsigned int r ...@@ -463,7 +463,7 @@ sigact_set_handler (struct k_sigaction *sa, unsigned int handler, unsigned int r
} }
asmlinkage long asmlinkage long
ia32_rt_sigsuspend (sigset32_t *uset, unsigned int sigsetsize, struct sigscratch *scr) ia32_rt_sigsuspend (compat_sigset_t *uset, unsigned int sigsetsize, struct sigscratch *scr)
{ {
extern long ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall); extern long ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall);
sigset_t oldset, set; sigset_t oldset, set;
...@@ -504,7 +504,7 @@ ia32_rt_sigsuspend (sigset32_t *uset, unsigned int sigsetsize, struct sigscratch ...@@ -504,7 +504,7 @@ ia32_rt_sigsuspend (sigset32_t *uset, unsigned int sigsetsize, struct sigscratch
asmlinkage long asmlinkage long
ia32_sigsuspend (unsigned int mask, struct sigscratch *scr) ia32_sigsuspend (unsigned int mask, struct sigscratch *scr)
{ {
return ia32_rt_sigsuspend((sigset32_t *)&mask, sizeof(mask), scr); return ia32_rt_sigsuspend((compat_sigset_t *)&mask, sizeof(mask), scr);
} }
asmlinkage long asmlinkage long
...@@ -530,14 +530,14 @@ sys32_rt_sigaction (int sig, struct sigaction32 *act, ...@@ -530,14 +530,14 @@ sys32_rt_sigaction (int sig, struct sigaction32 *act,
int ret; int ret;
/* XXX: Don't preclude handling different sized sigset_t's. */ /* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset32_t)) if (sigsetsize != sizeof(compat_sigset_t))
return -EINVAL; return -EINVAL;
if (act) { if (act) {
ret = get_user(handler, &act->sa_handler); ret = get_user(handler, &act->sa_handler);
ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags); ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags);
ret |= get_user(restorer, &act->sa_restorer); ret |= get_user(restorer, &act->sa_restorer);
ret |= copy_from_user(&new_ka.sa.sa_mask, &act->sa_mask, sizeof(sigset32_t)); ret |= copy_from_user(&new_ka.sa.sa_mask, &act->sa_mask, sizeof(compat_sigset_t));
if (ret) if (ret)
return -EFAULT; return -EFAULT;
...@@ -550,7 +550,7 @@ sys32_rt_sigaction (int sig, struct sigaction32 *act, ...@@ -550,7 +550,7 @@ sys32_rt_sigaction (int sig, struct sigaction32 *act,
ret = put_user(IA32_SA_HANDLER(&old_ka), &oact->sa_handler); ret = put_user(IA32_SA_HANDLER(&old_ka), &oact->sa_handler);
ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags); ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags);
ret |= put_user(IA32_SA_RESTORER(&old_ka), &oact->sa_restorer); ret |= put_user(IA32_SA_RESTORER(&old_ka), &oact->sa_restorer);
ret |= copy_to_user(&oact->sa_mask, &old_ka.sa.sa_mask, sizeof(sigset32_t)); ret |= copy_to_user(&oact->sa_mask, &old_ka.sa.sa_mask, sizeof(compat_sigset_t));
} }
return ret; return ret;
} }
...@@ -560,7 +560,7 @@ extern asmlinkage long sys_rt_sigprocmask (int how, sigset_t *set, sigset_t *ose ...@@ -560,7 +560,7 @@ extern asmlinkage long sys_rt_sigprocmask (int how, sigset_t *set, sigset_t *ose
size_t sigsetsize); size_t sigsetsize);
asmlinkage long asmlinkage long
sys32_rt_sigprocmask (int how, sigset32_t *set, sigset32_t *oset, unsigned int sigsetsize) sys32_rt_sigprocmask (int how, compat_sigset_t *set, compat_sigset_t *oset, unsigned int sigsetsize)
{ {
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
sigset_t s; sigset_t s;
...@@ -587,13 +587,7 @@ sys32_rt_sigprocmask (int how, sigset32_t *set, sigset32_t *oset, unsigned int s ...@@ -587,13 +587,7 @@ sys32_rt_sigprocmask (int how, sigset32_t *set, sigset32_t *oset, unsigned int s
} }
asmlinkage long asmlinkage long
sys32_sigprocmask (int how, unsigned int *set, unsigned int *oset) sys32_rt_sigtimedwait (compat_sigset_t *uthese, siginfo_t32 *uinfo,
{
return sys32_rt_sigprocmask(how, (sigset32_t *) set, (sigset32_t *) oset, sizeof(*set));
}
asmlinkage long
sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo,
struct compat_timespec *uts, unsigned int sigsetsize) struct compat_timespec *uts, unsigned int sigsetsize)
{ {
extern asmlinkage long sys_rt_sigtimedwait (const sigset_t *, siginfo_t *, extern asmlinkage long sys_rt_sigtimedwait (const sigset_t *, siginfo_t *,
...@@ -605,16 +599,13 @@ sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo, ...@@ -605,16 +599,13 @@ sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo,
sigset_t s; sigset_t s;
int ret; int ret;
if (copy_from_user(&s.sig, uthese, sizeof(sigset32_t))) if (copy_from_user(&s.sig, uthese, sizeof(compat_sigset_t)))
return -EFAULT;
if (uts && get_compat_timespec(&t, uts))
return -EFAULT; return -EFAULT;
if (uts) {
ret = get_user(t.tv_sec, &uts->tv_sec);
ret |= get_user(t.tv_nsec, &uts->tv_nsec);
if (ret)
return -EFAULT;
}
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = sys_rt_sigtimedwait(&s, &info, &t, sigsetsize); ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
sigsetsize);
set_fs(old_fs); set_fs(old_fs);
if (ret >= 0 && uinfo) { if (ret >= 0 && uinfo) {
if (copy_siginfo_to_user32(uinfo, &info)) if (copy_siginfo_to_user32(uinfo, &info))
...@@ -648,7 +639,7 @@ sys32_sigaction (int sig, struct old_sigaction32 *act, struct old_sigaction32 *o ...@@ -648,7 +639,7 @@ sys32_sigaction (int sig, struct old_sigaction32 *act, struct old_sigaction32 *o
int ret; int ret;
if (act) { if (act) {
old_sigset32_t mask; compat_old_sigset_t mask;
ret = get_user(handler, &act->sa_handler); ret = get_user(handler, &act->sa_handler);
ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags); ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags);
...@@ -866,7 +857,7 @@ setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs ...@@ -866,7 +857,7 @@ setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs
err |= setup_sigcontext_ia32(&frame->sc, &frame->fpstate, regs, set->sig[0]); err |= setup_sigcontext_ia32(&frame->sc, &frame->fpstate, regs, set->sig[0]);
if (_IA32_NSIG_WORDS > 1) if (_COMPAT_NSIG_WORDS > 1)
err |= __copy_to_user(frame->extramask, (char *) &set->sig + 4, err |= __copy_to_user(frame->extramask, (char *) &set->sig + 4,
sizeof(frame->extramask)); sizeof(frame->extramask));
...@@ -1011,7 +1002,7 @@ sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int ...@@ -1011,7 +1002,7 @@ sys32_sigreturn (int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int
goto badframe; goto badframe;
if (__get_user(set.sig[0], &frame->sc.oldmask) if (__get_user(set.sig[0], &frame->sc.oldmask)
|| (_IA32_NSIG_WORDS > 1 && __copy_from_user((char *) &set.sig + 4, &frame->extramask, || (_COMPAT_NSIG_WORDS > 1 && __copy_from_user((char *) &set.sig + 4, &frame->extramask,
sizeof(frame->extramask)))) sizeof(frame->extramask))))
goto badframe; goto badframe;
......
...@@ -95,8 +95,6 @@ ia32_load_state (struct task_struct *t) ...@@ -95,8 +95,6 @@ ia32_load_state (struct task_struct *t)
struct pt_regs *regs = ia64_task_regs(t); struct pt_regs *regs = ia64_task_regs(t);
int nr = smp_processor_id(); /* LDT and TSS depend on CPU number: */ int nr = smp_processor_id(); /* LDT and TSS depend on CPU number: */
nr = smp_processor_id();
eflag = t->thread.eflag; eflag = t->thread.eflag;
fsr = t->thread.fsr; fsr = t->thread.fsr;
fcr = t->thread.fcr; fcr = t->thread.fcr;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright (C) 1999 Arun Sharma <arun.sharma@intel.com> * Copyright (C) 1999 Arun Sharma <arun.sharma@intel.com>
* Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 2000-2002 Hewlett-Packard Co * Copyright (C) 2000-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* *
* These routines maintain argument size conversion between 32bit and 64bit * These routines maintain argument size conversion between 32bit and 64bit
...@@ -609,61 +609,6 @@ sys32_pipe (int *fd) ...@@ -609,61 +609,6 @@ sys32_pipe (int *fd)
return retval; return retval;
} }
static inline int
put_statfs (struct statfs32 *ubuf, struct statfs *kbuf)
{
int err;
if (!access_ok(VERIFY_WRITE, ubuf, sizeof(*ubuf)))
return -EFAULT;
err = __put_user(kbuf->f_type, &ubuf->f_type);
err |= __put_user(kbuf->f_bsize, &ubuf->f_bsize);
err |= __put_user(kbuf->f_blocks, &ubuf->f_blocks);
err |= __put_user(kbuf->f_bfree, &ubuf->f_bfree);
err |= __put_user(kbuf->f_bavail, &ubuf->f_bavail);
err |= __put_user(kbuf->f_files, &ubuf->f_files);
err |= __put_user(kbuf->f_ffree, &ubuf->f_ffree);
err |= __put_user(kbuf->f_namelen, &ubuf->f_namelen);
err |= __put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]);
err |= __put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]);
return err;
}
extern asmlinkage long sys_statfs(const char * path, struct statfs * buf);
asmlinkage long
sys32_statfs (const char *path, struct statfs32 *buf)
{
int ret;
struct statfs s;
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
ret = sys_statfs(path, &s);
set_fs(old_fs);
if (put_statfs(buf, &s))
return -EFAULT;
return ret;
}
extern asmlinkage long sys_fstatfs(unsigned int fd, struct statfs * buf);
asmlinkage long
sys32_fstatfs (unsigned int fd, struct statfs32 *buf)
{
int ret;
struct statfs s;
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
ret = sys_fstatfs(fd, &s);
set_fs(old_fs);
if (put_statfs(buf, &s))
return -EFAULT;
return ret;
}
static inline long static inline long
get_tv32 (struct timeval *o, struct compat_timeval *i) get_tv32 (struct timeval *o, struct compat_timeval *i)
{ {
...@@ -1849,10 +1794,10 @@ struct ipc_perm32 { ...@@ -1849,10 +1794,10 @@ struct ipc_perm32 {
struct ipc64_perm32 { struct ipc64_perm32 {
key_t key; key_t key;
__kernel_uid32_t32 uid; compat_uid32_t uid;
__kernel_gid32_t32 gid; compat_gid32_t gid;
__kernel_uid32_t32 cuid; compat_uid32_t cuid;
__kernel_gid32_t32 cgid; compat_gid32_t cgid;
compat_mode_t mode; compat_mode_t mode;
unsigned short __pad1; unsigned short __pad1;
unsigned short seq; unsigned short seq;
...@@ -1895,8 +1840,8 @@ struct msqid_ds32 { ...@@ -1895,8 +1840,8 @@ struct msqid_ds32 {
unsigned short msg_cbytes; unsigned short msg_cbytes;
unsigned short msg_qnum; unsigned short msg_qnum;
unsigned short msg_qbytes; unsigned short msg_qbytes;
__kernel_ipc_pid_t32 msg_lspid; compat_ipc_pid_t msg_lspid;
__kernel_ipc_pid_t32 msg_lrpid; compat_ipc_pid_t msg_lrpid;
}; };
struct msqid64_ds32 { struct msqid64_ds32 {
...@@ -1922,8 +1867,8 @@ struct shmid_ds32 { ...@@ -1922,8 +1867,8 @@ struct shmid_ds32 {
compat_time_t shm_atime; compat_time_t shm_atime;
compat_time_t shm_dtime; compat_time_t shm_dtime;
compat_time_t shm_ctime; compat_time_t shm_ctime;
__kernel_ipc_pid_t32 shm_cpid; compat_ipc_pid_t shm_cpid;
__kernel_ipc_pid_t32 shm_lpid; compat_ipc_pid_t shm_lpid;
unsigned short shm_nattch; unsigned short shm_nattch;
}; };
...@@ -2011,6 +1956,10 @@ semctl32 (int first, int second, int third, void *uptr) ...@@ -2011,6 +1956,10 @@ semctl32 (int first, int second, int third, void *uptr)
else else
fourth.__pad = (void *)A(pad); fourth.__pad = (void *)A(pad);
switch (third) { switch (third) {
default:
err = -EINVAL;
break;
case IPC_INFO: case IPC_INFO:
case IPC_RMID: case IPC_RMID:
case IPC_SET: case IPC_SET:
...@@ -2399,7 +2348,7 @@ shmctl32 (int first, int second, void *uptr) ...@@ -2399,7 +2348,7 @@ shmctl32 (int first, int second, void *uptr)
static long static long
semtimedop32(int semid, struct sembuf *tsems, int nsems, semtimedop32(int semid, struct sembuf *tsems, int nsems,
const struct timespec32 *timeout32) const struct compat_timespec *timeout32)
{ {
struct timespec t; struct timespec t;
if (get_user (t.tv_sec, &timeout32->tv_sec) || if (get_user (t.tv_sec, &timeout32->tv_sec) ||
...@@ -2422,7 +2371,7 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) ...@@ -2422,7 +2371,7 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
return sys_semtimedop(first, (struct sembuf *)AA(ptr), second, NULL); return sys_semtimedop(first, (struct sembuf *)AA(ptr), second, NULL);
case SEMTIMEDOP: case SEMTIMEDOP:
return semtimedop32(first, (struct sembuf *)AA(ptr), second, return semtimedop32(first, (struct sembuf *)AA(ptr), second,
(const struct timespec32 *)AA(fifth)); (const struct compat_timespec *)AA(fifth));
case SEMGET: case SEMGET:
return sys_semget(first, second, third); return sys_semget(first, second, third);
case SEMCTL: case SEMCTL:
...@@ -3475,12 +3424,6 @@ sys32_fstat64 (unsigned int fd, struct stat64 *statbuf) ...@@ -3475,12 +3424,6 @@ sys32_fstat64 (unsigned int fd, struct stat64 *statbuf)
return ret; return ret;
} }
asmlinkage long
sys32_sigpending (unsigned int *set)
{
return do_sigpending(set, sizeof(*set));
}
struct sysinfo32 { struct sysinfo32 {
s32 uptime; s32 uptime;
u32 loads[3]; u32 loads[3];
...@@ -3536,7 +3479,7 @@ sys32_sched_rr_get_interval (pid_t pid, struct compat_timespec *interval) ...@@ -3536,7 +3479,7 @@ sys32_sched_rr_get_interval (pid_t pid, struct compat_timespec *interval)
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = sys_sched_rr_get_interval(pid, &t); ret = sys_sched_rr_get_interval(pid, &t);
set_fs(old_fs); set_fs(old_fs);
if (put_user (t.tv_sec, &interval->tv_sec) || put_user (t.tv_nsec, &interval->tv_nsec)) if (put_compat_timespec(&t, interval))
return -EFAULT; return -EFAULT;
return ret; return ret;
} }
......
...@@ -10,6 +10,7 @@ obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \ ...@@ -10,6 +10,7 @@ obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \
semaphore.o setup.o \ semaphore.o setup.o \
signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
obj-$(CONFIG_FSYS) += fsys.o
obj-$(CONFIG_IOSAPIC) += iosapic.o obj-$(CONFIG_IOSAPIC) += iosapic.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o
obj-$(CONFIG_EFI_VARS) += efivars.o obj-$(CONFIG_EFI_VARS) += efivars.o
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com>
* Copyright (C) 2000, 2002 Hewlett-Packard Co. * Copyright (C) 2000, 2002-2003 Hewlett-Packard Co.
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 2000 Intel Corp. * Copyright (C) 2000 Intel Corp.
* Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com> * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
...@@ -75,20 +75,20 @@ acpi_get_sysname (void) ...@@ -75,20 +75,20 @@ acpi_get_sysname (void)
rsdp_phys = acpi_find_rsdp(); rsdp_phys = acpi_find_rsdp();
if (!rsdp_phys) { if (!rsdp_phys) {
printk("ACPI 2.0 RSDP not found, default to \"dig\"\n"); printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n");
return "dig"; return "dig";
} }
rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys); rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys);
if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
printk("ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
return "dig"; return "dig";
} }
xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address); xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address);
hdr = &xsdt->header; hdr = &xsdt->header;
if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
printk("ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
return "dig"; return "dig";
} }
...@@ -128,7 +128,7 @@ acpi_get_sysname (void) ...@@ -128,7 +128,7 @@ acpi_get_sysname (void)
* with a list of acpi_resource structures. * with a list of acpi_resource structures.
*/ */
acpi_status acpi_status
acpi_get_crs (acpi_handle obj, acpi_buffer *buf) acpi_get_crs (acpi_handle obj, struct acpi_buffer *buf)
{ {
acpi_status result; acpi_status result;
buf->length = 0; buf->length = 0;
...@@ -144,10 +144,10 @@ acpi_get_crs (acpi_handle obj, acpi_buffer *buf) ...@@ -144,10 +144,10 @@ acpi_get_crs (acpi_handle obj, acpi_buffer *buf)
return acpi_get_current_resources(obj, buf); return acpi_get_current_resources(obj, buf);
} }
acpi_resource * struct acpi_resource *
acpi_get_crs_next (acpi_buffer *buf, int *offset) acpi_get_crs_next (struct acpi_buffer *buf, int *offset)
{ {
acpi_resource *res; struct acpi_resource *res;
if (*offset >= buf->length) if (*offset >= buf->length)
return NULL; return NULL;
...@@ -157,11 +157,11 @@ acpi_get_crs_next (acpi_buffer *buf, int *offset) ...@@ -157,11 +157,11 @@ acpi_get_crs_next (acpi_buffer *buf, int *offset)
return res; return res;
} }
acpi_resource_data * union acpi_resource_data *
acpi_get_crs_type (acpi_buffer *buf, int *offset, int type) acpi_get_crs_type (struct acpi_buffer *buf, int *offset, int type)
{ {
for (;;) { for (;;) {
acpi_resource *res = acpi_get_crs_next(buf, offset); struct acpi_resource *res = acpi_get_crs_next(buf, offset);
if (!res) if (!res)
return NULL; return NULL;
if (res->id == type) if (res->id == type)
...@@ -170,7 +170,7 @@ acpi_get_crs_type (acpi_buffer *buf, int *offset, int type) ...@@ -170,7 +170,7 @@ acpi_get_crs_type (acpi_buffer *buf, int *offset, int type)
} }
void void
acpi_dispose_crs (acpi_buffer *buf) acpi_dispose_crs (struct acpi_buffer *buf)
{ {
kfree(buf->pointer); kfree(buf->pointer);
} }
...@@ -199,7 +199,7 @@ acpi_request_vector (u32 int_type) ...@@ -199,7 +199,7 @@ acpi_request_vector (u32 int_type)
/* correctable platform error interrupt */ /* correctable platform error interrupt */
vector = platform_intr_list[int_type]; vector = platform_intr_list[int_type];
} else } else
printk("acpi_request_vector(): invalid interrupt type\n"); printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
return vector; return vector;
} }
...@@ -249,7 +249,7 @@ acpi_parse_lsapic (acpi_table_entry_header *header) ...@@ -249,7 +249,7 @@ acpi_parse_lsapic (acpi_table_entry_header *header)
acpi_table_print_madt_entry(header); acpi_table_print_madt_entry(header);
printk("CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid); printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid);
if (lsapic->flags.enabled) { if (lsapic->flags.enabled) {
available_cpus++; available_cpus++;
...@@ -478,8 +478,8 @@ acpi_numa_slit_init (struct acpi_table_slit *slit) ...@@ -478,8 +478,8 @@ acpi_numa_slit_init (struct acpi_table_slit *slit)
len = sizeof(struct acpi_table_header) + 8 len = sizeof(struct acpi_table_header) + 8
+ slit->localities * slit->localities; + slit->localities * slit->localities;
if (slit->header.length != len) { if (slit->header.length != len) {
printk("ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
len, slit->header.length); len, slit->header.length);
memset(numa_slit, 10, sizeof(numa_slit)); memset(numa_slit, 10, sizeof(numa_slit));
return; return;
} }
...@@ -514,8 +514,8 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma) ...@@ -514,8 +514,8 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
size = (size << 32) | ma->length_lo; size = (size << 32) | ma->length_lo;
if (num_memblks >= NR_MEMBLKS) { if (num_memblks >= NR_MEMBLKS) {
printk("Too many mem chunks in SRAT. Ignoring %ld MBytes at %lx\n", printk(KERN_ERR "Too many mem chunks in SRAT. Ignoring %ld MBytes at %lx\n",
size/(1024*1024), paddr); size/(1024*1024), paddr);
return; return;
} }
...@@ -545,8 +545,8 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma) ...@@ -545,8 +545,8 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
if (min_hole_size) { if (min_hole_size) {
if (min_hole_size > size) { if (min_hole_size > size) {
printk("Too huge memory hole. Ignoring %ld MBytes at %lx\n", printk(KERN_ERR "Too huge memory hole. Ignoring %ld MBytes at %lx\n",
size/(1024*1024), paddr); size/(1024*1024), paddr);
return; return;
} }
} }
...@@ -605,8 +605,8 @@ acpi_numa_arch_fixup(void) ...@@ -605,8 +605,8 @@ acpi_numa_arch_fixup(void)
for (i = 0; i < srat_num_cpus; i++) for (i = 0; i < srat_num_cpus; i++)
node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
printk("Number of logical nodes in system = %d\n", numnodes); printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes);
printk("Number of memory chunks in system = %d\n", num_memblks); printk(KERN_INFO "Number of memory chunks in system = %d\n", num_memblks);
if (!slit_table) return; if (!slit_table) return;
memset(numa_slit, -1, sizeof(numa_slit)); memset(numa_slit, -1, sizeof(numa_slit));
...@@ -638,7 +638,7 @@ static int __init ...@@ -638,7 +638,7 @@ static int __init
acpi_parse_fadt (unsigned long phys_addr, unsigned long size) acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
{ {
struct acpi_table_header *fadt_header; struct acpi_table_header *fadt_header;
fadt_descriptor_rev2 *fadt; struct fadt_descriptor_rev2 *fadt;
u32 sci_irq, gsi_base; u32 sci_irq, gsi_base;
char *iosapic_address; char *iosapic_address;
...@@ -649,7 +649,7 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size) ...@@ -649,7 +649,7 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
if (fadt_header->revision != 3) if (fadt_header->revision != 3)
return -ENODEV; /* Only deal with ACPI 2.0 FADT */ return -ENODEV; /* Only deal with ACPI 2.0 FADT */
fadt = (fadt_descriptor_rev2 *) fadt_header; fadt = (struct fadt_descriptor_rev2 *) fadt_header;
if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER)) if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
acpi_kbd_controller_present = 0; acpi_kbd_controller_present = 0;
...@@ -806,7 +806,7 @@ acpi_boot_init (char *cmdline) ...@@ -806,7 +806,7 @@ acpi_boot_init (char *cmdline)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (available_cpus == 0) { if (available_cpus == 0) {
printk("ACPI: Found 0 CPUS; assuming 1\n"); printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
available_cpus = 1; /* We've got at least one of these, no? */ available_cpus = 1; /* We've got at least one of these, no? */
} }
smp_boot_data.cpu_count = total_cpus; smp_boot_data.cpu_count = total_cpus;
...@@ -817,7 +817,7 @@ acpi_boot_init (char *cmdline) ...@@ -817,7 +817,7 @@ acpi_boot_init (char *cmdline)
#endif #endif
#endif #endif
/* Make boot-up look pretty */ /* Make boot-up look pretty */
printk("%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
return 0; return 0;
} }
...@@ -888,4 +888,26 @@ acpi_irq_to_vector (u32 irq) ...@@ -888,4 +888,26 @@ acpi_irq_to_vector (u32 irq)
return gsi_to_vector(irq); return gsi_to_vector(irq);
} }
int __init
acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
{
int vector = 0;
u32 irq_base;
char *iosapic_address;
if (acpi_madt->flags.pcat_compat && (gsi < 16))
return isa_irq_to_vector(gsi);
if (!iosapic_register_intr)
return 0;
/* Find the IOSAPIC */
if (!acpi_find_iosapic(gsi, &irq_base, &iosapic_address)) {
/* Turn it on */
vector = iosapic_register_intr (gsi, polarity, trigger,
irq_base, iosapic_address);
}
return vector;
}
#endif /* CONFIG_ACPI_BOOT */ #endif /* CONFIG_ACPI_BOOT */
...@@ -195,7 +195,7 @@ ia64_emulate_brl (struct pt_regs *regs, unsigned long ar_ec) ...@@ -195,7 +195,7 @@ ia64_emulate_brl (struct pt_regs *regs, unsigned long ar_ec)
/* /*
* The target address contains unimplemented bits. * The target address contains unimplemented bits.
*/ */
printk("Woah! Unimplemented Instruction Address Trap!\n"); printk(KERN_DEBUG "Woah! Unimplemented Instruction Address Trap!\n");
siginfo.si_signo = SIGILL; siginfo.si_signo = SIGILL;
siginfo.si_errno = 0; siginfo.si_errno = 0;
siginfo.si_flags = 0; siginfo.si_flags = 0;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 1999-2002 Hewlett-Packard Co. * Copyright (C) 1999-2003 Hewlett-Packard Co.
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
...@@ -33,15 +33,6 @@ ...@@ -33,15 +33,6 @@
#define EFI_DEBUG 0 #define EFI_DEBUG 0
#ifdef CONFIG_HUGETLB_PAGE
/* By default at total of 512MB is reserved huge pages. */
#define HTLBZONE_SIZE_DEFAULT 0x20000000
unsigned long htlbzone_pages = (HTLBZONE_SIZE_DEFAULT >> HPAGE_SHIFT);
#endif
extern efi_status_t efi_call_phys (void *, ...); extern efi_status_t efi_call_phys (void *, ...);
struct efi efi; struct efi efi;
...@@ -374,7 +365,7 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) ...@@ -374,7 +365,7 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
prev_valid = 1; prev_valid = 1;
} else { } else {
if (curr.start < prev.start) if (curr.start < prev.start)
printk("Oops: EFI memory table not ordered!\n"); printk(KERN_ERR "Oops: EFI memory table not ordered!\n");
if (prev.end == curr.start) { if (prev.end == curr.start) {
/* merge two consecutive memory ranges */ /* merge two consecutive memory ranges */
...@@ -446,7 +437,8 @@ efi_map_pal_code (void) ...@@ -446,7 +437,8 @@ efi_map_pal_code (void)
* dedicated ITR for the PAL code. * dedicated ITR for the PAL code.
*/ */
if ((vaddr & mask) == (KERNEL_START & mask)) { if ((vaddr & mask) == (KERNEL_START & mask)) {
printk("%s: no need to install ITR for PAL code\n", __FUNCTION__); printk(KERN_INFO "%s: no need to install ITR for PAL code\n",
__FUNCTION__);
continue; continue;
} }
...@@ -454,7 +446,7 @@ efi_map_pal_code (void) ...@@ -454,7 +446,7 @@ efi_map_pal_code (void)
panic("Woah! PAL code size bigger than a granule!"); panic("Woah! PAL code size bigger than a granule!");
mask = ~((1 << IA64_GRANULE_SHIFT) - 1); mask = ~((1 << IA64_GRANULE_SHIFT) - 1);
printk("CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
smp_processor_id(), md->phys_addr, smp_processor_id(), md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
...@@ -497,27 +489,8 @@ efi_init (void) ...@@ -497,27 +489,8 @@ efi_init (void)
++cp; ++cp;
} }
} }
#ifdef CONFIG_HUGETLB_PAGE
/* Just duplicating the above algo for lpzone start */
for (cp = saved_command_line; *cp; ) {
if (memcmp(cp, "lpmem=", 6) == 0) {
cp += 6;
htlbzone_pages = memparse(cp, &end);
htlbzone_pages = (htlbzone_pages >> HPAGE_SHIFT);
if (end != cp)
break;
cp = end;
} else {
while (*cp != ' ' && *cp)
++cp;
while (*cp == ' ')
++cp;
}
}
printk("Total HugeTLB_Page memory pages requested 0x%lx \n", htlbzone_pages);
#endif
if (mem_limit != ~0UL) if (mem_limit != ~0UL)
printk("Ignoring memory above %luMB\n", mem_limit >> 20); printk(KERN_INFO "Ignoring memory above %luMB\n", mem_limit >> 20);
efi.systab = __va(ia64_boot_param->efi_systab); efi.systab = __va(ia64_boot_param->efi_systab);
...@@ -529,7 +502,7 @@ efi_init (void) ...@@ -529,7 +502,7 @@ efi_init (void)
if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
panic("Woah! EFI system table signature incorrect\n"); panic("Woah! EFI system table signature incorrect\n");
if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0) if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0)
printk("Warning: EFI system table major version mismatch: " printk(KERN_WARNING "Warning: EFI system table major version mismatch: "
"got %d.%02d, expected %d.%02d\n", "got %d.%02d, expected %d.%02d\n",
efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff,
EFI_SYSTEM_TABLE_REVISION >> 16, EFI_SYSTEM_TABLE_REVISION & 0xffff); EFI_SYSTEM_TABLE_REVISION >> 16, EFI_SYSTEM_TABLE_REVISION & 0xffff);
...@@ -544,7 +517,7 @@ efi_init (void) ...@@ -544,7 +517,7 @@ efi_init (void)
vendor[i] = '\0'; vendor[i] = '\0';
} }
printk("EFI v%u.%.02u by %s:", printk(KERN_INFO "EFI v%u.%.02u by %s:",
efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor); efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor);
for (i = 0; i < efi.systab->nr_tables; i++) { for (i = 0; i < efi.systab->nr_tables; i++) {
...@@ -636,7 +609,7 @@ efi_enter_virtual_mode (void) ...@@ -636,7 +609,7 @@ efi_enter_virtual_mode (void)
| _PAGE_PL_0 | _PAGE_PL_0
| _PAGE_AR_RW)); | _PAGE_AR_RW));
#else #else
printk("EFI_MEMORY_WC mapping\n"); printk(KERN_INFO "EFI_MEMORY_WC mapping\n");
md->virt_addr = (u64) ioremap(md->phys_addr, 0); md->virt_addr = (u64) ioremap(md->phys_addr, 0);
#endif #endif
} else if (md->attribute & EFI_MEMORY_WT) { } else if (md->attribute & EFI_MEMORY_WT) {
...@@ -646,7 +619,7 @@ efi_enter_virtual_mode (void) ...@@ -646,7 +619,7 @@ efi_enter_virtual_mode (void)
| _PAGE_PL_0 | _PAGE_PL_0
| _PAGE_AR_RW)); | _PAGE_AR_RW));
#else #else
printk("EFI_MEMORY_WT mapping\n"); printk(KERN_INFO "EFI_MEMORY_WT mapping\n");
md->virt_addr = (u64) ioremap(md->phys_addr, 0); md->virt_addr = (u64) ioremap(md->phys_addr, 0);
#endif #endif
} }
...@@ -658,7 +631,8 @@ efi_enter_virtual_mode (void) ...@@ -658,7 +631,8 @@ efi_enter_virtual_mode (void)
efi_desc_size, ia64_boot_param->efi_memdesc_version, efi_desc_size, ia64_boot_param->efi_memdesc_version,
ia64_boot_param->efi_memmap); ia64_boot_param->efi_memmap);
if (status != EFI_SUCCESS) { if (status != EFI_SUCCESS) {
printk("Warning: unable to switch EFI into virtual mode (status=%lu)\n", status); printk(KERN_WARNING "warning: unable to switch EFI into virtual mode "
"(status=%lu)\n", status);
return; return;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Kernel entry points. * Kernel entry points.
* *
* Copyright (C) 1998-2002 Hewlett-Packard Co * Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
/* /*
* Global (preserved) predicate usage on syscall entry/exit path: * Global (preserved) predicate usage on syscall entry/exit path:
* *
* pKern: See entry.h. * pKStk: See entry.h.
* pUser: See entry.h. * pUStk: See entry.h.
* pSys: See entry.h. * pSys: See entry.h.
* pNonSys: !pSys * pNonSys: !pSys
*/ */
...@@ -63,7 +63,7 @@ ENTRY(ia64_execve) ...@@ -63,7 +63,7 @@ ENTRY(ia64_execve)
sxt4 r8=r8 // return 64-bit result sxt4 r8=r8 // return 64-bit result
;; ;;
stf.spill [sp]=f0 stf.spill [sp]=f0
(p6) cmp.ne pKern,pUser=r0,r0 // a successful execve() lands us in user-mode... (p6) cmp.ne pKStk,pUStk=r0,r0 // a successful execve() lands us in user-mode...
mov rp=loc0 mov rp=loc0
(p6) mov ar.pfs=r0 // clear ar.pfs on success (p6) mov ar.pfs=r0 // clear ar.pfs on success
(p7) br.ret.sptk.many rp (p7) br.ret.sptk.many rp
...@@ -193,7 +193,7 @@ GLOBAL_ENTRY(ia64_switch_to) ...@@ -193,7 +193,7 @@ GLOBAL_ENTRY(ia64_switch_to)
;; ;;
(p6) srlz.d (p6) srlz.d
ld8 sp=[r21] // load kernel stack pointer of new task ld8 sp=[r21] // load kernel stack pointer of new task
mov IA64_KR(CURRENT)=r20 // update "current" application register mov IA64_KR(CURRENT)=in0 // update "current" application register
mov r8=r13 // return pointer to previously running task mov r8=r13 // return pointer to previously running task
mov r13=in0 // set "current" pointer mov r13=in0 // set "current" pointer
;; ;;
...@@ -507,7 +507,14 @@ END(invoke_syscall_trace) ...@@ -507,7 +507,14 @@ END(invoke_syscall_trace)
GLOBAL_ENTRY(ia64_trace_syscall) GLOBAL_ENTRY(ia64_trace_syscall)
PT_REGS_UNWIND_INFO(0) PT_REGS_UNWIND_INFO(0)
{ /*
* Some versions of gas generate bad unwind info if the first instruction of a
* procedure doesn't go into the first slot of a bundle. This is a workaround.
*/
nop.m 0
nop.i 0
br.call.sptk.many rp=invoke_syscall_trace // give parent a chance to catch syscall args br.call.sptk.many rp=invoke_syscall_trace // give parent a chance to catch syscall args
}
.ret6: br.call.sptk.many rp=b6 // do the syscall .ret6: br.call.sptk.many rp=b6 // do the syscall
strace_check_retval: strace_check_retval:
cmp.lt p6,p0=r8,r0 // syscall failed? cmp.lt p6,p0=r8,r0 // syscall failed?
...@@ -537,12 +544,19 @@ END(ia64_trace_syscall) ...@@ -537,12 +544,19 @@ END(ia64_trace_syscall)
GLOBAL_ENTRY(ia64_ret_from_clone) GLOBAL_ENTRY(ia64_ret_from_clone)
PT_REGS_UNWIND_INFO(0) PT_REGS_UNWIND_INFO(0)
{ /*
* Some versions of gas generate bad unwind info if the first instruction of a
* procedure doesn't go into the first slot of a bundle. This is a workaround.
*/
nop.m 0
nop.i 0
/* /*
* We need to call schedule_tail() to complete the scheduling process. * We need to call schedule_tail() to complete the scheduling process.
* Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the * Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the
* address of the previously executing task. * address of the previously executing task.
*/ */
br.call.sptk.many rp=ia64_invoke_schedule_tail br.call.sptk.many rp=ia64_invoke_schedule_tail
}
.ret8: .ret8:
adds r2=TI_FLAGS+IA64_TASK_SIZE,r13 adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
;; ;;
...@@ -569,11 +583,12 @@ END(ia64_ret_from_syscall) ...@@ -569,11 +583,12 @@ END(ia64_ret_from_syscall)
// fall through // fall through
GLOBAL_ENTRY(ia64_leave_kernel) GLOBAL_ENTRY(ia64_leave_kernel)
PT_REGS_UNWIND_INFO(0) PT_REGS_UNWIND_INFO(0)
// work.need_resched etc. mustn't get changed by this CPU before it returns to userspace: // work.need_resched etc. mustn't get changed by this CPU before it returns to
(pUser) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUser // user- or fsys-mode:
(pUser) rsm psr.i (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk
(pUStk) rsm psr.i
;; ;;
(pUser) adds r17=TI_FLAGS+IA64_TASK_SIZE,r13 (pUStk) adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
;; ;;
.work_processed: .work_processed:
(p6) ld4 r18=[r17] // load current_thread_info()->flags (p6) ld4 r18=[r17] // load current_thread_info()->flags
...@@ -635,9 +650,9 @@ GLOBAL_ENTRY(ia64_leave_kernel) ...@@ -635,9 +650,9 @@ GLOBAL_ENTRY(ia64_leave_kernel)
;; ;;
srlz.i // ensure interruption collection is off srlz.i // ensure interruption collection is off
mov b7=r15 mov b7=r15
bsw.0 // switch back to bank 0 (no stop bit required beforehand...)
;; ;;
bsw.0 // switch back to bank 0 (pUStk) mov r18=IA64_KR(CURRENT) // Itanium 2: 12 cycle read latency
;;
adds r16=16,r12 adds r16=16,r12
adds r17=24,r12 adds r17=24,r12
;; ;;
...@@ -665,16 +680,21 @@ GLOBAL_ENTRY(ia64_leave_kernel) ...@@ -665,16 +680,21 @@ GLOBAL_ENTRY(ia64_leave_kernel)
;; ;;
ld8.fill r12=[r16],16 ld8.fill r12=[r16],16
ld8.fill r13=[r17],16 ld8.fill r13=[r17],16
(pUStk) adds r18=IA64_TASK_THREAD_ON_USTACK_OFFSET,r18
;; ;;
ld8.fill r14=[r16] ld8.fill r14=[r16]
ld8.fill r15=[r17] ld8.fill r15=[r17]
(pUStk) mov r17=1
;;
(pUStk) st1 [r18]=r17 // restore current->thread.on_ustack
shr.u r18=r19,16 // get byte size of existing "dirty" partition shr.u r18=r19,16 // get byte size of existing "dirty" partition
;; ;;
mov r16=ar.bsp // get existing backing store pointer mov r16=ar.bsp // get existing backing store pointer
movl r17=THIS_CPU(ia64_phys_stacked_size_p8) movl r17=THIS_CPU(ia64_phys_stacked_size_p8)
;; ;;
ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8 ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8
(pKern) br.cond.dpnt skip_rbs_switch (pKStk) br.cond.dpnt skip_rbs_switch
/* /*
* Restore user backing store. * Restore user backing store.
* *
...@@ -710,21 +730,9 @@ dont_preserve_current_frame: ...@@ -710,21 +730,9 @@ dont_preserve_current_frame:
shr.u loc1=r18,9 // RNaTslots <= dirtySize / (64*8) + 1 shr.u loc1=r18,9 // RNaTslots <= dirtySize / (64*8) + 1
sub r17=r17,r18 // r17 = (physStackedSize + 8) - dirtySize sub r17=r17,r18 // r17 = (physStackedSize + 8) - dirtySize
;; ;;
#if 1
.align 32 // see comment below about gas bug...
#endif
mov ar.rsc=r19 // load ar.rsc to be used for "loadrs" mov ar.rsc=r19 // load ar.rsc to be used for "loadrs"
shladd in0=loc1,3,r17 shladd in0=loc1,3,r17
mov in1=0 mov in1=0
#if 0
// gas-2.12.90 is unable to generate a stop bit after .align, which is bad,
// because alloc must be at the beginning of an insn-group.
.align 32
#else
nop 0
nop 0
nop 0
#endif
;; ;;
rse_clear_invalid: rse_clear_invalid:
#ifdef CONFIG_ITANIUM #ifdef CONFIG_ITANIUM
...@@ -788,12 +796,12 @@ rse_clear_invalid: ...@@ -788,12 +796,12 @@ rse_clear_invalid:
skip_rbs_switch: skip_rbs_switch:
mov b6=rB6 mov b6=rB6
mov ar.pfs=rARPFS mov ar.pfs=rARPFS
(pUser) mov ar.bspstore=rARBSPSTORE (pUStk) mov ar.bspstore=rARBSPSTORE
(p9) mov cr.ifs=rCRIFS (p9) mov cr.ifs=rCRIFS
mov cr.ipsr=rCRIPSR mov cr.ipsr=rCRIPSR
mov cr.iip=rCRIIP mov cr.iip=rCRIIP
;; ;;
(pUser) mov ar.rnat=rARRNAT // must happen with RSE in lazy mode (pUStk) mov ar.rnat=rARRNAT // must happen with RSE in lazy mode
mov ar.rsc=rARRSC mov ar.rsc=rARRSC
mov ar.unat=rARUNAT mov ar.unat=rARUNAT
mov pr=rARPR,-1 mov pr=rARPR,-1
...@@ -963,17 +971,16 @@ ENTRY(sys_rt_sigreturn) ...@@ -963,17 +971,16 @@ ENTRY(sys_rt_sigreturn)
END(sys_rt_sigreturn) END(sys_rt_sigreturn)
GLOBAL_ENTRY(ia64_prepare_handle_unaligned) GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
//
// r16 = fake ar.pfs, we simply need to make sure
// privilege is still 0
//
mov r16=r0
.prologue .prologue
/*
* r16 = fake ar.pfs, we simply need to make sure privilege is still 0
*/
mov r16=r0
DO_SAVE_SWITCH_STACK DO_SAVE_SWITCH_STACK
br.call.sptk.many rp=ia64_handle_unaligned // stack frame setup in ivt br.call.sptk.many rp=ia64_handle_unaligned // stack frame setup in ivt
.ret21: .body .ret21: .body
DO_LOAD_SWITCH_STACK DO_LOAD_SWITCH_STACK
br.cond.sptk.many rp // goes to ia64_leave_kernel br.cond.sptk.many rp // goes to ia64_leave_kernel
END(ia64_prepare_handle_unaligned) END(ia64_prepare_handle_unaligned)
// //
...@@ -1235,8 +1242,8 @@ sys_call_table: ...@@ -1235,8 +1242,8 @@ sys_call_table:
data8 sys_sched_setaffinity data8 sys_sched_setaffinity
data8 sys_sched_getaffinity data8 sys_sched_getaffinity
data8 sys_set_tid_address data8 sys_set_tid_address
data8 ia64_ni_syscall // available. (was sys_alloc_hugepages) data8 ia64_ni_syscall
data8 ia64_ni_syscall // available (was sys_free_hugepages) data8 ia64_ni_syscall // 1235
data8 sys_exit_group data8 sys_exit_group
data8 sys_lookup_dcookie data8 sys_lookup_dcookie
data8 sys_io_setup data8 sys_io_setup
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
* Preserved registers that are shared between code in ivt.S and entry.S. Be * Preserved registers that are shared between code in ivt.S and entry.S. Be
* careful not to step on these! * careful not to step on these!
*/ */
#define pKern p2 /* will leave_kernel return to kernel-mode? */ #define pKStk p2 /* will leave_kernel return to kernel-stacks? */
#define pUser p3 /* will leave_kernel return to user-mode? */ #define pUStk p3 /* will leave_kernel return to user-stacks? */
#define pSys p4 /* are we processing a (synchronous) system call? */ #define pSys p4 /* are we processing a (synchronous) system call? */
#define pNonSys p5 /* complement of pSys */ #define pNonSys p5 /* complement of pSys */
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* This file contains the code that gets mapped at the upper end of each task's text * This file contains the code that gets mapped at the upper end of each task's text
* region. For now, it contains the signal trampoline code only. * region. For now, it contains the signal trampoline code only.
* *
* Copyright (C) 1999-2002 Hewlett-Packard Co * Copyright (C) 1999-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
*/ */
...@@ -14,6 +14,87 @@ ...@@ -14,6 +14,87 @@
#include <asm/page.h> #include <asm/page.h>
.section .text.gate, "ax" .section .text.gate, "ax"
.start_gate:
#if CONFIG_FSYS
#include <asm/errno.h>
/*
* On entry:
* r11 = saved ar.pfs
* r15 = system call #
* b0 = saved return address
* b6 = return address
* On exit:
* r11 = saved ar.pfs
* r15 = system call #
* b0 = saved return address
* all other "scratch" registers: undefined
* all "preserved" registers: same as on entry
*/
GLOBAL_ENTRY(syscall_via_epc)
.prologue
.altrp b6
.body
{
/*
* Note: the kernel cannot assume that the first two instructions in this
* bundle get executed. The remaining code must be safe even if
* they do not get executed.
*/
adds r17=-1024,r15
mov r10=0 // default to successful syscall execution
epc
}
;;
rsm psr.be
movl r18=fsyscall_table
mov r16=IA64_KR(CURRENT)
mov r19=255
;;
shladd r18=r17,3,r18
cmp.geu p6,p0=r19,r17 // (syscall > 0 && syscall <= 1024+255)?
;;
srlz.d // ensure little-endian byteorder is in effect
(p6) ld8 r18=[r18]
;;
(p6) mov b7=r18
(p6) br.sptk.many b7
mov r10=-1
mov r8=ENOSYS
MCKINLEY_E9_WORKAROUND
br.ret.sptk.many b6
END(syscall_via_epc)
GLOBAL_ENTRY(syscall_via_break)
.prologue
.altrp b6
.body
break 0x100000
br.ret.sptk.many b6
END(syscall_via_break)
GLOBAL_ENTRY(fsys_fallback_syscall)
/*
* It would be better/fsyser to do the SAVE_MIN magic directly here, but for now
* we simply fall back on doing a system-call via break. Good enough
* to get started. (Note: we have to do this through the gate page again, since
* the br.ret will switch us back to user-level privilege.)
*
* XXX Move this back to fsys.S after changing it over to avoid break 0x100000.
*/
movl r2=(syscall_via_break - .start_gate) + GATE_ADDR
;;
MCKINLEY_E9_WORKAROUND
mov b7=r2
br.ret.sptk.many b7
END(fsys_fallback_syscall)
#endif /* CONFIG_FSYS */
# define ARG0_OFF (16 + IA64_SIGFRAME_ARG0_OFFSET) # define ARG0_OFF (16 + IA64_SIGFRAME_ARG0_OFFSET)
# define ARG1_OFF (16 + IA64_SIGFRAME_ARG1_OFFSET) # define ARG1_OFF (16 + IA64_SIGFRAME_ARG1_OFFSET)
...@@ -63,15 +144,18 @@ ...@@ -63,15 +144,18 @@
* call stack. * call stack.
*/ */
#define SIGTRAMP_SAVES \
.unwabi @svr4, 's' // mark this as a sigtramp handler (saves scratch regs) \
.savesp ar.unat, UNAT_OFF+SIGCONTEXT_OFF \
.savesp ar.fpsr, FPSR_OFF+SIGCONTEXT_OFF \
.savesp pr, PR_OFF+SIGCONTEXT_OFF \
.savesp rp, RP_OFF+SIGCONTEXT_OFF \
.vframesp SP_OFF+SIGCONTEXT_OFF
GLOBAL_ENTRY(ia64_sigtramp) GLOBAL_ENTRY(ia64_sigtramp)
// describe the state that is active when we get here: // describe the state that is active when we get here:
.prologue .prologue
.unwabi @svr4, 's' // mark this as a sigtramp handler (saves scratch regs) SIGTRAMP_SAVES
.savesp ar.unat, UNAT_OFF+SIGCONTEXT_OFF
.savesp ar.fpsr, FPSR_OFF+SIGCONTEXT_OFF
.savesp pr, PR_OFF+SIGCONTEXT_OFF
.savesp rp, RP_OFF+SIGCONTEXT_OFF
.vframesp SP_OFF+SIGCONTEXT_OFF
.body .body
.label_state 1 .label_state 1
...@@ -156,10 +240,11 @@ back_from_restore_rbs: ...@@ -156,10 +240,11 @@ back_from_restore_rbs:
ldf.fill f14=[base0],32 ldf.fill f14=[base0],32
ldf.fill f15=[base1],32 ldf.fill f15=[base1],32
mov r15=__NR_rt_sigreturn mov r15=__NR_rt_sigreturn
.restore sp // pop .prologue
break __BREAK_SYSCALL break __BREAK_SYSCALL
.body .prologue
.copy_state 1 SIGTRAMP_SAVES
setup_rbs: setup_rbs:
mov ar.rsc=0 // put RSE into enforced lazy mode mov ar.rsc=0 // put RSE into enforced lazy mode
;; ;;
...@@ -171,6 +256,7 @@ setup_rbs: ...@@ -171,6 +256,7 @@ setup_rbs:
;; ;;
.spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF .spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF
st8 [r14]=r16 // save sc_ar_rnat st8 [r14]=r16 // save sc_ar_rnat
.body
adds r14=(LOADRS_OFF+SIGCONTEXT_OFF),sp adds r14=(LOADRS_OFF+SIGCONTEXT_OFF),sp
mov.m r16=ar.bsp // sc_loadrs <- (new bsp - new bspstore) << 16 mov.m r16=ar.bsp // sc_loadrs <- (new bsp - new bspstore) << 16
...@@ -182,10 +268,11 @@ setup_rbs: ...@@ -182,10 +268,11 @@ setup_rbs:
;; ;;
st8 [r14]=r15 // save sc_loadrs st8 [r14]=r15 // save sc_loadrs
mov ar.rsc=0xf // set RSE into eager mode, pl 3 mov ar.rsc=0xf // set RSE into eager mode, pl 3
.restore sp // pop .prologue
br.cond.sptk back_from_setup_rbs br.cond.sptk back_from_setup_rbs
.prologue .prologue
.copy_state 1 SIGTRAMP_SAVES
.spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF .spillsp ar.rnat, RNAT_OFF+SIGCONTEXT_OFF
.body .body
restore_rbs: restore_rbs:
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* to set up the kernel's global pointer and jump to the kernel * to set up the kernel's global pointer and jump to the kernel
* entry point. * entry point.
* *
* Copyright (C) 1998-2001 Hewlett-Packard Co * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
...@@ -143,17 +143,14 @@ start_ap: ...@@ -143,17 +143,14 @@ start_ap:
movl r2=init_thread_union movl r2=init_thread_union
cmp.eq isBP,isAP=r0,r0 cmp.eq isBP,isAP=r0,r0
#endif #endif
;;
extr r3=r2,0,61 // r3 == phys addr of task struct
mov r16=KERNEL_TR_PAGE_NUM mov r16=KERNEL_TR_PAGE_NUM
;; ;;
// load the "current" pointer (r13) and ar.k6 with the current task // load the "current" pointer (r13) and ar.k6 with the current task
mov r13=r2 mov IA64_KR(CURRENT)=r2 // virtual address
mov IA64_KR(CURRENT)=r3 // Physical address
// initialize k4 to a safe value (64-128MB is mapped by TR_KERNEL) // initialize k4 to a safe value (64-128MB is mapped by TR_KERNEL)
mov IA64_KR(CURRENT_STACK)=r16 mov IA64_KR(CURRENT_STACK)=r16
mov r13=r2
/* /*
* Reserve space at the top of the stack for "struct pt_regs". Kernel threads * Reserve space at the top of the stack for "struct pt_regs". Kernel threads
* don't store interesting values in that structure, but the space still needs * don't store interesting values in that structure, but the space still needs
......
...@@ -142,4 +142,8 @@ EXPORT_SYMBOL(efi_dir); ...@@ -142,4 +142,8 @@ EXPORT_SYMBOL(efi_dir);
EXPORT_SYMBOL(ia64_mv); EXPORT_SYMBOL(ia64_mv);
#endif #endif
EXPORT_SYMBOL(machvec_noop); EXPORT_SYMBOL(machvec_noop);
#ifdef CONFIG_PERFMON
#include <asm/perfmon.h>
EXPORT_SYMBOL(pfm_install_alternate_syswide_subsystem);
EXPORT_SYMBOL(pfm_remove_alternate_syswide_subsystem);
#endif
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 1999 Intel Corp. * Copyright (C) 1999 Intel Corp.
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
* Copyright (C) 2000-2002 J.I. Lee <jung-ik.lee@intel.com> * Copyright (C) 2000-2002 J.I. Lee <jung-ik.lee@intel.com>
* Copyright (C) 1999-2000, 2002 Hewlett-Packard Co. * Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co.
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999,2000 Walt Drummond <drummond@valinux.com>
...@@ -433,7 +433,7 @@ iosapic_reassign_vector (int vector) ...@@ -433,7 +433,7 @@ iosapic_reassign_vector (int vector)
|| iosapic_intr_info[vector].polarity || iosapic_intr_info[vector].trigger) || iosapic_intr_info[vector].polarity || iosapic_intr_info[vector].trigger)
{ {
new_vector = ia64_alloc_vector(); new_vector = ia64_alloc_vector();
printk("Reassigning vector %d to %d\n", vector, new_vector); printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector);
memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector], memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector],
sizeof(struct iosapic_intr_info)); sizeof(struct iosapic_intr_info));
memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info)); memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info));
...@@ -468,17 +468,17 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, ...@@ -468,17 +468,17 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
#else #else
if (iosapic_address) { if (iosapic_address) {
if (iosapic_intr_info[vector].addr && (iosapic_intr_info[vector].addr != iosapic_address)) if (iosapic_intr_info[vector].addr && (iosapic_intr_info[vector].addr != iosapic_address))
printk("WARN: register_intr: diff IOSAPIC ADDRESS for GSI 0x%x, vector %d\n", printk(KERN_WARNING "warning: register_intr: diff IOSAPIC ADDRESS for "
gsi, vector); "GSI 0x%x, vector %d\n", gsi, vector);
iosapic_intr_info[vector].addr = iosapic_address; iosapic_intr_info[vector].addr = iosapic_address;
if (iosapic_intr_info[vector].gsi_base && (iosapic_intr_info[vector].gsi_base != gsi_base)) { if (iosapic_intr_info[vector].gsi_base && (iosapic_intr_info[vector].gsi_base != gsi_base)) {
printk("WARN: register_intr: diff GSI base 0x%x for GSI 0x%x, vector %d\n", printk(KERN_WARNING "warning: register_intr: diff GSI base 0x%x for "
gsi_base, gsi, vector); "GSI 0x%x, vector %d\n", gsi_base, gsi, vector);
} }
iosapic_intr_info[vector].gsi_base = gsi_base; iosapic_intr_info[vector].gsi_base = gsi_base;
} else if (!iosapic_intr_info[vector].addr) } else if (!iosapic_intr_info[vector].addr)
printk("WARN: register_intr: invalid override for GSI 0x%x, vector %d\n", printk(KERN_WARNING "warning: register_intr: invalid override for GSI 0x%x, "
gsi, vector); "vector %d\n", gsi, vector);
#endif #endif
if (edge_triggered) { if (edge_triggered) {
iosapic_intr_info[vector].trigger = IOSAPIC_EDGE; iosapic_intr_info[vector].trigger = IOSAPIC_EDGE;
...@@ -491,9 +491,8 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery, ...@@ -491,9 +491,8 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
idesc = irq_desc(vector); idesc = irq_desc(vector);
if (idesc->handler != irq_type) { if (idesc->handler != irq_type) {
if (idesc->handler != &no_irq_type) if (idesc->handler != &no_irq_type)
printk("%s: changing vector %d from %s to %s\n", printk(KERN_WARNING "%s: changing vector %d from %s to %s\n",
__FUNCTION__, vector, idesc->handler->typename, __FUNCTION__, vector, idesc->handler->typename, irq_type->typename);
irq_type->typename);
idesc->handler = irq_type; idesc->handler = irq_type;
} }
} }
...@@ -518,7 +517,7 @@ iosapic_register_intr (unsigned int gsi, ...@@ -518,7 +517,7 @@ iosapic_register_intr (unsigned int gsi,
register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
polarity, edge_triggered, gsi_base, iosapic_address); polarity, edge_triggered, gsi_base, iosapic_address);
printk("GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", printk(KERN_INFO "GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
gsi, (polarity ? "high" : "low"), gsi, (polarity ? "high" : "low"),
(edge_triggered ? "edge" : "level"), dest, vector); (edge_triggered ? "edge" : "level"), dest, vector);
...@@ -560,14 +559,14 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi, ...@@ -560,14 +559,14 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
delivery = IOSAPIC_LOWEST_PRIORITY; delivery = IOSAPIC_LOWEST_PRIORITY;
break; break;
default: default:
printk("iosapic_register_platform_irq(): invalid int type\n"); printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type\n");
return -1; return -1;
} }
register_intr(gsi, vector, delivery, polarity, register_intr(gsi, vector, delivery, polarity,
edge_triggered, gsi_base, iosapic_address); edge_triggered, gsi_base, iosapic_address);
printk("PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n", printk(KERN_INFO "PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
int_type, gsi, (polarity ? "high" : "low"), int_type, gsi, (polarity ? "high" : "low"),
(edge_triggered ? "edge" : "level"), dest, vector); (edge_triggered ? "edge" : "level"), dest, vector);
...@@ -594,7 +593,7 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, ...@@ -594,7 +593,7 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
index = find_iosapic(gsi); index = find_iosapic(gsi);
if (index < 0) { if (index < 0) {
printk("ISA: No corresponding IOSAPIC found : ISA IRQ %u -> GSI 0x%x\n", printk(KERN_ERR "ISA: No corresponding IOSAPIC found : ISA IRQ %u -> GSI 0x%x\n",
isa_irq, gsi); isa_irq, gsi);
return; return;
} }
...@@ -634,7 +633,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat) ...@@ -634,7 +633,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
* Disable the compatibility mode interrupts (8259 style), needs IN/OUT support * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
* enabled. * enabled.
*/ */
printk("%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__); printk(KERN_INFO "%s: Disabling PC-AT compatible 8259 interrupts\n", __FUNCTION__);
outb(0xff, 0xA1); outb(0xff, 0xA1);
outb(0xff, 0x21); outb(0xff, 0x21);
} }
...@@ -655,7 +654,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat) ...@@ -655,7 +654,7 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
iosapic_lists[num_iosapic].num_rte = num_rte; iosapic_lists[num_iosapic].num_rte = num_rte;
num_iosapic++; num_iosapic++;
printk(KERN_INFO" IOSAPIC v%x.%x, address 0x%lx, GSIs 0x%x-0x%x\n", printk(KERN_INFO " IOSAPIC v%x.%x, address 0x%lx, GSIs 0x%x-0x%x\n",
(ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, gsi_base, gsi_base + num_rte - 1); (ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, gsi_base, gsi_base + num_rte - 1);
if ((gsi_base == 0) && pcat_compat) { if ((gsi_base == 0) && pcat_compat) {
...@@ -692,7 +691,7 @@ fixup_vector (int vector, unsigned int gsi, const char *pci_id) ...@@ -692,7 +691,7 @@ fixup_vector (int vector, unsigned int gsi, const char *pci_id)
idesc = irq_desc(vector); idesc = irq_desc(vector);
if (idesc->handler != irq_type) { if (idesc->handler != irq_type) {
if (idesc->handler != &no_irq_type) if (idesc->handler != &no_irq_type)
printk("IOSAPIC: changing vector %d from %s to %s\n", printk(KERN_INFO "IOSAPIC: changing vector %d from %s to %s\n",
vector, idesc->handler->typename, irq_type->typename); vector, idesc->handler->typename, irq_type->typename);
idesc->handler = irq_type; idesc->handler = irq_type;
} }
...@@ -723,7 +722,8 @@ fixup_vector (int vector, unsigned int gsi, const char *pci_id) ...@@ -723,7 +722,8 @@ fixup_vector (int vector, unsigned int gsi, const char *pci_id)
#endif #endif
set_rte(vector, dest); set_rte(vector, dest);
printk("IOSAPIC: %s -> GSI 0x%x -> CPU 0x%04x vector %d\n", pci_id, gsi, dest, vector); printk(KERN_INFO "IOSAPIC: %s -> GSI 0x%x -> CPU 0x%04x vector %d\n",
pci_id, gsi, dest, vector);
} }
void __init void __init
...@@ -751,8 +751,8 @@ iosapic_parse_prt (void) ...@@ -751,8 +751,8 @@ iosapic_parse_prt (void)
index = find_iosapic(gsi); index = find_iosapic(gsi);
if (index < 0) { if (index < 0) {
printk(KERN_WARNING"IOSAPIC: GSI 0x%x has no IOSAPIC!\n", gsi); printk(KERN_WARNING "IOSAPIC: GSI 0x%x has no IOSAPIC!\n", gsi);
return; continue;
} }
addr = iosapic_lists[index].addr; addr = iosapic_lists[index].addr;
gsi_base = iosapic_lists[index].gsi_base; gsi_base = iosapic_lists[index].gsi_base;
......
...@@ -108,7 +108,7 @@ static void ack_none(unsigned int irq) ...@@ -108,7 +108,7 @@ static void ack_none(unsigned int irq)
* a generic callback i think. * a generic callback i think.
*/ */
#if CONFIG_X86 #if CONFIG_X86
printk("unexpected IRQ trap at vector %02x\n", irq); printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq);
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
/* /*
* Currently unexpected vectors happen only on SMP and APIC. * Currently unexpected vectors happen only on SMP and APIC.
...@@ -122,7 +122,7 @@ static void ack_none(unsigned int irq) ...@@ -122,7 +122,7 @@ static void ack_none(unsigned int irq)
#endif #endif
#endif #endif
#if CONFIG_IA64 #if CONFIG_IA64
printk("Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id());
#endif #endif
} }
...@@ -317,7 +317,7 @@ void enable_irq(unsigned int irq) ...@@ -317,7 +317,7 @@ void enable_irq(unsigned int irq)
desc->depth--; desc->depth--;
break; break;
case 0: case 0:
printk("enable_irq(%u) unbalanced from %p\n", printk(KERN_ERR "enable_irq(%u) unbalanced from %p\n",
irq, (void *) __builtin_return_address(0)); irq, (void *) __builtin_return_address(0));
} }
spin_unlock_irqrestore(&desc->lock, flags); spin_unlock_irqrestore(&desc->lock, flags);
...@@ -466,7 +466,7 @@ int request_irq(unsigned int irq, ...@@ -466,7 +466,7 @@ int request_irq(unsigned int irq,
*/ */
if (irqflags & SA_SHIRQ) { if (irqflags & SA_SHIRQ) {
if (!dev_id) if (!dev_id)
printk("Bad boy: %s called us without a dev_id!\n", devname); printk(KERN_ERR "Bad boy: %s called us without a dev_id!\n", devname);
} }
#endif #endif
...@@ -547,7 +547,7 @@ void free_irq(unsigned int irq, void *dev_id) ...@@ -547,7 +547,7 @@ void free_irq(unsigned int irq, void *dev_id)
kfree(action); kfree(action);
return; return;
} }
printk("Trying to free free IRQ%d\n",irq); printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
spin_unlock_irqrestore(&desc->lock,flags); spin_unlock_irqrestore(&desc->lock,flags);
return; return;
} }
......
...@@ -178,7 +178,7 @@ init_IRQ (void) ...@@ -178,7 +178,7 @@ init_IRQ (void)
register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction); register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
#endif #endif
#ifdef CONFIG_PERFMON #ifdef CONFIG_PERFMON
perfmon_init_percpu(); pfm_init_percpu();
#endif #endif
platform_irq_init(); platform_irq_init();
} }
......
This diff is collapsed.
...@@ -47,7 +47,7 @@ machvec_init (const char *name) ...@@ -47,7 +47,7 @@ machvec_init (const char *name)
panic("generic kernel failed to find machine vector for platform %s!", name); panic("generic kernel failed to find machine vector for platform %s!", name);
} }
ia64_mv = *mv; ia64_mv = *mv;
printk("booting generic kernel on platform %s\n", name); printk(KERN_INFO "booting generic kernel on platform %s\n", name);
} }
#endif /* CONFIG_IA64_GENERIC */ #endif /* CONFIG_IA64_GENERIC */
......
...@@ -231,7 +231,7 @@ ia64_mca_register_cpev (int cpev) ...@@ -231,7 +231,7 @@ ia64_mca_register_cpev (int cpev)
{ {
/* Register the CPE interrupt vector with SAL */ /* Register the CPE interrupt vector with SAL */
if (ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0)) { if (ia64_sal_mc_set_params(SAL_MC_PARAM_CPE_INT, SAL_MC_PARAM_MECHANISM_INT, cpev, 0, 0)) {
printk("ia64_mca_platform_init: failed to register Corrected " printk(KERN_ERR "ia64_mca_platform_init: failed to register Corrected "
"Platform Error interrupt vector with SAL.\n"); "Platform Error interrupt vector with SAL.\n");
return; return;
} }
...@@ -398,7 +398,7 @@ ia64_mca_init(void) ...@@ -398,7 +398,7 @@ ia64_mca_init(void)
IA64_MCA_RENDEZ_TIMEOUT, IA64_MCA_RENDEZ_TIMEOUT,
0))) 0)))
{ {
printk("ia64_mca_init: Failed to register rendezvous interrupt " printk(KERN_ERR "ia64_mca_init: Failed to register rendezvous interrupt "
"with SAL. rc = %ld\n", rc); "with SAL. rc = %ld\n", rc);
return; return;
} }
...@@ -409,8 +409,8 @@ ia64_mca_init(void) ...@@ -409,8 +409,8 @@ ia64_mca_init(void)
IA64_MCA_WAKEUP_VECTOR, IA64_MCA_WAKEUP_VECTOR,
0, 0))) 0, 0)))
{ {
printk("ia64_mca_init: Failed to register wakeup interrupt with SAL. rc = %ld\n", printk(KERN_ERR "ia64_mca_init: Failed to register wakeup interrupt with SAL. "
rc); "rc = %ld\n", rc);
return; return;
} }
...@@ -430,8 +430,8 @@ ia64_mca_init(void) ...@@ -430,8 +430,8 @@ ia64_mca_init(void)
ia64_mc_info.imi_mca_handler_size, ia64_mc_info.imi_mca_handler_size,
0, 0, 0))) 0, 0, 0)))
{ {
printk("ia64_mca_init: Failed to register os mca handler with SAL. rc = %ld\n", printk(KERN_ERR "ia64_mca_init: Failed to register os mca handler with SAL. "
rc); "rc = %ld\n", rc);
return; return;
} }
...@@ -459,8 +459,8 @@ ia64_mca_init(void) ...@@ -459,8 +459,8 @@ ia64_mca_init(void)
__pa(ia64_get_gp()), __pa(ia64_get_gp()),
ia64_mc_info.imi_slave_init_handler_size))) ia64_mc_info.imi_slave_init_handler_size)))
{ {
printk("ia64_mca_init: Failed to register m/s init handlers with SAL. rc = %ld\n", printk(KERN_ERR "ia64_mca_init: Failed to register m/s init handlers with SAL. "
rc); "rc = %ld\n", rc);
return; return;
} }
...@@ -495,7 +495,8 @@ ia64_mca_init(void) ...@@ -495,7 +495,8 @@ ia64_mca_init(void)
} }
ia64_mca_register_cpev(cpev); ia64_mca_register_cpev(cpev);
} else } else
printk("ia64_mca_init: Failed to get routed CPEI vector from ACPI.\n"); printk(KERN_ERR
"ia64_mca_init: Failed to get routed CPEI vector from ACPI.\n");
} }
/* Initialize the areas set aside by the OS to buffer the /* Initialize the areas set aside by the OS to buffer the
...@@ -511,7 +512,7 @@ ia64_mca_init(void) ...@@ -511,7 +512,7 @@ ia64_mca_init(void)
mca_test(); mca_test();
#endif /* #if defined(MCA_TEST) */ #endif /* #if defined(MCA_TEST) */
printk("Mca related initialization done\n"); printk(KERN_INFO "Mca related initialization done\n");
/* commented out because this is done elsewhere */ /* commented out because this is done elsewhere */
#if 0 #if 0
...@@ -807,7 +808,7 @@ ia64_init_handler (struct pt_regs *regs) ...@@ -807,7 +808,7 @@ ia64_init_handler (struct pt_regs *regs)
sal_log_processor_info_t *proc_ptr; sal_log_processor_info_t *proc_ptr;
ia64_err_rec_t *plog_ptr; ia64_err_rec_t *plog_ptr;
printk("Entered OS INIT handler\n"); printk(KERN_INFO "Entered OS INIT handler\n");
/* Get the INIT processor log */ /* Get the INIT processor log */
if (!ia64_log_get(SAL_INFO_TYPE_INIT, (prfunc_t)printk)) if (!ia64_log_get(SAL_INFO_TYPE_INIT, (prfunc_t)printk))
...@@ -1736,8 +1737,7 @@ ia64_log_processor_info_print(sal_log_record_header_t *lh, prfunc_t prfunc) ...@@ -1736,8 +1737,7 @@ ia64_log_processor_info_print(sal_log_record_header_t *lh, prfunc_t prfunc)
/* /*
* Now process processor device error record section * Now process processor device error record section
*/ */
ia64_log_proc_dev_err_info_print((sal_log_processor_info_t *)slsh, ia64_log_proc_dev_err_info_print((sal_log_processor_info_t *)slsh, printk);
printk);
} }
IA64_MCA_DEBUG("ia64_mca_log_print: " IA64_MCA_DEBUG("ia64_mca_log_print: "
......
...@@ -30,25 +30,23 @@ ...@@ -30,25 +30,23 @@
* on interrupts. * on interrupts.
*/ */
#define MINSTATE_START_SAVE_MIN_VIRT \ #define MINSTATE_START_SAVE_MIN_VIRT \
(pUser) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ (pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \
dep r1=-1,r1,61,3; /* r1 = current (virtual) */ \
;; \ ;; \
(pUser) mov.m rARRNAT=ar.rnat; \ (pUStk) mov.m rARRNAT=ar.rnat; \
(pUser) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of RBS */ \ (pUStk) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of RBS */ \
(pKern) mov r1=sp; /* get sp */ \ (pKStk) mov r1=sp; /* get sp */ \
;; \ ;; \
(pUser) lfetch.fault.excl.nt1 [rKRBS]; \ (pUStk) lfetch.fault.excl.nt1 [rKRBS]; \
(pUser) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ (pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \
(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ (pUStk) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \
;; \ ;; \
(pUser) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ (pUStk) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \
(pKern) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ (pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \
;; \ ;; \
(pUser) mov r18=ar.bsp; \ (pUStk) mov r18=ar.bsp; \
(pUser) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ (pUStk) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \
#define MINSTATE_END_SAVE_MIN_VIRT \ #define MINSTATE_END_SAVE_MIN_VIRT \
or r13=r13,r14; /* make `current' a kernel virtual address */ \
bsw.1; /* switch back to bank 1 (must be last in insn group) */ \ bsw.1; /* switch back to bank 1 (must be last in insn group) */ \
;; ;;
...@@ -57,21 +55,21 @@ ...@@ -57,21 +55,21 @@
* go virtual and dont want to destroy the iip or ipsr. * go virtual and dont want to destroy the iip or ipsr.
*/ */
#define MINSTATE_START_SAVE_MIN_PHYS \ #define MINSTATE_START_SAVE_MIN_PHYS \
(pKern) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \ (pKStk) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \
(pUser) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ (pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \
(pUser) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ (pUStk) addl rKRBS=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \
;; \ ;; \
(pUser) mov rARRNAT=ar.rnat; \ (pUStk) mov rARRNAT=ar.rnat; \
(pKern) dep r1=0,sp,61,3; /* compute physical addr of sp */ \ (pKStk) dep r1=0,sp,61,3; /* compute physical addr of sp */ \
(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ (pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1; /* compute base of memory stack */ \
(pUser) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \ (pUStk) mov rARBSPSTORE=ar.bspstore; /* save ar.bspstore */ \
(pUser) dep rKRBS=-1,rKRBS,61,3; /* compute kernel virtual addr of RBS */\ (pUStk) dep rKRBS=-1,rKRBS,61,3; /* compute kernel virtual addr of RBS */\
;; \ ;; \
(pKern) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ (pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \
(pUser) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \ (pUStk) mov ar.bspstore=rKRBS; /* switch to kernel RBS */ \
;; \ ;; \
(pUser) mov r18=ar.bsp; \ (pUStk) mov r18=ar.bsp; \
(pUser) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \ (pUStk) mov ar.rsc=0x3; /* set eager mode, pl 0, little-endian, loadrs=0 */ \
#define MINSTATE_END_SAVE_MIN_PHYS \ #define MINSTATE_END_SAVE_MIN_PHYS \
or r12=r12,r14; /* make sp a kernel virtual address */ \ or r12=r12,r14; /* make sp a kernel virtual address */ \
...@@ -79,11 +77,13 @@ ...@@ -79,11 +77,13 @@
;; ;;
#ifdef MINSTATE_VIRT #ifdef MINSTATE_VIRT
# define MINSTATE_GET_CURRENT(reg) mov reg=IA64_KR(CURRENT)
# define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_VIRT # define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_VIRT
# define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_VIRT # define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_VIRT
#endif #endif
#ifdef MINSTATE_PHYS #ifdef MINSTATE_PHYS
# define MINSTATE_GET_CURRENT(reg) mov reg=IA64_KR(CURRENT);; dep reg=0,reg,61,3
# define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_PHYS # define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_PHYS
# define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_PHYS # define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_PHYS
#endif #endif
...@@ -110,23 +110,26 @@ ...@@ -110,23 +110,26 @@
* we can pass interruption state as arguments to a handler. * we can pass interruption state as arguments to a handler.
*/ */
#define DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA) \ #define DO_SAVE_MIN(COVER,SAVE_IFS,EXTRA) \
mov rARRSC=ar.rsc; \ mov rARRSC=ar.rsc; /* M */ \
mov rARPFS=ar.pfs; \ mov rARUNAT=ar.unat; /* M */ \
mov rR1=r1; \ mov rR1=r1; /* A */ \
mov rARUNAT=ar.unat; \ MINSTATE_GET_CURRENT(r1); /* M (or M;;I) */ \
mov rCRIPSR=cr.ipsr; \ mov rCRIPSR=cr.ipsr; /* M */ \
mov rB6=b6; /* rB6 = branch reg 6 */ \ mov rARPFS=ar.pfs; /* I */ \
mov rCRIIP=cr.iip; \ mov rCRIIP=cr.iip; /* M */ \
mov r1=IA64_KR(CURRENT); /* r1 = current (physical) */ \ mov rB6=b6; /* I */ /* rB6 = branch reg 6 */ \
COVER; \ COVER; /* B;; (or nothing) */ \
;; \ ;; \
invala; \ adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r1; \
extr.u r16=rCRIPSR,32,2; /* extract psr.cpl */ \ ;; \
;; \ ld1 r17=[r16]; /* load current->thread.on_ustack flag */ \
cmp.eq pKern,pUser=r0,r16; /* are we in kernel mode already? (psr.cpl==0) */ \ st1 [r16]=r0; /* clear current->thread.on_ustack flag */ \
/* switch from user to kernel RBS: */ \ /* switch from user to kernel RBS: */ \
;; \ ;; \
invala; /* M */ \
SAVE_IFS; \ SAVE_IFS; \
cmp.eq pKStk,pUStk=r0,r17; /* are we in kernel mode already? (psr.cpl==0) */ \
;; \
MINSTATE_START_SAVE_MIN \ MINSTATE_START_SAVE_MIN \
add r17=L1_CACHE_BYTES,r1 /* really: biggest cache-line size */ \ add r17=L1_CACHE_BYTES,r1 /* really: biggest cache-line size */ \
;; \ ;; \
...@@ -138,23 +141,23 @@ ...@@ -138,23 +141,23 @@
;; \ ;; \
lfetch.fault.excl.nt1 [r17]; \ lfetch.fault.excl.nt1 [r17]; \
adds r17=8,r1; /* initialize second base pointer */ \ adds r17=8,r1; /* initialize second base pointer */ \
(pKern) mov r18=r0; /* make sure r18 isn't NaT */ \ (pKStk) mov r18=r0; /* make sure r18 isn't NaT */ \
;; \ ;; \
st8 [r17]=rCRIIP,16; /* save cr.iip */ \ st8 [r17]=rCRIIP,16; /* save cr.iip */ \
st8 [r16]=rCRIFS,16; /* save cr.ifs */ \ st8 [r16]=rCRIFS,16; /* save cr.ifs */ \
(pUser) sub r18=r18,rKRBS; /* r18=RSE.ndirty*8 */ \ (pUStk) sub r18=r18,rKRBS; /* r18=RSE.ndirty*8 */ \
;; \ ;; \
st8 [r17]=rARUNAT,16; /* save ar.unat */ \ st8 [r17]=rARUNAT,16; /* save ar.unat */ \
st8 [r16]=rARPFS,16; /* save ar.pfs */ \ st8 [r16]=rARPFS,16; /* save ar.pfs */ \
shl r18=r18,16; /* compute ar.rsc to be used for "loadrs" */ \ shl r18=r18,16; /* compute ar.rsc to be used for "loadrs" */ \
;; \ ;; \
st8 [r17]=rARRSC,16; /* save ar.rsc */ \ st8 [r17]=rARRSC,16; /* save ar.rsc */ \
(pUser) st8 [r16]=rARRNAT,16; /* save ar.rnat */ \ (pUStk) st8 [r16]=rARRNAT,16; /* save ar.rnat */ \
(pKern) adds r16=16,r16; /* skip over ar_rnat field */ \ (pKStk) adds r16=16,r16; /* skip over ar_rnat field */ \
;; /* avoid RAW on r16 & r17 */ \ ;; /* avoid RAW on r16 & r17 */ \
(pUser) st8 [r17]=rARBSPSTORE,16; /* save ar.bspstore */ \ (pUStk) st8 [r17]=rARBSPSTORE,16; /* save ar.bspstore */ \
st8 [r16]=rARPR,16; /* save predicates */ \ st8 [r16]=rARPR,16; /* save predicates */ \
(pKern) adds r17=16,r17; /* skip over ar_bspstore field */ \ (pKStk) adds r17=16,r17; /* skip over ar_bspstore field */ \
;; \ ;; \
st8 [r17]=rB6,16; /* save b6 */ \ st8 [r17]=rB6,16; /* save b6 */ \
st8 [r16]=r18,16; /* save ar.rsc value for "loadrs" */ \ st8 [r16]=r18,16; /* save ar.rsc value for "loadrs" */ \
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com> * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 1999-2001 Hewlett-Packard Co * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co
* David Mosberger <davidm@hpl.hp.com> * David Mosberger <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
...@@ -114,7 +114,7 @@ GLOBAL_ENTRY(ia64_pal_call_stacked) ...@@ -114,7 +114,7 @@ GLOBAL_ENTRY(ia64_pal_call_stacked)
;; ;;
rsm psr.i rsm psr.i
mov b7 = loc2 mov b7 = loc2
;; ;;
br.call.sptk.many rp=b7 // now make the call br.call.sptk.many rp=b7 // now make the call
.ret0: mov psr.l = loc3 .ret0: mov psr.l = loc3
mov ar.pfs = loc1 mov ar.pfs = loc1
...@@ -131,15 +131,15 @@ END(ia64_pal_call_stacked) ...@@ -131,15 +131,15 @@ END(ia64_pal_call_stacked)
* in0 Index of PAL service * in0 Index of PAL service
* in2 - in3 Remaning PAL arguments * in2 - in3 Remaning PAL arguments
* *
* PSR_DB, PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel. * PSR_LP, PSR_TB, PSR_ID, PSR_DA are never set by the kernel.
* So we don't need to clear them. * So we don't need to clear them.
*/ */
#define PAL_PSR_BITS_TO_CLEAR \ #define PAL_PSR_BITS_TO_CLEAR \
(IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_RT | \ (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_DB | IA64_PSR_RT | \
IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \ IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \
IA64_PSR_DFL | IA64_PSR_DFH) IA64_PSR_DFL | IA64_PSR_DFH)
#define PAL_PSR_BITS_TO_SET \ #define PAL_PSR_BITS_TO_SET \
(IA64_PSR_BN) (IA64_PSR_BN)
...@@ -161,7 +161,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static) ...@@ -161,7 +161,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
;; ;;
mov loc3 = psr // save psr mov loc3 = psr // save psr
adds r8 = 1f-1b,r8 // calculate return address for call adds r8 = 1f-1b,r8 // calculate return address for call
;; ;;
mov loc4=ar.rsc // save RSE configuration mov loc4=ar.rsc // save RSE configuration
dep.z loc2=loc2,0,61 // convert pal entry point to physical dep.z loc2=loc2,0,61 // convert pal entry point to physical
dep.z r8=r8,0,61 // convert rp to physical dep.z r8=r8,0,61 // convert rp to physical
...@@ -275,7 +275,6 @@ END(ia64_save_scratch_fpregs) ...@@ -275,7 +275,6 @@ END(ia64_save_scratch_fpregs)
* Inputs: * Inputs:
* in0 Address of stack storage for fp regs * in0 Address of stack storage for fp regs
*/ */
GLOBAL_ENTRY(ia64_load_scratch_fpregs) GLOBAL_ENTRY(ia64_load_scratch_fpregs)
alloc r3=ar.pfs,1,0,0,0 alloc r3=ar.pfs,1,0,0,0
add r2=16,in0 add r2=16,in0
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Intel IA-64 Architecture Software Developer's Manual v1.0. * Intel IA-64 Architecture Software Developer's Manual v1.0.
* *
* *
* Copyright (C) 2000-2001 Hewlett-Packard Co * Copyright (C) 2000-2001, 2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
* 05/26/2000 S.Eranian initial release * 05/26/2000 S.Eranian initial release
...@@ -225,15 +225,12 @@ cache_info(char *page) ...@@ -225,15 +225,12 @@ cache_info(char *page)
int i,j, k; int i,j, k;
s64 status; s64 status;
if ((status=ia64_pal_cache_summary(&levels, &unique_caches)) != 0) { if ((status = ia64_pal_cache_summary(&levels, &unique_caches)) != 0) {
printk("ia64_pal_cache_summary=%ld\n", status); printk(KERN_ERR "ia64_pal_cache_summary=%ld\n", status);
return 0; return 0;
} }
p += sprintf(p, "Cache levels : %ld\n" \ p += sprintf(p, "Cache levels : %ld\nUnique caches : %ld\n\n", levels, unique_caches);
"Unique caches : %ld\n\n",
levels,
unique_caches);
for (i=0; i < levels; i++) { for (i=0; i < levels; i++) {
...@@ -308,8 +305,8 @@ vm_info(char *page) ...@@ -308,8 +305,8 @@ vm_info(char *page)
int i, j; int i, j;
s64 status; s64 status;
if ((status=ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) {
printk("ia64_pal_vm_summary=%ld\n", status); printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status);
return 0; return 0;
} }
...@@ -339,8 +336,8 @@ vm_info(char *page) ...@@ -339,8 +336,8 @@ vm_info(char *page)
} }
p += sprintf(p, "\n"); p += sprintf(p, "\n");
if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) { if ((status = ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
printk("ia64_pal_vm_page_size=%ld\n", status); printk(KERN_ERR "ia64_pal_vm_page_size=%ld\n", status);
return 0; return 0;
} }
...@@ -360,7 +357,7 @@ vm_info(char *page) ...@@ -360,7 +357,7 @@ vm_info(char *page)
p = bitvector_process(p, vw_pages); p = bitvector_process(p, vw_pages);
if ((status=ia64_get_ptce(&ptce)) != 0) { if ((status=ia64_get_ptce(&ptce)) != 0) {
printk("ia64_get_ptce=%ld\n",status); printk(KERN_ERR "ia64_get_ptce=%ld\n", status);
return 0; return 0;
} }
...@@ -710,8 +707,8 @@ tr_info(char *page) ...@@ -710,8 +707,8 @@ tr_info(char *page)
u64 rv2:32; u64 rv2:32;
} *rid_reg; } *rid_reg;
if ((status=ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) { if ((status = ia64_pal_vm_summary(&vm_info_1, &vm_info_2)) !=0) {
printk("ia64_pal_vm_summary=%ld\n", status); printk(KERN_ERR "ia64_pal_vm_summary=%ld\n", status);
return 0; return 0;
} }
max[0] = vm_info_1.pal_vm_info_1_s.max_itr_entry+1; max[0] = vm_info_1.pal_vm_info_1_s.max_itr_entry+1;
...@@ -722,7 +719,8 @@ tr_info(char *page) ...@@ -722,7 +719,8 @@ tr_info(char *page)
status = ia64_pal_tr_read(j, i, tr_buffer, &tr_valid); status = ia64_pal_tr_read(j, i, tr_buffer, &tr_valid);
if (status != 0) { if (status != 0) {
printk("palinfo: pal call failed on tr[%d:%d]=%ld\n", i, j, status); printk(KERN_ERR "palinfo: pal call failed on tr[%d:%d]=%ld\n",
i, j, status);
continue; continue;
} }
...@@ -841,7 +839,7 @@ palinfo_smp_call(void *info) ...@@ -841,7 +839,7 @@ palinfo_smp_call(void *info)
{ {
palinfo_smp_data_t *data = (palinfo_smp_data_t *)info; palinfo_smp_data_t *data = (palinfo_smp_data_t *)info;
if (data == NULL) { if (data == NULL) {
printk("%s palinfo: data pointer is NULL\n", KERN_ERR); printk(KERN_ERR "palinfo: data pointer is NULL\n");
data->ret = 0; /* no output */ data->ret = 0; /* no output */
return; return;
} }
...@@ -868,7 +866,8 @@ int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page) ...@@ -868,7 +866,8 @@ int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page)
/* will send IPI to other CPU and wait for completion of remote call */ /* will send IPI to other CPU and wait for completion of remote call */
if ((ret=smp_call_function_single(f->req_cpu, palinfo_smp_call, &ptr, 0, 1))) { if ((ret=smp_call_function_single(f->req_cpu, palinfo_smp_call, &ptr, 0, 1))) {
printk("palinfo: remote CPU call from %d to %d on function %d: error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret); printk(KERN_ERR "palinfo: remote CPU call from %d to %d on function %d: "
"error %d\n", smp_processor_id(), f->req_cpu, f->func_id, ret);
return 0; return 0;
} }
return ptr.ret; return ptr.ret;
...@@ -877,7 +876,7 @@ int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page) ...@@ -877,7 +876,7 @@ int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page)
static static
int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page) int palinfo_handle_smp(pal_func_cpu_u_t *f, char *page)
{ {
printk("palinfo: should not be called with non SMP kernel\n"); printk(KERN_ERR "palinfo: should not be called with non SMP kernel\n");
return 0; return 0;
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
......
This diff is collapsed.
/*
* This file contains the architected PMU register description tables
* and pmc checker used by perfmon.c.
*
* Copyright (C) 2002 Hewlett Packard Co
* Stephane Eranian <eranian@hpl.hp.com>
*/
#define RDEP(x) (1UL<<(x)) #define RDEP(x) (1UL<<(x))
#if defined(CONFIG_ITANIUM) || defined(CONFIG_MCKINLEY) #if defined(CONFIG_ITANIUM) || defined (CONFIG_MCKINLEY)
#error "This file should only be used when CONFIG_ITANIUM and CONFIG_MCKINLEY are not defined" #error "This file should not be used when CONFIG_ITANIUM or CONFIG_MCKINLEY is defined"
#endif #endif
static pfm_reg_desc_t pmc_desc[PMU_MAX_PMCS]={ static pfm_reg_desc_t pmc_gen_desc[PMU_MAX_PMCS]={
/* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
...@@ -13,10 +20,10 @@ static pfm_reg_desc_t pmc_desc[PMU_MAX_PMCS]={ ...@@ -13,10 +20,10 @@ static pfm_reg_desc_t pmc_desc[PMU_MAX_PMCS]={
/* pmc5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(5),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(6),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {RDEP(7),0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
{ PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
}; };
static pfm_reg_desc_t pmd_desc[PMU_MAX_PMDS]={ static pfm_reg_desc_t pmd_gen_desc[PMU_MAX_PMDS]={
/* pmd0 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* pmd0 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}},
/* pmd1 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* pmd1 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}},
/* pmd2 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* pmd2 */ { PFM_REG_NOTIMPL , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}},
...@@ -25,5 +32,17 @@ static pfm_reg_desc_t pmd_desc[PMU_MAX_PMDS]={ ...@@ -25,5 +32,17 @@ static pfm_reg_desc_t pmd_desc[PMU_MAX_PMDS]={
/* pmd5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}}, /* pmd5 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(5),0UL, 0UL, 0UL}},
/* pmd6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}}, /* pmd6 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(6),0UL, 0UL, 0UL}},
/* pmd7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}}, /* pmd7 */ { PFM_REG_COUNTING, 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {RDEP(7),0UL, 0UL, 0UL}},
{ PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
};
/*
* impl_pmcs, impl_pmds are computed at runtime to minimize errors!
*/
static pmu_config_t pmu_conf={
.disabled = 1,
.ovfl_val = (1UL << 32) - 1,
.num_ibrs = 8,
.num_dbrs = 8,
.pmd_desc = pfm_gen_pmd_desc,
.pmc_desc = pfm_gen_pmc_desc
}; };
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
static int pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); static int pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs);
static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ static pfm_reg_desc_t pfm_ita_pmc_desc[PMU_MAX_PMCS]={
/* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
...@@ -33,7 +33,7 @@ static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ ...@@ -33,7 +33,7 @@ static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={
{ PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
}; };
static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ static pfm_reg_desc_t pfm_ita_pmd_desc[PMU_MAX_PMDS]={
/* pmd0 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd0 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}},
/* pmd1 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd1 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}},
/* pmd2 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, /* pmd2 */ { PFM_REG_BUFFER , 0, 0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}},
...@@ -55,6 +55,19 @@ static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ ...@@ -55,6 +55,19 @@ static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={
{ PFM_REG_END , 0, 0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
}; };
/*
* impl_pmcs, impl_pmds are computed at runtime to minimize errors!
*/
static pmu_config_t pmu_conf={
.disabled = 1,
.ovfl_val = (1UL << 32) - 1,
.num_ibrs = 8,
.num_dbrs = 8,
.pmd_desc = pfm_ita_pmd_desc,
.pmc_desc = pfm_ita_pmc_desc
};
static int static int
pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs) pfm_ita_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs)
{ {
......
...@@ -16,7 +16,7 @@ static int pfm_mck_reserved(struct task_struct *task, unsigned int cnum, unsigne ...@@ -16,7 +16,7 @@ static int pfm_mck_reserved(struct task_struct *task, unsigned int cnum, unsigne
static int pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs); static int pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *val, struct pt_regs *regs);
static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs); static int pfm_write_ibr_dbr(int mode, struct task_struct *task, void *arg, int count, struct pt_regs *regs);
static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ static pfm_reg_desc_t pfm_mck_pmc_desc[PMU_MAX_PMCS]={
/* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc0 */ { PFM_REG_CONTROL , 0, 0x1UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc1 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
/* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}}, /* pmc2 */ { PFM_REG_CONTROL , 0, 0x0UL, -1UL, NULL, NULL, {0UL,0UL, 0UL, 0UL}, {0UL,0UL, 0UL, 0UL}},
...@@ -36,7 +36,7 @@ static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={ ...@@ -36,7 +36,7 @@ static pfm_reg_desc_t pfm_pmc_desc[PMU_MAX_PMCS]={
{ PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
}; };
static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ static pfm_reg_desc_t pfm_mck_pmd_desc[PMU_MAX_PMDS]={
/* pmd0 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd0 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(1),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}},
/* pmd1 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}}, /* pmd1 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(0),0UL, 0UL, 0UL}, {RDEP(10),0UL, 0UL, 0UL}},
/* pmd2 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}}, /* pmd2 */ { PFM_REG_BUFFER , 0, 0x0UL, -1UL, NULL, NULL, {RDEP(3)|RDEP(17),0UL, 0UL, 0UL}, {RDEP(11),0UL, 0UL, 0UL}},
...@@ -58,6 +58,19 @@ static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={ ...@@ -58,6 +58,19 @@ static pfm_reg_desc_t pfm_pmd_desc[PMU_MAX_PMDS]={
{ PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */ { PFM_REG_END , 0, 0x0UL, -1UL, NULL, NULL, {0,}, {0,}}, /* end marker */
}; };
/*
* impl_pmcs, impl_pmds are computed at runtime to minimize errors!
*/
static pmu_config_t pmu_conf={
.disabled = 1,
.ovfl_val = (1UL << 47) - 1,
.num_ibrs = 8,
.num_dbrs = 8,
.pmd_desc = pfm_mck_pmd_desc,
.pmc_desc = pfm_mck_pmc_desc
};
/* /*
* PMC reserved fields must have their power-up values preserved * PMC reserved fields must have their power-up values preserved
*/ */
...@@ -150,12 +163,12 @@ pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *va ...@@ -150,12 +163,12 @@ pfm_mck_pmc_check(struct task_struct *task, unsigned int cnum, unsigned long *va
* i-side events in L1D and L2 caches * i-side events in L1D and L2 caches
*/ */
if (check_case1) { if (check_case1) {
ret = ((val13 >> 45) & 0xf) == 0 ret = ((val13 >> 45) & 0xf) == 0
&& ((val8 & 0x1) == 0) && ((val8 & 0x1) == 0)
&& ((((val14>>1) & 0x3) == 0x2 || ((val14>>1) & 0x3) == 0x0) && ((((val14>>1) & 0x3) == 0x2 || ((val14>>1) & 0x3) == 0x0)
||(((val14>>4) & 0x3) == 0x2 || ((val14>>4) & 0x3) == 0x0)); ||(((val14>>4) & 0x3) == 0x2 || ((val14>>4) & 0x3) == 0x0));
if (ret) printk("perfmon: failure check_case1\n"); if (ret) printk(KERN_DEBUG "perfmon: failure check_case1\n");
} }
return ret ? -EINVAL : 0; return ret ? -EINVAL : 0;
......
/* /*
* Architecture-specific setup. * Architecture-specific setup.
* *
* Copyright (C) 1998-2002 Hewlett-Packard Co * Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
*/ */
#define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */ #define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */
...@@ -96,7 +96,7 @@ show_regs (struct pt_regs *regs) ...@@ -96,7 +96,7 @@ show_regs (struct pt_regs *regs)
{ {
unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri; unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
printk("\nPid: %d, comm: %20s\n", current->pid, current->comm); printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm);
printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n", printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n",
regs->cr_ipsr, regs->cr_ifs, ip, print_tainted()); regs->cr_ipsr, regs->cr_ifs, ip, print_tainted());
print_symbol("ip is at %s\n", ip); print_symbol("ip is at %s\n", ip);
...@@ -144,6 +144,15 @@ show_regs (struct pt_regs *regs) ...@@ -144,6 +144,15 @@ show_regs (struct pt_regs *regs)
void void
do_notify_resume_user (sigset_t *oldset, struct sigscratch *scr, long in_syscall) do_notify_resume_user (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
{ {
#ifdef CONFIG_FSYS
if (fsys_mode(current, &scr->pt)) {
/* defer signal-handling etc. until we return to privilege-level 0. */
if (!ia64_psr(&scr->pt)->lp)
ia64_psr(&scr->pt)->lp = 1;
return;
}
#endif
#ifdef CONFIG_PERFMON #ifdef CONFIG_PERFMON
if (current->thread.pfm_ovfl_block_reset) if (current->thread.pfm_ovfl_block_reset)
pfm_ovfl_block_reset(); pfm_ovfl_block_reset();
...@@ -198,6 +207,10 @@ cpu_idle (void *unused) ...@@ -198,6 +207,10 @@ cpu_idle (void *unused)
void void
ia64_save_extra (struct task_struct *task) ia64_save_extra (struct task_struct *task)
{ {
#ifdef CONFIG_PERFMON
unsigned long info;
#endif
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
ia64_save_debug_regs(&task->thread.dbr[0]); ia64_save_debug_regs(&task->thread.dbr[0]);
...@@ -205,8 +218,9 @@ ia64_save_extra (struct task_struct *task) ...@@ -205,8 +218,9 @@ ia64_save_extra (struct task_struct *task)
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
pfm_save_regs(task); pfm_save_regs(task);
if (__get_cpu_var(pfm_syst_wide)) info = __get_cpu_var(pfm_syst_info);
pfm_syst_wide_update_task(task, 0); if (info & PFM_CPUINFO_SYST_WIDE)
pfm_syst_wide_update_task(task, info, 0);
#endif #endif
#ifdef CONFIG_IA32_SUPPORT #ifdef CONFIG_IA32_SUPPORT
...@@ -218,6 +232,10 @@ ia64_save_extra (struct task_struct *task) ...@@ -218,6 +232,10 @@ ia64_save_extra (struct task_struct *task)
void void
ia64_load_extra (struct task_struct *task) ia64_load_extra (struct task_struct *task)
{ {
#ifdef CONFIG_PERFMON
unsigned long info;
#endif
if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0) if ((task->thread.flags & IA64_THREAD_DBG_VALID) != 0)
ia64_load_debug_regs(&task->thread.dbr[0]); ia64_load_debug_regs(&task->thread.dbr[0]);
...@@ -225,8 +243,9 @@ ia64_load_extra (struct task_struct *task) ...@@ -225,8 +243,9 @@ ia64_load_extra (struct task_struct *task)
if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0) if ((task->thread.flags & IA64_THREAD_PM_VALID) != 0)
pfm_load_regs(task); pfm_load_regs(task);
if (__get_cpu_var(pfm_syst_wide)) info = __get_cpu_var(pfm_syst_info);
pfm_syst_wide_update_task(task, 1); if (info & PFM_CPUINFO_SYST_WIDE)
pfm_syst_wide_update_task(task, info, 1);
#endif #endif
#ifdef CONFIG_IA32_SUPPORT #ifdef CONFIG_IA32_SUPPORT
......
...@@ -833,21 +833,19 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data ...@@ -833,21 +833,19 @@ access_uarea (struct task_struct *child, unsigned long addr, unsigned long *data
return -1; return -1;
} }
#ifdef CONFIG_PERFMON #ifdef CONFIG_PERFMON
/* /*
* Check if debug registers are used * Check if debug registers are used by perfmon. This test must be done
* by perfmon. This test must be done once we know that we can * once we know that we can do the operation, i.e. the arguments are all
* do the operation, i.e. the arguments are all valid, but before * valid, but before we start modifying the state.
* we start modifying the state.
* *
* Perfmon needs to keep a count of how many processes are * Perfmon needs to keep a count of how many processes are trying to
* trying to modify the debug registers for system wide monitoring * modify the debug registers for system wide monitoring sessions.
* sessions.
* *
* We also include read access here, because they may cause * We also include read access here, because they may cause the
* the PMU-installed debug register state (dbr[], ibr[]) to * PMU-installed debug register state (dbr[], ibr[]) to be reset. The two
* be reset. The two arrays are also used by perfmon, but * arrays are also used by perfmon, but we do not use
* we do not use IA64_THREAD_DBG_VALID. The registers are restored * IA64_THREAD_DBG_VALID. The registers are restored by the PMU context
* by the PMU context switch code. * switch code.
*/ */
if (pfm_use_debug_registers(child)) return -1; if (pfm_use_debug_registers(child)) return -1;
#endif #endif
......
/* /*
* System Abstraction Layer (SAL) interface routines. * System Abstraction Layer (SAL) interface routines.
* *
* Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co * Copyright (C) 1998, 1999, 2001, 2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com> * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
...@@ -96,17 +96,17 @@ ia64_sal_init (struct ia64_sal_systab *systab) ...@@ -96,17 +96,17 @@ ia64_sal_init (struct ia64_sal_systab *systab)
int i; int i;
if (!systab) { if (!systab) {
printk("Hmm, no SAL System Table.\n"); printk(KERN_WARNING "Hmm, no SAL System Table.\n");
return; return;
} }
if (strncmp(systab->signature, "SST_", 4) != 0) if (strncmp(systab->signature, "SST_", 4) != 0)
printk("bad signature in system table!"); printk(KERN_ERR "bad signature in system table!");
/* /*
* revisions are coded in BCD, so %x does the job for us * revisions are coded in BCD, so %x does the job for us
*/ */
printk("SAL v%x.%02x: oem=%.32s, product=%.32s\n", printk(KERN_INFO "SAL v%x.%02x: oem=%.32s, product=%.32s\n",
systab->sal_rev_major, systab->sal_rev_minor, systab->sal_rev_major, systab->sal_rev_minor,
systab->oem_id, systab->product_id); systab->oem_id, systab->product_id);
...@@ -121,7 +121,7 @@ ia64_sal_init (struct ia64_sal_systab *systab) ...@@ -121,7 +121,7 @@ ia64_sal_init (struct ia64_sal_systab *systab)
switch (*p) { switch (*p) {
case SAL_DESC_ENTRY_POINT: case SAL_DESC_ENTRY_POINT:
ep = (struct ia64_sal_desc_entry_point *) p; ep = (struct ia64_sal_desc_entry_point *) p;
printk("SAL: entry: pal_proc=0x%lx, sal_proc=0x%lx\n", printk(KERN_INFO "SAL: entry: pal_proc=0x%lx, sal_proc=0x%lx\n",
ep->pal_proc, ep->sal_proc); ep->pal_proc, ep->sal_proc);
ia64_pal_handler_init(__va(ep->pal_proc)); ia64_pal_handler_init(__va(ep->pal_proc));
ia64_sal_handler_init(__va(ep->sal_proc), __va(ep->gp)); ia64_sal_handler_init(__va(ep->sal_proc), __va(ep->gp));
...@@ -139,12 +139,12 @@ ia64_sal_init (struct ia64_sal_systab *systab) ...@@ -139,12 +139,12 @@ ia64_sal_init (struct ia64_sal_systab *systab)
switch (ap->mechanism) { switch (ap->mechanism) {
case IA64_SAL_AP_EXTERNAL_INT: case IA64_SAL_AP_EXTERNAL_INT:
ap_wakeup_vector = ap->vector; ap_wakeup_vector = ap->vector;
printk("SAL: AP wakeup using external interrupt " printk(KERN_INFO "SAL: AP wakeup using external interrupt "
"vector 0x%lx\n", ap_wakeup_vector); "vector 0x%lx\n", ap_wakeup_vector);
break; break;
default: default:
printk("SAL: AP wakeup mechanism unsupported!\n"); printk(KERN_ERR "SAL: AP wakeup mechanism unsupported!\n");
break; break;
} }
break; break;
...@@ -154,7 +154,7 @@ ia64_sal_init (struct ia64_sal_systab *systab) ...@@ -154,7 +154,7 @@ ia64_sal_init (struct ia64_sal_systab *systab)
{ {
struct ia64_sal_desc_platform_feature *pf = (void *) p; struct ia64_sal_desc_platform_feature *pf = (void *) p;
sal_platform_features = pf->feature_mask; sal_platform_features = pf->feature_mask;
printk("SAL: Platform features "); printk(KERN_INFO "SAL: Platform features ");
if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK) if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK)
printk("BusLock "); printk("BusLock ");
......
/* /*
* Architecture-specific setup. * Architecture-specific setup.
* *
* Copyright (C) 1998-2001 Hewlett-Packard Co * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 2000, Rohit Seth <rohit.seth@intel.com> * Copyright (C) 2000, Rohit Seth <rohit.seth@intel.com>
...@@ -171,7 +171,7 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg) ...@@ -171,7 +171,7 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
#if IGNORE_PFN0 #if IGNORE_PFN0
if (start == PAGE_OFFSET) { if (start == PAGE_OFFSET) {
printk("warning: skipping physical page 0\n"); printk(KERN_WARNING "warning: skipping physical page 0\n");
start += PAGE_SIZE; start += PAGE_SIZE;
if (start >= end) return 0; if (start >= end) return 0;
} }
...@@ -341,7 +341,7 @@ find_memory (void) ...@@ -341,7 +341,7 @@ find_memory (void)
initrd_start = (unsigned long)__va(ia64_boot_param->initrd_start); initrd_start = (unsigned long)__va(ia64_boot_param->initrd_start);
initrd_end = initrd_start+ia64_boot_param->initrd_size; initrd_end = initrd_start+ia64_boot_param->initrd_size;
printk("Initial ramdisk at: 0x%lx (%lu bytes)\n", printk(KERN_INFO "Initial ramdisk at: 0x%lx (%lu bytes)\n",
initrd_start, ia64_boot_param->initrd_size); initrd_start, ia64_boot_param->initrd_size);
} }
#endif #endif
...@@ -409,8 +409,9 @@ setup_arch (char **cmdline_p) ...@@ -409,8 +409,9 @@ setup_arch (char **cmdline_p)
ia64_set_kr(IA64_KR_IO_BASE, phys_iobase); ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
else { else {
phys_iobase = ia64_get_kr(IA64_KR_IO_BASE); phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
printk("No I/O port range found in EFI memory map, falling back to AR.KR0\n"); printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
printk("I/O port base = 0x%lx\n", phys_iobase); "to AR.KR0\n");
printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
} }
ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
...@@ -615,7 +616,7 @@ identify_cpu (struct cpuinfo_ia64 *c) ...@@ -615,7 +616,7 @@ identify_cpu (struct cpuinfo_ia64 *c)
impl_va_msb = vm2.pal_vm_info_2_s.impl_va_msb; impl_va_msb = vm2.pal_vm_info_2_s.impl_va_msb;
phys_addr_size = vm1.pal_vm_info_1_s.phys_add_size; phys_addr_size = vm1.pal_vm_info_1_s.phys_add_size;
} }
printk("CPU %d: %lu virtual and %lu physical address bits\n", printk(KERN_INFO "CPU %d: %lu virtual and %lu physical address bits\n",
smp_processor_id(), impl_va_msb + 1, phys_addr_size); smp_processor_id(), impl_va_msb + 1, phys_addr_size);
c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1)); c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1));
c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1)); c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
...@@ -738,7 +739,7 @@ cpu_init (void) ...@@ -738,7 +739,7 @@ cpu_init (void)
if (ia64_pal_vm_summary(NULL, &vmi) == 0) if (ia64_pal_vm_summary(NULL, &vmi) == 0)
max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1; max_ctx = (1U << (vmi.pal_vm_info_2_s.rid_size - 3)) - 1;
else { else {
printk("cpu_init: PAL VM summary failed, assuming 18 RID bits\n"); printk(KERN_WARNING "cpu_init: PAL VM summary failed, assuming 18 RID bits\n");
max_ctx = (1U << 15) - 1; /* use architected minimum */ max_ctx = (1U << 15) - 1; /* use architected minimum */
} }
while (max_ctx < ia64_ctx.max_ctx) { while (max_ctx < ia64_ctx.max_ctx) {
...@@ -748,10 +749,39 @@ cpu_init (void) ...@@ -748,10 +749,39 @@ cpu_init (void)
} }
if (ia64_pal_rse_info(&num_phys_stacked, 0) != 0) { if (ia64_pal_rse_info(&num_phys_stacked, 0) != 0) {
printk ("cpu_init: PAL RSE info failed, assuming 96 physical stacked regs\n"); printk(KERN_WARNING "cpu_init: PAL RSE info failed; assuming 96 physical "
"stacked regs\n");
num_phys_stacked = 96; num_phys_stacked = 96;
} }
/* size of physical stacked register partition plus 8 bytes: */ /* size of physical stacked register partition plus 8 bytes: */
__get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8; __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
platform_cpu_init(); platform_cpu_init();
} }
void
check_bugs (void)
{
extern int __start___mckinley_e9_bundles[];
extern int __end___mckinley_e9_bundles[];
u64 *bundle;
int *wp;
if (local_cpu_data->family == 0x1f && local_cpu_data->model == 0)
printk(KERN_INFO "check_bugs: leaving McKinley Errata 9 workaround enabled\n");
else {
printk(KERN_INFO "check_bugs: McKinley Errata 9 workaround not needed; "
"disabling it\n");
for (wp = __start___mckinley_e9_bundles; wp < __end___mckinley_e9_bundles; ++wp) {
bundle = (u64 *) ((char *) wp + *wp);
/* install a bundle of NOPs: */
bundle[0] = 0x0000000100000000;
bundle[1] = 0x0004000000000200;
ia64_fc(bundle);
}
ia64_insn_group_barrier();
ia64_sync_i();
ia64_insn_group_barrier();
ia64_srlz_i();
ia64_insn_group_barrier();
}
}
/* /*
* SMP boot-related support * SMP boot-related support
* *
* Copyright (C) 1998-2002 Hewlett-Packard Co * Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* *
* 01/05/16 Rohit Seth <rohit.seth@intel.com> Moved SMP booting functions from smp.c to here. * 01/05/16 Rohit Seth <rohit.seth@intel.com> Moved SMP booting functions from smp.c to here.
...@@ -204,7 +204,7 @@ ia64_sync_itc (unsigned int master) ...@@ -204,7 +204,7 @@ ia64_sync_itc (unsigned int master)
go[MASTER] = 1; go[MASTER] = 1;
if (smp_call_function_single(master, sync_master, NULL, 1, 0) < 0) { if (smp_call_function_single(master, sync_master, NULL, 1, 0) < 0) {
printk("sync_itc: failed to get attention of CPU %u!\n", master); printk(KERN_ERR "sync_itc: failed to get attention of CPU %u!\n", master);
return; return;
} }
...@@ -244,8 +244,8 @@ ia64_sync_itc (unsigned int master) ...@@ -244,8 +244,8 @@ ia64_sync_itc (unsigned int master)
t[i].rt, t[i].master, t[i].diff, t[i].lat); t[i].rt, t[i].master, t[i].diff, t[i].lat);
#endif #endif
printk("CPU %d: synchronized ITC with CPU %u (last diff %ld cycles, maxerr %lu cycles)\n", printk(KERN_INFO "CPU %d: synchronized ITC with CPU %u (last diff %ld cycles, "
smp_processor_id(), master, delta, rt); "maxerr %lu cycles)\n", smp_processor_id(), master, delta, rt);
} }
/* /*
...@@ -265,14 +265,15 @@ smp_callin (void) ...@@ -265,14 +265,15 @@ smp_callin (void)
extern void ia64_init_itm(void); extern void ia64_init_itm(void);
#ifdef CONFIG_PERFMON #ifdef CONFIG_PERFMON
extern void perfmon_init_percpu(void); extern void pfm_init_percpu(void);
#endif #endif
cpuid = smp_processor_id(); cpuid = smp_processor_id();
phys_id = hard_smp_processor_id(); phys_id = hard_smp_processor_id();
if (test_and_set_bit(cpuid, &cpu_online_map)) { if (test_and_set_bit(cpuid, &cpu_online_map)) {
printk("huh, phys CPU#0x%x, CPU#0x%x already present??\n", phys_id, cpuid); printk(KERN_ERR "huh, phys CPU#0x%x, CPU#0x%x already present??\n",
phys_id, cpuid);
BUG(); BUG();
} }
...@@ -300,7 +301,7 @@ smp_callin (void) ...@@ -300,7 +301,7 @@ smp_callin (void)
#endif #endif
#ifdef CONFIG_PERFMON #ifdef CONFIG_PERFMON
perfmon_init_percpu(); pfm_init_percpu();
#endif #endif
local_irq_enable(); local_irq_enable();
...@@ -380,9 +381,7 @@ do_boot_cpu (int sapicid, int cpu) ...@@ -380,9 +381,7 @@ do_boot_cpu (int sapicid, int cpu)
if (test_bit(cpu, &cpu_callin_map)) { if (test_bit(cpu, &cpu_callin_map)) {
/* number CPUs logically, starting from 1 (BSP is 0) */ /* number CPUs logically, starting from 1 (BSP is 0) */
printk("CPU%d: ", cpu); printk(KERN_INFO "CPU%d: CPU has booted.\n", cpu);
/*print_cpu_info(&cpu_data[cpu]); */
printk("CPU has booted.\n");
} else { } else {
printk(KERN_ERR "Processor 0x%x/0x%x is stuck.\n", cpu, sapicid); printk(KERN_ERR "Processor 0x%x/0x%x is stuck.\n", cpu, sapicid);
ia64_cpu_to_sapicid[cpu] = -1; ia64_cpu_to_sapicid[cpu] = -1;
...@@ -399,7 +398,7 @@ smp_tune_scheduling (void) ...@@ -399,7 +398,7 @@ smp_tune_scheduling (void)
{ {
cache_decay_ticks = 10; /* XXX base this on PAL info and cache-bandwidth estimate */ cache_decay_ticks = 10; /* XXX base this on PAL info and cache-bandwidth estimate */
printk("task migration cache decay timeout: %ld msecs.\n", printk(KERN_INFO "task migration cache decay timeout: %ld msecs.\n",
(cache_decay_ticks + 1) * 1000 / HZ); (cache_decay_ticks + 1) * 1000 / HZ);
} }
...@@ -491,7 +490,7 @@ smp_prepare_cpus (unsigned int max_cpus) ...@@ -491,7 +490,7 @@ smp_prepare_cpus (unsigned int max_cpus)
local_cpu_data->loops_per_jiffy = loops_per_jiffy; local_cpu_data->loops_per_jiffy = loops_per_jiffy;
ia64_cpu_to_sapicid[0] = boot_cpu_id; ia64_cpu_to_sapicid[0] = boot_cpu_id;
printk("Boot processor id 0x%x/0x%x\n", 0, boot_cpu_id); printk(KERN_INFO "Boot processor id 0x%x/0x%x\n", 0, boot_cpu_id);
current_thread_info()->cpu = 0; current_thread_info()->cpu = 0;
smp_tune_scheduling(); smp_tune_scheduling();
...@@ -526,7 +525,7 @@ smp_cpus_done (unsigned int dummy) ...@@ -526,7 +525,7 @@ smp_cpus_done (unsigned int dummy)
if (cpu_online(cpu)) if (cpu_online(cpu))
bogosum += cpu_data(cpu)->loops_per_jiffy; bogosum += cpu_data(cpu)->loops_per_jiffy;
printk(KERN_INFO"Total of %d processors activated (%lu.%02lu BogoMIPS).\n", printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100); num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
} }
...@@ -571,5 +570,6 @@ init_smp_config(void) ...@@ -571,5 +570,6 @@ init_smp_config(void)
sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ, sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ,
__pa(ap_startup->fp), __pa(ap_startup->gp), 0, 0, 0, 0); __pa(ap_startup->fp), __pa(ap_startup->gp), 0, 0, 0, 0);
if (sal_ret < 0) if (sal_ret < 0)
printk("SMP: Can't set SAL AP Boot Rendezvous: %s\n", ia64_sal_strerror(sal_ret)); printk(KERN_ERR "SMP: Can't set SAL AP Boot Rendezvous: %s\n",
ia64_sal_strerror(sal_ret));
} }
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/highuid.h> #include <linux/highuid.h>
#include <linux/hugetlb.h>
#include <asm/shmparam.h> #include <asm/shmparam.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
unsigned long unsigned long
arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len, arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len,
unsigned long pgoff, unsigned long flags) unsigned long pgoff, unsigned long flags)
...@@ -31,6 +31,20 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len ...@@ -31,6 +31,20 @@ arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len
if (len > RGN_MAP_LIMIT) if (len > RGN_MAP_LIMIT)
return -ENOMEM; return -ENOMEM;
#ifdef CONFIG_HUGETLB_PAGE
#define COLOR_HALIGN(addr) ((addr + HPAGE_SIZE - 1) & ~(HPAGE_SIZE - 1))
#define TASK_HPAGE_BASE ((REGION_HPAGE << REGION_SHIFT) | HPAGE_SIZE)
if (filp && is_file_hugepages(filp)) {
if ((REGION_NUMBER(addr) != REGION_HPAGE) || (addr & (HPAGE_SIZE -1)))
addr = TASK_HPAGE_BASE;
addr = COLOR_HALIGN(addr);
}
else {
if (REGION_NUMBER(addr) == REGION_HPAGE)
addr = 0;
}
#endif
if (!addr) if (!addr)
addr = TASK_UNMAPPED_BASE; addr = TASK_UNMAPPED_BASE;
......
/* /*
* linux/arch/ia64/kernel/time.c * linux/arch/ia64/kernel/time.c
* *
* Copyright (C) 1998-2002 Hewlett-Packard Co * Copyright (C) 1998-2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* David Mosberger <davidm@hpl.hp.com> * David Mosberger <davidm@hpl.hp.com>
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com> * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
...@@ -75,10 +75,8 @@ gettimeoffset (void) ...@@ -75,10 +75,8 @@ gettimeoffset (void)
now = ia64_get_itc(); now = ia64_get_itc();
if ((long) (now - last_tick) < 0) { if ((long) (now - last_tick) < 0) {
# if 1 printk(KERN_ERR "CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n",
printk("CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n",
smp_processor_id(), now, last_tick); smp_processor_id(), now, last_tick);
# endif
return last_time_offset; return last_time_offset;
} }
elapsed_cycles = now - last_tick; elapsed_cycles = now - last_tick;
...@@ -157,7 +155,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -157,7 +155,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
new_itm = local_cpu_data->itm_next; new_itm = local_cpu_data->itm_next;
if (!time_after(ia64_get_itc(), new_itm)) if (!time_after(ia64_get_itc(), new_itm))
printk("Oops: timer tick before it's due (itc=%lx,itm=%lx)\n", printk(KERN_ERR "Oops: timer tick before it's due (itc=%lx,itm=%lx)\n",
ia64_get_itc(), new_itm); ia64_get_itc(), new_itm);
while (1) { while (1) {
...@@ -246,21 +244,22 @@ ia64_init_itm (void) ...@@ -246,21 +244,22 @@ ia64_init_itm (void)
*/ */
status = ia64_sal_freq_base(SAL_FREQ_BASE_PLATFORM, &platform_base_freq, &drift); status = ia64_sal_freq_base(SAL_FREQ_BASE_PLATFORM, &platform_base_freq, &drift);
if (status != 0) { if (status != 0) {
printk("SAL_FREQ_BASE_PLATFORM failed: %s\n", ia64_sal_strerror(status)); printk(KERN_ERR "SAL_FREQ_BASE_PLATFORM failed: %s\n", ia64_sal_strerror(status));
} else { } else {
status = ia64_pal_freq_ratios(&proc_ratio, 0, &itc_ratio); status = ia64_pal_freq_ratios(&proc_ratio, 0, &itc_ratio);
if (status != 0) if (status != 0)
printk("PAL_FREQ_RATIOS failed with status=%ld\n", status); printk(KERN_ERR "PAL_FREQ_RATIOS failed with status=%ld\n", status);
} }
if (status != 0) { if (status != 0) {
/* invent "random" values */ /* invent "random" values */
printk("SAL/PAL failed to obtain frequency info---inventing reasonably values\n"); printk(KERN_ERR
"SAL/PAL failed to obtain frequency info---inventing reasonably values\n");
platform_base_freq = 100000000; platform_base_freq = 100000000;
itc_ratio.num = 3; itc_ratio.num = 3;
itc_ratio.den = 1; itc_ratio.den = 1;
} }
if (platform_base_freq < 40000000) { if (platform_base_freq < 40000000) {
printk("Platform base frequency %lu bogus---resetting to 75MHz!\n", printk(KERN_ERR "Platform base frequency %lu bogus---resetting to 75MHz!\n",
platform_base_freq); platform_base_freq);
platform_base_freq = 75000000; platform_base_freq = 75000000;
} }
...@@ -271,8 +270,8 @@ ia64_init_itm (void) ...@@ -271,8 +270,8 @@ ia64_init_itm (void)
itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den; itc_freq = (platform_base_freq*itc_ratio.num)/itc_ratio.den;
local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ; local_cpu_data->itm_delta = (itc_freq + HZ/2) / HZ;
printk("CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, ITC freq=%lu.%03luMHz\n", printk(KERN_INFO "CPU %d: base freq=%lu.%03luMHz, ITC ratio=%lu/%lu, "
smp_processor_id(), "ITC freq=%lu.%03luMHz\n", smp_processor_id(),
platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000, platform_base_freq / 1000000, (platform_base_freq / 1000) % 1000,
itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000); itc_ratio.num, itc_ratio.den, itc_freq / 1000000, (itc_freq / 1000) % 1000);
......
/* /*
* Architecture-specific trap handling. * Architecture-specific trap handling.
* *
* Copyright (C) 1998-2002 Hewlett-Packard Co * Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* *
* 05/12/00 grao <goutham.rao@intel.com> : added isr in siginfo for SIGFPE * 05/12/00 grao <goutham.rao@intel.com> : added isr in siginfo for SIGFPE
...@@ -57,7 +57,8 @@ trap_init (void) ...@@ -57,7 +57,8 @@ trap_init (void)
major = fpswa_interface->revision >> 16; major = fpswa_interface->revision >> 16;
minor = fpswa_interface->revision & 0xffff; minor = fpswa_interface->revision & 0xffff;
} }
printk("fpswa interface at %lx (rev %d.%d)\n", ia64_boot_param->fpswa, major, minor); printk(KERN_INFO "fpswa interface at %lx (rev %d.%d)\n",
ia64_boot_param->fpswa, major, minor);
} }
/* /*
...@@ -142,7 +143,7 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs) ...@@ -142,7 +143,7 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
switch (break_num) { switch (break_num) {
case 0: /* unknown error (used by GCC for __builtin_abort()) */ case 0: /* unknown error (used by GCC for __builtin_abort()) */
die_if_kernel("bad break", regs, break_num); die_if_kernel("bugcheck!", regs, break_num);
sig = SIGILL; code = ILL_ILLOPC; sig = SIGILL; code = ILL_ILLOPC;
break; break;
...@@ -222,7 +223,7 @@ ia64_ni_syscall (unsigned long arg0, unsigned long arg1, unsigned long arg2, uns ...@@ -222,7 +223,7 @@ ia64_ni_syscall (unsigned long arg0, unsigned long arg1, unsigned long arg2, uns
{ {
struct pt_regs *regs = (struct pt_regs *) &stack; struct pt_regs *regs = (struct pt_regs *) &stack;
printk("%s(%d): <sc%ld(%lx,%lx,%lx,%lx)>\n", current->comm, current->pid, printk(KERN_DEBUG "%s(%d): <sc%ld(%lx,%lx,%lx,%lx)>\n", current->comm, current->pid,
regs->r15, arg0, arg1, arg2, arg3); regs->r15, arg0, arg1, arg2, arg3);
return -ENOSYS; return -ENOSYS;
} }
...@@ -346,7 +347,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr) ...@@ -346,7 +347,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
/* emulation was successful */ /* emulation was successful */
ia64_increment_ip(regs); ia64_increment_ip(regs);
} else if (exception == -1) { } else if (exception == -1) {
printk("handle_fpu_swa: fp_emulate() returned -1\n"); printk(KERN_ERR "handle_fpu_swa: fp_emulate() returned -1\n");
return -1; return -1;
} else { } else {
/* is next instruction a trap? */ /* is next instruction a trap? */
...@@ -369,7 +370,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr) ...@@ -369,7 +370,7 @@ handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
} }
} else { } else {
if (exception == -1) { if (exception == -1) {
printk("handle_fpu_swa: fp_emulate() returned -1\n"); printk(KERN_ERR "handle_fpu_swa: fp_emulate() returned -1\n");
return -1; return -1;
} else if (exception != 0) { } else if (exception != 0) {
/* raise exception */ /* raise exception */
...@@ -467,7 +468,9 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, ...@@ -467,7 +468,9 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
? " (RSE access)" : " (data access)") : ""); ? " (RSE access)" : " (data access)") : "");
if (code == 8) { if (code == 8) {
# ifdef CONFIG_IA64_PRINT_HAZARDS # ifdef CONFIG_IA64_PRINT_HAZARDS
printk("%016lx:possible hazard, pr = %016lx\n", regs->cr_iip, regs->pr); printk("%s[%d]: possible hazard @ ip=%016lx (pr = %016lx)\n",
current->comm, current->pid, regs->cr_iip + ia64_psr(regs)->ri,
regs->pr);
# endif # endif
return; return;
} }
...@@ -524,6 +527,25 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, ...@@ -524,6 +527,25 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
case 29: /* Debug */ case 29: /* Debug */
case 35: /* Taken Branch Trap */ case 35: /* Taken Branch Trap */
case 36: /* Single Step Trap */ case 36: /* Single Step Trap */
#ifdef CONFIG_FSYS
if (fsys_mode(current, regs)) {
extern char syscall_via_break[], __start_gate_section[];
/*
* Got a trap in fsys-mode: Taken Branch Trap and Single Step trap
* need special handling; Debug trap is not supposed to happen.
*/
if (unlikely(vector == 29)) {
die("Got debug trap in fsys-mode---not supposed to happen!",
regs, 0);
return;
}
/* re-do the system call via break 0x100000: */
regs->cr_iip = GATE_ADDR + (syscall_via_break - __start_gate_section);
ia64_psr(regs)->ri = 0;
ia64_psr(regs)->cpl = 3;
return;
}
#endif
switch (vector) { switch (vector) {
case 29: case 29:
siginfo.si_code = TRAP_HWBKPT; siginfo.si_code = TRAP_HWBKPT;
...@@ -563,19 +585,31 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, ...@@ -563,19 +585,31 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
} }
return; return;
case 34: /* Unimplemented Instruction Address Trap */ case 34:
if (user_mode(regs)) { if (isr & 0x2) {
siginfo.si_signo = SIGILL; /* Lower-Privilege Transfer Trap */
siginfo.si_code = ILL_BADIADDR; /*
siginfo.si_errno = 0; * Just clear PSR.lp and then return immediately: all the
siginfo.si_flags = 0; * interesting work (e.g., signal delivery is done in the kernel
siginfo.si_isr = 0; * exit path).
siginfo.si_imm = 0; */
siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri); ia64_psr(regs)->lp = 0;
force_sig_info(SIGILL, &siginfo, current);
return; return;
} else {
/* Unimplemented Instr. Address Trap */
if (user_mode(regs)) {
siginfo.si_signo = SIGILL;
siginfo.si_code = ILL_BADIADDR;
siginfo.si_errno = 0;
siginfo.si_flags = 0;
siginfo.si_isr = 0;
siginfo.si_imm = 0;
siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
force_sig_info(SIGILL, &siginfo, current);
return;
}
sprintf(buf, "Unimplemented Instruction Address fault");
} }
sprintf(buf, "Unimplemented Instruction Address fault");
break; break;
case 45: case 45:
...@@ -583,8 +617,9 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, ...@@ -583,8 +617,9 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
if (ia32_exception(regs, isr) == 0) if (ia32_exception(regs, isr) == 0)
return; return;
#endif #endif
printk("Unexpected IA-32 exception (Trap 45)\n"); printk(KERN_ERR "Unexpected IA-32 exception (Trap 45)\n");
printk(" iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n", regs->cr_iip, ifa, isr); printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx\n",
regs->cr_iip, ifa, isr);
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);
break; break;
...@@ -593,8 +628,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa, ...@@ -593,8 +628,8 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
if (ia32_intercept(regs, isr) == 0) if (ia32_intercept(regs, isr) == 0)
return; return;
#endif #endif
printk("Unexpected IA-32 intercept trap (Trap 46)\n"); printk(KERN_ERR "Unexpected IA-32 intercept trap (Trap 46)\n");
printk(" iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n", printk(KERN_ERR " iip - 0x%lx, ifa - 0x%lx, isr - 0x%lx, iim - 0x%lx\n",
regs->cr_iip, ifa, isr, iim); regs->cr_iip, ifa, isr, iim);
force_sig(SIGSEGV, current); force_sig(SIGSEGV, current);
return; return;
......
...@@ -331,12 +331,8 @@ set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat) ...@@ -331,12 +331,8 @@ set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat)
return; return;
} }
/* if (!user_stack(current, regs)) {
* Avoid using user_mode() here: with "epc", we cannot use the privilege level to DPRINT("ignoring kernel write to r%lu; register isn't on the kernel RBS!", r1);
* infer whether the interrupt task was running on the kernel backing store.
*/
if (regs->r12 >= TASK_SIZE) {
DPRINT("ignoring kernel write to r%lu; register isn't on the RBS!", r1);
return; return;
} }
...@@ -406,11 +402,7 @@ get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int *na ...@@ -406,11 +402,7 @@ get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int *na
return; return;
} }
/* if (!user_stack(current, regs)) {
* Avoid using user_mode() here: with "epc", we cannot use the privilege level to
* infer whether the interrupt task was running on the kernel backing store.
*/
if (regs->r12 >= TASK_SIZE) {
DPRINT("ignoring kernel read of r%lu; register isn't on the RBS!", r1); DPRINT("ignoring kernel read of r%lu; register isn't on the RBS!", r1);
goto fail; goto fail;
} }
...@@ -1302,12 +1294,12 @@ within_logging_rate_limit (void) ...@@ -1302,12 +1294,12 @@ within_logging_rate_limit (void)
void void
ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
{ {
struct exception_fixup fix = { 0 };
struct ia64_psr *ipsr = ia64_psr(regs); struct ia64_psr *ipsr = ia64_psr(regs);
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
unsigned long bundle[2]; unsigned long bundle[2];
unsigned long opcode; unsigned long opcode;
struct siginfo si; struct siginfo si;
const struct exception_table_entry *eh = NULL;
union { union {
unsigned long l; unsigned long l;
load_store_t insn; load_store_t insn;
...@@ -1325,10 +1317,9 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) ...@@ -1325,10 +1317,9 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* user-level unaligned accesses. Otherwise, a clever program could trick this * user-level unaligned accesses. Otherwise, a clever program could trick this
* handler into reading an arbitrary kernel addresses... * handler into reading an arbitrary kernel addresses...
*/ */
if (!user_mode(regs)) { if (!user_mode(regs))
fix = SEARCH_EXCEPTION_TABLE(regs); eh = SEARCH_EXCEPTION_TABLE(regs);
} if (user_mode(regs) || eh) {
if (user_mode(regs) || fix.cont) {
if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0) if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0)
goto force_sigbus; goto force_sigbus;
...@@ -1494,8 +1485,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) ...@@ -1494,8 +1485,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
failure: failure:
/* something went wrong... */ /* something went wrong... */
if (!user_mode(regs)) { if (!user_mode(regs)) {
if (fix.cont) { if (eh) {
handle_exception(regs, fix); handle_exception(regs, eh);
goto done; goto done;
} }
die_if_kernel("error during unaligned kernel access\n", regs, ret); die_if_kernel("error during unaligned kernel access\n", regs, ret);
......
/* /*
* Copyright (C) 1999-2002 Hewlett-Packard Co * Copyright (C) 1999-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
*/ */
/* /*
...@@ -532,7 +532,7 @@ push (struct unw_state_record *sr) ...@@ -532,7 +532,7 @@ push (struct unw_state_record *sr)
rs = alloc_reg_state(); rs = alloc_reg_state();
if (!rs) { if (!rs) {
printk("unwind: cannot stack reg state!\n"); printk(KERN_ERR "unwind: cannot stack reg state!\n");
return; return;
} }
memcpy(rs, &sr->curr, sizeof(*rs)); memcpy(rs, &sr->curr, sizeof(*rs));
...@@ -545,7 +545,7 @@ pop (struct unw_state_record *sr) ...@@ -545,7 +545,7 @@ pop (struct unw_state_record *sr)
struct unw_reg_state *rs = sr->curr.next; struct unw_reg_state *rs = sr->curr.next;
if (!rs) { if (!rs) {
printk("unwind: stack underflow!\n"); printk(KERN_ERR "unwind: stack underflow!\n");
return; return;
} }
memcpy(&sr->curr, rs, sizeof(*rs)); memcpy(&sr->curr, rs, sizeof(*rs));
...@@ -561,7 +561,7 @@ dup_state_stack (struct unw_reg_state *rs) ...@@ -561,7 +561,7 @@ dup_state_stack (struct unw_reg_state *rs)
while (rs) { while (rs) {
copy = alloc_reg_state(); copy = alloc_reg_state();
if (!copy) { if (!copy) {
printk ("unwind.dup_state_stack: out of memory\n"); printk(KERN_ERR "unwind.dup_state_stack: out of memory\n");
return NULL; return NULL;
} }
memcpy(copy, rs, sizeof(*copy)); memcpy(copy, rs, sizeof(*copy));
...@@ -951,7 +951,7 @@ desc_copy_state (unw_word label, struct unw_state_record *sr) ...@@ -951,7 +951,7 @@ desc_copy_state (unw_word label, struct unw_state_record *sr)
return; return;
} }
} }
printk("unwind: failed to find state labeled 0x%lx\n", label); printk(KERN_ERR "unwind: failed to find state labeled 0x%lx\n", label);
} }
static inline void static inline void
...@@ -961,7 +961,7 @@ desc_label_state (unw_word label, struct unw_state_record *sr) ...@@ -961,7 +961,7 @@ desc_label_state (unw_word label, struct unw_state_record *sr)
ls = alloc_labeled_state(); ls = alloc_labeled_state();
if (!ls) { if (!ls) {
printk("unwind.desc_label_state(): out of memory\n"); printk(KERN_ERR "unwind.desc_label_state(): out of memory\n");
return; return;
} }
ls->label = label; ls->label = label;
...@@ -1055,7 +1055,8 @@ desc_spill_sprel_p (unsigned char qp, unw_word t, unsigned char abreg, unw_word ...@@ -1055,7 +1055,8 @@ desc_spill_sprel_p (unsigned char qp, unw_word t, unsigned char abreg, unw_word
r->val = 4*spoff; r->val = 4*spoff;
} }
#define UNW_DEC_BAD_CODE(code) printk("unwind: unknown code 0x%02x\n", code); #define UNW_DEC_BAD_CODE(code) printk(KERN_ERR "unwind: unknown code 0x%02x\n", \
code);
/* /*
* region headers: * region headers:
...@@ -1997,23 +1998,25 @@ unw_create_gate_table (void) ...@@ -1997,23 +1998,25 @@ unw_create_gate_table (void)
{ {
extern char __start_gate_section[], __stop_gate_section[]; extern char __start_gate_section[], __stop_gate_section[];
unsigned long *lp, start, end, segbase = unw.kernel_table.segment_base; unsigned long *lp, start, end, segbase = unw.kernel_table.segment_base;
const struct unw_table_entry *entry, *first; const struct unw_table_entry *entry, *first, *unw_table_end;
extern int ia64_unw_end;
size_t info_size, size; size_t info_size, size;
char *info; char *info;
start = (unsigned long) __start_gate_section - segbase; start = (unsigned long) __start_gate_section - segbase;
end = (unsigned long) __stop_gate_section - segbase; end = (unsigned long) __stop_gate_section - segbase;
unw_table_end = (struct unw_table_entry *) &ia64_unw_end;
size = 0; size = 0;
first = lookup(&unw.kernel_table, start); first = lookup(&unw.kernel_table, start);
for (entry = first; entry->start_offset < end; ++entry) for (entry = first; entry < unw_table_end && entry->start_offset < end; ++entry)
size += 3*8 + 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset)); size += 3*8 + 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset));
size += 8; /* reserve space for "end of table" marker */ size += 8; /* reserve space for "end of table" marker */
unw.gate_table = alloc_bootmem(size); unw.gate_table = alloc_bootmem(size);
if (!unw.gate_table) { if (!unw.gate_table) {
unw.gate_table_size = 0; unw.gate_table_size = 0;
printk("unwind: unable to create unwind data for gate page!\n"); printk(KERN_ERR "unwind: unable to create unwind data for gate page!\n");
return; return;
} }
unw.gate_table_size = size; unw.gate_table_size = size;
...@@ -2021,7 +2024,7 @@ unw_create_gate_table (void) ...@@ -2021,7 +2024,7 @@ unw_create_gate_table (void)
lp = unw.gate_table; lp = unw.gate_table;
info = (char *) unw.gate_table + size; info = (char *) unw.gate_table + size;
for (entry = first; entry->start_offset < end; ++entry, lp += 3) { for (entry = first; entry < unw_table_end && entry->start_offset < end; ++entry, lp += 3) {
info_size = 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset)); info_size = 8 + 8*UNW_LENGTH(*(u64 *) (segbase + entry->info_offset));
info -= info_size; info -= info_size;
memcpy(info, (char *) segbase + entry->info_offset, info_size); memcpy(info, (char *) segbase + entry->info_offset, info_size);
......
...@@ -159,7 +159,7 @@ GLOBAL_ENTRY(__copy_user) ...@@ -159,7 +159,7 @@ GLOBAL_ENTRY(__copy_user)
mov ar.ec=2 mov ar.ec=2
(p10) br.dpnt.few .aligned_src_tail (p10) br.dpnt.few .aligned_src_tail
;; ;;
.align 32 // .align 32
1: 1:
EX(.ex_handler, (p16) ld8 r34=[src0],16) EX(.ex_handler, (p16) ld8 r34=[src0],16)
EK(.ex_handler, (p16) ld8 r38=[src1],16) EK(.ex_handler, (p16) ld8 r38=[src1],16)
...@@ -316,7 +316,7 @@ EK(.ex_handler, (p[D]) st8 [dst1] = t15, 4*8) ...@@ -316,7 +316,7 @@ EK(.ex_handler, (p[D]) st8 [dst1] = t15, 4*8)
(p7) mov ar.lc = r21 (p7) mov ar.lc = r21
(p8) mov ar.lc = r0 (p8) mov ar.lc = r0
;; ;;
.align 32 // .align 32
1: lfetch.fault [src_pre_mem], 128 1: lfetch.fault [src_pre_mem], 128
lfetch.fault.excl [dst_pre_mem], 128 lfetch.fault.excl [dst_pre_mem], 128
br.cloop.dptk.few 1b br.cloop.dptk.few 1b
...@@ -522,7 +522,7 @@ EK(.ex_handler, (p17) st8 [dst1]=r39,8); \ ...@@ -522,7 +522,7 @@ EK(.ex_handler, (p17) st8 [dst1]=r39,8); \
shrp r21=r22,r38,shift; /* speculative work */ \ shrp r21=r22,r38,shift; /* speculative work */ \
br.sptk.few .unaligned_src_tail /* branch out of jump table */ \ br.sptk.few .unaligned_src_tail /* branch out of jump table */ \
;; ;;
.align 32 // .align 32
.jump_table: .jump_table:
COPYU(8) // unaligned cases COPYU(8) // unaligned cases
.jmp1: .jmp1:
......
...@@ -125,7 +125,7 @@ GLOBAL_ENTRY(memset) ...@@ -125,7 +125,7 @@ GLOBAL_ENTRY(memset)
(p_zr) br.cond.dptk.many .l1b // Jump to use stf.spill (p_zr) br.cond.dptk.many .l1b // Jump to use stf.spill
;; } ;; }
.align 32 // -------------------------- // L1A: store ahead into cache lines; fill later // .align 32 // -------------------------- // L1A: store ahead into cache lines; fill later
{ .mmi { .mmi
and tmp = -(LINE_SIZE), cnt // compute end of range and tmp = -(LINE_SIZE), cnt // compute end of range
mov ptr9 = ptr1 // used for prefetching mov ptr9 = ptr1 // used for prefetching
...@@ -194,7 +194,7 @@ GLOBAL_ENTRY(memset) ...@@ -194,7 +194,7 @@ GLOBAL_ENTRY(memset)
br.cond.dpnt.many .move_bytes_from_alignment // Branch no. 3 br.cond.dpnt.many .move_bytes_from_alignment // Branch no. 3
;; } ;; }
.align 32 // .align 32
.l1b: // ------------------------------------ // L1B: store ahead into cache lines; fill later .l1b: // ------------------------------------ // L1B: store ahead into cache lines; fill later
{ .mmi { .mmi
and tmp = -(LINE_SIZE), cnt // compute end of range and tmp = -(LINE_SIZE), cnt // compute end of range
...@@ -261,7 +261,7 @@ GLOBAL_ENTRY(memset) ...@@ -261,7 +261,7 @@ GLOBAL_ENTRY(memset)
and cnt = 0x1f, cnt // compute the remaining cnt and cnt = 0x1f, cnt // compute the remaining cnt
mov.i ar.lc = loopcnt mov.i ar.lc = loopcnt
;; } ;; }
.align 32 // .align 32
.l2: // ------------------------------------ // L2A: store 32B in 2 cycles .l2: // ------------------------------------ // L2A: store 32B in 2 cycles
{ .mmb { .mmb
stf8 [ptr1] = fvalue, 8 stf8 [ptr1] = fvalue, 8
......
...@@ -113,7 +113,7 @@ swiotlb_init (void) ...@@ -113,7 +113,7 @@ swiotlb_init (void)
io_tlb_index = 0; io_tlb_index = 0;
io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *)); io_tlb_orig_addr = alloc_bootmem(io_tlb_nslabs * sizeof(char *));
printk("Placing software IO TLB between 0x%p - 0x%p\n", printk(KERN_INFO "Placing software IO TLB between 0x%p - 0x%p\n",
(void *) io_tlb_start, (void *) io_tlb_end); (void *) io_tlb_start, (void *) io_tlb_end);
} }
......
...@@ -215,7 +215,7 @@ discontig_mem_init(void) ...@@ -215,7 +215,7 @@ discontig_mem_init(void)
int node; int node;
if (numnodes == 0) { if (numnodes == 0) {
printk("node info missing!\n"); printk(KERN_ERR "node info missing!\n");
numnodes = 1; numnodes = 1;
} }
......
...@@ -10,20 +10,19 @@ ...@@ -10,20 +10,19 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/module.h> #include <asm/module.h>
extern const struct exception_table_entry __start___ex_table[]; const struct exception_table_entry *
extern const struct exception_table_entry __stop___ex_table[]; search_extable (const struct exception_table_entry *first,
const struct exception_table_entry *last,
static inline const struct exception_table_entry * unsigned long ip)
search_one_table (const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long ip, unsigned long gp)
{ {
while (first <= last) { const struct exception_table_entry *mid;
const struct exception_table_entry *mid; unsigned long mid_ip;
long diff; long diff;
while (first <= last) {
mid = &first[(last - first)/2]; mid = &first[(last - first)/2];
diff = (mid->addr + gp) - ip; mid_ip = (u64) &mid->addr + mid->addr;
diff = mid_ip - ip;
if (diff == 0) if (diff == 0)
return mid; return mid;
else if (diff < 0) else if (diff < 0)
...@@ -34,50 +33,14 @@ search_one_table (const struct exception_table_entry *first, ...@@ -34,50 +33,14 @@ search_one_table (const struct exception_table_entry *first,
return 0; return 0;
} }
#ifndef CONFIG_MODULES
register unsigned long main_gp __asm__("gp");
#endif
struct exception_fixup
search_exception_table (unsigned long addr)
{
const struct exception_table_entry *entry;
struct exception_fixup fix = { 0 };
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
entry = search_one_table(__start___ex_table, __stop___ex_table - 1, addr, main_gp);
if (entry)
fix.cont = entry->cont + main_gp;
return fix;
#else
struct archdata *archdata;
struct module *mp;
/* The kernel is the last "module" -- no need to treat it special. */
for (mp = module_list; mp; mp = mp->next) {
if (!mp->ex_table_start)
continue;
archdata = (struct archdata *) mp->archdata_start;
if (!archdata)
continue;
entry = search_one_table(mp->ex_table_start, mp->ex_table_end - 1,
addr, (unsigned long) archdata->gp);
if (entry) {
fix.cont = entry->cont + (unsigned long) archdata->gp;
return fix;
}
}
#endif
return fix;
}
void void
handle_exception (struct pt_regs *regs, struct exception_fixup fix) handle_exception (struct pt_regs *regs, const struct exception_table_entry *e)
{ {
long fix = (u64) &e->cont + e->cont;
regs->r8 = -EFAULT; regs->r8 = -EFAULT;
if (fix.cont & 4) if (fix & 4)
regs->r9 = 0; regs->r9 = 0;
regs->cr_iip = (long) fix.cont & ~0xf; regs->cr_iip = fix & ~0xf;
ia64_psr(regs)->ri = fix.cont & 0x3; /* set continuation slot number */ ia64_psr(regs)->ri = fix & 0x3; /* set continuation slot number */
} }
...@@ -196,7 +196,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re ...@@ -196,7 +196,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
yield(); yield();
goto survive; goto survive;
} }
printk("VM: killing process %s\n", current->comm); printk(KERN_CRIT "VM: killing process %s\n", current->comm);
if (user_mode(regs)) if (user_mode(regs))
do_exit(SIGKILL); do_exit(SIGKILL);
goto no_context; goto no_context;
......
This diff is collapsed.
...@@ -234,7 +234,7 @@ put_gate_page (struct page *page, unsigned long address) ...@@ -234,7 +234,7 @@ put_gate_page (struct page *page, unsigned long address)
pte_t *pte; pte_t *pte;
if (!PageReserved(page)) if (!PageReserved(page))
printk("put_gate_page: gate page at 0x%p not in reserved memory\n", printk(KERN_ERR "put_gate_page: gate page at 0x%p not in reserved memory\n",
page_address(page)); page_address(page));
pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */ pgd = pgd_offset_k(address); /* note: this is NOT pgd_offset()! */
...@@ -342,13 +342,6 @@ ia64_mmu_init (void *my_cpu_data) ...@@ -342,13 +342,6 @@ ia64_mmu_init (void *my_cpu_data)
* Set up the page tables. * Set up the page tables.
*/ */
#ifdef CONFIG_HUGETLB_PAGE
long htlbpagemem;
int htlbpage_max;
extern long htlbzone_pages;
extern struct list_head htlbpage_freelist;
#endif
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
void void
paging_init (void) paging_init (void)
...@@ -438,10 +431,10 @@ mem_init (void) ...@@ -438,10 +431,10 @@ mem_init (void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext; datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
printk("Memory: %luk/%luk available (%luk code, %luk reserved, %luk data, %luk init)\n", printk(KERN_INFO "Memory: %luk/%luk available (%luk code, %luk reserved, "
(unsigned long) nr_free_pages() << (PAGE_SHIFT - 10), "%luk data, %luk init)\n", (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10),
num_physpages << (PAGE_SHIFT - 10), codesize >> 10, reserved_pages << (PAGE_SHIFT - 10), num_physpages << (PAGE_SHIFT - 10), codesize >> 10,
datasize >> 10, initsize >> 10); reserved_pages << (PAGE_SHIFT - 10), datasize >> 10, initsize >> 10);
/* /*
* Allow for enough (cached) page table pages so that we can map the entire memory * Allow for enough (cached) page table pages so that we can map the entire memory
...@@ -462,29 +455,4 @@ mem_init (void) ...@@ -462,29 +455,4 @@ mem_init (void)
#ifdef CONFIG_IA32_SUPPORT #ifdef CONFIG_IA32_SUPPORT
ia32_gdt_init(); ia32_gdt_init();
#endif #endif
#ifdef CONFIG_HUGETLB_PAGE
{
long i;
int j;
struct page *page, *map;
if ((htlbzone_pages << (HPAGE_SHIFT - PAGE_SHIFT)) >= max_low_pfn)
htlbzone_pages = (max_low_pfn >> ((HPAGE_SHIFT - PAGE_SHIFT) + 1));
INIT_LIST_HEAD(&htlbpage_freelist);
for (i = 0; i < htlbzone_pages; i++) {
page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER);
if (!page)
break;
map = page;
for (j = 0; j < (HPAGE_SIZE/PAGE_SIZE); j++) {
SetPageReserved(map);
map++;
}
list_add(&page->list, &htlbpage_freelist);
}
printk("Total Huge_TLB_Page memory pages allocated %ld \n", i);
htlbzone_pages = htlbpagemem = i;
htlbpage_max = (int)i;
}
#endif
} }
#!/bin/sh
dir=$(dirname $0)
CC=$1
$CC -c $dir/check-gas-asm.S
res=$(objdump -r --section .data check-gas-asm.o | fgrep 00004 | tr -s ' ' |cut -f3 -d' ')
if [ $res != ".text" ]; then
echo buggy
else
echo good
fi
exit 0
[1:] nop 0
.xdata4 ".data", 0, 1b-.
#!/bin/sh
# Usage: unwcheck.sh <executable_file_name>
# Pre-requisite: readelf [from Gnu binutils package]
# Purpose: Check the following invariant
# For each code range in the input binary:
# Sum[ lengths of unwind regions] = Number of slots in code range.
# Author : Harish Patil
# First version: January 2002
# Modified : 2/13/2002
# Modified : 3/15/2002: duplicate detection
readelf -u $1 | gawk '\
function todec(hexstr){
dec = 0;
l = length(hexstr);
for (i = 1; i <= l; i++)
{
c = substr(hexstr, i, 1);
if (c == "A")
dec = dec*16 + 10;
else if (c == "B")
dec = dec*16 + 11;
else if (c == "C")
dec = dec*16 + 12;
else if (c == "D")
dec = dec*16 + 13;
else if (c == "E")
dec = dec*16 + 14;
else if (c == "F")
dec = dec*16 + 15;
else
dec = dec*16 + c;
}
return dec;
}
BEGIN { first = 1; sum_rlen = 0; no_slots = 0; errors=0; no_code_ranges=0; }
{
if (NF==5 && $3=="info")
{
no_code_ranges += 1;
if (first == 0)
{
if (sum_rlen != no_slots)
{
print full_code_range;
print " ", "lo = ", lo, " hi =", hi;
print " ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots;
print " "," ", "*******ERROR ***********";
print " "," ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots;
errors += 1;
}
sum_rlen = 0;
}
full_code_range = $0;
code_range = $2;
gsub("..$", "", code_range);
gsub("^.", "", code_range);
split(code_range, addr, "-");
lo = toupper(addr[1]);
code_range_lo[no_code_ranges] = addr[1];
occurs[addr[1]] += 1;
full_range[addr[1]] = $0;
gsub("0X.[0]*", "", lo);
hi = toupper(addr[2]);
gsub("0X.[0]*", "", hi);
no_slots = (todec(hi) - todec(lo))/ 16*3
first = 0;
}
if (index($0,"rlen") > 0 )
{
rlen_str = substr($0, index($0,"rlen"));
rlen = rlen_str;
gsub("rlen=", "", rlen);
gsub(")", "", rlen);
sum_rlen = sum_rlen + rlen;
}
}
END {
if (first == 0)
{
if (sum_rlen != no_slots)
{
print "code_range=", code_range;
print " ", "lo = ", lo, " hi =", hi;
print " ", "sum_rlen = ", sum_rlen, "no_slots = " no_slots;
print " "," ", "*******ERROR ***********";
print " "," ", "sum_rlen:", sum_rlen, " != no_slots:" no_slots;
errors += 1;
}
}
no_duplicates = 0;
for (i=1; i<=no_code_ranges; i++)
{
cr = code_range_lo[i];
if (reported_cr[cr]==1) continue;
if ( occurs[cr] > 1)
{
reported_cr[cr] = 1;
print "Code range low ", code_range_lo[i], ":", full_range[cr], " occurs: ", occurs[cr], " times.";
print " ";
no_duplicates++;
}
}
print "======================================"
print "Total errors:", errors, "/", no_code_ranges, " duplicates:", no_duplicates;
print "======================================"
}
'
...@@ -4,14 +4,7 @@ TARGET = include/asm-ia64/offsets.h ...@@ -4,14 +4,7 @@ TARGET = include/asm-ia64/offsets.h
src = $(obj) src = $(obj)
all: clean-files := print_offsets.s print_offsets offsets.h
fastdep:
mrproper: clean
clean:
rm -f $(obj)/print_offsets.s $(obj)/print_offsets $(obj)/offsets.h
$(TARGET): $(obj)/offsets.h $(TARGET): $(obj)/offsets.h
@if ! cmp -s $(obj)/offsets.h ${TARGET}; then \ @if ! cmp -s $(obj)/offsets.h ${TARGET}; then \
......
/* /*
* Utility to generate asm-ia64/offsets.h. * Utility to generate asm-ia64/offsets.h.
* *
* Copyright (C) 1999-2002 Hewlett-Packard Co * Copyright (C) 1999-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com> * David Mosberger-Tang <davidm@hpl.hp.com>
* *
* Note that this file has dual use: when building the kernel * Note that this file has dual use: when building the kernel
...@@ -52,8 +52,13 @@ tab[] = ...@@ -52,8 +52,13 @@ tab[] =
{ "SIGFRAME_SIZE", sizeof (struct sigframe) }, { "SIGFRAME_SIZE", sizeof (struct sigframe) },
{ "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) }, { "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) },
{ "", 0 }, /* spacer */ { "", 0 }, /* spacer */
{ "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) }, { "IA64_TASK_CLEAR_CHILD_TID_OFFSET",offsetof (struct task_struct, clear_child_tid) },
{ "IA64_TASK_GROUP_LEADER_OFFSET", offsetof (struct task_struct, group_leader) },
{ "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) }, { "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) },
{ "IA64_TASK_REAL_PARENT_OFFSET", offsetof (struct task_struct, real_parent) },
{ "IA64_TASK_TGID_OFFSET", offsetof (struct task_struct, tgid) },
{ "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) },
{ "IA64_TASK_THREAD_ON_USTACK_OFFSET", offsetof (struct task_struct, thread.on_ustack) },
{ "IA64_PT_REGS_CR_IPSR_OFFSET", offsetof (struct pt_regs, cr_ipsr) }, { "IA64_PT_REGS_CR_IPSR_OFFSET", offsetof (struct pt_regs, cr_ipsr) },
{ "IA64_PT_REGS_CR_IIP_OFFSET", offsetof (struct pt_regs, cr_iip) }, { "IA64_PT_REGS_CR_IIP_OFFSET", offsetof (struct pt_regs, cr_iip) },
{ "IA64_PT_REGS_CR_IFS_OFFSET", offsetof (struct pt_regs, cr_ifs) }, { "IA64_PT_REGS_CR_IFS_OFFSET", offsetof (struct pt_regs, cr_ifs) },
......
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