sc_pend 함수의 의미

bakdorazi의 이미지

안녕하세요.

struct mbox rtsem;
..........................................
 
중략
 
.......................................
 
 body += sprintf(body,"\
                                 <TD width=\"64\" bgColor=whitesmoke height=25>&nbsp;Netmask</TD>\n\
                                <TD width=\"221\" height=25>&nbsp;<input class=\"num\" maxLength=3 size=3 \n\
                                 name=lan_mask1 value=\"%d\" onKeyUp=next(this,this.form.lan_mask2,3)>. <input class=\"num\" maxLength=3 size=3\n\
                                 name=lan_mask2 value=\"%d\" onKeyUp=next(this,this.form.lan_mask3,3)>. <input class=\"num\" maxLength=3 size=3\n\
                                 name=lan_mask3 value=\"%d\" onKeyUp=next(this,this.form.lan_mask4,3)>. <input class=\"num\" maxLength=3 size=3\n\
                                 name=lan_mask4 value=\"%d\"><input class=\"num\" type=hidden name=lan_mask></TD>\n",(ifp->ni_mask >> 24) & 0x000000FF,
                         (ifp->ni_mask >> 16) & 0x000000FF,
                         (ifp->ni_mask >> 8) & 0x000000FF,
                         (ifp->ni_mask) & 0x000000FF);
 
sc_pend(&rtsem,0,&err);
 
....................................................

C와 HML이 혼용된 위와 같은 웹페이지를 수정하고 있습니다.

여기에서

sc_pend(&rtsem, 0, &err);

이 구문이 이해가 안가는 데요..

검색을 해도 사용용례만 있을 뿐 정확한 함수 정의나 사용법에 대한 레퍼런스는 없더군요...

제가 의문이 나는 부분은 위의 lan_mask 값을 rtsem 이 저장하는 것 같은데 (맞나요?)

코드의 앞뒤로 rtsem 에 lan_mask 값이 저장되는 모습이 안보입니다...

혹시나 sc_pend에 대해 아시거나 위의 코드가 정확히 무엇을 말하는 지 아시는 분 있으시면 말씀 좀 해주세요...

감사합니다.

nthroot의 이미지

"sc_pend(mboxp, timeout, errp)
입력 파라미터 mboxp로 지정된 mailbox로부터 message를 pend한다. mbox에 message가
존재하면 message를 돌려준 후 mailbox를 reset하고 현재의 task를 계속 수행한다. 만약
mailbox가 비어 있으면 task는 pending 상태로 들어가고 task switching이 일어난다. 또한
입력 파라미터 timeout에 지정된 시간 내에 mailbox에 message가 들어오지 않을 경우
pending이 끝나고 현재의 task가 계속 수행된다."

------식은이 처------
길이 끝나는 저기엔 아무 것도 없어요. 희망이고 나발이고 아무 것도 없어.

bakdorazi의 이미지

제가 생각하던 거랑 많은 차이가 있네요..

그런데 한 가지 문제가...

님께서 하시는 말씀을 알아듣기가 좀 어렵네요...^^;

왜 웹페이지를 만드는데 Mailbox에 메시지가 들었는 지 않들었지 여부를 확인하고 Mailbox를 비우고..

거기다 Mailbox에 메시지가 없으면 작업을 pending 하다니... 에구....

제가 RTOS에 대한 개념이 없어서 그렇습니다..

조금 쉽게 설명해주시면 안되나요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.