@@ -665,6 +665,89 @@ mod imp {
665665 }
666666 }
667667
668+ #[ cfg( target_arch = "x86_64" ) ]
669+ mod arch {
670+ use libc:: { c_longlong, c_ulonglong} ;
671+ use libc:: types:: os:: arch:: extra:: { WORD , DWORD , DWORDLONG } ;
672+
673+ pub struct CONTEXT {
674+ P1Home : DWORDLONG ,
675+ P2Home : DWORDLONG ,
676+ P3Home : DWORDLONG ,
677+ P4Home : DWORDLONG ,
678+ P5Home : DWORDLONG ,
679+ P6Home : DWORDLONG ,
680+
681+ ContextFlags : DWORD ,
682+ MxCsr : DWORD ,
683+
684+ SegCs : WORD ,
685+ SegDs : WORD ,
686+ SegEs : WORD ,
687+ SegFs : WORD ,
688+ SegGs : WORD ,
689+ SegSs : WORD ,
690+ EFlags : DWORD ,
691+
692+ Dr0 : DWORDLONG ,
693+ Dr1 : DWORDLONG ,
694+ Dr2 : DWORDLONG ,
695+ Dr3 : DWORDLONG ,
696+ Dr6 : DWORDLONG ,
697+ Dr7 : DWORDLONG ,
698+
699+ Rax : DWORDLONG ,
700+ Rcx : DWORDLONG ,
701+ Rdx : DWORDLONG ,
702+ Rbx : DWORDLONG ,
703+ Rsp : DWORDLONG ,
704+ Rbp : DWORDLONG ,
705+ Rsi : DWORDLONG ,
706+ Rdi : DWORDLONG ,
707+ R8 : DWORDLONG ,
708+ R9 : DWORDLONG ,
709+ R10 : DWORDLONG ,
710+ R11 : DWORDLONG ,
711+ R12 : DWORDLONG ,
712+ R13 : DWORDLONG ,
713+ R14 : DWORDLONG ,
714+ R15 : DWORDLONG ,
715+
716+ Rip : DWORDLONG ,
717+
718+ FltSave : FLOATING_SAVE_AREA ,
719+
720+ VectorRegister : [ M128A , .. 26 ] ,
721+ VectorControl : DWORDLONG ,
722+
723+ DebugControl : DWORDLONG ,
724+ LastBranchToRip : DWORDLONG ,
725+ LastBranchFromRip : DWORDLONG ,
726+ LastExceptionToRip : DWORDLONG ,
727+ LastExceptionFromRip : DWORDLONG ,
728+ }
729+
730+ pub struct M128A {
731+ Low : c_ulonglong ,
732+ High : c_longlong
733+ }
734+
735+ pub struct FLOATING_SAVE_AREA {
736+ _Dummy : [ u8 , ..512 ] // FIXME: Fill this out
737+ }
738+
739+ pub fn init_frame ( frame : & mut super :: STACKFRAME64 ,
740+ ctx : & CONTEXT ) -> DWORD {
741+ frame. AddrPC . Offset = ctx. Rip as u64 ;
742+ frame. AddrPC . Mode = super :: AddrModeFlat ;
743+ frame. AddrStack . Offset = ctx. Rsp as u64 ;
744+ frame. AddrStack . Mode = super :: AddrModeFlat ;
745+ frame. AddrFrame . Offset = ctx. Rbp as u64 ;
746+ frame. AddrFrame . Mode = super :: AddrModeFlat ;
747+ super :: IMAGE_FILE_MACHINE_AMD64
748+ }
749+ }
750+
668751 struct Cleanup {
669752 handle : libc:: HANDLE ,
670753 SymCleanup : SymCleanupFn ,
0 commit comments