]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added AMD64 skeleton, just defining LibVEX_GuestAMD64_initialise().
authorNicholas Nethercote <njn@valgrind.org>
Tue, 30 Nov 2004 15:56:47 +0000 (15:56 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 30 Nov 2004 15:56:47 +0000 (15:56 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@601

VEX/Makefile
VEX/priv/guest-amd64/ghelpers.c [new file with mode: 0644]
VEX/pub/libvex_guest_amd64.h

index 5824ff4b1ecfa16a47598db797fab0437d0ae028..bed2d78e4a30668a8f1e9511485c9accb9300f82 100644 (file)
@@ -26,6 +26,7 @@ LIB_OBJS =    priv/ir/irdefs.o                        \
                priv/host-generic/h_generic_regs.o      \
                priv/host-generic/reg_alloc2.o          \
                priv/guest-x86/ghelpers.o               \
+               priv/guest-amd64/ghelpers.o             \
                priv/guest-arm/ghelpers.o               \
                priv/guest-x86/toIR.o                   \
                priv/guest-arm/toIR.o
@@ -125,6 +126,10 @@ priv/guest-x86/ghelpers.o: $(ALL_HEADERS) priv/guest-x86/ghelpers.c
        $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-x86/ghelpers.o \
                                         -c priv/guest-x86/ghelpers.c
 
+priv/guest-amd64/ghelpers.o: $(ALL_HEADERS) priv/guest-amd64/ghelpers.c
+       $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-amd64/ghelpers.o \
+                                        -c priv/guest-amd64/ghelpers.c
+
 priv/guest-arm/ghelpers.o: $(ALL_HEADERS) priv/guest-arm/ghelpers.c
        $(CC) $(CCFLAGS) $(ALL_INCLUDES) -o priv/guest-arm/ghelpers.o \
                                         -c priv/guest-arm/ghelpers.c
diff --git a/VEX/priv/guest-amd64/ghelpers.c b/VEX/priv/guest-amd64/ghelpers.c
new file mode 100644 (file)
index 0000000..cca2764
--- /dev/null
@@ -0,0 +1,84 @@
+
+/*---------------------------------------------------------------*/
+/*---                                                         ---*/
+/*--- This file (guest-amd64/ghelpers.c) is                   ---*/
+/*--- Copyright (c) 2004 OpenWorks LLP.  All rights reserved. ---*/
+/*---                                                         ---*/
+/*---------------------------------------------------------------*/
+
+/*
+   This file is part of LibVEX, a library for dynamic binary
+   instrumentation and translation.
+
+   Copyright (C) 2004 OpenWorks, LLP.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; Version 2 dated June 1991 of the
+   license.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or liability
+   for damages.  See the GNU General Public License for more details.
+
+   Neither the names of the U.S. Department of Energy nor the
+   University of California nor the names of its contributors may be
+   used to endorse or promote products derived from this software
+   without prior written permission.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+   USA.
+*/
+
+#include "libvex_basictypes.h"
+#include "libvex_emwarn.h"
+#include "libvex_guest_amd64.h"
+#include "libvex_ir.h"
+#include "libvex.h"
+
+#include "main/vex_util.h"
+//#include "guest-amd64/gdefs.h"    // put back in when that file is added
+
+
+/* VISIBLE TO LIBVEX CLIENT */
+void LibVEX_GuestAMD64_initialise ( /*OUT*/VexGuestAMD64State* vex_state )
+{
+   //Int i;
+
+   vex_state->guest_RAX = 0;
+   vex_state->guest_RCX = 0;
+   vex_state->guest_RDX = 0;
+   vex_state->guest_RBX = 0;
+   vex_state->guest_RSP = 0;
+   vex_state->guest_RBP = 0;
+   vex_state->guest_RSI = 0;
+   vex_state->guest_RDI = 0;
+   vex_state->guest_R8  = 0;
+   vex_state->guest_R9  = 0;
+   vex_state->guest_R10 = 0;
+   vex_state->guest_R11 = 0;
+   vex_state->guest_R12 = 0;
+   vex_state->guest_R13 = 0;
+   vex_state->guest_R14 = 0;
+   vex_state->guest_R15 = 0;
+
+   vex_state->guest_CC_OP   = 999;//X86G_CC_OP_COPY;  // XXX ???
+   vex_state->guest_CC_DEP1 = 0;
+   vex_state->guest_CC_DEP2 = 0;
+   vex_state->guest_CC_NDEP = 0;
+
+   // XXX: add more here later, for D/ID flags
+
+   vex_state->guest_RIP = 0;
+
+   // XXX: add more here later, for segment registers, FPU, etc.
+
+   vex_state->guest_EMWARN = EmWarn_NONE;
+}
+
+/*---------------------------------------------------------------*/
+/*--- end                              guest-amd64/ghelpers.c ---*/
+/*---------------------------------------------------------------*/
index 35aa26de053b6713e681bae7cc297dd7d7ff621c..b70c681c9cd9cf50f86fcf6e118524b8aaf7c7d6 100644 (file)
@@ -89,14 +89,14 @@ typedef
 /*--- Utility functions for amd64 guest stuff.                ---*/
 /*---------------------------------------------------------------*/
 
-#if 0
 /* ALL THE FOLLOWING ARE VISIBLE TO LIBRARY CLIENT */
 
 /* Initialise all guest x86 state.  The FPU is put in default mode. */
 extern
-void LibVEX_GuestX86_initialise ( /*OUT*/VexGuestX86State* vex_state );
+void LibVEX_GuestAMD64_initialise ( /*OUT*/VexGuestAMD64State* vex_state );
 
 
+#if 0
 /* Convert a saved x87 FPU image (as created by fsave) and write it
    into the supplied VexGuestX86State structure.  The non-FP parts of
    said structure are left unchanged.