Exception.asm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // Copyright (c) 2011, ARM Limited. All rights reserved.
  3. //
  4. // SPDX-License-Identifier: BSD-2-Clause-Patent
  5. //
  6. //
  7. #include <AutoGen.h>
  8. IMPORT PeiCommonExceptionEntry
  9. EXPORT PeiVectorTable
  10. PRESERVE8
  11. AREA PrePeiCoreException, CODE, READONLY, CODEALIGN, ALIGN=5
  12. //============================================================
  13. //Default Exception Handlers
  14. //============================================================
  15. PeiVectorTable
  16. b _DefaultResetHandler
  17. b _DefaultUndefined
  18. b _DefaultSWI
  19. b _DefaultPrefetchAbort
  20. b _DefaultDataAbort
  21. b _DefaultReserved
  22. b _DefaultIrq
  23. b _DefaultFiq
  24. //
  25. // Default Exception handlers: There is no plan to return from any of these exceptions.
  26. // No context saving at all.
  27. //
  28. _DefaultResetHandler
  29. mov r1, lr
  30. cps #0x13 ; Switch to SVC for common stack
  31. mov r0, #0
  32. blx PeiCommonExceptionEntry
  33. _DefaultUndefined
  34. sub r1, LR, #4
  35. cps #0x13 ; Switch to SVC for common stack
  36. mov r0, #1
  37. blx PeiCommonExceptionEntry
  38. _DefaultSWI
  39. sub r1, LR, #4
  40. cps #0x13 ; Switch to SVC for common stack
  41. mov r0, #2
  42. blx PeiCommonExceptionEntry
  43. _DefaultPrefetchAbort
  44. sub r1, LR, #4
  45. cps #0x13 ; Switch to SVC for common stack
  46. mov r0, #3
  47. blx PeiCommonExceptionEntry
  48. _DefaultDataAbort
  49. sub r1, LR, #8
  50. cps #0x13 ; Switch to SVC for common stack
  51. mov r0, #4
  52. blx PeiCommonExceptionEntry
  53. _DefaultReserved
  54. mov r1, lr
  55. cps #0x13 ; Switch to SVC for common stack
  56. mov r0, #5
  57. blx PeiCommonExceptionEntry
  58. _DefaultIrq
  59. sub r1, LR, #4
  60. cps #0x13 ; Switch to SVC for common stack
  61. mov r0, #6
  62. blx PeiCommonExceptionEntry
  63. _DefaultFiq
  64. sub r1, LR, #4
  65. cps #0x13 ; Switch to SVC for common stack
  66. mov r0, #7
  67. blx PeiCommonExceptionEntry
  68. END