|
From: Dirk M. <mu...@kd...> - 2004-01-03 14:27:48
|
CVS commit by mueller:
make it compile on FreeBSD
M +2 -0 .cvsignore 1.7
M +1 -1 bitfield1.c 1.3
M +1 -1 map_unmap.c 1.3
M +1 -1 munmap_exe.c 1.3
M +1 -0 resolv.c 1.3
M +9 -0 sha1_test.c 1.4
--- valgrind/none/tests/.cvsignore #1.6:1.7
@@ -15,5 +15,7 @@
fucomip
gxx304
+map_unmap
munmap_exe
+mremap
pluto
pth_blockedsig
--- valgrind/none/tests/bitfield1.c #1.2:1.3
@@ -1,4 +1,4 @@
-#include <malloc.h>
+#include <stdlib.h>
typedef
--- valgrind/none/tests/map_unmap.c #1.2:1.3
@@ -11,5 +11,5 @@ static unsigned int pagesize;
static void *domap(void)
{
- void *ret = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ void *ret = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
if (ret == (void *)-1) {
--- valgrind/none/tests/munmap_exe.c #1.2:1.3
@@ -12,5 +12,5 @@ int main()
void* m;
- m = mmap(NULL, 100, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ m = mmap(NULL, 100, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0);
if (m == (void*)-1) {
--- valgrind/none/tests/resolv.c #1.2:1.3
@@ -1,3 +1,4 @@
+#include <netinet/in.h>
#include <resolv.h>
#include <stdio.h>
--- valgrind/none/tests/sha1_test.c #1.3:1.4
@@ -43,4 +43,6 @@ A million repetitions of "a"
#define SHA1HANDSOFF
+#include <config.h>
+
#include <string.h>
#include <sys/types.h> /* for u_int*_t */
@@ -64,5 +66,12 @@ void SHA1Update(SHA1_CTX* context, const
void SHA1Final(unsigned char digest[20], SHA1_CTX* context);
/* ================ end of sha1.h ================ */
+
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
+#ifdef HAVE_ENDIAN_H
#include <endian.h>
+#endif
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
|
|
From: Jeremy F. <je...@go...> - 2004-01-06 21:46:42
|
CVS commit by fitzhardinge:
Make fork test deterministic.
M +4 -0 fork.c 1.4
M +0 -2 fork.stderr.exp 1.4
M +1 -0 fork.vgtest 1.3
--- valgrind/none/tests/fork.c #1.3:1.4
@@ -2,4 +2,5 @@
#include <unistd.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <stdio.h>
@@ -17,4 +18,7 @@ int main(void)
printf("%s", pid==0 ? "X" : "XX");
+ if (pid != 0)
+ waitpid(pid, NULL, 0);
+
return 0;
}
--- valgrind/none/tests/fork.stderr.exp #1.3:1.4
@@ -1,2 +0,0 @@
-
-
--- valgrind/none/tests/fork.vgtest #1.2:1.3
@@ -1 +1,2 @@
prog: fork
+vgopts: -q
|
|
From: Jeremy F. <je...@go...> - 2004-01-16 02:20:26
|
CVS commit by fitzhardinge: Add other .exp file for exec-sigmask. A exec-sigmask.stdout.exp 1.1 |
|
From: Jeremy F. <je...@go...> - 2004-01-19 21:48:25
|
CVS commit by fitzhardinge:
Reduce the pounding.
M +1 -1 map_unmap.c 1.4
--- valgrind/none/tests/map_unmap.c #1.3:1.4
@@ -57,5 +57,5 @@ int main()
munmap(expect2, LEN);
- for(i = 0; i < 1000; i++) {
+ for(i = 0; i < 100; i++) {
void *m1, *m2;
|
|
From: Jeremy F. <je...@go...> - 2004-01-21 01:21:14
|
CVS commit by fitzhardinge: Hasn't this been added already? A exec-sigmask.vgtest 1.1 |
|
From: Nicholas N. <nj...@ca...> - 2004-02-12 08:37:10
|
CVS commit by nethercote: Add files I forgot to when I committed Tom Hughes' patch for bug 73907. A insn_basic.def 1.1 A insn_basic.stderr.exp 1.1 A insn_basic.stdout.exp 1.1 A insn_basic.vgtest 1.1 A insn_cmov.def 1.1 A insn_cmov.stderr.exp 1.1 A insn_cmov.stdout.exp 1.1 A insn_cmov.vgtest 1.1 A insn_mmxext.def 1.1 A insn_mmxext.stderr.exp 1.1 A insn_mmxext.stdout.exp 1.1 A insn_mmxext.vgtest 1.1 |
|
From: Nicholas N. <nj...@ca...> - 2004-02-14 16:56:30
|
CVS commit by nethercote:
Remove compile warnings.
M +2 -0 gen_insn_test.pl 1.3
--- valgrind/none/tests/gen_insn_test.pl #1.2:1.3
@@ -135,4 +135,5 @@
}
+__attribute__((unused))
static int eq_float(float f1, float f2)
{
@@ -140,4 +141,5 @@
}
+__attribute__((unused))
static int eq_double(double d1, double d2)
{
|
|
From: Nicholas N. <nj...@ca...> - 2004-02-15 16:15:47
|
CVS commit by nethercote:
whoops
A closeall.c 1.1 [no copyright]
A closeall.stderr.exp 1.1
A closeall.vgtest 1.1
M +3 -1 Makefile.am 1.26
--- valgrind/none/tests/Makefile.am #1.25:1.26
@@ -51,4 +51,5 @@
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
+ system.stdout.exp system.vgtest
yield.stdout.exp yield.vgtest
@@ -60,5 +61,5 @@
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
tls.so tls2.so tls pth_blockedsig \
- syscall-restart1 syscall-restart2 \
+ syscall-restart1 syscall-restart2 system \
coolo_sigaction gxx304 yield
@@ -108,4 +109,5 @@
syscall_restart1_SOURCES = syscall-restart1.c
syscall_restart2_SOURCES = syscall-restart2.c
+system_SOURCES = system.c
tls_SOURCES = tls.c tls2.c
tls_DEPENDENCIES = tls.so
|
|
From: Dirk M. <mu...@kd...> - 2004-02-20 14:52:08
|
CVS commit by mueller:
get rid of the thread local storage tests until somebody
writes a configure check for them.
M +11 -13 Makefile.am 1.27
--- valgrind/none/tests/Makefile.am #1.26:1.27
@@ -60,5 +60,5 @@
munmap_exe map_unmap mremap rcl_assert \
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
- tls.so tls2.so tls pth_blockedsig \
+ pth_blockedsig \
syscall-restart1 syscall-restart2 system \
coolo_sigaction gxx304 yield
@@ -110,19 +110,17 @@
syscall_restart2_SOURCES = syscall-restart2.c
system_SOURCES = system.c
-tls_SOURCES = tls.c tls2.c
-tls_DEPENDENCIES = tls.so
-tls_LDFLAGS = -Wl,-rpath,$(srcdir)
-tls_LDADD = tls.so -lpthread
-tls_so_SOURCES = tls_so.c
-tls_so_LDADD = tls2.so
-tls_so_DEPENDENCIES = tls2.so
-tls_so_LDFLAGS = -Wl,-rpath,$(srcdir) -shared
-tls2_so_SOURCES = tls2_so.c
-tls2_so_LDFLAGS = -shared
+#tls_SOURCES = tls.c tls2.c
+#tls_DEPENDENCIES = tls.so
+#tls_LDFLAGS = -Wl,-rpath,$(srcdir)
+#tls_LDADD = tls.so -lpthread
+#tls_so_SOURCES = tls_so.c
+#tls_so_LDADD = tls2.so
+#tls_so_DEPENDENCIES = tls2.so
+#tls_so_LDFLAGS = -Wl,-rpath,$(srcdir) -shared
+#tls2_so_SOURCES = tls2_so.c
+#tls2_so_LDFLAGS = -shared
yield_SOURCES = yield.c
yield_LDADD = -lpthread
-tls_so.o tls2_so.o: CFLAGS += -fpic
-
# pthread C ones
pth_blockedsig_SOURCES = pth_blockedsig.c
|
|
From: Dirk M. <mu...@kd...> - 2004-02-21 04:34:26
|
CVS commit by mueller:
sigh
M +1 -1 Makefile.am 1.28
R tls.vgtest 1.1
--- valgrind/none/tests/Makefile.am #1.27:1.28
@@ -47,5 +47,5 @@
shortpush.stderr.exp shortpush.vgtest \
shorts.stderr.exp shorts.vgtest \
- tls.stderr.exp tls.stdout.exp tls.vgtest \
+ tls.stderr.exp tls.stdout.exp \
smc1.stderr.exp smc1.stdout.exp smc1.vgtest \
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
|
|
From: Dirk M. <mu...@kd...> - 2004-02-23 22:10:20
|
CVS commit by mueller:
patch by Tom Hughes to make it work with gcc 2.96
M +102 -74 gen_insn_test.pl 1.4
--- valgrind/none/tests/gen_insn_test.pl #1.3:1.4
@@ -215,16 +215,16 @@
push @presets, $preset;
- print qq| $ArgTypes{$type} $name = \{|;
+ print qq| $ArgTypes{$type} $name = \{ .$subtype = \{|;
my $valuec = 0;
foreach my $value (@values)
- {
+ {
print qq|,| if $valuec > 0;
- print qq| .$subtype\[$valuec\] = $value$SubTypeSuffixes{$subtype}|;
+ print qq| $value$SubTypeSuffixes{$subtype}|;
$valuec++;
}
- print qq| \};\n|;
+ print qq| \} \};\n|;
$presetc++;
@@ -278,5 +278,5 @@
push @args, $arg;
- print qq| $ArgTypes{$type} $name = \{|;
+ print qq| $ArgTypes{$type} $name = \{ .$subtype = \{|;
my $valuec = 0;
@@ -285,9 +285,9 @@
{
print qq|,| if $valuec > 0;
- print qq| .$subtype\[$valuec\] = $value$SubTypeSuffixes{$subtype}|;
+ print qq| $value$SubTypeSuffixes{$subtype}|;
$valuec++;
}
- print qq| \};\n|;
+ print qq| \} \};\n|;
}
elsif ($arg =~ /^(imm8|imm16|imm32)\[([^\]]+)\]$/)
@@ -339,6 +339,6 @@
my $name = "result$resultc";
- if ($result =~ /^(\d+)\.(sb|ub|sw|uw|sd|ud|sq|uq|ps|pd)\[([^\]]+)\]$/)
- {
+ if ($result =~ /^(\d+)\.(sb|ub|sw|uw|sd|ud|sq|uq|ps|pd)\[([^\]]+)\]$/)
+ {
my $index = $1;
my $type = $args[$index]->{type};
@@ -383,12 +383,12 @@
print qq| $ArgTypes{$type} $name;\n|;
- }
- elsif ($result =~ /^eflags\[([^\]]+)\]$/)
- {
+ }
+ elsif ($result =~ /^eflags\[([^\]]+)\]$/)
+ {
my @values = split(/,/, $1);
-
+
$values[0] = oct($values[0]) if $values[0] =~ /^0/;
$values[1] = oct($values[1]) if $values[1] =~ /^0/;
-
+
my $result = {
name => $name,
@@ -407,13 +407,41 @@
$eflagsset = sprintf "0x%x", $values[0] & ~$values[1];
}
+ }
+ else
+ {
+ die "Can't parse result $result";
+ }
+
+ $resultc++;
}
- else
+
+ my $argnum = 0;
+
+ foreach my $result (@results)
{
- die "Can't parse result $result";
+ if ($result->{type} =~ /^(m(8|16|32|64|128)|eflags)$/)
+ {
+ $result->{argnum} = $argnum++;
+ }
}
- $resultc++;
+ foreach my $arg (@presets, @args)
+ {
+ if (defined($arg->{name}))
+ {
+ $arg->{argnum} = $argnum++;
+ }
}
+ foreach my $result (@results)
+ {
+ if ($result->{type} =~ /^(r(8|16|32)|mm|xmm)$/)
+ {
+ $result->{argnum} = $argnum++;
+ }
+ }
+
+ my $stateargnum = $argnum++;
+
print qq| char state\[108\];\n|;
print qq|\n|;
@@ -421,5 +449,5 @@
print qq| \{\n|;
print qq| asm\(\n|;
- print qq| \"fsave %\[state\]\\n\"\n|;
+ print qq| \"fsave %$stateargnum\\n\"\n|;
foreach my $arg (@presets, @args)
@@ -427,23 +455,23 @@
if ($arg->{type} eq "r8")
{
- print qq| \"movb %\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
+ print qq| \"movb %$arg->{argnum}, %%$arg->{register}\\n\"\n|;
}
elsif ($arg->{type} eq "r16")
{
- print qq| \"movw %\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
+ print qq| \"movw %$arg->{argnum}, %%$arg->{register}\\n\"\n|;
}
elsif ($arg->{type} eq "r32")
{
- print qq| \"movl %\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
+ print qq| \"movl %$arg->{argnum}, %%$arg->{register}\\n\"\n|;
}
elsif ($arg->{type} eq "mm")
- {
- print qq| \"movq %\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
- }
+ {
+ print qq| \"movq %$arg->{argnum}, %%$arg->{register}\\n\"\n|;
+ }
elsif ($arg->{type} eq "xmm")
- {
- print qq| \"movlps 0%\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
- print qq| \"movhps 8%\[$arg->{name}\], %%$arg->{register}\\n\"\n|;
- }
+ {
+ print qq| \"movlps 0%$arg->{argnum}, %%$arg->{register}\\n\"\n|;
+ print qq| \"movhps 8%$arg->{argnum}, %%$arg->{register}\\n\"\n|;
+ }
}
@@ -461,5 +489,5 @@
foreach my $arg (@args)
- {
+ {
next if $arg->{type} eq "eflags";
@@ -472,9 +500,9 @@
if (exists($arg->{result}))
{
- print qq|$prefix%\[$arg->{result}->{name}\]|;
+ print qq|$prefix%$arg->{result}->{argnum}|;
}
else
{
- print qq|$prefix%\[$arg->{name}\]|;
+ print qq|$prefix%$arg->{argnum}|;
}
}
@@ -493,31 +521,31 @@
if ($result->{type} eq "r8")
{
- print qq| \"movb %%$result->{register}, %\[$result->{name}\]\\n\"\n|;
+ print qq| \"movb %%$result->{register}, %$result->{argnum}\\n\"\n|;
}
elsif ($result->{type} eq "r16")
- {
- print qq| \"movw %%$result->{register}, %\[$result->{name}\]\\n\"\n|;
- }
+ {
+ print qq| \"movw %%$result->{register}, %$result->{argnum}\\n\"\n|;
+ }
elsif ($result->{type} eq "r32")
- {
- print qq| \"movl %%$result->{register}, %\[$result->{name}\]\\n\"\n|;
- }
+ {
+ print qq| \"movl %%$result->{register}, %$result->{argnum}\\n\"\n|;
+ }
elsif ($result->{type} eq "mm")
- {
- print qq| \"movq %%$result->{register}, %\[$result->{name}\]\\n\"\n|;
- }
+ {
+ print qq| \"movq %%$result->{register}, %$result->{argnum}\\n\"\n|;
+ }
elsif ($result->{type} eq "xmm")
{
- print qq| \"movlps %%$result->{register}, 0%\[$result->{name}\]\\n\"\n|;
- print qq| \"movhps %%$result->{register}, 8%\[$result->{name}\]\\n\"\n|;
+ print qq| \"movlps %%$result->{register}, 0%$result->{argnum}\\n\"\n|;
+ print qq| \"movhps %%$result->{register}, 8%$result->{argnum}\\n\"\n|;
}
elsif ($result->{type} eq "eflags")
- {
- print qq| \"pushfl\\n\"\n|;
- print qq| \"popl %\[$result->{name}\]\\n\"\n|;
+ {
+ print qq| \"pushfl\\n\"\n|;
+ print qq| \"popl %$result->{argnum}\\n\"\n|;
}
}
- print qq| \"frstor %\[state\]\\n\"\n|;
+ print qq| \"frstor %$stateargnum\\n\"\n|;
print qq| :|;
@@ -528,6 +556,6 @@
{
if ($result->{type} =~ /^(m(8|16|32|64|128)|eflags)$/)
- {
- print qq|$prefix\[$result->{name}\] \"=m\" \($result->{name}\)|;
+ {
+ print qq|$prefix\"=m\" \($result->{name}\)|;
$prefix = ", ";
}
@@ -542,5 +570,5 @@
if (defined($arg->{name}))
{
- print qq|$prefix\[$arg->{name}\] \"m\" \($arg->{name}\)|;
+ print qq|$prefix\"m\" \($arg->{name}\)|;
$prefix = ", ";
}
@@ -551,15 +579,15 @@
if ($result->{type} =~ /^(r(8|16|32)|mm|xmm)$/)
{
- print qq|$prefix\[$result->{name}\] \"m\" \($result->{name}\)|;
+ print qq|$prefix\"m\" \($result->{name}\)|;
$prefix = ", ";
}
}
- print qq|$prefix\[state\] \"m\" \(state[0]\)\n|;
+ print qq|$prefix\"m\" \(state[0]\)\n|;
$prefix = " : ";
foreach my $arg (@presets, @args)
- {
+ {
if ($arg->{register})
{
@@ -586,28 +614,28 @@
if ($type eq "eflags")
- {
+ {
print qq|${prefix}\($result->{name}.ud[0] & $values[0]UL\) == $values[1]UL|;
- }
- else
- {
- foreach my $value (0 .. $#values)
+ }
+ else
{
- if ($subtype eq "ps")
+ foreach my $value (0 .. $#values)
{
+ if ($subtype eq "ps")
+ {
print qq|${prefix}eq_float($result->{name}.$subtype\[$value\], $values[$value]$suffix)|;
- }
+ }
elsif ($subtype eq "pd")
- {
+ {
print qq|${prefix}eq_double($result->{name}.$subtype\[$value\], $values[$value]$suffix)|;
- }
- else
- {
+ }
+ else
+ {
print qq|${prefix}$result->{name}.$subtype\[$value\] == $values[$value]$suffix|;
+ }
+
+ $prefix = " && ";
}
-
- $prefix = " && ";
}
- }
-
+
$prefix = " &&\n ";
}
@@ -629,16 +657,16 @@
if ($type eq "eflags")
- {
+ {
print qq| printf(" eflags & 0x%lx = 0x%lx (expected 0x%lx)\\n", $values[0]UL, $result->{name}.ud\[0\] & $values[0]UL, $values[1]UL);\n|;
- }
- else
- {
- foreach my $value (0 .. $#values)
+ }
+ else
{
+ foreach my $value (0 .. $#values)
+ {
print qq| printf(" $result->{name}.$subtype\[$value\] = $SubTypeFormats{$subtype} (expected $SubTypeFormats{$subtype})\\n", $result->{name}.$subtype\[$value\], $values[$value]$suffix);\n|;
}
}
}
-
+
print qq| \}\n|;
print qq| \}\n|;
|
|
From: Tom H. <th...@cy...> - 2004-03-16 10:51:35
|
CVS commit by thughes:
Added the new badseg test to the list of things to build.
M +3 -1 Makefile.am 1.32
--- valgrind/none/tests/Makefile.am #1.31:1.32
@@ -6,4 +6,5 @@
EXTRA_DIST = $(noinst_SCRIPTS) \
args.stderr.exp args.stdout.exp args.vgtest \
+ badseg.stderr.exp badseg.stdout.exp badseg.vgtest \
bitfield1.stderr.exp bitfield1.vgtest \
bt_everything.stderr.exp \
@@ -56,5 +57,5 @@
check_PROGRAMS = \
- args bitfield1 bt_everything bt_literal closeall coolo_strlen \
+ args badseg bitfield1 bt_everything bt_literal closeall coolo_strlen \
cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
fucomip $(INSN_TESTS) \
@@ -70,4 +71,5 @@
# generic C ones
args_SOURCES = args.c
+badseg_SOURCES = badseg.c
bitfield1_SOURCES = bitfield1.c
bt_everything_SOURCES = bt_everything.c
|
|
From: Tom H. <th...@cy...> - 2004-03-16 10:51:49
|
CVS commit by thughes: Fixed compiler warning. M +1 -0 badseg.c 1.2 --- valgrind/none/tests/badseg.c #1.1:1.2 @@ -1,3 +1,4 @@ #include <stdio.h> +#include <stdlib.h> #include <signal.h> |
|
From: Tom H. <th...@cy...> - 2004-03-16 11:04:08
|
CVS commit by thughes: Added badseg to the list of things to ignore. M +1 -0 .cvsignore 1.12 --- valgrind/none/tests/.cvsignore #1.11:1.12 @@ -2,4 +2,5 @@ Makefile args +badseg bitfield1 bt_everything |
|
From: Tom H. <th...@cy...> - 2004-03-28 00:31:35
|
CVS commit by thughes: Ignore generated files from insn_fpu test. M +2 -0 .cvsignore 1.15 --- valgrind/none/tests/.cvsignore #1.14:1.15 @@ -20,4 +20,6 @@ insn_basic insn_basic.c +insn_fpu +insn_fpu.c insn_cmov insn_cmov.c |
|
From: Tom H. <th...@cy...> - 2004-03-28 08:43:40
|
CVS commit by thughes:
Fix typo that broke tests which compared the contents of eflags.
M +1 -1 gen_insn_test.pl 1.6
--- valgrind/none/tests/gen_insn_test.pl #1.5:1.6
@@ -562,5 +562,5 @@
foreach my $result (@results)
{
- if ($result->{type} =~ /^(m(8|16|32|64|128)|st|flags|fpusw)$/)
+ if ($result->{type} =~ /^(m(8|16|32|64|128)|st|eflags|fpusw)$/)
{
$result->{argnum} = $argnum++;
|
|
From: Tom H. <th...@cy...> - 2004-06-14 13:15:49
|
CVS commit by thughes: Include config.h so that the test for semtimedop works. M +1 -0 sem.c 1.3 --- valgrind/none/tests/sem.c #1.2:1.3 @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include <config.h> #include <errno.h> #include <stdio.h> |
|
From: Tom H. <th...@cy...> - 2004-06-14 17:27:46
|
CVS commit by thughes:
Don't bother trying to test semtimedop if it isn't available.
M +7 -51 sem.c 1.4
--- valgrind/none/tests/sem.c #1.3:1.4
@@ -8,59 +8,11 @@
#include <sys/sem.h>
-#ifndef HAVE_SEMTIMEDOP
-
-#include <signal.h>
-#include <sys/time.h>
-
-static int semtimedop(int semid, struct sembuf *sops, unsigned nsops,
- struct timespec *timeout)
-{
- struct sigaction act;
- struct sigaction oldact;
- struct itimerval itv;
- int rv;
-
- act.sa_handler = SIG_IGN;
- sigemptyset( &act.sa_mask );
- act.sa_flags = 0;
-
- if (sigaction(SIGALRM, &act, &oldact) < 0)
- {
- perror("sigaction");
- exit(1);
- }
-
- itv.it_interval.tv_sec = 0;
- itv.it_interval.tv_usec = 0;
- itv.it_value.tv_sec = timeout->tv_sec;
- itv.it_value.tv_usec = timeout->tv_nsec / 1000;
-
- if (setitimer(ITIMER_REAL, &itv, NULL) < 0)
- {
- perror("setitimer");
- exit(1);
- }
-
- if ((rv = semop(semid, sops, nsops)) < 0 && errno == EINTR)
- {
- errno = EAGAIN;
- }
-
- if (sigaction(SIGALRM, &oldact, NULL) < 0)
- {
- perror("sigaction");
- exit(1);
- }
-
- return rv;
-}
-
-#endif
-
int main(int argc, char **argv)
{
int semid;
struct sembuf sop;
+#ifdef HAVE_SEMTIMEDOP
struct timespec ts;
+#endif
if ((semid = semget(IPC_PRIVATE, 1, 0600)) < 0)
@@ -81,4 +33,5 @@ int main(int argc, char **argv)
}
+#ifdef HAVE_SEMTIMEDOP
sop.sem_num = 0;
sop.sem_op = 0;
@@ -86,5 +39,5 @@ int main(int argc, char **argv)
ts.tv_sec = 0;
- ts.tv_nsec = 1000;
+ ts.tv_nsec = 1000000;
if (semtimedop(semid, &sop, 1, &ts) < 0 && errno != EAGAIN)
@@ -94,4 +47,5 @@ int main(int argc, char **argv)
exit(1);
}
+#endif
sop.sem_num = 0;
@@ -106,4 +60,5 @@ int main(int argc, char **argv)
}
+#ifdef HAVE_SEMTIMEDOP
sop.sem_num = 0;
sop.sem_op = 0;
@@ -119,4 +74,5 @@ int main(int argc, char **argv)
exit(1);
}
+#endif
if (semctl(semid, 0, IPC_RMID) < 0)
|
|
From: Tom H. <th...@cy...> - 2004-06-28 21:38:06
|
CVS commit by thughes:
Fixed typo in makefile.
M +1 -1 Makefile.am 1.40
--- valgrind/none/tests/Makefile.am #1.39:1.40
@@ -28,5 +28,5 @@
discard.vgtest \
exec-sigmask.vgtest exec-sigmask.stdout.exp exec-sigmask.stderr.exp \
- execve.vgtext execve.stdout.exp execve.stderr.exp \
+ execve.vgtest execve.stdout.exp execve.stderr.exp \
floored.stderr.exp floored.stdout.exp \
floored.vgtest \
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-10 16:11:05
|
CVS commit by nethercote: Minor Makefile.am fix (doesn't actually change behaviour, because automake's default rules meant 'execve' was being built anyway... but the fix at least avoids confusion). M +1 -1 Makefile.am 1.41 --- valgrind/none/tests/Makefile.am #1.40:1.41 @@ -92,5 +92,5 @@ discard_SOURCES = discard.c exec_sigmask_SOURCES = exec-sigmask.c -execve = execve.c +execve_SOURCES = execve.c fork_SOURCES = fork.c floored_SOURCES = floored.c |
|
From: Nicholas N. <nj...@ca...> - 2004-10-19 19:12:25
|
CVS commit by nethercote: Arch-abstraction: - Forgot to move the insn_*.def files when moving the insn_* tests. A x86/insn_basic.def 1.1 A x86/insn_cmov.def 1.1 A x86/insn_fpu.def 1.1 A x86/insn_mmx.def 1.1 A x86/insn_mmxext.def 1.1 A x86/insn_sse.def 1.1 A x86/insn_sse2.def 1.1 R insn_basic.def 1.1 R insn_cmov.def 1.1 R insn_fpu.def 1.4 R insn_mmx.def 1.2 R insn_mmxext.def 1.2 R insn_sse.def 1.3 R insn_sse2.def 1.3 |
|
From: Nicholas N. <nj...@ca...> - 2004-10-20 13:22:01
|
CVS commit by nethercote:
Arch-abstraction:
- conditionally compile x86-specific line within yield.c.
M +1 -0 Makefile.am 1.47
M +4 -0 yield.c 1.2
--- valgrind/none/tests/Makefile.am #1.46:1.47
@@ -108,4 +108,5 @@
#tls2_so_LDFLAGS = -shared
yield_SOURCES = yield.c
+yield_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH)__
yield_LDADD = -lpthread
--- valgrind/none/tests/yield.c #1.1:1.2
@@ -36,5 +36,9 @@ static void *th2(void *v)
while(alive) {
rep_nop++;
+#ifdef __x86__
+ // This gives a hint to a P4, telling it to pause
+ // (ie. we're in a spin-wait loop)
asm volatile ("rep; nop" : : : "memory");
+#endif
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-27 14:06:58
|
CVS commit by nethercote:
Make exec-sigmask more robust.
A exec-sigmask.stdout.exp2 1.1
M +2 -1 Makefile.am 1.49
--- valgrind/none/tests/Makefile.am #1.48:1.49
@@ -18,5 +18,6 @@
discard.stderr.exp discard.stdout.exp \
discard.vgtest \
- exec-sigmask.vgtest exec-sigmask.stdout.exp exec-sigmask.stderr.exp \
+ exec-sigmask.vgtest exec-sigmask.stdout.exp
+ exec-sigmask.stdout.exp2 exec-sigmask.stderr.exp \
execve.vgtest execve.stdout.exp execve.stderr.exp \
fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-29 13:17:46
|
CVS commit by nethercote:
whoops
M +1 -1 Makefile.am 1.50
--- valgrind/none/tests/Makefile.am #1.49:1.50
@@ -18,5 +18,5 @@
discard.stderr.exp discard.stdout.exp \
discard.vgtest \
- exec-sigmask.vgtest exec-sigmask.stdout.exp
+ exec-sigmask.vgtest exec-sigmask.stdout.exp \
exec-sigmask.stdout.exp2 exec-sigmask.stderr.exp \
execve.vgtest execve.stdout.exp execve.stderr.exp \
|
|
From: Tom H. <th...@cy...> - 2005-01-10 10:45:42
|
CVS commit by thughes:
Broadcast the condition variable instead of signalling because we
want to wake both the threads. Also initialise the mutex and condition
variable properly.
M +3 -3 yield.c 1.3
--- valgrind/none/tests/yield.c #1.2:1.3
@@ -4,6 +4,6 @@
#include <unistd.h>
-static pthread_mutex_t m_go;
-static pthread_cond_t c_go;
+static pthread_mutex_t m_go = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t c_go = PTHREAD_COND_INITIALIZER;
static volatile int alive;
@@ -56,5 +56,5 @@ int main()
pthread_mutex_lock(&m_go);
alive = 1;
- pthread_cond_signal(&c_go);
+ pthread_cond_broadcast(&c_go);
pthread_mutex_unlock(&m_go);
|