mn10300-watchdog-low.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ###############################################################################
  2. #
  3. # MN10300 Watchdog interrupt handler
  4. #
  5. # Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  6. # Written by David Howells (dhowells@redhat.com)
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public Licence
  10. # as published by the Free Software Foundation; either version
  11. # 2 of the Licence, or (at your option) any later version.
  12. #
  13. ###############################################################################
  14. #include <linux/sys.h>
  15. #include <linux/linkage.h>
  16. #include <asm/intctl-regs.h>
  17. #include <asm/timer-regs.h>
  18. #include <asm/frame.inc>
  19. #include <linux/threads.h>
  20. .text
  21. ###############################################################################
  22. #
  23. # Watchdog handler entry point
  24. # - special non-maskable interrupt
  25. #
  26. ###############################################################################
  27. .globl watchdog_handler
  28. .type watchdog_handler,@function
  29. watchdog_handler:
  30. add -4,sp
  31. SAVE_ALL
  32. mov 0xffffffff,d0
  33. mov d0,(REG_ORIG_D0,fp)
  34. mov fp,d0
  35. lsr 2,d1
  36. call watchdog_interrupt[],0 # watchdog_interrupt(regs,irq)
  37. jmp ret_from_intr
  38. .size watchdog_handler,.-watchdog_handler
  39. ###############################################################################
  40. #
  41. # Watchdog touch entry point
  42. # - kept to absolute minimum (unfortunately, it's prototyped in linux/nmi.h so
  43. # we can't inline it)
  44. #
  45. ###############################################################################
  46. .globl touch_nmi_watchdog
  47. .type touch_nmi_watchdog,@function
  48. touch_nmi_watchdog:
  49. clr d0
  50. clr d1
  51. mov watchdog_alert_counter, a0
  52. setlb
  53. mov d0, (a0+)
  54. inc d1
  55. cmp NR_CPUS, d1
  56. lne
  57. ret [],0
  58. .size touch_nmi_watchdog,.-touch_nmi_watchdog