@@ -22,7 +22,29 @@ pub type wchar_t = ::c_int;
22
22
//pub type d_ino = ::c_ulong;
23
23
pub type nfds_t = :: c_ulong ;
24
24
25
+ // L4Re specifics
26
+ // Some of these aren't actually part of the libc, but of l4sys, but since libc
27
+ // depends on l4sys on this platform, we should dump the few important
28
+ // definitions here.
29
+ pub type l4_umword_t = :: c_ulong ; // Unsigned machine word.
30
+
25
31
s ! {
32
+ pub struct dirent {
33
+ pub d_ino: :: ino64_t,
34
+ pub d_off: :: off64_t,
35
+ pub d_reclen: u16 ,
36
+ pub d_type: u8 ,
37
+ pub d_name: [ :: c_char; 256 ] ,
38
+ }
39
+
40
+ pub struct dirent64 {
41
+ pub d_ino: :: ino64_t,
42
+ pub d_off: :: off64_t,
43
+ pub d_reclen: u16 ,
44
+ pub d_type: u8 ,
45
+ pub d_name: [ :: c_char; 256 ] ,
46
+ }
47
+
26
48
pub struct ipc_perm {
27
49
pub __key: :: key_t,
28
50
pub uid: :: uid_t,
37
59
__unused2: :: c_ulong
38
60
}
39
61
62
+ /// CPU sets.
63
+ pub struct l4_sched_cpu_set_t {
64
+ // from the L4Re docs
65
+ /// Combination of granularity and offset.
66
+ ///
67
+ /// The granularity defines how many CPUs each bit in map describes.
68
+ /// The offset is the numer of the first CPU described by the first
69
+ /// bit in the bitmap.
70
+ /// offset must be a multiple of 2^graularity.
71
+ ///
72
+ /// | MSB | LSB |
73
+ /// | ---------------- | ------------------- |
74
+ /// | 8bit granularity | 24bit offset .. |
75
+ gran_offset: l4_umword_t ,
76
+ /// Bitmap of CPUs.
77
+ map: l4_umword_t ,
78
+ }
79
+
80
+ pub struct pthread_attr_t {
81
+ __detachstate: :: c_int,
82
+ __schedpolicy: :: c_int,
83
+ __schedparam: __sched_param,
84
+ __inheritsched: :: c_int,
85
+ __scope: :: c_int,
86
+ __guardsize: :: size_t,
87
+ __stackaddr_set: :: c_int,
88
+ __stackaddr: * mut :: c_void, // better don't use it
89
+ __stacksize: :: size_t,
90
+ // L4Re specifics
91
+ affinity: l4_sched_cpu_set_t,
92
+ create_flags: :: c_uint,
93
+ }
94
+
95
+ pub struct __sched_param {
96
+ __sched_priority: :: c_int,
97
+ }
98
+
40
99
pub struct siginfo_t {
41
100
si_signo: :: c_int, // signal number
42
101
si_errno: :: c_int, // if not zero: error value of signal, see errno.h
@@ -147,26 +206,6 @@ s! {
147
206
__f_spare: [ :: c_int; 6 ] ,
148
207
}
149
208
150
- pub struct dirent { // Todo
151
- pub d_ino: :: ino64_t,
152
- pub d_off: :: off64_t,
153
- d_reclen: u16 ,
154
- pub d_type: u8 ,
155
- pub d_name: [ i8 ; 256 ] ,
156
- }
157
-
158
- pub struct dirent64 { //
159
- pub d_ino: :: ino64_t,
160
- pub d_off: :: off64_t,
161
- pub d_reclen: u16 ,
162
- pub d_type: u8 ,
163
- pub d_name: [ i8 ; 256 ] ,
164
- }
165
-
166
- pub struct pthread_attr_t { // ToDo
167
- __size: [ u64 ; 7 ]
168
- }
169
-
170
209
pub struct sigaction { // TODO!!
171
210
pub sa_sigaction: :: sighandler_t,
172
211
pub sa_mask: :: sigset_t,
0 commit comments