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