Add test code for synchronizing caches for signal trampoline code
This commit is contained in:
parent
2f247ac8dd
commit
ea80527b05
@ -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>
|
||||
|
10
regress/sys/kern/sigtramp/Makefile
Normal file
10
regress/sys/kern/sigtramp/Makefile
Normal 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>
|
19
regress/sys/kern/sigtramp/dotest
Normal file
19
regress/sys/kern/sigtramp/dotest
Normal 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
|
22
regress/sys/kern/sigtramp/sigtramp.c
Normal file
22
regress/sys/kern/sigtramp/sigtramp.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user