Skip to content

Commit b882548

Browse files
committed
CMSIS/RTX: Allow overwriting mutex ops for ARMC
1 parent cc2e051 commit b882548

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ __attribute__((section(".rodata"))) =
374374
0U,
375375
#endif
376376
{ &os_isr_queue[0], (uint16_t)(sizeof(os_isr_queue)/sizeof(void *)), 0U },
377-
{
377+
{
378378
// Memory Pools (Variable Block Size)
379379
#if ((OS_THREAD_OBJ_MEM != 0) && (OS_THREAD_USER_STACK_SIZE != 0))
380380
&os_thread_stack[0], sizeof(os_thread_stack),
@@ -407,7 +407,7 @@ __attribute__((section(".rodata"))) =
407407
#endif
408408
&os_mpi_thread,
409409
#else
410-
NULL,
410+
NULL,
411411
NULL,
412412
#endif
413413
#if (OS_TIMER_OBJ_MEM != 0)
@@ -490,7 +490,7 @@ __asm void os_cb_sections_wrapper (void) {
490490
EXTERN ||.bss.os.mempool.cb$$Limit|| [WEAK]
491491
EXTERN ||.bss.os.msgqueue.cb$$Base|| [WEAK]
492492
EXTERN ||.bss.os.msgqueue.cb$$Limit|| [WEAK]
493-
493+
494494
AREA ||.rodata||, DATA, READONLY
495495
EXPORT os_cb_sections
496496
os_cb_sections
@@ -676,11 +676,12 @@ typedef void *mutex;
676676
//lint -e818 "Pointer 'm' could be declared as pointing to const"
677677

678678
// Initialize mutex
679+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
679680
__USED
681+
#endif
680682
int _mutex_initialize(mutex *m);
681-
int _mutex_initialize(mutex *m) {
683+
__WEAK int _mutex_initialize(mutex *m) {
682684
int result;
683-
684685
*m = osMutexNew(NULL);
685686
if (*m != NULL) {
686687
result = 1;
@@ -692,26 +693,32 @@ int _mutex_initialize(mutex *m) {
692693
}
693694

694695
// Acquire mutex
696+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
695697
__USED
696-
void _mutex_acquire(mutex *m);
698+
#endif
699+
__WEAK void _mutex_acquire(mutex *m);
697700
void _mutex_acquire(mutex *m) {
698701
if (os_kernel_is_active() != 0U) {
699702
(void)osMutexAcquire(*m, osWaitForever);
700703
}
701704
}
702705

703706
// Release mutex
707+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
704708
__USED
705-
void _mutex_release(mutex *m);
709+
#endif
710+
__WEAK void _mutex_release(mutex *m);
706711
void _mutex_release(mutex *m) {
707712
if (os_kernel_is_active() != 0U) {
708713
(void)osMutexRelease(*m);
709714
}
710715
}
711716

712717
// Free mutex
718+
#if !defined(__ARMCC_VERSION) || __ARMCC_VERSION < 6010050
713719
__USED
714-
void _mutex_free(mutex *m);
720+
#endif
721+
__WEAK void _mutex_free(mutex *m);
715722
void _mutex_free(mutex *m) {
716723
(void)osMutexDelete(*m);
717724
}

0 commit comments

Comments
 (0)