mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
move linux ureg code to portable file
This commit is contained in:
parent
e2f52703c2
commit
1369edef9f
2 changed files with 37 additions and 0 deletions
|
@ -41,6 +41,7 @@ OFILES=\
|
|||
symelf.$O\
|
||||
symmacho.$O\
|
||||
symstabs.$O\
|
||||
ureg386.$O\
|
||||
|
||||
HFILES=mach.h
|
||||
|
||||
|
|
36
src/libmach/ureg386.c
Normal file
36
src/libmach/ureg386.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <mach.h>
|
||||
#include <elf.h>
|
||||
#include "ureg386.h"
|
||||
|
||||
|
||||
Ureg*
|
||||
_linux2ureg386(UregLinux386 *l)
|
||||
{
|
||||
Ureg *u;
|
||||
|
||||
u = malloc(sizeof(Ureg));
|
||||
if(u == nil)
|
||||
return nil;
|
||||
u->di = l->edi;
|
||||
u->si = l->esi;
|
||||
u->bp = l->ebp;
|
||||
u->nsp = l->esp;
|
||||
u->bx = l->ebx;
|
||||
u->dx = l->edx;
|
||||
u->cx = l->ecx;
|
||||
u->ax = l->eax;
|
||||
u->gs = l->xgs;
|
||||
u->fs = l->xfs;
|
||||
u->es = l->xes;
|
||||
u->ds = l->xds;
|
||||
u->trap = ~0; // l->trapno;
|
||||
u->ecode = ~0; // l->err;
|
||||
u->pc = l->eip;
|
||||
u->cs = l->xcs;
|
||||
u->flags = l->eflags;
|
||||
u->sp = l->esp;
|
||||
u->ss = l->xss;
|
||||
return u;
|
||||
}
|
Loading…
Reference in a new issue