Changeset a35b458 in mainline for kernel/arch/arm32/include
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- kernel/arch/arm32/include/arch
- Files:
-
- 4 edited
-
asm.h (modified) (2 diffs)
-
atomic.h (modified) (1 diff)
-
mm/page_armv4.h (modified) (4 diffs)
-
mm/page_armv6.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/arch/asm.h
r3061bc1 ra35b458 105 105 { 106 106 uintptr_t v; 107 107 108 108 asm volatile ( 109 109 "and %[v], sp, %[size]\n" … … 111 111 : [size] "r" (~(STACK_SIZE - 1)) 112 112 ); 113 113 114 114 return v; 115 115 } -
kernel/arch/arm32/include/arch/atomic.h
r3061bc1 ra35b458 59 59 atomic_count_t ret = val->count; 60 60 interrupts_restore(ipl); 61 61 62 62 return ret; 63 63 } -
kernel/arch/arm32/include/arch/mm/page_armv4.h
r3061bc1 ra35b458 137 137 pte_level0_t *p = &pt[i].l0; 138 138 int np = (p->descriptor_type == PTE_DESCRIPTOR_NOT_PRESENT); 139 139 140 140 return (np << PAGE_PRESENT_SHIFT) | (1 << PAGE_USER_SHIFT) | 141 141 (1 << PAGE_READ_SHIFT) | (1 << PAGE_WRITE_SHIFT) | … … 152 152 { 153 153 pte_level1_t *p = &pt[i].l1; 154 154 155 155 int dt = p->descriptor_type; 156 156 int ap = p->access_permission_0; 157 157 158 158 return ((dt == PTE_DESCRIPTOR_NOT_PRESENT) << PAGE_PRESENT_SHIFT) | 159 159 ((ap == PTE_AP_USER_RO_KERNEL_RW) << PAGE_READ_SHIFT) | … … 177 177 { 178 178 pte_level0_t *p = &pt[i].l0; 179 179 180 180 if (flags & PAGE_NOT_PRESENT) { 181 181 p->descriptor_type = PTE_DESCRIPTOR_NOT_PRESENT; … … 206 206 { 207 207 pte_level1_t *p = &pt[i].l1; 208 208 209 209 if (flags & PAGE_NOT_PRESENT) 210 210 p->descriptor_type = PTE_DESCRIPTOR_NOT_PRESENT; 211 211 else 212 212 p->descriptor_type = PTE_DESCRIPTOR_SMALL_PAGE; 213 213 214 214 p->cacheable = p->bufferable = (flags & PAGE_CACHEABLE) != 0; 215 215 216 216 /* default access permission */ 217 217 p->access_permission_0 = p->access_permission_1 = 218 218 p->access_permission_2 = p->access_permission_3 = 219 219 PTE_AP_USER_NO_KERNEL_RW; 220 220 221 221 if (flags & PAGE_USER) { 222 222 if (flags & PAGE_READ) { -
kernel/arch/arm32/include/arch/mm/page_armv6.h
r3061bc1 ra35b458 170 170 const pte_level0_t *p = &pt[i].l0; 171 171 const unsigned np = (p->descriptor_type == PTE_DESCRIPTOR_NOT_PRESENT); 172 172 173 173 return (np << PAGE_PRESENT_SHIFT) | (1 << PAGE_USER_SHIFT) | 174 174 (1 << PAGE_READ_SHIFT) | (1 << PAGE_WRITE_SHIFT) | … … 185 185 { 186 186 const pte_level1_t *p = &pt[i].l1; 187 187 188 188 const unsigned dt = p->descriptor_type; 189 189 const unsigned ap0 = p->access_permission_0; 190 190 const unsigned ap1 = p->access_permission_1; 191 191 192 192 return ((dt == PTE_DESCRIPTOR_NOT_PRESENT) << PAGE_PRESENT_SHIFT) | 193 193 ((dt != PTE_DESCRIPTOR_SMALL_PAGE_NX) << PAGE_EXEC_SHIFT) | … … 211 211 { 212 212 pte_level0_t *p = &pt[i].l0; 213 213 214 214 if (flags & PAGE_NOT_PRESENT) { 215 215 p->descriptor_type = PTE_DESCRIPTOR_NOT_PRESENT; … … 245 245 { 246 246 pte_level1_t *p = &pt[i].l1; 247 247 248 248 if (flags & PAGE_NOT_PRESENT) { 249 249 p->descriptor_type = PTE_DESCRIPTOR_NOT_PRESENT; … … 278 278 p->bufferable = 1; 279 279 } 280 280 281 281 /* Shareable is ignored for devices (non-cacheable), 282 282 * turn it off for normal memory. */ 283 283 p->shareable = 0; 284 284 285 285 p->non_global = !(flags & PAGE_GLOBAL); 286 286 287 287 /* default access permission: kernel only*/ 288 288 p->access_permission_0 = PTE_AP0_USER_NO_KERNEL_FULL; 289 289 290 290 if (flags & PAGE_USER) { 291 291 p->access_permission_0 = PTE_AP0_USER_FULL_KERNEL_FULL;
Note:
See TracChangeset
for help on using the changeset viewer.
