Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173394
b: refs/heads/master
c: d26cddb
h: refs/heads/master
v: v3
  • Loading branch information
Matt Fleming committed Oct 11, 2009
1 parent 03bfa5c commit aa547e0
Show file tree
Hide file tree
Showing 24 changed files with 319 additions and 395 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: 8ec006c58775869175edee3d23f4525b6df2935a
refs/heads/master: d26cddbbd23b81eac4fcf340b633e97b40b8d3a1
2 changes: 1 addition & 1 deletion trunk/arch/sh/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void decompress_kernel(void)
#ifdef CONFIG_SUPERH64
output_addr = (CONFIG_MEMORY_START + 0x2000);
#else
output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
output_addr = PHYSADDR((unsigned long)&_text+PAGE_SIZE);
#ifdef CONFIG_29BIT
output_addr |= P2SEG;
#endif
Expand Down
9 changes: 3 additions & 6 deletions trunk/arch/sh/include/asm/addrspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
/* Returns the privileged segment base of a given address */
#define PXSEG(a) (((unsigned long)(a)) & 0xe0000000)

/* Returns the physical address of a PnSEG (n=1,2) address */
#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)

#if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED)
/*
* Map an address to a certain privileged segment
Expand Down Expand Up @@ -57,11 +60,5 @@
#define P3_ADDR_MAX P4SEG
#endif

#ifndef __ASSEMBLY__
#ifdef CONFIG_PMB
extern int __in_29bit_mode(void);
#endif /* CONFIG_PMB */
#endif /* __ASSEMBLY__ */

#endif /* __KERNEL__ */
#endif /* __ASM_SH_ADDRSPACE_H */
16 changes: 0 additions & 16 deletions trunk/arch/sh/include/asm/dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ struct dwarf_cie {

unsigned long flags;
#define DWARF_CIE_Z_AUGMENTATION (1 << 0)

/*
* 'mod' will be non-NULL if this CIE came from a module's
* .eh_frame section.
*/
struct module *mod;
};

/**
Expand All @@ -261,12 +255,6 @@ struct dwarf_fde {
unsigned char *instructions;
unsigned char *end;
struct list_head link;

/*
* 'mod' will be non-NULL if this FDE came from a module's
* .eh_frame section.
*/
struct module *mod;
};

/**
Expand Down Expand Up @@ -376,10 +364,6 @@ static inline unsigned int DW_CFA_operand(unsigned long insn)

extern struct dwarf_frame *dwarf_unwind_stack(unsigned long,
struct dwarf_frame *);
extern void dwarf_free_frame(struct dwarf_frame *);
extern int dwarf_parse_section(char *, char *, struct module *);
extern void dwarf_module_unload(struct module *);

#endif /* !__ASSEMBLY__ */

#define CFI_STARTPROC .cfi_startproc
Expand Down
47 changes: 47 additions & 0 deletions trunk/arch/sh/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,53 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
return addr;
}


#ifdef CONFIG_DWARF_UNWINDER
#include <asm/dwarf.h>

#define HAVE_ARCH_CALLER_ADDR

static inline unsigned long dwarf_return_address(int depth)
{
struct dwarf_frame *frame;
unsigned long ra;
int i;

for (i = 0, frame = NULL, ra = 0; i <= depth; i++) {
struct dwarf_frame *tmp;

tmp = dwarf_unwind_stack(ra, frame);

if (frame)
dwarf_free_frame(frame);

frame = tmp;

if (!frame || !frame->return_addr)
break;

ra = frame->return_addr;
}

/* Failed to unwind the stack to the specified depth. */
WARN_ON(i != depth + 1);

if (frame)
dwarf_free_frame(frame);

return ra;
}

#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
#define CALLER_ADDR1 dwarf_return_address(1)
#define CALLER_ADDR2 dwarf_return_address(2)
#define CALLER_ADDR3 dwarf_return_address(3)
#define CALLER_ADDR4 dwarf_return_address(4)
#define CALLER_ADDR5 dwarf_return_address(5)
#define CALLER_ADDR6 dwarf_return_address(6)

#endif /* CONFIG_DWARF_UNWINDER */

#endif /* __ASSEMBLY__ */
#endif /* CONFIG_FUNCTION_TRACER */

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void __iounmap(void __iomem *addr);
static inline void __iomem *
__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
{
#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB)
#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED)
unsigned long last_addr = offset + size - 1;
#endif
void __iomem *ret;
Expand All @@ -255,7 +255,7 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
if (ret)
return ret;

#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB)
#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED)
/*
* For P1 and P2 space this is trivial, as everything is already
* mapped. Uncached access for P1 addresses are done through P2.
Expand Down
13 changes: 8 additions & 5 deletions trunk/arch/sh/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
#define PMB_PASCR 0xff000070
#define PMB_IRMCR 0xff000078

#define PASCR_SE 0x80000000

#define PMB_ADDR 0xf6100000
#define PMB_DATA 0xf7100000
#define PMB_ENTRY_MAX 16
#define PMB_E_MASK 0x0000000f
#define PMB_E_SHIFT 8

#define PMB_PFN_MASK 0xff000000

#define PMB_SZ_16M 0x00000000
#define PMB_SZ_64M 0x00000010
#define PMB_SZ_128M 0x00000080
Expand Down Expand Up @@ -66,10 +62,17 @@ struct pmb_entry {
};

/* arch/sh/mm/pmb.c */
int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
unsigned long flags, int *entry);
int set_pmb_entry(struct pmb_entry *pmbe);
void clear_pmb_entry(struct pmb_entry *pmbe);
struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
unsigned long flags);
void pmb_free(struct pmb_entry *pmbe);
long pmb_remap(unsigned long virt, unsigned long phys,
unsigned long size, unsigned long flags);
void pmb_unmap(unsigned long addr);
int pmb_init(void);
#endif /* __ASSEMBLY__ */

#endif /* __MMU_H */

26 changes: 4 additions & 22 deletions trunk/arch/sh/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,13 @@ static inline unsigned long long neff_sign_extend(unsigned long val)
#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
#define FIRST_USER_ADDRESS 0

#define PHYS_ADDR_MASK29 0x1fffffff
#define PHYS_ADDR_MASK32 0xffffffff

#ifdef CONFIG_PMB
static inline unsigned long phys_addr_mask(void)
{
/* Is the MMU in 29bit mode? */
if (__in_29bit_mode())
return PHYS_ADDR_MASK29;

return PHYS_ADDR_MASK32;
}
#elif defined(CONFIG_32BIT)
static inline unsigned long phys_addr_mask(void)
{
return PHYS_ADDR_MASK32;
}
#ifdef CONFIG_32BIT
#define PHYS_ADDR_MASK 0xffffffff
#else
static inline unsigned long phys_addr_mask(void)
{
return PHYS_ADDR_MASK29;
}
#define PHYS_ADDR_MASK 0x1fffffff
#endif

#define PTE_PHYS_MASK (phys_addr_mask() & PAGE_MASK)
#define PTE_PHYS_MASK (PHYS_ADDR_MASK & PAGE_MASK)
#define PTE_FLAGS_MASK (~(PTE_PHYS_MASK) << PAGE_SHIFT)

#ifdef CONFIG_SUPERH32
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/include/asm/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static inline unsigned long copy_ptea_attributes(unsigned long x)
#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)
#endif

#define _PAGE_FLAGS_HARDWARE_MASK (phys_addr_mask() & ~(_PAGE_CLEAR_FLAGS))
#define _PAGE_FLAGS_HARDWARE_MASK (PHYS_ADDR_MASK & ~(_PAGE_CLEAR_FLAGS))

/* Hardware flags, page size encoding */
#if !defined(CONFIG_MMU)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/include/asm/scatterlist.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __ASM_SH_SCATTERLIST_H
#define __ASM_SH_SCATTERLIST_H

#define ISA_DMA_THRESHOLD phys_addr_mask()
#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK

#include <asm-generic/scatterlist.h>

Expand Down
28 changes: 10 additions & 18 deletions trunk/arch/sh/kernel/cpu/sh4a/setup-shx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,7 @@ enum {
UNUSED = 0,

/* interrupt sources */
IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
IRL_HHLL, IRL_HHLH, IRL_HHHL,
IRQ0, IRQ1, IRQ2, IRQ3,
IRL, IRQ0, IRQ1, IRQ2, IRQ3,
HUDII,
TMU0, TMU1, TMU2, TMU3, TMU4, TMU5,
PCII0, PCII1, PCII2, PCII3, PCII4,
Expand All @@ -295,7 +291,7 @@ enum {
INTICI4, INTICI5, INTICI6, INTICI7,

/* interrupt groups */
IRL, PCII56789, SCIF0, SCIF1, SCIF2, SCIF3,
PCII56789, SCIF0, SCIF1, SCIF2, SCIF3,
DMAC0, DMAC1,
};

Expand Down Expand Up @@ -348,10 +344,6 @@ static struct intc_vect vectors[] __initdata = {
};

static struct intc_group groups[] __initdata = {
INTC_GROUP(IRL, IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
IRL_HHLL, IRL_HHLH, IRL_HHHL),
INTC_GROUP(PCII56789, PCII5, PCII6, PCII7, PCII8, PCII9),
INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
Expand Down Expand Up @@ -427,14 +419,14 @@ static DECLARE_INTC_DESC(intc_desc_irq, "shx3-irq", vectors_irq, groups,

/* External interrupt pins in IRL mode */
static struct intc_vect vectors_irl[] __initdata = {
INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220),
INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260),
INTC_VECT(IRL_LHLL, 0x280), INTC_VECT(IRL_LHLH, 0x2a0),
INTC_VECT(IRL_LHHL, 0x2c0), INTC_VECT(IRL_LHHH, 0x2e0),
INTC_VECT(IRL_HLLL, 0x300), INTC_VECT(IRL_HLLH, 0x320),
INTC_VECT(IRL_HLHL, 0x340), INTC_VECT(IRL_HLHH, 0x360),
INTC_VECT(IRL_HHLL, 0x380), INTC_VECT(IRL_HHLH, 0x3a0),
INTC_VECT(IRL_HHHL, 0x3c0),
INTC_VECT(IRL, 0x200), INTC_VECT(IRL, 0x220),
INTC_VECT(IRL, 0x240), INTC_VECT(IRL, 0x260),
INTC_VECT(IRL, 0x280), INTC_VECT(IRL, 0x2a0),
INTC_VECT(IRL, 0x2c0), INTC_VECT(IRL, 0x2e0),
INTC_VECT(IRL, 0x300), INTC_VECT(IRL, 0x320),
INTC_VECT(IRL, 0x340), INTC_VECT(IRL, 0x360),
INTC_VECT(IRL, 0x380), INTC_VECT(IRL, 0x3a0),
INTC_VECT(IRL, 0x3c0),
};

static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups,
Expand Down
Loading

0 comments on commit aa547e0

Please sign in to comment.