mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			CMSIS/RTX: Patch RTX4 to preserve osThreadDef compatibility
mbed OS used older RTX4 version and with osThreadDef accepting only 3
parameters, to preserve compatibility we hardcode the 'instances'
parameter to 1.
(cherry picked from commit 428acae1b2ac15c3ad523e8d40755a9301220822)
(cherry picked from commit 4360b7bbf8)
			
			
				pull/10366/head
			
			
		
							parent
							
								
									00c9005b4e
								
							
						
					
					
						commit
						4edb719624
					
				| 
						 | 
					@ -438,26 +438,25 @@ uint32_t osKernelSysTick (void);
 | 
				
			||||||
/// Create a Thread Definition with function, priority, and stack requirements.
 | 
					/// Create a Thread Definition with function, priority, and stack requirements.
 | 
				
			||||||
/// \param         name          name of the thread function.
 | 
					/// \param         name          name of the thread function.
 | 
				
			||||||
/// \param         priority      initial priority of the thread function.
 | 
					/// \param         priority      initial priority of the thread function.
 | 
				
			||||||
/// \param         instances     number of possible thread instances.
 | 
					 | 
				
			||||||
/// \param         stacksz       stack size (in bytes) requirements for the thread function.
 | 
					/// \param         stacksz       stack size (in bytes) requirements for the thread function.
 | 
				
			||||||
#if defined (osObjectsExternal)  // object is external
 | 
					#if defined (osObjectsExternal)  // object is external
 | 
				
			||||||
#define osThreadDef(name, priority, instances, stacksz) \
 | 
					#define osThreadDef(name, priority, stacksz) \
 | 
				
			||||||
extern const osThreadDef_t os_thread_def_##name
 | 
					extern const osThreadDef_t os_thread_def_##name
 | 
				
			||||||
#else                            // define the object
 | 
					#else                            // define the object
 | 
				
			||||||
#if (osCMSIS < 0x20000U)
 | 
					#if (osCMSIS < 0x20000U)
 | 
				
			||||||
#define osThreadDef(name, priority, instances, stacksz) \
 | 
					#define osThreadDef(name, priority, stacksz) \
 | 
				
			||||||
const osThreadDef_t os_thread_def_##name = \
 | 
					const osThreadDef_t os_thread_def_##name = \
 | 
				
			||||||
{ (name), (priority), (instances), (stacksz) }
 | 
					{ (name), (priority), 1, (stacksz) }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#define osThreadDef(name, priority, instances, stacksz) \
 | 
					#define osThreadDef(name, priority, stacksz) \
 | 
				
			||||||
static uint64_t os_thread_stack##name[(stacksz)?(((stacksz+7)/8)):1] __attribute__((section(".bss.os.thread.stack"))); \
 | 
					uint64_t os_thread_stack##name[(stacksz)?(((stacksz+7)/8)):1] __attribute__((section(".bss.os.thread.stack"))); \
 | 
				
			||||||
static osRtxThread_t os_thread_cb_##name __attribute__((section(".bss.os.thread.cb"))); \
 | 
					static osRtxThread_t os_thread_cb_##name __attribute__((section(".bss.os.thread.cb"))); \
 | 
				
			||||||
const osThreadDef_t os_thread_def_##name = \
 | 
					const osThreadDef_t os_thread_def_##name = \
 | 
				
			||||||
{ (name), \
 | 
					{ (name), \
 | 
				
			||||||
  { NULL, osThreadDetached, \
 | 
					  { NULL, osThreadDetached, \
 | 
				
			||||||
    (instances == 1) ? (&os_thread_cb_##name) : NULL,\
 | 
					    &os_thread_cb_##name,\
 | 
				
			||||||
    (instances == 1) ? osRtxThreadCbSize : 0U, \
 | 
					    osRtxThreadCbSize, \
 | 
				
			||||||
    ((stacksz) && (instances == 1)) ? (&os_thread_stack##name) : NULL, \
 | 
					    (stacksz) ? (&os_thread_stack##name) : NULL, \
 | 
				
			||||||
    8*((stacksz+7)/8), \
 | 
					    8*((stacksz+7)/8), \
 | 
				
			||||||
    (priority), 0U, 0U } }
 | 
					    (priority), 0U, 0U } }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue