summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2004-11-29 13:54:10 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2004-11-29 13:54:10 +0000
commitc616819253fcf211745060b2be26076174b1df19 (patch)
tree36e86ae9f0f29789eafecd98a7211dd8bb4f6123 /tests
parent8e4d7dc6c8b023e4cde4153aeff132e32b9b7b10 (diff)
Added beginnings of an AMD64 port, so lots of new files and directories.
It compiles, but aborts immediately if you try to run it. I didn't include ldt.c; I'm not sure how the LDT is used on AMD64. It can be added later if necessary. While doing this, did some 64-bit cleanness fixes: - Added necessary intermediate casts to ULong to avoid warnings when converting ThreadId to void* and vice versa, in vg_scheduler.c. - Fixed VALGRIND_NON_SIMD_CALL[0123] to use 'long' as the return type. - Fixed VALGRIND_PRINTF{,BACKTRACE} to use unsigned longs instead of unsigned ints, as needed. - Converted some offsets in vg_symtab2.h from "Int" to "OffT". - Made strlen, strncat, etc, use SizeT instead of 'unsigned int' for the length parameter. - Couple of other minor things. I had to insert some "#ifdef __amd64__" and "#ifndef __amd64__" guards in places. In particular, in vg_mylibc.c, some of our syscall wrappers aren't appropriate for AMD64 because the syscall numbering is a bit different in places. This difference will have to be abstracted out somehow. Also rewrote the sys_fcntl and sys_fcntl64 wrappers, as required for AMD64. Also moved the ipc wrapper into x86, since it's not applicable for AMD64. However, it is applicable (I think) for ARM, so it would be nice to work out a way to share syscall wrappers between some, but not all, archs. Hmm. Also now using the real IPC constants rather than magic numbers in the wrapper. Other non-AMD64-related fixes: - ARM: fixed syscall table by accounting for the fact that syscall numbers don't start at 0, but rather at 0x900000. - Converted a few places to use ThreadId instead of 'int' or 'Int' for thread IDs. - Added both AMD64 and ARM (which I'd forgotten) entries to valgrind.spec.in. - Tweaked comments in various places. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3136 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'tests')
-rw-r--r--tests/cputest.c54
1 files changed, 32 insertions, 22 deletions
diff --git a/tests/cputest.c b/tests/cputest.c
index ac6d7863..9f464a52 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -15,13 +15,43 @@
typedef int Bool;
char* all_archs[] = {
- "x86",
- "arm",
"amd64",
+ "arm",
"ppc",
+ "x86",
NULL
};
+#ifdef __amd64
+static Bool go(char* cpu)
+{
+ if ( strcmp( cpu, "amd64" ) == 0 )
+ return True;
+ else
+ return False;
+}
+#endif // __amd64
+
+#ifdef __arm__
+static Bool go(char* cpu)
+{
+ if ( strcmp( cpu, "arm" ) == 0 )
+ return True;
+ else
+ return False;
+}
+#endif // __arm__
+
+#ifdef __ppc__
+static Bool go(char* cpu)
+{
+ if ( strcmp( cpu, "ppc" ) == 0 )
+ return True;
+ else
+ return False;
+}
+#endif // __ppc__
+
#ifdef __x86__
static __inline__ void cpuid(unsigned int n,
unsigned int *a, unsigned int *b,
@@ -74,26 +104,6 @@ static Bool go(char* cpu)
#endif // __x86__
-#ifdef __arm__
-static Bool go(char* cpu)
-{
- if ( strcmp( cpu, "arm" ) == 0 )
- return True;
- else
- return False;
-}
-#endif // __arm__
-
-#ifdef __ppc__
-static Bool go(char* cpu)
-{
- if ( strcmp( cpu, "ppc" ) == 0 )
- return True;
- else
- return False;
-}
-#endif // __ppc__
-
int main(int argc, char **argv)
{
int i;