+#if defined(i386)
+ /*
+ * selfpc = pc pushed by mcount call
+ */
+ asm("movl 4(%%ebp),%0" : "=r" (selfpc));
+ /*
+ * frompcindex = pc pushed by jsr into self.
+ * in GCC, the caller's stack frame has already been built, so we
+ * have to chase the base pointer to find caller's raddr.
+ */
+ asm("movl (%%ebp),%0" : "=r" (frompcindex));
+ frompcindex = ((unsigned short **)frompcindex)[1];
+#endif /* i386 */