From: Nicholas Nethercote Date: Mon, 16 May 2005 21:30:24 +0000 (+0000) Subject: Removed the core_arch_asm.h files. The OYNK macros now live in tool_asm.h, X-Git-Tag: svn/VALGRIND_3_0_0~570 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df9411196864f78284a1aa5d8d633ad5bea10e5e;p=thirdparty%2Fvalgrind.git Removed the core_arch_asm.h files. The OYNK macros now live in tool_asm.h, at least for the moment. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3748 --- diff --git a/coregrind/amd64/Makefile.am b/coregrind/amd64/Makefile.am index 7160e2cbfa..35729bb48f 100644 --- a/coregrind/amd64/Makefile.am +++ b/coregrind/amd64/Makefile.am @@ -4,8 +4,7 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer -g noinst_HEADERS = \ - core_arch.h \ - core_arch_asm.h + core_arch.h noinst_LIBRARIES = libarch.a diff --git a/coregrind/amd64/core_arch.h b/coregrind/amd64/core_arch.h index 193a5ef75a..b4c57a0779 100644 --- a/coregrind/amd64/core_arch.h +++ b/coregrind/amd64/core_arch.h @@ -31,8 +31,6 @@ #ifndef __AMD64_CORE_ARCH_H #define __AMD64_CORE_ARCH_H -#include "core_arch_asm.h" // arch-specific asm stuff - #include "libvex.h" #include "libvex_guest_amd64.h" diff --git a/coregrind/amd64/core_arch_asm.h b/coregrind/amd64/core_arch_asm.h deleted file mode 100644 index d9c5a3db1a..0000000000 --- a/coregrind/amd64/core_arch_asm.h +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------------------------------------------*/ -/*--- amd64/core_arch_asm.h ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2005 Nicholas Nethercote - njn@valgrind.org - - 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; either version 2 of the - License, or (at your option) any later version. - - 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. See the GNU - General Public License for more details. - - 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. - - The GNU General Public License is contained in the file COPYING. -*/ - -#ifndef __AMD64_CORE_ARCH_ASM_H -#define __AMD64_CORE_ARCH_ASM_H - -// Print a constant from asm code. -#define OYNK(nnn) push %r8 ; push %r9 ; push %r10; push %r11; \ - push %rax; push %rbx; push %rcx; push %rdx; \ - push %rsi; push %rdi; \ - movl $nnn, %edi; call VG_(oynk); \ - pop %rdi; pop %rsi; pop %rdx; pop %rcx; \ - pop %rbx; pop %rax; pop %r11; pop %r10; \ - pop %r9 ; pop %r8 - -#endif // __AMD64_CORE_ARCH_ASM_H - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/arm/Makefile.am b/coregrind/arm/Makefile.am index 1bb806eca4..c4a81e84ee 100644 --- a/coregrind/arm/Makefile.am +++ b/coregrind/arm/Makefile.am @@ -4,8 +4,7 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fomit-frame-pointer -g noinst_HEADERS = \ - core_arch.h \ - core_arch_asm.h + core_arch.h noinst_LIBRARIES = libarch.a diff --git a/coregrind/arm/core_arch.h b/coregrind/arm/core_arch.h index 13ad9c81e0..c8aeec51e4 100644 --- a/coregrind/arm/core_arch.h +++ b/coregrind/arm/core_arch.h @@ -31,8 +31,6 @@ #ifndef __ARM_CORE_ARCH_H #define __ARM_CORE_ARCH_H -#include "core_arch_asm.h" // arch-specific asm stuff - #include "libvex.h" #include "libvex_guest_arm.h" diff --git a/coregrind/arm/core_arch_asm.h b/coregrind/arm/core_arch_asm.h deleted file mode 100644 index 2d990c4964..0000000000 --- a/coregrind/arm/core_arch_asm.h +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------------------------------------------*/ -/*--- arm/core_arch_asm.h ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2005 Nicholas Nethercote - njn@valgrind.org - - 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; either version 2 of the - License, or (at your option) any later version. - - 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. See the GNU - General Public License for more details. - - 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. - - The GNU General Public License is contained in the file COPYING. -*/ - -#ifndef __ARM_CORE_ARCH_ASM_H -#define __ARM_CORE_ARCH_ASM_H - -#if 0 -/* Debugging hack for assembly code ... sigh. */ -#if 0 -#define OYNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal -#else -#define OYNK(nnn) -#endif - -#if 0 -#define OYNNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal -#else -#define OYNNK(nnn) -#endif -#endif - -#endif // __ARM_CORE_ARCH_ASM_H - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/coregrind/x86/Makefile.am b/coregrind/x86/Makefile.am index d5ccd3605e..03d41694b7 100644 --- a/coregrind/x86/Makefile.am +++ b/coregrind/x86/Makefile.am @@ -4,8 +4,7 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am AM_CFLAGS = $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O -g noinst_HEADERS = \ - core_arch.h \ - core_arch_asm.h + core_arch.h noinst_LIBRARIES = libarch.a diff --git a/coregrind/x86/core_arch.h b/coregrind/x86/core_arch.h index a0816d684a..e9c0bca8db 100644 --- a/coregrind/x86/core_arch.h +++ b/coregrind/x86/core_arch.h @@ -31,8 +31,6 @@ #ifndef __X86_CORE_ARCH_H #define __X86_CORE_ARCH_H -#include "core_arch_asm.h" // arch-specific asm stuff - #include "libvex.h" #include "libvex_guest_x86.h" diff --git a/coregrind/x86/core_arch_asm.h b/coregrind/x86/core_arch_asm.h deleted file mode 100644 index c8a6210440..0000000000 --- a/coregrind/x86/core_arch_asm.h +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------------------------------------------*/ -/*--- x86/core_arch_asm.h ---*/ -/*--------------------------------------------------------------------*/ - -/* - This file is part of Valgrind, a dynamic binary instrumentation - framework. - - Copyright (C) 2000-2005 Nicholas Nethercote - njn@valgrind.org - - 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; either version 2 of the - License, or (at your option) any later version. - - 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. See the GNU - General Public License for more details. - - 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. - - The GNU General Public License is contained in the file COPYING. -*/ - -#ifndef __X86_CORE_ARCH_ASM_H -#define __X86_CORE_ARCH_ASM_H - -#endif /* __X86_CORE_ARCH_ASM_H */ - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ diff --git a/docs/directory-structure b/docs/directory-structure index 0eb1a3df6f..e8a6e40294 100644 --- a/docs/directory-structure +++ b/docs/directory-structure @@ -1,6 +1,9 @@ ------------------------------------------------------------------- Guide to the directory structure ------------------------------------------------------------------- +[16-May-2005: a lot of the stuff about arch/OS/platform specific code + is out of date in here. Hopefully, things have gotten simpler. --njn] + Valgrind has 2 main levels of genericity. 1. Multiple tools, plus the core. diff --git a/include/tool_asm.h b/include/tool_asm.h index c8d01dc4c1..95f3fafc6d 100644 --- a/include/tool_asm.h +++ b/include/tool_asm.h @@ -45,6 +45,22 @@ #define VGO_(str) VGAPPEND(vgOS_,str) #define VGP_(str) VGAPPEND(vgPlatform_,str) +// Print a constant from asm code. +// Nb: you'll need to define VG_(oynk)(Int) to use this. +#if defined(VGA_x86) +# define OYNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal +#elif defined(VGA_amd64) +# define OYNK(nnn) push %r8 ; push %r9 ; push %r10; push %r11; \ + push %rax; push %rbx; push %rcx; push %rdx; \ + push %rsi; push %rdi; \ + movl $nnn, %edi; call VG_(oynk); \ + pop %rdi; pop %rsi; pop %rdx; pop %rcx; \ + pop %rbx; pop %rax; pop %r11; pop %r10; \ + pop %r9 ; pop %r8 +#else +# error Unknown architecture +#endif + #endif /* ndef __TOOL_ASM_H */ /*--------------------------------------------------------------------*/