1- //! Definitions for l4re- uclibc on 64bit systems
2-
1+ //! Definitions for uclibc on 64bit systems
2+ //!
33pub type blkcnt_t = i64 ;
44pub type blksize_t = i64 ;
55pub type clock_t = i64 ;
@@ -22,12 +22,6 @@ pub type wchar_t = ::c_int;
2222//pub type d_ino = ::c_ulong;
2323pub type nfds_t = :: c_ulong ;
2424
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-
3125s ! {
3226 pub struct dirent {
3327 pub d_ino: :: ino64_t,
5953 __unused2: :: c_ulong
6054 }
6155
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-
56+ #[ cfg( not( target_os = "l4re" ) ) ]
8057 pub struct pthread_attr_t {
8158 __detachstate: :: c_int,
8259 __schedpolicy: :: c_int,
8764 __stackaddr_set: :: c_int,
8865 __stackaddr: * mut :: c_void, // better don't use it
8966 __stacksize: :: size_t,
90- // L4Re specifics
91- affinity: l4_sched_cpu_set_t,
92- create_flags: :: c_uint,
9367 }
9468
9569 pub struct __sched_param {
@@ -399,7 +373,7 @@ pub const O_EXCL: ::c_int = 0200;
399373pub const O_NONBLOCK : :: c_int = 04000 ;
400374pub const O_TRUNC : :: c_int = 01000 ;
401375pub const NCCS : usize = 32 ;
402- pub const PTHREAD_STACK_MIN : :: c_int = 16384 ;
376+ pub const PTHREAD_STACK_MIN : usize = 16384 ;
403377pub const SIG_SETMASK : :: c_int = 2 ; // Set the set of blocked signals
404378pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40 ;
405379pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4 ;
@@ -415,3 +389,11 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
415389extern {
416390 pub fn memalign ( align : :: size_t , size : :: size_t ) -> * mut :: c_void ;
417391}
392+
393+ cfg_if ! {
394+ if #[ cfg( target_os = "l4re" ) ] {
395+ mod l4re;
396+ pub use self :: l4re:: * ;
397+ } else { }
398+ }
399+
0 commit comments