Commit 25c2ccd7 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://lia64.bkbits.net/linux-ia64-release-2.6.9

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 3411df4e 4b0be4f7
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc1
# Tue Aug 24 15:08:24 2004
#
#
......@@ -126,6 +128,7 @@ CONFIG_PCI_NAMES=y
CONFIG_HOTPLUG_PCI=m
# CONFIG_HOTPLUG_PCI_FAKE is not set
CONFIG_HOTPLUG_PCI_ACPI=m
# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_PCIE is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
......@@ -172,6 +175,7 @@ CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_SIZE=4096
......@@ -313,6 +317,7 @@ CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
# CONFIG_MD_RAID10 is not set
CONFIG_MD_RAID5=m
CONFIG_MD_RAID6=m
CONFIG_MD_MULTIPATH=m
......@@ -365,6 +370,7 @@ CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_IPV6 is not set
# CONFIG_NETFILTER is not set
......@@ -767,6 +773,7 @@ CONFIG_USB=m
CONFIG_USB_DEVICEFS=y
# CONFIG_USB_BANDWIDTH is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_SUSPEND is not set
#
# USB Host Controller Drivers
......@@ -919,6 +926,8 @@ CONFIG_UDF_NLS=y
CONFIG_FAT_FS=y
# CONFIG_MSDOS_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
# CONFIG_NTFS_RW is not set
......@@ -946,7 +955,6 @@ CONFIG_RAMFS=y
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
......@@ -971,6 +979,7 @@ CONFIG_EXPORTFS=m
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
# CONFIG_RPCSEC_GSS_SPKM3 is not set
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_SMB_NLS_REMOTE="cp437"
......@@ -1007,7 +1016,7 @@ CONFIG_EFI_PARTITION=y
#
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
CONFIG_NLS_CODEPAGE_850=m
......@@ -1031,7 +1040,7 @@ CONFIG_NLS_ISO8859_8=m
CONFIG_NLS_CODEPAGE_1250=m
CONFIG_NLS_CODEPAGE_1251=m
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ISO8859_1=m
CONFIG_NLS_ISO8859_1=y
CONFIG_NLS_ISO8859_2=m
CONFIG_NLS_ISO8859_3=m
CONFIG_NLS_ISO8859_4=m
......@@ -1068,18 +1077,18 @@ CONFIG_CRC32=y
#
# Kernel hacking
#
CONFIG_IA64_GRANULE_16MB=y
# CONFIG_IA64_GRANULE_64MB is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_IA64_PRINT_HAZARDS is not set
# CONFIG_DISABLE_VHPT is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_INFO is not set
CONFIG_IA64_GRANULE_16MB=y
# CONFIG_IA64_GRANULE_64MB is not set
# CONFIG_IA64_PRINT_HAZARDS is not set
# CONFIG_DISABLE_VHPT is not set
# CONFIG_IA64_DEBUG_CMPXCHG is not set
# CONFIG_IA64_DEBUG_IRQ is not set
# CONFIG_DEBUG_INFO is not set
CONFIG_SYSVIPC_COMPAT=y
#
......@@ -1102,11 +1111,12 @@ CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_AES_GENERIC is not set
# CONFIG_CRYPTO_AES is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
......
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc1
# Fri Aug 27 22:00:00 2004
#
#
......@@ -7,7 +9,6 @@
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
CONFIG_STANDALONE=y
#
# General setup
......@@ -74,8 +75,8 @@ CONFIG_IA64_SGI_SN_SIM=y
CONFIG_FORCE_MAX_ZONEORDER=18
CONFIG_SMP=y
CONFIG_NR_CPUS=512
# CONFIG_HOTPLUG_CPU is not set
# CONFIG_PREEMPT is not set
CONFIG_HOTPLUG_CPU=y
CONFIG_PREEMPT=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_IA32_SUPPORT=y
CONFIG_COMPAT=y
......@@ -115,7 +116,7 @@ CONFIG_ACPI_SYSTEM=y
#
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_USE_VECTOR is not set
# CONFIG_PCI_MSI is not set
CONFIG_PCI_LEGACY_PROC=y
CONFIG_PCI_NAMES=y
......@@ -142,6 +143,7 @@ CONFIG_HOTPLUG_PCI_SGI=y
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=m
# CONFIG_DEBUG_DRIVER is not set
......@@ -171,6 +173,7 @@ CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
......@@ -185,7 +188,8 @@ CONFIG_BLK_DEV_IDE=y
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_IDE_SATA is not set
# CONFIG_BLK_DEV_IDEDISK is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
......@@ -316,6 +320,7 @@ CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=y
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
# CONFIG_MD_RAID10 is not set
CONFIG_MD_RAID5=y
# CONFIG_MD_RAID6 is not set
CONFIG_MD_MULTIPATH=y
......@@ -368,11 +373,13 @@ CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_IPV6=m
# CONFIG_IPV6_PRIVACY is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_INET6_TUNNEL is not set
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_NETFILTER is not set
......@@ -538,6 +545,7 @@ CONFIG_SGI_SNSC=y
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_SGI_L1_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
......@@ -601,7 +609,6 @@ CONFIG_MAX_RAW_DEVS=256
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
#
......@@ -621,6 +628,7 @@ CONFIG_USB=m
# CONFIG_USB_DEVICEFS is not set
# CONFIG_USB_BANDWIDTH is not set
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_OTG is not set
#
# USB Host Controller Drivers
......@@ -717,7 +725,7 @@ CONFIG_USB_HIDINPUT=y
#
# File systems
#
CONFIG_EXT2_FS=m
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
......@@ -792,7 +800,6 @@ CONFIG_RAMFS=y
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
......@@ -817,10 +824,12 @@ CONFIG_EXPORTFS=m
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
# CONFIG_RPCSEC_GSS_SPKM3 is not set
CONFIG_SMB_FS=m
# CONFIG_SMB_NLS_DEFAULT is not set
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
# CONFIG_CIFS_XATTR is not set
# CONFIG_CIFS_POSIX is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
......@@ -907,18 +916,18 @@ CONFIG_ZLIB_DEFLATE=m
#
# Kernel hacking
#
CONFIG_IA64_GRANULE_16MB=y
# CONFIG_IA64_GRANULE_64MB is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_IA64_PRINT_HAZARDS is not set
# CONFIG_DISABLE_VHPT is not set
CONFIG_MAGIC_SYSRQ=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
CONFIG_DEBUG_INFO=y
CONFIG_IA64_GRANULE_16MB=y
# CONFIG_IA64_GRANULE_64MB is not set
# CONFIG_IA64_PRINT_HAZARDS is not set
# CONFIG_DISABLE_VHPT is not set
# CONFIG_IA64_DEBUG_CMPXCHG is not set
# CONFIG_IA64_DEBUG_IRQ is not set
CONFIG_DEBUG_INFO=y
CONFIG_SYSVIPC_COMPAT=y
#
......@@ -937,6 +946,7 @@ CONFIG_CRYPTO_MD5=m
CONFIG_CRYPTO_SHA1=m
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_WHIRLPOOL is not set
CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_TWOFISH is not set
......@@ -946,6 +956,7 @@ CONFIG_CRYPTO_DES=m
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_KHAZAD is not set
CONFIG_CRYPTO_DEFLATE=m
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_CRC32C is not set
......
......@@ -357,8 +357,10 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
if (total_mem >= mem_limit)
continue;
total_mem += (md->num_pages << EFI_PAGE_SHIFT);
if (total_mem > mem_limit)
if (total_mem > mem_limit) {
md->num_pages -= ((total_mem - mem_limit) >> EFI_PAGE_SHIFT);
max_addr = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
}
if (md->num_pages == 0)
continue;
......
......@@ -479,7 +479,7 @@ static const char *proc_features[]={
"Enable CMCI promotion",
"Enable MCA to BINIT promotion",
"Enable MCA promotion",
"Enable BEER promotion"
"Enable BERR promotion"
};
......
......@@ -2227,6 +2227,15 @@ pfm_alloc_fd(struct file **cfile)
static void
pfm_free_fd(int fd, struct file *file)
{
struct files_struct *files = current->files;
/*
* there ie no fd_uninstall(), so we do it here
*/
spin_lock(&files->file_lock);
files->fd[fd] = NULL;
spin_unlock(&files->file_lock);
if (file) put_filp(file);
put_unused_fd(fd);
}
......@@ -2659,8 +2668,10 @@ pfm_context_create(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
ctx = pfm_context_alloc();
if (!ctx) goto error;
req->ctx_fd = ctx->ctx_fd = pfm_alloc_fd(&filp);
if (req->ctx_fd < 0) goto error_file;
ret = pfm_alloc_fd(&filp);
if (ret < 0) goto error_file;
req->ctx_fd = ctx->ctx_fd = ret;
/*
* attach context to file
......@@ -3985,7 +3996,10 @@ pfm_stop(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
state = ctx->ctx_state;
is_system = ctx->ctx_fl_system;
if (state != PFM_CTX_LOADED && state != PFM_CTX_MASKED) return -EINVAL;
/*
* context must be attached to issue the stop command (includes LOADED,MASKED,ZOMBIE)
*/
if (state == PFM_CTX_UNLOADED) return -EINVAL;
/*
* In system wide and when the context is loaded, access can only happen
......@@ -6312,15 +6326,15 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
*/
is_self = ctx->ctx_task == task ? 1 : 0;
#ifdef CONFIG_SMP
if (task == current) {
#else
/*
* in UP, the state can still be in the registers
* can access PMU is task is the owner of the PMU state on the current CPU
* or if we are running on the CPU bound to the context in system-wide mode
* (that is not necessarily the task the context is attached to in this mode).
* In system-wide we always have can_access_pmu true because a task running on an
* invalid processor is flagged earlier in the call stack (see pfm_stop).
*/
if (task == current || GET_PMU_OWNER() == task) {
#endif
can_access_pmu = 1;
can_access_pmu = (GET_PMU_OWNER() == task) || (ctx->ctx_fl_system && ctx->ctx_cpu == smp_processor_id());
if (can_access_pmu) {
/*
* Mark the PMU as not owned
* This will cause the interrupt handler to do nothing in case an overflow
......@@ -6330,6 +6344,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
* on.
*/
SET_PMU_OWNER(NULL, NULL);
DPRINT(("releasing ownership\n"));
/*
* read current overflow status:
......
......@@ -10,6 +10,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/string.h>
......@@ -262,3 +263,40 @@ ia64_sal_init (struct ia64_sal_systab *systab)
p += SAL_DESC_SIZE(*p);
}
}
int
ia64_sal_oemcall(struct ia64_sal_retval *isrvp, u64 oemfunc, u64 arg1,
u64 arg2, u64 arg3, u64 arg4, u64 arg5, u64 arg6, u64 arg7)
{
if (oemfunc < IA64_SAL_OEMFUNC_MIN || oemfunc > IA64_SAL_OEMFUNC_MAX)
return -1;
SAL_CALL(*isrvp, oemfunc, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
return 0;
}
EXPORT_SYMBOL(ia64_sal_oemcall);
int
ia64_sal_oemcall_nolock(struct ia64_sal_retval *isrvp, u64 oemfunc, u64 arg1,
u64 arg2, u64 arg3, u64 arg4, u64 arg5, u64 arg6,
u64 arg7)
{
if (oemfunc < IA64_SAL_OEMFUNC_MIN || oemfunc > IA64_SAL_OEMFUNC_MAX)
return -1;
SAL_CALL_NOLOCK(*isrvp, oemfunc, arg1, arg2, arg3, arg4, arg5, arg6,
arg7);
return 0;
}
EXPORT_SYMBOL(ia64_sal_oemcall_nolock);
int
ia64_sal_oemcall_reentrant(struct ia64_sal_retval *isrvp, u64 oemfunc,
u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5,
u64 arg6, u64 arg7)
{
if (oemfunc < IA64_SAL_OEMFUNC_MIN || oemfunc > IA64_SAL_OEMFUNC_MAX)
return -1;
SAL_CALL_REENTRANT(*isrvp, oemfunc, arg1, arg2, arg3, arg4, arg5, arg6,
arg7);
return 0;
}
EXPORT_SYMBOL(ia64_sal_oemcall_reentrant);
......@@ -116,19 +116,19 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg)
range_start = max(start, free_start);
range_end = min(end, rsvd_region[i].start & PAGE_MASK);
free_start = PAGE_ALIGN(rsvd_region[i].end);
if (range_end <= range_start)
continue; /* skip over empty range */
if (range_end - range_start >= needed) {
bootmap_start = __pa(range_start);
return 1; /* done */
return -1; /* done */
}
/* nothing more available in this segment */
if (range_end == end)
return 0;
free_start = PAGE_ALIGN(rsvd_region[i].end);
}
return 0;
}
......
......@@ -16,6 +16,10 @@ config OPROFILE
whole system, include the kernel, kernel modules, libraries,
and applications.
Due to firmware bugs, you may need to use the "nohalt" boot
option if you're using OProfile with the hardware performance
counters.
If unsure, say N.
endmenu
......
......@@ -7,3 +7,4 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
timer_int.o )
oprofile-y := $(DRIVER_OBJS) init.o
oprofile-$(CONFIG_PERFMON) += perfmon.o
......@@ -12,14 +12,21 @@
#include <linux/init.h>
#include <linux/errno.h>
extern void timer_init(struct oprofile_operations ** ops);
extern int perfmon_init(struct oprofile_operations ** ops);
extern void perfmon_exit(void);
int __init oprofile_arch_init(struct oprofile_operations ** ops)
{
#ifdef CONFIG_PERFMON
return perfmon_init(ops);
#endif
return -ENODEV;
}
void oprofile_arch_exit(void)
{
#ifdef CONFIG_PERFMON
perfmon_exit();
#endif
}
/**
* @file perfmon.c
*
* @remark Copyright 2003 OProfile authors
* @remark Read the file COPYING
*
* @author John Levon <levon@movementarian.org>
*/
#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/oprofile.h>
#include <linux/sched.h>
#include <asm/perfmon.h>
#include <asm/ptrace.h>
#include <asm/errno.h>
static int allow_ints;
static int
perfmon_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg,
struct pt_regs *regs, unsigned long stamp)
{
int cpu = smp_processor_id();
unsigned long eip = instruction_pointer(regs);
int event = arg->pmd_eventid;
arg->ovfl_ctrl.bits.reset_ovfl_pmds = 1;
/* the owner of the oprofile event buffer may have exited
* without perfmon being shutdown (e.g. SIGSEGV)
*/
if (allow_ints)
oprofile_add_sample(eip, !user_mode(regs), event, cpu);
return 0;
}
static int perfmon_start(void)
{
allow_ints = 1;
return 0;
}
static void perfmon_stop(void)
{
allow_ints = 0;
}
#define OPROFILE_FMT_UUID { \
0x77, 0x7a, 0x6e, 0x61, 0x20, 0x65, 0x73, 0x69, 0x74, 0x6e, 0x72, 0x20, 0x61, 0x65, 0x0a, 0x6c }
static pfm_buffer_fmt_t oprofile_fmt = {
.fmt_name = "oprofile_format",
.fmt_uuid = OPROFILE_FMT_UUID,
.fmt_handler = perfmon_handler,
};
static char * get_cpu_type(void)
{
__u8 family = local_cpu_data->family;
switch (family) {
case 0x07:
return "ia64/itanium";
case 0x1f:
return "ia64/itanium2";
default:
return "ia64/ia64";
}
}
/* all the ops are handled via userspace for IA64 perfmon */
static struct oprofile_operations perfmon_ops = {
.start = perfmon_start,
.stop = perfmon_stop,
};
static int using_perfmon;
int perfmon_init(struct oprofile_operations ** ops)
{
int ret = pfm_register_buffer_fmt(&oprofile_fmt);
if (ret)
return -ENODEV;
perfmon_ops.cpu_type = get_cpu_type();
*ops = &perfmon_ops;
using_perfmon = 1;
printk(KERN_INFO "oprofile: using perfmon.\n");
return 0;
}
void perfmon_exit(void)
{
if (!using_perfmon)
return;
pfm_unregister_buffer_fmt(oprofile_fmt.fmt_uuid);
}
......@@ -3,10 +3,10 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1999,2001-2003 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All Rights Reserved.
*
* Module to export the system's Firmware Interface Tables, including
* PROM revision numbers, in /proc
* PROM revision numbers and banners, in /proc
*/
#include <linux/config.h>
#include <linux/module.h>
......@@ -45,9 +45,18 @@ MODULE_LICENSE("GPL");
# define TRACE()
#endif
/* Architected IA64 firmware space */
#define FW_BASE 0x00000000FF000000
#define FW_TOP 0x0000000100000000
/* Sub-regions determined by bits in Node Offset */
#define LB_PROM_SPACE 0x0000000700000000ul /* Local LB PROM */
/* Offset of PROM banner pointers in SAL A and SAL B */
#define SAL_A_BANNER_OFFSET (1 * 16)
#define SAL_B_BANNER_OFFSET (3 * 16)
#define FIT_SIGNATURE 0x2020205f5449465ful
/* Standard Intel FIT entry types */
#define FIT_ENTRY_FIT_HEADER 0x00 /* FIT header entry */
......@@ -125,6 +134,26 @@ fit_type_name(unsigned char type)
return "Unknown type";
}
static unsigned long
convert_fw_addr(nasid_t nasid, unsigned long addr)
{
/* snag just the node-relative offset */
addr &= ~0ul >> (63-35);
/* the pointer to SAL A is relative to IA-64 compatibility
* space. However, the PROM is mapped at a different offset
* in MMR space (both local and global)
*/
addr += 0x700000000;
return GLOBAL_MMR_ADDR(nasid, addr);
}
static int
valid_fw_addr(unsigned long addr)
{
addr &= ~(1ul << 63); /* Clear cached/uncached bit */
return (addr >= FW_BASE && addr < FW_TOP);
}
/* These two routines read the FIT table directly from the FLASH PROM
* on a specific node. The PROM can only be accessed using aligned 64
* bit reads, so we do that and then shift and mask the result to get
......@@ -194,6 +223,8 @@ dump_version(char *page, unsigned long *fit)
int nentries;
int fentry;
unsigned long qw;
int len;
nasid_t nasid = NASID_GET(fit);
TRACE();
......@@ -203,10 +234,31 @@ dump_version(char *page, unsigned long *fit)
for (fentry = 0; fentry < nentries; fentry++) {
qw = readq(fit + 2 * fentry + 1);
if (FIT_TYPE(qw) == FIT_ENTRY_SAL_A)
return sprintf(page, "%x.%02x\n",
FIT_MAJOR(qw), FIT_MINOR(qw));
break;
}
if (fentry >= nentries)
return 0;
len = sprintf(page, "%x.%02x\n", FIT_MAJOR(qw), FIT_MINOR(qw));
page += len;
qw = readq(fit + 2 * fentry); /* Address of SAL A */
DPRINTK("SAL A at %p\n", (void *)qw);
if (!valid_fw_addr(qw))
return len;
qw += SAL_A_BANNER_OFFSET;
qw = convert_fw_addr(nasid, qw);
DPRINTK("Banner ptr at %p\n", (void *)qw);
qw = readq(qw); /* Address of banner */
if (!valid_fw_addr(qw))
return len;
qw = convert_fw_addr(nasid, qw);
DPRINTK("Banner at %p\n", (void *)qw);
len += snprintf(page, PAGE_SIZE-len, "%s\n", (char *)qw);
return len;
}
/* same as in proc_misc.c */
......@@ -278,14 +330,10 @@ lookup_fit(int nasid)
DPRINTK("pointer to fit at %p\n", (void *)fitp);
fit_paddr = readq(fitp);
DPRINTK("fit pointer contains %lx\n", fit_paddr);
/* snag just the node-relative offset */
fit_paddr &= ~0ul >> (63-35);
/* the pointer to the FIT is relative to IA-64 compatibility
* space. However, the PROM is mapped at a different offset
* in MMR space (both local and global)
*/
fit_paddr += 0x700000000;
fit_vaddr = (void *)GLOBAL_MMR_ADDR(nasid, fit_paddr);
BUG_ON(!valid_fw_addr(fit_paddr));
fit_vaddr = (void *)convert_fw_addr(nasid, fit_paddr);
DPRINTK("fit at %p\n", (void *)fit_vaddr);
return fit_vaddr;
}
......
......@@ -28,36 +28,6 @@
#include <asm/processor.h>
#define MMU_CONTEXT_DEBUG 0
#if MMU_CONTEXT_DEBUG
#include <ia64intrin.h>
extern struct mmu_trace_entry {
char op;
u8 cpu;
u32 context;
void *mm;
} mmu_tbuf[1024];
extern volatile int mmu_tbuf_index;
# define MMU_TRACE(_op,_cpu,_mm,_ctx) \
do { \
int i = __sync_fetch_and_add(&mmu_tbuf_index, 1) % ARRAY_SIZE(mmu_tbuf); \
struct mmu_trace_entry e; \
e.op = (_op); \
e.cpu = (_cpu); \
e.mm = (_mm); \
e.context = (_ctx); \
mmu_tbuf[i] = e; \
} while (0)
#else
# define MMU_TRACE(op,cpu,mm,ctx) do { ; } while (0)
#endif
struct ia64_ctx {
spinlock_t lock;
unsigned int next; /* next context number to use */
......@@ -123,7 +93,6 @@ get_mmu_context (struct mm_struct *mm)
static inline int
init_new_context (struct task_struct *p, struct mm_struct *mm)
{
MMU_TRACE('N', smp_processor_id(), mm, 0);
mm->context = 0;
return 0;
}
......@@ -132,7 +101,6 @@ static inline void
destroy_context (struct mm_struct *mm)
{
/* Nothing to do. */
MMU_TRACE('D', smp_processor_id(), mm, mm->context);
}
static inline void
......@@ -171,19 +139,14 @@ activate_context (struct mm_struct *mm)
do {
context = get_mmu_context(mm);
MMU_TRACE('A', smp_processor_id(), mm, context);
if (!cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
cpu_set(smp_processor_id(), mm->cpu_vm_mask);
reload_context(context);
MMU_TRACE('a', smp_processor_id(), mm, context);
/* in the unlikely event of a TLB-flush by another thread, redo the load: */
} while (unlikely(context != mm->context));
}
#define deactivate_mm(tsk,mm) \
do { \
MMU_TRACE('d', smp_processor_id(), mm, mm->context); \
} while (0)
#define deactivate_mm(tsk,mm) do { } while (0)
/*
* Switch from address space PREV to address space NEXT.
......
......@@ -84,6 +84,13 @@ extern int ia64_pfn_valid (unsigned long pfn);
#endif
#ifndef CONFIG_DISCONTIGMEM
# ifdef CONFIG_VIRTUAL_MEM_MAP
extern struct page *vmem_map;
# define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
# define page_to_pfn(page) ((unsigned long) (page - vmem_map))
# define pfn_to_page(pfn) (vmem_map + (pfn))
# endif
#else /* !CONFIG_VIRTUAL_MEM_MAP */
#define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
#define page_to_pfn(page) ((unsigned long) (page - mem_map))
#define pfn_to_page(pfn) (mem_map + (pfn))
......
......@@ -819,6 +819,16 @@ struct sal_ret_values {
long r8; long r9; long r10; long r11;
};
#define IA64_SAL_OEMFUNC_MIN 0x02000000
#define IA64_SAL_OEMFUNC_MAX 0x03ffffff
extern int ia64_sal_oemcall(struct ia64_sal_retval *, u64, u64, u64, u64, u64,
u64, u64, u64);
extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
u64, u64, u64, u64, u64);
extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
u64, u64, u64, u64, u64);
#endif /* __ASSEMBLY__ */
#endif /* _ASM_IA64_SAL_H */
......@@ -39,6 +39,7 @@
*/
#include <linux/config.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <asm/pgalloc.h>
......
......@@ -48,22 +48,19 @@ local_finish_flush_tlb_mm (struct mm_struct *mm)
static inline void
flush_tlb_mm (struct mm_struct *mm)
{
MMU_TRACE('F', smp_processor_id(), mm, mm->context);
if (!mm)
goto out;
return;
mm->context = 0;
if (atomic_read(&mm->mm_users) == 0)
goto out; /* happens as a result of exit_mmap() */
return; /* happens as a result of exit_mmap() */
#ifdef CONFIG_SMP
smp_flush_tlb_mm(mm);
#else
local_finish_flush_tlb_mm(mm);
#endif
out:
MMU_TRACE('f', smp_processor_id(), mm, mm->context);
}
extern void flush_tlb_range (struct vm_area_struct *vma, unsigned long start, unsigned long end);
......
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