Commit c6bb6a89 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://lia64.bkbits.net/to-linus-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 6521e426 0b6e72b3
......@@ -854,7 +854,7 @@ endif # ifdef include_config
# FIXME Should go into a make.lib or something
# ===========================================================================
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $@
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "IA-64 Linux Kernel Configuration"
source "init/Kconfig"
......@@ -215,6 +220,22 @@ config NUMA
Access). This option is for configuring high-end multiprocessor
server systems. If in doubt, say N.
choice
prompt "Maximum Memory per NUMA Node" if NUMA && IA64_DIG
depends on NUMA && IA64_DIG
default IA64_NODESIZE_16GB
config IA64_NODESIZE_16GB
bool "16GB"
config IA64_NODESIZE_64GB
bool "64GB"
config IA64_NODESIZE_256GB
bool "256GB"
endchoice
config DISCONTIGMEM
bool
depends on IA64_SGI_SN1 || IA64_SGI_SN2 || (IA64_GENERIC || IA64_DIG || IA64_HP_ZX1) && NUMA
......@@ -225,6 +246,21 @@ config DISCONTIGMEM
or have huge holes in the physical address space for other reasons.
See <file:Documentation/vm/numa> for more.
config VIRTUAL_MEM_MAP
bool "Enable Virtual Mem Map"
depends on !NUMA
default y if IA64_GENERIC || IA64_DIG || IA64_HP_ZX1
help
Say Y to compile the kernel with support for a virtual mem map.
This is an alternate method of supporting large holes in the
physical address space on non NUMA machines. Since the DISCONTIGMEM
option is not supported on machines with the ZX1 chipset, this is
the only way of supporting more than 1 Gb of memory on those
machines. This code also only takes effect if a memory hole of
greater than 1 Gb is found during boot, so it is safe to enable
unless you require the DISCONTIGMEM option for your machine. If you
are unsure, say Y.
config IA64_MCA
bool "Enable IA-64 Machine Check Abort" if IA64_GENERIC || IA64_DIG || IA64_HP_ZX1
default y if IA64_SGI_SN1 || IA64_SGI_SN2
......@@ -397,6 +433,11 @@ config IA32_SUPPORT
run IA-32 Linux binaries on an IA-64 Linux system.
If in doubt, say Y.
config COMPAT
bool
depends on IA32_SUPPORT
default y
config PERFMON
bool "Performance monitor support"
help
......
......@@ -5,76 +5,69 @@
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1998-2001 by David Mosberger-Tang <davidm@hpl.hp.com>
# Copyright (C) 1998-2002 by David Mosberger-Tang <davidm@hpl.hp.com>
#
NM := $(CROSS_COMPILE)nm -B
AWK := awk
export AWK
OBJCOPYFLAGS := --strip-all
LDFLAGS_vmlinux := -static
AFLAGS_KERNEL := -mconstant-gp
EXTRA =
OBJCOPYFLAGS := --strip-all
LDFLAGS_vmlinux := -static
AFLAGS_KERNEL := -mconstant-gp
EXTRA :=
CFLAGS := $(CFLAGS) -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
-falign-functions=32
# -ffunction-sections
CFLAGS_KERNEL := -mconstant-gp
cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f10-f15,f32-f127 \
-falign-functions=32
CFLAGS_KERNEL := -mconstant-gp
GCC_VERSION=$(shell $(CC) -v 2>&1 | fgrep 'gcc version' | cut -f3 -d' ' | cut -f1 -d'.')
ifneq ($(GCC_VERSION),2)
CFLAGS += -frename-registers --param max-inline-insns=5000
cflags-y += -frename-registers --param max-inline-insns=5000
endif
ifeq ($(CONFIG_ITANIUM_BSTEP_SPECIFIC),y)
CFLAGS += -mb-step
endif
cflags-$(CONFIG_ITANIUM_BSTEP_SPECIFIC) += -mb-step
cflags-$(CONFIG_IA64_SGI_SN) += -DBRINGUP
HEAD := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
libs-y += arch/$(ARCH)/lib/
core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
core-$(CONFIG_IA32_SUPPORT) += arch/$(ARCH)/ia32/
core-$(CONFIG_IA64_DIG) += arch/$(ARCH)/dig/
core-$(CONFIG_IA64_GENERIC) += arch/$(ARCH)/dig/ arch/$(ARCH)/hp/common/ arch/$(ARCH)/hp/zx1/ \
arch/$(ARCH)/hp/sim/
core-$(CONFIG_IA64_HP_ZX1) += arch/$(ARCH)/dig/
core-$(CONFIG_IA64_SGI_SN) += arch/$(ARCH)/sn/kernel arch/$(ARCH)/sn/io \
arch/$(ARCH)/sn/fakeprom
drivers-$(CONFIG_PCI) += arch/$(ARCH)/pci/
drivers-$(CONFIG_IA64_HP_SIM) += arch/$(ARCH)/hp/sim/
drivers-$(CONFIG_IA64_HP_ZX1) += arch/$(ARCH)/hp/common/ arch/$(ARCH)/hp/zx1/
ifdef CONFIG_IA64_SGI_SN
CFLAGS += -DBRINGUP
SUBDIRS += arch/$(ARCH)/sn/fakeprom
endif
CFLAGS += $(cflags-y)
HEAD := arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o
makeboot = $(call descend,arch/ia64/boot,$(1))
maketool = $(call descend,arch/ia64/tools,$(1))
libs-y += arch/ia64/lib/
core-y += arch/ia64/kernel/ arch/ia64/mm/
core-$(CONFIG_IA32_SUPPORT) += arch/ia64/ia32/
core-$(CONFIG_IA64_DIG) += arch/ia64/dig/
core-$(CONFIG_IA64_GENERIC) += arch/ia64/dig/ arch/ia64/hp/common/ arch/ia64/hp/zx1/ \
arch/ia64/hp/sim/
core-$(CONFIG_IA64_HP_ZX1) += arch/ia64/dig/
core-$(CONFIG_IA64_SGI_SN) += arch/ia64/sn/kernel/ \
arch/ia64/sn/io/ \
arch/ia64/sn/kernel/sn2/
drivers-$(CONFIG_PCI) += arch/ia64/pci/
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_SGI_SN) += arch/ia64/sn/fakeprom/
.PHONY: compressed archclean archmrproper $(TOPDIR)/include/asm-ia64/offsets.h
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/boot $(1)
maketool =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/ia64/tools $(1)
all: compressed boot
.PHONY: boot compressed archclean archmrproper include/asm-ia64/offsets.h
boot: vmlinux
+@$(call makeboot,all)
all compressed: vmlinux.gz
compressed: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp
gzip vmlinux-tmp
mv vmlinux-tmp.gz vmlinux.gz
vmlinux.gz: vmlinux
$(call makeboot,vmlinux.gz)
archmrproper:
archclean:
$(MAKE) -rR -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/ia64/boot
archmrproper:
CLEAN_FILES += include/asm-ia64/offsets.h vmlinux.gz bootloader
prepare: include/asm-ia64/offsets.h
prepare: $(TOPDIR)/include/asm-ia64/offsets.h
boot: lib/lib.a vmlinux
$(call makeboot,$@)
$(TOPDIR)/include/asm-ia64/offsets.h: include/asm include/linux/version.h \
include/config/MARKER
+@$(call maketool,$@)
include/asm-ia64/offsets.h: include/asm include/linux/version.h include/config/MARKER
$(call maketool,$@)
......@@ -8,20 +8,33 @@
# Copyright (C) 1998 by David Mosberger-Tang <davidm@hpl.hp.com>
#
LINKFLAGS = -static -T $(src)/bootloader.lds
EXTRA_TARGETS := vmlinux.bin vmlinux.gz
OBJS = $(obj)/bootloader.o
targets-$(CONFIG_IA64_HP_SIM) += bootloader
targets-$(CONFIG_IA64_GENERIC) += bootloader
EXTRA_TARGETS += $(sort $(targets-y))
targets-$(CONFIG_IA64_HP_SIM) += bootloader
targets-$(CONFIG_IA64_GENERIC) += bootloader
quiet_cmd_cptotop = LN $@
cmd_cptotop = ln -f $< $@
CFLAGS := $(CFLAGS) $(CFLAGS_KERNEL)
vmlinux.gz: $(obj)/vmlinux.gz $(targets-y)
$(call cmd,cptotop)
@echo ' Kernel: $@ is ready'
all: $(targets-y)
boot: bootloader
bootloader: $(OBJS)
$(LD) $(LINKFLAGS) $(OBJS) $(TOPDIR)/lib/lib.a $(TOPDIR)/arch/$(ARCH)/lib/lib.a \
-o bootloader
bootloader: $(obj)/bootloader
$(call cmd,cptotop)
clean:
rm -f $(TARGETS)
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
LDFLAGS_bootloader = -static -T
$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o \
lib/lib.a arch/ia64/lib/lib.a FORCE
$(call if_changed,ld)
......@@ -3,12 +3,14 @@
*
* Loads an ELF kernel.
*
* Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
* Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998, 1999 Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1998-2002 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
*
* 01/07/99 S.Eranian modified to pass command line arguments to kernel
*/
struct task_struct; /* forward declaration for elf.h */
#include <linux/config.h>
#include <linux/elf.h>
#include <linux/init.h>
......@@ -53,6 +55,15 @@ struct disk_stat {
#include "../kernel/fw-emu.c"
/*
* Set a break point on this function so that symbols are available to set breakpoints in
* the kernel being debugged.
*/
static void
debug_break (void)
{
}
static void
cons_write (const char *buf)
{
......@@ -187,6 +198,7 @@ _start (void)
ssc(0, (long) kpath, 0, 0, SSC_LOAD_SYMBOLS);
debug_break();
asm volatile ("mov sp=%2; mov r28=%1; br.sptk.few %0"
:: "b"(e_entry), "r"(bp), "r"(__pa(&stack)));
......
......@@ -23,7 +23,7 @@
#include "../drivers/scsi/hosts.h"
#include "simscsi.h"
#define DEBUG_SIMSCSI 1
#define DEBUG_SIMSCSI 0
/* Simulator system calls: */
......@@ -377,6 +377,12 @@ simscsi_queuecommand (Scsi_Cmnd *sc, void (*done)(Scsi_Cmnd *))
return 0;
}
int
simscsi_host_reset (Scsi_Cmnd *sc)
{
printk ("simscsi_host_reset: not implemented\n");
return 0;
}
static Scsi_Host_Template driver_template = SIMSCSI;
......
/*
* Simulated SCSI driver.
*
* Copyright (C) 1999 Hewlett-Packard Co
* Copyright (C) 1999, 2002 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef SIMSCSI_H
......@@ -21,14 +21,17 @@ extern int simscsi_biosparam (struct scsi_device *, struct block_device *,
sector_t, int[]);
#define SIMSCSI { \
.name = "simscsi", \
.detect = simscsi_detect, \
.release = simscsi_release, \
.info = simscsi_info, \
.queuecommand = simscsi_queuecommand, \
.eh_host_reset_handler = simscsi_host_reset, \
.bios_param = simscsi_biosparam, \
.can_queue = SIMSCSI_REQ_QUEUE_LEN, \
.this_id = -1, \
.sg_tablesize = SG_ALL, \
.max_sectors = 1024, \
.cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN, \
.present = 0, \
.unchecked_isa_dma = 0, \
......
......@@ -180,7 +180,6 @@ hpzx1_fake_pci_dev(char *name, unsigned int busnum, unsigned long addr, unsigned
list_add_tail(&dev->bus_list, &bus->devices);
list_add_tail(&dev->global_list, &pci_devices);
strcpy(dev->dev.name, dev->name);
strcpy(dev->dev.bus_id, dev->slot_name);
ret = device_register(&dev->dev);
if (ret < 0)
......@@ -335,7 +334,7 @@ hpzx1_acpi_dev_init(void)
extern void sba_init(void);
static void
static int
hpzx1_init (void)
{
/* zx1 has a hardware I/O TLB which lets us DMA from any device to any address */
......@@ -343,6 +342,7 @@ hpzx1_init (void)
hpzx1_acpi_dev_init();
sba_init();
return 0;
}
subsys_initcall(hpzx1_init);
......@@ -2,5 +2,5 @@
# Makefile for the ia32 kernel emulation subsystem.
#
obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o ia32_support.o ia32_traps.o \
binfmt_elf32.o ia32_ldt.o
obj-y := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o \
ia32_support.o ia32_traps.o binfmt_elf32.o ia32_ldt.o
......@@ -162,9 +162,11 @@ ia32_setup_arg_pages (struct linux_binprm *bprm)
{
unsigned long stack_base;
struct vm_area_struct *mpnt;
struct mm_struct *mm = current->mm;
int i;
stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
mm->arg_start = bprm->p + stack_base;
bprm->p += stack_base;
if (bprm->loader)
......@@ -175,6 +177,11 @@ ia32_setup_arg_pages (struct linux_binprm *bprm)
if (!mpnt)
return -ENOMEM;
if (!vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
kmem_cache_free(vm_area_cachep, mpnt);
return -ENOMEM;
}
down_write(&current->mm->mmap_sem);
{
mpnt->vm_mm = current->mm;
......
......@@ -196,7 +196,7 @@ ia32_syscall_table:
data8 sys32_fork
data8 sys_read
data8 sys_write
data8 sys_open /* 5 */
data8 sys32_open /* 5 */
data8 sys_close
data8 sys32_waitpid
data8 sys_creat
......@@ -221,7 +221,7 @@ ia32_syscall_table:
data8 sys32_alarm
data8 sys32_ni_syscall
data8 sys32_pause
data8 sys32_utime /* 30 */
data8 compat_sys_utime /* 30 */
data8 sys32_ni_syscall /* old stty syscall holder */
data8 sys32_ni_syscall /* old gtty syscall holder */
data8 sys_access
......@@ -234,7 +234,7 @@ ia32_syscall_table:
data8 sys_rmdir /* 40 */
data8 sys_dup
data8 sys32_pipe
data8 sys32_times
data8 compat_sys_times
data8 sys32_ni_syscall /* old prof syscall holder */
data8 sys32_brk /* 45 */
data8 sys_setgid /* 16-bit version */
......@@ -295,11 +295,11 @@ ia32_syscall_table:
data8 sys32_ioperm
data8 sys32_socketcall
data8 sys_syslog
data8 sys32_setitimer
data8 sys32_getitimer /* 105 */
data8 sys32_newstat
data8 sys32_newlstat
data8 sys32_newfstat
data8 compat_sys_setitimer
data8 compat_sys_getitimer /* 105 */
data8 compat_sys_newstat
data8 compat_sys_newlstat
data8 compat_sys_newfstat
data8 sys32_ni_syscall
data8 sys32_iopl /* 110 */
data8 sys_vhangup
......@@ -353,7 +353,7 @@ ia32_syscall_table:
data8 sys_sched_get_priority_max
data8 sys_sched_get_priority_min /* 160 */
data8 sys32_sched_rr_get_interval
data8 sys32_nanosleep
data8 compat_sys_nanosleep
data8 sys_mremap
data8 sys_setresuid /* 16-bit version */
data8 sys32_getresuid16 /* 16-bit version */ /* 165 */
......
......@@ -22,6 +22,7 @@
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/wait.h>
#include <linux/compat.h>
#include <asm/uaccess.h>
#include <asm/rse.h>
......@@ -165,10 +166,10 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
* sw ar.fsr(0:15)
* tag ar.fsr(16:31) with odd numbered bits not used
* (read returns 0, writes ignored)
* ipoff ar.fir(0:31) RO
* cssel ar.fir(32:47) RO
* dataoff ar.fdr(0:31) RO
* datasel ar.fdr(32:47) RO
* ipoff ar.fir(0:31)
* cssel ar.fir(32:47)
* dataoff ar.fdr(0:31)
* datasel ar.fdr(32:47)
*
* _st[(0+TOS)%8] f8
* _st[(1+TOS)%8] f9 (f8, f9 from ptregs)
......@@ -328,7 +329,7 @@ restore_ia32_fpstate_live (struct _fpstate_ia32 *save)
unsigned long num64, mxcsr;
struct _fpreg_ia32 *fpregp;
char buf[32];
unsigned long fsr, fcr;
unsigned long fsr, fcr, fir, fdr;
int fp_tos, fr8_st_map;
if (!access_ok(VERIFY_READ, save, sizeof(*save)))
......@@ -345,6 +346,8 @@ restore_ia32_fpstate_live (struct _fpstate_ia32 *save)
*/
asm volatile ( "mov %0=ar.fsr;" : "=r"(fsr));
asm volatile ( "mov %0=ar.fcr;" : "=r"(fcr));
asm volatile ( "mov %0=ar.fir;" : "=r"(fir));
asm volatile ( "mov %0=ar.fdr;" : "=r"(fdr));
__get_user(mxcsr, (unsigned int *)&save->mxcsr);
/* setting bits 0..5 8..12 with cw and 39..47 from mxcsr */
......@@ -355,14 +358,34 @@ restore_ia32_fpstate_live (struct _fpstate_ia32 *save)
/* setting bits 0..31 with sw and tag and 32..37 from mxcsr */
__get_user(lo, (unsigned int *)&save->sw);
/* set bits 15,7 (fsw.b, fsw.es) to reflect the current error status */
if ( !(lo & 0x7f) )
lo &= (~0x8080);
__get_user(hi, (unsigned int *)&save->tag);
num64 = mxcsr & 0x3f;
num64 = (num64 << 16) | (hi & 0xffff);
num64 = (num64 << 16) | (lo & 0xffff);
fsr = (fsr & (~0x3fffffffff)) | num64;
/* setting bits 0..47 with cssel and ipoff */
__get_user(lo, (unsigned int *)&save->ipoff);
__get_user(hi, (unsigned int *)&save->cssel);
num64 = hi & 0xffff;
num64 = (num64 << 32) | lo;
fir = (fir & (~0xffffffffffff)) | num64;
/* setting bits 0..47 with datasel and dataoff */
__get_user(lo, (unsigned int *)&save->dataoff);
__get_user(hi, (unsigned int *)&save->datasel);
num64 = hi & 0xffff;
num64 = (num64 << 32) | lo;
fdr = (fdr & (~0xffffffffffff)) | num64;
asm volatile ( "mov ar.fsr=%0;" :: "r"(fsr));
asm volatile ( "mov ar.fcr=%0;" :: "r"(fcr));
asm volatile ( "mov ar.fir=%0;" :: "r"(fir));
asm volatile ( "mov ar.fdr=%0;" :: "r"(fdr));
/*
* restore f8, f9 onto pt_regs
* restore f10..f15 onto live registers
......@@ -570,8 +593,8 @@ sys32_sigprocmask (int how, unsigned int *set, unsigned int *oset)
}
asmlinkage long
sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo, struct timespec32 *uts,
unsigned int sigsetsize)
sys32_rt_sigtimedwait (sigset32_t *uthese, siginfo_t32 *uinfo,
struct compat_timespec *uts, unsigned int sigsetsize)
{
extern asmlinkage long sys_rt_sigtimedwait (const sigset_t *, siginfo_t *,
const struct timespec *, size_t);
......
This diff is collapsed.
......@@ -6,9 +6,12 @@ EXTRA_TARGETS := head.o init_task.o
export-objs := ia64_ksyms.o
obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \
machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \
obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \
irq.o irq_ia64.o irq_lsapic.o ivt.o \
machvec.o pal.o process.o perfmon.o ptrace.o sal.o \
semaphore.o setup.o \
signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
obj-$(CONFIG_IOSAPIC) += iosapic.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o
obj-$(CONFIG_EFI_VARS) += efivars.o
......
......@@ -306,7 +306,7 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
u64 start;
u64 end;
} prev, curr;
void *efi_map_start, *efi_map_end, *p, *q;
void *efi_map_start, *efi_map_end, *p, *q, *r;
efi_memory_desc_t *md, *check_md;
u64 efi_desc_size, start, end, granule_addr, first_non_wb_addr = 0;
......@@ -351,11 +351,10 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
if (!(first_non_wb_addr > granule_addr))
continue; /* couldn't find enough contiguous memory */
}
/* BUG_ON((md->phys_addr >> IA64_GRANULE_SHIFT) < first_non_wb_addr); */
trim_top(md, first_non_wb_addr);
for (r = p; r < q; r += efi_desc_size)
trim_top(r, first_non_wb_addr);
}
if (is_available_memory(md)) {
if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) {
......
......@@ -29,6 +29,9 @@
*
* Changelog:
*
* 10 Dec 2002 - Matt Domsch <Matt_Domsch@dell.com>
* fix locking per Peter Chubb's findings
*
* 25 Mar 2002 - Matt Domsch <Matt_Domsch@dell.com>
* move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_unparse()
*
......@@ -73,7 +76,7 @@ MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
MODULE_DESCRIPTION("/proc interface to EFI Variables");
MODULE_LICENSE("GPL");
#define EFIVARS_VERSION "0.05 2002-Mar-26"
#define EFIVARS_VERSION "0.06 2002-Dec-10"
static int
efivar_read(char *page, char **start, off_t off,
......@@ -106,6 +109,14 @@ typedef struct _efivar_entry_t {
struct list_head list;
} efivar_entry_t;
/*
efivars_lock protects two things:
1) efivar_list - adds, removals, reads, writes
2) efi.[gs]et_variable() calls.
It must not be held when creating proc entries or calling kmalloc.
efi.get_next_variable() is only called from efivars_init(),
which is protected by the BKL, so that path is safe.
*/
static spinlock_t efivars_lock = SPIN_LOCK_UNLOCKED;
static LIST_HEAD(efivar_list);
static struct proc_dir_entry *efi_vars_dir = NULL;
......@@ -150,6 +161,7 @@ proc_calc_metrics(char *page, char **start, off_t off,
* variable_name_size = number of bytes required to hold
* variable_name (not counting the NULL
* character at the end.
* efivars_lock is not held on entry or exit.
* Returns 1 on failure, 0 on success
*/
static int
......@@ -160,10 +172,12 @@ efivar_create_proc_entry(unsigned long variable_name_size,
int i, short_name_size = variable_name_size /
sizeof(efi_char16_t) + 38;
char *short_name = kmalloc(short_name_size+1,
GFP_KERNEL);
efivar_entry_t *new_efivar = kmalloc(sizeof(efivar_entry_t),
GFP_KERNEL);
char *short_name;
efivar_entry_t *new_efivar;
short_name = kmalloc(short_name_size+1, GFP_KERNEL);
new_efivar = kmalloc(sizeof(efivar_entry_t), GFP_KERNEL);
if (!short_name || !new_efivar) {
if (short_name) kfree(short_name);
if (new_efivar) kfree(new_efivar);
......@@ -188,20 +202,19 @@ efivar_create_proc_entry(unsigned long variable_name_size,
*(short_name + strlen(short_name)) = '-';
efi_guid_unparse(vendor_guid, short_name + strlen(short_name));
/* Create the entry in proc */
new_efivar->entry = create_proc_entry(short_name, 0600, efi_vars_dir);
kfree(short_name); short_name = NULL;
if (!new_efivar->entry) return 1;
new_efivar->entry->owner = THIS_MODULE;
new_efivar->entry->data = new_efivar;
new_efivar->entry->read_proc = efivar_read;
new_efivar->entry->write_proc = efivar_write;
list_add(&new_efivar->list, &efivar_list);
spin_lock(&efivars_lock);
list_add(&new_efivar->list, &efivar_list);
spin_unlock(&efivars_lock);
return 0;
}
......@@ -319,6 +332,8 @@ efivar_write(struct file *file, const char *buffer,
kfree(efivar);
}
spin_unlock(&efivars_lock);
/* If this is a new variable, set up the proc entry for it. */
if (!found) {
efivar_create_proc_entry(utf8_strsize(var_data->VariableName,
......@@ -328,7 +343,6 @@ efivar_write(struct file *file, const char *buffer,
}
kfree(var_data);
spin_unlock(&efivars_lock);
return size;
}
......@@ -343,8 +357,6 @@ efivars_init(void)
efi_char16_t *variable_name = kmalloc(1024, GFP_KERNEL);
unsigned long variable_name_size = 1024;
spin_lock(&efivars_lock);
printk(KERN_INFO "EFI Variables Facility v%s\n", EFIVARS_VERSION);
/* Since efi.c happens before procfs is available,
......@@ -357,8 +369,6 @@ efivars_init(void)
efi_vars_dir = proc_mkdir("vars", efi_dir);
/* Per EFI spec, the maximum storage allocated for both
the variable name and variable data is 1024 bytes.
*/
......@@ -390,7 +400,6 @@ efivars_init(void)
} while (status != EFI_NOT_FOUND);
kfree(variable_name);
spin_unlock(&efivars_lock);
return 0;
}
......@@ -400,17 +409,16 @@ efivars_exit(void)
struct list_head *pos, *n;
efivar_entry_t *efivar;
spin_lock(&efivars_lock);
spin_lock(&efivars_lock);
list_for_each_safe(pos, n, &efivar_list) {
efivar = efivar_entry(pos);
remove_proc_entry(efivar->entry->name, efi_vars_dir);
list_del(&efivar->list);
kfree(efivar);
}
remove_proc_entry(efi_vars_dir->name, efi_dir);
spin_unlock(&efivars_lock);
remove_proc_entry(efi_vars_dir->name, efi_dir);
}
module_init(efivars_init);
......
......@@ -91,11 +91,12 @@ ENTRY(ia64_execve)
END(ia64_execve)
/*
* sys_clone2(u64 flags, u64 ustack_base, u64 ustack_size, u64 user_tid, u64 tls)
* sys_clone2(u64 flags, u64 ustack_base, u64 ustack_size, u64 child_tidptr, u64 parent_tidptr,
* u64 tls)
*/
GLOBAL_ENTRY(sys_clone2)
.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
alloc r16=ar.pfs,5,2,5,0
alloc r16=ar.pfs,6,2,6,0
DO_SAVE_SWITCH_STACK
adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp
mov loc0=rp
......@@ -104,9 +105,10 @@ GLOBAL_ENTRY(sys_clone2)
mov out1=in1
mov out3=in2
tbit.nz p6,p0=in0,CLONE_SETTLS_BIT
mov out4=in3 // valid only w/CLONE_SETTID and/or CLONE_CLEARTID
mov out4=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
;;
(p6) st8 [r2]=in4 // store TLS in r13 (tp)
(p6) st8 [r2]=in5 // store TLS in r16 for copy_thread()
mov out5=in4 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = &regs
dep out0=0,in0,CLONE_IDLETASK_BIT,1 // out0 = clone_flags & ~CLONE_IDLETASK
br.call.sptk.many rp=do_fork
......@@ -535,7 +537,6 @@ END(ia64_trace_syscall)
GLOBAL_ENTRY(ia64_ret_from_clone)
PT_REGS_UNWIND_INFO(0)
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
/*
* We need to call schedule_tail() to complete the scheduling process.
* Called by ia64_switch_to() after do_fork()->copy_thread(). r8 contains the
......@@ -543,7 +544,6 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
*/
br.call.sptk.many rp=ia64_invoke_schedule_tail
.ret8:
#endif
adds r2=TI_FLAGS+IA64_TASK_SIZE,r13
;;
ld4 r2=[r2]
......@@ -844,7 +844,6 @@ ENTRY(handle_syscall_error)
br.cond.sptk ia64_leave_kernel
END(handle_syscall_error)
#ifdef CONFIG_SMP
/*
* Invoke schedule_tail(task) while preserving in0-in7, which may be needed
* in case a system call gets restarted.
......@@ -861,8 +860,6 @@ GLOBAL_ENTRY(ia64_invoke_schedule_tail)
br.ret.sptk.many rp
END(ia64_invoke_schedule_tail)
#endif /* CONFIG_SMP */
#if __GNUC__ < 3
/*
......@@ -1129,18 +1126,18 @@ sys_call_table:
data8 ia64_ni_syscall /* was: ia64_oldfstat */
data8 sys_vhangup
data8 sys_lchown
data8 sys_vm86 // 1125
data8 sys_remap_file_pages // 1125
data8 sys_wait4
data8 sys_sysinfo
data8 sys_clone
data8 sys_setdomainname
data8 sys_newuname // 1130
data8 sys_adjtimex
data8 ia64_create_module
data8 ia64_ni_syscall /* was: ia64_create_module */
data8 sys_init_module
data8 sys_delete_module
data8 sys_get_kernel_syms // 1135
data8 sys_query_module
data8 ia64_ni_syscall // 1135 /* was: sys_get_kernel_syms */
data8 ia64_ni_syscall /* was: sys_query_module */
data8 sys_quotactl
data8 sys_bdflush
data8 sys_sysfs
......@@ -1160,7 +1157,7 @@ sys_call_table:
data8 sys_mlock
data8 sys_mlockall
data8 sys_mprotect // 1155
data8 sys_mremap
data8 ia64_mremap
data8 sys_msync
data8 sys_munlock
data8 sys_munlockall
......@@ -1173,11 +1170,7 @@ sys_call_table:
data8 sys_sched_get_priority_min
data8 sys_sched_rr_get_interval
data8 sys_nanosleep
#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
data8 sys_nfsservctl
#else
data8 sys_ni_syscall
#endif
data8 sys_prctl // 1170
data8 sys_getpagesize
data8 sys_mmap2
......@@ -1241,7 +1234,7 @@ sys_call_table:
data8 sys_futex // 1230
data8 sys_sched_setaffinity
data8 sys_sched_getaffinity
data8 sys_ni_syscall
data8 sys_set_tid_address
data8 sys_alloc_hugepages
data8 sys_free_hugepages // 1235
data8 sys_exit_group
......@@ -1254,10 +1247,10 @@ sys_call_table:
data8 sys_epoll_create
data8 sys_epoll_ctl
data8 sys_epoll_wait // 1245
data8 sys_restart_syscall
data8 sys_semtimedop
data8 ia64_ni_syscall
data8 ia64_ni_syscall
data8 ia64_ni_syscall
data8 ia64_ni_syscall // 1250
data8 ia64_ni_syscall
data8 ia64_ni_syscall
......
......@@ -20,7 +20,13 @@
#define MB (1024*1024UL)
#define NUM_MEM_DESCS 3
#define SIMPLE_MEMMAP 1
#if SIMPLE_MEMMAP
# define NUM_MEM_DESCS 4
#else
# define NUM_MEM_DESCS 16
#endif
static char fw_mem[( sizeof(struct ia64_boot_param)
+ sizeof(efi_system_table_t)
......@@ -379,6 +385,17 @@ sys_fw_init (const char *args, int arglen)
struct ia64_boot_param *bp;
unsigned char checksum = 0;
char *cp, *cmd_line;
int i = 0;
# define MAKE_MD(typ, attr, start, end) \
do { \
md = efi_memmap + i++; \
md->type = typ; \
md->pad = 0; \
md->phys_addr = start; \
md->virt_addr = 0; \
md->num_pages = (end - start) >> 12; \
md->attribute = attr; \
} while (0)
memset(fw_mem, 0, sizeof(fw_mem));
......@@ -464,47 +481,29 @@ sys_fw_init (const char *args, int arglen)
sal_systab->checksum = -checksum;
#if SIMPLE_MEMMAP
/* simulate free memory at physical address zero */
md = &efi_memmap[0];
md->type = EFI_BOOT_SERVICES_DATA;
md->pad = 0;
md->phys_addr = 0*MB;
md->virt_addr = 0;
md->num_pages = (1*MB) >> 12; /* 1MB (in 4KB pages) */
md->attribute = EFI_MEMORY_WB;
/* fill in a memory descriptor: */
md = &efi_memmap[1];
md->type = EFI_CONVENTIONAL_MEMORY;
md->pad = 0;
md->phys_addr = 2*MB;
md->virt_addr = 0;
md->num_pages = (128*MB) >> 12; /* 128MB (in 4KB pages) */
md->attribute = EFI_MEMORY_WB;
/* descriptor for firmware emulator: */
md = &efi_memmap[2];
md->type = EFI_PAL_CODE;
md->pad = 0;
md->phys_addr = 1*MB;
md->virt_addr = 1*MB;
md->num_pages = (1*MB) >> 12; /* 1MB (in 4KB pages) */
md->attribute = EFI_MEMORY_WB;
#if 0
/*
* XXX bootmem is broken for now... (remember to NUM_MEM_DESCS
* if you re-enable this!)
*/
/* descriptor for high memory (>4GB): */
md = &efi_memmap[3];
md->type = EFI_CONVENTIONAL_MEMORY;
md->pad = 0;
md->phys_addr = 4096*MB;
md->virt_addr = 0;
md->num_pages = (32*MB) >> 12; /* 32MB (in 4KB pages) */
md->attribute = EFI_MEMORY_WB;
MAKE_MD(EFI_BOOT_SERVICES_DATA, EFI_MEMORY_WB, 0*MB, 1*MB);
MAKE_MD(EFI_PAL_CODE, EFI_MEMORY_WB, 1*MB, 2*MB);
MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 2*MB, 130*MB);
MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 4096*MB, 4128*MB);
#else
MAKE_MD( 4, 0x9, 0x0000000000000000, 0x0000000000001000);
MAKE_MD( 7, 0x9, 0x0000000000001000, 0x000000000008a000);
MAKE_MD( 4, 0x9, 0x000000000008a000, 0x00000000000a0000);
MAKE_MD( 5, 0x8000000000000009, 0x00000000000c0000, 0x0000000000100000);
MAKE_MD( 7, 0x9, 0x0000000000100000, 0x0000000004400000);
MAKE_MD( 2, 0x9, 0x0000000004400000, 0x0000000004be5000);
MAKE_MD( 7, 0x9, 0x0000000004be5000, 0x000000007f77e000);
MAKE_MD( 6, 0x8000000000000009, 0x000000007f77e000, 0x000000007fb94000);
MAKE_MD( 6, 0x8000000000000009, 0x000000007fb94000, 0x000000007fb95000);
MAKE_MD( 6, 0x8000000000000009, 0x000000007fb95000, 0x000000007fc00000);
MAKE_MD(13, 0x8000000000000009, 0x000000007fc00000, 0x000000007fc3a000);
MAKE_MD( 7, 0x9, 0x000000007fc3a000, 0x000000007fea0000);
MAKE_MD( 5, 0x8000000000000009, 0x000000007fea0000, 0x000000007fea8000);
MAKE_MD( 7, 0x9, 0x000000007fea8000, 0x000000007feab000);
MAKE_MD( 5, 0x8000000000000009, 0x000000007feab000, 0x000000007ffff000);
MAKE_MD( 7, 0x9, 0x00000000ff400000, 0x0000000104000000);
#endif
bp->efi_systab = __pa(&fw_mem);
......
......@@ -86,7 +86,7 @@ EXPORT_SYMBOL(cpu_online_map);
EXPORT_SYMBOL(ia64_cpu_to_sapicid);
#else /* !CONFIG_SMP */
EXPORT_SYMBOL(__flush_tlb_all);
EXPORT_SYMBOL(local_flush_tlb_all);
#endif /* !CONFIG_SMP */
......
......@@ -69,10 +69,10 @@ u64 ia64_mca_stackframe[32];
u64 ia64_mca_bspstore[1024];
u64 ia64_init_stack[KERNEL_STACK_SIZE] __attribute__((aligned(16)));
u64 ia64_mca_sal_data_area[1356];
u64 ia64_mca_min_state_save_info;
u64 ia64_tlb_functional;
u64 ia64_os_mca_recovery_successful;
/* TODO: need to assign min-state structure to UC memory */
u64 ia64_mca_min_state_save_info[MIN_STATE_AREA_SIZE] __attribute__((aligned(512)));
static void ia64_mca_wakeup_ipi_wait(void);
static void ia64_mca_wakeup(int cpu);
static void ia64_mca_wakeup_all(void);
......@@ -116,7 +116,7 @@ static struct irqaction mca_cpe_irqaction = {
* Outputs : platform error status
*/
int
ia64_mca_log_sal_error_record(int sal_info_type)
ia64_mca_log_sal_error_record(int sal_info_type, int called_from_init)
{
int platform_err = 0;
......@@ -131,7 +131,10 @@ ia64_mca_log_sal_error_record(int sal_info_type)
*/
platform_err = ia64_log_print(sal_info_type, (prfunc_t)printk);
ia64_sal_clear_state_info(sal_info_type);
/* temporary: only clear SAL logs on hardware-corrected errors
or if we're logging an error after an MCA-initiated reboot */
if ((sal_info_type > 1) || (called_from_init))
ia64_sal_clear_state_info(sal_info_type);
return platform_err;
}
......@@ -152,7 +155,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
IA64_MCA_DEBUG("ia64_mca_cpe_int_handler: received interrupt. vector = %#x\n", cpe_irq);
/* Get the CMC error record and log it */
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE, 0);
}
/*
......@@ -199,13 +202,15 @@ ia64_mca_init_platform (void)
*
* Outputs : None
*/
void
int
ia64_mca_check_errors (void)
{
/*
* If there is an MCA error record pending, get it and log it.
*/
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA, 1);
return 0;
}
device_initcall(ia64_mca_check_errors);
......@@ -237,49 +242,26 @@ ia64_mca_register_cpev (int cpev)
#endif /* PLATFORM_MCA_HANDLERS */
static char *min_state_labels[] = {
"nat",
"r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8",
"r9", "r10","r11", "r12","r13","r14", "r15",
"b0r16","b0r17", "b0r18", "b0r19", "b0r20",
"b0r21", "b0r22","b0r23", "b0r24", "b0r25",
"b0r26", "b0r27", "b0r28","b0r29", "b0r30", "b0r31",
"r16", "r17", "r18","r19", "r20", "r21","r22",
"r23", "r24","r25", "r26", "r27","r28", "r29", "r30","r31",
"preds", "br0", "rsc",
"iip", "ipsr", "ifs",
"xip", "xpsr", "xfs"
};
int ia64_pmss_dump_bank0=0; /* dump bank 0 ? */
/*
* routine to process and prepare to dump min_state_save
* information for debugging purposes.
*
*/
void
ia64_process_min_state_save (pal_min_state_area_t *pmss, struct pt_regs *ptregs)
ia64_process_min_state_save (pal_min_state_area_t *pmss)
{
int i, max=57;
u64 *tpmss_ptr=(u64 *)pmss;
int i, max = MIN_STATE_AREA_SIZE;
u64 *tpmss_ptr = (u64 *)pmss;
u64 *return_min_state_ptr = ia64_mca_min_state_save_info;
/* dump out the min_state_area information */
for (i=0;i<max;i++) {
if(!ia64_pmss_dump_bank0) {
if(strncmp("B0",min_state_labels[i],2)==0) {
tpmss_ptr++; /* skip to next entry */
continue;
}
}
printk("%5s=0x%16.16lx ",min_state_labels[i],*tpmss_ptr++);
/* copy min-state register info for eventual return to PAL */
*return_min_state_ptr++ = *tpmss_ptr;
if (((i+1)%3)==0 || ((!strcmp("GR16",min_state_labels[i]))
&& !ia64_pmss_dump_bank0))
printk("\n");
tpmss_ptr++; /* skip to next entry */
}
}
......@@ -525,19 +507,17 @@ ia64_mca_init(void)
ia64_log_init(SAL_INFO_TYPE_CMC);
ia64_log_init(SAL_INFO_TYPE_CPE);
/* Zero the min state save info */
ia64_mca_min_state_save_info = 0;
#if defined(MCA_TEST)
mca_test();
#endif /* #if defined(MCA_TEST) */
printk("Mca related initialization done\n");
#if 0 // Too early in initialization -- error log is lost
/* commented out because this is done elsewhere */
#if 0
/* Do post-failure MCA error logging */
ia64_mca_check_errors();
#endif // Too early in initialization -- error log is lost
#endif
}
/*
......@@ -632,7 +612,6 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg, struct pt_regs *ptregs)
int cpu = 0;
/* Mask all interrupts */
#warning XXX fix me: this used to be: save_and_cli(flags);
local_irq_save(flags);
#ifdef CONFIG_SMP
......@@ -709,8 +688,8 @@ ia64_return_to_sal_check(void)
ia64_os_to_sal_handoff_state.imots_context = IA64_MCA_SAME_CONTEXT;
/* Register pointer to new min state values */
/* NOTE: need to do something with this during recovery phase */
ia64_os_to_sal_handoff_state.imots_new_min_state = &ia64_mca_min_state_save_info;
ia64_os_to_sal_handoff_state.imots_new_min_state =
ia64_mca_min_state_save_info;
}
/*
......@@ -735,7 +714,7 @@ ia64_mca_ucmc_handler(void)
int platform_err = 0;
/* Get the MCA error record and log it */
platform_err = ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
platform_err = ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA, 0);
/*
* Do Platform-specific mca error handling if required.
......@@ -775,7 +754,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs)
cmc_irq, smp_processor_id());
/* Get the CMC error record and log it */
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC);
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC, 0);
}
/*
......@@ -845,8 +824,7 @@ ia64_init_handler (struct pt_regs *regs)
plog_ptr=(ia64_err_rec_t *)IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_INIT);
proc_ptr = &plog_ptr->proc_err;
ia64_process_min_state_save(&proc_ptr->processor_static_info.min_state_area,
regs);
ia64_process_min_state_save(&proc_ptr->processor_static_info.min_state_area);
/* Clear the INIT SAL logs now that they have been saved in the OS buffer */
ia64_sal_clear_state_info(SAL_INFO_TYPE_INIT);
......@@ -1677,6 +1655,9 @@ ia64_log_proc_dev_err_info_print (sal_log_processor_info_t *slpi,
if (slpi->valid.psi_static_struct) {
spsi = (sal_processor_static_info_t *)p_data;
/* copy interrupted context PAL min-state info */
ia64_process_min_state_save(&spsi->min_state_area);
/* Print branch register contents if valid */
if (spsi->valid.br)
ia64_log_processor_regs_print(spsi->br, 8, "Branch", "br",
......
......@@ -101,26 +101,15 @@ static const char *rse_hints[]={
#define RSE_HINTS_COUNT (sizeof(rse_hints)/sizeof(const char *))
/*
* The current revision of the Volume 2 (July 2000) of
* IA-64 Architecture Software Developer's Manual is wrong.
* Table 4-10 has invalid information concerning the ma field:
* Correct table is:
* bit 0 - 001 - UC
* bit 4 - 100 - UC
* bit 5 - 101 - UCE
* bit 6 - 110 - WC
* bit 7 - 111 - NatPage
*/
static const char *mem_attrib[]={
"Write Back (WB)", /* 000 */
"Uncacheable (UC)", /* 001 */
"Reserved", /* 010 */
"Reserved", /* 011 */
"Uncacheable (UC)", /* 100 */
"Uncacheable Exported (UCE)", /* 101 */
"Write Coalescing (WC)", /* 110 */
"NaTPage" /* 111 */
"WB", /* 000 */
"SW", /* 001 */
"010", /* 010 */
"011", /* 011 */
"UC", /* 100 */
"UCE", /* 101 */
"WC", /* 110 */
"NaTPage" /* 111 */
};
/*
......@@ -315,6 +304,7 @@ vm_info(char *page)
pal_vm_info_2_u_t vm_info_2;
pal_tc_info_u_t tc_info;
ia64_ptce_info_t ptce;
const char *sep;
int i, j;
s64 status;
......@@ -339,7 +329,15 @@ vm_info(char *page)
if (ia64_pal_mem_attrib(&attrib) != 0) return 0;
p += sprintf(p, "Supported memory attributes : %s\n", mem_attrib[attrib&0x7]);
p += sprintf(p, "Supported memory attributes : ");
sep = "";
for (i = 0; i < 8; i++) {
if (attrib & (1 << i)) {
p += sprintf(p, "%s%s", sep, mem_attrib[i]);
sep = ", ";
}
}
p += sprintf(p, "\n");
if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
printk("ia64_pal_vm_page_size=%ld\n", status);
......
......@@ -10,6 +10,7 @@
#include <linux/pm.h>
#include <linux/elf.h>
#include <linux/errno.h>
#include <linux/kallsyms.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/module.h>
......@@ -376,36 +377,12 @@ copy_thread (int nr, unsigned long clone_flags,
/* clear list of sampling buffer to free for new task */
p->thread.pfm_smpl_buf_list = NULL;
if (current->thread.pfm_context) retval = pfm_inherit(p, child_ptregs);
if (current->thread.pfm_context)
retval = pfm_inherit(p, child_ptregs);
#endif
return retval;
}
void
do_copy_regs (struct unw_frame_info *info, void *arg)
{
do_copy_task_regs(current, info, arg);
}
void
do_dump_fpu (struct unw_frame_info *info, void *arg)
{
do_dump_task_fpu(current, info, arg);
}
void
ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
{
unw_init_running(do_copy_regs, dst);
}
int
dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
{
unw_init_running(do_dump_fpu, dst);
return 1; /* f0-f31 are always valid so we always return 1 */
}
static void
do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg)
{
......@@ -497,36 +474,59 @@ do_dump_task_fpu (struct task_struct *task, struct unw_frame_info *info, void *a
memcpy(dst + 32, task->thread.fph, 96*16);
}
int dump_task_regs(struct task_struct *task, elf_gregset_t *regs)
void
do_copy_regs (struct unw_frame_info *info, void *arg)
{
do_copy_task_regs(current, info, arg);
}
void
do_dump_fpu (struct unw_frame_info *info, void *arg)
{
do_dump_task_fpu(current, info, arg);
}
int
dump_task_regs(struct task_struct *task, elf_gregset_t *regs)
{
struct unw_frame_info tcore_info;
if(current == task) {
if (current == task) {
unw_init_running(do_copy_regs, regs);
}
else {
memset(&tcore_info, 0, sizeof(tcore_info));
} else {
memset(&tcore_info, 0, sizeof(tcore_info));
unw_init_from_blocked_task(&tcore_info, task);
do_copy_task_regs(task, &tcore_info, regs);
}
return 1;
}
int dump_task_fpu (struct task_struct *task, elf_fpregset_t *dst)
void
ia64_elf_core_copy_regs (struct pt_regs *pt, elf_gregset_t dst)
{
unw_init_running(do_copy_regs, dst);
}
int
dump_task_fpu (struct task_struct *task, elf_fpregset_t *dst)
{
struct unw_frame_info tcore_info;
if(current == task) {
if (current == task) {
unw_init_running(do_dump_fpu, dst);
}
else {
memset(&tcore_info, 0, sizeof(tcore_info));
} else {
memset(&tcore_info, 0, sizeof(tcore_info));
unw_init_from_blocked_task(&tcore_info, task);
do_dump_task_fpu(task, &tcore_info, dst);
}
return 1;
}
return 1;
int
dump_fpu (struct pt_regs *pt, elf_fpregset_t dst)
{
unw_init_running(do_dump_fpu, dst);
return 1; /* f0-f31 are always valid so we always return 1 */
}
asmlinkage long
......
/*
* Kernel support for the ptrace() and syscall tracing interfaces.
*
* Copyright (C) 1999-2001 Hewlett-Packard Co
* Copyright (C) 1999-2002 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*
* Derived from the x86 and Alpha versions. Most of the code in here
......@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
......@@ -460,6 +461,60 @@ user_flushrs (struct task_struct *task, struct pt_regs *pt)
pt->loadrs = 0;
}
static inline void
sync_user_rbs_one_thread (struct task_struct *p, int make_writable)
{
struct switch_stack *sw;
unsigned long urbs_end;
struct pt_regs *pt;
sw = (struct switch_stack *) (p->thread.ksp + 16);
pt = ia64_task_regs(p);
urbs_end = ia64_get_user_rbs_end(p, pt, NULL);
ia64_sync_user_rbs(p, sw, pt->ar_bspstore, urbs_end);
if (make_writable)
user_flushrs(p, pt);
}
struct task_list {
struct task_list *next;
struct task_struct *task;
};
#ifdef CONFIG_SMP
static inline void
collect_task (struct task_list **listp, struct task_struct *p, int make_writable)
{
struct task_list *e;
e = kmalloc(sizeof(*e), GFP_KERNEL);
if (!e)
/* oops, can't collect more: finish at least what we collected so far... */
return;
get_task_struct(p);
e->task = p;
e->next = *listp;
*listp = e;
}
static inline struct task_list *
finish_task (struct task_list *list, int make_writable)
{
struct task_list *next = list->next;
sync_user_rbs_one_thread(list->task, make_writable);
put_task_struct(list->task);
kfree(list);
return next;
}
#else
# define collect_task(list, p, make_writable) sync_user_rbs_one_thread(p, make_writable)
# define finish_task(list, make_writable) (NULL)
#endif
/*
* Synchronize the RSE backing store of CHILD and all tasks that share the address space
* with it. CHILD_URBS_END is the address of the end of the register backing store of
......@@ -473,7 +528,6 @@ static void
threads_sync_user_rbs (struct task_struct *child, unsigned long child_urbs_end, int make_writable)
{
struct switch_stack *sw;
unsigned long urbs_end;
struct task_struct *g, *p;
struct mm_struct *mm;
struct pt_regs *pt;
......@@ -493,20 +547,27 @@ threads_sync_user_rbs (struct task_struct *child, unsigned long child_urbs_end,
if (make_writable)
user_flushrs(child, pt);
} else {
/*
* Note: we can't call ia64_sync_user_rbs() while holding the
* tasklist_lock because that may cause a dead-lock: ia64_sync_user_rbs()
* may indirectly call tlb_flush_all(), which triggers an IPI.
* Furthermore, tasklist_lock is acquired by fork() with interrupts
* disabled, so with the right timing, the IPI never completes, hence
* tasklist_lock never gets released, hence fork() never completes...
*/
struct task_list *list = NULL;
read_lock(&tasklist_lock);
{
do_each_thread(g, p) {
if (p->mm == mm && p->state != TASK_RUNNING) {
sw = (struct switch_stack *) (p->thread.ksp + 16);
pt = ia64_task_regs(p);
urbs_end = ia64_get_user_rbs_end(p, pt, NULL);
ia64_sync_user_rbs(p, sw, pt->ar_bspstore, urbs_end);
if (make_writable)
user_flushrs(p, pt);
}
if (p->mm == mm && p->state != TASK_RUNNING)
collect_task(&list, p, make_writable);
} while_each_thread(g, p);
}
read_unlock(&tasklist_lock);
while (list)
list = finish_task(list, make_writable);
}
child->thread.flags |= IA64_THREAD_KRBS_SYNCED; /* set the flag in the child thread only */
}
......
......@@ -77,7 +77,7 @@ ia64_sal_strerror (long status)
return str;
}
static void __init
void __init
ia64_sal_handler_init (void *entry_point, void *gpval)
{
/* fill in the SAL procedure descriptor and point ia64_sal to it: */
......
......@@ -364,11 +364,13 @@ setup_arch (char **cmdline_p)
#ifdef CONFIG_ACPI_BOOT
/* Initialize the ACPI boot-time table parser */
acpi_table_init(*cmdline_p);
#ifdef CONFIG_ACPI_NUMA
# ifdef CONFIG_ACPI_NUMA
acpi_numa_init();
#endif
# endif
#else
# ifdef CONFIG_SMP
smp_build_cpu_map(); /* happens, e.g., with the Ski simulator */
# endif
#endif /* CONFIG_APCI_BOOT */
find_memory();
......@@ -469,9 +471,18 @@ show_cpuinfo (struct seq_file *m, void *v)
# define lpj loops_per_jiffy
# define cpunum 0
#endif
char family[32], features[128], *cp;
static struct {
unsigned long mask;
const char *feature_name;
} feature_bits[] = {
{ 1UL << 0, "branchlong" },
{ 1UL << 1, "spontaneous deferral"},
{ 1UL << 2, "16-byte atomic ops" }
};
char family[32], features[128], *cp, sep;
struct cpuinfo_ia64 *c = v;
unsigned long mask;
int i;
mask = c->features;
......@@ -484,13 +495,24 @@ show_cpuinfo (struct seq_file *m, void *v)
/* build the feature string: */
memcpy(features, " standard", 10);
cp = features;
if (mask & 1) {
strcpy(cp, " branchlong");
cp = strchr(cp, '\0');
mask &= ~1UL;
sep = 0;
for (i = 0; i < sizeof(feature_bits)/sizeof(feature_bits[0]); ++i) {
if (mask & feature_bits[i].mask) {
if (sep)
*cp++ = sep;
sep = ',';
*cp++ = ' ';
strcpy(cp, feature_bits[i].feature_name);
cp += strlen(feature_bits[i].feature_name);
mask &= ~feature_bits[i].mask;
}
}
if (mask)
if (mask) {
/* print unknown features as a hex value: */
if (sep)
*cp++ = sep;
sprintf(cp, " 0x%lx", mask);
}
seq_printf(m,
"processor : %d\n"
......@@ -630,9 +652,8 @@ cpu_init (void)
* "NR_CPUS" pages for all CPUs to avoid that AP calls get_zeroed_page().
*/
if (smp_processor_id() == 0) {
cpu_data = (unsigned long) __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS,
PERCPU_PAGE_SIZE,
__pa(MAX_DMA_ADDRESS));
cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS, PERCPU_PAGE_SIZE,
__pa(MAX_DMA_ADDRESS));
for (cpu = 0; cpu < NR_CPUS; cpu++) {
memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
__per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start;
......
......@@ -385,15 +385,14 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set,
frame = (void *) scr->pt.r12;
tramp_addr = GATE_ADDR + (ia64_sigtramp - __start_gate_section);
if (ka->sa.sa_flags & SA_ONSTACK) {
if ((ka->sa.sa_flags & SA_ONSTACK) && sas_ss_flags((unsigned long) frame) == 0) {
frame = (void *) ((current->sas_ss_sp + current->sas_ss_size)
& ~(STACK_ALIGN - 1));
/*
* We need to check the memory and register stacks separately, because
* they're switched separately (memory stack is switched in the kernel,
* register stack is switched in the signal trampoline).
* We need to check for the register stack being on the signal stack
* separately, because it's switched separately (memory stack is switched
* in the kernel, register stack is switched in the signal trampoline).
*/
if (!on_sig_stack((unsigned long) frame))
frame = (void *) ((current->sas_ss_sp + current->sas_ss_size)
& ~(STACK_ALIGN - 1));
if (!rbs_on_sig_stack(scr->pt.ar_bspstore))
new_rbs = (current->sas_ss_sp + sizeof(long) - 1) & ~(sizeof(long) - 1);
}
......@@ -453,16 +452,14 @@ static long
handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset,
struct sigscratch *scr)
{
#ifdef CONFIG_IA32_SUPPORT
if (IS_IA32_PROCESS(&scr->pt)) {
/* send signal to IA-32 process */
if (!ia32_setup_frame1(sig, ka, info, oldset, &scr->pt))
return 0;
} else
#endif
/* send signal to IA-64 process */
if (!setup_frame(sig, ka, info, oldset, scr))
return 0;
/* send signal to IA-64 process */
if (!setup_frame(sig, ka, info, oldset, scr))
return 0;
if (ka->sa.sa_flags & SA_ONESHOT)
ka->sa.sa_handler = SIG_DFL;
......@@ -490,6 +487,7 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
siginfo_t info;
long restart = in_syscall;
long errno = scr->pt.r8;
# define ERR_CODE(c) (IS_IA32_PROCESS(&scr->pt) ? -(c) : (c))
/*
* In the ia64_leave_kernel code path, we want the common case to go fast, which
......@@ -502,7 +500,6 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
if (!oldset)
oldset = &current->blocked;
#ifdef CONFIG_IA32_SUPPORT
if (IS_IA32_PROCESS(&scr->pt)) {
if (in_syscall) {
if (errno >= 0)
......@@ -510,9 +507,7 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
else
errno = -errno;
}
} else
#endif
if (scr->pt.r10 != -1)
} else if (scr->pt.r10 != -1)
/*
* A system calls has to be restarted only if one of the error codes
* ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10
......@@ -531,25 +526,24 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
if (restart) {
switch (errno) {
case ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn = do_no_restart_syscall;
case ERESTARTNOHAND:
scr->pt.r8 = ERR_CODE(EINTR);
/* note: scr->pt.r10 is already -1 */
break;
case ERESTARTSYS:
if ((ka->sa.sa_flags & SA_RESTART) == 0) {
case ERESTARTNOHAND:
#ifdef CONFIG_IA32_SUPPORT
if (IS_IA32_PROCESS(&scr->pt))
scr->pt.r8 = -EINTR;
else
#endif
scr->pt.r8 = EINTR;
scr->pt.r8 = ERR_CODE(EINTR);
/* note: scr->pt.r10 is already -1 */
break;
}
case ERESTARTNOINTR:
#ifdef CONFIG_IA32_SUPPORT
if (IS_IA32_PROCESS(&scr->pt)) {
scr->pt.r8 = scr->pt.r1;
scr->pt.cr_iip -= 2;
} else
#endif
ia64_decrement_ip(&scr->pt);
}
}
......@@ -565,19 +559,26 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
/* Did we come from a system call? */
if (restart) {
/* Restart the system call - no handlers present */
if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR) {
#ifdef CONFIG_IA32_SUPPORT
if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR
|| errno == ERESTART_RESTARTBLOCK)
{
if (IS_IA32_PROCESS(&scr->pt)) {
scr->pt.r8 = scr->pt.r1;
scr->pt.cr_iip -= 2;
} else
#endif
/*
* Note: the syscall number is in r15 which is saved in pt_regs so
* all we need to do here is adjust ip so that the "break"
* instruction gets re-executed.
*/
ia64_decrement_ip(&scr->pt);
if (errno == ERESTART_RESTARTBLOCK) {
scr->pt.r8 = 0; /* x86 version of __NR_restart_syscall */
scr->pt.cr_iip -= 2;
}
} else {
/*
* Note: the syscall number is in r15 which is saved in
* pt_regs so all we need to do here is adjust ip so that
* the "break" instruction gets re-executed.
*/
ia64_decrement_ip(&scr->pt);
if (errno == ERESTART_RESTARTBLOCK)
scr->pt.r15 = __NR_restart_syscall;
}
}
}
return 0;
......
......@@ -206,8 +206,27 @@ smp_send_reschedule_all (void)
void
smp_flush_tlb_all (void)
{
smp_call_function((void (*)(void *))__flush_tlb_all, 0, 1, 1);
__flush_tlb_all();
smp_call_function((void (*)(void *))local_flush_tlb_all, 0, 1, 1);
local_flush_tlb_all();
}
void
smp_flush_tlb_mm (struct mm_struct *mm)
{
local_finish_flush_tlb_mm(mm);
/* this happens for the common case of a single-threaded fork(): */
if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1))
return;
/*
* We could optimize this further by using mm->cpu_vm_mask to track which CPUs
* have been running in the address space. It's not clear that this is worth the
* trouble though: to avoid races, we have to raise the IPI on the target CPU
* anyhow, and once a CPU is interrupted, the cost of local_flush_tlb_all() is
* rather trivial.
*/
smp_call_function((void (*)(void *))local_finish_flush_tlb_mm, mm, 1, 1);
}
/*
......
......@@ -337,7 +337,7 @@ fork_by_hand (void)
* don't care about the eip and regs settings since we'll never reschedule the
* forked task.
*/
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, 0, 0, NULL);
return do_fork(CLONE_VM|CLONE_IDLETASK, 0, 0, 0, NULL, NULL);
}
static int __init
......@@ -499,7 +499,7 @@ smp_prepare_cpus (unsigned int max_cpus)
/*
* If SMP should be disabled, then really disable it!
*/
if (!max_cpus || (max_cpus < -1)) {
if (!max_cpus) {
printk(KERN_INFO "SMP mode deactivated.\n");
cpu_online_map = phys_cpu_present_map = 1;
return;
......
......@@ -12,6 +12,7 @@
#include <linux/hugetlb.h>
#include <linux/mman.h>
#include <linux/sched.h>
#include <linux/shm.h>
#include <linux/file.h> /* doh, must come after sched.h... */
#include <linux/smp.h>
#include <linux/smp_lock.h>
......@@ -317,22 +318,26 @@ sys_free_hugepages (unsigned long addr)
#endif /* !CONFIG_HUGETLB_PAGE */
asmlinkage long
sys_vm86 (long arg0, long arg1, long arg2, long arg3)
{
printk(KERN_ERR "sys_vm86(%lx, %lx, %lx, %lx)!\n", arg0, arg1, arg2, arg3);
return -ENOSYS;
}
asmlinkage unsigned long
ia64_create_module (const char *name_user, size_t size)
ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags,
unsigned long new_addr)
{
extern unsigned long sys_create_module (const char *, size_t);
unsigned long addr;
extern unsigned long do_mremap (unsigned long addr,
unsigned long old_len,
unsigned long new_len,
unsigned long flags,
unsigned long new_addr);
addr = sys_create_module (name_user, size);
if (!IS_ERR((void *) addr))
force_successful_syscall_return();
down_write(&current->mm->mmap_sem);
{
addr = do_mremap(addr, old_len, new_len, flags, new_addr);
}
up_write(&current->mm->mmap_sem);
if (IS_ERR((void *) addr))
return addr;
force_successful_syscall_return();
return addr;
}
......
......@@ -5,6 +5,10 @@
* Stephane Eranian <eranian@hpl.hp.com>
* David Mosberger-Tang <davidm@hpl.hp.com>
*
* 2002/12/09 Fix rotating register handling (off-by-1 error, missing fr-rotation). Fix
* get_rse_reg() to not leak kernel bits to user-level (reading an out-of-frame
* stacked register returns an undefined value; it does NOT trigger a
* "rsvd register fault").
* 2001/10/11 Fix unaligned access to rotating registers in s/w pipelined loops.
* 2001/08/13 Correct size of extended floats (float_fsz) from 16 to 10 bytes.
* 2001/01/17 Add support emulation of unaligned kernel accesses.
......@@ -276,6 +280,15 @@ invala_fr (int regno)
# undef F
}
static inline unsigned long
rotate_reg (unsigned long sor, unsigned long rrb, unsigned long reg)
{
reg += rrb;
if (reg >= sor)
reg -= sor;
return reg;
}
static void
set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat)
{
......@@ -287,26 +300,22 @@ set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat)
long sof = (regs->cr_ifs) & 0x7f;
long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
long rrb_gr = (regs->cr_ifs >> 18) & 0x7f;
long ridx;
if ((r1 - 32) > sor)
ridx = -sof + (r1 - 32);
else if ((r1 - 32) < (sor - rrb_gr))
ridx = -sof + (r1 - 32) + rrb_gr;
else
ridx = -sof + (r1 - 32) - (sor - rrb_gr);
DPRINT("r%lu, sw.bspstore=%lx pt.bspstore=%lx sof=%ld sol=%ld ridx=%ld\n",
r1, sw->ar_bspstore, regs->ar_bspstore, sof, (regs->cr_ifs >> 7) & 0x7f, ridx);
long ridx = r1 - 32;
if ((r1 - 32) >= sof) {
if (ridx >= sof) {
/* this should never happen, as the "rsvd register fault" has higher priority */
DPRINT("ignoring write to r%lu; only %lu registers are allocated!\n", r1, sof);
return;
}
if (ridx < sor)
ridx = rotate_reg(sor, rrb_gr, ridx);
DPRINT("r%lu, sw.bspstore=%lx pt.bspstore=%lx sof=%ld sol=%ld ridx=%ld\n",
r1, sw->ar_bspstore, regs->ar_bspstore, sof, (regs->cr_ifs >> 7) & 0x7f, ridx);
on_kbs = ia64_rse_num_regs(kbs, (unsigned long *) sw->ar_bspstore);
addr = ia64_rse_skip_regs((unsigned long *) sw->ar_bspstore, ridx);
addr = ia64_rse_skip_regs((unsigned long *) sw->ar_bspstore, -sof + ridx);
if (addr >= kbs) {
/* the register is on the kernel backing store: easy... */
rnat_addr = ia64_rse_rnat_addr(addr);
......@@ -334,7 +343,7 @@ set_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long val, int nat)
bspstore = (unsigned long *)regs->ar_bspstore;
ubs_end = ia64_rse_skip_regs(bspstore, on_kbs);
bsp = ia64_rse_skip_regs(ubs_end, -sof);
addr = ia64_rse_skip_regs(bsp, ridx + sof);
addr = ia64_rse_skip_regs(bsp, ridx);
DPRINT("ubs_end=%p bsp=%p addr=%p\n", (void *) ubs_end, (void *) bsp, (void *) addr);
......@@ -368,26 +377,22 @@ get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int *na
long sof = (regs->cr_ifs) & 0x7f;
long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
long rrb_gr = (regs->cr_ifs >> 18) & 0x7f;
long ridx;
long ridx = r1 - 32;
if ((r1 - 32) > sor)
ridx = -sof + (r1 - 32);
else if ((r1 - 32) < (sor - rrb_gr))
ridx = -sof + (r1 - 32) + rrb_gr;
else
ridx = -sof + (r1 - 32) - (sor - rrb_gr);
if (ridx >= sof) {
/* read of out-of-frame register returns an undefined value; 0 in our case. */
DPRINT("ignoring read from r%lu; only %lu registers are allocated!\n", r1, sof);
goto fail;
}
if (ridx < sor)
ridx = rotate_reg(sor, rrb_gr, ridx);
DPRINT("r%lu, sw.bspstore=%lx pt.bspstore=%lx sof=%ld sol=%ld ridx=%ld\n",
r1, sw->ar_bspstore, regs->ar_bspstore, sof, (regs->cr_ifs >> 7) & 0x7f, ridx);
if ((r1 - 32) >= sof) {
/* this should never happen, as the "rsvd register fault" has higher priority */
DPRINT("ignoring read from r%lu; only %lu registers are allocated!\n", r1, sof);
return;
}
on_kbs = ia64_rse_num_regs(kbs, (unsigned long *) sw->ar_bspstore);
addr = ia64_rse_skip_regs((unsigned long *) sw->ar_bspstore, ridx);
addr = ia64_rse_skip_regs((unsigned long *) sw->ar_bspstore, -sof + ridx);
if (addr >= kbs) {
/* the register is on the kernel backing store: easy... */
*val = *addr;
......@@ -407,13 +412,13 @@ get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int *na
*/
if (regs->r12 >= TASK_SIZE) {
DPRINT("ignoring kernel read of r%lu; register isn't on the RBS!", r1);
return;
goto fail;
}
bspstore = (unsigned long *)regs->ar_bspstore;
ubs_end = ia64_rse_skip_regs(bspstore, on_kbs);
bsp = ia64_rse_skip_regs(ubs_end, -sof);
addr = ia64_rse_skip_regs(bsp, ridx + sof);
addr = ia64_rse_skip_regs(bsp, ridx);
DPRINT("ubs_end=%p bsp=%p addr=%p\n", (void *) ubs_end, (void *) bsp, (void *) addr);
......@@ -428,6 +433,13 @@ get_rse_reg (struct pt_regs *regs, unsigned long r1, unsigned long *val, int *na
ia64_peek(current, sw, (unsigned long) ubs_end, (unsigned long) rnat_addr, &rnats);
*nat = (rnats & nat_mask) != 0;
}
return;
fail:
*val = 0;
if (nat)
*nat = 0;
return;
}
......@@ -486,7 +498,16 @@ setreg (unsigned long regnum, unsigned long val, int nat, struct pt_regs *regs)
DPRINT("*0x%lx=0x%lx NaT=%d new unat: %p=%lx\n", addr, val, nat, (void *) unat,*unat);
}
#define IA64_FPH_OFFS(r) (r - IA64_FIRST_ROTATING_FR)
/*
* Return the (rotated) index for floating point register REGNUM (REGNUM must be in the
* range from 32-127, result is in the range from 0-95.
*/
static inline unsigned long
fph_index (struct pt_regs *regs, long regnum)
{
unsigned long rrb_fr = (regs->cr_ifs >> 25) & 0x7f;
return rotate_reg(96, rrb_fr, (regnum - IA64_FIRST_ROTATING_FR));
}
static void
setfpreg (unsigned long regnum, struct ia64_fpreg *fpval, struct pt_regs *regs)
......@@ -507,7 +528,7 @@ setfpreg (unsigned long regnum, struct ia64_fpreg *fpval, struct pt_regs *regs)
*/
if (regnum >= IA64_FIRST_ROTATING_FR) {
ia64_sync_fph(current);
current->thread.fph[IA64_FPH_OFFS(regnum)] = *fpval;
current->thread.fph[fph_index(regs, regnum)] = *fpval;
} else {
/*
* pt_regs or switch_stack ?
......@@ -566,7 +587,7 @@ getfpreg (unsigned long regnum, struct ia64_fpreg *fpval, struct pt_regs *regs)
*/
if (regnum >= IA64_FIRST_ROTATING_FR) {
ia64_flush_fph(current);
*fpval = current->thread.fph[IA64_FPH_OFFS(regnum)];
*fpval = current->thread.fph[fph_index(regs, regnum)];
} else {
/*
* f0 = 0.0, f1= 1.0. Those registers are constant and are thus
......@@ -651,8 +672,8 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi
* just in case.
*/
if (ld.x6_op == 1 || ld.x6_op == 3) {
printk("%s %s: register update on speculative load, error\n", KERN_ERR, __FUNCTION__);
die_if_kernel("unaligned reference on specualtive load with register update\n",
printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__);
die_if_kernel("unaligned reference on speculative load with register update\n",
regs, 30);
}
......@@ -1081,8 +1102,8 @@ emulate_load_floatpair (unsigned long ifa, load_store_t ld, struct pt_regs *regs
* For this reason we keep this sanity check
*/
if (ld.x6_op == 1 || ld.x6_op == 3)
printk("%s %s: register update on speculative load pair, "
"error\n",KERN_ERR, __FUNCTION__);
printk(KERN_ERR "%s: register update on speculative load pair, error\n",
__FUNCTION__);
setreg(ld.r3, ifa, 0, regs);
}
......
#
# Makefile for the ia64-specific parts of the memory manager.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...
obj-y := init.o fault.o tlb.o extable.o
obj-y := init.o fault.o tlb.o extable.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_NUMA) += numa.o
obj-$(CONFIG_NUMA) += numa.o
obj-$(CONFIG_DISCONTIGMEM) += discontig.o
......@@ -96,13 +96,13 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
* fault.
*/
switch (handle_mm_fault(mm, vma, address, (mask & VM_WRITE) != 0)) {
case 1:
case VM_FAULT_MINOR:
++current->min_flt;
break;
case 2:
case VM_FAULT_MAJOR:
++current->maj_flt;
break;
case 0:
case VM_FAULT_SIGBUS:
/*
* We ran out of memory, or some other thing happened
* to us that made us unable to handle the page fault
......@@ -110,8 +110,10 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
*/
signal = SIGBUS;
goto bad_area;
default:
case VM_FAULT_OOM:
goto out_of_memory;
default:
BUG();
}
up_read(&mm->mmap_sem);
return;
......
......@@ -84,7 +84,7 @@ wrap_mmu_context (struct mm_struct *mm)
for (i = 0; i < NR_CPUS; ++i)
if (i != smp_processor_id())
per_cpu(ia64_need_tlb_flush, i) = 1;
__flush_tlb_all();
local_flush_tlb_all();
}
void
......@@ -108,7 +108,7 @@ ia64_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbi
}
void
__flush_tlb_all (void)
local_flush_tlb_all (void)
{
unsigned long i, j, flags, count0, count1, stride0, stride1, addr;
......@@ -194,5 +194,5 @@ ia64_tlb_init (void)
local_cpu_data->ptce_stride[0] = ptce_info.stride[0];
local_cpu_data->ptce_stride[1] = ptce_info.stride[1];
__flush_tlb_all(); /* nuke left overs from bootstrapping... */
local_flush_tlb_all(); /* nuke left overs from bootstrapping... */
}
#
# Makefile for the ia64-specific parts of the pci bus
#
obj-y := pci.o
......@@ -44,10 +44,6 @@
#define DBG(x...)
#endif
#ifdef CONFIG_IA64_MCA
extern void ia64_mca_check_errors( void );
#endif
struct pci_fixup pcibios_fixups[1];
/*
......
This diff is collapsed.
This diff is collapsed.
#
# Automatically generated make config: don't edit
#
#
# Code maturity level options
#
# CONFIG_EXPERIMENTAL is not set
#
# Loadable module support
#
# CONFIG_MODULES is not set
#
# General setup
#
CONFIG_IA64=y
# CONFIG_ISA is not set
# CONFIG_EISA is not set
# CONFIG_MCA is not set
# CONFIG_SBUS is not set
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
CONFIG_ACPI=y
CONFIG_ACPI_EFI=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_KERNEL_CONFIG=y
CONFIG_ITANIUM=y
# CONFIG_MCKINLEY is not set
# CONFIG_IA64_GENERIC is not set
CONFIG_IA64_DIG=y
# CONFIG_IA64_HP_SIM is not set
# CONFIG_IA64_SGI_SN1 is not set
# CONFIG_IA64_SGI_SN2 is not set
# CONFIG_IA64_PAGE_SIZE_4KB is not set
# CONFIG_IA64_PAGE_SIZE_8KB is not set
CONFIG_IA64_PAGE_SIZE_16KB=y
# CONFIG_IA64_PAGE_SIZE_64KB is not set
CONFIG_IA64_BRL_EMU=y
CONFIG_ITANIUM_BSTEP_SPECIFIC=y
CONFIG_IA64_L1_CACHE_SHIFT=6
# CONFIG_NUMA is not set
# CONFIG_IA64_MCA is not set
CONFIG_PM=y
CONFIG_IA64_HAVE_SYNCRONIZED_ITC=y
# CONFIG_DEVFS_FS is not set
CONFIG_KCORE_ELF=y
CONFIG_SMP=y
# CONFIG_IA32_SUPPORT is not set
# CONFIG_PERFMON is not set
# CONFIG_IA64_PALINFO is not set
# CONFIG_EFI_VARS is not set
# CONFIG_NET is not set
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_SYSCTL is not set
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_BUSMGR is not set
# CONFIG_ACPI_SYS is not set
# CONFIG_ACPI_CPU is not set
# CONFIG_ACPI_BUTTON is not set
# CONFIG_ACPI_AC is not set
# CONFIG_ACPI_EC is not set
# CONFIG_ACPI_CMBATT is not set
# CONFIG_ACPI_THERMAL is not set
CONFIG_PCI=y
# CONFIG_PCI_NAMES is not set
# CONFIG_HOTPLUG is not set
# CONFIG_PCMCIA is not set
#
# Parallel port support
#
# CONFIG_PARPORT is not set
#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set
#
# Plug and Play configuration
#
# CONFIG_PNP is not set
# CONFIG_ISAPNP is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
#
# I2O device support
#
# CONFIG_I2O is not set
# CONFIG_I2O_PCI is not set
# CONFIG_I2O_BLOCK is not set
# CONFIG_I2O_SCSI is not set
# CONFIG_I2O_PROC is not set
#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID5 is not set
# CONFIG_MD_MULTIPATH is not set
# CONFIG_BLK_DEV_LVM is not set
#
# ATA/IDE/MFM/RLL support
#
CONFIG_IDE=y
#
# IDE, ATA and ATAPI Block devices
#
CONFIG_BLK_DEV_IDE=y
#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_HD_IDE is not set
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_BLK_DEV_IDECS is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
#
# IDE chipset support/bugfixes
#
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
# CONFIG_BLK_DEV_ISAPNP is not set
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEDMA_AUTO is not set
# CONFIG_BLK_DEV_IDE_MODES is not set
# CONFIG_BLK_DEV_ATARAID is not set
# CONFIG_BLK_DEV_ATARAID_PDC is not set
# CONFIG_BLK_DEV_ATARAID_HPT is not set
#
# Alternate 1394 support
#
# CONFIG_X1394 is not set
#
# Alternate SCSI support
#
# CONFIG_XSCSI is not set
#
# SCSI support
#
# CONFIG_SCSI is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# ISDN subsystem
#
# CONFIG_ISDN is not set
#
# CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
#
# CONFIG_CD_NO_IDESCSI is not set
#
# Input core support
#
# CONFIG_INPUT is not set
# CONFIG_INPUT_KEYBDEV is not set
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
# CONFIG_SERIAL is not set
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
#
# I2C support
#
# CONFIG_I2C is not set
#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_MOUSE is not set
#
# Joysticks
#
# CONFIG_INPUT_GAMEPORT is not set
#
# Input core support is needed for gameports
#
#
# Input core support is needed for joysticks
#
# CONFIG_QIC02_TAPE is not set
#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_INTEL_RNG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_EFI_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_MWAVE is not set
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
#
# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_REISERFS_CHECK is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
# CONFIG_JFFS2_FS is not set
# CONFIG_CRAMFS is not set
CONFIG_TMPFS=y
# CONFIG_RAMFS is not set
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_MOUNT is not set
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_SUPPORT is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_SMB_FS is not set
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_SMB_NLS is not set
# CONFIG_NLS is not set
#
# Console drivers
#
CONFIG_VGA_CONSOLE=y
#
# Frame-buffer support
#
# CONFIG_FB is not set
#
# Sound
#
# CONFIG_SOUND is not set
#
# USB support
#
# CONFIG_USB is not set
#
# USB Controllers
#
# CONFIG_USB_UHCI is not set
# CONFIG_USB_UHCI_ALT is not set
# CONFIG_USB_OHCI is not set
#
# USB Device Class drivers
#
# CONFIG_USB_AUDIO is not set
# CONFIG_USB_BLUETOOTH is not set
# CONFIG_USB_STORAGE is not set
# CONFIG_USB_STORAGE_DEBUG is not set
# CONFIG_USB_STORAGE_DATAFAB is not set
# CONFIG_USB_STORAGE_FREECOM is not set
# CONFIG_USB_STORAGE_ISD200 is not set
# CONFIG_USB_STORAGE_DPCM is not set
# CONFIG_USB_STORAGE_HP8200e is not set
# CONFIG_USB_STORAGE_SDDR09 is not set
# CONFIG_USB_STORAGE_JUMPSHOT is not set
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
#
# USB Human Interface Devices (HID)
#
#
# Input core support is needed for USB HID
#
#
# USB Imaging devices
#
# CONFIG_USB_DC2XX is not set
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_SCANNER is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set
#
# USB Multimedia devices
#
#
# Video4Linux support is needed for USB Multimedia device support
#
#
# USB Network adaptors
#
#
# Networking support is needed for USB Networking device support
#
#
# USB port drivers
#
# CONFIG_USB_USS720 is not set
#
# USB Serial Converter support
#
# CONFIG_USB_SERIAL is not set
# CONFIG_USB_SERIAL_GENERIC is not set
# CONFIG_USB_SERIAL_BELKIN is not set
# CONFIG_USB_SERIAL_WHITEHEAT is not set
# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
# CONFIG_USB_SERIAL_VISOR is not set
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
# CONFIG_USB_SERIAL_KEYSPAN is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
# CONFIG_USB_SERIAL_MCT_U232 is not set
# CONFIG_USB_SERIAL_PL2303 is not set
# CONFIG_USB_SERIAL_CYBERJACK is not set
# CONFIG_USB_SERIAL_XIRCOM is not set
# CONFIG_USB_SERIAL_OMNINET is not set
#
# USB Miscellaneous drivers
#
# CONFIG_USB_RIO500 is not set
#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
CONFIG_IA64_PRINT_HAZARDS=y
# CONFIG_DISABLE_VHPT is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_IA64_EARLY_PRINTK=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_IA64_DEBUG_CMPXCHG is not set
# CONFIG_IA64_DEBUG_IRQ is not set
# CONFIG_KDB is not set
# CONFIG_KDB_MODULES is not set
# CONFIG_KALLSYMS is not set
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.
......@@ -6,15 +6,15 @@
# Copyright (c) 2000-2001 Silicon Graphics, Inc. All rights reserved.
#
TOPDIR=../../../..
LIB = ../../lib/lib.a
OBJ=fpromasm.o main.o fw-emu.o fpmem.o klgraph_init.o
obj-y=fprom
obj-y=fpromasm.o main.o fw-emu.o fpmem.o klgraph_init.o
fprom: $(OBJ)
$(LD) -static -Tfprom.lds -o fprom $(OBJ) $(LIB)
.S.o:
$(CC) -D__ASSEMBLY__ $(AFLAGS) $(AFLAGS_KERNEL) -c -o $*.o $<
.c.o:
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -c -o $*.o $<
clean:
rm -f *.o fprom
......@@ -71,7 +71,7 @@ amount of memory present on nodes 0-3.
1GB*<dn>, where dn is the digit number. The amount of memory
is 8MB*2**<d>. (If <d> = 0, the memory size is 0).
SN1 doesn't support dimms this small but small memory systems
SN1 doesnt support dimms this small but small memory systems
boot faster on Medusa.
......
......@@ -54,10 +54,10 @@ sn_config_t *sn_config ;
#define PROMRESERVED_SIZE (1*MB)
#ifdef CONFIG_IA64_SGI_SN1
#define PHYS_ADDRESS(_n, _x) (((long)_n<<33L) | (long)_x)
#define PHYS_ADDRESS(_n, _x) (((long)_n<<33) | (long)_x)
#define MD_BANK_SHFT 30
#else
#define PHYS_ADDRESS(_n, _x) (((long)_n<<38L) | (long)_x | 0x3000000000UL)
#define PHYS_ADDRESS(_n, _x) (((long)_n<<38) | (long)_x | 0x3000000000UL)
#define MD_BANK_SHFT 34
#endif
......@@ -94,7 +94,7 @@ GetMemBankInfo(int index)
int
IsCpuPresent(int cnode, int cpu)
{
return sn_memmap[cnode].cpuconfig & (1<<cpu);
return sn_memmap[cnode].cpuconfig & (1UL<<cpu);
}
......@@ -142,10 +142,10 @@ int
IsBankPresent(int index, node_memmap_t nmemmap)
{
switch (index) {
case 0:return nmemmap.ena0;
case 1:return nmemmap.ena1;
case 2:return nmemmap.ena2;
case 3:return nmemmap.ena3;
case 0:return BankPresent(nmemmap.b0size);
case 1:return BankPresent(nmemmap.b1size);
case 2:return BankPresent(nmemmap.b2size);
case 3:return BankPresent(nmemmap.b3size);
default:return -1 ;
}
}
......@@ -153,11 +153,14 @@ IsBankPresent(int index, node_memmap_t nmemmap)
int
GetBankSize(int index, node_memmap_t nmemmap)
{
/*
* Add 2 because there are 4 dimms per bank.
*/
switch (index) {
case 0:return (long)nmemmap.b0size + nmemmap.b0dou;
case 1:return (long)nmemmap.b1size + nmemmap.b1dou;
case 2:return (long)nmemmap.b2size + nmemmap.b2dou;
case 3:return (long)nmemmap.b3size + nmemmap.b3dou;
case 0:return 2 + ((long)nmemmap.b0size + nmemmap.b0dou);
case 1:return 2 + ((long)nmemmap.b1size + nmemmap.b1dou);
case 2:return 2 + ((long)nmemmap.b2size + nmemmap.b2dou);
case 3:return 2 + ((long)nmemmap.b3size + nmemmap.b3dou);
default:return -1 ;
}
}
......@@ -189,14 +192,30 @@ build_efi_memmap(void *md, int mdsize)
for (cnode=0;cnode<numnodes;cnode++) {
nasid = GetNasid(cnode) ;
membank_info = GetMemBankInfo(cnode) ;
for (bank=0;bank<PLAT_CLUMPS_PER_NODE;bank++) {
for (bank=0;bank<NR_BANKS_PER_NODE;bank++) {
if (IsBankPresent(bank, membank_info)) {
bsize = GetBankSize(bank, membank_info) ;
paddr = PHYS_ADDRESS(nasid, (long)bank<<MD_BANK_SHFT);
numbytes = BankSizeBytes(bsize);
#ifdef CONFIG_IA64_SGI_SN2
/*
* Ignore directory.
* Shorten memory chunk by 1 page - makes a better
* testcase & is more like the real PROM.
*/
numbytes = numbytes * 31 / 32;
#endif
/*
* Only emulate the memory prom grabs
* if we have lots of memory, to allow
* us to simulate smaller memory configs than
* we can actually run on h/w. Otherwise,
* linux throws away a whole "granule".
*/
if (cnode == 0 && bank == 0 &&
numbytes > 128*1024*1024) {
numbytes -= 1000;
}
/*
* Check for the node 0 hole. Since banks cant
......
......@@ -4,7 +4,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2000-2001 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 2000-2002 Silicon Graphics, Inc. All rights reserved.
*/
#include <linux/config.h>
......@@ -71,7 +71,8 @@ typedef struct node_memmap_s
} node_memmap_t ;
#define SN2_BANK_SIZE_SHIFT (MBSHIFT+6) /* 64 MB */
#define BankSizeBytes(bsize) (1UL<<((bsize)+SN2_BANK_SIZE_SHIFT))
#define BankPresent(bsize) (bsize<6)
#define BankSizeBytes(bsize) (BankPresent(bsize) ? 1UL<<((bsize)+SN2_BANK_SIZE_SHIFT) : 0)
#endif
typedef struct sn_memmap_s
......
......@@ -180,7 +180,7 @@ initx:
// Now call main & pass it the current LID value.
alloc r0=ar.pfs,0,0,2,0
alloc r2=ar.pfs,0,0,2,0
mov r32=r26
mov r33=r8;;
br.call.sptk.few rp=fmain
......
This diff is collapsed.
/* $Id: klgraph_init.c,v 1.2 2001/12/05 16:58:41 jh Exp $
/* $Id: klgraph_init.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
......@@ -49,8 +49,9 @@ void
klgraph_init(void)
{
u64 *temp;
#ifdef CONFIG_IA64_SGI_SN1
u64 *temp;
#endif
/*
* Initialize some hub/xbow registers that allows access to
* Xbridge etc. These are normally done in PROM.
......@@ -109,6 +110,8 @@ klgraph_init(void)
// [PI] *(volatile u32 *)0xc00000080f000288L = 0xba98;
#endif /* CONFIG_IA64_SGI_SN1 */
#ifdef CONFIG_IA64_SGI_SN1
/*
* kldir entries initialization - mankato
*/
......@@ -282,6 +285,7 @@ klgraph_init(void)
convert(0x8000000000002560, 0xffffffffffffffff, 0xffffffffffffffff);
convert(0x8000000000002570, 0xffffffffffffffff, 0xffffffffffffffff);
convert(0x8000000000002580, 0x000000000000ffff, 0x0000000000000000);
#endif
}
......@@ -98,7 +98,7 @@ synergy_init(int nasid, int syn)
/*
* Enable all FSB flashed interrupts.
* ZZZ - I'd really like defines for this......
* I'd really like defines for this......
*/
base = (long*)0x80000e0000000000LL; /* base of synergy regs */
for (off = 0x2a0; off < 0x2e0; off+=8) /* offset for VEC_MASK_{0-3}_A/B */
......
This diff is collapsed.
......@@ -192,9 +192,9 @@ struct alenlist_s {
#define AL_FIXED_SIZE 0x1 /* List is pre-allocated, and of fixed size */
zone_t *alenlist_zone = NULL;
zone_t *alenlist_chunk_zone = NULL;
zone_t *alenlist_cursor_zone = NULL;
struct zone *alenlist_zone = NULL;
struct zone *alenlist_chunk_zone = NULL;
struct zone *alenlist_cursor_zone = NULL;
#if DEBUG
int alenlist_count=0; /* Currently allocated Lists */
......
/* $Id$
/* $Id: ate_utils.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
*/
#include <linux/config.h>
......
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.
/* $Id: io.c,v 1.2 2001/06/26 14:02:43 pfg Exp $
/* $Id: hub_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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