18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 38c2ecf20Sopenharmony_ci * Licensed under the GPL 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef __SYS_SIGCONTEXT_X86_H 78c2ecf20Sopenharmony_ci#define __SYS_SIGCONTEXT_X86_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciextern void get_regs_from_mc(struct uml_pt_regs *, mcontext_t *); 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifdef __i386__ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#define GET_FAULTINFO_FROM_MC(fi, mc) \ 148c2ecf20Sopenharmony_ci { \ 158c2ecf20Sopenharmony_ci (fi).cr2 = (mc)->cr2; \ 168c2ecf20Sopenharmony_ci (fi).error_code = (mc)->gregs[REG_ERR]; \ 178c2ecf20Sopenharmony_ci (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ 188c2ecf20Sopenharmony_ci } 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#else 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#define GET_FAULTINFO_FROM_MC(fi, mc) \ 238c2ecf20Sopenharmony_ci { \ 248c2ecf20Sopenharmony_ci (fi).cr2 = (mc)->gregs[REG_CR2]; \ 258c2ecf20Sopenharmony_ci (fi).error_code = (mc)->gregs[REG_ERR]; \ 268c2ecf20Sopenharmony_ci (fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ 278c2ecf20Sopenharmony_ci } 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#endif 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#endif 32