From 162448f06b730166c2b1ec06ab202f31d4143ed8 Mon Sep 17 00:00:00 2001
From: Richard Barry <ribarry@amazon.com>
Date: Mon, 4 Aug 2014 07:57:18 +0000
Subject: [PATCH] General maintenance - changing comments and correcting
 spellings only.

---
 .../Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c     | 4 ++++
 FreeRTOS/Source/include/portable.h                           | 2 +-
 FreeRTOS/Source/include/projdefs.h                           | 2 +-
 FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s        | 5 +++++
 FreeRTOS/Source/tasks.c                                      | 4 +++-
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
index 2b3e22157..d120401c1 100644
--- a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
+++ b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/Sample-CLI-commands.c
@@ -89,6 +89,10 @@
 	#define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0
 #endif
 
+/*
+ * The function that registers the commands that are defined within this file.
+ */
+void vRegisterSampleCLICommands( void );
 
 /*
  * Implements the task-stats command.
diff --git a/FreeRTOS/Source/include/portable.h b/FreeRTOS/Source/include/portable.h
index 619daf9a7..f63e1a599 100644
--- a/FreeRTOS/Source/include/portable.h
+++ b/FreeRTOS/Source/include/portable.h
@@ -322,7 +322,7 @@ to find the path to the correct portmacro.h file. */
 #endif
 
 #if portBYTE_ALIGNMENT == 8
-	#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
+	#define portBYTE_ALIGNMENT_MASK ( 0x0007U )
 #endif
 
 #if portBYTE_ALIGNMENT == 4
diff --git a/FreeRTOS/Source/include/projdefs.h b/FreeRTOS/Source/include/projdefs.h
index 2d12bd719..ab13a62e1 100644
--- a/FreeRTOS/Source/include/projdefs.h
+++ b/FreeRTOS/Source/include/projdefs.h
@@ -72,7 +72,7 @@
  */
 typedef void (*TaskFunction_t)( void * );
 
-/* Converts a time in miliseconds to a time in ticks. */
+/* Converts a time in milliseconds to a time in ticks. */
 #define pdMS_TO_TICKS( xTimeInMs ) ( ( ( TickType_t ) xTimeInMs * configTICK_RATE_HZ ) / ( TickType_t ) 1000 )
 
 #define pdFALSE			( ( BaseType_t ) 0 )
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s b/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s
index b2a4f708c..d61b79606 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s
+++ b/FreeRTOS/Source/portable/IAR/ARM_CA5_No_GIC/portASM.s
@@ -90,6 +90,9 @@ FreeRTOS_SWI_Handler
 ; vPortRestoreTaskContext is used to start the scheduler.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 vPortRestoreTaskContext
+
+	PRESERVE8
+
 	; Switch to system mode
 	CPS		#SYS_MODE
 	portRESTORE_CONTEXT
@@ -99,6 +102,8 @@ vPortRestoreTaskContext
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 FreeRTOS_IRQ_Handler
 
+	PRESERVE8
+
 	; Return to the interrupted instruction.
 	SUB		lr, lr, #4
 
diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c
index 1ef6523c9..7f03fa9bf 100644
--- a/FreeRTOS/Source/tasks.c
+++ b/FreeRTOS/Source/tasks.c
@@ -2151,11 +2151,13 @@ void vTaskSwitchContext( void )
 		}
 		#endif /* configGENERATE_RUN_TIME_STATS */
 
+		/* Check for stack overflow, if configured. */
 		taskFIRST_CHECK_FOR_STACK_OVERFLOW();
 		taskSECOND_CHECK_FOR_STACK_OVERFLOW();
 
+		/* Select a new task to run using either the generic C or port
+		optimised asm code. */
 		taskSELECT_HIGHEST_PRIORITY_TASK();
-
 		traceTASK_SWITCHED_IN();
 
 		#if ( configUSE_NEWLIB_REENTRANT == 1 )