From owner-freebsd-current Sat Jun 1 6:43:15 2002 Delivered-To: freebsd-current@freebsd.org Received: from hotmail.com (oe134.pav0.hotmail.com [64.4.33.127]) by hub.freebsd.org (Postfix) with ESMTP id DCFC637B401 for ; Sat, 1 Jun 2002 06:43:09 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 1 Jun 2002 06:43:09 -0700 X-Originating-IP: [210.74.136.33] From: "kai ouyang" To: Subject: Help! Date: Sat, 1 Jun 2002 21:43:01 +0800 MIME-Version: 1.0 X-Mailer: MSN Explorer 7.00.0021.1900 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0000_01C209B5.4D632930" Message-ID: X-OriginalArrivalTime: 01 Jun 2002 13:43:09.0750 (UTC) FILETIME=[445A8560:01C20972] Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ------=_NextPart_001_0000_01C209B5.4D632930 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi, everybody I am working on transfer RaidFrame from FreeBSD4.x to FreeBSD5.0. Scott= Long has transfered RAIDFrame from NetBSD to FreeBSD 4.x. Now, I am transfering those codes to FreeBSD5.0. This is my first strolli= ng in FreeBSD5.0 kernel. =20 Firstly, I transfered some codes based on the relationship of vinum and = ccd between 4.x and 5.0. It could compile successfully. Now when I boot the box, the system tell me: panic: sleeping without a mutex Debugger("panic") Stopped at Debugger+0x40: xorl %eax,%eax I traced the source code and found some information as follow: These is a function on RAIDFrame in the FreeBSD4.x . static __inline int RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct simple= lock *mutex) { int ret; if (mutex !=3D NULL) simple_unlock(mutex); ret =3D tsleep(cond, pri, text, time); if (mutex !=3D NULL) simple_lock(mutex); return (ret); } These is the above funtion I modifed to support FreeBSD5.0: static __inline int RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct mtx *m= utex) { int ret; if (mutex !=3D NULL) mtx_unlock(mutex); ret =3D tsleep(cond, pri, text, time); if (mutex !=3D NULL) mtx_lock(mutex); return (ret); } I have a clear ideal to use mtx. =20 I think there are maybe some problem in using the mtx. Thank you very much! Best Regards Ouyang Kai=B4=D3=CD=F8=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN= Explorer =C3=E2=B7=D1=CF=C2=D4=D8:http://explorer.msn.com/lccn ------=_NextPart_001_0000_01C209B5.4D632930 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Hi, everybody<= /DIV>
 I am working on transfer RaidFrame from FreeBSD4.x to Fr= eeBSD5.0.  Scott Long has transfered RAIDFrame from NetBSD to FreeBS= D 4.x.
Now, I am transfering those codes to FreeBSD5.0. This i= s my first strolling in FreeBSD5.0 kernel.
 Firstly, I t= ransfered some codes based on the relationship of vinum and ccd between 4= .x and 5.0. It could compile successfully.
 Now when I bo= ot the box, the system tell me:
 panic: sleeping without = a mutex
 Debugger("panic")
Stopped at Debugger= +0x40: xorl %eax,%eax
 
I traced the source co= de and found some information as follow:
These is a function o= n RAIDFrame in the FreeBSD4.x .
static __inline int
RF_LTSL= EEP(void *cond, int pri, const char *text, int time, struct simplelock *m= utex)
{
 int ret;
 if (mutex !=3D NULL)
  = ;simple_unlock(mutex);
 ret =3D tsleep(cond, pri, text, time); if (mutex !=3D NULL)
  simple_lock(mutex);
 r= eturn (ret);
}
These is the above funtion I modifed to = support FreeBSD5.0:
static __inline int
RF_LTSLEEP(void *co= nd, int pri, const char *text, int time, struct mtx *mutex)
{
 = ;int ret;
 if (mutex !=3D NULL)
  mtx_unlock(mutex);=
 ret =3D tsleep(cond, pri, text, time);
 if (mutex !=3D = NULL)
  mtx_lock(mutex);
 return (ret);
}
<= DIV> 
I have a clear ideal to use mtx.
I thin= k there are maybe some problem in using the mtx.
Thank you ver= y much!

Best Regards
Ouyang Kai


=B4=D3=CD=F8=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1= =A3MSN Explorer =C3=E2=B7=D1=CF=C2=D4=D8=A3=BAhttp://explorer.msn.com/lccn

------=_NextPart_001_0000_01C209B5.4D632930-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message