Android Deep Explore reading notes eighth Chapter

Source: Internet
Author: User

The reuse of code is divided into static reuse and dynamic reuse. Static Reuse:Adopt a standardCprogram, put the code that will be reused in other files, and if you want to use some of the appropriate features,includeThe corresponding header file can be. Dynamic Reuse:Is aLinuxThe driver can use a differentLinuxresources in the drive. There is another way to share code:, module dependencies, also known as export symbols. The exported symbols (constants, variables, functions, etc.) are used in one drive module in another. Compilation is made up of multiple filesLinuxDrive, ifLinuxThe driver code is not much, you can put all the code in a file, ifLinuxdriver code is more complex, it is necessary to use multiple source code files to hold different function code, which facilitates the classification and management of code. IfLinuxdriver to use the original code of a third party, then you have to compile multiple source code files, and eventually generate. Kofiles or compiled intoLinuxkernel. Forced uninstallation is required in some casesLinuxDrive: 1, becauseLinuxThe initialization function of the driver module crashes for some operation, which causes the initialization function to fail back properly. 2, in useRmmodwhen the command unloads the drive, the system invokes the Unload function, and only if the Unload function returns successfully.Linuxthe driver will be uninstalled if the Unload function is blocked,Rmmodcommand will also be blocked, unable to perform to uninstallLinuxthe code for the drive module. The root of this problem is the Unload function, so just replace the original unload function with an empty unload function.

http://www.cnblogs.com/sam0304/

Android Deep Explore reading notes eighth Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.