Skip to content

Commit

Permalink
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Browse files Browse the repository at this point in the history
* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: Fix ftrace
  microblaze: Wire up new syscalls
  microblaze: Fix level/edge irq sensibility
  • Loading branch information
torvalds committed Apr 5, 2011
2 parents 6ad8523 + 9e1491d commit bdfd6b7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
6 changes: 5 additions & 1 deletion arch/microblaze/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,12 @@
#define __NR_fanotify_init 368
#define __NR_fanotify_mark 369
#define __NR_prlimit64 370
#define __NR_name_to_handle_at 371
#define __NR_open_by_handle_at 372
#define __NR_clock_adjtime 373
#define __NR_syncfs 374

#define __NR_syscalls 371
#define __NR_syscalls 375

#ifdef __KERNEL__
#ifndef __ASSEMBLY__
Expand Down
1 change: 1 addition & 0 deletions arch/microblaze/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CFLAGS_REMOVE_early_printk.o = -pg
CFLAGS_REMOVE_selfmod.o = -pg
CFLAGS_REMOVE_heartbeat.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_process.o = -pg
endif

extra-y := head.o vmlinux.lds
Expand Down
10 changes: 6 additions & 4 deletions arch/microblaze/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
: "r" (parent), "r" (return_hooker)
);

flush_dcache_range((u32)parent, (u32)parent + 4);
flush_icache_range((u32)parent, (u32)parent + 4);

if (unlikely(faulted)) {
ftrace_graph_stop();
WARN_ON(1);
Expand Down Expand Up @@ -95,6 +98,9 @@ static int ftrace_modify_code(unsigned long addr, unsigned int value)
if (unlikely(faulted))
return -EFAULT;

flush_dcache_range(addr, addr + 4);
flush_icache_range(addr, addr + 4);

return 0;
}

Expand Down Expand Up @@ -195,8 +201,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
ret += ftrace_modify_code((unsigned long)&ftrace_caller,
MICROBLAZE_NOP);

/* All changes are done - lets do caches consistent */
flush_icache();
return ret;
}

Expand All @@ -210,7 +214,6 @@ int ftrace_enable_ftrace_graph_caller(void)

old_jump = *(unsigned int *)ip; /* save jump over instruction */
ret = ftrace_modify_code(ip, MICROBLAZE_NOP);
flush_icache();

pr_debug("%s: Replace instruction: 0x%x\n", __func__, old_jump);
return ret;
Expand All @@ -222,7 +225,6 @@ int ftrace_disable_ftrace_graph_caller(void)
unsigned long ip = (unsigned long)(&ftrace_call_graph);

ret = ftrace_modify_code(ip, old_jump);
flush_icache();

pr_debug("%s\n", __func__);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions arch/microblaze/kernel/intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ void __init init_IRQ(void)
for (i = 0; i < nr_irq; ++i) {
if (intr_type & (0x00000001 << i)) {
irq_set_chip_and_handler_name(i, &intc_dev,
handle_edge_irq, intc_dev.name);
handle_edge_irq, "edge");
irq_clear_status_flags(i, IRQ_LEVEL);
} else {
irq_set_chip_and_handler_name(i, &intc_dev,
handle_level_irq, intc_dev.name);
handle_level_irq, "level");
irq_set_status_flags(i, IRQ_LEVEL);
}
}
Expand Down
4 changes: 4 additions & 0 deletions arch/microblaze/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,7 @@ ENTRY(sys_call_table)
.long sys_fanotify_init
.long sys_fanotify_mark
.long sys_prlimit64 /* 370 */
.long sys_name_to_handle_at
.long sys_open_by_handle_at
.long sys_clock_adjtime
.long sys_syncfs
6 changes: 6 additions & 0 deletions arch/microblaze/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# Makefile
#

ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_ashldi3.o = -pg
CFLAGS_REMOVE_ashrdi3.o = -pg
CFLAGS_REMOVE_lshrdi3.o = -pg
endif

lib-y := memset.o

ifeq ($(CONFIG_OPT_LIB_ASM),y)
Expand Down

0 comments on commit bdfd6b7

Please sign in to comment.