blob: 8f70bb2d0c37bc0df8bc264e5ac032e8c25e6c84 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/uaccess.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10void
11ia64_handle_exception (struct pt_regs *regs, const struct exception_table_entry *e)
12{
Ard Biesheuvel8fe97522016-03-22 14:28:20 -070013 long fix = (u64) &e->fixup + e->fixup;
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15 regs->r8 = -EFAULT;
16 if (fix & 4)
17 regs->r9 = 0;
18 regs->cr_iip = fix & ~0xf;
19 ia64_psr(regs)->ri = fix & 0x3; /* set continuation slot number */
20}