From 3836cfc77ccaace693f83be1ed5a290bce26e564 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 20 Jan 2005 07:35:50 +0000 Subject: [PATCH] Improve debuggability by adding .func/.endfunc around functions. --- grading/userprog/null.S | 4 +++- src/threads/start.S | 9 ++++++--- src/threads/switch.S | 8 ++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/grading/userprog/null.S b/grading/userprog/null.S index e4f7e3a..ded0e59 100644 --- a/grading/userprog/null.S +++ b/grading/userprog/null.S @@ -1,3 +1,5 @@ - .globl _start +.globl _start +.func _start _start: int $0x30 +.endfunc diff --git a/src/threads/start.S b/src/threads/start.S index df63f85..5a495c4 100644 --- a/src/threads/start.S +++ b/src/threads/start.S @@ -4,10 +4,13 @@ #### so that this module appears at the very beginning of the kernel #### image, and then using that as the entry point. -.globl start .section .start - + +.globl start +.func start + # Call main. start: call main - # If main returns, spin. + # main() should not return, but if it does, spin. 1: jmp 1b +.endfunc diff --git a/src/threads/switch.S b/src/threads/switch.S index 4f0d412..f58c4a8 100644 --- a/src/threads/switch.S +++ b/src/threads/switch.S @@ -12,9 +12,10 @@ #### restore the registers. As part of switching stacks we record the #### current stack pointer in CUR's thread structure. - .intel_syntax noprefix +.intel_syntax noprefix -.globl switch_threads +.globl switch_threads +.func switch_threads switch_threads: # Save caller's register state. # @@ -49,8 +50,10 @@ switch_threads: pop ebp pop ebx ret +.endfunc .globl switch_entry +.func switch_entry switch_entry: # Discard switch_threads() arguments. add esp, 8 @@ -63,3 +66,4 @@ switch_entry: # Start thread proper. ret +.endfunc -- 2.30.2