diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 12:01:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 12:01:44 -0400 |
commit | a6b49cb210f878709bdc0bddc16a853f18790d02 (patch) | |
tree | 6147078ef0ce584cb6a8dae7468f060ef5838d12 /arch/microblaze/include | |
parent | 2c9871de0ae89a0e2c365ea6e277135fe031d8b4 (diff) | |
parent | bfc8125858d777bd5bdba03a091c07cc2e0e17c0 (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: (24 commits)
microblaze: Disable heartbeat/enable emaclite in defconfigs
microblaze: Support simpleImage.dts make target
microblaze: Fix _start symbol to physical address
microblaze: Use LOAD_OFFSET macro to get correct LMA for all sections
microblaze: Create the LOAD_OFFSET macro used to compute VMA vs LMA offsets
microblaze: Copy ppc asm-compat.h for clean handling of constants in asm and C
microblaze: Actually show KiB rather than pages in "Freeing initrd memory:"
microblaze: Support ptrace syscall tracing.
microblaze: Updated CPU version and FPGA family codes in PVR
microblaze: Generate correct signal and siginfo for integer div-by-zero
microblaze: Don't be noisy when userspace causes hardware exceptions
microblaze: Remove ipc.h file which points to non-existing asm-generic file
microblaze: Clear sticky FSR register after generating exception signals
microblaze: Ensure CPU usermode is set on new userspace processes
microblaze: Use correct kbuild variable KBUILD_CFLAGS
microblaze: Save and restore msr in hw exception
microblaze: Add architectural support for USB EHCI host controllers
microblaze: Implement include/asm/syscall.h.
microblaze: Improve checking mechanism for MSR instruction
microblaze: Add checking mechanism for MSR instruction
...
Diffstat (limited to 'arch/microblaze/include')
-rw-r--r-- | arch/microblaze/include/asm/asm-compat.h | 17 | ||||
-rw-r--r-- | arch/microblaze/include/asm/io.h | 3 | ||||
-rw-r--r-- | arch/microblaze/include/asm/ipc.h | 1 | ||||
-rw-r--r-- | arch/microblaze/include/asm/page.h | 3 | ||||
-rw-r--r-- | arch/microblaze/include/asm/setup.h | 2 | ||||
-rw-r--r-- | arch/microblaze/include/asm/syscall.h | 99 |
6 files changed, 123 insertions, 2 deletions
diff --git a/arch/microblaze/include/asm/asm-compat.h b/arch/microblaze/include/asm/asm-compat.h new file mode 100644 index 000000000000..e7bc9dc11b57 --- /dev/null +++ b/arch/microblaze/include/asm/asm-compat.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _ASM_MICROBLAZE_ASM_COMPAT_H | ||
2 | #define _ASM_MICROBLAZE_ASM_COMPAT_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
6 | #ifdef __ASSEMBLY__ | ||
7 | # define stringify_in_c(...) __VA_ARGS__ | ||
8 | # define ASM_CONST(x) x | ||
9 | #else | ||
10 | /* This version of stringify will deal with commas... */ | ||
11 | # define __stringify_in_c(...) #__VA_ARGS__ | ||
12 | # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " " | ||
13 | # define __ASM_CONST(x) x##UL | ||
14 | # define ASM_CONST(x) __ASM_CONST(x) | ||
15 | #endif | ||
16 | |||
17 | #endif /* _ASM_MICROBLAZE_ASM_COMPAT_H */ | ||
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 7c3ec13b44d8..fc9997b73c09 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h | |||
@@ -210,6 +210,9 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size, | |||
210 | #define in_be32(a) __raw_readl((const void __iomem __force *)(a)) | 210 | #define in_be32(a) __raw_readl((const void __iomem __force *)(a)) |
211 | #define in_be16(a) __raw_readw(a) | 211 | #define in_be16(a) __raw_readw(a) |
212 | 212 | ||
213 | #define writel_be(v, a) out_be32((__force unsigned *)a, v) | ||
214 | #define readl_be(a) in_be32((__force unsigned *)a) | ||
215 | |||
213 | /* | 216 | /* |
214 | * Little endian | 217 | * Little endian |
215 | */ | 218 | */ |
diff --git a/arch/microblaze/include/asm/ipc.h b/arch/microblaze/include/asm/ipc.h deleted file mode 100644 index a46e3d9c2a3f..000000000000 --- a/arch/microblaze/include/asm/ipc.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ipc.h> | ||
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h index 72aceae88680..880c988c2237 100644 --- a/arch/microblaze/include/asm/page.h +++ b/arch/microblaze/include/asm/page.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/pfn.h> | 18 | #include <linux/pfn.h> |
19 | #include <asm/setup.h> | 19 | #include <asm/setup.h> |
20 | #include <asm/asm-compat.h> | ||
20 | #include <linux/const.h> | 21 | #include <linux/const.h> |
21 | 22 | ||
22 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
@@ -26,6 +27,8 @@ | |||
26 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) | 27 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) |
27 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 28 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
28 | 29 | ||
30 | #define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR)) | ||
31 | |||
29 | #ifndef __ASSEMBLY__ | 32 | #ifndef __ASSEMBLY__ |
30 | 33 | ||
31 | #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) | 34 | #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) |
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index 27f8dafd8c34..ed67c9ed15b8 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h | |||
@@ -38,7 +38,7 @@ extern void early_console_reg_tlb_alloc(unsigned int addr); | |||
38 | void time_init(void); | 38 | void time_init(void); |
39 | void init_IRQ(void); | 39 | void init_IRQ(void); |
40 | void machine_early_init(const char *cmdline, unsigned int ram, | 40 | void machine_early_init(const char *cmdline, unsigned int ram, |
41 | unsigned int fdt); | 41 | unsigned int fdt, unsigned int msr); |
42 | 42 | ||
43 | void machine_restart(char *cmd); | 43 | void machine_restart(char *cmd); |
44 | void machine_shutdown(void); | 44 | void machine_shutdown(void); |
diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h new file mode 100644 index 000000000000..048dfcd8d89d --- /dev/null +++ b/arch/microblaze/include/asm/syscall.h | |||
@@ -0,0 +1,99 @@ | |||
1 | #ifndef __ASM_MICROBLAZE_SYSCALL_H | ||
2 | #define __ASM_MICROBLAZE_SYSCALL_H | ||
3 | |||
4 | #include <linux/kernel.h> | ||
5 | #include <linux/sched.h> | ||
6 | #include <asm/ptrace.h> | ||
7 | |||
8 | /* The system call number is given by the user in R12 */ | ||
9 | static inline long syscall_get_nr(struct task_struct *task, | ||
10 | struct pt_regs *regs) | ||
11 | { | ||
12 | return regs->r12; | ||
13 | } | ||
14 | |||
15 | static inline void syscall_rollback(struct task_struct *task, | ||
16 | struct pt_regs *regs) | ||
17 | { | ||
18 | /* TODO. */ | ||
19 | } | ||
20 | |||
21 | static inline long syscall_get_error(struct task_struct *task, | ||
22 | struct pt_regs *regs) | ||
23 | { | ||
24 | return IS_ERR_VALUE(regs->r3) ? regs->r3 : 0; | ||
25 | } | ||
26 | |||
27 | static inline long syscall_get_return_value(struct task_struct *task, | ||
28 | struct pt_regs *regs) | ||
29 | { | ||
30 | return regs->r3; | ||
31 | } | ||
32 | |||
33 | static inline void syscall_set_return_value(struct task_struct *task, | ||
34 | struct pt_regs *regs, | ||
35 | int error, long val) | ||
36 | { | ||
37 | if (error) | ||
38 | regs->r3 = -error; | ||
39 | else | ||
40 | regs->r3 = val; | ||
41 | } | ||
42 | |||
43 | static inline microblaze_reg_t microblaze_get_syscall_arg(struct pt_regs *regs, | ||
44 | unsigned int n) | ||
45 | { | ||
46 | switch (n) { | ||
47 | case 5: return regs->r10; | ||
48 | case 4: return regs->r9; | ||
49 | case 3: return regs->r8; | ||
50 | case 2: return regs->r7; | ||
51 | case 1: return regs->r6; | ||
52 | case 0: return regs->r5; | ||
53 | default: | ||
54 | BUG(); | ||
55 | } | ||
56 | return ~0; | ||
57 | } | ||
58 | |||
59 | static inline void microblaze_set_syscall_arg(struct pt_regs *regs, | ||
60 | unsigned int n, | ||
61 | unsigned long val) | ||
62 | { | ||
63 | switch (n) { | ||
64 | case 5: | ||
65 | regs->r10 = val; | ||
66 | case 4: | ||
67 | regs->r9 = val; | ||
68 | case 3: | ||
69 | regs->r8 = val; | ||
70 | case 2: | ||
71 | regs->r7 = val; | ||
72 | case 1: | ||
73 | regs->r6 = val; | ||
74 | case 0: | ||
75 | regs->r5 = val; | ||
76 | default: | ||
77 | BUG(); | ||
78 | } | ||
79 | } | ||
80 | |||
81 | static inline void syscall_get_arguments(struct task_struct *task, | ||
82 | struct pt_regs *regs, | ||
83 | unsigned int i, unsigned int n, | ||
84 | unsigned long *args) | ||
85 | { | ||
86 | while (n--) | ||
87 | *args++ = microblaze_get_syscall_arg(regs, i++); | ||
88 | } | ||
89 | |||
90 | static inline void syscall_set_arguments(struct task_struct *task, | ||
91 | struct pt_regs *regs, | ||
92 | unsigned int i, unsigned int n, | ||
93 | const unsigned long *args) | ||
94 | { | ||
95 | while (n--) | ||
96 | microblaze_set_syscall_arg(regs, i++, *args++); | ||
97 | } | ||
98 | |||
99 | #endif /* __ASM_MICROBLAZE_SYSCALL_H */ | ||