1 /*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 37 * $FreeBSD$ 38 */ 39 40 #ifndef _MACHINE_FRAME_H_ 41 #define _MACHINE_FRAME_H_ 1 42 43 /* 44 * System stack frames. 45 */ 46 47 /* 48 * Exception/Trap Stack Frame 49 * 50 * The ordering of this is specifically so that we can take first 6 51 * the syscall arguments directly from the beginning of the frame. 52 */ 53 54 struct trapframe { 55 register_t tf_rdi; 56 register_t tf_rsi; 57 register_t tf_rdx; 58 register_t tf_rcx; 59 register_t tf_r8; 60 register_t tf_r9; 61 register_t tf_rax; 62 register_t tf_rbx; 63 register_t tf_rbp; 64 register_t tf_r10; 65 register_t tf_r11; 66 register_t tf_r12; 67 register_t tf_r13; 68 register_t tf_r14; 69 register_t tf_r15; 70 register_t tf_trapno; 71 register_t tf_addr; 72 /* below portion defined in hardware */ 73 register_t tf_err; 74 register_t tf_rip; 75 register_t tf_cs; 76 register_t tf_rflags; 77 register_t tf_rsp; 78 register_t tf_ss; 79 }; 80 81 /* Interrupt stack frame */ 82 83 struct intrframe { 84 register_t if_rdi; 85 register_t if_rsi; 86 register_t if_rdx; 87 register_t if_rcx; 88 register_t if_r8; 89 register_t if_r9; 90 register_t if_rax; 91 register_t if_rbx; 92 register_t if_rbp; 93 register_t if_r10; 94 register_t if_r11; 95 register_t if_r12; 96 register_t if_r13; 97 register_t if_r14; 98 register_t if_r15; 99 register_t :64; /* compat with trap frame - trapno */ 100 register_t :64; /* compat with trap frame - addr */ 101 register_t :64; /* compat with trap frame - err */ 102 /* below portion defined in hardware */ 103 register_t if_rip; 104 register_t if_cs; 105 register_t if_rflags; 106 register_t if_rsp; 107 register_t if_ss; 108 }; 109 110 /* frame of clock (same as interrupt frame) */ 111 112 struct clockframe { 113 register_t cf_rdi; 114 register_t cf_rsi; 115 register_t cf_rdx; 116 register_t cf_rcx; 117 register_t cf_r8; 118 register_t cf_r9; 119 register_t cf_rax; 120 register_t cf_rbx; 121 register_t cf_rbp; 122 register_t cf_r10; 123 register_t cf_r11; 124 register_t cf_r12; 125 register_t cf_r13; 126 register_t cf_r14; 127 register_t cf_r15; 128 register_t :64; /* compat with trap frame - trapno */ 129 register_t :64; /* compat with trap frame - addr */ 130 register_t :64; /* compat with trap frame - err */ 131 /* below portion defined in hardware */ 132 register_t cf_rip; 133 register_t cf_cs; 134 register_t cf_rflags; 135 register_t cf_rsp; 136 register_t cf_ss; 137 }; 138 139 int kdb_trap(int, int, struct trapframe *); 140 141 #endif /* _MACHINE_FRAME_H_ */ 142