include/linux/pm_wakeup.h
Source file repositories/reference/linux-study-clean/include/linux/pm_wakeup.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/pm_wakeup.h- Extension
.h- Size
- 7402 bytes
- Lines
- 263
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct wake_irqstruct wakeup_sourcefunction device_can_wakeupfunction device_may_wakeupfunction device_wakeup_pathfunction device_set_wakeup_pathfunction device_set_out_band_wakeupfunction device_out_band_wakeupfunction device_set_wakeup_capablefunction device_can_wakeupfunction wakeup_source_unregisterfunction device_wakeup_disablefunction device_set_wakeup_enablefunction device_may_wakeupfunction device_wakeup_pathfunction device_set_wakeup_pathfunction __pm_stay_awakefunction device_set_awake_pathfunction __pm_wakeup_eventfunction pm_wakeup_eventfunction pm_wakeup_hard_eventfunction device_init_wakeupfunction device_disable_wakeupfunction device_init_wakeup
Annotated Snippet
struct wakeup_source {
const char *name;
int id;
struct list_head entry;
spinlock_t lock;
struct wake_irq *wakeirq;
struct timer_list timer;
unsigned long timer_expires;
ktime_t total_time;
ktime_t max_time;
ktime_t last_time;
ktime_t start_prevent_time;
ktime_t prevent_sleep_time;
unsigned long event_count;
unsigned long active_count;
unsigned long relax_count;
unsigned long expire_count;
unsigned long wakeup_count;
struct device *dev;
bool active:1;
bool autosleep_enabled:1;
};
#define for_each_wakeup_source(ws) \
for ((ws) = wakeup_sources_walk_start(); \
(ws); \
(ws) = wakeup_sources_walk_next((ws)))
#ifdef CONFIG_PM_SLEEP
/*
* Changes to device_may_wakeup take effect on the next pm state change.
*/
static inline bool device_can_wakeup(struct device *dev)
{
return dev->power.can_wakeup;
}
static inline bool device_may_wakeup(struct device *dev)
{
return dev->power.can_wakeup && !!dev->power.wakeup;
}
static inline bool device_wakeup_path(struct device *dev)
{
return dev->power.wakeup_path;
}
static inline void device_set_wakeup_path(struct device *dev)
{
dev->power.wakeup_path = true;
}
static inline void device_set_out_band_wakeup(struct device *dev)
{
dev->power.out_band_wakeup = true;
}
static inline bool device_out_band_wakeup(struct device *dev)
{
return dev->power.out_band_wakeup;
}
/* drivers/base/power/wakeup.c */
extern struct wakeup_source *wakeup_source_register(struct device *dev,
const char *name);
extern void wakeup_source_unregister(struct wakeup_source *ws);
extern int wakeup_sources_read_lock(void);
extern void wakeup_sources_read_unlock(int idx);
extern struct wakeup_source *wakeup_sources_walk_start(void);
extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws);
extern int device_wakeup_enable(struct device *dev);
extern void device_wakeup_disable(struct device *dev);
extern void device_set_wakeup_capable(struct device *dev, bool capable);
extern int device_set_wakeup_enable(struct device *dev, bool enable);
extern void __pm_stay_awake(struct wakeup_source *ws);
extern void pm_stay_awake(struct device *dev);
extern void __pm_relax(struct wakeup_source *ws);
extern void pm_relax(struct device *dev);
extern void pm_wakeup_ws_event(struct wakeup_source *ws, unsigned int msec, bool hard);
extern void pm_wakeup_dev_event(struct device *dev, unsigned int msec, bool hard);
#else /* !CONFIG_PM_SLEEP */
static inline void device_set_wakeup_capable(struct device *dev, bool capable)
{
dev->power.can_wakeup = capable;
}
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct wake_irq`, `struct wakeup_source`, `function device_can_wakeup`, `function device_may_wakeup`, `function device_wakeup_path`, `function device_set_wakeup_path`, `function device_set_out_band_wakeup`, `function device_out_band_wakeup`, `function device_set_wakeup_capable`, `function device_can_wakeup`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.