-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now we don't mix host and guest signal frame layouts anymore; moreover, we don't need host's struct sigcontext at all. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
- Loading branch information
Al Viro
authored and
Richard Weinberger
committed
Nov 2, 2011
1 parent
248b74c
commit ab1c0cc
Showing
9 changed files
with
67 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <sys/ucontext.h> | ||
#define __FRAME_OFFSETS | ||
#include <asm/ptrace.h> | ||
#include <sysdep/ptrace.h> | ||
|
||
void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc) | ||
{ | ||
#ifdef __i386__ | ||
#define COPY2(X,Y) regs->gp[X] = mc->gregs[REG_##Y] | ||
#define COPY(X) regs->gp[X] = mc->gregs[REG_##X] | ||
#define COPY_SEG(X) regs->gp[X] = mc->gregs[REG_##X] & 0xffff; | ||
#define COPY_SEG_CPL3(X) regs->gp[X] = (mc->gregs[REG_##X] & 0xffff) | 3; | ||
COPY_SEG(GS); COPY_SEG(FS); COPY_SEG(ES); COPY_SEG(DS); | ||
COPY(EDI); COPY(ESI); COPY(EBP); | ||
COPY2(UESP, ESP); /* sic */ | ||
COPY(EBX); COPY(EDX); COPY(ECX); COPY(EAX); | ||
COPY(EIP); COPY_SEG_CPL3(CS); COPY(EFL); COPY_SEG_CPL3(SS); | ||
#else | ||
#define COPY2(X,Y) regs->gp[X/sizeof(unsigned long)] = mc->gregs[REG_##Y] | ||
#define COPY(X) regs->gp[X/sizeof(unsigned long)] = mc->gregs[REG_##X] | ||
COPY(R8); COPY(R9); COPY(R10); COPY(R11); | ||
COPY(R12); COPY(R13); COPY(R14); COPY(R15); | ||
COPY(RDI); COPY(RSI); COPY(RBP); COPY(RBX); | ||
COPY(RDX); COPY(RAX); COPY(RCX); COPY(RSP); | ||
COPY(RIP); | ||
COPY2(EFLAGS, EFL); | ||
COPY2(CS, CSGSFS); | ||
regs->gp[CS / sizeof(unsigned long)] &= 0xffff; | ||
regs->gp[CS / sizeof(unsigned long)] |= 3; | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#ifndef __SYS_SIGCONTEXT_X86_H | ||
#define __SYS_SIGCONTEXT_X86_H | ||
|
||
extern void get_regs_from_mc(struct uml_pt_regs *, mcontext_t *); | ||
|
||
#ifdef __i386__ | ||
|
||
#define GET_FAULTINFO_FROM_MC(fi, mc) \ | ||
{ \ | ||
(fi).cr2 = (mc)->cr2; \ | ||
(fi).error_code = (mc)->gregs[REG_ERR]; \ | ||
(fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ | ||
} | ||
|
||
#else | ||
|
||
#define GET_FAULTINFO_FROM_MC(fi, mc) \ | ||
{ \ | ||
(fi).cr2 = (mc)->gregs[REG_CR2]; \ | ||
(fi).error_code = (mc)->gregs[REG_ERR]; \ | ||
(fi).trap_no = (mc)->gregs[REG_TRAPNO]; \ | ||
} | ||
|
||
#endif | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters