aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-05 11:59:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-05 11:59:22 -0400
commitbbc4fd12a635492ad9d12bb418124fa2d5f0d734 (patch)
treefe245d350db180d499a9e9d6dc84bbb308f33dc2 /arch/microblaze/include/asm
parent673b864fd76a29031aa0b4b08fc80886d527b3b7 (diff)
parent2d5973cb5ac5d04662f86e19a06a4c52fa4c4ae3 (diff)
Merge branch 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze
* 'for-linus' of git://git.monstr.eu/linux-2.6-microblaze: (49 commits) microblaze: Add KGDB support microblaze: Support brki rX, 0x18 for user application debugging microblaze: Remove nop after MSRCLR/SET, MTS, MFS instructions microblaze: Simplify syscall rutine microblaze: Move PT_MODE saving to delay slot microblaze: Fix _interrupt function microblaze: Fix _user_exception function microblaze: Put together addik instructions microblaze: Use delay slot in syscall macros microblaze: Save kernel mode in delay slot microblaze: Do not mix register saving and mode setting microblaze: Move SAVE_STATE upward microblaze: entry.S: Macro optimization microblaze: Optimize hw exception rutine microblaze: Implement clear_ums macro and fix SAVE_STATE macro microblaze: Remove additional setup for kernel_mode microblaze: Optimize SAVE_STATE macro microblaze: Remove additional loading microblaze: Completely remove working with R11 register microblaze: Do not setup BIP in _debug_exception ...
Diffstat (limited to 'arch/microblaze/include/asm')
-rw-r--r--arch/microblaze/include/asm/cacheflush.h18
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h6
-rw-r--r--arch/microblaze/include/asm/elf.h2
-rw-r--r--arch/microblaze/include/asm/exceptions.h21
-rw-r--r--arch/microblaze/include/asm/kgdb.h28
-rw-r--r--arch/microblaze/include/asm/page.h12
-rw-r--r--arch/microblaze/include/asm/pvr.h2
-rw-r--r--arch/microblaze/include/asm/setup.h2
-rw-r--r--arch/microblaze/include/asm/system.h1
-rw-r--r--arch/microblaze/include/asm/uaccess.h4
-rw-r--r--arch/microblaze/include/asm/unwind.h29
11 files changed, 89 insertions, 36 deletions
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
index a6edd356cd08..7ebd955460d9 100644
--- a/arch/microblaze/include/asm/cacheflush.h
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -17,6 +17,7 @@
17 17
18/* Somebody depends on this; sigh... */ 18/* Somebody depends on this; sigh... */
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/io.h>
20 21
21/* Look at Documentation/cachetlb.txt */ 22/* Look at Documentation/cachetlb.txt */
22 23
@@ -60,7 +61,6 @@ void microblaze_cache_init(void);
60#define invalidate_icache() mbc->iin(); 61#define invalidate_icache() mbc->iin();
61#define invalidate_icache_range(start, end) mbc->iinr(start, end); 62#define invalidate_icache_range(start, end) mbc->iinr(start, end);
62 63
63
64#define flush_icache_user_range(vma, pg, adr, len) flush_icache(); 64#define flush_icache_user_range(vma, pg, adr, len) flush_icache();
65#define flush_icache_page(vma, pg) do { } while (0) 65#define flush_icache_page(vma, pg) do { } while (0)
66 66
@@ -72,9 +72,15 @@ void microblaze_cache_init(void);
72#define flush_dcache() mbc->dfl(); 72#define flush_dcache() mbc->dfl();
73#define flush_dcache_range(start, end) mbc->dflr(start, end); 73#define flush_dcache_range(start, end) mbc->dflr(start, end);
74 74
75#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 75#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
76/* D-cache aliasing problem can't happen - cache is between MMU and ram */ 76/* MS: We have to implement it because of rootfs-jffs2 issue on WB */
77#define flush_dcache_page(page) do { } while (0) 77#define flush_dcache_page(page) \
78do { \
79 unsigned long addr = (unsigned long) page_address(page); /* virtual */ \
80 addr = (u32)virt_to_phys((void *)addr); \
81 flush_dcache_range((unsigned) (addr), (unsigned) (addr) + PAGE_SIZE); \
82} while (0);
83
78#define flush_dcache_mmap_lock(mapping) do { } while (0) 84#define flush_dcache_mmap_lock(mapping) do { } while (0)
79#define flush_dcache_mmap_unlock(mapping) do { } while (0) 85#define flush_dcache_mmap_unlock(mapping) do { } while (0)
80 86
@@ -97,8 +103,10 @@ void microblaze_cache_init(void);
97 103
98#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 104#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
99do { \ 105do { \
106 u32 addr = virt_to_phys(dst); \
107 invalidate_icache_range((unsigned) (addr), (unsigned) (addr) + (len));\
100 memcpy((dst), (src), (len)); \ 108 memcpy((dst), (src), (len)); \
101 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ 109 flush_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\
102} while (0) 110} while (0)
103 111
104#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 112#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 18b3731c8509..507389580709 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -79,12 +79,6 @@ static inline int dma_supported(struct device *dev, u64 mask)
79 return ops->dma_supported(dev, mask); 79 return ops->dma_supported(dev, mask);
80} 80}
81 81
82#ifdef CONFIG_PCI
83/* We have our own implementation of pci_set_dma_mask() */
84#define HAVE_ARCH_PCI_SET_DMA_MASK
85
86#endif
87
88static inline int dma_set_mask(struct device *dev, u64 dma_mask) 82static inline int dma_set_mask(struct device *dev, u64 dma_mask)
89{ 83{
90 struct dma_map_ops *ops = get_dma_ops(dev); 84 struct dma_map_ops *ops = get_dma_ops(dev);
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
index 7d4acf2b278e..732caf1be741 100644
--- a/arch/microblaze/include/asm/elf.h
+++ b/arch/microblaze/include/asm/elf.h
@@ -77,7 +77,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
77#define ELF_DATA ELFDATA2MSB 77#define ELF_DATA ELFDATA2MSB
78#endif 78#endif
79 79
80#define ELF_EXEC_PAGESIZE 4096 80#define ELF_EXEC_PAGESIZE PAGE_SIZE
81 81
82 82
83#define ELF_CORE_COPY_REGS(_dest, _regs) \ 83#define ELF_CORE_COPY_REGS(_dest, _regs) \
diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h
index 4c7b5d037c88..6479097b802b 100644
--- a/arch/microblaze/include/asm/exceptions.h
+++ b/arch/microblaze/include/asm/exceptions.h
@@ -14,6 +14,11 @@
14#define _ASM_MICROBLAZE_EXCEPTIONS_H 14#define _ASM_MICROBLAZE_EXCEPTIONS_H
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17
18#ifndef CONFIG_MMU
19#define EX_HANDLER_STACK_SIZ (4*19)
20#endif
21
17#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
18 23
19/* Macros to enable and disable HW exceptions in the MSR */ 24/* Macros to enable and disable HW exceptions in the MSR */
@@ -64,22 +69,6 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
64void die(const char *str, struct pt_regs *fp, long err); 69void die(const char *str, struct pt_regs *fp, long err);
65void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); 70void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr);
66 71
67#if defined(CONFIG_KGDB)
68void (*debugger)(struct pt_regs *regs);
69int (*debugger_bpt)(struct pt_regs *regs);
70int (*debugger_sstep)(struct pt_regs *regs);
71int (*debugger_iabr_match)(struct pt_regs *regs);
72int (*debugger_dabr_match)(struct pt_regs *regs);
73void (*debugger_fault_handler)(struct pt_regs *regs);
74#else
75#define debugger(regs) do { } while (0)
76#define debugger_bpt(regs) 0
77#define debugger_sstep(regs) 0
78#define debugger_iabr_match(regs) 0
79#define debugger_dabr_match(regs) 0
80#define debugger_fault_handler ((void (*)(struct pt_regs *))0)
81#endif
82
83#endif /*__ASSEMBLY__ */ 72#endif /*__ASSEMBLY__ */
84#endif /* __KERNEL__ */ 73#endif /* __KERNEL__ */
85#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */ 74#endif /* _ASM_MICROBLAZE_EXCEPTIONS_H */
diff --git a/arch/microblaze/include/asm/kgdb.h b/arch/microblaze/include/asm/kgdb.h
new file mode 100644
index 000000000000..78b17d40b235
--- /dev/null
+++ b/arch/microblaze/include/asm/kgdb.h
@@ -0,0 +1,28 @@
1#ifdef __KERNEL__
2#ifndef __MICROBLAZE_KGDB_H__
3#define __MICROBLAZE_KGDB_H__
4
5#ifndef __ASSEMBLY__
6
7#define CACHE_FLUSH_IS_SAFE 1
8#define BUFMAX 2048
9
10/*
11 * 32 32-bit general purpose registers (r0-r31)
12 * 6 32-bit special registers (pc, msr, ear, esr, fsr, btr)
13 * 12 32-bit PVR
14 * 7 32-bit MMU Regs (redr, rpid, rzpr, rtlbx, rtlbsx, rtlblo, rtlbhi)
15 * ------
16 * 57 registers
17 */
18#define NUMREGBYTES (57 * 4)
19
20#define BREAK_INSTR_SIZE 4
21static inline void arch_kgdb_breakpoint(void)
22{
23 __asm__ __volatile__("brki r16, 0x18;");
24}
25
26#endif /* __ASSEMBLY__ */
27#endif /* __MICROBLAZE_KGDB_H__ */
28#endif /* __KERNEL__ */
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 464ff32bee3d..c12c6dfafd9f 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -23,8 +23,16 @@
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25/* PAGE_SHIFT determines the page size */ 25/* PAGE_SHIFT determines the page size */
26#define PAGE_SHIFT (12) 26#if defined(CONFIG_MICROBLAZE_32K_PAGES)
27#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) 27#define PAGE_SHIFT 15
28#elif defined(CONFIG_MICROBLAZE_16K_PAGES)
29#define PAGE_SHIFT 14
30#elif defined(CONFIG_MICROBLAZE_8K_PAGES)
31#define PAGE_SHIFT 13
32#else
33#define PAGE_SHIFT 12
34#endif
35#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
28#define PAGE_MASK (~(PAGE_SIZE-1)) 36#define PAGE_MASK (~(PAGE_SIZE-1))
29 37
30#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR)) 38#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR))
diff --git a/arch/microblaze/include/asm/pvr.h b/arch/microblaze/include/asm/pvr.h
index e38abc7714b6..9578666e98ba 100644
--- a/arch/microblaze/include/asm/pvr.h
+++ b/arch/microblaze/include/asm/pvr.h
@@ -16,7 +16,7 @@
16#define PVR_MSR_BIT 0x400 16#define PVR_MSR_BIT 0x400
17 17
18struct pvr_s { 18struct pvr_s {
19 unsigned pvr[16]; 19 unsigned pvr[12];
20}; 20};
21 21
22/* The following taken from Xilinx's standalone BSP pvr.h */ 22/* The following taken from Xilinx's standalone BSP pvr.h */
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 7f31394985e0..782b5c89248e 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -28,8 +28,6 @@ void disable_early_printk(void);
28void heartbeat(void); 28void heartbeat(void);
29void setup_heartbeat(void); 29void setup_heartbeat(void);
30 30
31unsigned long long sched_clock(void);
32
33# ifdef CONFIG_MMU 31# ifdef CONFIG_MMU
34extern void mmu_reset(void); 32extern void mmu_reset(void);
35extern void early_console_reg_tlb_alloc(unsigned int addr); 33extern void early_console_reg_tlb_alloc(unsigned int addr);
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index 81e1f7d5b4cb..e6a2284571dc 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -45,7 +45,6 @@ extern struct task_struct *_switch_to(struct thread_info *prev,
45#define smp_rmb() rmb() 45#define smp_rmb() rmb()
46#define smp_wmb() wmb() 46#define smp_wmb() wmb()
47 47
48void show_trace(struct task_struct *task, unsigned long *stack);
49void __bad_xchg(volatile void *ptr, int size); 48void __bad_xchg(volatile void *ptr, int size);
50 49
51static inline unsigned long __xchg(unsigned long x, volatile void *ptr, 50static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 26460d15b338..d840f4a2d3c9 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -359,7 +359,7 @@ extern long __user_bad(void);
359 __copy_tofrom_user((__force void __user *)(to), \ 359 __copy_tofrom_user((__force void __user *)(to), \
360 (void __user *)(from), (n)) 360 (void __user *)(from), (n))
361#define __copy_from_user_inatomic(to, from, n) \ 361#define __copy_from_user_inatomic(to, from, n) \
362 copy_from_user((to), (from), (n)) 362 __copy_from_user((to), (from), (n))
363 363
364static inline long copy_from_user(void *to, 364static inline long copy_from_user(void *to,
365 const void __user *from, unsigned long n) 365 const void __user *from, unsigned long n)
@@ -373,7 +373,7 @@ static inline long copy_from_user(void *to,
373#define __copy_to_user(to, from, n) \ 373#define __copy_to_user(to, from, n) \
374 __copy_tofrom_user((void __user *)(to), \ 374 __copy_tofrom_user((void __user *)(to), \
375 (__force const void __user *)(from), (n)) 375 (__force const void __user *)(from), (n))
376#define __copy_to_user_inatomic(to, from, n) copy_to_user((to), (from), (n)) 376#define __copy_to_user_inatomic(to, from, n) __copy_to_user((to), (from), (n))
377 377
378static inline long copy_to_user(void __user *to, 378static inline long copy_to_user(void __user *to,
379 const void *from, unsigned long n) 379 const void *from, unsigned long n)
diff --git a/arch/microblaze/include/asm/unwind.h b/arch/microblaze/include/asm/unwind.h
new file mode 100644
index 000000000000..d248b7de4b13
--- /dev/null
+++ b/arch/microblaze/include/asm/unwind.h
@@ -0,0 +1,29 @@
1/*
2 * Backtrace support for Microblaze
3 *
4 * Copyright (C) 2010 Digital Design Corporation
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __MICROBLAZE_UNWIND_H
12#define __MICROBLAZE_UNWIND_H
13
14struct stack_trace;
15
16struct trap_handler_info {
17 unsigned long start_addr;
18 unsigned long end_addr;
19 const char *trap_name;
20};
21extern struct trap_handler_info microblaze_trap_handlers;
22
23extern const char _hw_exception_handler;
24extern const char ex_handler_unhandled;
25
26void microblaze_unwind(struct task_struct *task, struct stack_trace *trace);
27
28#endif /* __MICROBLAZE_UNWIND_H */
29