提交 7dfb7103 编写于 作者: N Nigel Cunningham 提交者: Linus Torvalds

[PATCH] Add include/linux/freezer.h and move definitions from sched.h

Move process freezing functions from include/linux/sched.h to freezer.h, so
that modifications to the freezer or the kernel configuration don't require
recompiling just about everything.

[akpm@osdl.org: fix ueagle driver]
Signed-off-by: NNigel Cunningham <nigel@suspend2.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8a05aac2
......@@ -11,6 +11,7 @@
#include <linux/signal.h>
#include <linux/ptrace.h>
#include <linux/personality.h>
#include <linux/freezer.h>
#include <asm/cacheflush.h>
#include <asm/ucontext.h>
......
......@@ -15,7 +15,7 @@
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <asm/uaccess.h>
#include <asm/ucontext.h>
......
......@@ -21,7 +21,7 @@
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/personality.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
......
......@@ -38,7 +38,7 @@
#include <linux/personality.h>
#include <linux/tty.h>
#include <linux/binfmts.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
......
......@@ -34,6 +34,7 @@
#include <linux/pci.h>
#include <linux/msi.h>
#include <linux/htirq.h>
#include <linux/freezer.h>
#include <asm/io.h>
#include <asm/smp.h>
......
......@@ -21,7 +21,7 @@
#include <linux/unistd.h>
#include <linux/stddef.h>
#include <linux/personality.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <asm/cacheflush.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
......
......@@ -36,7 +36,7 @@
#include <linux/stddef.h>
#include <linux/tty.h>
#include <linux/binfmts.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#endif
#include <asm/uaccess.h>
......
......@@ -23,6 +23,7 @@
#include <linux/elf.h>
#include <linux/personality.h>
#include <linux/binfmts.h>
#include <linux/freezer.h>
#include <asm/ucontext.h>
#include <asm/uaccess.h>
......
......@@ -22,7 +22,7 @@
#include <linux/errno.h>
#include <linux/wait.h>
#include <linux/personality.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/ptrace.h>
#include <linux/unistd.h>
#include <linux/stddef.h>
......
......@@ -54,7 +54,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/miscdevice.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/mutex.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_ioctl.h>
......
......@@ -38,6 +38,7 @@
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/freezer.h>
#include <asm/uaccess.h>
......
......@@ -28,6 +28,7 @@
#include <linux/sysdev.h>
#include <linux/ctype.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/edac.h>
......
......@@ -15,6 +15,7 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/moduleparam.h>
#include <linux/freezer.h>
#include <asm/atomic.h>
#include "csr.h"
......
......@@ -23,6 +23,7 @@
#include <linux/kthread.h>
#include <linux/sched.h> /* HZ */
#include <linux/mutex.h>
#include <linux/freezer.h>
/*#include <asm/io.h>*/
......
......@@ -35,6 +35,7 @@
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Serio abstraction core");
......
......@@ -24,6 +24,7 @@
#include <linux/suspend.h>
#include <linux/kthread.h>
#include <linux/moduleparam.h>
#include <linux/freezer.h>
#include <asm/prom.h>
#include <asm/machdep.h>
......
......@@ -42,7 +42,7 @@
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/sysdev.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/syscalls.h>
#include <linux/cpu.h>
#include <asm/prom.h>
......
......@@ -34,6 +34,7 @@
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
#include <asm/prom.h>
......
......@@ -39,10 +39,10 @@
#include <linux/raid/bitmap.h>
#include <linux/sysctl.h>
#include <linux/buffer_head.h> /* for invalidate_bdev */
#include <linux/suspend.h>
#include <linux/poll.h>
#include <linux/mutex.h>
#include <linux/ctype.h>
#include <linux/freezer.h>
#include <linux/init.h>
......
......@@ -34,7 +34,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/list.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/jiffies.h>
#include <asm/processor.h>
......
......@@ -56,7 +56,7 @@
#include <media/tvaudio.h>
#include <media/msp3400.h>
#include <linux/kthread.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include "msp3400-driver.h"
/* ---------------------------------------------------------------------- */
......
......@@ -29,6 +29,7 @@
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <media/tvaudio.h>
#include <media/v4l2-common.h>
......
......@@ -20,7 +20,7 @@
#include <linux/fs.h>
#include <linux/kthread.h>
#include <linux/file.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <media/video-buf.h>
#include <media/video-buf-dvb.h>
......
......@@ -36,6 +36,7 @@
#include <media/v4l2-common.h>
#include <linux/kthread.h>
#include <linux/highmem.h>
#include <linux/freezer.h>
/* Wake up at about 30 fps */
#define WAKE_NUMERATOR 30
......
......@@ -28,7 +28,7 @@
#include <linux/string.h>
#include <linux/input.h>
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/slab.h>
#include <linux/kthread.h>
......
......@@ -50,6 +50,7 @@
#include <linux/usb.h>
#include <linux/crc32.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <net/irda/irda.h>
#include <net/irda/irlap.h>
#include <net/irda/irda_device.h>
......
......@@ -49,6 +49,7 @@
#include <asm/uaccess.h>
#include <net/ieee80211.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include "airo.h"
......
......@@ -29,6 +29,7 @@
#include <linux/pci.h>
#include <linux/device.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <asm/system.h>
#include <asm/irq.h>
......
......@@ -61,6 +61,7 @@
#include <linux/dmi.h>
#include <linux/delay.h>
#include <linux/acpi.h>
#include <linux/freezer.h>
#include <asm/page.h>
#include <asm/desc.h>
......
......@@ -64,6 +64,8 @@
#include <linux/kthread.h>
#include <linux/version.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
#include <asm/unaligned.h>
#include "usbatm.h"
......
......@@ -22,6 +22,7 @@
#include <linux/usbdevice_fs.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/freezer.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>
......
......@@ -250,7 +250,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/utsname.h>
#include <linux/usb_ch9.h>
......
......@@ -49,7 +49,7 @@
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
......
......@@ -31,6 +31,7 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <asm/atomic.h>
......
......@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/freezer.h>
#include "cell.h"
#include "server.h"
#include "volume.h"
......
......@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/freezer.h>
#include "cell.h"
#include "volume.h"
#include "kafstimod.h"
......
......@@ -34,6 +34,7 @@
#include <linux/mempool.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include "cifsfs.h"
#include "cifspdu.h"
#define DECLARE_GLOBALS_HERE
......
......@@ -31,6 +31,7 @@
#include <linux/delay.h>
#include <linux/completion.h>
#include <linux/pagevec.h>
#include <linux/freezer.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include "cifspdu.h"
......
......@@ -31,7 +31,7 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/pagemap.h>
#include <linux/kthread.h>
#include <linux/poison.h>
......
......@@ -31,7 +31,7 @@
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/pagemap.h>
#include <linux/kthread.h>
#include <linux/poison.h>
......
......@@ -66,6 +66,7 @@
#include <linux/smp_lock.h>
#include <linux/time.h>
#include <linux/ctype.h>
#include <linux/freezer.h>
#include "intrep.h"
#include "jffs_fm.h"
......
......@@ -16,6 +16,7 @@
#include <linux/mtd/mtd.h>
#include <linux/completion.h>
#include <linux/sched.h>
#include <linux/freezer.h>
#include "nodelist.h"
......
......@@ -67,7 +67,7 @@
#include <linux/kthread.h>
#include <linux/buffer_head.h> /* for sync_blockdev() */
#include <linux/bio.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include "jfs_incore.h"
......
......@@ -46,7 +46,7 @@
#include <linux/vmalloc.h>
#include <linux/smp_lock.h>
#include <linux/completion.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kthread.h>
......
......@@ -13,6 +13,7 @@
#include <linux/nfs_fs.h>
#include <linux/utsname.h>
#include <linux/smp_lock.h>
#include <linux/freezer.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/svc.h>
#include <linux/lockd/lockd.h>
......
......@@ -32,6 +32,7 @@
#include <linux/kthread.h>
#include <linux/migrate.h>
#include <linux/backing-dev.h>
#include <linux/freezer.h>
STATIC kmem_zone_t *xfs_buf_zone;
STATIC kmem_shaker_t xfs_buf_shake;
......
......@@ -56,6 +56,7 @@
#include <linux/mempool.h>
#include <linux/writeback.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
STATIC struct quotactl_ops xfs_quotactl_operations;
STATIC struct super_operations xfs_super_operations;
......
/* Freezer declarations */
#ifdef CONFIG_PM
/*
* Check if a process has been frozen
*/
static inline int frozen(struct task_struct *p)
{
return p->flags & PF_FROZEN;
}
/*
* Check if there is a request to freeze a process
*/
static inline int freezing(struct task_struct *p)
{
return p->flags & PF_FREEZE;
}
/*
* Request that a process be frozen
* FIXME: SMP problem. We may not modify other process' flags!
*/
static inline void freeze(struct task_struct *p)
{
p->flags |= PF_FREEZE;
}
/*
* Sometimes we may need to cancel the previous 'freeze' request
*/
static inline void do_not_freeze(struct task_struct *p)
{
p->flags &= ~PF_FREEZE;
}
/*
* Wake up a frozen process
*/
static inline int thaw_process(struct task_struct *p)
{
if (frozen(p)) {
p->flags &= ~PF_FROZEN;
wake_up_process(p);
return 1;
}
return 0;
}
/*
* freezing is complete, mark process as frozen
*/
static inline void frozen_process(struct task_struct *p)
{
p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
}
extern void refrigerator(void);
extern int freeze_processes(void);
extern void thaw_processes(void);
static inline int try_to_freeze(void)
{
if (freezing(current)) {
refrigerator();
return 1;
} else
return 0;
}
#else
static inline int frozen(struct task_struct *p) { return 0; }
static inline int freezing(struct task_struct *p) { return 0; }
static inline void freeze(struct task_struct *p) { BUG(); }
static inline int thaw_process(struct task_struct *p) { return 1; }
static inline void frozen_process(struct task_struct *p) { BUG(); }
static inline void refrigerator(void) {}
static inline int freeze_processes(void) { BUG(); return 0; }
static inline void thaw_processes(void) {}
static inline int try_to_freeze(void) { return 0; }
#endif
......@@ -1618,87 +1618,6 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
extern void normalize_rt_tasks(void);
#ifdef CONFIG_PM
/*
* Check if a process has been frozen
*/
static inline int frozen(struct task_struct *p)
{
return p->flags & PF_FROZEN;
}
/*
* Check if there is a request to freeze a process
*/
static inline int freezing(struct task_struct *p)
{
return p->flags & PF_FREEZE;
}
/*
* Request that a process be frozen
* FIXME: SMP problem. We may not modify other process' flags!
*/
static inline void freeze(struct task_struct *p)
{
p->flags |= PF_FREEZE;
}
/*
* Sometimes we may need to cancel the previous 'freeze' request
*/
static inline void do_not_freeze(struct task_struct *p)
{
p->flags &= ~PF_FREEZE;
}
/*
* Wake up a frozen process
*/
static inline int thaw_process(struct task_struct *p)
{
if (frozen(p)) {
p->flags &= ~PF_FROZEN;
wake_up_process(p);
return 1;
}
return 0;
}
/*
* freezing is complete, mark process as frozen
*/
static inline void frozen_process(struct task_struct *p)
{
p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
}
extern void refrigerator(void);
extern int freeze_processes(void);
extern void thaw_processes(void);
static inline int try_to_freeze(void)
{
if (freezing(current)) {
refrigerator();
return 1;
} else
return 0;
}
#else
static inline int frozen(struct task_struct *p) { return 0; }
static inline int freezing(struct task_struct *p) { return 0; }
static inline void freeze(struct task_struct *p) { BUG(); }
static inline int thaw_process(struct task_struct *p) { return 1; }
static inline void frozen_process(struct task_struct *p) { BUG(); }
static inline void refrigerator(void) {}
static inline int freeze_processes(void) { BUG(); return 0; }
static inline void thaw_processes(void) {}
static inline int try_to_freeze(void) { return 0; }
#endif /* CONFIG_PM */
#endif /* __KERNEL__ */
#endif
......@@ -6,6 +6,7 @@
#include <linux/romfs_fs.h>
#include <linux/initrd.h>
#include <linux/sched.h>
#include <linux/freezer.h>
#include "do_mounts.h"
......
......@@ -57,6 +57,7 @@
#include <linux/netlink.h>
#include <linux/selinux.h>
#include <linux/inotify.h>
#include <linux/freezer.h>
#include "audit.h"
......
......@@ -20,6 +20,7 @@
#include <linux/pm.h>
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/freezer.h>
#include "power.h"
......
......@@ -18,6 +18,7 @@
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/resume-trace.h>
#include <linux/freezer.h>
#include "power.h"
......
......@@ -13,6 +13,7 @@
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
/*
* Timeout for stopping processes
......
......@@ -22,6 +22,7 @@
#include <linux/fs.h>
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/freezer.h>
#include <asm/uaccess.h>
......
......@@ -13,6 +13,7 @@
#include <linux/spinlock.h>
#include <linux/sysdev.h>
#include <linux/timer.h>
#include <linux/freezer.h>
#include "rtmutex.h"
......
......@@ -34,7 +34,7 @@
#include <linux/security.h>
#include <linux/notifier.h>
#include <linux/profile.h>
#include <linux/suspend.h>
#include <linux/freezer.h>
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
......
......@@ -23,6 +23,7 @@
#include <linux/ptrace.h>
#include <linux/signal.h>
#include <linux/capability.h>
#include <linux/freezer.h>
#include <asm/param.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
......
......@@ -21,6 +21,7 @@
#include <linux/writeback.h> // Prototypes pdflush_operation()
#include <linux/kthread.h>
#include <linux/cpuset.h>
#include <linux/freezer.h>
/*
......
......@@ -36,6 +36,7 @@
#include <linux/rwsem.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <asm/tlbflush.h>
#include <asm/div64.h>
......
......@@ -13,6 +13,7 @@
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/freezer.h>
#include <rxrpc/krxiod.h>
#include <rxrpc/transport.h>
#include <rxrpc/peer.h>
......
......@@ -27,6 +27,7 @@
#include <rxrpc/call.h>
#include <linux/udp.h>
#include <linux/ip.h>
#include <linux/freezer.h>
#include <net/sock.h>
#include "internal.h"
......
......@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/freezer.h>
#include <rxrpc/rxrpc.h>
#include <rxrpc/krxtimod.h>
#include <asm/errno.h>
......
......@@ -32,6 +32,7 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/file.h>
#include <linux/freezer.h>
#include <net/sock.h>
#include <net/checksum.h>
#include <net/ip.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册