diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index f2f842db03ce..6f7bba93929b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -377,6 +377,8 @@ extern int sysctl_max_map_count; | |||
377 | 377 | ||
378 | #include <linux/aio.h> | 378 | #include <linux/aio.h> |
379 | 379 | ||
380 | #ifdef CONFIG_MMU | ||
381 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
380 | extern unsigned long | 382 | extern unsigned long |
381 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 383 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
382 | unsigned long, unsigned long); | 384 | unsigned long, unsigned long); |
@@ -386,6 +388,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
386 | unsigned long flags); | 388 | unsigned long flags); |
387 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 389 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
388 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 390 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
391 | #else | ||
392 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | ||
393 | #endif | ||
389 | 394 | ||
390 | #if USE_SPLIT_PTLOCKS | 395 | #if USE_SPLIT_PTLOCKS |
391 | /* | 396 | /* |
@@ -2491,8 +2496,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
2491 | 2496 | ||
2492 | #endif /* CONFIG_SMP */ | 2497 | #endif /* CONFIG_SMP */ |
2493 | 2498 | ||
2494 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
2495 | |||
2496 | #ifdef CONFIG_TRACING | 2499 | #ifdef CONFIG_TRACING |
2497 | extern void | 2500 | extern void |
2498 | __trace_special(void *__tr, void *__data, | 2501 | __trace_special(void *__tr, void *__data, |
@@ -2601,6 +2604,28 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
2601 | } | 2604 | } |
2602 | #endif /* CONFIG_MM_OWNER */ | 2605 | #endif /* CONFIG_MM_OWNER */ |
2603 | 2606 | ||
2607 | static inline unsigned long task_rlimit(const struct task_struct *tsk, | ||
2608 | unsigned int limit) | ||
2609 | { | ||
2610 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); | ||
2611 | } | ||
2612 | |||
2613 | static inline unsigned long task_rlimit_max(const struct task_struct *tsk, | ||
2614 | unsigned int limit) | ||
2615 | { | ||
2616 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); | ||
2617 | } | ||
2618 | |||
2619 | static inline unsigned long rlimit(unsigned int limit) | ||
2620 | { | ||
2621 | return task_rlimit(current, limit); | ||
2622 | } | ||
2623 | |||
2624 | static inline unsigned long rlimit_max(unsigned int limit) | ||
2625 | { | ||
2626 | return task_rlimit_max(current, limit); | ||
2627 | } | ||
2628 | |||
2604 | #endif /* __KERNEL__ */ | 2629 | #endif /* __KERNEL__ */ |
2605 | 2630 | ||
2606 | #endif | 2631 | #endif |