diff options
author | rsc <devnull@localhost> | 2004-12-28 17:35:10 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-28 17:35:10 +0000 |
commit | 1369edef9f26a5a127b60b1163564c2570d9a7d9 (patch) | |
tree | 22d5d53115e8792b70add6e2ed9d043fad19ae47 /src/libmach | |
parent | e2f52703c2387a34f7edc86845a0b15f04830bb8 (diff) | |
download | plan9port-1369edef9f26a5a127b60b1163564c2570d9a7d9.tar.gz plan9port-1369edef9f26a5a127b60b1163564c2570d9a7d9.tar.bz2 plan9port-1369edef9f26a5a127b60b1163564c2570d9a7d9.zip |
move linux ureg code to portable file
Diffstat (limited to 'src/libmach')
-rw-r--r-- | src/libmach/mkfile | 1 | ||||
-rw-r--r-- | src/libmach/ureg386.c | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/libmach/mkfile b/src/libmach/mkfile index 8ebe0374..53d1af99 100644 --- a/src/libmach/mkfile +++ b/src/libmach/mkfile @@ -41,6 +41,7 @@ OFILES=\ symelf.$O\ symmacho.$O\ symstabs.$O\ + ureg386.$O\ HFILES=mach.h diff --git a/src/libmach/ureg386.c b/src/libmach/ureg386.c new file mode 100644 index 00000000..09ef095d --- /dev/null +++ b/src/libmach/ureg386.c @@ -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; +} |