vm_events.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Mostly IRQ support for Hexagon
  3. *
  4. * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 and
  8. * only version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. * 02110-1301, USA.
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/sched/debug.h>
  22. #include <asm/registers.h>
  23. #include <linux/irq.h>
  24. #include <linux/hardirq.h>
  25. /*
  26. * show_regs - print pt_regs structure
  27. * @regs: pointer to pt_regs
  28. *
  29. * To-do: add all the accessor definitions to registers.h
  30. *
  31. * Will make this routine a lot easier to write.
  32. */
  33. void show_regs(struct pt_regs *regs)
  34. {
  35. show_regs_print_info(KERN_EMERG);
  36. printk(KERN_EMERG "restart_r0: \t0x%08lx syscall_nr: %ld\n",
  37. regs->restart_r0, regs->syscall_nr);
  38. printk(KERN_EMERG "preds: \t\t0x%08lx\n", regs->preds);
  39. printk(KERN_EMERG "lc0: \t0x%08lx sa0: 0x%08lx m0: 0x%08lx\n",
  40. regs->lc0, regs->sa0, regs->m0);
  41. printk(KERN_EMERG "lc1: \t0x%08lx sa1: 0x%08lx m1: 0x%08lx\n",
  42. regs->lc1, regs->sa1, regs->m1);
  43. printk(KERN_EMERG "gp: \t0x%08lx ugp: 0x%08lx usr: 0x%08lx\n",
  44. regs->gp, regs->ugp, regs->usr);
  45. printk(KERN_EMERG "cs0: \t0x%08lx cs1: 0x%08lx\n",
  46. regs->cs0, regs->cs1);
  47. printk(KERN_EMERG "r0: \t0x%08lx %08lx %08lx %08lx\n", regs->r00,
  48. regs->r01,
  49. regs->r02,
  50. regs->r03);
  51. printk(KERN_EMERG "r4: \t0x%08lx %08lx %08lx %08lx\n", regs->r04,
  52. regs->r05,
  53. regs->r06,
  54. regs->r07);
  55. printk(KERN_EMERG "r8: \t0x%08lx %08lx %08lx %08lx\n", regs->r08,
  56. regs->r09,
  57. regs->r10,
  58. regs->r11);
  59. printk(KERN_EMERG "r12: \t0x%08lx %08lx %08lx %08lx\n", regs->r12,
  60. regs->r13,
  61. regs->r14,
  62. regs->r15);
  63. printk(KERN_EMERG "r16: \t0x%08lx %08lx %08lx %08lx\n", regs->r16,
  64. regs->r17,
  65. regs->r18,
  66. regs->r19);
  67. printk(KERN_EMERG "r20: \t0x%08lx %08lx %08lx %08lx\n", regs->r20,
  68. regs->r21,
  69. regs->r22,
  70. regs->r23);
  71. printk(KERN_EMERG "r24: \t0x%08lx %08lx %08lx %08lx\n", regs->r24,
  72. regs->r25,
  73. regs->r26,
  74. regs->r27);
  75. printk(KERN_EMERG "r28: \t0x%08lx %08lx %08lx %08lx\n", regs->r28,
  76. regs->r29,
  77. regs->r30,
  78. regs->r31);
  79. printk(KERN_EMERG "elr: \t0x%08lx cause: 0x%08lx user_mode: %d\n",
  80. pt_elr(regs), pt_cause(regs), user_mode(regs));
  81. printk(KERN_EMERG "psp: \t0x%08lx badva: 0x%08lx int_enabled: %d\n",
  82. pt_psp(regs), pt_badva(regs), ints_enabled(regs));
  83. }
  84. void dummy_handler(struct pt_regs *regs)
  85. {
  86. unsigned int elr = pt_elr(regs);
  87. printk(KERN_ERR "Unimplemented handler; ELR=0x%08x\n", elr);
  88. }
  89. void arch_do_IRQ(struct pt_regs *regs)
  90. {
  91. int irq = pt_cause(regs);
  92. struct pt_regs *old_regs = set_irq_regs(regs);
  93. irq_enter();
  94. generic_handle_irq(irq);
  95. irq_exit();
  96. set_irq_regs(old_regs);
  97. }