Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2010 Tilera Corporation. All Rights Reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation, version 2. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, but |
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or |
| 11 | * NON INFRINGEMENT. See the GNU General Public License for |
| 12 | * more details. |
| 13 | */ |
| 14 | |
| 15 | #ifndef _ASM_TILE_TRAPS_H |
| 16 | #define _ASM_TILE_TRAPS_H |
| 17 | |
Chris Metcalf | 2f9ac29 | 2013-08-06 16:04:13 -0400 | [diff] [blame] | 18 | #ifndef __ASSEMBLY__ |
Chris Metcalf | 313ce67 | 2011-05-02 14:50:06 -0400 | [diff] [blame] | 19 | #include <arch/chip.h> |
| 20 | |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 21 | /* mm/fault.c */ |
| 22 | void do_page_fault(struct pt_regs *, int fault_num, |
| 23 | unsigned long address, unsigned long write); |
Chris Metcalf | d7c9661 | 2013-08-15 16:23:24 -0400 | [diff] [blame] | 24 | #if CHIP_HAS_TILE_DMA() |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 25 | void do_async_page_fault(struct pt_regs *); |
Chris Metcalf | 313ce67 | 2011-05-02 14:50:06 -0400 | [diff] [blame] | 26 | #endif |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 27 | |
| 28 | #ifndef __tilegx__ |
| 29 | /* |
| 30 | * We return this structure in registers to avoid having to write |
| 31 | * additional save/restore code in the intvec.S caller. |
| 32 | */ |
| 33 | struct intvec_state { |
| 34 | void *handler; |
| 35 | unsigned long vecnum; |
| 36 | unsigned long fault_num; |
| 37 | unsigned long info; |
| 38 | unsigned long retval; |
| 39 | }; |
| 40 | struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num, |
| 41 | unsigned long address, |
| 42 | unsigned long info); |
| 43 | #endif |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 44 | |
| 45 | /* kernel/traps.c */ |
| 46 | void do_trap(struct pt_regs *, int fault_num, unsigned long reason); |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 47 | void kernel_double_fault(int dummy, ulong pc, ulong lr, ulong sp, ulong r52); |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 48 | |
| 49 | /* kernel/time.c */ |
| 50 | void do_timer_interrupt(struct pt_regs *, int fault_num); |
| 51 | |
| 52 | /* kernel/messaging.c */ |
| 53 | void hv_message_intr(struct pt_regs *, int intnum); |
| 54 | |
Chris Metcalf | e5701b7 | 2015-05-04 17:26:35 -0400 | [diff] [blame] | 55 | #define TILE_NMI_DUMP_STACK 1 /* Dump stack for sysrq+'l' */ |
| 56 | |
| 57 | /* kernel/process.c */ |
| 58 | void do_nmi_dump_stack(struct pt_regs *regs); |
| 59 | |
| 60 | /* kernel/traps.c */ |
| 61 | void do_nmi(struct pt_regs *, int fault_num, unsigned long reason); |
| 62 | |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 63 | /* kernel/irq.c */ |
| 64 | void tile_dev_intr(struct pt_regs *, int intnum); |
| 65 | |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 66 | #ifdef CONFIG_HARDWALL |
| 67 | /* kernel/hardwall.c */ |
| 68 | void do_hardwall_trap(struct pt_regs *, int fault_num); |
| 69 | #endif |
| 70 | |
| 71 | /* kernel/ptrace.c */ |
| 72 | void do_breakpoint(struct pt_regs *, int fault_num); |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 73 | |
| 74 | |
Chris Metcalf | 233325b | 2010-10-14 16:32:41 -0400 | [diff] [blame] | 75 | #ifdef __tilegx__ |
Chris Metcalf | e172353 | 2012-03-29 14:52:00 -0400 | [diff] [blame] | 76 | /* kernel/single_step.c */ |
Chris Metcalf | 233325b | 2010-10-14 16:32:41 -0400 | [diff] [blame] | 77 | void gx_singlestep_handle(struct pt_regs *, int fault_num); |
Chris Metcalf | e172353 | 2012-03-29 14:52:00 -0400 | [diff] [blame] | 78 | |
| 79 | /* kernel/intvec_64.S */ |
| 80 | void fill_ra_stack(void); |
Chris Metcalf | 2f9ac29 | 2013-08-06 16:04:13 -0400 | [diff] [blame] | 81 | |
| 82 | /* Handle unalign data fixup. */ |
| 83 | extern void do_unaligned(struct pt_regs *regs, int vecnum); |
| 84 | #endif |
| 85 | |
| 86 | #endif /* __ASSEMBLY__ */ |
| 87 | |
| 88 | #ifdef __tilegx__ |
| 89 | /* 128 byte JIT per unalign fixup. */ |
| 90 | #define UNALIGN_JIT_SHIFT 7 |
Chris Metcalf | 233325b | 2010-10-14 16:32:41 -0400 | [diff] [blame] | 91 | #endif |
| 92 | |
Chris Metcalf | e172353 | 2012-03-29 14:52:00 -0400 | [diff] [blame] | 93 | #endif /* _ASM_TILE_TRAPS_H */ |