Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2016-04-13 23:50:25 +0300
committerJoel Sherrill <joel@rtems.org>2016-04-15 16:15:39 +0300
commit85ae35fdb7e541afdaa73b1e8878e7d37a393b58 (patch)
treefca96742fd3ee0e3b8004e9d83d991c6ccaeaba3 /newlib
parentea58e20c0e711591b3b4260a34aef69d8291bcb5 (diff)
libc/sys/rtems/crt0.c: Add <sys/lock.h> symbols required to link autoconf probes
The dummy crt0.c provided by the RTEMS target provides stubs of symbols which would normally be provided by RTEMS. This patch adds stubs for posix_memalign() as well as the synchronization methods prototyped in <sys/lock.h>.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/sys/rtems/crt0.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c
index a6f48f295..8d87fd4cf 100644
--- a/newlib/libc/sys/rtems/crt0.c
+++ b/newlib/libc/sys/rtems/crt0.c
@@ -15,6 +15,7 @@
#include <signal.h> /* sigset_t */
#include <time.h> /* struct timespec */
#include <unistd.h> /* isatty */
+#include <sys/lock.h> /* _Mutex_recursive_Control */
void rtems_provides_crt0( void ) {} /* dummy symbol so file always has one */
@@ -27,7 +28,37 @@ RTEMS_STUB(void *,malloc(size_t s), { return 0; })
RTEMS_STUB(void *,realloc(void* p, size_t s), { return 0; })
RTEMS_STUB(void, free(void* ptr), { })
RTEMS_STUB(_PTR, calloc(size_t s1, size_t s2), { return 0; })
-
+RTEMS_STUB(int, posix_memalign(void **p, size_t si, size_t s2), { return -1; })
+
+/* Stubs for routines from RTEMS <sys/lock.h> */
+RTEMS_STUB(void, _Mutex_Acquire(struct _Mutex_Control *p), { })
+RTEMS_STUB(int, _Mutex_Acquire_timed(struct _Mutex_Control *p1, const struct timespec *p2), { return -1; })
+RTEMS_STUB(int, _Mutex_Try_Acquire(struct _Mutex_Control *p), { return -1; })
+RTEMS_STUB(void, _Mutex_Release(struct _Mutex_Control *p), { })
+
+RTEMS_STUB(void, _Mutex_recursive_Acquire(struct _Mutex_recursive_Control *p), { })
+RTEMS_STUB(int, _Mutex_recursive_Acquire_timed(struct _Mutex_recursive_Control *p1, const struct timespec *p2), { return -1; })
+RTEMS_STUB(int, _Mutex_recursive_Try_acquire(struct _Mutex_recursive_Control *p), { return -1; })
+RTEMS_STUB(void, _Mutex_recursive_Release(struct _Mutex_recursive_Control *p), { })
+
+RTEMS_STUB(void, _Condition_Wait(struct _Condition_Control *p1, struct _Mutex_Control *p2), { })
+RTEMS_STUB(int, _Condition_Wait_timed(struct _Condition_Control *p1, struct _Mutex_Control *p2, const struct timespec *p3), { return -1; })
+RTEMS_STUB(void, _Condition_Wait_recursive(struct _Condition_Control *p1, struct _Mutex_recursive_Control *p2), { })
+RTEMS_STUB(int, _Condition_Wait_recursive_timed(struct _Condition_Control *p1, struct _Mutex_recursive_Control *p2, const struct timespec *p3), { return -1; })
+RTEMS_STUB(void, _Condition_Signal(struct _Condition_Control *p), { })
+RTEMS_STUB(void, _Condition_Broadcast(struct _Condition_Control *p), { })
+
+RTEMS_STUB(void, _Semaphore_Wait(struct _Semaphore_Control *p), { })
+RTEMS_STUB(void, _Semaphore_Post(struct _Semaphore_Control *p), { })
+
+RTEMS_STUB(int, _Futex_Wait(struct _Futex_Control *p1, int *p2, int i), { return -1; })
+RTEMS_STUB(int, _Futex_Wake(struct _Futex_Control *p, int i), { return -1; })
+
+RTEMS_STUB(int, _Sched_Count(void), { return -1; })
+RTEMS_STUB(int, _Sched_Index(void), { return -1; })
+RTEMS_STUB(int, _Sched_Name_to_index(const char *p, size_t s), { return -1; })
+RTEMS_STUB(int, _Sched_Processor_count(int i), { return 1; })
+
#if defined(__GNUC__)
/*
* stubs for libstdc++ rtems-threads support functions from gcc/gthr-rtems.h