Skip to content

Commit

Permalink
um: nommu: add ifdefs for nommu
Browse files Browse the repository at this point in the history
Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
  • Loading branch information
thehajime committed Sep 10, 2024
1 parent e762cd7 commit 3c387ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/um/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child);
}

#ifdef CONFIG_MMU
long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
Expand Down Expand Up @@ -150,3 +151,17 @@ void syscall_trace_leave(struct pt_regs *regs)
if (ptraced & PT_PTRACED)
set_thread_flag(TIF_SIGPENDING);
}
#else
long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
return -EINVAL;
}

const struct user_regset_view *task_user_regset_view(struct task_struct *);
const struct user_regset_view *task_user_regset_view(struct task_struct *task)
{
BUG();
return 0;
}
#endif
2 changes: 2 additions & 0 deletions arch/um/kernel/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
int handle_page_fault(unsigned long address, unsigned long ip,
int is_write, int is_user, int *code_out)
{
#ifdef CONFIG_MMU
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
pmd_t *pmd;
Expand Down Expand Up @@ -128,6 +129,7 @@ int handle_page_fault(unsigned long address, unsigned long ip,
if (!is_user)
goto out_nosemaphore;
pagefault_out_of_memory();
#endif
return 0;
}

Expand Down

0 comments on commit 3c387ac

Please sign in to comment.