Adjust indentation for .globl directives.
[pintos-anon] / src / threads / switch.S
index b00823af50044cd4e2cfb0a1f73fbd5802d18fd5..c077e46d590202ef5156ab0d9084d1ea28e6afe2 100644 (file)
@@ -1,6 +1,6 @@
 #include "switch.h"
 
-        .globl switch_threads 
+.globl switch_threads 
 switch_threads:
        # Save caller's register state.
        # Note that the SVR4 ABI allows us to destroy %eax, %ecx, %edx.
@@ -11,7 +11,7 @@ switch_threads:
        pushl %edi
 
        # Get offsetof (struct thread, stack).
-       .globl thread_stack_ofs
+.globl thread_stack_ofs
        mov thread_stack_ofs, %edx
 
        # Save current stack pointer to old thread's stack, if any.
@@ -32,7 +32,16 @@ switch_threads:
        popl %ebx
         ret
 
-       .globl switch_thunk
-switch_thunk:
+.globl switch_entry
+switch_entry:
+       # Discard thread_switch() arguments.
        addl $8, %esp
+
+       # Call schedule_tail(prev).
+       pushl %eax
+.globl schedule_tail
+       call schedule_tail
+       addl $4, %esp
+
+       # Start thread proper.
        ret