diff options
Diffstat (limited to 'c/src/lib/libc')
-rw-r--r-- | c/src/lib/libc/error.c | 4 | ||||
-rw-r--r-- | c/src/lib/libc/libio.c | 3 | ||||
-rw-r--r-- | c/src/lib/libc/newlibc.c | 11 | ||||
-rw-r--r-- | c/src/lib/libc/support.c | 15 |
4 files changed, 22 insertions, 11 deletions
diff --git a/c/src/lib/libc/error.c b/c/src/lib/libc/error.c index 8cf46f0565..cfe1858e08 100644 --- a/c/src/lib/libc/error.c +++ b/c/src/lib/libc/error.c @@ -91,8 +91,8 @@ rtems_assoc_t rtems_status_assoc[] = { { "not owner of resource", RTEMS_NOT_OWNER_OF_RESOURCE , }, { "directive not implemented", RTEMS_NOT_IMPLEMENTED, }, { "RTEMS inconsistency detected", RTEMS_INTERNAL_ERROR, }, - { "internal multiprocessing only", RTEMS_PROXY_BLOCKING, }, { "could not get enough memory", RTEMS_NO_MEMORY, }, + { "internal multiprocessing only", THREAD_STATUS_PROXY_BLOCKING, }, { 0, 0, 0 }, }; @@ -134,7 +134,7 @@ static int rtems_verror( if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */ local_errno = errno; - if (_Configuration_Is_multiprocessing()) + if (_System_state_Is_multiprocessing) fprintf(stderr, "[%d] ", _Configuration_MP_table->node); if (rtems_progname && *rtems_progname) diff --git a/c/src/lib/libc/libio.c b/c/src/lib/libc/libio.c index f2046501ce..38e0f83bac 100644 --- a/c/src/lib/libc/libio.c +++ b/c/src/lib/libc/libio.c @@ -14,8 +14,11 @@ #include <rtems/assoc.h> /* assoc.h not included by rtems.h */ #include <fcntl.h> /* O_RDONLY, et.al. */ +#include <sys/fcntl.h> /* O_RDONLY, et.al. */ #if defined(solaris2) #define O_NDELAY O_NONBLOCK +#elif defined(RTEMS_NEWLIB) +#define O_NDELAY _FNBIO #endif #include <errno.h> #include <string.h> /* strcmp */ diff --git a/c/src/lib/libc/newlibc.c b/c/src/lib/libc/newlibc.c index 4493b473da..e041668375 100644 --- a/c/src/lib/libc/newlibc.c +++ b/c/src/lib/libc/newlibc.c @@ -80,11 +80,12 @@ libc_wrapup(void) } -rtems_extension +rtems_boolean libc_create_hook(rtems_tcb *current_task, rtems_tcb *creating_task) { MY_task_set_note(creating_task, LIBC_NOTEPAD, 0); + return TRUE; } /* @@ -231,10 +232,10 @@ libc_init(int reentrant) { memset(&libc_extension, 0, sizeof(libc_extension)); - libc_extension.rtems_task_create = libc_create_hook; - libc_extension.rtems_task_start = libc_start_hook; - libc_extension.task_switch = libc_switch_hook; - libc_extension.rtems_task_delete = libc_delete_hook; + libc_extension.thread_create = libc_create_hook; + libc_extension.thread_start = libc_start_hook; + libc_extension.thread_switch = libc_switch_hook; + libc_extension.thread_delete = libc_delete_hook; rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'), &libc_extension, &extension_id); diff --git a/c/src/lib/libc/support.c b/c/src/lib/libc/support.c index c4e207df0a..13a2d0c2a5 100644 --- a/c/src/lib/libc/support.c +++ b/c/src/lib/libc/support.c @@ -13,8 +13,7 @@ * */ -#include <rtems/system.h> -#include <rtems/thread.h> +#include <rtems.h> void MY_task_set_note( Thread_Control *the_thread, @@ -22,7 +21,11 @@ void MY_task_set_note( unsigned32 note ) { - the_thread->RTEMS_API->Notepads[ notepad ] = note; + RTEMS_API_Control *api; + + api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; + + api->Notepads[ notepad ] = note; } @@ -31,7 +34,11 @@ unsigned32 MY_task_get_note( unsigned32 notepad ) { - return the_thread->RTEMS_API->Notepads[ notepad ]; + RTEMS_API_Control *api; + + api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; + + return api->Notepads[ notepad ]; } void *MY_CPU_Context_FP_start( |