Skip to content

Commit 90202d2

Browse files
committed
Removing unused rt_OsEventObserver
1 parent 8292aff commit 90202d2

File tree

7 files changed

+0
-153
lines changed

7 files changed

+0
-153
lines changed

rtos/TARGET_CORTEX/rtx5/RTX/Include/rtx_os.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ typedef struct osRtxThread_s {
127127
uint32_t sp; ///< Current Stack Pointer
128128
uint32_t thread_addr; ///< Thread entry address
129129
uint32_t tz_memory; ///< TrustZone Memory Identifier
130-
void *context; ///< Context for OsEventObserver objects
131130
} osRtxThread_t;
132131

133132

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M3/irq_cm3.S

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ SVC_ContextSwitch:
8080
#ifdef FEATURE_UVISOR
8181
CPSID I // The call to the thread switch helper and PSP loading must be atomic.
8282
#endif
83-
/* The call to thread_switch_helper can clobber R2 and R3, but we don't
84-
* want to clobber R2 or R3. We can't save R2 and R3 to the stack (as
85-
* the stack we save them onto is likely to be inaccessible after the
86-
* call to thread_switch_helper). So, we just re-obtain the values from
87-
* osRtxInfo again. */
88-
BL thread_switch_helper
89-
LDR R3,=osRtxInfo+I_T_RUN_OFS // Load address of osRtxInfo.run
90-
LDM R3,{R1,R2} // Load osRtxInfo.thread.run: curr & next
91-
9283
STR R2,[R3] // osRtxInfo.thread.run: curr = next
9384

9485
SVC_ContextRestore:

rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_RTOS_M4_M7/irq_cm4f.S

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,6 @@ SVC_ContextSwitch:
9797
#ifdef FEATURE_UVISOR
9898
CPSID I // The call to the thread switch helper and PSP loading must be atomic.
9999
#endif
100-
/* The call to thread_switch_helper can clobber R2 and R3, but we don't
101-
* want to clobber R2 or R3. We can't save R2 and R3 to the stack (as
102-
* the stack we save them onto is likely to be inaccessible after the
103-
* call to thread_switch_helper). So, we just re-obtain the values from
104-
* osRtxInfo again. */
105-
BL thread_switch_helper
106-
LDR R3,=osRtxInfo+I_T_RUN_OFS // Load address of osRtxInfo.run
107-
LDM R3,{R1,R2} // Load osRtxInfo.thread.run: curr & next
108-
109100
STR R2,[R3] // osRtxInfo.thread.run: curr = next
110101

111102
SVC_ContextRestore:

rtos/TARGET_CORTEX/rtx5/RTX/Source/rt_OsEventObserver.c

Lines changed: 0 additions & 51 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/rt_OsEventObserver.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_kernel.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
*/
2525

2626
#include "rtx_lib.h"
27-
#include "rt_OsEventObserver.h"
28-
2927

3028
// OS Runtime Information
3129
osRtxInfo_t osRtxInfo __attribute__((section(".data.os"))) =
@@ -579,13 +577,6 @@ osStatus_t osKernelStart (void) {
579577
EvrRtxKernelError((int32_t)osErrorISR);
580578
status = osErrorISR;
581579
} else {
582-
/* Call the pre-start event (from unprivileged mode) if the handler exists
583-
* and the kernel is not running. */
584-
/* FIXME osEventObs needs to be readable but not writable from unprivileged
585-
* code. */
586-
if (osKernelGetState() != osKernelRunning && osEventObs && osEventObs->pre_start) {
587-
osEventObs->pre_start();
588-
}
589580
status = __svcKernelStart();
590581
}
591582
return status;

rtos/TARGET_CORTEX/rtx5/RTX/Source/rtx_thread.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525

2626
#include "rtx_lib.h"
27-
#include "rt_OsEventObserver.h"
2827

2928
// OS Runtime Object Memory Usage
3029
#if ((defined(OS_OBJ_MEM_USAGE) && (OS_OBJ_MEM_USAGE != 0)))
@@ -426,17 +425,6 @@ void osRtxThreadSwitch (os_thread_t *thread) {
426425
osRtxInfo.thread.run.next = thread;
427426
osRtxThreadStackCheck();
428427
EvrRtxThreadSwitched(thread);
429-
430-
if (osEventObs && osEventObs->thread_switch) {
431-
osEventObs->thread_switch(thread->context);
432-
}
433-
}
434-
435-
/// Notify the OS event observer of an imminent thread switch.
436-
void thread_switch_helper(void) {
437-
if (osEventObs && osEventObs->thread_switch) {
438-
osEventObs->thread_switch(osRtxInfo.thread.run.next->context);
439-
}
440428
}
441429

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

813-
/* Notify the OS event observer of a new thread. */
814-
if (osEventObs && osEventObs->thread_create) {
815-
thread->context = osEventObs->thread_create((int)thread, context);
816-
} else {
817-
thread->context = context;
818-
}
819-
820801
if (thread != NULL) {
821802
osRtxThreadDispatch(thread);
822803
}
@@ -1326,10 +1307,6 @@ static osStatus_t svcRtxThreadTerminate (osThreadId_t thread_id) {
13261307
break;
13271308
}
13281309

1329-
if (osEventObs && osEventObs->thread_destroy) {
1330-
osEventObs->thread_destroy(thread->context);
1331-
}
1332-
13331310
if (status == osOK) {
13341311
// Release owned Mutexes
13351312
osRtxMutexOwnerRelease(thread->mutex_list);

0 commit comments

Comments
 (0)