Changeset b3f967c in mainline


Ignore:
Timestamp:
2013-08-06T23:06:38Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb75646
Parents:
e40b8066
Message:

arm32: Move more functions to common header

Location:
kernel/arch/arm32/include/arch/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/arch/mm/page.h

    re40b8066 rb3f967c  
    4141#include <arch/exception.h>
    4242#include <arch/barrier.h>
     43#include <arch/cp15.h>
    4344#include <trace.h>
    4445
     
    129130        set_pt_level1_present((pte_t *) (ptl3), (size_t) (i))
    130131
     132
     133#define pt_coherence(page) pt_coherence_m(page, 1)
     134
    131135#if defined(PROCESSOR_ARCH_armv6) | defined(PROCESSOR_ARCH_armv7_a)
    132136#include "page_armv6.h"
     
    137141#endif
    138142
     143/** Sets the address of level 0 page table.
     144 *
     145 * @param pt Pointer to the page table to set.
     146 *
     147 */
     148NO_TRACE static inline void set_ptl0_addr(pte_t *pt)
     149{
     150        TTBR0_write((uint32_t)pt);
     151}
     152
     153NO_TRACE static inline void set_ptl1_addr(pte_t *pt, size_t i, uintptr_t address)
     154{
     155        pt[i].l0.coarse_table_addr = address >> 10;
     156        pt_coherence(&pt[i].l0);
     157}
     158
     159NO_TRACE static inline void set_ptl3_addr(pte_t *pt, size_t i, uintptr_t address)
     160{
     161        pt[i].l1.frame_base_addr = address >> 12;
     162        pt_coherence(&pt[i].l1);
     163}
     164
    139165#endif
    140166
  • kernel/arch/arm32/include/arch/mm/page_armv4.h

    re40b8066 rb3f967c  
    4141#error "Do not include arch specific page.h directly use generic page.h instead"
    4242#endif
    43 
    44 #include <arch/cp15.h>
    4543
    4644/* Macros for querying the last-level PTE entries. */
     
    122120#define PTE_DESCRIPTOR_SMALL_PAGE       2
    123121
    124 
    125 /** Sets the address of level 0 page table.
    126  *
    127  * @param pt Pointer to the page table to set.
    128  *
    129  */
    130 NO_TRACE static inline void set_ptl0_addr(pte_t *pt)
    131 {
    132         TTBR0_write((uint32_t)pt);
    133 }
    134 
    135 NO_TRACE static inline void set_ptl1_addr(pte_t *pt, size_t i, uintptr_t address)
    136 {
    137         pt[i].l0.coarse_table_addr = address >> 10;
    138 }
    139 
    140 NO_TRACE static inline void set_ptl3_addr(pte_t *pt, size_t i, uintptr_t address)
    141 {
    142         pt[i].l1.frame_base_addr = address >> 12;
    143 }
    144 
     122#define pt_coherence_m(page, count)
    145123
    146124/** Returns level 0 page table entry flags.
  • kernel/arch/arm32/include/arch/mm/page_armv6.h

    re40b8066 rb3f967c  
    4141#endif
    4242
    43 #include <arch/cp15.h>
    4443
    4544/* Macros for querying the last-level PTE entries. */
     
    135134        read_barrier(); \
    136135} while (0)
    137 #define pt_coherence(page) pt_coherence_m(page, 1)
    138 
    139 /** Sets the address of level 0 page table.
    140  *
    141  * @param pt Pointer to the page table to set.
    142  *
    143  */
    144 NO_TRACE static inline void set_ptl0_addr(pte_t *pt)
    145 {
    146         TTBR0_write((uint32_t)pt);
    147 }
    148 
    149 NO_TRACE static inline void set_ptl1_addr(pte_t *pt, size_t i, uintptr_t address)
    150 {
    151         pt[i].l0.coarse_table_addr = address >> 10;
    152         pt_coherence(&pt[i]);
    153 }
    154 
    155 NO_TRACE static inline void set_ptl3_addr(pte_t *pt, size_t i, uintptr_t address)
    156 {
    157         pt[i].l1.frame_base_addr = address >> 12;
    158         pt_coherence(&pt[i]);
    159 }
    160136
    161137
Note: See TracChangeset for help on using the changeset viewer.