<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 嵌入式:關(guān)于Linux下_init與_exit的解釋

          嵌入式:關(guān)于Linux下_init與_exit的解釋

          作者: 時間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

          include/linux/init.h

          本文引用地址:http://www.ex-cimer.com/article/201609/303922.htm

          #define __init __attribute__ ((__section__ (.init.text)))

          #define __initdata __attribute__ ((__section__ (.init.data)))

          #define __exitdata __attribute__ ((__section__(.exit.data)))

          #define __exit_call __attribute_used__ __attribute__ ((__section__ (.exitcall.exit)))

          #ifdef MODULE

          #define __exit __attribute__ ((__section__(.exit.text)))

          #else

          #define __exit __attribute_used__ __attribute__ ((__section__(.exit.text)))

          #endif__init和__exit標(biāo)記,__initdata和__exitdata標(biāo)記數(shù)據(jù)。

          此宏定義可知標(biāo)記后的與數(shù)據(jù)其實是放到了特定的(代碼或數(shù)據(jù))段中。

          標(biāo)記為初始化的,表明該函數(shù)供在初始化期間使用。

          在模塊裝載之后,模塊裝載就會將初始化函數(shù)扔掉。這樣可以將該函數(shù)占用的內(nèi)存釋放出來。

          __exit修飾詞標(biāo)記函數(shù)只在模塊卸載時使用。

          如果模塊被直接編進內(nèi)核則該函數(shù)就不會被調(diào)用。如果內(nèi)核編譯時沒有包含該模塊,則此標(biāo)記的函數(shù)將被簡單地丟棄。



          關(guān)鍵詞: 嵌入式 函數(shù)

          評論


          相關(guān)推薦

          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();