2 * arch/arm/mm/mm-armv.c
4 * Common routines for ARM v3 and v4 architectures.
6 * Copyright (C) 1998 Russell King
8 * Do not compile this file directly!
12 #error MAPPING not defined - do not compile this file individually
15 static const struct mapping
{
16 unsigned long virtual;
17 unsigned long physical
;
22 } mapping
[] __initdata
= {
26 #define SIZEOFMAP (sizeof(mapping) / sizeof(mapping[0]))
28 unsigned long __init
setup_io_pagetables(unsigned long start_mem
)
30 const struct mapping
*mp
;
33 for (i
= 0, mp
= mapping
; i
< SIZEOFMAP
; i
++, mp
++) {
34 unsigned long virtual, physical
, length
;
37 virtual = mp
->virtual;
38 physical
= mp
->physical
;
40 prot
= (mp
->prot_read
? L_PTE_USER
: 0) | (mp
->prot_write
? L_PTE_WRITE
: 0)
41 | L_PTE_PRESENT
| L_PTE_YOUNG
| L_PTE_DIRTY
;
43 while ((virtual & 1048575 || physical
& 1048575) && length
>= PAGE_SIZE
) {
44 alloc_init_page(&start_mem
, virtual, physical
, mp
->domain
, prot
);
47 physical
+= PAGE_SIZE
;
50 prot
= (mp
->prot_read
? PMD_SECT_AP_READ
: 0) |
51 (mp
->prot_write
? PMD_SECT_AP_WRITE
: 0);
53 while (length
>= 1048576) {
54 alloc_init_section(&start_mem
, virtual, physical
, mp
->domain
, prot
);
60 prot
= (mp
->prot_read
? L_PTE_USER
: 0) | (mp
->prot_write
? L_PTE_WRITE
: 0)
61 | L_PTE_PRESENT
| L_PTE_YOUNG
| L_PTE_DIRTY
;
63 while (length
>= PAGE_SIZE
) {
64 alloc_init_page(&start_mem
, virtual, physical
, mp
->domain
, prot
);
67 physical
+= PAGE_SIZE
;