* Re: do_ri( )
[not found] <008701c165ac$1a49a9a0$4c0c5c8c@trd.iii.org.tw>
@ 2001-11-05 4:33 ` Bradley D. LaRonde
2001-11-08 0:50 ` memory mapping for MIPS 4Kc Waren Hardy
0 siblings, 1 reply; 3+ messages in thread
From: Bradley D. LaRonde @ 2001-11-05 4:33 UTC (permalink / raw)
To: Green, Linux-mips, MipsMailList
I've seen the same thing but on a different processor (VR5432). gcc 3.0.1,
glibc 2.2.3. I suspect stack/register corruption.
Regards,
Brad
----- Original Message -----
From: Green
To: Linux-mips ; MipsMailList
Sent: Sunday, November 04, 2001 10:43 PM
Subject: do_ri( )
Dear all,
I often get into trouble executing multithread application.
Sometimes it will appear the message " Illegal instruction = 0xXXXX " in
do_ri() function in /arch/mips/kernel/traps.c.
It happened randomly.
Up to now, I still didn't know how to fix bug.
If any one know how to fix it, please reply me.
Appreciate in sincerely.
P.S My mips bos is R3912.
~~
Green greeen@iii.org.tw
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: do_ri( )
@ 2001-11-05 17:18 TWEDE,ROGER (HP-Boise,ex1)
0 siblings, 0 replies; 3+ messages in thread
From: TWEDE,ROGER (HP-Boise,ex1) @ 2001-11-05 17:18 UTC (permalink / raw)
To: 'Bradley D. LaRonde', Green, Linux-mips, MipsMailList
I've seen the same with glibc 2.2.4 on the QED RM5261 processor (Mips 5000).
I can take a multi-threaded application that runs without fail using glibc
2.2.2 and reproduce the failure using glibc 2.2.3 and glibc 2.2.4.
A small test app I wrote to exhibit the problem is included below.
I was using gcc 3.0 at the time. I question whether gcc 2.96 might help
since the glibc variants at sgi.com were compiled using 2.96.
Regards,
Roger
// CODE STARTS BELOW
#include <assert.h>
#include <pthread.h>
#include <sched.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
struct ThreadStartInfo {
pthread_mutex_t InitCompleteMutex;
pthread_cond_t InitCompleteCond;
void * (*Func)(void *);
void * Arg;
int Priority;
char * ThreadName;
unsigned char InitCompleteCount;
};
static void * StartFunction(void * Arg)
{
struct ThreadStartInfo * StartInfo = (struct ThreadStartInfo *) Arg;
int result;
void * retVal = 0;
assert(Arg != NULL);
result = pthread_mutex_lock(&(StartInfo->InitCompleteMutex));
assert(result == 0);
printf("pid=%d thread mutex locked at x%x\n", getpid(),
&(StartInfo->InitCompleteMutex));
StartInfo->InitCompleteCount = 1;
result = pthread_cond_signal(&(StartInfo->InitCompleteCond));
assert(result == 0);
printf("pid=%d thread cond signal sent, unlocking at 0x%x\n", getpid(),
&(StartInfo->InitCompleteMutex));
result = pthread_mutex_unlock(&(StartInfo->InitCompleteMutex));
assert(result == 0);
printf("pid=%d thread unlocked\n", getpid());
sched_yield();
printf("pid=%d yielded and back again\n", getpid());
return(retVal);
}
int main(void)
{
pthread_t ThreadObject;
struct ThreadStartInfo StartInfo;
pthread_mutexattr_t mutexAttr;
pthread_attr_t threadAttr;
pthread_condattr_t condAttr;
int result = 0;
StartInfo.ThreadName = "mythread";
result = pthread_mutexattr_init(&mutexAttr);
assert(result == 0);
printf("pid=%d Init mutex\n", getpid());
result = pthread_mutex_init(&(StartInfo.InitCompleteMutex), &mutexAttr);
assert(result == 0);
result = pthread_condattr_init(&condAttr);
assert(result == 0);
result = pthread_cond_init(&(StartInfo.InitCompleteCond), &condAttr);
assert(result == 0);
StartInfo.InitCompleteCount = 0;
pthread_mutex_lock(&(StartInfo.InitCompleteMutex));
printf("pid=%d About to create thread: %s\n", getpid(),
StartInfo.ThreadName);
result = pthread_attr_init(&threadAttr);
assert(result == 0);
result = pthread_create(&ThreadObject,
&threadAttr,
&StartFunction,
(void *)&StartInfo);
assert(result == 0);
while ((result == 0) && (StartInfo.InitCompleteCount == 0))
{
do
{
printf("pid=%d about to cond_wait for %s init 1.\n", getpid(),
StartInfo.ThreadName);
result = pthread_cond_wait(&(StartInfo.InitCompleteCond),
&(StartInfo.InitCompleteMutex));
printf("pid=%d back from cond_wait for %s init 1. result=%d\n",
getpid(), StartInfo.ThreadName, result);
} while (result == EINTR);
}
result = pthread_mutex_unlock(&(StartInfo.InitCompleteMutex));
assert(result == 0);
getchar();
return 0;
}
// CODE ABOVE
-----Original Message-----
From: Bradley D. LaRonde [mailto:brad@ltc.com]
Sent: Sunday, November 04, 2001 9:33 PM
To: Green; Linux-mips; MipsMailList
Subject: Re: do_ri( )
I've seen the same thing but on a different processor (VR5432). gcc 3.0.1,
glibc 2.2.3. I suspect stack/register corruption.
Regards,
Brad
----- Original Message -----
From: Green
To: Linux-mips ; MipsMailList
Sent: Sunday, November 04, 2001 10:43 PM
Subject: do_ri( )
Dear all,
I often get into trouble executing multithread application.
Sometimes it will appear the message " Illegal instruction = 0xXXXX " in
do_ri() function in /arch/mips/kernel/traps.c.
It happened randomly.
Up to now, I still didn't know how to fix bug.
If any one know how to fix it, please reply me.
Appreciate in sincerely.
P.S My mips bos is R3912.
~~
Green greeen@iii.org.tw
^ permalink raw reply [flat|nested] 3+ messages in thread
* memory mapping for MIPS 4Kc
2001-11-05 4:33 ` do_ri( ) Bradley D. LaRonde
@ 2001-11-08 0:50 ` Waren Hardy
0 siblings, 0 replies; 3+ messages in thread
From: Waren Hardy @ 2001-11-08 0:50 UTC (permalink / raw)
To: Linux-mips, MipsMailList
I have a small prototype board with a mips 4kc on it and I have linux
running. I have to megs of sram mapped how do i map in sdram ?
the memory map looks like
0000.0000 - 0001f.ffff 2M SRAM
0020.0000 - 0020.1fff 8K Embedded SRAM CPU
0020.2000 - 002f.fffff reserved
0030.0000 - 0030.ffff 64K Chip registers
0031.0000 - 00ff.ffff reserved
0100.0000 - 01ff.ffff 16M SDRAM
0200.0000 - 1fb0.ffff SDRAM
1fc0.0000 - 1fdf.ffff 2M ROM / FLASH
0060.0000 - ffff.ffff SDRAM
how do I get linux to read this 16M SDRAM @ 0100.000 - 01ff.ffff ? Then
how do I get linux to read RAM @ 0200.000 - 1fb0.ffff and 0060.000 -
ffff.ffff ?
We have our own load which is loading linux from ROM, and we can pass
arg to linux, can the memory be set as an argument passed ?
Thanks for you help
Warren Hardy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-11-07 23:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <008701c165ac$1a49a9a0$4c0c5c8c@trd.iii.org.tw>
2001-11-05 4:33 ` do_ri( ) Bradley D. LaRonde
2001-11-08 0:50 ` memory mapping for MIPS 4Kc Waren Hardy
2001-11-05 17:18 do_ri( ) TWEDE,ROGER (HP-Boise,ex1)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox