#include <linux/slab.h>
#include <linux/syscalls.h>
+#include <asm-generic/irq_regs.h>
+
asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, off_t off)
asmlinkage long sys_rt_sigreturn_wrapper(void);
#define sys_rt_sigreturn sys_rt_sigreturn_wrapper
+/* Added functions for PREM support */
+
+/*
+ * Disable IRQ syscall (__NR_prem_irq_disable)
+ */
+asmlinkage long sys_prem_irq_disable(void)
+{
+ /* We need to update userspace pstate that is going to be recovered.
+ * If we call any system call, the irq enabled on OS level */
+ struct pt_regs * regs = task_pt_regs(current);
+ regs->pstate |= (PSR_I_BIT | PSR_F_BIT);
+ return 0;
+}
+
+/*
+ * Enable IRQ syscall (__NR_prem_irq_enable)
+ */
+asmlinkage long sys_prem_irq_enable(void)
+{
+ struct pt_regs * regs = task_pt_regs(current);
+ regs->pstate &= ~(PSR_I_BIT | PSR_F_BIT);
+ return 0;
+}
+
+extern void __flush_dcache_all(void);
+
+/*
+ * Flush and invalidate entire cache (__NR_prem_flush)
+ */
+asmlinkage long sys_prem_flush(void)
+{
+ __flush_dcache_all();
+ return 0;
+}
+
#undef __SYSCALL
#define __SYSCALL(nr, sym) [nr] = sym,
#define __NR_mlock2 284
__SYSCALL(__NR_mlock2, sys_mlock2)
+#define __NR_prem_flush 789
+__SYSCALL(__NR_prem_flush, sys_prem_flush)
+#define __NR_prem_irq_enable 790
+__SYSCALL(__NR_prem_irq_enable, sys_prem_irq_enable)
+#define __NR_prem_irq_disable 791
+__SYSCALL(__NR_prem_irq_disable, sys_prem_irq_disable)
+
#undef __NR_syscalls
-#define __NR_syscalls 285
+#define __NR_syscalls 792
/*
* All syscalls below here should go away really,