^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _ARCH_POWERPC_EXTABLE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _ARCH_POWERPC_EXTABLE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * The exception table consists of pairs of relative addresses: the first is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * the address of an instruction that is allowed to fault, and the second is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * the address at which the program should continue. No registers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * modified, so it is entirely up to the continuation code to figure out what
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * to do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * All the routines below use bits of fixup code that are out of line with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * main instruction path. This means when everything is well, we don't even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * have to jump over them. Further, they do not intrude on our cache or tlb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * entries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define ARCH_HAS_RELATIVE_EXTABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct exception_table_entry {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int insn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) int fixup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) static inline unsigned long extable_fixup(const struct exception_table_entry *x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) return (unsigned long)&x->fixup + x->fixup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #endif