Sfoglia il codice sorgente

RTX5: changed R/W section names to start with .data/.bss

Robert Rostohar 9 anni fa
parent
commit
d6c28bb60f

+ 29 - 29
CMSIS/RTOS2/RTX/Include/rtx_config.h

@@ -59,30 +59,30 @@
 
 // Thread Control Blocks
 static os_thread_t os_thread_cb[OS_THREAD_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.thread.cb")));
 
 // Thread Default Stack
 #if (OS_THREAD_DEF_STACK_NUM != 0)
 static uint64_t os_thread_def_stack[OS_THREAD_DEF_STACK_NUM*(OS_STACK_SIZE/8)] \
-__attribute__((section(".os.object.stack")));
+__attribute__((section(".bss.os.thread.stack")));
 #endif
 
 // Memory Pool for Thread Control Blocks
 static os_mp_info_t os_mpi_thread \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.thread.mpi"))) =
 { (uint32_t)OS_THREAD_NUM, 0U, (uint32_t)os_ThreadCbSize, &os_thread_cb, NULL, NULL };
 
 // Memory Pool for Thread Default Stack
 #if (OS_THREAD_DEF_STACK_NUM != 0)
 static os_mp_info_t os_mpi_def_stack \
-__attribute__((section(".os.object.stack"))) =
+__attribute__((section(".bss.os.thread.mpi"))) =
 { (uint32_t)OS_THREAD_DEF_STACK_NUM, 0U, (uint32_t)OS_STACK_SIZE, &os_thread_def_stack, NULL, NULL };
 #endif
 
 // Memory Pool for Thread Stack
 #if (OS_THREAD_USER_STACK_SIZE != 0)
 static uint64_t os_thread_stack[OS_THREAD_USER_STACK_SIZE/8] \
-__attribute__((section(".os.object.stack")));
+__attribute__((section(".bss.os.thread.stack")));
 #endif
 
 #endif  // (OS_THREAD_OBJ_MEM != 0)
@@ -98,11 +98,11 @@ void os_ThreadStackCheck (void) {}
 
 // Idle Thread Control Block
 static os_thread_t os_idle_thread_cb \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.thread.cb")));
 
 // Idle Thread Stack
 static uint64_t os_idle_thread_stack[OS_IDLE_THREAD_STACK_SIZE/8] \
-__attribute__((section(".os.object.stack")));
+__attribute__((section(".bss.os.thread.stack")));
 
 // Idle Thread Attributes
 static const osThreadAttr_t os_idle_thread_attr = {
@@ -128,11 +128,11 @@ static const osThreadAttr_t os_idle_thread_attr = {
 
 // Timer Control Blocks
 static os_timer_t os_timer_cb[OS_TIMER_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.timer.cb")));
 
 // Memory Pool for Timer Control Blocks
 static os_mp_info_t os_mpi_timer \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.timer.mpi"))) =
 { (uint32_t)OS_TIMER_NUM, 0U, (uint32_t)os_TimerCbSize, &os_timer_cb, NULL, NULL };
 
 #endif  // (OS_TIMER_OBJ_MEM != 0)
@@ -146,11 +146,11 @@ __attribute__((section(".os.object.cb"))) =
 
 // Timer Thread Control Block
 static os_thread_t os_timer_thread_cb \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.thread.cb")));
 
 // Timer Thread Stack
 static uint64_t os_timer_thread_stack[OS_TIMER_THREAD_STACK_SIZE/8] \
-__attribute__((section(".os.object.stack")));
+__attribute__((section(".bss.os.thread.stack")));
 
 // Timer Thread Attributes
 static const osThreadAttr_t os_timer_thread_attr = {
@@ -166,11 +166,11 @@ static const osThreadAttr_t os_timer_thread_attr = {
 
 // Timer Message Queue Control Block
 static os_message_queue_t os_timer_mq_cb \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.msgqueue.cb")));
 
 // Timer Message Queue Data
 static uint32_t os_timer_mq_data[os_MessageQueueMemSize(OS_TIMER_CB_QUEUE,8)/4] \
-__attribute__((section(".os.object.data")));
+__attribute__((section(".bss.os.msgqueue.mem")));
 
 // Timer Message Queue Attributes
 static const osMessageQueueAttr_t os_timer_mq_attr = {
@@ -196,11 +196,11 @@ static const osMessageQueueAttr_t os_timer_mq_attr = {
 
 // Event Flags Control Blocks
 static os_event_flags_t os_ef_cb[OS_EVFLAGS_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.evflags.cb")));
 
 // Memory Pool for Event Flags Control Blocks
 static os_mp_info_t os_mpi_ef \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.evflags.mpi"))) =
 { (uint32_t)OS_EVFLAGS_NUM, 0U, (uint32_t)os_EventFlagsCbSize, &os_ef_cb, NULL, NULL };
 
 #endif  // (OS_EVFLAGS_OBJ_MEM != 0)
@@ -217,11 +217,11 @@ __attribute__((section(".os.object.cb"))) =
 
 // Mutex Control Blocks
 static os_mutex_t os_mutex_cb[OS_MUTEX_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.mutex.cb")));
 
 // Memory Pool for Mutex Control Blocks
 static os_mp_info_t os_mpi_mutex \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.mutex.mpi"))) =
 { (uint32_t)OS_MUTEX_NUM, 0U, (uint32_t)os_MutexCbSize, &os_mutex_cb, NULL, NULL };
 
 #endif  // (OS_MUTEX_OBJ_MEM != 0)
@@ -238,11 +238,11 @@ __attribute__((section(".os.object.cb"))) =
 
 // Semaphore Control Blocks
 static os_semaphore_t os_semaphore_cb[OS_SEMAPHORE_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.semaphore.cb")));
 
 // Memory Pool for Semaphore Control Blocks
 static os_mp_info_t os_mpi_semaphore \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.semaphore.mpi"))) =
 { (uint32_t)OS_SEMAPHORE_NUM, 0U, (uint32_t)os_SemaphoreCbSize, &os_semaphore_cb, NULL, NULL };
 
 #endif  // (OS_SEMAPHORE_OBJ_MEM != 0)
@@ -259,11 +259,11 @@ __attribute__((section(".os.object.cb"))) =
 
 // Memory Pool Control Blocks
 static os_memory_pool_t os_mp_cb[OS_MEMPOOL_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.mempool.cb")));
 
 // Memory Pool for Memory Pool Control Blocks
 static os_mp_info_t os_mpi_mp \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.mempool.mpi"))) =
 { (uint32_t)OS_MEMPOOL_NUM, 0U, (uint32_t)os_MemoryPoolCbSize, &os_mp_cb, NULL, NULL };
 
 // Memory Pool for Memory Pool Data Storage
@@ -272,7 +272,7 @@ __attribute__((section(".os.object.cb"))) =
 #error "Invalid Data Memory size for Memory Pools!"
 #endif
 static uint32_t os_mp_data[OS_MEMPOOL_DATA_SIZE/4] \
-__attribute__((section(".os.object.data")));
+__attribute__((section(".bss.os.mempool.mem")));
 #endif
 
 #endif  // (OS_MEMPOOL_OBJ_MEM != 0)
@@ -289,11 +289,11 @@ __attribute__((section(".os.object.data")));
 
 // Message Queue Control Blocks
 static os_message_queue_t os_mq_cb[OS_MSGQUEUE_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os.msgqueue.cb")));
 
 // Memory Pool for Message Queue Control Blocks
 static os_mp_info_t os_mpi_mq \
-__attribute__((section(".os.object.cb"))) =
+__attribute__((section(".bss.os.msgqueue.mpi"))) =
 { (uint32_t)OS_MSGQUEUE_NUM, 0U, (uint32_t)os_MessageQueueCbSize, &os_mq_cb, NULL, NULL };
 
 // Memory Pool for Message Queue Data Storage
@@ -302,7 +302,7 @@ __attribute__((section(".os.object.cb"))) =
 #error "Invalid Data Memory size for Message Queues!"
 #endif
 static uint32_t os_mq_data[OS_MSGQUEUE_DATA_SIZE/4] \
-__attribute__((section(".os.object.data")));
+__attribute__((section(".bss.os.msgqueue.mem")));
 #endif
 
 #endif  // (OS_MSGQUEUE_OBJ_MEM != 0)
@@ -317,12 +317,12 @@ __attribute__((section(".os.object.data")));
 #error "Invalid Dynamic Memory size!"
 #endif
 static uint64_t os_mem[OS_DYNAMIC_MEM_SIZE/8] \
-__attribute__((section(".os.object")));
+__attribute__((section(".bss.os")));
 #endif
 
 // ISR FIFO Queue
 static void *os_isr_queue[OS_ISR_FIFO_QUEUE] \
-__attribute__((section(".os.data")));
+__attribute__((section(".bss.os")));
 
 
 // OS Configuration
@@ -464,11 +464,11 @@ void software_init_hook (void) {
 
 // Memory for libspace
 static uint32_t os_libspace[OS_THREAD_LIBSPACE_NUM+1][LIBSPACE_SIZE/sizeof(uint32_t)] \
-__attribute__((section(".os.object.data")));
+__attribute__((section(".bss.os")));
 
 // Thread IDs for libspace
 static uint32_t os_libspace_id[OS_THREAD_LIBSPACE_NUM] \
-__attribute__((section(".os.object.cb")));
+__attribute__((section(".bss.os")));
 
 // Check if Kernel has been started
 static uint32_t os_kernel_is_active (void) {

+ 14 - 14
CMSIS/RTOS2/RTX/Include1/cmsis_os.h

@@ -419,8 +419,8 @@ const osThreadDef_t os_thread_def_##name = \
 { (name), (priority), (instances), (stacksz) }
 #else
 #define osThreadDef(name, priority, instances, stacksz) \
-static uint64_t os_thread_stack##name[(stacksz)?(((stacksz+7)/8)):1] __attribute__((section(".os.object.stack"))); \
-static os_thread_t os_thread_cb_##name __attribute__((section(".os.object.cb"))); \
+static uint64_t os_thread_stack##name[(stacksz)?(((stacksz+7)/8)):1] __attribute__((section(".bss.os.thread.stack"))); \
+static os_thread_t os_thread_cb_##name __attribute__((section(".bss.os.thread.cb"))); \
 const osThreadDef_t os_thread_def_##name = \
 { (name), \
   { NULL, osThreadDetached, \
@@ -532,7 +532,7 @@ extern const osTimerDef_t os_timer_def_##name
 const osTimerDef_t os_timer_def_##name = { (function) }
 #else
 #define osTimerDef(name, function) \
-static os_timer_t os_timer_cb_##name __attribute__((section(".os.object.cb"))); \
+static os_timer_t os_timer_cb_##name __attribute__((section(".bss.os.timer.cb"))); \
 const osTimerDef_t os_timer_def_##name = \
 { (function), { NULL, 0U, (&os_timer_cb_##name), os_TimerCbSize } }
 #endif
@@ -586,7 +586,7 @@ extern const osMutexDef_t os_mutex_def_##name
 const osMutexDef_t os_mutex_def_##name = { 0 }
 #else
 #define osMutexDef(name) \
-static os_mutex_t os_mutex_cb_##name __attribute__((section(".os.object.cb"))); \
+static os_mutex_t os_mutex_cb_##name __attribute__((section(".bss.os.mutex.cb"))); \
 const osMutexDef_t os_mutex_def_##name = \
 { NULL, osMutexRecursive | osMutexPrioInherit | osMutexRobust, (&os_mutex_cb_##name), os_MutexCbSize }
 #endif
@@ -642,7 +642,7 @@ extern const osSemaphoreDef_t os_semaphore_def_##name
 const osSemaphoreDef_t os_semaphore_def_##name = { 0 }
 #else
 #define osSemaphoreDef(name) \
-static os_semaphore_t os_semaphore_cb_##name __attribute__((section(".os.object.cb"))); \
+static os_semaphore_t os_semaphore_cb_##name __attribute__((section(".bss.os.semaphore.cb"))); \
 const osSemaphoreDef_t os_semaphore_def_##name = \
 { NULL, 0U, (&os_semaphore_cb_##name), os_SemaphoreCbSize }
 #endif
@@ -700,8 +700,8 @@ const osPoolDef_t os_pool_def_##name = \
 { (no), sizeof(type), NULL }
 #else
 #define osPoolDef(name, no, type) \
-static os_memory_pool_t os_mp_cb_##name __attribute__((section(".os.object.cb"))); \
-static uint32_t os_mp_data_##name[os_MemoryPoolMemSize((no),sizeof(type))/4] __attribute__((section(".os.object.data"))); \
+static os_memory_pool_t os_mp_cb_##name __attribute__((section(".bss.os.mempool.cb"))); \
+static uint32_t os_mp_data_##name[os_MemoryPoolMemSize((no),sizeof(type))/4] __attribute__((section(".bss.os.mempool.mem"))); \
 const osPoolDef_t os_pool_def_##name = \
 { (no), sizeof(type), \
   { NULL, 0U, (&os_mp_cb_##name), os_MemoryPoolCbSize, \
@@ -756,8 +756,8 @@ const osMessageQDef_t os_messageQ_def_##name = \
 { (queue_sz), NULL }
 #else
 #define osMessageQDef(name, queue_sz, type) \
-static os_message_queue_t os_mq_cb_##name __attribute__((section(".os.object.cb"))); \
-static uint32_t os_mq_data_##name[os_MessageQueueMemSize((queue_sz),sizeof(uint32_t))/4] __attribute__((section(".os.object.data"))); \
+static os_message_queue_t os_mq_cb_##name __attribute__((section(".bss.os.msgqueue.cb"))); \
+static uint32_t os_mq_data_##name[os_MessageQueueMemSize((queue_sz),sizeof(uint32_t))/4] __attribute__((section(".bss.os.msgqueue.mem"))); \
 const osMessageQDef_t os_messageQ_def_##name = \
 { (queue_sz), \
   { NULL, 0U, (&os_mq_cb_##name), os_MessageQueueCbSize, \
@@ -810,11 +810,11 @@ const osMailQDef_t os_mailQ_def_##name = \
 { (queue_sz), sizeof(type), NULL }
 #else
 #define osMailQDef(name, queue_sz, type) \
-static void              *os_mail_p_##name[2]  __attribute__((section(".os.object.cb"))); \
-static os_memory_pool_t   os_mail_mp_cb_##name __attribute__((section(".os.object.cb"))); \
-static os_message_queue_t os_mail_mq_cb_##name __attribute__((section(".os.object.cb"))); \
-static uint32_t os_mail_mp_data_##name[os_MemoryPoolMemSize  ((queue_sz),sizeof(type))/4] __attribute__((section(".os.object.data"))); \
-static uint32_t os_mail_mq_data_##name[os_MessageQueueMemSize((queue_sz),sizeof(type))/4] __attribute__((section(".os.object.data"))); \
+static void              *os_mail_p_##name[2]  __attribute__((section(".bss.os"))); \
+static os_memory_pool_t   os_mail_mp_cb_##name __attribute__((section(".bss.os.mempool.cb"))); \
+static os_message_queue_t os_mail_mq_cb_##name __attribute__((section(".bss.os.msgqueue.cb"))); \
+static uint32_t os_mail_mp_data_##name[os_MemoryPoolMemSize  ((queue_sz),sizeof(type))/4] __attribute__((section(".bss.os.mempool.mem"))); \
+static uint32_t os_mail_mq_data_##name[os_MessageQueueMemSize((queue_sz),sizeof(type))/4] __attribute__((section(".bss.os.msgqueue.mem"))); \
 const osMailQDef_t os_mailQ_def_##name = \
 { (queue_sz), sizeof(type), (&os_mail_p_##name), \
   { NULL, 0U, (&os_mail_mp_cb_##name), os_MemoryPoolCbSize, \

+ 1 - 1
CMSIS/RTOS2/RTX/Source/rtx_kernel.c

@@ -27,7 +27,7 @@
 
 
 //  OS Runtime Information
-os_info_t os_Info __attribute__((section(".os.data"))) =
+os_info_t os_Info __attribute__((section(".data.os"))) =
 { .os_id = os_KernelId, .version = os_CMSIS_RTX, .kernel.state = os_KernelInactive };
 
 //  Library reference to irq_cm module