kernel, libroot: Make scheduler modes interface public
This commit is contained in:
@@ -49,6 +49,11 @@ enum be_task_flags {
|
||||
B_MIDI_PROCESSING = 0x800
|
||||
};
|
||||
|
||||
enum scheduler_mode {
|
||||
SCHEDULER_MODE_LOW_LATENCY,
|
||||
SCHEDULER_MODE_POWER_SAVING,
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
|
||||
@@ -58,6 +63,9 @@ int32 suggest_thread_priority(uint32 task_flags = B_DEFAULT_MEDIA_PRIORITY,
|
||||
bigtime_t estimate_max_scheduling_latency(thread_id th = -1);
|
||||
/* default is current thread */
|
||||
|
||||
status_t set_scheduler_mode(int32 mode);
|
||||
int32 get_scheduler_mode(void);
|
||||
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -67,6 +75,9 @@ int32 suggest_thread_priority(uint32 what, int32 period, bigtime_t jitter,
|
||||
bigtime_t estimate_max_scheduling_latency(thread_id th);
|
||||
/* default is current thread */
|
||||
|
||||
status_t set_scheduler_mode(int32 mode);
|
||||
int32 get_scheduler_mode(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SCHEDULER_H
|
||||
|
||||
@@ -18,12 +18,10 @@ struct scheduling_analysis;
|
||||
struct SchedulerListener;
|
||||
|
||||
|
||||
typedef enum scheduler_mode {
|
||||
enum scheduler_mode {
|
||||
SCHEDULER_MODE_LOW_LATENCY,
|
||||
SCHEDULER_MODE_POWER_SAVING,
|
||||
// ...
|
||||
SCHEDULER_MODE_COUNT
|
||||
} scheduler_mode;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -95,6 +93,9 @@ bigtime_t _user_estimate_max_scheduling_latency(thread_id thread);
|
||||
status_t _user_analyze_scheduling(bigtime_t from, bigtime_t until, void* buffer,
|
||||
size_t size, struct scheduling_analysis* analysis);
|
||||
|
||||
status_t _user_set_scheduler_mode(int32 mode);
|
||||
int32 _user_get_scheduler_mode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -192,6 +192,9 @@ extern status_t _kern_unblock_threads(thread_id* threads, uint32 count,
|
||||
|
||||
extern bigtime_t _kern_estimate_max_scheduling_latency(thread_id thread);
|
||||
|
||||
extern status_t _kern_set_scheduler_mode(int32 mode);
|
||||
extern int32 _kern_get_scheduler_mode(void);
|
||||
|
||||
// user/group functions
|
||||
extern gid_t _kern_getgid(bool effective);
|
||||
extern uid_t _kern_getuid(bool effective);
|
||||
|
||||
Reference in New Issue
Block a user