/* arrive here in 32 bit mode */ .globl test64 test64: /* first of all, get our ljmp points. */ leal to64p,%edx movl (%edx),%edx leal to32p,%ecx movl (%ecx),%ecx /* Pointer to command block */ leal cmdp,%eax /* Set up for inter-segment jump to 64 bit code mode */ pushl $43 /* $GSEL(GUCODE_SEL, SEL_UPL) */ pushl %edx /* passed in (to64) */ lretl .code64 .p2align 4 .globl to64 to64: /* get 32 bit pointers to source and dest data */ movl 4(%rax), %ebx /* dest */ movl 0(%rax), %eax /* source */ /* Copy in a 64 bit operation */ movq (%rax), %rdx movq %rdx, (%rbx) /* Get the heck out of here. Jump back to 32 bit code segment */ pushq $27 /* GSEL(GUCODE32_UPL, SEL_UPL) */ pushq %rcx /* passed in (to32) */ lretq .code32 .p2align 4 .globl to32 to32: ret