From: "Christian Groessler" <cpg@aladdin.de>
To: nbecker@fred.net
Cc: ericding@applix.com, axp-list@redhat.com
Subject: Re: How do I find/fix unaligned accesses?
Date: Tue, 8 Dec 1998 22:13:08 +0100 [thread overview]
Message-ID: <412566D4.0074F6BB.00@saturn.aladdin.de> (raw)
>Isn't there a syscall to stop kernel unaligned trap fixup?
The following code I've got from this mail list iirc, but cannot
remember from who it was. Sorry.
This program will spawn a subshell, in which unaligned accessed
generate a bus fault.
------------
/* 28-May-98, chris */
#ifndef __linux__
#include <sys/sysinfo.h>
#else
#include <asm/sysinfo.h>
#include <asm/unistd.h>
static int setsysinfo(unsigned long op, void *buffer, unsigned long size,
int *start, void *arg, unsigned long flag)
{
syscall(__NR_osf_setsysinfo, op, buffer, size, start, arg, flag);
}
#endif
void trap_unaligned(void)
{
unsigned int buf[2];
buf[0] = SSIN_UACPROC;
buf[1] = UAC_SIGBUS | UAC_NOPRINT;
setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0, 0);
}
int main(int ac)
{
trap_unaligned();
printf("creating subshell with SIGBUS setting!\n");
execl("/bin/bash","/bin/bash",(char *)0);
return(0); /* not reached */
}
------------
next reply other threads:[~1998-12-08 21:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-08 21:13 Christian Groessler [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-12-04 18:25 How do I find/fix unaligned accesses? Eric Ding
1998-12-04 21:16 ` Oscar Levi
1998-12-04 21:17 ` nbecker
1998-12-04 21:18 ` Harvey J. Stein
1998-12-04 21:35 ` Rich Payne
1998-12-05 2:29 ` Tom Linden
1998-12-05 16:37 ` Oscar Levi
1998-12-07 23:45 ` Eric Ding
1998-12-08 0:44 ` Richard Hadsell
1998-12-08 1:07 ` Uncle George
1998-12-08 3:58 ` Eric Ding
1998-12-08 7:16 ` Wes Bauske
1998-12-08 11:14 ` Uncle George
1998-12-08 13:04 ` nbecker
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox