davids5 commented on a change in pull request #1369:
URL: https://github.com/apache/incubator-nuttx/pull/1369#discussion_r487162566



##########
File path: arch/arm/src/arm/arm_initialstate.c
##########
@@ -52,13 +52,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
+#define IDLETHREAD_STACKMARGIN    128

Review comment:
       Well the assembly code works. and it is not portable. 
   
   I did not consider e.g. AddressSanitizer, Stack Smashing Protector. - So you 
may be correct this may not work. 
   
   **Please Note: Fill the stack ONLY with the fill value as defined from 
before or you will break all the monitors.**
   
   
   Here is how I was looking at it. 1) I Draw a picture of the stack frame
   [    ]
   [    ]
   [    ]
   [    ]<---At the function
   [ marker1]
   [    ]
   [ what is here or not does not matter  ]
   [    ]
   [ marker2 ]
   [    ] <- the allocation
   
   if the compiler messes with you and it looks like this, does not matter.
   
   [ marker2]
   [    ]
   [ what is here or not does not matter  ]
   [    ]
   [ marker1 ]
   [    ] <- the allocation
   
   safe = min of (&marker2, &marker1) word gets you the lowest point on the 
stack you can write to,
   
   DO NOT Use MEMSET! (it will not write the correct pattern, and you already 
know the call it a problem) Use a for() with the appropriate sized type 
   
   Set the start address and write from bottom up or top down from  or to 
`safe`.
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to