]>
Commit | Line | Data |
---|---|---|
ea8adc8c XL |
1 | /// L4Re specifics |
2 | /// This module contains definitions required by various L4Re libc backends. | |
3 | /// Some of them are formally not part of the libc, but are a dependency of the | |
4 | /// libc and hence we should provide them here. | |
5 | ||
6 | pub type l4_umword_t = ::c_ulong; // Unsigned machine word. | |
0531ce1d | 7 | pub type pthread_t = *mut ::c_void; |
ea8adc8c XL |
8 | |
9 | s! { | |
10 | /// CPU sets. | |
11 | pub struct l4_sched_cpu_set_t { | |
12 | // from the L4Re docs | |
13 | /// Combination of granularity and offset. | |
14 | /// | |
15 | /// The granularity defines how many CPUs each bit in map describes. | |
16 | /// The offset is the numer of the first CPU described by the first | |
17 | /// bit in the bitmap. | |
18 | /// offset must be a multiple of 2^graularity. | |
19 | /// | |
20 | /// | MSB | LSB | | |
21 | /// | ---------------- | ------------------- | | |
22 | /// | 8bit granularity | 24bit offset .. | | |
23 | gran_offset: l4_umword_t , | |
24 | /// Bitmap of CPUs. | |
25 | map: l4_umword_t , | |
26 | } | |
27 | } | |
28 | ||
29 | #[cfg(target_os = "l4re")] | |
30 | pub struct pthread_attr_t { | |
31 | pub __detachstate: ::c_int, | |
32 | pub __schedpolicy: ::c_int, | |
33 | pub __schedparam: super::__sched_param, | |
34 | pub __inheritsched: ::c_int, | |
35 | pub __scope: ::c_int, | |
36 | pub __guardsize: ::size_t, | |
37 | pub __stackaddr_set: ::c_int, | |
38 | pub __stackaddr: *mut ::c_void, // better don't use it | |
39 | pub __stacksize: ::size_t, | |
40 | // L4Re specifics | |
41 | pub affinity: l4_sched_cpu_set_t, | |
42 | pub create_flags: ::c_uint, | |
43 | } | |
44 | ||
45 | // L4Re requires a min stack size of 64k; that isn't defined in uClibc, but | |
46 | // somewhere in the core libraries. uClibc wants 16k, but that's not enough. | |
47 | pub const PTHREAD_STACK_MIN: usize = 65536; |