{"id":293297,"date":"2024-09-29T12:05:03","date_gmt":"2024-09-29T04:05:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/jsjisbjcqdxy.html"},"modified":"2024-09-29T12:05:03","modified_gmt":"2024-09-29T04:05:03","slug":"jsjisbjcqdxy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/jsjisbjcqdxy.html","title":{"rendered":"\u8ba1\u7b97\u673a IO \u8bbe\u5907\u5bc4\u5b58\u5668\u8bfb\u5199\u4e0e\u7aef\u53e3\u5730\u5740\u7f16\u5740\u65b9\u5f0f\u8be6\u89e3"},"content":{"rendered":"
\u4f7f\u7528\u8ba1\u7b97\u673a\u79bb\u4e0d\u5f00IO\u8bbe\u5907\uff08\u9f20\u6807\u3001\u9f20\u6807\u3001\u4e32\u53e3\u3001\u6253\u5370\u673a\u7b49\uff09\uff0cIO\u8bbe\u5907\u901a\u5e38\u90fd\u6709\u51e0\u4e2a\u5bc4\u5b58\u5668\uff0c\u4e00\u822c\u6211\u4eec\u90fd\u662f\u5bf9\u5bc4\u5b58\u5668\u8fdb\u884c\u8bfb\u5199\u6765\u63a7\u5236IO\u8bbe\u5907\u7684\u884c\u4e3a\u7684\u3002<\/p>\n
\u4e0d\u8bba\u54ea\u4e9b\u8bbe\u5907\uff0c\u5176\u8bfb\u5199\u5bc4\u5b58\u5668\u7684\u8fc7\u7a0b\u5728\u786c\u4ef6\u5c42\u9762\u90fd\u662f\u76f8\u540c\u7684\uff1a\u5411\u5730\u5740\u603b\u7ebf\u53d1\u9001\u7535\u5e73\u8baf\u53f7\uff08\u4e3b\u5b58\uff09\uff0c\u5411\u63a7\u5236\u603b\u7ebf\u53d1\u9001\u7535\u5e73\u8baf\u53f7\uff08\u6bd4\u5982\u8bfb\u5199\u63a7\u5236\u7b49\uff09\uff0c\u901a\u8fc7\u6570\u636e\u603b\u7ebf\u8bfb\u5199\u6240\u9700\u7684\u6570\u636e\u3002<\/p>\n
\u91cc\u9762\u7684\u8f6e\u8be2\u8fc7\u7a0b\u9996\u5148\u8981\u6653\u5f97IO\u8bbe\u5907\u7684\u5730\u5740\uff0c\u8fd9\u4e2a\u5730\u5740\u6210\u4e3aIO\u7aef\u53e3\u5730\u5740\uff0c\u7b80\u79f0\u4e3a\u7aef\u53e3\u3002<\/p>\n
\u4e0d\u540c\u7684CPU\u5bf9\u4e8e\u5916\u8bbe\u7684\u7f16\u5740\u65b9\u6cd5\u4e0d\u540c\uff0c\u53ef\u4ee5\u5206\u4e3a\uff1a\u7edf\u4e00\u7f16\u5740\u548c\u72ec\u7acb\u7f16\u5740\u3002<\/p>\n
\u4f7f\u7528ISA\u603b\u7ebf\u7ed3\u6784\u7684\u4f20\u7edfPC\u673aIO\u5730\u5740\u7a7a\u95f4\u8303\u56f4\u662f0x000-0x3FF\uff0c\u67091024\u4e2aIO\u7aef\u53e3\u5730\u5740\u53ef\u4f9b\u4f7f\u7528\u3002\u5404\u63a7\u5236\u5668\u548c\u63a7\u5236\u5361\u6240\u9ed8\u8ba4\u5206\u914d\u4f7f\u7528\u7684\u7aef\u53e3\u5730\u5740\u8303\u56f4\u89c1\u4e0b\u8868:<\/p>\n
\u7aef\u53e3\u5730\u5740\u8303\u56f4<\/p>\n
\u5206\u914d\u8bf4\u660e<\/p>\n
\u7aef\u53e3\u5730\u5740\u8303\u56f4<\/p>\n
\u5206\u914d\u8bf4\u660e<\/p>\n
0x000-0x01f<\/p>\n
8237ADMA\u63a7\u5236\u56681<\/p>\n
0x020-0x03f<\/p>\n
8259A\u53ef\u7f16\u7a0b\u4e2d\u65ad\u63a7\u5236\u56681<\/p>\n
0x040-0x05f<\/p>\n
8253\/8254A\u5b9a\u65f6\u8ba1\u6570\u5668<\/p>\n
0x060-0x06f<\/p>\n
8042\u6309\u952e\u63a7\u5236\u5668<\/p>\n
0x070-0x07f<\/p>\n
\u8bbf\u95eeCMOSRAM\/\u5b9e\u65f6\u65f6\u949fRTC\uff08RealTimeClock)\u7aef\u53e3<\/p>\n
0x080-0x09f<\/p>\n
DMA\u9875\u9762\u5bc4\u5b58\u5668\u8bbf\u95ee\u7aef\u53e3<\/p>\n
0x0a0-0x0bf<\/p>\n
8259\u53ef\u7f16\u7a0b\u4e2d\u65ad\u63a7\u5236\u56682<\/p>\n
0x0c0-0x0df<\/p>\n
8237ADMA\u63a7\u5236\u56682<\/p>\n
0x0f0-0x0ff<\/p>\n
\u534f\u5904\u7406\u5668\u8bbf\u95ee\u7aef\u53e3<\/p>\n
0x170-0x177<\/p>\n
IDE\u786c\u789f\u63a7\u5236\u56681<\/p>\n
0x1f0-0x1f7<\/p>\n
<\/p>\n
IDE\u786c\u789f\u63a7\u5236\u56682<\/p>\n
0x278-ox27f<\/p>\n
\u5e76\u884c\u590d\u5370\u673a\u7aef\u53e32<\/p>\n
0x2f8-0x2ff<\/p>\n
\u4e32\u884c\u63a7\u5236\u56682<\/p>\n
0x378-0x38f<\/p>\n
\u5e76\u884c\u590d\u5370\u673a\u7aef\u53e31<\/p>\n
0x3b0-0x3bf<\/p>\n
\u5355\u8272MDA\u663e\u793a\u63a7\u5236\u5668<\/p>\n
0x3c0-0x3cf<\/p>\n
\u5f69\u8272CGA\u663e\u793a\u63a7\u5236\u5668<\/p>\n
0x3d0-0x3df<\/p>\n
\u5f69\u8272EGA\/VGA\u663e\u793a\u63a7\u5236\u5668<\/p>\n
0x3f0-0x3f7<\/p>\n
<\/p>\n
\u8f6f\u9a71\u63a7\u5236\u5668<\/p>\n
0x3f8-0x3ff<\/p>\n
\u4e32\u884c\u63a7\u5236\u56681<\/p>\n
\u8fb9\u9645\u6548\u5e94<\/p>\n
\u4ece\u91cc\u9762\u770b\u6765\uff0c\u8bbf\u95ee\u5bc4\u5b58\u5668\u548c\u8bbf\u95ee\u663e\u5b58\u7684\u8fc7\u7a0b\u662f\u4e00\u6837\u7684\uff0c\u800c\u4e14\uff0c\u5bc4\u5b58\u5668\u7684\u8bbf\u95ee\u53ef\u80fd\u5b58\u5728\u8fb9\u9645\u6548\u5e94(sideeffect,\u526f\u4f5c\u7528)\u3002<\/p>\n
\u5bf9\u4e8e\u8fb9\u9645\u6548\u5e94\uff0c\u6211\u90a3\u8fb9\u4e2a\u4eba\u7406\u89e3\u662f\u8fd9\u6837\u7684\uff1a\u5bf9\u4e8e\u663e\u5b58\u800c\u8a00linux \u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f<\/strong>\uff0c\u6211\u4eec\u5bf9\u5176\u7684\u64cd\u4f5c\u662f\u5b58\u503c\u53d6\u503clinux \u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f<\/strong>\uff0c\u6bd4\u5982\u201da=0;b=0;\u201c\u8fd9\u4e24\u4e2a\u53e5\u5b50\u7684\u6267\u884c\u6b21\u5e8f\u8c03\u6362\u5bf9\u4e8e\u6211\u671f\u76fc\u7684\u7ed3\u679c\u5e76\u6ca1\u6709\u54ea\u4e9b\u5f71\u54cd\uff0c\u6240\u4ee5\u7f16\u8bd1\u5668\u53ef\u80fd\u4f1a\u5bf9\u5176\u8fdb\u884c\u4f18\u5316\uff0c\u91cd\u6392\u5e8f\u7b49\uff1b\u800c\u5bf9\u4e8e\u5bc4\u5b58\u5668\u800c\u8a00\uff0c\u8bfb\u5199\u64cd\u4f5c\u987b\u8981\u4e25\u683c\u4f9d\u7167\u8981\u6c42\u6765\u64cd\u4f5c\uff0c\u4f8b\u5982\u67d0\u4e2a\u5bc4\u5b58\u5668\u88ab\u8bfb\u4e00\u6b21\u540e\u624d\u4f1a\u88ab\u6e05\u7a7alinux \u8bba\u575b\uff0c\u5047\u5982\u8bfb\u5199\u987a\u4fbf\u88ab\u91cd\u6392\u5e8f\uff0c\u90fd\u4f1a\u9020\u6210\u4e0d\u53ef\u9884\u60f3\u7684\u95ee\u9898\u4e86\uff0c\u5e76\u4e14\u4e5f\u5f88\u96be\u6392\u67e5\u3002<\/p>\n \u4e3a\u4e86\u6392\u9664\u8fb9\u9645\u6548\u5e94\u7684\u5f71\u54cd\uff1a\u9a71\u52a8\u7a0b\u5e8f\u5fc5\u987b\u786e\u4fdd\u4e0d\u4f7f\u7528\u9ad8\u901f\u7f13\u5b58\uff08\u9ad8\u901f\u7f13\u5b58\u4f1a\u5c06\u8bfb\u5199\u64cd\u4f5c\u5728CPU\u5bc4\u5b58\u5668\u4e2d\u5b8c\u6210\uff0c\u81f4\u4f7fCPU\u5728\u4e0d\u8bbf\u95eeRAM\uff0c\u800c\u6211\u4eec\u7684\u76ee\u7684\u5374\u662f\u8bfb\u5199RAM\uff09\uff0c\u4f46\u662f\u5728\u8bbf\u95ee\u5bc4\u5b58\u5668\u65f6\u4e0d\u4f1a\u53d1\u751f\u8bfb\u5199\u547d\u4ee4<\/a>\u7684\u91cd\u6392\u5e8f\u3002<\/p>\n \u5bf9\u4e8e\u4e0d\u4f7f\u7528\u9ad8\u901f\u7f13\u5b58\u7684\u89e3\u51b3\u65b9\u5f0f\u662f\uff1a\u628a\u5e95\u5c42\u786c\u4ef6\u914d\u7f6e\u6210\u5728\u8bbf\u95eeIO\u533a\u57df\u65f6\u4e25\u7981\u786c\u4ef6\u7f13\u5b58\u3002<\/p>\n \u5bf9\u4e8e\u8bfb\u5199\u91cd\u6392\u5e8f\u95ee\u9898\uff0c\u5bf9\u4e8e\u5fc5\u987b\u4fdd\u8bc1\u6267\u884c\u6b21\u5e8f\u7684\u64cd\u4f5c\u4e4b\u95f4\u8bbe\u7f6e\u663e\u5b58\u5c4f\u969c(memorybarrier)\u3002<\/p>\n \n \u663e\u5b58\u5c4f\u969c\u662f\u4f1a\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u7684\uff0c\u6240\u4ee5\u53ea\u80fd\u7528\u5728\u771f\u6b63\u987b\u8981\u4f7f\u7528\u7684\u5730\u65b9\u3002<\/p>\n IO\u7aef\u53e3\u76f8\u5173\u64cd\u4f5c<\/p>\n \n \u8be5\u51fd\u6570\u544a\u8bc9\u5185\u6838\u6211\u4eec\u5373\u5c06\u4f7f\u7528\u8d77\u59cb\u4e8efirst\u7684n\u4e2a\u7aef\u53e3\u3002name\u662f\u8bbe\u5907\u7684\u540d\u79f0\u3002\u5206\u914d\u6210\u529f\u8fd4\u56de\u975eNULL\u503clinux vi\uff0c\u5426\u5219\u8fd4\u56deNULL\u3002\u5047\u5982\u8fd4\u56deNULL\uff0c\u5219\u4e0d\u80fd\u4f7f\u7528\u7533\u8bf7\u7684\u7aef\u53e3\u3002<\/p>\n \n \u5018\u82e5\u4e0d\u518d\u4f7f\u7528IO\u7aef\u53e3\uff0c\u4f7f\u7528\u524d\u9762\u7684\u51fd\u6570\u91ca\u653e\u3002<\/p>\n \n \u68c0\u6d4b\u6240\u9700\u7684\u7aef\u53e3\u662f\u5426\u53ef\u7528\uff0c\u4f46\u56e0\u4e3a\u8be5\u51fd\u6570\u5e76\u4e0d\u662f\u539f\u5b50\u64cd\u4f5c\u7684\uff0c\u56e0\u800c\u867d\u7136\u5176\u68c0\u6d4b\u7ed3\u679c\u6b63\u5e38\u4e5f\u4e0d\u80fd\u4fdd\u8bc1\u5206\u914d\u4e00\u5b9a\u6210\u529f\u3002<\/p>\n \u5f53\u6073\u6c42\u4e86\u987b\u8981\u7684IO\u7aef\u53e3\u8303\u56f4\u540e\uff0c\u8bfb\u5199\u8fd9\u79cd\u7aef\u53e3\u7684\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n \n \u4e00\u822c\u4f1a\u5c068\/16\/32\u4f4d\u7684\u7aef\u53e3\u8fdb\u884c\u5206\u8fa8\uff0c\u5bf9\u5e94\u91cc\u9762\u7684b(byte)\u3001w(word)\u3001l(longwork)\u3002<\/p>\n \u8fd9\u513f\u6ca1\u6709\u5b9a\u4e4964\u4f4d\u7684IO\u64cd\u4f5c\uff0c\u7531\u4e8e\u867d\u7136\u662f\u572864\u4f4d\u7684\u4f53\u7cfb\u6784\u67b6\u4e0a\uff0c\u7aef\u53e3\u5730\u5740\u7a7a\u95f4\u4e5f\u6700\u5927\u53ea\u4f7f\u752832\u4f4d\u7684\u6570\u636e\u901a\u8def\u3002<\/p>\n \u91cc\u9762\u7684\u51fd\u6570\u53ea\u662f\u5bf9\u4e00\u4e2a\u6570\u636e\u8fdb\u884c\u8bfb\u5199\uff0c\u5185\u6838\u4e5f\u63d0\u4f9b\u4e86\u4e32\u64cd\u4f5c\u6307\u4ee4\uff0c\u76f8\u5173\u7684\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n \n \u4f7f\u7528\u4e32\u64cd\u4f5c\u6307\u4ee4\u65f6\uff0c\u987b\u8981\u6ce8\u610f\u5b57\u8282\u5e8f\u7684\u95ee\u9898\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u4e0d\u53ef\u9884\u6d4b\u7684\u7ed3\u679c\uff0c\u91cc\u9762\u7684\u4e32\u64cd\u4f5c\u51fd\u6570\u4e0d\u4f1a\u5b8c\u6210\u5b57\u8282\u5e8f\u7684\u4ea4\u6362\u548c\u5339\u914d\uff0c\u987b\u8981\u81ea\u5df1\u5b8c\u6210\u3002<\/p>\n IO\u663e\u5b58\u64cd\u4f5c<\/p>\n \u524d\u9762\u4ecb\u7ecd\u7684IO\u7aef\u53e3\u662f\u548c\u8bbe\u5907\u901a\u8baf\u7684\u4e00\u79cd\u673a\u5236\uff0c\u53e6\u4e00\u79cd\u673a\u5236\u662f\u5c06\u8bbe\u5907\u7684\u5bc4\u5b58\u5668\u6216\u663e\u5b58\u6620\u5c04\u5230\u663e\u5b58\u4e2d\uff0c\u4f7f\u5176\u7684\u8bbf\u95ee\u7c7b\u4f3cRAM\u3002\u5176\u5b9e\u7c7b\u4f3cRAM\uff0c\u800c\u4e14\u5176\u4e00\u76f4\u5b58\u5728\u8fb9\u9645\u6548\u5e94\u3002<\/p>\n \u6620\u5c04\u5230\u663e\u5b58\u7684\u8bbe\u5907\u5bc4\u5b58\u5668\u6216\u663e\u5b58\u53ef\u80fd\u662f\u901a\u8fc7\/\u4e0d\u901a\u8fc7\u9875\u8868\u6765\u8bbf\u95ee\u7684\uff1a\u5047\u5982\u901a\u8fc7\u9875\u8868\u6765\u8bbf\u95ee\uff0c\u5c31\u8981\u5148\u8ba9\u6570\u5b66\u5730\u5740\u5bf9\u9a71\u52a8\u7a0b\u5e8f\u53ef\u89c1\uff08\u8c03\u7528ioremap\u6620\u5c04\uff09\uff1b\u5018\u82e5\u4e0d\u662f\u901a\u8fc7\u9875\u8868\u8bbf\u95ee\uff0c\u5219\u7c7b\u4f3c\u4e8eIO\u7aef\u53e3\uff0c\u901a\u8fc7\u4e00\u4e9b\u51fd\u6570\u6765\u8bfb\u5199\u3002<\/p>\n <\/p>\n \u76f8\u5173\u7684\u64cd\u4f5c\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n \n \u91cc\u9762\u7684\u51fd\u6570\u4ecestart\u5f00\u59cb\u5206\u914dlen\u5b57\u8282\u5bbd\u5ea6\u7684\u533a\u57df\uff0c\u5206\u914d\u6210\u529f\u8fd4\u56de\u975eNULL\u8868\u9488\uff0c\u5426\u5219\u8fd4\u56deNULL\u8868\u9488\u3002<\/p>\n \n \u4e0d\u518d\u4f7f\u7528\u5df2\u5206\u914d\u7684\u663e\u5b58\u533a\u57df\u65f6\uff0c\u4f7f\u7528\u524d\u9762\u7684\u51fd\u6570\u8fdb\u884c\u91ca\u653e\u3002<\/p>\n \u68c0\u6d4bIO\u663e\u5b58\u533a\u57df\u662f\u5426\u53ef\u7528\u7684\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n \n \u5206\u914dIO\u663e\u5b58\u4ee5\u540e\uff0c\u8fd8\u987b\u8981\u6784\u5efa\u865a\u62df\u5730\u5740\u4e0eIO\u663e\u5b58\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4f7f\u7528ioremap\u5b9e\u73b0\uff0c\u76f8\u5173\u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n \n \u8c03\u7528ioremap\u4ee5\u540e\uff0c\u9a71\u52a8\u7a0b\u5e8f\u5373\u53ef\u8bbf\u95ee\u5bf9\u5e94\u7684IO\u663e\u5b58\u5730\u5740\u4e86\uff0c\u4e2a\u522b\u5e73\u53f0\u53ef\u4ee5\u76f4\u63a5\u8bb2ioremap\u7684\u8fd4\u56de\u503c\u5f53\u8868\u9488\u76f4\u63a5\u4f7f\u7528\uff0c\u4f46\u4e0d\u5177\u6709\u53ef\u79fb\u690d\u6027\uff0c\u6240\u4ee5\u987b\u8981\u4f7f\u7528\u5185\u6838\u63d0\u4f9b\u7684\u51fd\u6570\u6765\u8bbf\u95ee\uff1a<\/p>\n \n addr\u662fioremap\u7684\u8fd4\u56de\u503c\u3002\u770b\u540d\u5b50\u5c31\u5e94\u5f53\u6653\u5f97\u6db5\u4e49\u548c\u4f7f\u7528\u65b9\u5f0f\u4e86\uff0c\u8fd9\u513f\u4e0d\u518d\u8bf4\u660e\u3002<\/p>\n \u5047\u5982\u8981\u8bfb\u5199\u4e00\u7cfb\u5217\u7684\u503c\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u51fd\u6570\uff1a<\/p>\n \n \u8fd8\u6709\u7c7b\u4f3cC\u8bed\u8a00\u4e2d\u663e\u5b58\u64cd\u4f5c\u76f8\u5173\u7684\u51fd\u6570\uff1a<\/p>\n \n \u5bf9\u4e8e\u4e0d\u4f7f\u7528\u9ad8\u901f\u7f13\u5b58\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\uff1a\u628a\u5e95\u5c42\u786c\u4ef6\u914d\u7f6e\u6210\u5728\u8bbf\u95eeIO\u533a\u57df\u65f6\u7981\u6b62\u786c\u4ef6\u7f13\u5b58\u3002\u4e0a\u9762\u4ecb\u7ecd\u7684IO\u7aef\u53e3\u662f\u548c\u8bbe\u5907\u901a\u4fe1\u7684\u4e00\u79cd\u673a\u5236\uff0c\u53e6\u4e00\u79cd\u673a\u5236\u662f\u5c06\u8bbe\u5907\u7684\u5bc4\u5b58\u5668\u6216\u5185\u5b58\u6620\u5c04\u5230\u5185\u5b58\u4e2d\uff0c\u4f7f\u5176\u7684\u8bbf\u95ee\u7c7b\u4f3cRAM\u3002<\/p>\n","protected":false},"author":1,"featured_media":293298,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[3275,3274,3273,3276,3277],"class_list":["post-293297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-dkzq","tag-idzkj","tag-izx","tag-zdkzq","tag-cxkzq"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293297","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=293297"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293297\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/293298"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=293297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=293297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=293297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}#include \nvoid barrier(void)\n#include \nvoid rmb(void); \/\/ \u8bfb\u5185\u5b58\u5c4f\u969c\uff0c\u4fdd\u8bc1\u5c4f\u969c\u4e4b\u524d\u7684\u8bfb\u64cd\u4f5c\u4e00\u5b9a\u4f1a\u5728\u540e\u6765\u7684\u8bfb\u64cd\u4f5c\u6267\u884c\u4e4b\u524d\u5b8c\u6210\nvoid read_barrier_depends(void); \/\/ \u4e0ermb\u7c7b\u4f3c\uff0c\u6700\u597d\u4f7f\u7528rmb\nvoid wmb(void); \/\/ \u5199\u5185\u5b58\u5c4f\u969c\uff0c\u4fdd\u8bc1\u5199\u64cd\u4f5c\u7684\u987a\u5e8f\nvoid mb(void); \/\/ \u4fdd\u8bc1\u8bfb\u5199\u90fd\u4e0d\u4f1a\u4e71\u5e8f<\/a><\/code><\/pre>\n<\/p>\n
#include \nstruct resource *request_region(unsigned long first, unsigned long n, const char *name);<\/code><\/pre>\n<\/p>\n
void release_region(unsigned long first, unsigned long n);<\/code><\/pre>\n<\/p>\n
int check_region(unsigned long first, unsigned long n);<\/code><\/pre>\n<\/p>\n
unsigned inb(unsigned port);\nvoid outb(unsgined char byte, unsigned port);\nunsigned inw(unsigned port);\nvoid outw(unsgined char byte, unsigned port);\nunsigned inl(unsigned port);\nvoid outl(unsgined char byte, unsigned port);<\/code><\/pre>\n<\/p>\n
void insb(unsigned port, void *addr, unsigned long count);\nvoid outsb(unsigned port, void *addr, unsigned long count);\nvoid insw(unsigned port, void *addr, unsigned long count);\nvoid outsw(unsigned port, void *addr, unsigned long count);\nvoid insl(unsigned port, void *addr, unsigned long count);\nvoid outsl(unsigned port, void *addr, unsigned long count);<\/code><\/pre>\n<\/p>\n
struct resource *request_mem_region(unsigned long start, unsigned long len, char *name);<\/code><\/pre>\n<\/p>\n
void release_mem_region(unsgined long start, unsigned long len);<\/code><\/pre>\n<\/p>\n
int check_mem_region(unsigned long start, unsigned long len);<\/code><\/pre>\n<\/p>\n
#include \nvoid *ioremap(unsigned long phys_addr, unsigned long size);\nvoid *ioremap_nocache(unsigned log phys_addr, unsigned long size);\nvoid iounmap(void *addr);<\/a><\/code><\/pre>\n<\/p>\n
#include \nunsigned int ioread8(void *addr);\nunsigned int ioread16(void *addr);\nunsigned int ioread32(void *addr);\nvoid iowrite8(u8 value, void *addr);\nvoid iowrite16(u16 value, void *addr);\nvoid iowrite32(u32 value, void *addr);<\/a><\/code><\/pre>\n<\/p>\n
void ioread8_rep(void *addr, void *buf, unsigned long count);\nvoid ioread16_rep(void *addr, void *buf, unsigned long count);\nvoid ioread32_rep(void *addr, void *buf, unsigned long count);\nvoid iowrite8_rep(void *addr, void *buf, unsigned long count);\nvoid iowrite16_rep(void *addr, void *buf, unsigned long count);\nvoid iowrite32_rep(void *addr, void *buf, unsigned long count);<\/code><\/pre>\n<\/p>\n
void memset_io(void *addr, u8 value, unsigned int count);\nvoid memcpy_fromio(void *dest, void * source, unsigned int count);\nvoid memcpy_toio(void *dest, void *source, unsigned int count);<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"