Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305243
b: refs/heads/master
c: bcb86e0
h: refs/heads/master
i:
  305241: 326997d
  305239: ed06794
v: v3
  • Loading branch information
Paul Mundt committed May 10, 2012
1 parent d5ea897 commit baf9540
Show file tree
Hide file tree
Showing 52 changed files with 4,512 additions and 492 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef0fa5331a73e479a30f73e00937afb5109566d7
refs/heads/master: bcb86e0adb6397013616567249d2d82f94b27891
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6549,7 +6549,7 @@ M: Paul Mundt <lethal@linux-sh.org>
L: linux-sh@vger.kernel.org
W: http://www.linux-sh.org
Q: http://patchwork.kernel.org/project/linux-sh/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git sh-latest
T: git git://github.com/pmundt/linux-sh.git sh-latest
S: Supported
F: Documentation/sh/
F: arch/sh/
Expand Down
27 changes: 26 additions & 1 deletion trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,16 @@ config CPU_SUBTYPE_SH7724
help
Select SH7724 if you have an SH-MobileR2R CPU.

config CPU_SUBTYPE_SH7734
bool "Support SH7734 processor"
select CPU_SH4A
select CPU_SHX2
select ARCH_WANT_OPTIONAL_GPIOLIB
select USB_ARCH_HAS_OHCI
select USB_ARCH_HAS_EHCI
help
Select SH7734 if you have a SH4A SH7734 CPU.

config CPU_SUBTYPE_SH7757
bool "Support SH7757 processor"
select CPU_SH4A
Expand Down Expand Up @@ -599,7 +609,8 @@ config SH_CLK_CPG_LEGACY
depends on SH_CLK_CPG
def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
!CPU_SHX3 && !CPU_SUBTYPE_SH7757 && \
!CPU_SUBTYPE_SH7264 && !CPU_SUBTYPE_SH7269
!CPU_SUBTYPE_SH7734 && !CPU_SUBTYPE_SH7264 && \
!CPU_SUBTYPE_SH7269

source "kernel/time/Kconfig"

Expand Down Expand Up @@ -700,6 +711,20 @@ config SECCOMP

If unsure, say N.

config CC_STACKPROTECTOR
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
depends on SUPERH32 && EXPERIMENTAL
help
This option turns on the -fstack-protector GCC feature. This
feature puts, at the beginning of functions, a canary value on
the stack just before the return address, and validates
the value just before actually returning. Stack based buffer
overflows (that need to overwrite this return address) now also
overwrite the canary, which gets detected and the attack is then
neutralized via a kernel panic.

This feature requires gcc version 4.2 or above.

config SMP
bool "Symmetric multi-processing support"
depends on SYS_SUPPORTS_SMP
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ ifeq ($(CONFIG_DWARF_UNWINDER),y)
KBUILD_CFLAGS += -fasynchronous-unwind-tables
endif

ifeq ($(CONFIG_CC_STACKPROTECTOR),y)
KBUILD_CFLAGS += -fstack-protector
endif

libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ config SH_APSH4AD0A
help
Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.

endmenu

source "arch/sh/boards/mach-r2d/Kconfig"
source "arch/sh/boards/mach-highlander/Kconfig"
source "arch/sh/boards/mach-sdk7780/Kconfig"
Expand All @@ -360,3 +358,5 @@ config SH_MAGIC_PANEL_R2_VERSION
endmenu

endif

endmenu
5 changes: 5 additions & 0 deletions trunk/arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,13 @@ __BUILD_IOPORT_STRING(w, u16)
__BUILD_IOPORT_STRING(l, u32)
__BUILD_IOPORT_STRING(q, u64)

#else /* !CONFIG_HAS_IOPORT */

#include <asm/io_noioport.h>

#endif


#define IO_SPACE_LIMIT 0xffffffff

/* synco on SH-4A, otherwise a nop */
Expand Down
41 changes: 41 additions & 0 deletions trunk/arch/sh/include/asm/io_noioport.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef __ASM_SH_IO_NOIOPORT_H
#define __ASM_SH_IO_NOIOPORT_H

static inline u8 inb(unsigned long addr)
{
BUG();
return -1;
}

static inline u16 inw(unsigned long addr)
{
BUG();
return -1;
}

static inline u32 inl(unsigned long addr)
{
BUG();
return -1;
}

#define outb(x, y) BUG()
#define outw(x, y) BUG()
#define outl(x, y) BUG()

#define inb_p(addr) inb(addr)
#define inw_p(addr) inw(addr)
#define inl_p(addr) inl(addr)
#define outb_p(x, addr) outb((x), (addr))
#define outw_p(x, addr) outw((x), (addr))
#define outl_p(x, addr) outl((x), (addr))

#define insb(a, b, c) BUG()
#define insw(a, b, c) BUG()
#define insl(a, b, c) BUG()

#define outsb(a, b, c) BUG()
#define outsw(a, b, c) BUG()
#define outsl(a, b, c) BUG()

#endif /* __ASM_SH_IO_NOIOPORT_H */
30 changes: 14 additions & 16 deletions trunk/arch/sh/include/asm/kgdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,34 @@
#include <asm/cacheflush.h>
#include <asm/ptrace.h>

/* Same as pt_regs but has vbr in place of syscall_nr */
struct kgdb_regs {
unsigned long regs[16];
unsigned long pc;
unsigned long pr;
unsigned long sr;
unsigned long gbr;
unsigned long mach;
unsigned long macl;
unsigned long vbr;
};

enum regnames {
GDB_R0, GDB_R1, GDB_R2, GDB_R3, GDB_R4, GDB_R5, GDB_R6, GDB_R7,
GDB_R8, GDB_R9, GDB_R10, GDB_R11, GDB_R12, GDB_R13, GDB_R14, GDB_R15,

GDB_PC, GDB_PR, GDB_SR, GDB_GBR, GDB_MACH, GDB_MACL, GDB_VBR,
};

#define NUMREGBYTES ((GDB_VBR + 1) * 4)
#define _GP_REGS 16
#define _EXTRA_REGS 7
#define GDB_SIZEOF_REG sizeof(u32)

#define DBG_MAX_REG_NUM (_GP_REGS + _EXTRA_REGS)
#define NUMREGBYTES (DBG_MAX_REG_NUM * sizeof(GDB_SIZEOF_REG))

static inline void arch_kgdb_breakpoint(void)
{
__asm__ __volatile__ ("trapa #0x3c\n");
}

#define BUFMAX 2048

#define CACHE_FLUSH_IS_SAFE 1
#define BREAK_INSTR_SIZE 2
#define BUFMAX 2048

#ifdef CONFIG_SMP
# define CACHE_FLUSH_IS_SAFE 0
#else
# define CACHE_FLUSH_IS_SAFE 1
#endif

#define GDB_ADJUSTS_BREAK_OFFSET

#endif /* __ASM_SH_KGDB_H */
2 changes: 1 addition & 1 deletion trunk/arch/sh/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum cpu_type {

/* SH-4A types */
CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SHX3,
CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SH7734, CPU_SHX3,

/* SH4AL-DSP types */
CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sh/include/asm/processor_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ struct thread_struct {
NULL for a kernel thread. */
struct pt_regs *uregs;

unsigned long trap_no, error_code;
unsigned long address;
/* Hardware debugging registers may come here */

Expand All @@ -138,8 +137,6 @@ struct thread_struct {
.pc = 0, \
.kregs = &fake_swapper_regs, \
.uregs = NULL, \
.trap_no = 0, \
.error_code = 0, \
.address = 0, \
.flags = 0, \
}
Expand Down
27 changes: 27 additions & 0 deletions trunk/arch/sh/include/asm/stackprotector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef __ASM_SH_STACKPROTECTOR_H
#define __ASM_SH_STACKPROTECTOR_H

#include <linux/random.h>
#include <linux/version.h>

extern unsigned long __stack_chk_guard;

/*
* Initialize the stackprotector canary value.
*
* NOTE: this must only be called from functions that never return,
* and it must always be inlined.
*/
static __always_inline void boot_init_stack_canary(void)
{
unsigned long canary;

/* Try to get a semi random initial value. */
get_random_bytes(&canary, sizeof(canary));
canary ^= LINUX_VERSION_CODE;

current->stack_canary = canary;
__stack_chk_guard = current->stack_canary;
}

#endif /* __ASM_SH_STACKPROTECTOR_H */
5 changes: 5 additions & 0 deletions trunk/arch/sh/include/cpu-sh4/cpu/freq.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
#define MSTPCR1 0xa4150034
#define MSTPCR2 0xa4150038

#elif defined(CONFIG_CPU_SUBTYPE_SH7734)
#define FRQCR0 0xffc80000
#define FRQCR2 0xffc80008
#define FRQMR1 0xffc80014
#define FRQMR2 0xffc80018
#elif defined(CONFIG_CPU_SUBTYPE_SH7785)
#define FRQCR0 0xffc80000
#define FRQCR1 0xffc80004
Expand Down
Loading

0 comments on commit baf9540

Please sign in to comment.