summaryrefslogtreecommitdiffstats
path: root/c/src/exec/rtems
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/exec/rtems/include/Makefile.am9
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/Makefile.am19
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/rtemsapi.h4
-rw-r--r--c/src/exec/rtems/inline/rtems/rtems/Makefile.am13
-rw-r--r--c/src/exec/rtems/macros/rtems/rtems/Makefile.am13
-rw-r--r--c/src/exec/rtems/optman/Makefile.am3
-rw-r--r--c/src/exec/rtems/optman/no-mp.c1
-rw-r--r--c/src/exec/rtems/src/Makefile.am5
-rw-r--r--c/src/exec/rtems/src/semdelete.c37
-rw-r--r--c/src/exec/rtems/src/tasks.c8
-rw-r--r--c/src/exec/rtems/src/taskvariableadd.c2
-rw-r--r--c/src/exec/rtems/src/taskvariabledelete.c2
-rw-r--r--c/src/exec/rtems/src/taskvariableget.c2
13 files changed, 56 insertions, 62 deletions
diff --git a/c/src/exec/rtems/include/Makefile.am b/c/src/exec/rtems/include/Makefile.am
index 8935b30100..09e318db3b 100644
--- a/c/src/exec/rtems/include/Makefile.am
+++ b/c/src/exec/rtems/include/Makefile.am
@@ -8,18 +8,15 @@ H_FILES = rtems.h
noinst_HEADERS = $(H_FILES)
-PREINSTALL_FILES = \
-$(PROJECT_INCLUDE) \
-$(noinst_HEADERS:%=$(PROJECT_INCLUDE)/%)
+PREINSTALL_FILES += $(PROJECT_INCLUDE) \
+ $(noinst_HEADERS:%=$(PROJECT_INCLUDE)/%)
$(PROJECT_INCLUDE):
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/%.h: %.h
$(INSTALL_DATA) $< $@
-all-am: $(PREINSTALL_FILES)
-debug-am: $(PREINSTALL_FILES)
-profile-am: $(PREINSTALL_FILES)
+all-local: $(PREINSTALL_FILES)
SUBDIRS = rtems
diff --git a/c/src/exec/rtems/include/rtems/rtems/Makefile.am b/c/src/exec/rtems/include/rtems/rtems/Makefile.am
index b27c67a0e5..f9c8d82fef 100644
--- a/c/src/exec/rtems/include/rtems/rtems/Makefile.am
+++ b/c/src/exec/rtems/include/rtems/rtems/Makefile.am
@@ -5,12 +5,12 @@
AUTOMAKE_OPTIONS = foreign 1.4
## We only build multiprocessing related files if HAS_MP was defined
-MP_H_FILES = eventmp.h mp.h msgmp.h partmp.h regionmp.h semmp.h \
- signalmp.h taskmp.h
+MP_H_FILES = eventmp.h mp.h msgmp.h partmp.h regionmp.h semmp.h signalmp.h \
+ taskmp.h
-STD_H_FILES = asr.h attr.h clock.h config.h dpmem.h event.h eventset.h intr.h \
- message.h modes.h options.h part.h ratemon.h region.h rtemsapi.h sem.h \
- signal.h status.h support.h tasks.h timer.h types.h
+STD_H_FILES = asr.h attr.h clock.h config.h dpmem.h event.h eventset.h \
+ intr.h message.h modes.h options.h part.h ratemon.h region.h rtemsapi.h \
+ sem.h signal.h status.h support.h tasks.h timer.h types.h
if HAS_MP
H_FILES = $(STD_H_FILES) $(MP_H_FILES)
@@ -20,17 +20,14 @@ endif
noinst_HEADERS = $(STD_H_FILES) $(MP_H_FILES)
-PREINSTALL_FILES = \
-$(PROJECT_INCLUDE)/rtems/rtems \
-$(H_FILES:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems \
+ $(H_FILES:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
$(PROJECT_INCLUDE)/rtems/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
-all-am: $(PREINSTALL_FILES)
-debug-am: $(PREINSTALL_FILES)
-profile-am: $(PREINSTALL_FILES)
+all-local: $(PREINSTALL_FILES)
include $(top_srcdir)/../../../automake/local.am
diff --git a/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h b/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
index 6b1cfd8d05..0028cf3980 100644
--- a/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
+++ b/c/src/exec/rtems/include/rtems/rtems/rtemsapi.h
@@ -22,7 +22,9 @@
*
* _RTEMS_API_Initialize
*
- * XXX
+ * This routine initializes the RTEMS API by invoking the initialization
+ * routine for each RTEMS manager with the appropriate parameters
+ * from the configuration_table.
*/
void _RTEMS_API_Initialize(
diff --git a/c/src/exec/rtems/inline/rtems/rtems/Makefile.am b/c/src/exec/rtems/inline/rtems/rtems/Makefile.am
index 44dde4db1b..b8b787a40e 100644
--- a/c/src/exec/rtems/inline/rtems/rtems/Makefile.am
+++ b/c/src/exec/rtems/inline/rtems/rtems/Makefile.am
@@ -6,14 +6,13 @@ AUTOMAKE_OPTIONS = foreign 1.4
if INLINE
I_FILES = asr.inl attr.inl dpmem.inl event.inl eventset.inl message.inl \
- modes.inl options.inl part.inl ratemon.inl \
- region.inl sem.inl status.inl support.inl tasks.inl timer.inl
+ modes.inl options.inl part.inl ratemon.inl region.inl sem.inl status.inl \
+ support.inl tasks.inl timer.inl
noinst_HEADERS = $(I_FILES)
-PREINSTALL_FILES = \
-$(PROJECT_INCLUDE)/rtems/rtems \
-$(noinst_HEADERS:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems \
+ $(noinst_HEADERS:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
$(PROJECT_INCLUDE)/rtems/rtems:
@$(mkinstalldirs) $@
@@ -21,8 +20,6 @@ $(PROJECT_INCLUDE)/rtems/rtems/%.inl: %.inl
$(INSTALL_DATA) $< $@
endif
-all-am: $(PREINSTALL_FILES)
-debug-am: $(PREINSTALL_FILES)
-profile-am: $(PREINSTALL_FILES)
+all-local: $(PREINSTALL_FILES)
include $(top_srcdir)/../../../automake/local.am
diff --git a/c/src/exec/rtems/macros/rtems/rtems/Makefile.am b/c/src/exec/rtems/macros/rtems/rtems/Makefile.am
index 65e0594cfd..dacf3011fe 100644
--- a/c/src/exec/rtems/macros/rtems/rtems/Makefile.am
+++ b/c/src/exec/rtems/macros/rtems/rtems/Makefile.am
@@ -5,16 +5,15 @@
AUTOMAKE_OPTIONS = foreign 1.4
I_FILES = asr.inl attr.inl dpmem.inl event.inl eventset.inl message.inl \
- modes.inl options.inl part.inl ratemon.inl \
- region.inl sem.inl status.inl support.inl tasks.inl timer.inl
+ modes.inl options.inl part.inl ratemon.inl region.inl sem.inl status.inl \
+ support.inl tasks.inl timer.inl
noinst_HEADERS = $(I_FILES)
if MACROS
-PREINSTALL_FILES = \
-$(PROJECT_INCLUDE)/rtems/rtems \
-$(I_FILES:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems \
+ $(I_FILES:%=$(PROJECT_INCLUDE)/rtems/rtems/%)
$(PROJECT_INCLUDE)/rtems/rtems:
@$(mkinstalldirs) $@
@@ -22,8 +21,6 @@ $(PROJECT_INCLUDE)/rtems/rtems/%.inl: %.inl
$(INSTALL_DATA) $< $@
endif
-all-am: $(PREINSTALL_FILES)
-debug-am: $(PREINSTALL_FILES)
-profile-am: $(PREINSTALL_FILES)
+all-local: $(PREINSTALL_FILES)
include $(top_srcdir)/../../../automake/local.am
diff --git a/c/src/exec/rtems/optman/Makefile.am b/c/src/exec/rtems/optman/Makefile.am
index 943e9cb210..dc6c6292b7 100644
--- a/c/src/exec/rtems/optman/Makefile.am
+++ b/c/src/exec/rtems/optman/Makefile.am
@@ -14,7 +14,7 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../automake/lib.am
TMPINSTALL_FILES += \
-$(C_FILES:%.c=$(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel)
+ $(C_FILES:%.c=$(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel)
$(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel: $(ARCH)/%.rel
$(INSTALL_DATA) $< $@
@@ -23,7 +23,6 @@ $(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel: $(ARCH)/%.rel
# (OPTIONAL) Add local stuff here using +=
#
-AM_CFLAGS += $(CFLAGS_OS_V)
ASM4FLAGS += -I$(PROJECT_INCLUDE)/rtems
all-local: ${ARCH} $(PGMS) $(TMPINSTALL_FILES)
diff --git a/c/src/exec/rtems/optman/no-mp.c b/c/src/exec/rtems/optman/no-mp.c
index 5fc8f81df6..6c23d4e923 100644
--- a/c/src/exec/rtems/optman/no-mp.c
+++ b/c/src/exec/rtems/optman/no-mp.c
@@ -156,6 +156,7 @@ Thread _MPCI_Receive_server(
FALSE,
RTEMS_NOT_CONFIGURED
);
+ return NULL;
}
void _MPCI_Announce ( void )
diff --git a/c/src/exec/rtems/src/Makefile.am b/c/src/exec/rtems/src/Makefile.am
index 16d932dc9d..f597292be1 100644
--- a/c/src/exec/rtems/src/Makefile.am
+++ b/c/src/exec/rtems/src/Makefile.am
@@ -42,7 +42,7 @@ SIGNAL_C_FILES = signal.c signalcatch.c signalsend.c
REGION_C_FILES = region.c regioncreate.c regiondelete.c regionextend.c \
regiongetsegment.c regiongetsegmentsize.c regionident.c \
- regionreturnsegment.c regionreturnsegment.c
+ regionreturnsegment.c
PARTITION_C_FILES = part.c partcreate.c partdelete.c partgetbuffer.c \
partident.c partreturnbuffer.c
@@ -70,9 +70,8 @@ OBJS = $(C_O_FILES)
#
AM_CPPFLAGS += -D__RTEMS_INSIDE__
-AM_CFLAGS += $(CFLAGS_OS_V)
-all: ${ARCH} ${OBJS}
+all-local: ${ARCH} ${OBJS}
EXTRA_DIST = $(STD_C_FILES) $(MP_C_FILES)
diff --git a/c/src/exec/rtems/src/semdelete.c b/c/src/exec/rtems/src/semdelete.c
index 1e9b165c71..079d9ed810 100644
--- a/c/src/exec/rtems/src/semdelete.c
+++ b/c/src/exec/rtems/src/semdelete.c
@@ -61,6 +61,12 @@
* error code - if unsuccessful
*/
+#if defined(RTEMS_MULTIPROCESSING)
+#define SEMAPHORE_MP_OBJECT_WAS_DELETED _Semaphore_MP_Send_object_was_deleted
+#else
+#define SEMAPHORE_MP_OBJECT_WAS_DELETED NULL
+#endif
+
rtems_status_code rtems_semaphore_delete(
Objects_Id id
)
@@ -81,32 +87,25 @@ rtems_status_code rtems_semaphore_delete(
return RTEMS_INVALID_ID;
case OBJECTS_LOCAL:
- if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
- if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) ) {
+ if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) {
+ if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) &&
+ !_Attributes_Is_simple_binary_semaphore(
+ the_semaphore->attribute_set ) ) {
_Thread_Enable_dispatch();
return RTEMS_RESOURCE_IN_USE;
}
- else
- _CORE_mutex_Flush(
- &the_semaphore->Core_control.mutex,
-#if defined(RTEMS_MULTIPROCESSING)
- _Semaphore_MP_Send_object_was_deleted,
-#else
- NULL,
-#endif
- CORE_MUTEX_WAS_DELETED
- );
- }
- else
+ _CORE_mutex_Flush(
+ &the_semaphore->Core_control.mutex,
+ SEMAPHORE_MP_OBJECT_WAS_DELETED,
+ CORE_MUTEX_WAS_DELETED
+ );
+ } else {
_CORE_semaphore_Flush(
&the_semaphore->Core_control.semaphore,
-#if defined(RTEMS_MULTIPROCESSING)
- _Semaphore_MP_Send_object_was_deleted,
-#else
- NULL,
-#endif
+ SEMAPHORE_MP_OBJECT_WAS_DELETED,
CORE_SEMAPHORE_WAS_DELETED
);
+ }
_Objects_Close( &_Semaphore_Information, &the_semaphore->Object );
diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c
index 5fdff2db18..40426642c9 100644
--- a/c/src/exec/rtems/src/tasks.c
+++ b/c/src/exec/rtems/src/tasks.c
@@ -105,6 +105,8 @@ User_extensions_routine _RTEMS_tasks_Delete_extension(
next = tvp->next;
if (tvp->dtor)
(*tvp->dtor)( tvp->ptr );
+ if (executing == deleted)
+ *tvp->ptr = tvp->gval;
_Workspace_Free( tvp );
tvp = next;
}
@@ -137,13 +139,15 @@ void _RTEMS_tasks_Switch_extension(
tvp = executing->task_variables;
while (tvp) {
- tvp->var = *tvp->ptr;
+ tvp->tval = *tvp->ptr;
+ *tvp->ptr = tvp->gval;
tvp = tvp->next;
}
tvp = heir->task_variables;
while (tvp) {
- *tvp->ptr = tvp->var;
+ tvp->gval = *tvp->ptr;
+ *tvp->ptr = tvp->tval;
tvp = tvp->next;
}
}
diff --git a/c/src/exec/rtems/src/taskvariableadd.c b/c/src/exec/rtems/src/taskvariableadd.c
index 0f1ae0895e..04d56d409d 100644
--- a/c/src/exec/rtems/src/taskvariableadd.c
+++ b/c/src/exec/rtems/src/taskvariableadd.c
@@ -72,7 +72,7 @@ rtems_status_code rtems_task_variable_add(
_Thread_Enable_dispatch();
return RTEMS_NO_MEMORY;
}
- new->var = 0;
+ new->gval = *ptr;
new->ptr = ptr;
new->dtor = dtor;
diff --git a/c/src/exec/rtems/src/taskvariabledelete.c b/c/src/exec/rtems/src/taskvariabledelete.c
index c760f9ba39..d87a772c18 100644
--- a/c/src/exec/rtems/src/taskvariabledelete.c
+++ b/c/src/exec/rtems/src/taskvariabledelete.c
@@ -53,6 +53,8 @@ rtems_status_code rtems_task_variable_delete(
if (tvp->ptr == ptr) {
if (prev) prev->next = tvp->next;
else the_thread->task_variables = tvp->next;
+ if (_Thread_Is_executing (the_thread))
+ *tvp->ptr = tvp->gval;
_Thread_Enable_dispatch();
_Workspace_Free(tvp);
return RTEMS_SUCCESSFUL;
diff --git a/c/src/exec/rtems/src/taskvariableget.c b/c/src/exec/rtems/src/taskvariableget.c
index 9beb0c4045..cc6e98045c 100644
--- a/c/src/exec/rtems/src/taskvariableget.c
+++ b/c/src/exec/rtems/src/taskvariableget.c
@@ -59,7 +59,7 @@ rtems_status_code rtems_task_variable_get(
* Should this return the current (i.e not the
* saved) value if `tid' is the current task?
*/
- *result = tvp->var;
+ *result = tvp->tval;
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;
}