Add arm32 architecture. The 32 suffix is used to specify that 16-bit Thumb
[helenos.git] / kernel / arch / arm32 / include / mm / page.h
blobb225d3e736276a8f06502800428854ec00753eee
1 /*
2 * Copyright (c) 2003-2007 Jakub Jermar
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 /** @addtogroup arm32mm
30 * @{
32 /** @file
35 #ifndef KERN_arm32_PAGE_H_
36 #define KERN_arm32_PAGE_H_
38 #include <arch/mm/frame.h>
40 #define PAGE_WIDTH FRAME_WIDTH
41 #define PAGE_SIZE FRAME_SIZE
43 #define PAGE_COLOR_BITS 0 /* dummy */
45 #ifndef __ASM__
46 # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
47 # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
48 #else
49 # define KA2PA(x) ((x) - 0x80000000)
50 # define PA2KA(x) ((x) + 0x80000000)
51 #endif
53 #ifdef KERNEL
55 #define PTL0_ENTRIES_ARCH 0 /* TODO */
56 #define PTL1_ENTRIES_ARCH 0 /* TODO */
57 #define PTL2_ENTRIES_ARCH 0 /* TODO */
58 #define PTL3_ENTRIES_ARCH 0 /* TODO */
60 #define PTL0_INDEX_ARCH(vaddr) 0 /* TODO */
61 #define PTL1_INDEX_ARCH(vaddr) 0 /* TODO */
62 #define PTL2_INDEX_ARCH(vaddr) 0 /* TODO */
63 #define PTL3_INDEX_ARCH(vaddr) 0 /* TODO */
65 #define SET_PTL0_ADDRESS_ARCH(ptl0)
67 #define GET_PTL1_ADDRESS_ARCH(ptl0, i) 0 /* TODO */
68 #define GET_PTL2_ADDRESS_ARCH(ptl1, i) 0 /* TODO */
69 #define GET_PTL3_ADDRESS_ARCH(ptl2, i) 0 /* TODO */
70 #define GET_FRAME_ADDRESS_ARCH(ptl3, i) 0 /* TODO */
72 #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) /* TODO */
73 #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a) /* TODO */
74 #define SET_PTL3_ADDRESS_ARCH(ptl2, i, a) /* TODO */
75 #define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) /* TODO */
77 #define GET_PTL1_FLAGS_ARCH(ptl0, i) 0 /* TODO */
78 #define GET_PTL2_FLAGS_ARCH(ptl1, i) 0 /* TODO */
79 #define GET_PTL3_FLAGS_ARCH(ptl2, i) 0 /* TODO */
80 #define GET_FRAME_FLAGS_ARCH(ptl3, i) 0 /* TODO */
82 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) /* TODO */
83 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) /* TODO */
84 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) /* TODO */
85 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) /* TODO */
87 #define PTE_VALID_ARCH(pte) 0 /* TODO */
88 #define PTE_PRESENT_ARCH(pte) 0 /* TODO */
89 #define PTE_GET_FRAME_ARCH(pte) 0 /* TODO */
90 #define PTE_WRITABLE_ARCH(pte) 0 /* TODO */
91 #define PTE_EXECUTABLE_ARCH(pte) 0 /* TODO */
93 #ifndef __ASM__
95 #include <mm/mm.h>
96 #include <arch/exception.h>
98 static inline int get_pt_flags(pte_t *pt, index_t i)
100 return 0; /* TODO */
103 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)
105 /* TODO */
106 return;
109 extern void page_arch_init(void);
111 #endif /* __ASM__ */
113 #endif /* KERNEL */
115 #endif
117 /** @}