Add test code for synchronizing caches for signal trampoline code

This commit is contained in:
ws 1999-07-08 17:37:35 +00:00
parent 2f247ac8dd
commit ea80527b05
4 changed files with 53 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.7 1999/06/02 15:57:18 drochner Exp $
# $NetBSD: Makefile,v 1.8 1999/07/08 17:37:35 ws Exp $
SUBDIR+= execve extent unfdpass getcwd
SUBDIR+= execve extent unfdpass getcwd sigtramp
.include <bsd.subdir.mk>

View File

@ -0,0 +1,10 @@
# $NetBSD: Makefile,v 1.1 1999/07/08 17:37:36 ws Exp $
#
PROG= sigtramp
MKMAN= no
LDFLAGS= -static -N
regress:
sh ${.CURDIR}/dotest
.include <bsd.prog.mk>

View File

@ -0,0 +1,19 @@
#!/bin/sh
# Do a bunch of runs of this program
for i in 0 1 2 3 4 5 6 7 8 9
do
for j in 0 1 2 3 4 5 6 7 8 9
do
for k in 0 1 2 3 4 5 6 7 8 9
do
if ./sigtramp
then
:
else
exit 1
fi
done
done
done

View File

@ -0,0 +1,22 @@
/*
* This program checks whether the kernel correctly synchronizes
* I&D-caches after copying out the signal trampoline code.
*/
#include <signal.h>
void catch(sig)
int sig;
{
return;
}
main()
{
static struct sigaction sa;
sa.sa_handler = catch;
sigaction(SIGUSR1, &sa, 0);
kill(getpid(), SIGUSR1);
return 0;
}