diff options
Diffstat (limited to 'schedsim/rtems/sched_cpu/sys')
-rw-r--r-- | schedsim/rtems/sched_cpu/sys/_types.h | 54 | ||||
-rw-r--r-- | schedsim/rtems/sched_cpu/sys/cpuset.h | 9 | ||||
-rw-r--r-- | schedsim/rtems/sched_cpu/sys/features.h | 16 | ||||
-rw-r--r-- | schedsim/rtems/sched_cpu/sys/lock.h | 35 |
4 files changed, 114 insertions, 0 deletions
diff --git a/schedsim/rtems/sched_cpu/sys/_types.h b/schedsim/rtems/sched_cpu/sys/_types.h new file mode 100644 index 0000000..1ad429d --- /dev/null +++ b/schedsim/rtems/sched_cpu/sys/_types.h @@ -0,0 +1,54 @@ +/* ANSI C namespace clean utility typedefs */ + +/* This file defines various typedefs needed by the system calls that support + the C library. Basically, they're just the POSIX versions with an '_' + prepended. This file lives in the `sys' directory so targets can provide + their own if desired (or they can put target dependant conditionals here). +*/ + +#ifndef _SYS__TYPES_H +#define _SYS__TYPES_H + +typedef long _off_t; +__extension__ typedef long long _off64_t; + +typedef long _fpos_t; +__extension__ typedef long long _fpos64_t; + +#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 +typedef int _ssize_t; +#else +typedef long _ssize_t; +#endif + +#define __need_wint_t +#include <stddef.h> + +/* Conversion state information. */ +typedef struct +{ + int __count; + union + { + wint_t __wch; + unsigned char __wchb[4]; + } __value; /* Value so far. */ +} _mbstate_t; + +struct __flock_mutex_t_tmp; +typedef struct +{ + int __a; + int __b; + struct + { + long int __c1; + int __c2; + } __c; + int __d; + struct __flock_mutex_t_tmp * __e; +} __flock_mutex_t; + +typedef struct { __flock_mutex_t mutex; } _flock_t; + +#endif /* _SYS__TYPES_H */ diff --git a/schedsim/rtems/sched_cpu/sys/cpuset.h b/schedsim/rtems/sched_cpu/sys/cpuset.h new file mode 100644 index 0000000..d89bb68 --- /dev/null +++ b/schedsim/rtems/sched_cpu/sys/cpuset.h @@ -0,0 +1,9 @@ +/* + * On Linux, the cpu_set_t is defined here proteted with _GNU_SOURCE + * and it is defined in Makefile.am` + */ +#include <sched.h> +#ifndef __CPU_ZERO_S +#error "__CPU_ZERO_S not defined - check configuration" +#endif + diff --git a/schedsim/rtems/sched_cpu/sys/features.h b/schedsim/rtems/sched_cpu/sys/features.h new file mode 100644 index 0000000..34cd0eb --- /dev/null +++ b/schedsim/rtems/sched_cpu/sys/features.h @@ -0,0 +1,16 @@ +#ifndef _SYS_FEATURES_H +#define _SYS_FEATURES_H + +#include <bits/posix_opt.h> + +/* We do not support asynchronous I/O. */ +#undef _POSIX_ASYNCHRONOUS_IO +#undef _POSIX_ASYNC_IO +#undef _LFS_ASYNCHRONOUS_IO +#undef _LFS64_ASYNCHRONOUS_IO + +/* POSIX message queues are supported. */ +#undef _POSIX_MESSAGE_PASSING +#define _POSIX_MESSAGE_PASSING 1 + +#endif /* _SYS_FEATURES_H */ diff --git a/schedsim/rtems/sched_cpu/sys/lock.h b/schedsim/rtems/sched_cpu/sys/lock.h new file mode 100644 index 0000000..d934031 --- /dev/null +++ b/schedsim/rtems/sched_cpu/sys/lock.h @@ -0,0 +1,35 @@ +#ifndef __SYS_LOCK_H__ +#define __SYS_LOCK_H__ + +#include <features.h> + +#define _LIBC 1 +#define NOT_IN_libc 1 + +#ifndef __USE_GNU +#define __USE_GNU 1 +#endif + +#include <bits/libc-lock.h> + +typedef __libc_lock_t _LOCK_T; +typedef __libc_lock_recursive_t _LOCK_RECURSIVE_T; + +#define __LOCK_INIT(class,lock) \ + __libc_lock_define_initialized(class, lock) +#define __LOCK_INIT_RECURSIVE(class, lock) \ + __libc_lock_define_initialized_recursive(class, lock) + +#define __lock_init(__lock) __libc_lock_init(__lock) +#define __lock_init_recursive(__lock) __libc_lock_init_recursive(__lock) +#define __lock_acquire(__lock) __libc_lock_lock(__lock) +#define __lock_acquire_recursive(__lock) __libc_lock_lock_recursive(__lock) +#define __lock_release(__lock) __libc_lock_unlock(__lock) +#define __lock_release_recursive(__lock) __libc_lock_unlock_recursive(__lock) +#define __lock_try_acquire(__lock) __libc_lock_trylock(__lock) +#define __lock_try_acquire_recursive(__lock) \ + __libc_lock_trylock_recursive(__lock) +#define __lock_close(__lock) __libc_lock_fini(__lock) +#define __lock_close_recursive(__lock) __libc_lock_fini_recursive(__lock) + +#endif /* __SYS_LOCK_H__ */ |