Skip to content

Commit 8580e97

Browse files
committed
Auto merge of #2175 - devnexen:haiku_upd, r=JohnTitor
Add kernel scheduler API to Haiku
2 parents b3692e9 + 3c6c414 commit 8580e97

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3205,6 +3205,7 @@ fn test_haiku(target: &str) {
32053205
"kernel/fs_query.h",
32063206
"kernel/fs_volume.h",
32073207
"kernel/image.h",
3208+
"kernel/scheduler.h",
32083209
"storage/StorageDefs.h",
32093210
"support/Errors.h",
32103211
"support/SupportDefs.h",

src/unix/haiku/native.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ e! {
6161
B_ADD_ON_IMAGE,
6262
B_SYSTEM_IMAGE
6363
}
64+
65+
// kernel/scheduler.h
66+
pub enum schduler_mode {
67+
SCHEDULER_MODE_LOW_LATENCY,
68+
SCHEDULER_MODE_POWER_SAVING,
69+
}
6470
}
6571

6672
s! {
@@ -744,6 +750,9 @@ extern "C" {
744750

745751
pub fn find_thread(name: *const ::c_char) -> thread_id;
746752

753+
pub fn get_scheduler_mode() -> i32;
754+
pub fn set_scheduler_mode(mode: i32) -> status_t;
755+
747756
pub fn send_data(
748757
thread: thread_id,
749758
code: i32,

0 commit comments

Comments
 (0)