dbg_stackkill.S 614 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * arch/alpha/lib/dbg_stackkill.S
  4. * Contributed by Richard Henderson ([email protected])
  5. *
  6. * Clobber the balance of the kernel stack, hoping to catch
  7. * uninitialized local variables in the act.
  8. */
  9. #include <asm/asm-offsets.h>
  10. .text
  11. .set noat
  12. .align 5
  13. .globl _mcount
  14. .ent _mcount
  15. _mcount:
  16. .frame $30, 0, $28, 0
  17. .prologue 0
  18. ldi $0, 0xdeadbeef
  19. lda $2, -STACK_SIZE
  20. sll $0, 32, $1
  21. and $30, $2, $2
  22. or $0, $1, $0
  23. lda $2, TASK_SIZE($2)
  24. cmpult $2, $30, $1
  25. beq $1, 2f
  26. 1: stq $0, 0($2)
  27. addq $2, 8, $2
  28. cmpult $2, $30, $1
  29. bne $1, 1b
  30. 2: ret ($28)
  31. .end _mcount