public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] suggestions regarding except1 and kexcept1 kernel tests
@ 2004-09-16  4:55 sandeep
  2004-09-16  8:59 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: sandeep @ 2004-09-16  4:55 UTC (permalink / raw)
  To: ecos-discuss

hi dsm/jl,

wouldn't it be better if following section of code in
except1 and kexcept1 kernel tests are moved under
"#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS" to cause
illegal access, as in compat/posix - signal2 test.

also, what is your view on keeping the illegal access
and unaligned access testings separate in mentioned
kernel tests (code snippet below doing both at same
time), as being done in similar posix test signal2.

-----------------
  // First try for an address exception (unaligned
access exception
    // or SEGV/BUS exceptions)
    do {
        x=*(volatile int *)(p-1);
        p+=0x100000;
    } while(p != 0);
-----------------

regards
sandeep



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] suggestions regarding except1 and kexcept1 kernel tests
  2004-09-16  4:55 [ECOS] suggestions regarding except1 and kexcept1 kernel tests sandeep
@ 2004-09-16  8:59 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2004-09-16  8:59 UTC (permalink / raw)
  To: sandeep; +Cc: ecos-discuss

sandeep <shimple0@yahoo.com> writes:

> hi dsm/jl,
> 
> wouldn't it be better if following section of code in
> except1 and kexcept1 kernel tests are moved under
> "#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS" to cause
> illegal access, as in compat/posix - signal2 test.
> 
> also, what is your view on keeping the illegal access
> and unaligned access testings separate in mentioned
> kernel tests (code snippet below doing both at same
> time), as being done in similar posix test signal2.
> 
> -----------------
>   // First try for an address exception (unaligned
> access exception
>     // or SEGV/BUS exceptions)
>     do {
>         x=*(volatile int *)(p-1);
>         p+=0x100000;
>     } while(p != 0);
> -----------------

The idea here is to try and generatate an exception of any sort. We
are not really concerned with trying to test each possible exception
source, just the kernel exception handling code. Since we don't know
what sort of exceptions the underlying hardware is capable of, we just
try a bunch of things that are likely to cause an exception. Doing the
unaligned and illegal accesses together is an optimization. If
that fails then we try an FP exception. Any target that doesn't
generate an exception for at least one of those probably won't
generate any exceptions at all.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-16  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-16  4:55 [ECOS] suggestions regarding except1 and kexcept1 kernel tests sandeep
2004-09-16  8:59 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).