亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? kernel-hacking.tmpl

?? ARM 嵌入式 系統(tǒng) 設(shè)計(jì)與實(shí)例開發(fā) 實(shí)驗(yàn)教材 二源碼
?? TMPL
?? 第 1 頁 / 共 4 頁
字號:
   </para>  </sect1>  <sect1 id="routines-init">   <title><type>__init</type>/<type>__exit</type>/<type>__initdata</type>    <filename class=headerfile>include/linux/init.h</filename></title>   <para>    After boot, the kernel frees up a special section; functions    marked with <type>__init</type> and data structures marked with    <type>__initdata</type> are dropped after boot is complete (within    modules this directive is currently ignored).  <type>__exit</type>    is used to declare a function which is only required on exit: the    function will be dropped if this file is not compiled as a module.    See the header file for use. Note that it makes no sense for a function    marked with <type>__init</type> to be exported to modules with     <function>EXPORT_SYMBOL()</function> - this will break.   </para>   <para>   Static data structures marked as <type>__initdata</type> must be initialised   (as opposed to ordinary static data which is zeroed BSS) and cannot be    <type>const</type>.   </para>   </sect1>  <sect1 id="routines-init-again">   <title><function>__initcall()</function>/<function>module_init()</function>    <filename class=headerfile>include/linux/init.h</filename></title>   <para>    Many parts of the kernel are well served as a module    (dynamically-loadable parts of the kernel).  Using the    <function>module_init()</function> and    <function>module_exit()</function> macros it is easy to write code    without #ifdefs which can operate both as a module or built into    the kernel.   </para>   <para>    The <function>module_init()</function> macro defines which    function is to be called at module insertion time (if the file is    compiled as a module), or at boot time: if the file is not    compiled as a module the <function>module_init()</function> macro    becomes equivalent to <function>__initcall()</function>, which    through linker magic ensures that the function is called on boot.   </para>   <para>    The function can return a negative error number to cause    module loading to fail (unfortunately, this has no effect if    the module is compiled into the kernel).  For modules, this is    called in user context, with interrupts enabled, and the    kernel lock held, so it can sleep.   </para>  </sect1>    <sect1 id="routines-moduleexit">   <title> <function>module_exit()</function>    <filename class=headerfile>include/linux/init.h</filename> </title>   <para>    This macro defines the function to be called at module removal    time (or never, in the case of the file compiled into the    kernel).  It will only be called if the module usage count has    reached zero.  This function can also sleep, but cannot fail:    everything must be cleaned up by the time it returns.   </para>  </sect1>  <sect1 id="routines-module-use-counters">   <title> <function>MOD_INC_USE_COUNT</function>/<function>MOD_DEC_USE_COUNT</function>    <filename class=headerfile>include/linux/module.h</filename></title>   <para>    These manipulate the module usage count, to protect against    removal (a module also can't be removed if another module uses    one of its exported symbols: see below).  Every reference to    the module from user context should be reflected by this    counter (e.g. for every data structure or socket) before the    function sleeps.  To quote Tim Waugh:   </para>   <programlisting>/* THIS IS BAD */foo_open (...){        stuff..        if (fail)                return -EBUSY;        sleep.. (might get unloaded here)        stuff..        MOD_INC_USE_COUNT;        return 0;}/* THIS IS GOOD /foo_open (...){        MOD_INC_USE_COUNT;        stuff..        if (fail) {                MOD_DEC_USE_COUNT;                return -EBUSY;        }        sleep.. (safe now)        stuff..        return 0;}   </programlisting>   <para>   You can often avoid having to deal with these problems by using the    <structfield>owner</structfield> field of the    <structname>file_operations</structname> structure. Set this field   as the macro <symbol>THIS_MODULE</symbol>.   </para>   <para>   For more complicated module unload locking requirements, you can set the   <structfield>can_unload</structfield> function pointer to your own routine,   which should return <returnvalue>0</returnvalue> if the module is   unloadable, or <returnvalue>-EBUSY</returnvalue> otherwise.   </para>     </sect1> </chapter> <chapter id="queues">  <title>Wait Queues   <filename class=headerfile>include/linux/wait.h</filename>  </title>  <para>   <emphasis>[SLEEPS]</emphasis>  </para>  <para>   A wait queue is used to wait for someone to wake you up when a   certain condition is true.  They must be used carefully to ensure   there is no race condition.  You declare a   <type>wait_queue_head_t</type>, and then processes which want to   wait for that condition declare a <type>wait_queue_t</type>   referring to themselves, and place that in the queue.  </para>  <sect1 id="queue-declaring">   <title>Declaring</title>      <para>    You declare a <type>wait_queue_head_t</type> using the    <function>DECLARE_WAIT_QUEUE_HEAD()</function> macro, or using the    <function>init_waitqueue_head()</function> routine in your    initialization code.   </para>  </sect1>    <sect1 id="queue-waitqueue">   <title>Queuing</title>      <para>    Placing yourself in the waitqueue is fairly complex, because you    must put yourself in the queue before checking the condition.    There is a macro to do this:    <function>wait_event_interruptible()</function>    <filename class=headerfile>include/linux/sched.h</filename> The    first argument is the wait queue head, and the second is an    expression which is evaluated; the macro returns    <returnvalue>0</returnvalue> when this expression is true, or    <returnvalue>-ERESTARTSYS</returnvalue> if a signal is received.    The <function>wait_event()</function> version ignores signals.   </para>   <para>   Do not use the <function>sleep_on()</function> function family -   it is very easy to accidentally introduce races; almost certainly   one of the <function>wait_event()</function> family will do, or a   loop around <function>schedule_timeout()</function>. If you choose   to loop around <function>schedule_timeout()</function> remember   you must set the task state (with    <function>set_current_state()</function>) on each iteration to avoid   busy-looping.   </para>   </sect1>  <sect1 id="queue-waking">   <title>Waking Up Queued Tasks</title>      <para>    Call <function>wake_up()</function>    <filename class=headerfile>include/linux/sched.h</filename>;,    which will wake up every process in the queue.  The exception is    if one has <constant>TASK_EXCLUSIVE</constant> set, in which case    the remainder of the queue will not be woken.   </para>  </sect1> </chapter> <chapter id="atomic-ops">  <title>Atomic Operations</title>  <para>   Certain operations are guaranteed atomic on all platforms.  The   first class of operations work on <type>atomic_t</type>   <filename class=headerfile>include/asm/atomic.h</filename>; this   contains a signed integer (at least 24 bits long), and you must use   these functions to manipulate or read atomic_t variables.   <function>atomic_read()</function> and   <function>atomic_set()</function> get and set the counter,   <function>atomic_add()</function>,   <function>atomic_sub()</function>,   <function>atomic_inc()</function>,   <function>atomic_dec()</function>, and   <function>atomic_dec_and_test()</function> (returns   <returnvalue>true</returnvalue> if it was decremented to zero).  </para>  <para>   Yes.  It returns <returnvalue>true</returnvalue> (i.e. != 0) if the   atomic variable is zero.  </para>  <para>   Note that these functions are slower than normal arithmetic, and   so should not be used unnecessarily.  On some platforms they   are much slower, like 32-bit Sparc where they use a spinlock.  </para>  <para>   The second class of atomic operations is atomic bit operations on a   <type>long</type>, defined in   <filename class=headerfile>include/asm/bitops.h</filename>.  These   operations generally take a pointer to the bit pattern, and a bit   number: 0 is the least significant bit.   <function>set_bit()</function>, <function>clear_bit()</function>   and <function>change_bit()</function> set, clear, and flip the   given bit.  <function>test_and_set_bit()</function>,   <function>test_and_clear_bit()</function> and   <function>test_and_change_bit()</function> do the same thing,   except return true if the bit was previously set; these are   particularly useful for very simple locking.  </para>    <para>   It is possible to call these operations with bit indices greater   than BITS_PER_LONG.  The resulting behavior is strange on big-endian   platforms though so it is a good idea not to do this.  </para>  <para>   Note that the order of bits depends on the architecture, and in   particular, the bitfield passed to these operations must be at   least as large as a <type>long</type>.  </para> </chapter> <chapter id="symbols">  <title>Symbols</title>  <para>   Within the kernel proper, the normal linking rules apply   (ie. unless a symbol is declared to be file scope with the   <type>static</type> keyword, it can be used anywhere in the   kernel).  However, for modules, a special exported symbol table is   kept which limits the entry points to the kernel proper.  Modules   can also export symbols.  </para>  <sect1 id="sym-exportsymbols">   <title><function>EXPORT_SYMBOL()</function>    <filename class=headerfile>include/linux/module.h</filename></title>   <para>    This is the classic method of exporting a symbol, and it works    for both modules and non-modules.  In the kernel all these    declarations are often bundled into a single file to help    genksyms (which searches source files for these declarations).    See the comment on genksyms and Makefiles below.   </para>  </sect1>  <sect1 id="sym-exportnosymbols">   <title><symbol>EXPORT_NO_SYMBOLS</symbol>    <filename class=headerfile>include/linux/module.h</filename></title>   <para>    If a module exports no symbols then you can specify    <programlisting>EXPORT_NO_SYMBOLS;    </programlisting>    anywhere in the module.    In kernel 2.4 and earlier, if a module contains neither    <function>EXPORT_SYMBOL()</function> nor    <symbol>EXPORT_NO_SYMBOLS</symbol> then the module defaults to    exporting all non-static global symbols.    In kernel 2.5 onwards you must explicitly specify whether a module    exports symbols or not.   </para>  </sect1>  <sect1 id="sym-exportsymbols-gpl">   <title><function>EXPORT_SYMBOL_GPL()</function>    <filename class=headerfile>include/linux/module.h</filename></title>   <para>    Similar to <function>EXPORT_SYMBOL()</function> except that the    symbols exported by <function>EXPORT_SYMBOL_GPL()</function> can    only be seen by modules with a    <function>MODULE_LICENCE()</function> that specifies a GPL    compatible license.   </para>  </sect1> </chapter> <chapter id="conventions">  <title>Routines and Conventions</title>  <sect1 id="conventions-doublelinkedlist">   <title>Double-linked lists    <filename class=headerfile>include/linux/list.h</filename></title>   <para>    There are three sets of linked-list routines in the kernel    headers, but this one seems to be winning out (and Linus has    used it).  If you don't have some particular pressing need for    a single list, it's a good choice.  In fact, I don't care    whether it's a good choice or not, just use it so we can get    rid of the others.   </para>  </sect1>  <sect1 id="convention-returns">   <title>Return Conventions</title>   <para>    For code called in user context, it's very common to defy C    convention, and return <returnvalue>0</returnvalue> for success,    and a negative error number    (eg. <returnvalue>-EFAULT</returnvalue>) for failure.  This can be    unintuitive at first, but it's fairly widespread in the networking    code, for example.   </para>   <para>    The filesystem code uses <function>ERR_PTR()</function>    <filename class=headerfile>include/linux/fs.h</filename>; to    encode a negative error number into a pointer, and    <function>IS_ERR()</function> and <function>PTR_ERR()</function>    to get it back out again: avoids a separate pointer parameter for    the error number.  Icky, but in a good way.   </para>  </sect1>  <sect1 id="conventions-borkedcompile">   <title>Breaking Compilation</title>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷丁香激情综合| 欧美性猛交xxxx黑人交| 欧美午夜电影网| 9191成人精品久久| 国产精品国产三级国产有无不卡 | 日韩精品免费专区| 国产精品亚洲一区二区三区在线| 91精品福利在线| 精品国产成人在线影院| 亚洲自拍都市欧美小说| 国产精品一线二线三线精华| 欧美三级韩国三级日本一级| 国产精品电影一区二区三区| 久久99国内精品| 欧美日韩国产系列| 亚洲人成小说网站色在线| 国产一级精品在线| 日韩欧美精品在线| 亚洲国产精品嫩草影院| 99久久婷婷国产综合精品电影| 日韩一区二区三区观看| 一级日本不卡的影视| 国产99精品在线观看| 91精品国产综合久久国产大片 | 精品欧美久久久| 一区二区三区中文字幕| 成人免费福利片| 国产三级欧美三级日产三级99 | 99久久久久久| 久久久不卡网国产精品二区 | 中文字幕日韩精品一区| 国产凹凸在线观看一区二区| 精品国产伦一区二区三区观看方式 | 色综合色综合色综合色综合色综合| 精品99一区二区| 久久av资源站| 日韩免费在线观看| 精品一区二区三区在线观看国产| 欧美日本在线一区| 午夜成人在线视频| 91精品国产综合久久久久久久久久| 亚洲风情在线资源站| 欧美裸体bbwbbwbbw| 亚洲午夜精品一区二区三区他趣| 91老师国产黑色丝袜在线| 亚洲视频香蕉人妖| 日本国产一区二区| 亚洲成人午夜影院| 欧美一级欧美三级在线观看| 免费成人在线播放| 久久人人97超碰com| 高清在线不卡av| 国产精品初高中害羞小美女文| www.亚洲在线| 亚洲曰韩产成在线| 欧美乱熟臀69xxxxxx| 99这里只有精品| 亚洲女人****多毛耸耸8| 色久优优欧美色久优优| 日韩综合小视频| 精品盗摄一区二区三区| 国产成人精品三级| 亚洲同性gay激情无套| 欧美丝袜丝交足nylons| 久久精品国产一区二区| 国产喂奶挤奶一区二区三区| 91美女蜜桃在线| 七七婷婷婷婷精品国产| 日本一区二区三级电影在线观看| 亚洲欧洲综合另类| 国产成人综合视频| 亚洲黄色免费网站| 精品久久久久一区| 91论坛在线播放| 麻豆精品视频在线观看视频| 国产精品久久精品日日| 欧美日韩精品免费| 国产999精品久久久久久绿帽| 亚洲女人的天堂| 欧美xxxx老人做受| 色素色在线综合| 国内成人精品2018免费看| 日韩美女久久久| 精品国产免费视频| 欧美日韩一区二区三区免费看 | 国产成人免费xxxxxxxx| 洋洋成人永久网站入口| 久久色在线观看| 欧美老人xxxx18| 成人av网站在线观看免费| 日韩中文字幕不卡| 亚洲色大成网站www久久九九| 欧美成人精品高清在线播放| 一本色道久久综合亚洲91| 国产一区二区不卡| 日韩国产精品91| 亚洲免费观看高清完整版在线| 久久综合九色综合久久久精品综合 | 综合精品久久久| 欧美一级一区二区| 欧美天堂亚洲电影院在线播放| 国产成+人+日韩+欧美+亚洲| 青娱乐精品视频| 一区二区成人在线视频| 国产精品丝袜一区| 久久―日本道色综合久久| 欧美一区二区三区小说| 日本丶国产丶欧美色综合| 国产.欧美.日韩| 国产成人综合在线| 国产精品影音先锋| 久久精品国产精品青草| 天堂蜜桃一区二区三区| 一区二区三区鲁丝不卡| 亚洲免费视频成人| 亚洲欧洲日韩av| 中文字幕亚洲在| 中文字幕在线免费不卡| 中文字幕欧美日韩一区| 国产女人水真多18毛片18精品视频 | 国产精品白丝jk黑袜喷水| 免费看日韩精品| 青青草原综合久久大伊人精品 | 成人免费观看男女羞羞视频| 激情丁香综合五月| 国产在线一区二区| 国产91在线看| 99国产精品一区| 一本色道久久加勒比精品| 91在线观看视频| 欧美亚洲另类激情小说| 欧美亚洲国产一区二区三区| 在线观看视频一区| 欧美乱妇15p| 欧美大胆人体bbbb| 久久精品一区蜜桃臀影院| 国产欧美日本一区视频| 亚洲品质自拍视频| 亚洲综合精品自拍| 日本欧美在线看| 美女在线视频一区| 国产精品一品视频| 91麻豆国产福利在线观看| 久久综合色之久久综合| 久久久国产一区二区三区四区小说 | 久久精品99国产国产精| 久久精品国产精品青草| 成人一级片在线观看| 99精品视频在线免费观看| 欧美日韩在线一区二区| 精品sm在线观看| 亚洲麻豆国产自偷在线| 青青国产91久久久久久 | 蜜臀99久久精品久久久久久软件| 久久国产精品区| av电影在线观看不卡| 在线看日韩精品电影| 精品精品国产高清一毛片一天堂| 国产精品久久综合| 日日夜夜免费精品| 波多野结衣精品在线| 欧美精品第一页| 中文字幕一区日韩精品欧美| 午夜精品免费在线| fc2成人免费人成在线观看播放| 欧美日韩午夜精品| 欧美韩国一区二区| 日韩在线一区二区三区| 懂色av噜噜一区二区三区av| 欧美精品久久天天躁| 国产精品久久久久一区 | 韩国成人福利片在线播放| 日本韩国欧美在线| 国产亚洲精品福利| 99免费精品视频| 91精品一区二区三区久久久久久| 国产欧美精品日韩区二区麻豆天美| 亚洲大尺度视频在线观看| 成人性生交大片免费看中文 | 最新国产成人在线观看| 蜜臀精品久久久久久蜜臀 | 韩国精品在线观看| 在线观看日韩av先锋影音电影院| 国产亚洲婷婷免费| 另类小说色综合网站| 欧美精品久久一区| 亚洲综合在线第一页| av成人动漫在线观看| 久久精品视频在线免费观看| 日本不卡一二三区黄网| 欧美在线你懂得| 亚洲欧美成人一区二区三区| 成人午夜精品在线| 精品999久久久| 麻豆精品视频在线观看| 3d成人动漫网站| 亚洲成av人在线观看| 91久久精品一区二区二区| 国产精品少妇自拍| 成人免费高清视频|