backtrace: Avoid GCC warning on x86-64.
authorBen Pfaff <blp@nicira.com>
Fri, 6 Nov 2009 18:25:50 +0000 (10:25 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 9 Nov 2009 18:30:10 +0000 (10:30 -0800)
The portable implementation of stack_low(), which before this commit is
used on x86-64, provokes a warning from GCC that cannot be disabled.  We
already have an i386-specific implementation that does not warn; this
commit adds a corresponding implementation for x86-64 to avoid the warning
there too.

lib/backtrace.c

index 42ab8c4..2f47809 100644 (file)
@@ -73,6 +73,10 @@ stack_low(void)
     uintptr_t low;
     asm("movl %%esp,%0" : "=g" (low));
     return low;
+#elif __x86_64__
+    uintptr_t low;
+    asm("movq %%rsp,%0" : "=g" (low));
+    return low;
 #else
     /* This causes a warning in GCC that cannot be disabled, so use it only on
      * non-x86. */