Search
lxdream.org :: lxdream/acinclude.m4 :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename acinclude.m4
changeset 927:17b6b9e245d8
prev923:13ac59a786f4
next964:f2f3c7612d06
author nkeynes
date Tue Jan 06 01:58:08 2009 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Fully integrate SQ with the new address space code - added additional 'prefetch'
memory accessor. TLB is utterly untested, but non-TLB at least still works.
file annotate diff log raw
1.1 --- a/acinclude.m4 Thu Dec 11 23:28:50 2008 +0000
1.2 +++ b/acinclude.m4 Tue Jan 06 01:58:08 2009 +0000
1.3 @@ -18,3 +18,37 @@
1.4 $2 ])
1.5 ])
1.6
1.7 +# AC_CHECK_FRAME_ADDRESS([if-ok],[if-notok])
1.8 +# Test if the compiler will let us modify the return address on the stack
1.9 +# via __builtin_frame_address()
1.10 +# -----------------------
1.11 +AC_DEFUN([AC_CHECK_FRAME_ADDRESS], [
1.12 +AC_MSG_CHECKING([if we have a working __builtin_frame_address()]);
1.13 +AC_RUN_IFELSE([
1.14 + AC_LANG_SOURCE([[
1.15 +void * __attribute__((noinline)) first_arg( void *x, void *y ) { return x; }
1.16 +int __attribute__((noinline)) foo( int arg, void *exc )
1.17 +{
1.18 + if( arg < 2 ) {
1.19 + *(((void **)__builtin_frame_address(0))+1) = exc;
1.20 + }
1.21 + return 0;
1.22 +}
1.23 +
1.24 +int main(int argc, char *argv[])
1.25 +{
1.26 + goto *first_arg(&&start, &&except);
1.27 +
1.28 +start:
1.29 + return foo( argc, &&except ) + 1;
1.30 +
1.31 +except:
1.32 + return 0;
1.33 +}]])], [
1.34 + AC_MSG_RESULT([yes])
1.35 + $1 ], [
1.36 + AC_MSG_RESULT([no])
1.37 + $2 ])
1.38 +])
1.39 +
1.40 +
.