Linux kernel device driver address mapping notes

Linux kernel device driver address mapping notes
#include <asm/io.h>
#define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
//cookie indicates the physical address, size indicates the mapping size. ioremap maps the specified physical address to an 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 after mapping from physical address

  • Virtual address = ioremap(physical address, mapping size);
  • After use, iounmap(virtual address); //delete the mapping table

2.

ioread8(address)/readb()
ioread16(address)/readw()
ioread32(address)/readl()

iowrite8(value, address) / writeb
iowrite16(value, address) / writew
iowrite32(value, address) / writel
#include <asm/sizes.h>
SZ_4K
SZ_1M

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • An easy way to port Linux code to Windows
  • Linux kernel device driver memory management notes
  • Linux kernel device driver kernel time management notes
  • Linux kernel device driver character device driver notes
  • Linux kernel device driver virtual file system notes
  • Linux kernel device driver system call notes
  • Linux kernel device driver kernel debugging technical notes collation
  • Linux kernel device driver kernel linked list usage notes
  • Linux kernel device driver proc file system notes
  • Linux kernel device driver advanced character device driver notes
  • Linux kernel device driver Linux kernel module loading mechanism notes summary
  • Linux kernel device driver Linux kernel basic notes summary
  • Steps to transplant the new kernel to the Linux system

<<:  Tutorial on how to remotely connect to MySQL database under Linux system

>>:  Example of downloading files with vue+django

Recommend

Detailed explanation of jQuery's core functions and event handling

Table of contents event Page Loading Event Delega...

td width problem when td cells are merged

In the following example, when the width of the td...

The perfect solution to the Chinese garbled characters in mysql6.x under win7

1. Stop the MySQL service in the command line: ne...

Negative distance (empathy) - iterative process of mutual influence

Negative distance refers to empathy. Preface (rai...

CSS code to achieve background gradient and automatic full screen

CSS issues about background gradient and automati...

Vue implements seamless scrolling of lists

This article example shares the specific code of ...

How to execute PHP scheduled tasks in CentOS7

Preface This article mainly introduces the releva...

CSS3 realizes various graphic effects of small arrows

It’s great to use CSS to realize various graphics...

A detailed discussion of components in Vue

Table of contents 1. Component Registration 2. Us...

Detailed explanation of the definition and function of delimiter in MySQL

When you first learn MySQL, you may not understan...

Native JS implementation of loading progress bar

This article shares a dynamic loading progress ba...

JavaScript imitates Jingdong carousel effect

This article shares the specific code for JavaScr...

Do you know all 24 methods of JavaScript loop traversal?

Table of contents Preface 1. Array traversal meth...

MySQL compressed package version zip installation configuration method

There are some problems with the compressed versi...

Introduction to commonly used MySQL commands in Linux environment

Enter the mysql command: mysql -u+(user name) -p+...