Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of device driver address Mapping in Linux Kernel

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux kernel device driver address mapping example analysis, the article is very detailed, has a certain reference value, interested friends must read it!

# include # define ioremap (cookie,size) _ arm_ioremap (cookie,size, MT_DEVICE) / / cookie represents the physical address, and size represents the mapping size. Ioremap maps the specified physical address to the idle virtual address void _ _ iomem * _ arm_ioremap (unsigned long phys_addr, size_t size, unsigned int mtype) {return_ _ arm_ioremap_caller (phys_addr, size, mtype,__builtin_return_address (0));}

1. Virtual address mapped according to physical address

Virtual address = ioremap (physical address, how big is the mapping)

Iounmap (virtual address) after use; / / delete the mapping table

two。

Ioread8 (address) / readb () ioread16 (address) / readw () ioread32 (address) / readl () iowrite8 (value, address) / writebiowrite16 (value, address) / writewiowrite32 (value, address) / writel#include SZ_4KSZ_1M are all the contents of the article "example Analysis of Linux Kernel device driver address Mapping". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report