]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Added in several quality-of-life needed patches.
authorDavid Devecsery <ddevec@gatech.edu>
Thu, 21 May 2020 13:26:54 +0000 (09:26 -0400)
committerDavid Devecsery <ddevec@gatech.edu>
Thu, 21 May 2020 13:26:54 +0000 (09:26 -0400)
CMakeLists.txt
include/asm/x86.h

index 4327ef2692771efdc00887c623a8db4e395abdb0..8972f2ef0096f3e3551eef76b0deef1f5c97858a 100644 (file)
@@ -6,8 +6,9 @@ endif()
 
 project(xv6)
 
-#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -MD -gstabs+ -Werror -fno-omit-frame-pointer -fno-stack-protector")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -Wall -fno-builtin -gstabs -Werror -fno-omit-frame-pointer -fno-stack-protector")
+# Lab1 only
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-optimize-sibling-calls -fno-lto")
 
 set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-O0 -gstabs")
index 4f8057004d339c717d0d579de844fe67d386d9fb..c25bf6b11053c6033ef263dee0dbd3c5cba020cb 100644 (file)
@@ -103,17 +103,12 @@ readeflags(void)
   return eflags;
 }
 
-// This needs to be always inlined, otherwise the ebp is modified
-static __inline uint
-read_ebp(void)
-{
-  uint ebp;
-  // Force the prologue before ebp
-  __asm __volatile("" : : :"memory");
-  __asm __volatile("movl %%ebp,%0" : "=r" (ebp));
-
-  return ebp;
-}
+// This is a define, so its always inlined
+#define read_ebp(dest) do { \
+    __asm __volatile("" : : : "memory"); \
+    __asm __volatile("movl %%ebp,%0" : "=r" (dest)); \
+    __asm __volatile("" : : : "memory"); \
+  } while (0)
 
 static inline void
 loadgs(ushort v)