]> git.hungrycats.org Git - linux/commitdiff
Verify stack more accurately in sparc64 stack overflow
authorDavid S. Miller <davem@nuts.ninka.net>
Wed, 13 Mar 2002 12:06:35 +0000 (04:06 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Wed, 13 Mar 2002 12:06:35 +0000 (04:06 -0800)
debugger by taking the FPU save area depth into
consideration.

arch/sparc64/lib/mcount.S

index 46f00859a0236c9c9d766587b9a4bcfe165ed35f..db5ecf9aa1a49f29e21390187b4b121ef4e75cf0 100644 (file)
@@ -36,7 +36,12 @@ mcount:
        /*
         * Check whether %sp is dangerously low.
         */
-       add             %g6, (TI_FPREGS + 256 + 192), %g5! where does task_struct+frame end?
+       ldub            [%g6 + TI_FPDEPTH], %g1
+       srl             %g1, 1, %g5
+       add             %g5, 1, %g5
+       sllx            %g5, 8, %g5                     ! each fpregs frame is 256b
+       add             %g5, 192, %g5
+       add             %g6, %g5, %g5                   ! where does task_struct+frame end?
        sub             %g5, STACK_BIAS, %g5
        cmp             %sp, %g5
        bg,pt           %xcc, 1f