Browse Source

Documented the fact that the prefix can prot_call(main) without

worrying about its stack being destroyed during the Etherboot run.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
29340d7728
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      src/arch/i386/transitions/librm.S

+ 9
- 0
src/arch/i386/transitions/librm.S View File

@@ -328,6 +328,15 @@ rm_ds:	.word 0
328 328
  * function explicitly overwrites values in ix86.  Interrupt status
329 329
  * and GDT will also be preserved.  Gate A20 will be enabled.
330 330
  *
331
+ * Note that prot_call() does not rely on the real-mode stack
332
+ * remaining intact in order to return, since everything relevant is
333
+ * copied to the protected-mode stack for the duration of the call.
334
+ * In particular, this means that a real-mode prefix can make a call
335
+ * to main() which will return correctly even if the prefix's stack
336
+ * gets vapourised during the Etherboot run.  (The prefix cannot rely
337
+ * on anything else on the stack being preserved, so should move any
338
+ * critical data to registers before calling main()).
339
+ *
331 340
  * Parameters:
332 341
  *   function : virtual address of protected-mode function to call
333 342
  *

Loading…
Cancel
Save