mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 02:32:42 -05:00 
			
		
		
		
	Align StackSize and StackAddress for macOS (#674)
This commit is contained in:
		
							parent
							
								
									153e52b729
								
							
						
					
					
						commit
						9149af9a6f
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								portable/ThirdParty/GCC/Posix/port.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								portable/ThirdParty/GCC/Posix/port.c
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -61,6 +61,10 @@
 | 
				
			||||||
#include <sys/times.h>
 | 
					#include <sys/times.h>
 | 
				
			||||||
#include <time.h>
 | 
					#include <time.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef __APPLE__
 | 
				
			||||||
 | 
					    #include <mach/mach_vm.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Scheduler includes. */
 | 
					/* Scheduler includes. */
 | 
				
			||||||
#include "FreeRTOS.h"
 | 
					#include "FreeRTOS.h"
 | 
				
			||||||
#include "task.h"
 | 
					#include "task.h"
 | 
				
			||||||
| 
						 | 
					@ -146,6 +150,11 @@ portSTACK_TYPE * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
				
			||||||
    pxTopOfStack = ( portSTACK_TYPE * ) thread - 1;
 | 
					    pxTopOfStack = ( portSTACK_TYPE * ) thread - 1;
 | 
				
			||||||
    ulStackSize = ( size_t )( pxTopOfStack + 1 - pxEndOfStack ) * sizeof( *pxTopOfStack );
 | 
					    ulStackSize = ( size_t )( pxTopOfStack + 1 - pxEndOfStack ) * sizeof( *pxTopOfStack );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #ifdef __APPLE__
 | 
				
			||||||
 | 
					        pxEndOfStack = mach_vm_round_page ( pxEndOfStack );
 | 
				
			||||||
 | 
					        ulStackSize = mach_vm_trunc_page ( ulStackSize );
 | 
				
			||||||
 | 
					    #endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    thread->pxCode = pxCode;
 | 
					    thread->pxCode = pxCode;
 | 
				
			||||||
    thread->pvParams = pvParameters;
 | 
					    thread->pvParams = pvParameters;
 | 
				
			||||||
    thread->xDying = pdFALSE;
 | 
					    thread->xDying = pdFALSE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue