blob: da477c11770b056b7bc4d13200f10acb10e3d50b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Kernel exception handling table support. Derived from arch/alpha/mm/extable.c.
4 *
5 * Copyright (C) 1998, 1999, 2001-2002, 2004 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */
8
Al Viro8bec2712016-12-25 14:24:35 -05009#include <asm/ptrace.h>
10#include <asm/extable.h>
11#include <asm/errno.h>
12#include <asm/processor.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14void
15ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e)
16{
Ard Biesheuvel8fe97522016-03-22 14:28:20 -070017 long fix = (u64) &e->fixup + e->fixup;
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19 regs->r8 = -EFAULT;
20 if (fix & 4)
21 regs->r9 = 0;
22 regs->cr_iip = fix & ~0xf;
23 ia64_psr(regs)->ri = fix & 0x3; /* set continuation slot number */
24}