Skip to content

Removing unused rt_OsEventObserver #7635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rtos/TARGET_CORTEX/rtx5/RTX/Include/rtx_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ typedef struct osRtxThread_s {
uint32_t sp; ///< Current Stack Pointer
uint32_t thread_addr; ///< Thread entry address
uint32_t tz_memory; ///< TrustZone Memory Identifier
void *context; ///< Context for OsEventObserver objects
} osRtxThread_t;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ SVC_ContextSwitch:
#ifdef FEATURE_UVISOR
CPSID I // The call to the thread switch helper and PSP loading must be atomic.
#endif
/* The call to thread_switch_helper can clobber R2 and R3, but we don't
* want to clobber R2 or R3. We can't save R2 and R3 to the stack (as
* the stack we save them onto is likely to be inaccessible after the
* call to thread_switch_helper). So, we just re-obtain the values from
* osRtxInfo again. */
BL thread_switch_helper
LDR R3,=osRtxInfo+I_T_RUN_OFS // Load address of osRtxInfo.run
LDM R3,{R1,R2} // Load osRtxInfo.thread.run: curr & next

STR R2,[R3] // osRtxInfo.thread.run: curr = next

SVC_ContextRestore:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ SVC_ContextSwitch:
#ifdef FEATURE_UVISOR
CPSID I // The call to the thread switch helper and PSP loading must be atomic.
#endif
/* The call to thread_switch_helper can clobber R2 and R3, but we don't
* want to clobber R2 or R3. We can't save R2 and R3 to the stack (as
* the stack we save them onto is likely to be inaccessible after the
* call to thread_switch_helper). So, we just re-obtain the values from
* osRtxInfo again. */
BL thread_switch_helper
LDR R3,=osRtxInfo+I_T_RUN_OFS // Load address of osRtxInfo.run
LDM R3,{R1,R2} // Load osRtxInfo.thread.run: curr & next

STR R2,[R3] // osRtxInfo.thread.run: curr = next

SVC_ContextRestore:
Expand Down
51 changes: 0 additions & 51 deletions rtos/TARGET_CORTEX/rtx5/RTX/Source/rt_OsEventObserver.c

This file was deleted.

51 changes: 0 additions & 51 deletions rtos/TARGET_CORTEX/rtx5/RTX/Source/rt_OsEventObserver.h

This file was deleted.

9 changes: 0 additions & 9 deletions rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/

#include "rtx_lib.h"
#include "rt_OsEventObserver.h"


// OS Runtime Information
osRtxInfo_t osRtxInfo __attribute__((section(".data.os"))) =
Expand Down Expand Up @@ -579,13 +577,6 @@ osStatus_t osKernelStart (void) {
EvrRtxKernelError((int32_t)osErrorISR);
status = osErrorISR;
} else {
/* Call the pre-start event (from unprivileged mode) if the handler exists
* and the kernel is not running. */
/* FIXME osEventObs needs to be readable but not writable from unprivileged
* code. */
if (osKernelGetState() != osKernelRunning && osEventObs && osEventObs->pre_start) {
osEventObs->pre_start();
}
status = __svcKernelStart();
}
return status;
Expand Down
23 changes: 0 additions & 23 deletions rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

#include "rtx_lib.h"
#include "rt_OsEventObserver.h"

// OS Runtime Object Memory Usage
#if ((defined(OS_OBJ_MEM_USAGE) && (OS_OBJ_MEM_USAGE != 0)))
Expand Down Expand Up @@ -426,17 +425,6 @@ void osRtxThreadSwitch (os_thread_t *thread) {
osRtxInfo.thread.run.next = thread;
osRtxThreadStackCheck();
EvrRtxThreadSwitched(thread);

if (osEventObs && osEventObs->thread_switch) {
osEventObs->thread_switch(thread->context);
}
}

/// Notify the OS event observer of an imminent thread switch.
void thread_switch_helper(void) {
if (osEventObs && osEventObs->thread_switch) {
osEventObs->thread_switch(osRtxInfo.thread.run.next->context);
}
}

/// Dispatch specified Thread or Ready Thread with Highest Priority.
Expand Down Expand Up @@ -810,13 +798,6 @@ osThreadId_t svcRtxThreadNew (osThreadFunc_t func, void *argument, const osThrea
EvrRtxThreadError(NULL, (int32_t)osErrorNoMemory);
}

/* Notify the OS event observer of a new thread. */
if (osEventObs && osEventObs->thread_create) {
thread->context = osEventObs->thread_create((int)thread, context);
} else {
thread->context = context;
}

if (thread != NULL) {
osRtxThreadDispatch(thread);
}
Expand Down Expand Up @@ -1326,10 +1307,6 @@ static osStatus_t svcRtxThreadTerminate (osThreadId_t thread_id) {
break;
}

if (osEventObs && osEventObs->thread_destroy) {
osEventObs->thread_destroy(thread->context);
}

if (status == osOK) {
// Release owned Mutexes
osRtxMutexOwnerRelease(thread->mutex_list);
Expand Down