Skip to content

Commit

Permalink
Reorder guest saved regs to match hyperall order
Browse files Browse the repository at this point in the history
Move eax next to ebx/ecx/edx in struct lguest_regs on i386, so they
will be located together and allow it to map directly to a struct
hcall_ring entry (which will be renamed struct hcall_args as in a
subsequent patch).

This is in preparation for making the code hcall code architecture
independent.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Jes Sorensen authored and Rusty Russell committed Oct 23, 2007
1 parent 625efab commit 4614a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/lguest/x86/switcher_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ ENTRY(switch_to_guest)
// The Guest's register page has been mapped
// Writable onto our %esp (stack) --
// We can simply pop off all Guest regs.
popl %eax
popl %ebx
popl %ecx
popl %edx
popl %esi
popl %edi
popl %ebp
popl %gs
popl %eax
popl %fs
popl %ds
popl %es
Expand Down Expand Up @@ -168,14 +168,14 @@ ENTRY(switch_to_guest)
pushl %es; \
pushl %ds; \
pushl %fs; \
pushl %eax; \
pushl %gs; \
pushl %ebp; \
pushl %edi; \
pushl %esi; \
pushl %edx; \
pushl %ecx; \
pushl %ebx; \
pushl %eax; \
/* Our stack and our code are using segments \
* Set in the TSS and IDT \
* Yet if we were to touch data we'd use \
Expand Down
3 changes: 1 addition & 2 deletions include/asm-x86/lguest.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ extern unsigned long default_idt_entries[];
struct lguest_regs
{
/* Manually saved part. */
unsigned long ebx, ecx, edx;
unsigned long eax, ebx, ecx, edx;
unsigned long esi, edi, ebp;
unsigned long gs;
unsigned long eax;
unsigned long fs, ds, es;
unsigned long trapnum, errcode;
/* Trap pushed part */
Expand Down

0 comments on commit 4614a3a

Please sign in to comment.