-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #734 - humenda:l4re-improvements, r=alexcrichton
L4Re improvements This commit improves the x86_64 uClibc port and splits of L4Re-specific structs into a separate submodule. It defines additional constants and fixes some unfinished structs.
- Loading branch information
Showing
3 changed files
with
125 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// L4Re specifics | ||
/// This module contains definitions required by various L4Re libc backends. | ||
/// Some of them are formally not part of the libc, but are a dependency of the | ||
/// libc and hence we should provide them here. | ||
pub type l4_umword_t = ::c_ulong; // Unsigned machine word. | ||
|
||
s! { | ||
/// CPU sets. | ||
pub struct l4_sched_cpu_set_t { | ||
// from the L4Re docs | ||
/// Combination of granularity and offset. | ||
/// | ||
/// The granularity defines how many CPUs each bit in map describes. | ||
/// The offset is the numer of the first CPU described by the first | ||
/// bit in the bitmap. | ||
/// offset must be a multiple of 2^graularity. | ||
/// | ||
/// | MSB | LSB | | ||
/// | ---------------- | ------------------- | | ||
/// | 8bit granularity | 24bit offset .. | | ||
gran_offset: l4_umword_t , | ||
/// Bitmap of CPUs. | ||
map: l4_umword_t , | ||
} | ||
} | ||
|
||
#[cfg(target_os = "l4re")] | ||
pub struct pthread_attr_t { | ||
pub __detachstate: ::c_int, | ||
pub __schedpolicy: ::c_int, | ||
pub __schedparam: super::__sched_param, | ||
pub __inheritsched: ::c_int, | ||
pub __scope: ::c_int, | ||
pub __guardsize: ::size_t, | ||
pub __stackaddr_set: ::c_int, | ||
pub __stackaddr: *mut ::c_void, // better don't use it | ||
pub __stacksize: ::size_t, | ||
// L4Re specifics | ||
pub affinity: l4_sched_cpu_set_t, | ||
pub create_flags: ::c_uint, | ||
} | ||
|
||
// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but | ||
// somewhere in the core libraries. uClibc wants 16k, but that's not enough. | ||
pub const PTHREAD_STACK_MIN: usize = 65536; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters