Index: kernel/generic/include/context.h
===================================================================
--- kernel/generic/include/context.h	(revision 6ab8697dc506650b8712d1dc5e817cc473bf170a)
+++ kernel/generic/include/context.h	(revision f60a0e4a19f29375456c61b20065121593a984e9)
@@ -51,17 +51,29 @@
 /** Save register context.
  *
- * Save current register context (including stack pointers)
- * to context structure.
- *
- * Note that call to context_restore() will return at the same
+ * Save the current register context (including stack pointer) to a context
+ * structure. A subsequent call to context_restore() will return to the same
  * address as the corresponding call to context_save().
  *
- * This MUST be a macro, gcc -O0 does not inline functions even
- * if they are marked inline and context_save_arch must be called
- * from level <= that when context_restore is called.
+ * Note that context_save_arch() must reuse the stack frame of the function
+ * which called context_save(). We guarantee this by:
  *
- * @param c Context structure.
+ *   a) implementing context_save_arch() in assembly so that it does not create
+ *      its own stack frame, and by
+ *   b) defining context_save() as a macro because the inline keyword is just a
+ *      hint for the compiler, not a real constraint; the application of a macro
+ *      will definitely not create a stack frame either.
  *
- * @return context_save() returns 1, context_restore() returns 0.
+ * To imagine what could happen if there were some extra stack frames created
+ * either by context_save() or context_save_arch(), we need to realize that the
+ * sp saved in the contex_t structure points to the current stack frame as it
+ * existed when context_save_arch() was executing. After the return from
+ * context_save_arch() and context_save(), any extra stack frames created by
+ * these functions will be destroyed and their contents sooner or later
+ * overwritten by functions called next. Any attempt to restore to a context
+ * saved like that would therefore lead to a disaster.
+ *
+ * @param c		Context structure.
+ *
+ * @return		context_save() returns 1, context_restore() returns 0.
  */
 #define context_save(c)   context_save_arch(c)
@@ -69,13 +81,12 @@
 /** Restore register context.
  *
- * Restore previously saved register context (including stack pointers)
- * from context structure.
+ * Restore a previously saved register context (including stack pointer) from
+ * a context structure.
  *
- * Note that this function does not normally return.
- * Instead, it returns at the same address as the
- * corresponding call to context_save(), the only
- * difference being return value.
+ * Note that this function does not normally return.  Instead, it returns to the
+ * same address as the corresponding call to context_save(), the only difference
+ * being return value.
  *
- * @param c Context structure.
+ * @param c		Context structure.
  */
 static inline void context_restore(context_t *c)
