{"id":289270,"date":"2024-01-01T05:26:06","date_gmt":"2023-12-31T21:26:06","guid":{"rendered":"https:\/\/lrxjmw.cn\/xlzmmmnhyshs.html"},"modified":"2024-01-01T05:26:06","modified_gmt":"2023-12-31T21:26:06","slug":"xlzmmmnhyshs","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/xlzmmmnhyshs.html","title":{"rendered":"\u5e0c\u814a\u5b57\u6bcd\u201cmu\u201d\uff08m\uff09\u5185\u6838\u5ef6\u65f6\u51fd\u6570\u4ee3\u7801"},"content":{"rendered":"
\u6709\u65f6\u9a71\u52a8\u7a0b\u5e8f\u987b\u8981\u5341\u5206\u77ed\u7684\u5ef6\u540e\u6765\u4e0e\u786c\u4ef6\u540c\u6b65\u3002\u6b64\u65f6\uff0c\u4f7f\u7528jiffies\u503c\u96be\u4ee5\u8fbe\u5230\u76ee\u7684\u3002\u8fd9\u65f6\u5c31\u8981\u7528\u5185\u6838\u51fd\u6570udelay\u548cmdelay\u3002u\u8868\u793a\u57c3\u53ca\u5b57\u6bcd\u201cmu\u201d(m)\u7ea2\u65d7linux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u4ee3\u8868\u201c\u5fae\u201d\u3002\u5b83\u4eec\u7684\u539f\u578b\u5982\u4e0b\uff1a<\/p>\n
#include<\/p>\n
voidudelay(unsignedlongusecs);\/\/\u8f6f\u4ef6\u5faa\u73af\u5ef6\u540e\u6307\u5b9a\u6570\u91cf\u7684\u6beb\u79d2\u6570<\/p>\n
<\/p>\n
voidmdelay(unsignedlongmsecs);\/\/\u4f7f\u7528udelay\u505a\u5faa\u73af<\/p>\n
\u8be5\u51fd\u6570\u5728\u7edd\u5927\u591a\u6570\u4f53\u7cfb\u7ed3\u6784\u4e0a\u662f\u4f5c\u4e3a\u5185\u8054\u51fd\u6570\u7f16\u8bd1\u7684\u3002udelay\u51fd\u6570\u91cc\u8981\u7528\u5230BogoMips\u503c\uff1a\u5b83\u7684\u5faa\u73af\u57fa\u4e8e\u6574\u6570\u503cloops_per_second\uff0c\u8fd9\u4e2a\u503c\u662f\u5728\u5f15\u5bfc\u9636\u6bb5\u4f30\u7b97BogoMips\u65f6\u5f97\u5230\u7684\u7ed3\u679c\u3002udelay\u51fd\u6570\u53ea\u80fd\u7528\u4e8e\u83b7\u53d6\u8f83\u77ed\u7684\u65f6\u95f4\u5ef6\u540elinux\u5185\u6838\u5ef6\u65f6\u51fd\u6570<\/strong>\uff0c\u7531\u4e8eloops_per_second\u503c\u7684\u7cbe\u5ea6\u53ea\u67098\u4f4d\uff0c\u6240\u4ee5\uff0c\u5f53\u4f30\u7b97\u66f4\u957f\u7684\u5ef6\u540e\u65f6\u4f1a\u79ef\u7d2f\u51fa\u76f8\u5f53\u5927\u7684\u504f\u5dee\u3002\u867d\u7136\u6700\u5927\u80fd\u5bb9\u8bb8\u7684\u5ef6\u540e\u5c06\u8fd11s(\u7531\u4e8e\u66f4\u957f\u7684\u5ef6\u540e\u5c31\u8981\u6ea2\u51fa)\uff0c\u63a8\u8350\u7684udelay\u51fd\u6570\u53c2\u6570\u6700\u5927\u503c\u662f\u53d61000us(1ms)\u3002\u5f53\u5ef6\u540e\u5c0f\u4e8e11ms\u65f6\u53ef\u4ee5\u4f7f\u7528\u51fd\u6570mdelay\u3002\u8bb8\u591a\u9a71\u52a8\u7a0b\u5e8f\u987b\u8981\u5c06\u4efb\u52a1\u5ef6\u540e\u5230\u4e4b\u540e\u5904\u7406\uff0c\u4f46\u53c8\u4e0d\u60f3\u5229\u7528\u4e2d\u65ad\u3002Linux<\/a>\u56e0\u6b64\u63d0\u4f9b\u4e86\u4e09\u79cd\u65b9\u5f0f\uff1a\u4efb\u52a1\u961f\u5217\u3001tasklet\u548c\u5185\u6838\u5b9a\u65f6\u5668\u3002<\/p>\n \u8981\u975e\u5e38\u6ce8\u610f\u7684\u662fudelay\u662f\u4e2a\u5fd9\u7b49\u5f85\u51fd\u6570linux\u5185\u6838\u5ef6\u65f6\u51fd\u6570<\/strong>\uff0c\u5728\u5ef6\u540e\u7684\u65f6\u95f4\u6bb5\u5185\u96be\u4ee5\u8fd0\u884c\u5176\u4ed6\u7684\u4efb\u52a1\u3002\u6e90\u7801\u89c1\u5934\u6587\u4ef6\u3002<\/p>\n \u76ee\u524d\u5185\u6838\u4e0d\u652f\u6301\u5c0f\u4e8e1\u7eb3\u79d2\u800c\u5927\u4e8e1\u4e2a\u65f6\u949f\u6ef4\u7b54\u7684\u5ef6\u540e\uff0c\u4f46\u8fd9\u4e0d\u662f\u4e2a\u95ee\u9898\uff0c\u7531\u4e8e\u5ef6\u540e\u662f\u7ed9\u786c\u4ef6\u6216\u5219\u4eba\u53bb\u8fa8\u8bc6\u7684\u3002\u767e\u5206\u4e4b1\u79d2\u7684\u65f6\u95f4\u95f4\u9694\u5bf9\u4eba\u6765\u8bf4\u5ef6\u540e\u7cbe\u5ea6\u8db3\u591f\u4e86\uff0c\u800c1\u7eb3\u79d2\u5bf9\u786c\u4ef6\u6765\u8bf4\u5ef6\u540e\u65f6\u95f4\u4e5f\u8db3\u591f\u957f\u3002\u5047\u5982\u4f60\u771f\u7684\u987b\u8981\u5176\u95f4\u7684\u5ef6\u540e\u95f4\u9694\u67e5\u770b\u7cfb\u7edf\u7248\u672clinux\uff0c\u4f60\u53ea\u8981\u6784\u5efa\u4e00\u4e2a\u8fde\u7eed\u6267\u884cudelay(1000)\u51fd\u6570\u7684\u5faa\u73af\u3002<\/p>\n <\/p>\n linux\u5185\u6838\u5ef6\u65f6\u51fd\u6570<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n 1\u3001#include<\/p>\n voiddo_gettimeofday(structtimeval<\/p>\n","protected":false},"excerpt":{"rendered":" \u8fd9\u65f6\u5c31\u8981\u7528\u5185\u6838\u51fd\u6570udelay\u548cmdelay\u3002udelay\u51fd\u6570\u91cc\u8981\u7528\u5230BogoMips\u503c\uff1a\u5b83\u7684\u5faa\u73af\u57fa\u4e8e\u6574\u6570\u503cloops_per_second\uff0c\u8fd9\u4e2a\u503c\u662f\u5728\u5f15\u5bfc\u9636\u6bb5\u8ba1\u7b97BogoMips\u65f6\u5f97\u5230\u7684\u7ed3\u679c\u3002Linux\u4e3a\u6b64\u63d0\u4f9b\u4e86\u4e09\u79cd\u65b9\u6cd5\uff1a\u4efb\u52a1\u961f\u5217\u3001tasklet\u548c\u5185\u6838\u5b9a\u65f6\u5668\u3002linux\u5185\u6838\u5ef6\u65f6\u51fd\u6570\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n","protected":false},"author":1,"featured_media":289271,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-289270","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=289270"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289270\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/289271"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=289270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=289270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=289270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}