Commit 6fd4ce88 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus: (31 commits)
  MIPS: Close races in TLB modify handlers.
  MIPS: Add uasm UASM_i_SRL_SAFE macro.
  MIPS: RB532: Use hex_to_bin()
  MIPS: Enable cpu_has_clo_clz for MIPS Technologies' platforms
  MIPS: PowerTV: Provide cpu-feature-overrides.h
  MIPS: Remove pointless return statement from empty void functions.
  MIPS: Limit fixrange_init() to the FIXMAP region
  MIPS: Install handlers for software IRQs
  MIPS: Move FIXADDR_TOP into spaces.h
  MIPS: Add SYNC after cacheflush
  MIPS: pfn_valid() is broken on low memory HIGHMEM systems
  MIPS: HIGHMEM DMA on noncoherent MIPS32 processors
  MIPS: topdown mmap support
  MIPS: Remove redundant addr_limit assignment on exec.
  MIPS: AR7: Replace __attribute__((__packed__)) with __packed
  MIPS: AR7: Remove 'space before tabs' in platform.c
  MIPS: Lantiq: Add missing clk_enable and clk_disable functions.
  MIPS: AR7: Fix trailing semicolon bug in clock.c
  MAINTAINERS: Update MIPS entry.
  MIPS: BCM63xx: Remove duplicate PERF_IRQSTAT_REG definition
  ...
parents ba5b56cb bf28607f
...@@ -4217,9 +4217,10 @@ F: drivers/usb/image/microtek.* ...@@ -4217,9 +4217,10 @@ F: drivers/usb/image/microtek.*
MIPS MIPS
M: Ralf Baechle <ralf@linux-mips.org> M: Ralf Baechle <ralf@linux-mips.org>
W: http://www.linux-mips.org/
L: linux-mips@linux-mips.org L: linux-mips@linux-mips.org
W: http://www.linux-mips.org/
T: git git://git.linux-mips.org/pub/scm/linux.git T: git git://git.linux-mips.org/pub/scm/linux.git
Q: http://patchwork.linux-mips.org/project/linux-mips/list/
S: Supported S: Supported
F: Documentation/mips/ F: Documentation/mips/
F: arch/mips/ F: arch/mips/
......
...@@ -16,6 +16,7 @@ platforms += lasat ...@@ -16,6 +16,7 @@ platforms += lasat
platforms += loongson platforms += loongson
platforms += mipssim platforms += mipssim
platforms += mti-malta platforms += mti-malta
platforms += netlogic
platforms += pmc-sierra platforms += pmc-sierra
platforms += pnx833x platforms += pnx833x
platforms += pnx8550 platforms += pnx8550
......
...@@ -191,18 +191,6 @@ endif ...@@ -191,18 +191,6 @@ endif
# #
include $(srctree)/arch/mips/Kbuild.platforms include $(srctree)/arch/mips/Kbuild.platforms
#
# NETLOGIC SOC Common (common)
#
cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/mach-netlogic
cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/netlogic
#
# NETLOGIC XLR/XLS SoC, Simulator and boards
#
core-$(CONFIG_NLM_XLR) += arch/mips/netlogic/xlr/
load-$(CONFIG_NLM_XLR_BOARD) += 0xffffffff84000000
cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
drivers-$(CONFIG_PCI) += arch/mips/pci/ drivers-$(CONFIG_PCI) += arch/mips/pci/
......
...@@ -443,7 +443,7 @@ struct clk *clk_get(struct device *dev, const char *id) ...@@ -443,7 +443,7 @@ struct clk *clk_get(struct device *dev, const char *id)
return &vbus_clk; return &vbus_clk;
if (!strcmp(id, "cpu")) if (!strcmp(id, "cpu"))
return &cpu_clk; return &cpu_clk;
if (!strcmp(id, "dsp")); if (!strcmp(id, "dsp"))
return &dsp_clk; return &dsp_clk;
if (!strcmp(id, "vbus")) if (!strcmp(id, "vbus"))
return &vbus_clk; return &vbus_clk;
......
...@@ -229,7 +229,7 @@ static struct resource cpmac_low_res[] = { ...@@ -229,7 +229,7 @@ static struct resource cpmac_low_res[] = {
.name = "irq", .name = "irq",
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
.start = 27, .start = 27,
.end = 27, .end = 27,
}, },
}; };
......
...@@ -77,7 +77,7 @@ struct psp_env_chunk { ...@@ -77,7 +77,7 @@ struct psp_env_chunk {
u16 csum; u16 csum;
u8 len; u8 len;
char data[11]; char data[11];
} __attribute__ ((packed)); } __packed;
struct psp_var_map_entry { struct psp_var_map_entry {
u8 num; u8 num;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#define _ASM_FIXMAP_H #define _ASM_FIXMAP_H
#include <asm/page.h> #include <asm/page.h>
#include <spaces.h>
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
#include <linux/threads.h> #include <linux/threads.h>
#include <asm/kmap_types.h> #include <asm/kmap_types.h>
...@@ -67,15 +68,6 @@ enum fixed_addresses { ...@@ -67,15 +68,6 @@ enum fixed_addresses {
* the start of the fixmap, and leave one page empty * the start of the fixmap, and leave one page empty
* at the top of mem.. * at the top of mem..
*/ */
#ifdef CONFIG_BCM63XX
#define FIXADDR_TOP ((unsigned long)(long)(int)0xff000000)
#else
#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000))
#else
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
#endif
#endif
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
#ifndef _ASM_GT64120_H #ifndef _ASM_GT64120_H
#define _ASM_GT64120_H #define _ASM_GT64120_H
#include <linux/clocksource.h>
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
static inline void irq_dispose_mapping(unsigned int virq) static inline void irq_dispose_mapping(unsigned int virq)
{ {
return;
} }
#ifdef CONFIG_I8259 #ifdef CONFIG_I8259
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
/* Interrupt Mask register */ /* Interrupt Mask register */
#define PERF_IRQMASK_REG 0xc #define PERF_IRQMASK_REG 0xc
#define PERF_IRQSTAT_REG 0x10
/* Interrupt Status register */ /* Interrupt Status register */
#define PERF_IRQSTAT_REG 0x10 #define PERF_IRQSTAT_REG 0x10
......
/*
* 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
* for more details.
*
* Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
* Copyright (C) 2000, 2002 Maciej W. Rozycki
* Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_BCM63XX_SPACES_H
#define _ASM_BCM63XX_SPACES_H
#define FIXADDR_TOP ((unsigned long)(long)(int)0xff000000)
#include <asm/mach-generic/spaces.h>
#endif /* __ASM_BCM63XX_SPACES_H */
...@@ -49,7 +49,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) ...@@ -49,7 +49,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
static inline void plat_extra_sync_for_device(struct device *dev) static inline void plat_extra_sync_for_device(struct device *dev)
{ {
return;
} }
static inline int plat_dma_mapping_error(struct device *dev, static inline int plat_dma_mapping_error(struct device *dev,
......
...@@ -82,4 +82,8 @@ ...@@ -82,4 +82,8 @@
#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
#endif #endif
#ifndef FIXADDR_TOP
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
#endif
#endif /* __ASM_MACH_GENERIC_SPACES_H */ #endif /* __ASM_MACH_GENERIC_SPACES_H */
...@@ -60,7 +60,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) ...@@ -60,7 +60,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
static inline void plat_extra_sync_for_device(struct device *dev) static inline void plat_extra_sync_for_device(struct device *dev)
{ {
return;
} }
static inline int plat_dma_mapping_error(struct device *dev, static inline int plat_dma_mapping_error(struct device *dev,
......
...@@ -50,7 +50,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) ...@@ -50,7 +50,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
static inline void plat_extra_sync_for_device(struct device *dev) static inline void plat_extra_sync_for_device(struct device *dev)
{ {
return;
} }
static inline int plat_dma_mapping_error(struct device *dev, static inline int plat_dma_mapping_error(struct device *dev,
......
...@@ -55,7 +55,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) ...@@ -55,7 +55,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
static inline void plat_extra_sync_for_device(struct device *dev) static inline void plat_extra_sync_for_device(struct device *dev)
{ {
return;
} }
static inline int plat_dma_mapping_error(struct device *dev, static inline int plat_dma_mapping_error(struct device *dev,
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
/* #define cpu_has_vtag_icache ? */ /* #define cpu_has_vtag_icache ? */
/* #define cpu_has_dc_aliases ? */ /* #define cpu_has_dc_aliases ? */
/* #define cpu_has_ic_fills_f_dc ? */ /* #define cpu_has_ic_fills_f_dc ? */
#define cpu_has_clo_clz 1
#define cpu_has_nofpuex 0 #define cpu_has_nofpuex 0
/* #define cpu_has_64bits ? */ /* #define cpu_has_64bits ? */
/* #define cpu_has_64bit_zero_reg ? */ /* #define cpu_has_64bit_zero_reg ? */
...@@ -58,6 +59,7 @@ ...@@ -58,6 +59,7 @@
/* #define cpu_has_vtag_icache ? */ /* #define cpu_has_vtag_icache ? */
/* #define cpu_has_dc_aliases ? */ /* #define cpu_has_dc_aliases ? */
/* #define cpu_has_ic_fills_f_dc ? */ /* #define cpu_has_ic_fills_f_dc ? */
#define cpu_has_clo_clz 1
#define cpu_has_nofpuex 0 #define cpu_has_nofpuex 0
/* #define cpu_has_64bits ? */ /* #define cpu_has_64bits ? */
/* #define cpu_has_64bit_zero_reg ? */ /* #define cpu_has_64bit_zero_reg ? */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
/* #define cpu_has_vtag_icache ? */ /* #define cpu_has_vtag_icache ? */
/* #define cpu_has_dc_aliases ? */ /* #define cpu_has_dc_aliases ? */
/* #define cpu_has_ic_fills_f_dc ? */ /* #define cpu_has_ic_fills_f_dc ? */
#define cpu_has_clo_clz 1
#define cpu_has_nofpuex 0 #define cpu_has_nofpuex 0
/* #define cpu_has_64bits ? */ /* #define cpu_has_64bits ? */
/* #define cpu_has_64bit_zero_reg ? */ /* #define cpu_has_64bit_zero_reg ? */
...@@ -56,6 +57,7 @@ ...@@ -56,6 +57,7 @@
/* #define cpu_has_vtag_icache ? */ /* #define cpu_has_vtag_icache ? */
/* #define cpu_has_dc_aliases ? */ /* #define cpu_has_dc_aliases ? */
/* #define cpu_has_ic_fills_f_dc ? */ /* #define cpu_has_ic_fills_f_dc ? */
#define cpu_has_clo_clz 1
#define cpu_has_nofpuex 0 #define cpu_has_nofpuex 0
/* #define cpu_has_64bits ? */ /* #define cpu_has_64bits ? */
/* #define cpu_has_64bit_zero_reg ? */ /* #define cpu_has_64bit_zero_reg ? */
......
/*
* Copyright (C) 2010 Cisco Systems, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _ASM_MACH_POWERTV_CPU_FEATURE_OVERRIDES_H_
#define _ASM_MACH_POWERTV_CPU_FEATURE_OVERRIDES_H_
#define cpu_has_tlb 1
#define cpu_has_4kex 1
#define cpu_has_3k_cache 0
#define cpu_has_4k_cache 1
#define cpu_has_tx39_cache 0
#define cpu_has_fpu 0
#define cpu_has_counter 1
#define cpu_has_watch 1
#define cpu_has_divec 1
#define cpu_has_vce 0
#define cpu_has_cache_cdex_p 0
#define cpu_has_cache_cdex_s 0
#define cpu_has_mcheck 1
#define cpu_has_ejtag 1
#define cpu_has_llsc 1
#define cpu_has_mips16 0
#define cpu_has_mdmx 0
#define cpu_has_mips3d 0
#define cpu_has_smartmips 0
#define cpu_has_vtag_icache 0
#define cpu_has_dc_aliases 0
#define cpu_has_ic_fills_f_dc 0
#define cpu_has_mips32r1 0
#define cpu_has_mips32r2 1
#define cpu_has_mips64r1 0
#define cpu_has_mips64r2 0
#define cpu_has_dsp 0
#define cpu_has_mipsmt 0
#define cpu_has_userlocal 0
#define cpu_has_nofpuex 0
#define cpu_has_64bits 0
#define cpu_has_64bit_zero_reg 0
#define cpu_has_vint 1
#define cpu_has_veic 1
#define cpu_has_inclusive_pcaches 0
#define cpu_dcache_line_size() 32
#define cpu_icache_line_size() 32
#endif
...@@ -102,7 +102,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask) ...@@ -102,7 +102,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
static inline void plat_extra_sync_for_device(struct device *dev) static inline void plat_extra_sync_for_device(struct device *dev)
{ {
return;
} }
static inline int plat_dma_mapping_error(struct device *dev, static inline int plat_dma_mapping_error(struct device *dev,
......
/*
* 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
* for more details.
*
* Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
* Copyright (C) 2000, 2002 Maciej W. Rozycki
* Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_TX39XX_SPACES_H
#define _ASM_TX39XX_SPACES_H
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfefe0000)
#include <asm/mach-generic/spaces.h>
#endif /* __ASM_TX39XX_SPACES_H */
/*
* 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
* for more details.
*
* Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
* Copyright (C) 2000, 2002 Maciej W. Rozycki
* Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_TX49XX_SPACES_H
#define _ASM_TX49XX_SPACES_H
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfefe0000)
#include <asm/mach-generic/spaces.h>
#endif /* __ASM_TX49XX_SPACES_H */
...@@ -414,6 +414,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, ...@@ -414,6 +414,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
* constraints placed on us by the cache architecture. * constraints placed on us by the cache architecture.
*/ */
#define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA
#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
/* /*
* No page table caches to initialise * No page table caches to initialise
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#ifndef __ASM_SMP_OPS_H #ifndef __ASM_SMP_OPS_H
#define __ASM_SMP_OPS_H #define __ASM_SMP_OPS_H
#include <linux/errno.h>
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#include <linux/cpumask.h> #include <linux/cpumask.h>
...@@ -56,8 +58,43 @@ static inline void register_smp_ops(struct plat_smp_ops *ops) ...@@ -56,8 +58,43 @@ static inline void register_smp_ops(struct plat_smp_ops *ops)
#endif /* !CONFIG_SMP */ #endif /* !CONFIG_SMP */
extern struct plat_smp_ops up_smp_ops; static inline int register_up_smp_ops(void)
extern struct plat_smp_ops cmp_smp_ops; {
extern struct plat_smp_ops vsmp_smp_ops; #ifdef CONFIG_SMP_UP
extern struct plat_smp_ops up_smp_ops;
register_smp_ops(&up_smp_ops);
return 0;
#else
return -ENODEV;
#endif
}
static inline int register_cmp_smp_ops(void)
{
#ifdef CONFIG_MIPS_CMP
extern struct plat_smp_ops cmp_smp_ops;
register_smp_ops(&cmp_smp_ops);
return 0;
#else
return -ENODEV;
#endif
}
static inline int register_vsmp_smp_ops(void)
{
#ifdef CONFIG_MIPS_MT_SMP
extern struct plat_smp_ops vsmp_smp_ops;
register_smp_ops(&vsmp_smp_ops);
return 0;
#else
return -ENODEV;
#endif
}
#endif /* __ASM_SMP_OPS_H */ #endif /* __ASM_SMP_OPS_H */
...@@ -46,6 +46,7 @@ extern void smtc_prepare_cpus(int cpus); ...@@ -46,6 +46,7 @@ extern void smtc_prepare_cpus(int cpus);
extern void smtc_smp_finish(void); extern void smtc_smp_finish(void);
extern void smtc_boot_secondary(int cpu, struct task_struct *t); extern void smtc_boot_secondary(int cpu, struct task_struct *t);
extern void smtc_cpus_done(void); extern void smtc_cpus_done(void);
extern void smtc_init_secondary(void);
/* /*
......
...@@ -150,6 +150,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ ...@@ -150,6 +150,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh) # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh)
# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh) # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh)
# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh) # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh)
# define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_dsrl_safe(buf, rs, rt, sh)
# define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh) # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh)
# define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd) # define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd)
# define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd) # define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd)
...@@ -165,6 +166,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \ ...@@ -165,6 +166,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
# define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh) # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh)
# define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh) # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh)
# define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh) # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh)
# define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh)
# define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_rotr(buf, rs, rt, sh) # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_rotr(buf, rs, rt, sh)
# define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd) # define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd)
# define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd) # define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd)
......
...@@ -363,17 +363,18 @@ ...@@ -363,17 +363,18 @@
#define __NR_open_by_handle_at (__NR_Linux + 340) #define __NR_open_by_handle_at (__NR_Linux + 340)
#define __NR_clock_adjtime (__NR_Linux + 341) #define __NR_clock_adjtime (__NR_Linux + 341)
#define __NR_syncfs (__NR_Linux + 342) #define __NR_syncfs (__NR_Linux + 342)
#define __NR_setns (__NR_Linux + 343) #define __NR_sendmmsg (__NR_Linux + 343)
#define __NR_setns (__NR_Linux + 344)
/* /*
* Offset of the last Linux o32 flavoured syscall * Offset of the last Linux o32 flavoured syscall
*/ */
#define __NR_Linux_syscalls 343 #define __NR_Linux_syscalls 344
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
#define __NR_O32_Linux 4000 #define __NR_O32_Linux 4000
#define __NR_O32_Linux_syscalls 343 #define __NR_O32_Linux_syscalls 344
#if _MIPS_SIM == _MIPS_SIM_ABI64 #if _MIPS_SIM == _MIPS_SIM_ABI64
...@@ -683,17 +684,18 @@ ...@@ -683,17 +684,18 @@
#define __NR_open_by_handle_at (__NR_Linux + 299) #define __NR_open_by_handle_at (__NR_Linux + 299)
#define __NR_clock_adjtime (__NR_Linux + 300) #define __NR_clock_adjtime (__NR_Linux + 300)
#define __NR_syncfs (__NR_Linux + 301) #define __NR_syncfs (__NR_Linux + 301)
#define __NR_setns (__NR_Linux + 302) #define __NR_sendmmsg (__NR_Linux + 302)
#define __NR_setns (__NR_Linux + 303)
/* /*
* Offset of the last Linux 64-bit flavoured syscall * Offset of the last Linux 64-bit flavoured syscall
*/ */
#define __NR_Linux_syscalls 302 #define __NR_Linux_syscalls 303
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
#define __NR_64_Linux 5000 #define __NR_64_Linux 5000
#define __NR_64_Linux_syscalls 302 #define __NR_64_Linux_syscalls 303
#if _MIPS_SIM == _MIPS_SIM_NABI32 #if _MIPS_SIM == _MIPS_SIM_NABI32
...@@ -1008,17 +1010,18 @@ ...@@ -1008,17 +1010,18 @@
#define __NR_open_by_handle_at (__NR_Linux + 304) #define __NR_open_by_handle_at (__NR_Linux + 304)
#define __NR_clock_adjtime (__NR_Linux + 305) #define __NR_clock_adjtime (__NR_Linux + 305)
#define __NR_syncfs (__NR_Linux + 306) #define __NR_syncfs (__NR_Linux + 306)
#define __NR_setns (__NR_Linux + 307) #define __NR_sendmmsg (__NR_Linux + 307)
#define __NR_setns (__NR_Linux + 308)
/* /*
* Offset of the last N32 flavoured syscall * Offset of the last N32 flavoured syscall
*/ */
#define __NR_Linux_syscalls 307 #define __NR_Linux_syscalls 308
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
#define __NR_N32_Linux 6000 #define __NR_N32_Linux 6000
#define __NR_N32_Linux_syscalls 307 #define __NR_N32_Linux_syscalls 308
#ifdef __KERNEL__ #ifdef __KERNEL__
......
...@@ -71,7 +71,6 @@ void r4k_wait_irqoff(void) ...@@ -71,7 +71,6 @@ void r4k_wait_irqoff(void)
local_irq_enable(); local_irq_enable();
__asm__(" .globl __pastwait \n" __asm__(" .globl __pastwait \n"
"__pastwait: \n"); "__pastwait: \n");
return;
} }
/* /*
......
...@@ -103,14 +103,12 @@ void __init mips_cpu_irq_init(void) ...@@ -103,14 +103,12 @@ void __init mips_cpu_irq_init(void)
clear_c0_status(ST0_IM); clear_c0_status(ST0_IM);
clear_c0_cause(CAUSEF_IP); clear_c0_cause(CAUSEF_IP);
/* /* Software interrupts are used for MT/CMT IPI */
* Only MT is using the software interrupts currently, so we just for (i = irq_base; i < irq_base + 2; i++)
* leave them uninitialized for other processors. irq_set_chip_and_handler(i, cpu_has_mipsmt ?
*/ &mips_mt_cpu_irq_controller :
if (cpu_has_mipsmt) &mips_cpu_irq_controller,
for (i = irq_base; i < irq_base + 2; i++) handle_percpu_irq);
irq_set_chip_and_handler(i, &mips_mt_cpu_irq_controller,
handle_percpu_irq);
for (i = irq_base + 2; i < irq_base + 8; i++) for (i = irq_base + 2; i < irq_base + 8; i++)
irq_set_chip_and_handler(i, &mips_cpu_irq_controller, irq_set_chip_and_handler(i, &mips_cpu_irq_controller,
......
...@@ -192,8 +192,6 @@ static void mipspmu_event_update(struct perf_event *event, ...@@ -192,8 +192,6 @@ static void mipspmu_event_update(struct perf_event *event,
local64_add(delta, &event->count); local64_add(delta, &event->count);
local64_sub(delta, &hwc->period_left); local64_sub(delta, &hwc->period_left);
return;
} }
static void mipspmu_start(struct perf_event *event, int flags) static void mipspmu_start(struct perf_event *event, int flags)
......
...@@ -103,7 +103,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) ...@@ -103,7 +103,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
__init_dsp(); __init_dsp();
regs->cp0_epc = pc; regs->cp0_epc = pc;
regs->regs[29] = sp; regs->regs[29] = sp;
current_thread_info()->addr_limit = USER_DS;
} }
void exit_thread(void) void exit_thread(void)
......
...@@ -589,6 +589,7 @@ einval: li v0, -ENOSYS ...@@ -589,6 +589,7 @@ einval: li v0, -ENOSYS
sys sys_open_by_handle_at 3 /* 4340 */ sys sys_open_by_handle_at 3 /* 4340 */
sys sys_clock_adjtime 2 sys sys_clock_adjtime 2
sys sys_syncfs 1 sys sys_syncfs 1
sys sys_sendmmsg 4
sys sys_setns 2 sys sys_setns 2
.endm .endm
......
...@@ -428,5 +428,6 @@ sys_call_table: ...@@ -428,5 +428,6 @@ sys_call_table:
PTR sys_open_by_handle_at PTR sys_open_by_handle_at
PTR sys_clock_adjtime /* 5300 */ PTR sys_clock_adjtime /* 5300 */
PTR sys_syncfs PTR sys_syncfs
PTR sys_sendmmsg
PTR sys_setns PTR sys_setns
.size sys_call_table,.-sys_call_table .size sys_call_table,.-sys_call_table
...@@ -428,5 +428,6 @@ EXPORT(sysn32_call_table) ...@@ -428,5 +428,6 @@ EXPORT(sysn32_call_table)
PTR sys_open_by_handle_at PTR sys_open_by_handle_at
PTR compat_sys_clock_adjtime /* 6305 */ PTR compat_sys_clock_adjtime /* 6305 */
PTR sys_syncfs PTR sys_syncfs
PTR compat_sys_sendmmsg
PTR sys_setns PTR sys_setns
.size sysn32_call_table,.-sysn32_call_table .size sysn32_call_table,.-sysn32_call_table
...@@ -546,5 +546,6 @@ sys_call_table: ...@@ -546,5 +546,6 @@ sys_call_table:
PTR compat_sys_open_by_handle_at /* 4340 */ PTR compat_sys_open_by_handle_at /* 4340 */
PTR compat_sys_clock_adjtime PTR compat_sys_clock_adjtime
PTR sys_syncfs PTR sys_syncfs
PTR compat_sys_sendmmsg
PTR sys_setns PTR sys_setns
.size sys_call_table,.-sys_call_table .size sys_call_table,.-sys_call_table
...@@ -100,6 +100,19 @@ void clk_put(struct clk *clk) ...@@ -100,6 +100,19 @@ void clk_put(struct clk *clk)
} }
EXPORT_SYMBOL(clk_put); EXPORT_SYMBOL(clk_put);
int clk_enable(struct clk *clk)
{
/* not used */
return 0;
}
EXPORT_SYMBOL(clk_enable);
void clk_disable(struct clk *clk)
{
/* not used */
}
EXPORT_SYMBOL(clk_disable);
static inline u32 ltq_get_counter_resolution(void) static inline u32 ltq_get_counter_resolution(void)
{ {
u32 res; u32 res;
......
...@@ -45,8 +45,6 @@ void ec_write(unsigned short addr, unsigned char val) ...@@ -45,8 +45,6 @@ void ec_write(unsigned short addr, unsigned char val)
/* flush the write action */ /* flush the write action */
inb(EC_IO_PORT_DATA); inb(EC_IO_PORT_DATA);
spin_unlock_irqrestore(&index_access_lock, flags); spin_unlock_irqrestore(&index_access_lock, flags);
return;
} }
EXPORT_SYMBOL_GPL(ec_write); EXPORT_SYMBOL_GPL(ec_write);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <asm/time.h> #include <asm/time.h>
#include <asm/mips-boards/sim.h> #include <asm/mips-boards/sim.h>
#include <asm/mips-boards/simint.h> #include <asm/mips-boards/simint.h>
#include <asm/smp-ops.h>
static void __init serial_init(void); static void __init serial_init(void);
...@@ -59,18 +60,17 @@ void __init prom_init(void) ...@@ -59,18 +60,17 @@ void __init prom_init(void)
prom_meminit(); prom_meminit();
#ifdef CONFIG_MIPS_MT_SMP if (cpu_has_mipsmt) {
if (cpu_has_mipsmt) if (!register_vsmp_smp_ops())
register_smp_ops(&vsmp_smp_ops); return;
else
register_smp_ops(&up_smp_ops);
#endif
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
if (cpu_has_mipsmt)
register_smp_ops(&ssmtc_smp_ops); register_smp_ops(&ssmtc_smp_ops);
else return;
register_smp_ops(&up_smp_ops);
#endif #endif
}
register_up_smp_ops();
} }
static void __init serial_init(void) static void __init serial_init(void)
......
...@@ -604,6 +604,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) ...@@ -604,6 +604,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
r4k_blast_scache(); r4k_blast_scache();
else else
blast_scache_range(addr, addr + size); blast_scache_range(addr, addr + size);
__sync();
return; return;
} }
...@@ -620,6 +621,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) ...@@ -620,6 +621,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
} }
bc_wback_inv(addr, size); bc_wback_inv(addr, size);
__sync();
} }
static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
...@@ -647,6 +649,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) ...@@ -647,6 +649,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
(addr + size - 1) & almask); (addr + size - 1) & almask);
blast_inv_scache_range(addr, addr + size); blast_inv_scache_range(addr, addr + size);
} }
__sync();
return; return;
} }
...@@ -663,6 +666,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) ...@@ -663,6 +666,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
} }
bc_inv(addr, size); bc_inv(addr, size);
__sync();
} }
#endif /* CONFIG_DMA_NONCOHERENT */ #endif /* CONFIG_DMA_NONCOHERENT */
......
...@@ -15,18 +15,18 @@ ...@@ -15,18 +15,18 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/highmem.h>
#include <asm/cache.h> #include <asm/cache.h>
#include <asm/io.h> #include <asm/io.h>
#include <dma-coherence.h> #include <dma-coherence.h>
static inline unsigned long dma_addr_to_virt(struct device *dev, static inline struct page *dma_addr_to_page(struct device *dev,
dma_addr_t dma_addr) dma_addr_t dma_addr)
{ {
unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr); return pfn_to_page(
plat_dma_addr_to_phys(dev, dma_addr) >> PAGE_SHIFT);
return (unsigned long)phys_to_virt(addr);
} }
/* /*
...@@ -148,20 +148,20 @@ static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr, ...@@ -148,20 +148,20 @@ static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr,
free_pages(addr, get_order(size)); free_pages(addr, get_order(size));
} }
static inline void __dma_sync(unsigned long addr, size_t size, static inline void __dma_sync_virtual(void *addr, size_t size,
enum dma_data_direction direction) enum dma_data_direction direction)
{ {
switch (direction) { switch (direction) {
case DMA_TO_DEVICE: case DMA_TO_DEVICE:
dma_cache_wback(addr, size); dma_cache_wback((unsigned long)addr, size);
break; break;
case DMA_FROM_DEVICE: case DMA_FROM_DEVICE:
dma_cache_inv(addr, size); dma_cache_inv((unsigned long)addr, size);
break; break;
case DMA_BIDIRECTIONAL: case DMA_BIDIRECTIONAL:
dma_cache_wback_inv(addr, size); dma_cache_wback_inv((unsigned long)addr, size);
break; break;
default: default:
...@@ -169,12 +169,49 @@ static inline void __dma_sync(unsigned long addr, size_t size, ...@@ -169,12 +169,49 @@ static inline void __dma_sync(unsigned long addr, size_t size,
} }
} }
/*
* A single sg entry may refer to multiple physically contiguous
* pages. But we still need to process highmem pages individually.
* If highmem is not configured then the bulk of this loop gets
* optimized out.
*/
static inline void __dma_sync(struct page *page,
unsigned long offset, size_t size, enum dma_data_direction direction)
{
size_t left = size;
do {
size_t len = left;
if (PageHighMem(page)) {
void *addr;
if (offset + len > PAGE_SIZE) {
if (offset >= PAGE_SIZE) {
page += offset >> PAGE_SHIFT;
offset &= ~PAGE_MASK;
}
len = PAGE_SIZE - offset;
}
addr = kmap_atomic(page);
__dma_sync_virtual(addr + offset, len, direction);
kunmap_atomic(addr);
} else
__dma_sync_virtual(page_address(page) + offset,
size, direction);
offset = 0;
page++;
left -= len;
} while (left);
}
static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction direction, struct dma_attrs *attrs) size_t size, enum dma_data_direction direction, struct dma_attrs *attrs)
{ {
if (cpu_is_noncoherent_r10000(dev)) if (cpu_is_noncoherent_r10000(dev))
__dma_sync(dma_addr_to_virt(dev, dma_addr), size, __dma_sync(dma_addr_to_page(dev, dma_addr),
direction); dma_addr & ~PAGE_MASK, size, direction);
plat_unmap_dma_mem(dev, dma_addr, size, direction); plat_unmap_dma_mem(dev, dma_addr, size, direction);
} }
...@@ -185,13 +222,11 @@ static int mips_dma_map_sg(struct device *dev, struct scatterlist *sg, ...@@ -185,13 +222,11 @@ static int mips_dma_map_sg(struct device *dev, struct scatterlist *sg,
int i; int i;
for (i = 0; i < nents; i++, sg++) { for (i = 0; i < nents; i++, sg++) {
unsigned long addr; if (!plat_device_is_coherent(dev))
__dma_sync(sg_page(sg), sg->offset, sg->length,
addr = (unsigned long) sg_virt(sg); direction);
if (!plat_device_is_coherent(dev) && addr) sg->dma_address = plat_map_dma_mem_page(dev, sg_page(sg)) +
__dma_sync(addr, sg->length, direction); sg->offset;
sg->dma_address = plat_map_dma_mem(dev,
(void *)addr, sg->length);
} }
return nents; return nents;
...@@ -201,30 +236,23 @@ static dma_addr_t mips_dma_map_page(struct device *dev, struct page *page, ...@@ -201,30 +236,23 @@ static dma_addr_t mips_dma_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t size, enum dma_data_direction direction, unsigned long offset, size_t size, enum dma_data_direction direction,
struct dma_attrs *attrs) struct dma_attrs *attrs)
{ {
unsigned long addr;
addr = (unsigned long) page_address(page) + offset;
if (!plat_device_is_coherent(dev)) if (!plat_device_is_coherent(dev))
__dma_sync(addr, size, direction); __dma_sync(page, offset, size, direction);
return plat_map_dma_mem(dev, (void *)addr, size); return plat_map_dma_mem_page(dev, page) + offset;
} }
static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg, static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
int nhwentries, enum dma_data_direction direction, int nhwentries, enum dma_data_direction direction,
struct dma_attrs *attrs) struct dma_attrs *attrs)
{ {
unsigned long addr;
int i; int i;
for (i = 0; i < nhwentries; i++, sg++) { for (i = 0; i < nhwentries; i++, sg++) {
if (!plat_device_is_coherent(dev) && if (!plat_device_is_coherent(dev) &&
direction != DMA_TO_DEVICE) { direction != DMA_TO_DEVICE)
addr = (unsigned long) sg_virt(sg); __dma_sync(sg_page(sg), sg->offset, sg->length,
if (addr) direction);
__dma_sync(addr, sg->length, direction);
}
plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction); plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction);
} }
} }
...@@ -232,24 +260,18 @@ static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg, ...@@ -232,24 +260,18 @@ static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
static void mips_dma_sync_single_for_cpu(struct device *dev, static void mips_dma_sync_single_for_cpu(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
{ {
if (cpu_is_noncoherent_r10000(dev)) { if (cpu_is_noncoherent_r10000(dev))
unsigned long addr; __dma_sync(dma_addr_to_page(dev, dma_handle),
dma_handle & ~PAGE_MASK, size, direction);
addr = dma_addr_to_virt(dev, dma_handle);
__dma_sync(addr, size, direction);
}
} }
static void mips_dma_sync_single_for_device(struct device *dev, static void mips_dma_sync_single_for_device(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
{ {
plat_extra_sync_for_device(dev); plat_extra_sync_for_device(dev);
if (!plat_device_is_coherent(dev)) { if (!plat_device_is_coherent(dev))
unsigned long addr; __dma_sync(dma_addr_to_page(dev, dma_handle),
dma_handle & ~PAGE_MASK, size, direction);
addr = dma_addr_to_virt(dev, dma_handle);
__dma_sync(addr, size, direction);
}
} }
static void mips_dma_sync_sg_for_cpu(struct device *dev, static void mips_dma_sync_sg_for_cpu(struct device *dev,
...@@ -260,8 +282,8 @@ static void mips_dma_sync_sg_for_cpu(struct device *dev, ...@@ -260,8 +282,8 @@ static void mips_dma_sync_sg_for_cpu(struct device *dev,
/* Make sure that gcc doesn't leave the empty loop body. */ /* Make sure that gcc doesn't leave the empty loop body. */
for (i = 0; i < nelems; i++, sg++) { for (i = 0; i < nelems; i++, sg++) {
if (cpu_is_noncoherent_r10000(dev)) if (cpu_is_noncoherent_r10000(dev))
__dma_sync((unsigned long)page_address(sg_page(sg)), __dma_sync(sg_page(sg), sg->offset, sg->length,
sg->length, direction); direction);
} }
} }
...@@ -273,8 +295,8 @@ static void mips_dma_sync_sg_for_device(struct device *dev, ...@@ -273,8 +295,8 @@ static void mips_dma_sync_sg_for_device(struct device *dev,
/* Make sure that gcc doesn't leave the empty loop body. */ /* Make sure that gcc doesn't leave the empty loop body. */
for (i = 0; i < nelems; i++, sg++) { for (i = 0; i < nelems; i++, sg++) {
if (!plat_device_is_coherent(dev)) if (!plat_device_is_coherent(dev))
__dma_sync((unsigned long)page_address(sg_page(sg)), __dma_sync(sg_page(sg), sg->offset, sg->length,
sg->length, direction); direction);
} }
} }
...@@ -295,7 +317,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, ...@@ -295,7 +317,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
plat_extra_sync_for_device(dev); plat_extra_sync_for_device(dev);
if (!plat_device_is_coherent(dev)) if (!plat_device_is_coherent(dev))
__dma_sync((unsigned long)vaddr, size, direction); __dma_sync_virtual(vaddr, size, direction);
} }
EXPORT_SYMBOL(dma_cache_sync); EXPORT_SYMBOL(dma_cache_sync);
......
...@@ -277,11 +277,11 @@ void __init fixrange_init(unsigned long start, unsigned long end, ...@@ -277,11 +277,11 @@ void __init fixrange_init(unsigned long start, unsigned long end,
k = __pmd_offset(vaddr); k = __pmd_offset(vaddr);
pgd = pgd_base + i; pgd = pgd_base + i;
for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
pud = (pud_t *)pgd; pud = (pud_t *)pgd;
for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { for ( ; (j < PTRS_PER_PUD) && (vaddr < end); pud++, j++) {
pmd = (pmd_t *)pud; pmd = (pmd_t *)pud;
for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { for (; (k < PTRS_PER_PMD) && (vaddr < end); pmd++, k++) {
if (pmd_none(*pmd)) { if (pmd_none(*pmd)) {
pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
set_pmd(pmd, __pmd((unsigned long)pte)); set_pmd(pmd, __pmd((unsigned long)pte));
...@@ -368,7 +368,7 @@ void __init mem_init(void) ...@@ -368,7 +368,7 @@ void __init mem_init(void)
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet" #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
#endif #endif
max_mapnr = highend_pfn; max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;
#else #else
max_mapnr = max_low_pfn; max_mapnr = max_low_pfn;
#endif #endif
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/personality.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -17,21 +18,65 @@ unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ ...@@ -17,21 +18,65 @@ unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */
EXPORT_SYMBOL(shm_align_mask); EXPORT_SYMBOL(shm_align_mask);
/* gap between mmap and stack */
#define MIN_GAP (128*1024*1024UL)
#define MAX_GAP ((TASK_SIZE)/6*5)
static int mmap_is_legacy(void)
{
if (current->personality & ADDR_COMPAT_LAYOUT)
return 1;
if (rlimit(RLIMIT_STACK) == RLIM_INFINITY)
return 1;
return sysctl_legacy_va_layout;
}
static unsigned long mmap_base(unsigned long rnd)
{
unsigned long gap = rlimit(RLIMIT_STACK);
if (gap < MIN_GAP)
gap = MIN_GAP;
else if (gap > MAX_GAP)
gap = MAX_GAP;
return PAGE_ALIGN(TASK_SIZE - gap - rnd);
}
static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
unsigned long pgoff)
{
unsigned long base = addr & ~shm_align_mask;
unsigned long off = (pgoff << PAGE_SHIFT) & shm_align_mask;
if (base + off <= addr)
return base + off;
return base - off;
}
#define COLOUR_ALIGN(addr,pgoff) \ #define COLOUR_ALIGN(addr,pgoff) \
((((addr) + shm_align_mask) & ~shm_align_mask) + \ ((((addr) + shm_align_mask) & ~shm_align_mask) + \
(((pgoff) << PAGE_SHIFT) & shm_align_mask)) (((pgoff) << PAGE_SHIFT) & shm_align_mask))
unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, enum mmap_allocation_direction {UP, DOWN};
unsigned long len, unsigned long pgoff, unsigned long flags)
static unsigned long arch_get_unmapped_area_foo(struct file *filp,
unsigned long addr0, unsigned long len, unsigned long pgoff,
unsigned long flags, enum mmap_allocation_direction dir)
{ {
struct vm_area_struct * vmm; struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
unsigned long addr = addr0;
int do_color_align; int do_color_align;
if (len > TASK_SIZE) if (unlikely(len > TASK_SIZE))
return -ENOMEM; return -ENOMEM;
if (flags & MAP_FIXED) { if (flags & MAP_FIXED) {
/* Even MAP_FIXED mappings must reside within TASK_SIZE. */ /* Even MAP_FIXED mappings must reside within TASK_SIZE */
if (TASK_SIZE - len < addr) if (TASK_SIZE - len < addr)
return -EINVAL; return -EINVAL;
...@@ -48,34 +93,130 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, ...@@ -48,34 +93,130 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
do_color_align = 0; do_color_align = 0;
if (filp || (flags & MAP_SHARED)) if (filp || (flags & MAP_SHARED))
do_color_align = 1; do_color_align = 1;
/* requesting a specific address */
if (addr) { if (addr) {
if (do_color_align) if (do_color_align)
addr = COLOUR_ALIGN(addr, pgoff); addr = COLOUR_ALIGN(addr, pgoff);
else else
addr = PAGE_ALIGN(addr); addr = PAGE_ALIGN(addr);
vmm = find_vma(current->mm, addr);
vma = find_vma(mm, addr);
if (TASK_SIZE - len >= addr && if (TASK_SIZE - len >= addr &&
(!vmm || addr + len <= vmm->vm_start)) (!vma || addr + len <= vma->vm_start))
return addr; return addr;
} }
addr = current->mm->mmap_base;
if (do_color_align)
addr = COLOUR_ALIGN(addr, pgoff);
else
addr = PAGE_ALIGN(addr);
for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { if (dir == UP) {
/* At this point: (!vmm || addr < vmm->vm_end). */ addr = mm->mmap_base;
if (TASK_SIZE - len < addr) if (do_color_align)
return -ENOMEM; addr = COLOUR_ALIGN(addr, pgoff);
if (!vmm || addr + len <= vmm->vm_start) else
return addr; addr = PAGE_ALIGN(addr);
addr = vmm->vm_end;
for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
/* At this point: (!vma || addr < vma->vm_end). */
if (TASK_SIZE - len < addr)
return -ENOMEM;
if (!vma || addr + len <= vma->vm_start)
return addr;
addr = vma->vm_end;
if (do_color_align)
addr = COLOUR_ALIGN(addr, pgoff);
}
} else {
/* check if free_area_cache is useful for us */
if (len <= mm->cached_hole_size) {
mm->cached_hole_size = 0;
mm->free_area_cache = mm->mmap_base;
}
/* either no address requested or can't fit in requested address hole */
addr = mm->free_area_cache;
if (do_color_align) {
unsigned long base =
COLOUR_ALIGN_DOWN(addr - len, pgoff);
addr = base + len;
}
/* make sure it can fit in the remaining address space */
if (likely(addr > len)) {
vma = find_vma(mm, addr - len);
if (!vma || addr <= vma->vm_start) {
/* remember the address as a hint for next time */
return mm->free_area_cache = addr-len;
}
}
if (unlikely(mm->mmap_base < len))
goto bottomup;
addr = mm->mmap_base-len;
if (do_color_align) if (do_color_align)
addr = COLOUR_ALIGN(addr, pgoff); addr = COLOUR_ALIGN_DOWN(addr, pgoff);
do {
/*
* Lookup failure means no vma is above this address,
* else if new region fits below vma->vm_start,
* return with success:
*/
vma = find_vma(mm, addr);
if (likely(!vma || addr+len <= vma->vm_start)) {
/* remember the address as a hint for next time */
return mm->free_area_cache = addr;
}
/* remember the largest hole we saw so far */
if (addr + mm->cached_hole_size < vma->vm_start)
mm->cached_hole_size = vma->vm_start - addr;
/* try just below the current vma->vm_start */
addr = vma->vm_start-len;
if (do_color_align)
addr = COLOUR_ALIGN_DOWN(addr, pgoff);
} while (likely(len < vma->vm_start));
bottomup:
/*
* A failed mmap() very likely causes application failure,
* so fall back to the bottom-up function here. This scenario
* can happen with large stack limits and large mmap()
* allocations.
*/
mm->cached_hole_size = ~0UL;
mm->free_area_cache = TASK_UNMAPPED_BASE;
addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
/*
* Restore the topdown base:
*/
mm->free_area_cache = mm->mmap_base;
mm->cached_hole_size = ~0UL;
return addr;
} }
} }
unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr0,
unsigned long len, unsigned long pgoff, unsigned long flags)
{
return arch_get_unmapped_area_foo(filp,
addr0, len, pgoff, flags, UP);
}
/*
* There is no need to export this but sched.h declares the function as
* extern so making it static here results in an error.
*/
unsigned long arch_get_unmapped_area_topdown(struct file *filp,
unsigned long addr0, unsigned long len, unsigned long pgoff,
unsigned long flags)
{
return arch_get_unmapped_area_foo(filp,
addr0, len, pgoff, flags, DOWN);
}
void arch_pick_mmap_layout(struct mm_struct *mm) void arch_pick_mmap_layout(struct mm_struct *mm)
{ {
unsigned long random_factor = 0UL; unsigned long random_factor = 0UL;
...@@ -89,9 +230,15 @@ void arch_pick_mmap_layout(struct mm_struct *mm) ...@@ -89,9 +230,15 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
random_factor &= 0xffffffful; random_factor &= 0xffffffful;
} }
mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; if (mmap_is_legacy()) {
mm->get_unmapped_area = arch_get_unmapped_area; mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
mm->unmap_area = arch_unmap_area; mm->get_unmapped_area = arch_get_unmapped_area;
mm->unmap_area = arch_unmap_area;
} else {
mm->mmap_base = mmap_base(random_factor);
mm->get_unmapped_area = arch_get_unmapped_area_topdown;
mm->unmap_area = arch_unmap_area_topdown;
}
} }
static inline unsigned long brk_rnd(void) static inline unsigned long brk_rnd(void)
......
...@@ -52,7 +52,7 @@ void __init pagetable_init(void) ...@@ -52,7 +52,7 @@ void __init pagetable_init(void)
* Fixed mappings: * Fixed mappings:
*/ */
vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
fixrange_init(vaddr, 0, pgd_base); fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
/* /*
......
...@@ -76,5 +76,5 @@ void __init pagetable_init(void) ...@@ -76,5 +76,5 @@ void __init pagetable_init(void)
* Fixed mappings: * Fixed mappings:
*/ */
vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
fixrange_init(vaddr, 0, pgd_base); fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
} }
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/smp-ops.h>
#include <asm/traps.h> #include <asm/traps.h>
#include <asm/gcmpregs.h> #include <asm/gcmpregs.h>
...@@ -358,15 +359,14 @@ void __init prom_init(void) ...@@ -358,15 +359,14 @@ void __init prom_init(void)
#ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef CONFIG_SERIAL_8250_CONSOLE
console_config(); console_config();
#endif #endif
#ifdef CONFIG_MIPS_CMP
/* Early detection of CMP support */ /* Early detection of CMP support */
if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ)) if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ))
register_smp_ops(&cmp_smp_ops); if (!register_cmp_smp_ops())
else return;
#endif
#ifdef CONFIG_MIPS_MT_SMP if (!register_vsmp_smp_ops())
register_smp_ops(&vsmp_smp_ops); return;
#endif
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
register_smp_ops(&msmtc_smp_ops); register_smp_ops(&msmtc_smp_ops);
#endif #endif
......
...@@ -152,7 +152,7 @@ int plat_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity, ...@@ -152,7 +152,7 @@ int plat_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity,
* runtime code can anyway deal with the null set * runtime code can anyway deal with the null set
*/ */
printk(KERN_WARNING printk(KERN_WARNING
"IRQ affinity leaves no legal CPU for IRQ %d\n", irq); "IRQ affinity leaves no legal CPU for IRQ %d\n", d->irq);
/* Do any generic SMTC IRQ affinity setup */ /* Do any generic SMTC IRQ affinity setup */
smtc_set_irq_affinity(d->irq, tmask); smtc_set_irq_affinity(d->irq, tmask);
......
#
# NETLOGIC includes
#
cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/mach-netlogic
cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/netlogic
#
# NETLOGIC XLR/XLS SoC, Simulator and boards
#
core-$(CONFIG_NLM_XLR) += arch/mips/netlogic/xlr/
load-$(CONFIG_NLM_XLR_BOARD) += 0xffffffff84000000
...@@ -209,7 +209,7 @@ void __init init_xlr_irqs(void) ...@@ -209,7 +209,7 @@ void __init init_xlr_irqs(void)
irq_set_chip_and_handler(i, &xlr_pic, handle_level_irq); irq_set_chip_and_handler(i, &xlr_pic, handle_level_irq);
else else
irq_set_chip_and_handler(i, &nlm_cpu_intr, irq_set_chip_and_handler(i, &nlm_cpu_intr,
handle_level_irq); handle_percpu_irq);
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
irq_set_chip_and_handler(IRQ_IPI_SMP_FUNCTION, &nlm_cpu_intr, irq_set_chip_and_handler(IRQ_IPI_SMP_FUNCTION, &nlm_cpu_intr,
......
...@@ -87,17 +87,7 @@ void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc) ...@@ -87,17 +87,7 @@ void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc)
/* IRQ_IPI_SMP_RESCHEDULE handler */ /* IRQ_IPI_SMP_RESCHEDULE handler */
void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc) void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc)
{ {
set_need_resched(); scheduler_ipi();
}
void nlm_common_ipi_handler(int irq, struct pt_regs *regs)
{
if (irq == IRQ_IPI_SMP_FUNCTION) {
smp_call_function_interrupt();
} else {
/* Announce that we are for reschduling */
set_need_resched();
}
} }
/* /*
...@@ -122,6 +112,7 @@ void nlm_smp_finish(void) ...@@ -122,6 +112,7 @@ void nlm_smp_finish(void)
#ifdef notyet #ifdef notyet
nlm_common_msgring_cpu_init(); nlm_common_msgring_cpu_init();
#endif #endif
local_irq_enable();
} }
void nlm_cpus_done(void) void nlm_cpus_done(void)
......
...@@ -140,6 +140,4 @@ void __init plat_mem_setup(void) ...@@ -140,6 +140,4 @@ void __init plat_mem_setup(void)
PNX8XXX_UART_LCR_8BIT; PNX8XXX_UART_LCR_8BIT;
ip3106_baud(UART_BASE, pnx8550_console_port) = 5; ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
} }
return;
} }
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/lasat/lasat.h> #include <asm/lasat/lasat.h>
#include <asm/gt64120.h>
#include <asm/nile4.h> #include <asm/nile4.h>
#define PCI_ACCESS_READ 0 #define PCI_ACCESS_READ 0
......
...@@ -228,13 +228,11 @@ void __init prom_init(void) ...@@ -228,13 +228,11 @@ void __init prom_init(void)
*/ */
msp_serial_setup(); msp_serial_setup();
#ifdef CONFIG_MIPS_MT_SMP if (register_vsmp_smp_ops()) {
register_smp_ops(&vsmp_smp_ops);
#endif
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
register_smp_ops(&msp_smtc_smp_ops); register_smp_ops(&msp_smtc_smp_ops);
#endif #endif
}
#ifdef CONFIG_PMCTWILED #ifdef CONFIG_PMCTWILED
/* /*
......
...@@ -139,6 +139,4 @@ void __init plat_mem_setup(void) ...@@ -139,6 +139,4 @@ void __init plat_mem_setup(void)
PNX8XXX_UART_LCR_8BIT; PNX8XXX_UART_LCR_8BIT;
ip3106_baud(UART_BASE, pnx8550_console_port) = 5; ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
} }
return;
} }
...@@ -251,28 +251,22 @@ static struct platform_device *rb532_devs[] = { ...@@ -251,28 +251,22 @@ static struct platform_device *rb532_devs[] = {
static void __init parse_mac_addr(char *macstr) static void __init parse_mac_addr(char *macstr)
{ {
int i, j; int i, h, l;
unsigned char result, value;
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
result = 0;
if (i != 5 && *(macstr + 2) != ':') if (i != 5 && *(macstr + 2) != ':')
return; return;
for (j = 0; j < 2; j++) { h = hex_to_bin(*macstr++);
if (isxdigit(*macstr) if (h == -1)
&& (value = return;
isdigit(*macstr) ? *macstr -
'0' : toupper(*macstr) - 'A' + 10) < 16) { l = hex_to_bin(*macstr++);
result = result * 16 + value; if (l == -1)
macstr++; return;
} else
return;
}
macstr++; macstr++;
korina_dev0_data.mac[i] = result; korina_dev0_data.mac[i] = (h << 4) + l;
} }
} }
......
...@@ -123,6 +123,13 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask, ...@@ -123,6 +123,13 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
} }
#endif #endif
static void disable_sb1250_irq(struct irq_data *d)
{
unsigned int irq = d->irq;
sb1250_mask_irq(sb1250_irq_owner[irq], irq);
}
static void enable_sb1250_irq(struct irq_data *d) static void enable_sb1250_irq(struct irq_data *d)
{ {
unsigned int irq = d->irq; unsigned int irq = d->irq;
...@@ -180,6 +187,7 @@ static struct irq_chip sb1250_irq_type = { ...@@ -180,6 +187,7 @@ static struct irq_chip sb1250_irq_type = {
.name = "SB1250-IMR", .name = "SB1250-IMR",
.irq_mask_ack = ack_sb1250_irq, .irq_mask_ack = ack_sb1250_irq,
.irq_unmask = enable_sb1250_irq, .irq_unmask = enable_sb1250_irq,
.irq_mask = disable_sb1250_irq,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.irq_set_affinity = sb1250_set_affinity .irq_set_affinity = sb1250_set_affinity
#endif #endif
......
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