Skip to content
Snippets Groups Projects
Verified Commit 5b56d630 authored by Jacob Lorentzon's avatar Jacob Lorentzon
Browse files

Remove pthreads-emb, add custom sched.h

parent e09e2eb2
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,6 @@ install-headers: libs
cp -rv "target/include"/* "$(DESTDIR)/include"
cp -v "openlibm/include"/*.h "$(DESTDIR)/include"
cp -v "openlibm/src"/*.h "$(DESTDIR)/include"
cp -v "pthreads-emb/"*.h "$(DESTDIR)/include"
libs: \
$(BUILD)/release/libc.a \
......@@ -93,7 +92,6 @@ install-libs: libs
cp -v "$(BUILD)/release/crtn.o" "$(DESTDIR)/lib"
cp -v "$(BUILD)/release/ld_so" "$(DESTDIR)/lib/ld64.so.1"
cp -v "$(BUILD)/openlibm/libopenlibm.a" "$(DESTDIR)/lib/libm.a"
cp -v "$(BUILD)/pthreads-emb/libpthread.a" "$(DESTDIR)/lib/libpthread.a"
# Empty libraries for dl and rt
$(AR) -rcs "$(DESTDIR)/lib/libdl.a"
$(AR) -rcs "$(DESTDIR)/lib/librt.a"
......@@ -119,7 +117,7 @@ test: sysroot
# Debug targets
$(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/openlibm/libopenlibm.a
echo "create $@" > "$@.mri"
for lib in $^; do\
echo "addlib $$lib" >> "$@.mri"; \
......@@ -128,7 +126,7 @@ $(BUILD)/debug/libc.a: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthre
echo "end" >> "$@.mri"
$(AR) -M < "$@.mri"
$(BUILD)/debug/libc.so: $(BUILD)/debug/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/debug/libc.so: $(BUILD)/debug/librelibc.a $(BUILD)/openlibm/libopenlibm.a
$(CC) -nostdlib -shared -Wl,--allow-multiple-definition -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,-soname,libc.so.6 -o $@
$(BUILD)/debug/librelibc.a: $(SRC)
......@@ -157,7 +155,7 @@ $(BUILD)/debug/ld_so: $(BUILD)/debug/ld_so.o $(BUILD)/debug/crti.o $(BUILD)/debu
# Release targets
$(BUILD)/release/libc.a: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/release/libc.a: $(BUILD)/release/librelibc.a $(BUILD)/openlibm/libopenlibm.a
echo "create $@" > "$@.mri"
for lib in $^; do\
echo "addlib $$lib" >> "$@.mri"; \
......@@ -166,7 +164,7 @@ $(BUILD)/release/libc.a: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libp
echo "end" >> "$@.mri"
$(AR) -M < "$@.mri"
$(BUILD)/release/libc.so: $(BUILD)/release/librelibc.a $(BUILD)/pthreads-emb/libpthread.a $(BUILD)/openlibm/libopenlibm.a
$(BUILD)/release/libc.so: $(BUILD)/release/librelibc.a $(BUILD)/openlibm/libopenlibm.a
$(CC) -nostdlib -shared -Wl,--allow-multiple-definition -Wl,--whole-archive $^ -Wl,--no-whole-archive -Wl,-soname,libc.so.6 -o $@
$(BUILD)/release/librelibc.a: $(SRC)
......@@ -206,13 +204,3 @@ $(BUILD)/openlibm: openlibm
$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm $(BUILD)/release/librelibc.a
$(MAKE) AR=$(AR) CC=$(CC) LD=$(LD) CPPFLAGS="-fno-stack-protector -I $(shell pwd)/include -I $(shell pwd)/target/include" -C $< libopenlibm.a
$(BUILD)/pthreads-emb: pthreads-emb
rm -rf $@ $@.partial
mkdir -p $(BUILD)
cp -r $< $@.partial
mv $@.partial $@
touch $@
$(BUILD)/pthreads-emb/libpthread.a: $(BUILD)/pthreads-emb $(BUILD)/release/librelibc.a
$(MAKE) AR=$(AR) CC=$(CC) LD=$(LD) CFLAGS="-fno-stack-protector -I $(shell pwd)/include -I $(shell pwd)/target/include" -C $< libpthread.a
......@@ -58,7 +58,6 @@ fn main() {
.flag("-nostdlib")
.include(&format!("{}/include", crate_dir))
.include(&format!("{}/target/include", crate_dir))
.include(&format!("{}/pthreads-emb", crate_dir))
.flag("-fno-stack-protector")
.flag("-Wno-expansion-to-defined")
.files(
......
Subproject commit 2a260e02a9e300838526be2f2a6e178daef876a7
......@@ -25,6 +25,7 @@ pub mod netinet_tcp;
pub mod poll;
pub mod pwd;
pub mod regex;
pub mod sched;
pub mod semaphore;
pub mod setjmp;
pub mod sgtty;
......
sys_includes = ["time.h"]
include_guard = "_RELIBC_SCHED_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
[enum]
prefix_with_name = true
//! sched.h implementation for Redox, following https://pubs.opengroup.org/onlinepubs/7908799/xsh/sched.h.html
use crate::platform::{Pal, Sys, types::*};
use crate::header::time::timespec;
#[repr(C)]
#[derive(Clone, Debug)]
pub struct sched_param {
sched_priority: c_int,
}
pub const SCHED_FIFO: c_int = 0;
pub const SCHED_RR: c_int = 1;
pub const SCHED_OTHER: c_int = 2;
// #[no_mangle]
pub extern "C" fn sched_get_priority_max(policy: c_int) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_get_priority_min(policy: c_int) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_getparam(pid: pid_t, param: *mut sched_param) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_rr_get_interval(pid: pid_t, time: *const timespec) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_setparam(pid: pid_t, param: *const sched_param) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_setscheduler(pid: pid_t, policy: c_int, param: *const sched_param) -> c_int {
todo!()
}
#[no_mangle]
pub extern "C" fn sched_yield() -> c_int {
Sys::sched_yield()
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment