| 1 | /*
|
|---|
| 2 | * Copyright (c) 2016 Petr Pavlu
|
|---|
| 3 | *
|
|---|
| 4 | * All rights reserved.
|
|---|
| 5 | *
|
|---|
| 6 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | * modification, are permitted provided that the following conditions
|
|---|
| 8 | * are met:
|
|---|
| 9 | *
|
|---|
| 10 | * - Redistributions of source code must retain the above copyright
|
|---|
| 11 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 13 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 14 | * documentation and/or other materials provided with the distribution.
|
|---|
| 15 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 16 | * derived from this software without specific prior written permission.
|
|---|
| 17 | *
|
|---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 28 | */
|
|---|
| 29 |
|
|---|
| 30 | /** @addtogroup kernel_arm64
|
|---|
| 31 | * @{
|
|---|
| 32 | */
|
|---|
| 33 | /** @file
|
|---|
| 34 | * @brief Exception declarations.
|
|---|
| 35 | */
|
|---|
| 36 |
|
|---|
| 37 | #ifndef KERN_arm64_EXCEPTION_H_
|
|---|
| 38 | #define KERN_arm64_EXCEPTION_H_
|
|---|
| 39 |
|
|---|
| 40 | /* Exception numbers. */
|
|---|
| 41 |
|
|---|
| 42 | /** Current Exception level with SP_EL0, Synchronous. */
|
|---|
| 43 | #define EXC_CURRENT_EL_SP_SEL0_SYNCH 0
|
|---|
| 44 | /** Current Exception level with SP_EL0, IRQ or vIRQ. */
|
|---|
| 45 | #define EXC_CURRENT_EL_SP_SEL0_IRQ 1
|
|---|
| 46 | /** Current Exception level with SP_EL0, FIQ or vFIQ. */
|
|---|
| 47 | #define EXC_CURRENT_EL_SP_SEL0_FIQ 2
|
|---|
| 48 | /** Current Exception level with SP_EL0, SError or vSError. */
|
|---|
| 49 | #define EXC_CURRENT_EL_SP_SEL0_SERROR 3
|
|---|
| 50 | /** Current Exception level with SP_ELx, x > 0, Synchronous. */
|
|---|
| 51 | #define EXC_CURRENT_EL_SP_SELX_SYNCH 4
|
|---|
| 52 | /** Current Exception level with SP_ELx, x > 0, IRQ or vIRQ. */
|
|---|
| 53 | #define EXC_CURRENT_EL_SP_SELX_IRQ 5
|
|---|
| 54 | /** Current Exception level with SP_ELx, x > 0, FIQ or vFIQ. */
|
|---|
| 55 | #define EXC_CURRENT_EL_SP_SELX_FIQ 6
|
|---|
| 56 | /** Current Exception level with SP_ELx, x > 0, SError or vSError. */
|
|---|
| 57 | #define EXC_CURRENT_EL_SP_SELX_SERROR 7
|
|---|
| 58 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 59 | * the target level is using AArch64, Synchronous.
|
|---|
| 60 | */
|
|---|
| 61 | #define EXC_LOWER_EL_AARCH64_SYNCH 8
|
|---|
| 62 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 63 | * the target level is using AArch64, IRQ or vIRQ.
|
|---|
| 64 | */
|
|---|
| 65 | #define EXC_LOWER_EL_AARCH64_IRQ 9
|
|---|
| 66 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 67 | * the target level is using AArch64, FIQ or vFIQ.
|
|---|
| 68 | */
|
|---|
| 69 | #define EXC_LOWER_EL_AARCH64_FIQ 10
|
|---|
| 70 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 71 | * the target level is using AArch64, SError or vSError.
|
|---|
| 72 | */
|
|---|
| 73 | #define EXC_LOWER_EL_AARCH64_SERROR 11
|
|---|
| 74 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 75 | * the target level is using AArch32, Synchronous.
|
|---|
| 76 | */
|
|---|
| 77 | #define EXC_LOWER_EL_AARCH32_SYNCH 12
|
|---|
| 78 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 79 | * the target level is using AArch32, IRQ or vIRQ.
|
|---|
| 80 | */
|
|---|
| 81 | #define EXC_LOWER_EL_AARCH32_IRQ 13
|
|---|
| 82 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 83 | * the target level is using AArch32, FIQ or vFIQ.
|
|---|
| 84 | */
|
|---|
| 85 | #define EXC_LOWER_EL_AARCH32_FIQ 14
|
|---|
| 86 | /** Lower Exception level, where the implemented level immediately lower than
|
|---|
| 87 | * the target level is using AArch32, SError or vSError.
|
|---|
| 88 | */
|
|---|
| 89 | #define EXC_LOWER_EL_AARCH32_SERROR 15
|
|---|
| 90 |
|
|---|
| 91 | #ifndef __ASSEMBLER__
|
|---|
| 92 | extern void exception_init(void);
|
|---|
| 93 | #endif /* __ASSEMBLER__ */
|
|---|
| 94 |
|
|---|
| 95 | #endif
|
|---|
| 96 |
|
|---|
| 97 | /** @}
|
|---|
| 98 | */
|
|---|