diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index 7c239a9..e5fc340 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -133,6 +133,11 @@ config LOADER_U_BOOT bool "U-Boot (or similar) bootloader" endchoice +config AVR32_JAVA_EXTENSION_MODULE + bool + prompt "Support Java Extension Module" + default n + source "arch/avr32/mach-at32ap/Kconfig" config LOAD_ADDRESS diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index 478bda4..bc2b5f4 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S @@ -295,4 +295,5 @@ sys_call_table: .long sys_signalfd .long sys_ni_syscall /* 280, was sys_timerfd */ .long sys_eventfd + .long sys_java_settrap .long sys_ni_syscall /* r8 is saturated at nr_syscalls */ diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index b835c4c..a99bca0 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c @@ -263,8 +263,20 @@ asmlinkage void do_fpe(unsigned long ecr, struct pt_regs *regs) _exception(SIGILL, regs, ILL_COPROC, regs->pc); } +#include void __init trap_init(void) { +} +#include +asmlinkage long sys_java_settrap(void __user *handler) +{ + /* This shouldn't be needed - we don't use the "H" bit, still we do + * observe aastore Write Barrier Java exceptions */ + sysreg_write(SR, sysreg_read(SR) & ~(1 << SYSREG_H_OFFSET)); + sysreg_write(JBCR, 0x80000000); + printk("Set Java trap handlers to %p\n", handler); + sysreg_write(JTBA, (int)handler); + return 0; } diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index 89861a2..b1c129f 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h @@ -300,8 +300,10 @@ /* 280 was __NR_timerfd */ #define __NR_eventfd 281 +#define __NR_java_settrap 282 + #ifdef __KERNEL__ -#define NR_syscalls 282 +#define NR_syscalls 283 /* Old stuff */ #define __IGNORE_uselib diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index d6ff145..e1885e1 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -622,6 +622,7 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); asmlinkage long sys_eventfd(unsigned int count); asmlinkage long sys_eventfd2(unsigned int count, int flags); asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); +asmlinkage long sys_java_settrap(void __user *handler); int kernel_execve(const char *filename, char *const argv[], char *const envp[]);