Subject: Re: build aborts in regress/lib/libpthread/sem
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Christian Groessler <cpg@aladdin.de>
List: port-dreamcast
Date: 02/13/2003 13:46:15
On 02/13/2003 08:44:08 PM ZE9 Izumi Tsutsui wrote:
>
>In article <200302131036.LAA31403@panther.aladdin.de>
>cpg@aladdin.de wrote:
>
>> >Nether I'm a VM guru, but in this case the buffer address passed from
>> >MI mb86964.c is kernel mbufs' one, so it would never be paged out.
>>
>> Hmm, then why does the patch make a difference? My idea was because of
>> memory been paged out, the page not present exception was the
>> problem.
>
>I guess the difference is the period between
>_cpu_exception_suspend() and _cpu_exception_resume().

I think it isn't the time. I first tried this version

{
		 __volatile u_int8_t *baddr = (u_int8_t *)(sh + (off * 4));
		 while (len--) {
		 		 G2_LOCK;
		 		 *baddr = *addr++;
		 		 G2_UNLOCK;
		 }
}

It also caused the reboot. When I moved the *addr access outside of
the G2_LOCK, the reboot disappeared:

{
		 __volatile u_int8_t *baddr = (u_int8_t *)(sh + (off * 4));
		 u_int8_t data;

		 while (len--) {
		 		 data = *addr++;
		 		 G2_LOCK;
		 		 *baddr = data;
		 		 G2_UNLOCK;
		 }
}


>In arch/sh3/sh3/locore_subr.S:_cpu_exception_suspend():
>
>/*
> * u_int32_t _cpu_exception_suspend(void):
> *      Block exception (SR.BL). if external interrupt raise, pending interrupt.
> *      if exception occur, jump to 0xa0000000 (hard reset).
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> */

Ah, this might explain why it simply reboots without message or
dropping into ddb...

regards,
chris