-
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.
yaml --- r: 273010 b: refs/heads/master c: ab1c0cc h: refs/heads/master v: v3
- Loading branch information
Al Viro
authored and
Richard Weinberger
committed
Nov 2, 2011
1 parent
b183f10
commit 8fc0e38
Showing
10 changed files
with
68 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 248b74c79ebb9fb55e146797a808836d90418c4b | ||
refs/heads/master: ab1c0cc7c96c17ea903ca6d3e42e7d2696b32b6c |
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