summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2009-08-21 14:32:48 -0400
committerJames Morris <jmorris@namei.org>2009-08-24 00:58:23 -0400
commit6777d773a463ac045d333b989d4e44660f8d92ad (patch)
tree17291984d71515cec0a1970ecce3d631ed2f7981 /include/linux
parent3edf2fb9d80a46d6c32ba12547a42419845b4b76 (diff)
kernel_read: redefine offset type
vfs_read() offset is defined as loff_t, but kernel_read() offset is only defined as unsigned long. Redefine kernel_read() offset as loff_t. Cc: stable@kernel.org Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67888a9e0655..73e9b643e455 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2123,7 +2123,7 @@ extern struct file *do_filp_open(int dfd, const char *pathname,
2123 int open_flag, int mode, int acc_mode); 2123 int open_flag, int mode, int acc_mode);
2124extern int may_open(struct path *, int, int); 2124extern int may_open(struct path *, int, int);
2125 2125
2126extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 2126extern int kernel_read(struct file *, loff_t, char *, unsigned long);
2127extern struct file * open_exec(const char *); 2127extern struct file * open_exec(const char *);
2128 2128
2129/* fs/dcache.c -- generic fs support functions */ 2129/* fs/dcache.c -- generic fs support functions */
'n225' href='#n225'>225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
/*
 *  Maple (970 eval board) setup code
 *
 *  (c) Copyright 2004 Benjamin Herrenschmidt (benh@kernel.crashing.org),
 *                     IBM Corp. 
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version
 *  2 of the License, or (at your option) any later version.
 *
 */

#define DEBUG

#include <linux/config.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/tty.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/major.h>
#include <linux/initrd.h>
#include <linux/vt_kern.h>
#include <linux/console.h>
#include <linux/ide.h>
#include <linux/pci.h>
#include <linux/adb.h>
#include <linux/cuda.h>
#include <linux/pmu.h>
#include <linux/irq.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <linux/serial.h>
#include <linux/smp.h>

#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/prom.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/kexec.h>
#include <asm/pci-bridge.h>
#include <asm/iommu.h>
#include <asm/machdep.h>
#include <asm/dma.h>
#include <asm/cputable.h>
#include <asm/time.h>
#include <asm/of_device.h>
#include <asm/lmb.h>
#include <asm/mpic.h>
#include <asm/udbg.h>

#include "maple.h"

#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
#else
#define DBG(fmt...)
#endif

static void maple_restart(char *cmd)
{
	unsigned int maple_nvram_base;
	unsigned int maple_nvram_offset;
	unsigned int maple_nvram_command;
	struct device_node *rtcs;

	/* find NVRAM device */
	rtcs = find_compatible_devices("nvram", "AMD8111");
	if (rtcs && rtcs->addrs) {
		maple_nvram_base = rtcs->addrs[0].address;
	} else {
		printk(KERN_EMERG "Maple: Unable to find NVRAM\n");
		printk(KERN_EMERG "Maple: Manual Restart Required\n");
		return;
	}

	/* find service processor device */
	rtcs = find_devices("service-processor");
	if (!rtcs) {
		printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
		printk(KERN_EMERG "Maple: Manual Restart Required\n");
		return;
	}
	maple_nvram_offset = *(unsigned int*) get_property(rtcs,
			"restart-addr", NULL);
	maple_nvram_command = *(unsigned int*) get_property(rtcs,
			"restart-value", NULL);

	/* send command */
	outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
	for (;;) ;
}

static void maple_power_off(void)
{
	unsigned int maple_nvram_base;
	unsigned int maple_nvram_offset;
	unsigned int maple_nvram_command;
	struct device_node *rtcs;

	/* find NVRAM device */
	rtcs = find_compatible_devices("nvram", "AMD8111");
	if (rtcs && rtcs->addrs) {
		maple_nvram_base = rtcs->addrs[0].address;
	} else {
		printk(KERN_EMERG "Maple: Unable to find NVRAM\n");
		printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
		return;
	}

	/* find service processor device */
	rtcs = find_devices("service-processor");
	if (!rtcs) {
		printk(KERN_EMERG "Maple: Unable to find Service Processor\n");
		printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
		return;
	}
	maple_nvram_offset = *(unsigned int*) get_property(rtcs,
			"power-off-addr", NULL);
	maple_nvram_command = *(unsigned int*) get_property(rtcs,
			"power-off-value", NULL);

	/* send command */
	outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset);
	for (;;) ;
}

static void maple_halt(void)
{
	maple_power_off();
}

#ifdef CONFIG_SMP
struct smp_ops_t maple_smp_ops = {
	.probe		= smp_mpic_probe,
	.message_pass	= smp_mpic_message_pass,
	.kick_cpu	= smp_generic_kick_cpu,
	.setup_cpu	= smp_mpic_setup_cpu,
	.give_timebase	= smp_generic_give_timebase,
	.take_timebase	= smp_generic_take_timebase,
};
#endif /* CONFIG_SMP */

void __init maple_setup_arch(void)
{
	/* init to some ~sane value until calibrate_delay() runs */
	loops_per_jiffy = 50000000;

	/* Setup SMP callback */
#ifdef CONFIG_SMP
	smp_ops = &maple_smp_ops;
#endif
	/* Lookup PCI hosts */
       	maple_pci_init();

#ifdef CONFIG_DUMMY_CONSOLE
	conswitchp = &dummy_con;
#endif

	printk(KERN_INFO "Using native/NAP idle loop\n");
}

/* 
 * Early initialization.
 */
static void __init maple_init_early(void)
{
	unsigned int default_speed;
	u64 physport;

	DBG(" -> maple_init_early\n");

	/* Initialize hash table, from now on, we can take hash faults
	 * and call ioremap
	 */
	hpte_init_native();

	/* Setup interrupt mapping options */
	ppc64_interrupt_controller = IC_OPEN_PIC;

	iommu_init_early_dart();