€•xgŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”(hhŒparent”hubaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ./translations/zh_CN/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”(hhhh2ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/zh_TW/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”(hhhhFubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/it_IT/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”(hhhhZubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ja_JP/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”(hhhhnubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/ko_KR/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”(hhhh‚ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ./translations/sp_SP/core-api/symbol-namespaces”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒSymbol Namespaces”h]”hŒSymbol Namespaces”…””}”(hhªhh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒH/var/lib/git/docbuild/linux/Documentation/core-api/symbol-namespaces.rst”h KubhŒ paragraph”“”)”}”(hŒ©The following document describes how to use Symbol Namespaces to structure the export surface of in-kernel symbols exported through the family of EXPORT_SYMBOL() macros.”h]”hŒ©The following document describes how to use Symbol Namespaces to structure the export surface of in-kernel symbols exported through the family of EXPORT_SYMBOL() macros.”…””}”(hh»hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒcomment”“”)”}”(hXETable of Contents === 1 Introduction === 2 How to define Symbol Namespaces --- 2.1 Using the EXPORT_SYMBOL macros --- 2.2 Using the DEFAULT_SYMBOL_NAMESPACE define === 3 How to use Symbols exported in Namespaces === 4 Loading Modules that use namespaced Symbols === 5 Automatically creating MODULE_IMPORT_NS statements”h]”hXETable of Contents === 1 Introduction === 2 How to define Symbol Namespaces --- 2.1 Using the EXPORT_SYMBOL macros --- 2.2 Using the DEFAULT_SYMBOL_NAMESPACE define === 3 How to use Symbols exported in Namespaces === 4 Loading Modules that use namespaced Symbols === 5 Automatically creating MODULE_IMPORT_NS statements”…””}”(hhhhÉubah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hÇhh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ1. Introduction”h]”hŒ1. Introduction”…””}”(hhÞhhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhÙhžhhŸh¶h Kubh¸)”}”(hX^Symbol Namespaces have been introduced as a means to structure the export surface of the in-kernel API. It allows subsystem maintainers to partition their exported symbols into separate namespaces. That is useful for documentation purposes (think of the SUBSYSTEM_DEBUG namespace) as well as for limiting the availability of a set of symbols for use in other parts of the kernel. As of today, modules that make use of symbols exported into namespaces, are required to import the namespace. Otherwise the kernel will, depending on its configuration, reject loading the module or warn about a missing import.”h]”hX^Symbol Namespaces have been introduced as a means to structure the export surface of the in-kernel API. It allows subsystem maintainers to partition their exported symbols into separate namespaces. That is useful for documentation purposes (think of the SUBSYSTEM_DEBUG namespace) as well as for limiting the availability of a set of symbols for use in other parts of the kernel. As of today, modules that make use of symbols exported into namespaces, are required to import the namespace. Otherwise the kernel will, depending on its configuration, reject loading the module or warn about a missing import.”…””}”(hhìhhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhÙhžhubeh}”(h]”Œ introduction”ah ]”h"]”Œ1. introduction”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ"2. How to define Symbol Namespaces”h]”hŒ"2. How to define Symbol Namespaces”…””}”(hjhjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h K ubh¸)”}”(hŒ¦Symbols can be exported into namespace using different methods. All of them are changing the way EXPORT_SYMBOL and friends are instrumented to create ksymtab entries.”h]”hŒ¦Symbols can be exported into namespace using different methods. All of them are changing the way EXPORT_SYMBOL and friends are instrumented to create ksymtab entries.”…””}”(hjhjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K"hjhžhubeh}”(h]”Œhow-to-define-symbol-namespaces”ah ]”h"]”Œ"2. how to define symbol namespaces”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K ubh¢)”}”(hhh]”(h§)”}”(hŒ"2.1 Using the EXPORT_SYMBOL macros”h]”hŒ"2.1 Using the EXPORT_SYMBOL macros”…””}”(hj,hj*hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj'hžhhŸh¶h K'ubh¸)”}”(hXäIn addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow exporting of kernel symbols to the kernel symbol table, variants of these are available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace. Please note that due to macro expansion that argument needs to be a preprocessor symbol. E.g. to export the symbol ``usb_stor_suspend`` into the namespace ``USB_STORAGE``, use::”h]”(hX¦In addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow exporting of kernel symbols to the kernel symbol table, variants of these are available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace. Please note that due to macro expansion that argument needs to be a preprocessor symbol. E.g. to export the symbol ”…””}”(hX¦In addition to the macros EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL(), that allow exporting of kernel symbols to the kernel symbol table, variants of these are available to export symbols into a certain namespace: EXPORT_SYMBOL_NS() and EXPORT_SYMBOL_NS_GPL(). They take one additional argument: the namespace. Please note that due to macro expansion that argument needs to be a preprocessor symbol. E.g. to export the symbol ”hj8hžhhŸNh NubhŒliteral”“”)”}”(hŒ``usb_stor_suspend``”h]”hŒusb_stor_suspend”…””}”(hhhjChžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhj8ubhŒ into the namespace ”…””}”(hŒ into the namespace ”hj8hžhhŸNh NubjB)”}”(hŒ``USB_STORAGE``”h]”hŒ USB_STORAGE”…””}”(hhhjVhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhj8ubhŒ, use:”…””}”(hŒ, use:”hj8hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K)hj'hžhubhŒ literal_block”“”)”}”(hŒ0EXPORT_SYMBOL_NS(usb_stor_suspend, USB_STORAGE);”h]”hŒ0EXPORT_SYMBOL_NS(usb_stor_suspend, USB_STORAGE);”…””}”(hhhjqubah}”(h]”h ]”h"]”h$]”h&]”h×hØuh1johŸh¶h K1hj'hžhubh¸)”}”(hXQThe corresponding ksymtab entry struct ``kernel_symbol`` will have the member ``namespace`` set accordingly. A symbol that is exported without a namespace will refer to ``NULL``. There is no default namespace if none is defined. ``modpost`` and kernel/module/main.c make use the namespace at build time or module load time, respectively.”h]”(hŒ'The corresponding ksymtab entry struct ”…””}”(hŒ'The corresponding ksymtab entry struct ”hjhžhhŸNh NubjB)”}”(hŒ``kernel_symbol``”h]”hŒ kernel_symbol”…””}”(hhhjˆhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhjubhŒ will have the member ”…””}”(hŒ will have the member ”hjhžhhŸNh NubjB)”}”(hŒ ``namespace``”h]”hŒ namespace”…””}”(hhhj›hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhjubhŒN set accordingly. A symbol that is exported without a namespace will refer to ”…””}”(hŒN set accordingly. A symbol that is exported without a namespace will refer to ”hjhžhhŸNh NubjB)”}”(hŒ``NULL``”h]”hŒNULL”…””}”(hhhj®hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhjubhŒ4. There is no default namespace if none is defined. ”…””}”(hŒ4. There is no default namespace if none is defined. ”hjhžhhŸNh NubjB)”}”(hŒ ``modpost``”h]”hŒmodpost”…””}”(hhhjÁhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhjubhŒa and kernel/module/main.c make use the namespace at build time or module load time, respectively.”…””}”(hŒa and kernel/module/main.c make use the namespace at build time or module load time, respectively.”hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K3hj'hžhubeh}”(h]”Œusing-the-export-symbol-macros”ah ]”h"]”Œ"2.1 using the export_symbol macros”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K'ubh¢)”}”(hhh]”(h§)”}”(hŒ-2.2 Using the DEFAULT_SYMBOL_NAMESPACE define”h]”hŒ-2.2 Using the DEFAULT_SYMBOL_NAMESPACE define”…””}”(hjçhjåhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjâhžhhŸh¶h K:ubh¸)”}”(hX7Defining namespaces for all symbols of a subsystem can be very verbose and may become hard to maintain. Therefore a default define (DEFAULT_SYMBOL_NAMESPACE) is been provided, that, if set, will become the default for all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() macro expansions that do not specify a namespace.”h]”hX7Defining namespaces for all symbols of a subsystem can be very verbose and may become hard to maintain. Therefore a default define (DEFAULT_SYMBOL_NAMESPACE) is been provided, that, if set, will become the default for all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() macro expansions that do not specify a namespace.”…””}”(hjõhjóhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K M=$PWD nsdeps”h]”hŒ,$ make -C M=$PWD nsdeps”…””}”(hhhj«ubah}”(h]”h ]”h"]”h$]”h&]”h×hØuh1johŸh¶h Khj!hžhubeh}”(h]”Œ2automatically-creating-module-import-ns-statements”ah ]”h"]”Œ55. automatically creating module_import_ns statements”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K~ubeh}”(h]”Œsymbol-namespaces”ah ]”h"]”Œsymbol namespaces”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jìŒerror_encoding”ŒUTF-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œ embed_images”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jÆjÃhýhúj$j!jßjÜjojljãjàjjj¾j»uŒ nametypes”}”(jÆNhýNj$NjßNjoNjãNjNj¾Nuh}”(jÃh£húhÙj!jjÜj'jljâjàjrjjæj»j!uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.