{"id":289624,"date":"2024-01-23T05:49:00","date_gmt":"2024-01-22T21:49:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/yybcjkahxtdy.html"},"modified":"2024-01-23T05:49:00","modified_gmt":"2024-01-22T21:49:00","slug":"yybcjkahxtdy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/yybcjkahxtdy.html","title":{"rendered":"\u5e94\u7528\u7f16\u7a0b\u63a5\u53e3API\u548c\u7cfb\u7edf\u8c03\u7528\u4e4b\u95f4\u7684\u5173\u7cfb"},"content":{"rendered":"

\u7cfb\u7edf<\/a>\u8c03\u7528<\/p>\n

\u5185\u6838\u4e3a\u7528\u6237\u8fdb\u7a0b\u63d0\u4f9b\u7684\u4ea4\u4e92\u63d2\u53e3\uff0c\u53ef\u4ee5\u4e3a\u7528\u6237\u8fdb\u7a0b\u63d0\u4f9b\u53d7\u9650\u5236\u5730\u8bbf\u95ee\u786c\u4ef6\u8bbe\u5907\u3001\u7533\u8bf7\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u4ee5\u53ca\u521b\u5efa\u8fdb\u7a0b\u548c\u8fdb\u7a0b\u901a\u8baf\u7b49\u80fd\u529b\u3002linux\u4e2d\u7684\u6bcf\u4f4d\u7cfb\u7edf\u8c03\u7528\u90fd\u5bf9\u5e94\u4e00\u4e2a\u7cfb\u7edf\u8c03\u7528\u53f7\uff0c\u8c03\u7528\u53f7\u7528\u4e8e\u6307\u660e\u5177\u4f53\u90a3\u4e2a\u7cfb\u7edf\u8c03\u7528\u3002<\/p>\n

\u5e94\u7528\u7f16\u7a0b\u63d2\u53e3API<\/p>\n

\u5b9e\u9645\u4e0a\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u4f1a\u4f7f\u7528\u7528\u6237\u7a7a\u95f4\u5b9e\u73b0\u7684\u5e94\u7528\u7f16\u7a0b\u63d2\u53e3\u6765\u95f4\u63a5\u8c03\u7528\u7cfb\u7edf\u8c03\u7528\uff0cAPI\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u6216\u82e5\u5e72\u4e2a\u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0\u4e00\u4e2a\u63d2\u53e3\uff0c\u5e76\u4e14\u80fd\u5c4f\u853d\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u7684\u5dee\u522b\uff0c\u4e3a\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u76f8\u540c\u7684\u63d2\u53e3\uff0c\u4f8b\u5982\u5e38\u7528\u7684C\u5e93\u3002\u636e\u6089\uff0cPOSIX\u6807\u660e\u7ed9\u51fa\u4e86API\u548c\u7cfb\u7edf\u8c03\u7528\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u4e0ePOSIX\u517c\u5bb9\u7684\u5e93\u80fd\u591f\u8ba9\u5e94\u7528\u7a0b\u5e8f\u5b9e\u73b0\u7edf\u4e00\u7684\u63d2\u53e3\u3002<\/p>\n

\u5bf9\u786c\u4ef6\u7684\u7ba1\u7406<\/p>\n

\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u7684\u6838\u5fc3\u4efb\u52a1\u5305\u62ec\u5bf9\u8ba1\u7b97\u673a\u6269\u5145\u7684\u786c\u4ef6\u8fdb\u884c\u7ba1\u7406\uff0c\u4f8b\u5982\u786c\u789f\u3001\u952e\u76d8\u3001\u9f20\u6807\u53ca\u5176\u4ed6\u6269\u5145\u786c\u4ef6\u3002\u5185\u6838\u5fc5\u9700\u8981\u624d\u80fd\u4e0e\u5b83\u4eec\u4e92\u76f8\u901a\u4fe1\uff0c\u4f46\u901a\u8baf\u8fc7\u7a0b\u6709\u4e2a\u5f88\u5173\u952e\u7684\u95ee\u9898\u987b\u8981\u5173\u6ce8\uff0c\u5c31\u662f\u901f\u7387\u95ee\u9898\u3002CPU\u7684\u901f\u7387\u5341\u5206\u5feb\uff0c\u4f46\u5411\u786c\u4ef6\u53d1\u8d77\u4e00\u4e2a\u6073\u6c42\u5e76\u63a5\u5230\u5176\u54cd\u5e94\u7684\u901f\u7387\u662f\u76f8\u5f53\u6162\u7684\uff0c\u600e\u4e48\u6709\u6548\u8ba9\u5b83\u4eec\u534f\u540c\u5de5\u4f5c\u662f\u786c\u4ef6\u7ba1\u7406\u7684\u6838\u5fc3\u95ee\u9898\uff0c\u7531\u4e8e\u8fd9\u4e2a\u95ee\u9898\u5f88\u53ef\u80fd\u4f1a\u4e25\u91cd\u5f71\u54cd\u6574\u4f53\u6027\u80fd\u3002<\/p>\n

\u6709\u4e24\u79cd\u5b9e\u73b0\u65b9\uff1a\u5bfb\u5740\u673a\u5236\u548c\u4e2d\u65ad\u673a\u5236\u3002\u5bfb\u5740\u673a\u5236\u662f\u8ba9\u5185\u6838\u5b9a\u671f\u5bf9\u786c\u4ef6\u8bbe\u5907\u8fdb\u884c\u67e5\u8be2\uff0c\u770b\u662f\u5426\u987b\u8981\u5904\u7406\uff0c\u5047\u5982\u987b\u8981\u5219\u5904\u7406\uff0c\u8fd9\u4e9b\u60c5\u51b5\u53ef\u80fd\u4f1a\u8ba9\u5185\u6838\u505a\u597d\u591a\u65e0\u7528\u529f\u3002\u4e2d\u65ad\u673a\u5236\u5219\u53cd\u8fc7\u6765\uff0c\u8ba9\u786c\u4ef6\u4e3b\u52a8\u6765\u53d1\u9001\u8baf\u53f7\uff0c\u5f53\u786c\u4ef6\u6709\u98ce\u6ce2\u53d1\u751f\u65f6\u5219\u5411\u5185\u6838\u53d1\u51fa\u8baf\u53f7\uff0c\u4e4b\u540e\u5185\u6838\u518d\u4ecb\u5165\u5904\u7406\u3002\u5185\u6838\u901a\u5e38\u4e5f\u662f\u4f7f\u7528\u4e2d\u65ad\u673a\u5236\u6765\u7ba1\u7406\u786c\u4ef6\u3002<\/p>\n

\u5185\u6838\u5b9a\u65f6\u5668\u4e2d\u65ad_linux \u5185\u6838\u5b9a\u65f6\u5668_\u5185\u6838\u5b9a\u65f6\u5668\u51fd\u6570\u7684\u6808\u7a7a\u95f4<\/p>\n

\u5173\u4e8e\u4e2d\u65ad<\/p>\n

\u4e2d\u65ad\u673a\u5236\u8ba9\u786c\u4ef6\u80fd\u53d1\u901a\u77e5\u7ed9CPU\uff0c\u4e2d\u65ad\u672c\u8d28\u662f\u4e00\u4e2a\u7279\u6b8a\u7684\u8054\u901a\u53f7\uff0c\u5904\u7406\u5668\u63a5\u6536\u5230\u4e2d\u65ad\u540e\u4f1a\u9a6c\u4e0a\u544a\u77e5\u5185\u6838\u3002\u4f8b\u5982\u70b9\u51fb\u4e0b\u952e\u76d8\u65f6\u952e\u76d8\u63a7\u5236\u5668\u90fd\u4f1a\u53d1\u9001\u4e00\u4e2a\u4e2d\u65ad\u901a\u77e5\uff0c\u5904\u7406\u5668\u4e00\u65e6\u76d1\u6d4b\u5230\u4e2d\u65ad\u8baf\u53f7\u4fbf\u4e2d\u65ad\u81ea\u5df1\u5f53\u524d\u7684\u5de5\u4f5c\u8f6c\u800c\u5904\u7406\u4e2d\u65ad\uff0c\u4e4b\u540e\u901a\u77e5\u64cd\u4f5c\u7cfb\u7edf\u952e\u76d8\u5f62\u6210\u4e86\u4e2d\u65ad\uff0c\u5185\u6838\u5f97\u6089\u952e\u76d8\u88ab\u6309\u4e0b\u4e86\uff0c\u4e4b\u540e\u5185\u6838\u8d1f\u8d23\u5904\u7406\u98ce\u6ce2\u3002<\/p>\n

\u4e0d\u540c\u8bbe\u5907\u7684\u4e2d\u65ad\u4e0d\u540c\uff0c\u901a\u8fc7\u4e00\u4e2a\u60df\u4e00\u7684\u6570\u5b57\u4f5c\u4e3a\u6807\u793a\uff0c\u4e5f\u5c31\u662f\u952e\u76d8\u3001\u952e\u76d8\u3001\u786c\u76d8\u7684\u4e2d\u65ad\u503c\u90fd\u4e0d\u540c\uff0c\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u4e0d\u540c\u7684\u4e2d\u65ad\u8fdb\u884c\u5904\u7406\u3002\u4e2d\u65ad\u503c\u79f0\u4f5c\u4e2d\u65ad\u6073\u6c42\u7ebf(IRQ)\uff0c\u6bcf\u4f4dIRQ\u90fd\u5bf9\u5e94\u4e00\u4e2a\u6570\u503c\uff0c\u4f8b\u5982PC\u4e0a0\u4f4d\u65f6\u949f\u4e2d\u65ad\u30011\u4f4d\u6309\u952e\u4e2d\u65ad\u3002\u5176\u5b9e\uff0c\u4e5f\u53ef\u80fd\u662f\u52a8\u6001\u5206\u914d\u4e2d\u65ad\u503c\u3002<\/p>\n

\u4e2d\u65ad\u7531\u786c\u4ef6\u6253\u65ad\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e3a\u786c\u4ef6\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u4e86\u901a\u8baf\u673a\u5236\u3002<\/p>\n

\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f<\/p>\n

\u5185\u6838\u5728\u54cd\u5e94\u6bcf\u4f4d\u7279\u5b9a\u7684\u4e2d\u65ad\u65f6\u5c31\u4f1a\u6267\u884c\u6307\u5b9a\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u4e3a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u3002\u6bcf\u4f4d\u786c\u4ef6\u6709\u4e00\u4e2a\u76f8\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\uff0c\u4ed6\u5c5e\u4e8e\u8bbe\u5907\u9a71\u52a8\u7684\u4e00\u90e8\u4efd\u3002\u5728linux\u4e2d\uff0c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u662f\u4e00\u4e2aC\u51fd\u6570\uff0c\u8fd9\u79cdC\u51fd\u6570\u6839\u636e\u4e00\u5b9a\u7684\u7c7b\u578b\u7533\u660e\uff0c\u4e4b\u540e\u5185\u6838\u5c31\u53ef\u4ee5\u4ee5\u6807\u51c6\u7684\u5f62\u5f0f\u8c03\u7528\u3002\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u88ab\u5185\u6838\u8c03\u7528\u6765\u54cd\u5e94\u4e2d\u65ad\uff0c\u5b83\u4eec\u8fd0\u884c\u5728\u4e2d\u65ad\u4e0a\u4e0b\u6587\u4e2d\uff0c\u5728\u8be5\u4e0a\u4e0b\u6587\u4e2d\u6267\u884c\u7684\u4ee3\u7801\u4e0d\u80fd\u5426\u963b\u585e\u3002<\/p>\n

linux \u5185\u6838\u5b9a\u65f6\u5668_\u5185\u6838\u5b9a\u65f6\u5668\u51fd\u6570\u7684\u6808\u7a7a\u95f4_\u5185\u6838\u5b9a\u65f6\u5668\u4e2d\u65ad<\/p>\n

\u4e2d\u65ad\u8baf\u53f7\u968f\u65f6\u53ef\u80fd\u53d1\u751f\uff0c\u6240\u4ee5\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u968f\u65f6\u53ef\u80fd\u88ab\u8fd0\u884c\uff0c\u5fc5\u987b\u4fdd\u8bc1\u5b83\u5feb\u901f\u88ab\u6267\u884c\uff0c\u80fd\u591f\u5feb\u901f\u6062\u590d\u4e2d\u65ad\u4ee3\u7801\u7684\u6267\u884c\u3002\u7406\u60f3\u72b6\u6001\u662f\u4e2d\u65ad\u80fd\u5feb\u901f\u88ab\u54cd\u5e94\uff0c\u5e76\u4e14\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u80fd\u5feb\u901f\u88ab\u6267\u884c\u5b8c\u3002\u4f46\u4e2d\u65ad\u7a0b\u5e8f\u8981\u5904\u7406\u7684\u5de5\u4f5c\u5e38\u5e38\u6709\u597d\u591a\uff0c\u4f8b\u5982\u5bf9\u4e8e\u7f51\u8def\u800c\u8a00\uff0c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u8981\u5c06\u7f51\u5361\u7684\u6570\u636e\u5305\u62f7\u8d1d\u5f97\u5230\u5185\u5b58\u4e2d\uff0c\u5e76\u4e14\u8fd8\u8981\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u540e\u624d\u4ea4\u7ed9\u5408\u9002\u7684\u5408\u540c\u6808linux \u5185\u6838\u5b9a\u65f6\u5668<\/strong>\uff0c\u6700\u7ec8\u518d\u544a\u77e5\u786c\u4ef6\u5df2\u5904\u7406\u4e2d\u65ad\u8baf\u53f7\u3002<\/p>\n

\u4e2d\u65ad\u7684\u4e0a\u534a\u90e8\u548c\u4e0b\u534a\u90e8<\/p>\n

\u6211\u4eec\u60f3\u8981\u5feb\u901f\u7684\u4e2d\u65ad\u54cd\u5e94\uff0c\u540c\u65f6\u53c8\u60f3\u8981\u5728\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4e2d\u5b8c\u6210\u66f4\u591a\u7684\u5de5\u4f5c\uff0c\u8fd9\u662f\u4e00\u4e2a\u77db\u76fe\u4f53\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u4e2d\u65ad\u5904\u7406\u88ab\u5206\u4e3a\u4e0a\u534a\u90e8\u548c\u4e0b\u534a\u90e8\u3002\u4e0a\u534a\u90e8\u7528\u4e8e\u6267\u884c\u6709\u4e25\u683c\u671f\u9650\u7684\u5de5\u4f5c\uff0c\u4f8b\u5982\u5e94\u7b54\u786c\u4ef6\u3002\u800c\u4e0b\u534a\u90e8\u7528\u4e8e\u5904\u7406\u624d\u80fd\u63a8\u8fdf\u5904\u7406\u7684\u5de5\u4f5c\u3002\u4e0a\u534a\u90e8\u548c\u4e0b\u534a\u90e8\u4f3c\u4e4e\u5c31\u662f\u4e00\u79cd\u5f02\u6b65\u5316\u5904\u7406\u601d\u60f3\uff0c\u8fd9\u6837\u65e2\u624d\u80fd\u4fdd\u8bc1\u54cd\u5e94\u901f\u7387linux\u67e5\u770b\u64cd\u4f5c\u7cfb\u7edf\uff0c\u53c8\u80fd\u5426\u5b8c\u6210\u5927\u5de5\u4f5c\u91cf\u7684\u5904\u7406\u3002<\/p>\n

\u5bf9\u4e8e\u7f51\u5361\u6765\u8bf4\uff0c\u5b83\u7684\u7f13\u5b58\u5927\u5c0f\u662f\u56fa\u5b9a\u7684\uff0c\u4e00\u65e6\u7f51\u5361\u63a5\u6536\u5230\u6570\u636e\u540e\u5185\u6838\u5fc5\u987b\u9a6c\u4e0a\u5c06\u5b83\u4eec\u62f7\u8d1d\u5230\u663e\u5b58\u4e2d\uff0c\u4e0d\u7136\u5c06\u53ef\u80fd\u9020\u6210\u7f51\u5361\u7684\u7f13\u5b58\u7206\u6ee1\u800c\u6570\u636e\u5305\u88ab\u9057\u5931\u3002\u9274\u4e8e\u8fd9\u4e9b\u60c5\u51b5\uff0c\u5bf9\u4e8e\u7f51\u5361\u7684\u4e2d\u65ad\u8baf\u53f7\u5904\u7406\u5e94\u5f53\u5feb\u901f\u5c06\u7f51\u5361\u6570\u636e\u5305\u62f7\u8d1d\u5230\u663e\u5b58\u4e2d\uff0c\u8fd9\u5c31\u662f\u4e0a\u534a\u90e8\u7684\u5de5\u4f5c\uff0c\u5feb\u901f\u6267\u884c\u5b8c\u540e\u9a6c\u4e0a\u7ed3\u675f\u4e2d\u65ad\u5904\u7406\uff0c\u5c06\u5904\u7406\u5668\u4ea4\u8fd8\u7ed9\u4e2d\u65ad\u524d\u7684\u7a0b\u5e8f\u3002\u800c\u5386\u65f6\u7684\u6570\u636e\u5305\u5904\u7406\u64cd\u4f5c\u5219\u653e\u5728\u4e0b\u534a\u90e8\u4e2d\uff0c\u8fd9\u90e8\u4efd\u53ef\u4ee5\u7a0d\u540e\u4e00\u70b9\u518d\u5904\u7406\uff0c\u6ca1\u6709\u5f88\u5f3a\u7684\u65f6\u6548\u6027\u3002<\/p>\n

\u6bcf\u4f4d\u8bbe\u5907\u90fd\u6709\u81ea\u5df1\u7684\u9a71\u52a8\u7a0b\u5e8f\uff0c\u9a71\u52a8\u7a0b\u5e8f\u53ef\u4ee5\u901a\u8fc7request_irq()\u51fd\u6570\u6765\u6ce8\u518c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u3002<\/p>\n

\u4e2d\u65ad\u4e0a\u4e0b\u6587<\/p>\n

\u4e2d\u65ad\u4e0a\u4e0b\u6587\u662f\u6307\u5185\u6838\u5728\u6267\u884c\u4e00\u4e2a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u65f6\u6240\u5904\u7684\u4e0a\u4e0b\u6587\uff0c\u5728\u8be5\u4e0a\u4e0b\u6587\u4e2d\u4e0d\u80fd\u7761\u7720\uff0c\u4e5f\u4e0d\u80fd\u8c03\u7528\u4e2a\u522b\u51fd\u6570\u3002\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u65f6\u6253\u65ad\u4e86\u5176\u5b83\u6b63\u5728\u6267\u884c\u7684\u4ee3\u7801\uff0c\u6240\u4ee5\u5b83\u5fc5\u9700\u8981\u5feb\u901f\u7b80\u7ec3\u5730\u6267\u884c\u5b8c\u6bd5\uff0c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u6709\u81ea\u5df1\u7684\u6808\u3002<\/p>\n

linux\u4e2d\u65ad\u8fc7\u7a0b<\/p>\n

\u786c\u4ef6\u5f62\u6210\u4e86\u4e00\u4e2a\u4e2d\u65ad\u8baf\u53f7\uff0c\u5b83\u901a\u8fc7\u603b\u7ebf\u5c06\u8054\u901a\u53f7\u53d1\u9001\u7ed9\u4e2d\u65ad\u63a7\u5236\u5668\uff0c\u4e2d\u65ad\u63a7\u5236\u5668\u4f1a\u5c06\u4e2d\u65ad\u8baf\u53f7\u53d1\u5f80\u5904\u7406\u5668\u3002\u5904\u7406\u5668\u4f1a\u7acb\u523b\u505c\u6b62\u6b63\u5728\u505a\u7684\u4e8b\u60c5\uff0c\u4e4b\u540e\u5173\u6389\u4e2d\u65ad\u7cfb\u7edf\u5e76\u8df3\u5230\u9884\u5b9a\u4e49\u7684\u4f4d\u7f6e\u5f00\u59cb\u6267\u884c\u4ee3\u7801\uff0c\u8fd9\u4e2a\u9884\u5b9a\u4e49\u7684\u4ee3\u7801\u5c31\u662f\u7531\u5185\u6838\u8bbe\u7f6e\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5165\u53e3\u3002\u5bf9\u4e8e\u6bcf\u4f4d\u4e2d\u65ad\u7ebf\uff0c\u5904\u7406\u5668\u5c31\u4f1a\u8df3\u8f6c\u5230\u5bf9\u5e94\u4e00\u4e2a\u60df\u4e00\u7684\u5165\u53e3\u4f4d\u7f6e\u3002\u5185\u6838\u6267\u884cdo_IRQ()\u51fd\u6570\u5bf9\u6240\u63a5\u6536\u5230\u7684\u4e2d\u65ad\u8fdb\u884c\u54cd\u5e94\u3002<\/p>\n

\u7cfb\u7edf\u5b9a\u65f6\u5668<\/p>\n

\u5185\u6838\u5927\u91cf\u51fd\u6570\u90fd\u662f\u57fa\u4e8e\u65f6\u95f4\u9a71\u52a8\u7684\uff0c\u4f8b\u5982\u6709\u4e9b\u51fd\u6570\u5468\u671f\u6027\u5730\u6267\u884c\uff0c\u8fd9\u79cd\u5c31\u987b\u8981\u5b9a\u65f6\u5668\u6765\u652f\u6301\u3002\u7cfb\u7edf\u5b9a\u65f6\u5668\u662f\u4e00\u79cd\u53ef\u7f16\u7a0b\u786c\u4ef6\u82af\u7247\uff0c\u5b83\u4ee5\u56fa\u5b9a\u9891\u5ea6\u5f62\u6210\u4e2d\u65ad\uff0c\u5373\u5b9a\u65f6\u5668\u4e2d\u65adlinux\u57f9\u8bad\u5b66\u6821\uff0c\u5b83\u5bf9\u5e94\u7684\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u8d1f\u8d23\u66f4\u65b0\u7cfb\u7edf\u65f6\u95f4\uff0c\u540c\u65f6\u4e5f\u8d1f\u8d23\u6267\u884c\u5468\u671f\u6027\u4efb\u52a1\u3002\u5b9a\u65f6\u5668\u548c\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u662flinux\u5185\u6838\u7ba1\u7406\u673a\u5236\u7684\u4e2d\u67a2\u3002<\/p>\n

\u5b9a\u65f6\u5668\u662f\u7ba1\u7406\u5185\u6838\u6d41\u901d\u65f6\u95f4\u7684\u57fa\u7840\uff0c\u4f7f\u7528\u5b9a\u65f6\u5668\u65f6\u8bbe\u7f6e\u4e00\u4e2a\u8d85\u65f6\u65f6\u95f4\uff0c\u4f46\u662f\u6307\u5b9a\u8d85\u65f6\u53d1\u751f\u65f6\u6267\u884c\u7684\u51fd\u6570\u3002\u5f53\u5b9a\u65f6\u5668\u5230\u65f6\u65f6\u4f1a\u624b\u52a8\u6267\u884c\u8be5\u51fd\u6570\uff0c\u8be5\u51fd\u6570\u53ea\u8fd0\u884c\u4e00\u6b21\u3002<\/p>\n

linux \u5185\u6838\u5b9a\u65f6\u5668_\u5185\u6838\u5b9a\u65f6\u5668\u4e2d\u65ad_\u5185\u6838\u5b9a\u65f6\u5668\u51fd\u6570\u7684\u6808\u7a7a\u95f4<\/p>\n

\u5185\u6838\u7684\u65f6\u95f4<\/p>\n

\u5185\u6838\u987b\u8981\u5728\u786c\u4ef6\u7684\u5e2e\u52a9\u4e0b\u80fd\u591f\u4f30\u7b97\u548c\u7ba1\u7406\u65f6\u95f4\uff0c\u786c\u4ef6\u63d0\u4f9b\u4e86\u7cfb\u7edf\u5b9a\u65f6\u5668\u7ed9\u5185\u6838\u6765\u4f30\u7b97\u6d41\u901d\u7684\u65f6\u95f4\uff0c\u5f53\u65f6\u949f\u4e2d\u65ad\u53d1\u751f\u65f6\u5185\u6838\u7684\u7279\u5b9a\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u4f1a\u5bf9\u5176\u8fdb\u884c\u5904\u7406\u3002\u5b9a\u65f6\u5668\u4ee5\u67d0\u79cd\u9891\u5ea6\u81ea\u884c\u89e6\u53d1\u65f6\u95f4\u4e2d\u65ad\uff0c\u8fd9\u4e2a\u9891\u5ea6\u6210\u4e3a\u8282\u62cd\u7387\uff0c\u8fde\u7eed\u4e24\u6b21\u65f6\u95f4\u4e2d\u65ad\u7684\u95f4\u9694\u65f6\u95f4\u4e3a\u8282\u62cd\u3002\u5185\u6838\u901a\u8fc7\u5df2\u77e5\u7684\u8282\u62cd\u6765\u4f30\u7b97\u5899\u4e0a\u65f6\u95f4\u548c\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4linux \u5185\u6838\u5b9a\u65f6\u5668<\/strong>\uff0c\u5899\u58c1\u65f6\u95f4\u5373\u662f\u5b9e\u9645\u65f6\u95f4\uff0c\u7cfb\u7edf\u8fd0\u884c\u65f6\u95f4\u4e3a\u81ea\u7cfb\u7edf\u542f\u52a8\u540e\u5f00\u59cb\u7684\u65f6\u95f4\u3002\u5185\u6838\u4e5f\u4e3a\u7528\u6237\u7a7a\u95f4\u63d0\u4f9b\u4e86\u4e00\u7ec4\u83b7\u53d6\u5b9e\u9645\u65f6\u95f4\u548c\u65e5\u671f\u7684\u7cfb\u7edf\u8c03\u7528\u3002<\/p>\n

\u5b9e\u65f6\u65f6\u949f<\/p>\n

\u5b9e\u65f6\u65f6\u949f(RTC)\u662f\u62ff\u6765\u6301\u4e45\u50a8\u5b58\u7cfb\u7edf\u65f6\u95f4\u7684\u8bbe\u5907\uff0c\u5b83\u53ef\u4ee5\u9760\u663e\u5361\u4e0a\u7684\u5fae\u578b\u7535\u74f6\u4fdd\u6301\u7cfb\u7edf\u7684\u8ba1\u65f6\uff0c\u6240\u4ee5\u5373\u4fbf\u7cfb\u7edf\u5173\u6389\u4e86\u4e5f\u80fd\u4fdd\u6301\u7cfb\u7edf\u65f6\u95f4\u7684\u8ba1\u65f6\u3002\u5b9e\u65f6\u65f6\u949f\u548cCMOS\u96c6\u6210\u5728\u4e00\u8d77\uff0c\u5b9e\u65f6\u65f6\u949f\u4e0eBIOS\u7684\u4fdd\u5b58\u8bbe\u7f6e\u90fd\u662f\u901a\u8fc7\u540c\u4e00\u4e2a\u7535\u677f\u4f9b\u7535\u3002\u7cfb\u7edf\u542f\u52a8\u65f6\u5185\u6838\u8bfb\u53d6\u5b9e\u65f6\u65f6\u949f\u6765\u521d\u59cb\u5316\u5899\u58c1\u65f6\u95f4\uff0c\u8be5\u65f6\u95f4\u5bf9\u5e94\u7684\u53d8\u91cf\u4e3axtime\u3002<\/p>\n

\u57fa\u4e8e\u65f6\u95f4\u7684\u5185\u6838\u7ba1\u7406<\/p>\n

\u5185\u6838\u597d\u591a\u5de5\u4f5c\u90fd\u4f9d\u8d56\u4e8e\u65f6\u949f\u4e2d\u65ad\uff0c\u4f8b\u5982\uff1a<\/p>\n

\u5185\u6838\u5b9a\u65f6\u5668\u51fd\u6570\u7684\u6808\u7a7a\u95f4_linux \u5185\u6838\u5b9a\u65f6\u5668_\u5185\u6838\u5b9a\u65f6\u5668\u4e2d\u65ad<\/p>\n

\u5173\u4e8e\u8282\u62cd\u7387<\/p>\n

\u7cfb\u7edf\u5b9a\u65f6\u5668\u7684\u8282\u62cd\u7387\u63d0\u4f9b\u7ed9\u9759\u6001\u9884\u5904\u7406\u5b9a\u4e49\uff0c\u5355\u4f4d\u4e3aHZ\uff0c\u5185\u6838\u518dasm\/param.h\u6587\u4ef6\u4e2d\u5b9a\u4e49\u3002x86\u4f53\u7cfb\u4e2d\u7cfb\u7edf\u5b9a\u65f6\u5668\u9891\u5ea6\u9ed8\u8ba4\u503c\u4e3a100\uff0c\u6240\u4ee5\u65f6\u949f\u4e2d\u65ad\u8bc4\u8bba\u4e3a100HZ\uff0c\u6bcf\u79d2\u8fdb\u884c\u65f6\u949f\u4e2d\u65ad100\u6b21\uff0c\u6bcf10ms\u5f62\u6210\u4e00\u6b21\u3002\u4e0d\u540c\u7684\u4f53\u7cfb\u7ed3\u6784\u8282\u62cd\u7387\u53ef\u80fd\u4e0d\u540c\u3002<\/p>\n

\u66f4\u9ad8\u7684\u8282\u62cd\u7387\u80fd\u63d0\u4f9b\u65f6\u95f4\u9a71\u52a8\u65f6\u95f4\u7684\u89e3\u6790\u5ea6\uff0c\u540c\u65f6\u4e5f\u63d0\u9ad8\u65f6\u95f4\u9a71\u52a8\u98ce\u6ce2\u7684\u786e\u5207\u5ea6\u3002\u5bf9\u4e8elinux\u6765\u8bf4\u80fd\u63d0\u4f9b\u66f4\u9ad8\u7684\u7cbe\u5ea6\u6765\u6267\u884cpoll()\u3001select()\u7b49\u7cfb\u7edf\u8c03\u7528\uff0c\u4e5f\u80fd\u63d0\u5347\u8fdb\u7a0b\u5360\u636e\u7684\u786e\u5207\u5ea6\u3002\u4f46\u9ad8\u8282\u62cd\u7387\u4f1a\u964d\u4f4e\u7cfb\u7edf\u8d1f\u62c5\uff0c\u7531\u4e8e\u4f1a\u6108\u52a0\u9891\u7e41\u5730\u6267\u884c\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\uff0c\u964d\u4f4e\u4e86\u7535\u6e90\u7684\u6d88\u8017\u3002<\/p>\n

jiffies<\/p>\n

jiffies\u662f\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf\uff0c\u5b83\u62ff\u6765\u8bb0\u5f55\u81ea\u7cfb\u7edf\u542f\u52a8\u4ee5\u6765\u5f62\u6210\u7684\u8282\u62cd\u603b\u91cf\u3002\u542f\u52a8\u65f6\u4e3a0\uff0c\u4e4b\u540e\u6bcf\u6b21\u65f6\u949f\u4e2d\u65ad\u5c31\u4f1a\u964d\u4f4e\u6539\u53d8\u4e86\u7684\u503c\uff0c\u6bcf\u79d2\u589e\u91cf\u4e3a\u8282\u62cd\u7387\uff0c\u5373n\u8d6b\u5179\u3002\u65f6\u949f\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u5de5\u4f5c\u5927\u81f4\u5305\u62ec\uff1a<\/p>\n

\u672c\u516c\u4f17\u53f7\u4e13\u6ce8\u4e8e\u4eba\u5de5\u667a\u80fd\u3001\u8bfb\u4e66\u4e0e\u770b\u6cd5\u3001\u804a\u804a\u7269\u7406\u3001\u8ba1\u7b97\u673a\u79d1\u5b66\u3001\u5206\u5e03\u5f0f\u3001\u673a\u5668\u5b66\u4e60\u3001\u6df1\u5ea6\u5b66\u4e60\u3001\u81ea\u7136\u8bed\u8a00\u5904\u7406\u3001\u7b97\u6cd5\u4e0e\u6570\u636e\u7ed3\u6784\u3001Java\u6df1\u5ea6\u3001Tomcat\u5185\u6838\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5185\u6838\u5927\u91cf\u51fd\u6570\u90fd\u662f\u57fa\u4e8e\u65f6\u95f4\u9a71\u52a8\u7684\uff0c\u6bd4\u5982\u6709\u4e9b\u51fd\u6570\u5468\u671f\u6027\u5730\u6267\u884c\uff0c\u8fd9\u4e9b\u5c31\u9700\u8981\u5b9a\u65f6\u5668\u6765\u652f\u6301\u3002\u5b9a\u65f6\u5668\u662f\u7ba1\u7406\u5185\u6838\u6d41\u901d\u65f6\u95f4\u7684\u57fa\u7840\uff0c\u4f7f\u7528\u5b9a\u65f6\u5668\u65f6\u8bbe\u7f6e\u4e00\u4e2a\u8d85\u65f6\u65f6\u95f4\uff0c\u5e76\u4e14\u6307\u5b9a\u8d85\u65f6\u53d1\u751f\u65f6\u6267\u884c\u7684\u51fd\u6570\u3002\u7cfb\u7edf\u5b9a\u65f6\u5668\u7684\u8282\u62cd\u7387\u63d0\u4f9b\u7ed9\u9759\u6001\u9884\u5904\u7406\u5b9a\u4e49\uff0c\u5355\u4f4d\u4e3aHZ\uff0c\u5185\u6838\u518dasm\/param.h\u6587\u4ef6\u4e2d\u5b9a\u4e49\u3002<\/p>\n","protected":false},"author":1,"featured_media":289625,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-289624","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\/289624","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=289624"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289624\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/289625"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=289624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=289624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=289624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}