Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jun 2002 21:43:01 +0800
From:      "kai ouyang" <oykai@msn.com>
To:        <current@FreeBSD.org>
Subject:   Help!
Message-ID:  <OE1349FFf70DQLGJZGT0000e264@hotmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
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 strolling in FreeBSD5.0 kernel.  
 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 simplelock *mutex)
{
 int ret;
 if (mutex != NULL)
  simple_unlock(mutex);
 ret = tsleep(cond, pri, text, time);
 if (mutex != 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 *mutex)
{
 int ret;
 if (mutex != NULL)
  mtx_unlock(mutex);
 ret = tsleep(cond, pri, text, time);
 if (mutex != NULL)
  mtx_lock(mutex);
 return (ret);
}

I have a clear ideal to use mtx.  
I think there are maybe some problem in using the mtx.
Thank you very much!

Best Regards
Ouyang Kai从网站得到更多信息。MSN Explorer 免费下载:http://explorer.msn.com/lccn

[-- Attachment #2 --]
<HTML><BODY STYLE="font:10pt verdana; border:none;"><DIV>Hi, everybody</DIV> <DIV>&nbsp;I am working on transfer RaidFrame from FreeBSD4.x to FreeBSD5.0.&nbsp; Scott Long has transfered RAIDFrame from NetBSD to FreeBSD 4.x.</DIV> <DIV>Now, I am transfering those codes to FreeBSD5.0. This is my first strolling in FreeBSD5.0 kernel. </DIV> <DIV>&nbsp;Firstly, I transfered some codes based on the relationship of vinum and ccd between 4.x and 5.0. It could compile successfully.</DIV> <DIV>&nbsp;Now when I boot the box, the system tell me:</DIV> <DIV>&nbsp;panic: sleeping without a mutex</DIV> <DIV>&nbsp;Debugger("panic")</DIV> <DIV>Stopped at Debugger+0x40: xorl %eax,%eax</DIV> <DIV>&nbsp;</DIV> <DIV>I traced the source code and found some information as follow:</DIV> <DIV>These is a function on RAIDFrame in the FreeBSD4.x .</DIV> <DIV>static __inline int<BR>RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct simplelock *mutex)<BR>{<BR>&nbsp;int ret;<BR>&nbsp;if (mutex != NULL)<BR>&nbsp;&nbsp;simple_unlock(mutex);<BR>&nbsp;ret = tsleep(cond, pri, text, time);<BR>&nbsp;if (mutex != NULL)<BR>&nbsp;&nbsp;simple_lock(mutex);<BR>&nbsp;return (ret);<BR>}<BR></DIV> <DIV>These is the above funtion I modifed to support FreeBSD5.0:</DIV> <DIV>static __inline int<BR>RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct mtx *mutex)<BR>{<BR>&nbsp;int ret;<BR>&nbsp;if (mutex != NULL)<BR>&nbsp;&nbsp;mtx_unlock(mutex);<BR>&nbsp;ret = tsleep(cond, pri, text, time);<BR>&nbsp;if (mutex != NULL)<BR>&nbsp;&nbsp;mtx_lock(mutex);<BR>&nbsp;return (ret);<BR>}</DIV> <DIV>&nbsp;</DIV> <DIV>I have a clear ideal to use mtx. </DIV> <DIV>I think there are maybe some problem in using the mtx.</DIV> <DIV>Thank you very much!</DIV> <DIV><BR>Best Regards<BR>Ouyang Kai</DIV></BODY></HTML><br clear=all><hr>从网站得到更多信息。MSN Explorer 免费下载:<a href='http://explorer.msn.com/lccn'>http://explorer.msn.com/lccn</a><br></p>;
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OE1349FFf70DQLGJZGT0000e264>