IO Space and memory space for Linux

Source: Internet
Author: User

1


io space and memory space


Not all architectures have IO space defined, I know only the X86 system, and arm


There is no such difference in architecture, arm unified addressing,
On the X86, IO space and memory are independent, they each have their own bus, and IO space is generally 64K,


That is, 16 bits, accessed using the in and out commands. The memory space is 4G.
It can be seen that their differences are very large.


2


Static mappings:


The I/O static mapping is often used in the mapping of register resources, so that when writing kernel code or drivers, it is not


The ioremap is required to be accessed directly using the mapped kernel virtual address.
The MAP_IO member is the interface letter that the kernel provides to the user to create the peripheral I/O resource to the kernel virtual address static mapping table


Number.


The user can specify MAP_IO interface functions when defining the MACHINE_DESC structure, where the s3c2410 platform


As an example.
The S3C2410 MACHINE_DESC structure is defined as follows:
/* ARCH/ARM/MACH-S3C2410/MACH-SMDK2410.C */
Machine_start (SMDK2410, "SMDK2410")
. Phys_io = S3c2410_pa_uart,
. Io_pg_offst = (((u32) S3c24xx_va_uart >>) & 0XFFFC,
. Boot_params = S3c2410_sdram_pa + 0x100,
. Map_io = Smdk2410_map_io,
. INIT_IRQ = S3c24xx_init_irq,
. Init_machine = Smdk2410_init,
. Timer = &s3c24xx_timer,
Machine_end
As above, Map_io is initialized to Smdk2410_map_io. Smdk2410_map_io is our own definition of creative


A function that constructs a static I/O mapping table.


Dynamic Memory Mapping:


Using the Ioremap () function

IO Space and memory space for Linux

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.