diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-07-23 05:20:10 -0400 |
commit | 39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch) | |
tree | 7a02a317b9ad57da51ca99887c119e779ccf3f13 /include/linux/sched.h | |
parent | 0fc72b81d3111d114ab378935b1cf07680ca1289 (diff) | |
parent | f695baf2df9e0413d3521661070103711545207a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index cfb680585ab8..33b9b4841ee7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ |
27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | 27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ |
28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | 28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ |
29 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Scheduling policies | 32 | * Scheduling policies |
@@ -287,6 +288,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout); | |||
287 | asmlinkage void schedule(void); | 288 | asmlinkage void schedule(void); |
288 | 289 | ||
289 | struct nsproxy; | 290 | struct nsproxy; |
291 | struct user_namespace; | ||
290 | 292 | ||
291 | /* Maximum number of active map areas.. This is a random (large) number */ | 293 | /* Maximum number of active map areas.. This is a random (large) number */ |
292 | #define DEFAULT_MAX_MAP_COUNT 65536 | 294 | #define DEFAULT_MAX_MAP_COUNT 65536 |
@@ -343,6 +345,27 @@ typedef unsigned long mm_counter_t; | |||
343 | (mm)->hiwater_vm = (mm)->total_vm; \ | 345 | (mm)->hiwater_vm = (mm)->total_vm; \ |
344 | } while (0) | 346 | } while (0) |
345 | 347 | ||
348 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
349 | extern int get_dumpable(struct mm_struct *mm); | ||
350 | |||
351 | /* mm flags */ | ||
352 | /* dumpable bits */ | ||
353 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | ||
354 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | ||
355 | #define MMF_DUMPABLE_BITS 2 | ||
356 | |||
357 | /* coredump filter bits */ | ||
358 | #define MMF_DUMP_ANON_PRIVATE 2 | ||
359 | #define MMF_DUMP_ANON_SHARED 3 | ||
360 | #define MMF_DUMP_MAPPED_PRIVATE 4 | ||
361 | #define MMF_DUMP_MAPPED_SHARED 5 | ||
362 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS | ||
363 | #define MMF_DUMP_FILTER_BITS 4 | ||
364 | #define MMF_DUMP_FILTER_MASK \ | ||
365 | (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT) | ||
366 | #define MMF_DUMP_FILTER_DEFAULT \ | ||
367 | ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) | ||
368 | |||
346 | struct mm_struct { | 369 | struct mm_struct { |
347 | struct vm_area_struct * mmap; /* list of VMAs */ | 370 | struct vm_area_struct * mmap; /* list of VMAs */ |
348 | struct rb_root mm_rb; | 371 | struct rb_root mm_rb; |
@@ -400,7 +423,7 @@ struct mm_struct { | |||
400 | unsigned int token_priority; | 423 | unsigned int token_priority; |
401 | unsigned int last_interval; | 424 | unsigned int last_interval; |
402 | 425 | ||
403 | unsigned char dumpable:2; | 426 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
404 | 427 | ||
405 | /* coredumping support */ | 428 | /* coredumping support */ |
406 | int core_waiters; | 429 | int core_waiters; |
@@ -529,6 +552,10 @@ struct signal_struct { | |||
529 | #ifdef CONFIG_TASKSTATS | 552 | #ifdef CONFIG_TASKSTATS |
530 | struct taskstats *stats; | 553 | struct taskstats *stats; |
531 | #endif | 554 | #endif |
555 | #ifdef CONFIG_AUDIT | ||
556 | unsigned audit_tty; | ||
557 | struct tty_audit_buf *tty_audit_buf; | ||
558 | #endif | ||
532 | }; | 559 | }; |
533 | 560 | ||
534 | /* Context switch must be unlocked if interrupts are to be enabled */ | 561 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -972,7 +999,8 @@ struct task_struct { | |||
972 | unsigned int rt_priority; | 999 | unsigned int rt_priority; |
973 | cputime_t utime, stime; | 1000 | cputime_t utime, stime; |
974 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1001 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
975 | struct timespec start_time; | 1002 | struct timespec start_time; /* monotonic time */ |
1003 | struct timespec real_start_time; /* boot based time */ | ||
976 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ | 1004 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ |
977 | unsigned long min_flt, maj_flt; | 1005 | unsigned long min_flt, maj_flt; |
978 | 1006 | ||
@@ -1320,6 +1348,13 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | |||
1320 | #endif | 1348 | #endif |
1321 | 1349 | ||
1322 | extern unsigned long long sched_clock(void); | 1350 | extern unsigned long long sched_clock(void); |
1351 | |||
1352 | /* | ||
1353 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | ||
1354 | * clock constructed from sched_clock(): | ||
1355 | */ | ||
1356 | extern unsigned long long cpu_clock(int cpu); | ||
1357 | |||
1323 | extern unsigned long long | 1358 | extern unsigned long long |
1324 | task_sched_runtime(struct task_struct *task); | 1359 | task_sched_runtime(struct task_struct *task); |
1325 | 1360 | ||
@@ -1403,7 +1438,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid); | |||
1403 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1438 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
1404 | 1439 | ||
1405 | /* per-UID process charging. */ | 1440 | /* per-UID process charging. */ |
1406 | extern struct user_struct * alloc_uid(uid_t); | 1441 | extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); |
1407 | static inline struct user_struct *get_uid(struct user_struct *u) | 1442 | static inline struct user_struct *get_uid(struct user_struct *u) |
1408 | { | 1443 | { |
1409 | atomic_inc(&u->__count); | 1444 | atomic_inc(&u->__count); |