From f2ec24fd42d52a52829070b5e31d9a17d145df30 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 10:36:54 +0200 Subject: microblaze: Remove unneded per cpu SYSCALL_SAVE variable Signed-off-by: Michal Simek --- arch/microblaze/include/asm/entry.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h index 7f57e42ee46..1019d88b812 100644 --- a/arch/microblaze/include/asm/entry.h +++ b/arch/microblaze/include/asm/entry.h @@ -29,7 +29,6 @@ DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */ DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ -DECLARE_PER_CPU(unsigned int, SYSCALL_SAVE); /* Saved syscall number */ # endif /* __ASSEMBLY__ */ #endif /* _ASM_MICROBLAZE_ENTRY_H */ -- cgit v1.2.3 From 51eb6dc9ca40d086c102bb868ba7f29f33a30f6f Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 10:41:45 +0200 Subject: microblaze: Remove while(1) loop from show_regs function I removed it because of show_regs can't break die function. If process/kernel failed, die (do_exit) function resolve it. Signed-off-by: Michal Simek --- arch/microblaze/kernel/process.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 436f26ccbfa..bdc8b2c6c57 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c @@ -37,8 +37,6 @@ void show_regs(struct pt_regs *regs) regs->r29, regs->r30, regs->r31, regs->pc); printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n", regs->msr, regs->ear, regs->esr, regs->fsr); - while (1) - ; } void (*pm_idle)(void); -- cgit v1.2.3 From ceb8944b3a3dd3ec4094a476a44802cc32c4fc02 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 10:46:37 +0200 Subject: microblaze: Remove uncache shadow condition Uncached shadow feature is not supported in current kernel code that's why I removed it. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/cache.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/cache.h b/arch/microblaze/include/asm/cache.h index c4c64b43c07..c209c47509d 100644 --- a/arch/microblaze/include/asm/cache.h +++ b/arch/microblaze/include/asm/cache.h @@ -37,9 +37,4 @@ void _invalidate_dcache(unsigned int addr); #define __disable_dcache() _disable_dcache() #define __invalidate_dcache(addr) _invalidate_dcache(addr) -/* FIXME - I don't think this is right */ -#ifdef CONFIG_XILINX_UNCACHED_SHADOW -#define UNCACHED_SHADOW_MASK (CONFIG_XILINX_ERAM_SIZE) -#endif - #endif /* _ASM_MICROBLAZE_CACHE_H */ -- cgit v1.2.3 From ac3efab50621bd6d01e5b40f3134dc7824788390 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 10:58:47 +0200 Subject: microblaze: Rename kernel_mode to pt_mode in pt_regs Signed-off-by: Michal Simek --- arch/microblaze/include/asm/processor.h | 2 +- arch/microblaze/include/asm/ptrace.h | 4 ++-- arch/microblaze/kernel/asm-offsets.c | 2 +- arch/microblaze/kernel/process.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index d8e15434ba2..4bed76d0a6c 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -62,7 +62,7 @@ static inline void start_thread(struct pt_regs *regs, { regs->pc = pc; regs->r1 = usp; - regs->kernel_mode = 0; + regs->pt_mode = 0; } /* Free all resources held by a thread. */ diff --git a/arch/microblaze/include/asm/ptrace.h b/arch/microblaze/include/asm/ptrace.h index f1f03486428..55015bce5e4 100644 --- a/arch/microblaze/include/asm/ptrace.h +++ b/arch/microblaze/include/asm/ptrace.h @@ -52,10 +52,10 @@ struct pt_regs { microblaze_reg_t ear; microblaze_reg_t esr; microblaze_reg_t fsr; - int kernel_mode; + int pt_mode; }; -#define kernel_mode(regs) ((regs)->kernel_mode) +#define kernel_mode(regs) ((regs)->pt_mode) #define user_mode(regs) (!kernel_mode(regs)) #define instruction_pointer(regs) ((regs)->pc) diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c index 38e1a2e8ad0..aabd9e9423a 100644 --- a/arch/microblaze/kernel/asm-offsets.c +++ b/arch/microblaze/kernel/asm-offsets.c @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) DEFINE(PT_R29, offsetof(struct pt_regs, r29)); DEFINE(PT_R30, offsetof(struct pt_regs, r30)); DEFINE(PT_R31, offsetof(struct pt_regs, r31)); - DEFINE(PT_MODE, offsetof(struct pt_regs, kernel_mode)); + DEFINE(PT_MODE, offsetof(struct pt_regs, pt_mode)); BLANK(); /* Magic offsets for PTRACE PEEK/POKE etc */ diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index bdc8b2c6c57..40cc1480810 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c @@ -18,7 +18,7 @@ void show_regs(struct pt_regs *regs) { - printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->kernel_mode); + printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->pt_mode); printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n", regs->r1, regs->r2, regs->r3, regs->r4); printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n", @@ -169,7 +169,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) regs.r6 = (unsigned long)arg; local_save_flags(regs.msr); regs.pc = (unsigned long)kernel_thread_helper; - regs.kernel_mode = 1; + regs.pt_mode = 1; ret = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); -- cgit v1.2.3 From 2eba318e0db1114726e69660d6b9e1bd59b10ba1 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:05:26 +0200 Subject: microblaze: Move task_pt_regs up This change is important for easier merge with Microblaze MMU code. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/processor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 4bed76d0a6c..cea42a36d16 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -26,6 +26,9 @@ extern const struct seq_operations cpuinfo_op; # endif /* __ASSEMBLY__ */ +#define task_pt_regs(tsk) \ + (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) + /* * User space process size: memory size * @@ -84,9 +87,6 @@ extern unsigned long get_wchan(struct task_struct *p); */ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -# define task_pt_regs(tsk) \ - (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) - # define KSTK_EIP(tsk) (0) # define KSTK_ESP(tsk) (0) -- cgit v1.2.3 From bf7e9da4e70a9d4bf9dc5829ff854398e0e4b7f7 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:10:07 +0200 Subject: microblaze: Remove sparse error in traps.c CHECK arch/microblaze/kernel/traps.c arch/microblaze/kernel/traps.c:37:47: warning: Using plain integer as NULL pointer CC arch/microblaze/kernel/traps.o Signed-off-by: Michal Simek --- arch/microblaze/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/traps.c b/arch/microblaze/kernel/traps.c index fbdc533c61e..293ef486013 100644 --- a/arch/microblaze/kernel/traps.c +++ b/arch/microblaze/kernel/traps.c @@ -34,7 +34,7 @@ static int kstack_depth_to_print = 24; static int __init kstack_setup(char *s) { - kstack_depth_to_print = strict_strtoul(s, 0, 0); + kstack_depth_to_print = strict_strtoul(s, 0, NULL); return 1; } -- cgit v1.2.3 From ce0b755f7dda4f1c06b89f7e903667f538dadd3c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:11:22 +0200 Subject: microblaze: Add missing declaration for die and _exception func This change remove sparse errors. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/exceptions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch') diff --git a/arch/microblaze/include/asm/exceptions.h b/arch/microblaze/include/asm/exceptions.h index 4cdd2159f47..24ca540e77c 100644 --- a/arch/microblaze/include/asm/exceptions.h +++ b/arch/microblaze/include/asm/exceptions.h @@ -61,6 +61,9 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, int fsr, int addr); +void die(const char *str, struct pt_regs *fp, long err); +void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr); + #if defined(CONFIG_XMON) extern void xmon(struct pt_regs *regs); extern int xmon_bpt(struct pt_regs *regs); -- cgit v1.2.3 From df4f3eb7c318e34899e9499bc5c9295690f7a106 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:29:13 +0200 Subject: microblaze: Add missing preadv and pwritev syscalls Signed-off-by: Michal Simek --- arch/microblaze/include/asm/unistd.h | 4 +++- arch/microblaze/kernel/syscall_table.S | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index d9d3903fde3..b5e2f5fa5c5 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h @@ -378,8 +378,10 @@ #define __NR_sendmsg 360 /* new */ #define __NR_recvmsg 361 /* new */ #define __NR_accept04 362 /* new */ +#define __NR_preadv 363 /* new */ +#define __NR_pwritev 364 /* new */ -#define __NR_syscalls 363 +#define __NR_syscalls 365 #ifdef __KERNEL__ #ifndef __ASSEMBLY__ diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index 529b0dbf4fe..3bb42ec924c 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S @@ -363,3 +363,5 @@ ENTRY(sys_call_table) .long sys_sendmsg /* 360 */ .long sys_recvmsg .long sys_ni_syscall + .long sys_ni_syscall + .long sys_ni_syscall -- cgit v1.2.3 From e1c4bd0897b6d03eff4b32197d6ab017f83fc836 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:30:16 +0200 Subject: microblaze: Move start_thread to process.c This change is due to upcomming MMU merge Signed-off-by: Michal Simek --- arch/microblaze/include/asm/processor.h | 13 +++---------- arch/microblaze/kernel/process.c | 9 +++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index cea42a36d16..89aa3956929 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -29,6 +29,9 @@ extern const struct seq_operations cpuinfo_op; #define task_pt_regs(tsk) \ (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) +/* Do necessary setup to start up a newly executed thread. */ +void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp); + /* * User space process size: memory size * @@ -58,16 +61,6 @@ struct task_struct; struct thread_struct { }; # define INIT_THREAD { } -/* Do necessary setup to start up a newly executed thread. */ -static inline void start_thread(struct pt_regs *regs, - unsigned long pc, - unsigned long usp) -{ - regs->pc = pc; - regs->r1 = usp; - regs->pt_mode = 0; -} - /* Free all resources held by a thread. */ static inline void release_thread(struct task_struct *dead_task) { diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index 40cc1480810..dd15de9cde3 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c @@ -182,3 +182,12 @@ unsigned long get_wchan(struct task_struct *p) /* TBD (used by procfs) */ return 0; } + +/* Set up a thread for executing a new program */ +void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp) +{ + set_fs(USER_DS); + regs->pc = pc; + regs->r1 = usp; + regs->pt_mode = 0; +} -- cgit v1.2.3 From 6714fcc34e1bcf247fe542ebdea36b699ff8e2b8 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 16 Apr 2009 11:32:21 +0200 Subject: microblaze: Remove redundant variable Signed-off-by: Michal Simek --- arch/microblaze/kernel/process.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index dd15de9cde3..07d4fa339ed 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c @@ -161,7 +161,6 @@ static void kernel_thread_helper(int (*fn)(void *), void *arg) int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { struct pt_regs regs; - int ret; memset(®s, 0, sizeof(regs)); /* store them in non-volatile registers */ @@ -171,10 +170,8 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) regs.pc = (unsigned long)kernel_thread_helper; regs.pt_mode = 1; - ret = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, + return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); - - return ret; } unsigned long get_wchan(struct task_struct *p) -- cgit v1.2.3 From 04e3a553e0cbed369e5649c472ac317b6c45215d Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 20 Apr 2009 09:56:24 +0200 Subject: microblaze: Correspond CONFIG...PCMP in Makefile/Kconfig Makefile contained different cpu config flag than is in Kconfig.auto in platform folder Signed-off-by: Michal Simek --- arch/microblaze/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 0dcbb983297..ee302f9f588 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -26,7 +26,7 @@ ifeq (,$(findstring spartan2,$(CONFIG_XILINX_MICROBLAZE0_FAMILY))) endif CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift -CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP) += -mxl-pattern-compare +CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) -- cgit v1.2.3 From 6e60c14810d8da792e418fdcb2110b4185d1b9a2 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Thu, 16 Apr 2009 22:49:17 +0200 Subject: microblaze: iowrite upon timeout retries reaches -1, so the iowrite occurrs upon timeout. Acked-by: John Williams Signed-off-by: Roel Kluin Signed-off-by: Michal Simek --- arch/microblaze/kernel/early_printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c index 62cc78993f4..4b0f0fdb9ca 100644 --- a/arch/microblaze/kernel/early_printk.c +++ b/arch/microblaze/kernel/early_printk.c @@ -36,7 +36,7 @@ static void early_printk_putc(char c) unsigned retries = 10000; /* read status bit - 0x8 offset */ - while (retries-- && (in_be32(base_addr + 8) & (1 << 3))) + while (--retries && (in_be32(base_addr + 8) & (1 << 3))) ; /* Only attempt the iowrite if we didn't timeout */ -- cgit v1.2.3 From 79533fd4cb7c261694d3b7d5bdde78836bc35b49 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Apr 2009 14:04:39 +0200 Subject: microblaze: Fix USR1/2 pvr printing message Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/mb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c index 3b6212bdc8d..4dcfccdbc36 100644 --- a/arch/microblaze/kernel/cpu/mb.c +++ b/arch/microblaze/kernel/cpu/mb.c @@ -115,8 +115,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) cpuinfo.hw_debug ? "yes" : "no"); count += seq_printf(m, - "PVR-USR1:\t%x\n" - "PVR-USR2:\t%x\n", + "PVR-USR1:\t%02x\n" + "PVR-USR2:\t%08x\n", cpuinfo.pvr_user1, cpuinfo.pvr_user2); -- cgit v1.2.3 From fbeda67782689bf80109512b16ac47264a282d01 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Apr 2009 14:06:08 +0200 Subject: microblaze: Do not use PVR configuration for broken MB version Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c | 9 +++++++-- arch/microblaze/kernel/cpu/cpuinfo.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c index cf7424a6bb8..153f57c57b6 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c +++ b/arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c @@ -30,6 +30,13 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) int temp; /* for saving temp value */ get_pvr(&pvr); + CI(ver_code, VERSION); + if (!ci->ver_code) { + printk(KERN_ERR "ERROR: MB has broken PVR regs " + "-> use DTS setting\n"); + return; + } + temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |\ PVR_USE_PCMP_INSTR(pvr) | PVR_USE_DIV(pvr); if (ci->use_instr != temp) @@ -60,8 +67,6 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) CI(mmu, USE_MMU); - CI(ver_code, VERSION); - CI(use_icache, USE_ICACHE); CI(icache_tagbits, ICACHE_ADDR_TAG_BITS); CI(icache_write, ICACHE_ALLOW_WR); diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c index 4a740dfcf6d..a10bea119b9 100644 --- a/arch/microblaze/kernel/cpu/cpuinfo.c +++ b/arch/microblaze/kernel/cpu/cpuinfo.c @@ -71,7 +71,7 @@ void __init setup_cpuinfo(void) __func__); set_cpuinfo_static(&cpuinfo, cpu); break; -/* FIXME I found weird behavior with MB 7.00.a/b +/* FIXME I found weird behavior with MB 7.00.a/b 7.10.a * please do not use FULL PVR with MMU */ case 1: printk(KERN_INFO "%s: Using full CPU PVR support\n", -- cgit v1.2.3 From 6dfb79aa114ac69032f3931235ffc90799e9630b Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Apr 2009 14:07:00 +0200 Subject: microblaze: Do not check use_dcache It is not necessary to check cpuinfo.use_dcache because this checking is done in function which call that functions Signed-off-by: Michal Simek --- arch/microblaze/kernel/cpu/cache.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/cpu/cache.c b/arch/microblaze/kernel/cpu/cache.c index be9fecca4f9..af866a45012 100644 --- a/arch/microblaze/kernel/cpu/cache.c +++ b/arch/microblaze/kernel/cpu/cache.c @@ -100,7 +100,6 @@ void _enable_dcache(void) void _disable_dcache(void) { - if (cpuinfo.use_dcache) { #if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR __asm__ __volatile__ (" \ msrclr r0, %0; \ @@ -119,12 +118,10 @@ void _disable_dcache(void) : "i" (MSR_DCE) \ : "memory", "r12"); #endif - } } void _invalidate_dcache(unsigned int addr) { - if (cpuinfo.use_dcache) __asm__ __volatile__ (" \ wdc %0, r0" \ : \ -- cgit v1.2.3 From 2921e2bd679949a7892d308b414e6a3b3c705260 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Apr 2009 14:08:47 +0200 Subject: microblaze: Add STATE_SAVE_ARG_SPACE for noMMU kernel too For noMMU kernel this change nothing bring but this change helps with MMU synchronization. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/entry.h | 3 +++ arch/microblaze/include/asm/processor.h | 2 ++ arch/microblaze/kernel/signal.c | 14 ++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/include/asm/entry.h b/arch/microblaze/include/asm/entry.h index 1019d88b812..e4c3aef884d 100644 --- a/arch/microblaze/include/asm/entry.h +++ b/arch/microblaze/include/asm/entry.h @@ -31,4 +31,7 @@ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ # endif /* __ASSEMBLY__ */ +/* noMMU hasn't any space for args */ +# define STATE_SAVE_ARG_SPACE (0) + #endif /* _ASM_MICROBLAZE_ENTRY_H */ diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 89aa3956929..9329029d261 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h @@ -15,6 +15,8 @@ #include #include #include +#include +#include # ifndef __ASSEMBLY__ /* from kernel/cpu/mb.c */ diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 3889cf45fa7..40d36931e36 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c @@ -178,7 +178,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *rval_p) asmlinkage int sys_sigreturn(struct pt_regs *regs) { - struct sigframe *frame = (struct sigframe *)regs->r1; + struct sigframe *frame = + (struct sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE); + sigset_t set; int rval; @@ -209,7 +211,9 @@ badframe: asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) { - struct rt_sigframe *frame = (struct rt_sigframe *)regs->r1; + struct rt_sigframe *frame = + (struct rt_sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE); + sigset_t set; stack_t st; int rval; @@ -336,7 +340,8 @@ static void setup_frame(int sig, struct k_sigaction *ka, goto give_sigsegv; /* Set up registers for signal handler */ - regs->r1 = (unsigned long) frame; + regs->r1 = (unsigned long) frame - STATE_SAVE_ARG_SPACE; + /* Signal handler args: */ regs->r5 = signal; /* Arg 0: signum */ regs->r6 = (unsigned long) &frame->sc; /* arg 1: sigcontext */ @@ -414,7 +419,8 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, goto give_sigsegv; /* Set up registers for signal handler */ - regs->r1 = (unsigned long) frame; + regs->r1 = (unsigned long) frame - STATE_SAVE_ARG_SPACE; + /* Signal handler args: */ regs->r5 = signal; /* arg 0: signum */ regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */ -- cgit v1.2.3 From 993ce24078eac1442078741cd204584b63de0881 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Apr 2009 14:12:18 +0200 Subject: microblaze: Use CFLAGS_KERNEL instead of CFLAGS Signed-off-by: Michal Simek --- arch/microblaze/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index ee302f9f588..aaadfa701da 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -32,15 +32,13 @@ CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) # The various CONFIG_XILINX cpu features options are integers 0/1/2... # rather than bools y/n -CFLAGS += $(CPUFLAGS-1) -CFLAGS += $(CPUFLAGS-2) # r31 holds current when in kernel mode -CFLAGS += -ffixed-r31 +CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) LDFLAGS_BLOB := --format binary --oformat elf32-microblaze -LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) +LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name) head-y := arch/microblaze/kernel/head.o libs-y += arch/microblaze/lib/ $(LIBGCC) -- cgit v1.2.3 From f57f2fe2a39338c47b67fbd564a9d3b7587bcbee Mon Sep 17 00:00:00 2001 From: Coly Li Date: Thu, 23 Apr 2009 03:05:31 +0800 Subject: microblaze: add parameter to microblaze_read() This patch modifies parameter of microblaze_read() from 'void' to 'struct clocksource *cs', which fixes compile warning for incompatible parameter type. Signed-off-by: Coly Li Cc: Michal Simek Cc: Ingo Molnar Signed-off-by: Michal Simek --- arch/microblaze/kernel/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index 05a497eefd7..bdfa2f9f0c8 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -176,7 +176,7 @@ static __init void microblaze_clockevent_init(void) clockevents_register_device(&clockevent_microblaze_timer); } -static cycle_t microblaze_read(void) +static cycle_t microblaze_read(struct clocksource *cs) { /* reading actual value of timer 1 */ return (cycle_t) (in_be32(TIMER_BASE + TCR1)); -- cgit v1.2.3