| |

VerySource

 Forgot password?
 Register
Search
View: 1708|Reply: 1

Difference between the function inl () and readl () that access I / O

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-22 19:40:01
| Show all posts |Read mode
Excuse me, the function unsigned inl (unsigned port) for accessing 32-bit I / O ports under Linux;
And I have seen in some books that when accessing directly mapped I / O memory areas, the function unsigned readl (address) is used;
Some dizzy, what's the difference between these two functions? Prawn help solve it!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-6 12:30:01
| Show all posts
Features:

Read data from the memory mapped I/O space.

Readb() Read 8-bit data (1 byte) from I/O

Readw() read 16-bit data (2 bytes) from I/O
Readl() read 8-bit data (4 bytes) from I/O

prototype:

#include <asm/io.h>

Unsigned char readb(unsigned int addr)

Unsigned char readw(unsigned int addr)

Unsigned char readl(unsigned int addr)

variable

Addr is the I/O address

Return value: The value read from the I/O space.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list