Changeset 97c7682 in mainline for kernel/genarch/src


Ignore:
Timestamp:
2012-07-14T11:18:40Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
804d9b6
Parents:
0747468 (diff), f0348c8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Text conflict in boot/arch/arm32/Makefile.inc:

Trivial conflict around ifeq condition.

Text conflict in kernel/arch/arm32/include/mm/page.h:

Added defines and set_pt_levelx_present function.
COnflict looked horrible because of the armv4/v7 split.

Location:
kernel/genarch/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/fb/fb.c

    r0747468 r97c7682  
    390390                            instance->position / instance->cols, false);
    391391                        instance->position++;
    392                 } while ((instance->position % 8)
    393                     && (instance->position < instance->cols * instance->rows));
     392                } while (((instance->position % instance->cols) % 8 != 0) &&
     393                    (instance->position < instance->cols * instance->rows));
    394394                break;
    395395        default:
  • kernel/genarch/src/kbrd/kbrd.c

    r0747468 r97c7682  
    158158            = malloc(sizeof(kbrd_instance_t), FRAME_ATOMIC);
    159159        if (instance) {
    160                 instance->thread
    161                         = thread_create(kkbrd, (void *) instance, TASK, 0, "kkbrd", false);
     160                instance->thread = thread_create(kkbrd, (void *) instance,
     161                    TASK, THREAD_FLAG_NONE, "kkbrd");
    162162               
    163163                if (!instance->thread) {
  • kernel/genarch/src/mm/as_ht.c

    r0747468 r97c7682  
    7878                hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations);
    7979                mutex_initialize(&page_ht_lock, MUTEX_PASSIVE);
    80                 pte_cache = slab_cache_create("pte_cache", sizeof(pte_t), 0, NULL, NULL,
    81                     SLAB_CACHE_MAGDEFERRED);
     80                pte_cache = slab_cache_create("pte_t", sizeof(pte_t), 0,
     81                    NULL, NULL, SLAB_CACHE_MAGDEFERRED);
    8282        }
    8383       
  • kernel/genarch/src/mm/page_ht.c

    r0747468 r97c7682  
    4545#include <typedefs.h>
    4646#include <arch/asm.h>
     47#include <arch/barrier.h>
    4748#include <synch/spinlock.h>
    4849#include <arch.h>
     
    207208                pte->page = ALIGN_DOWN(page, PAGE_SIZE);
    208209                pte->frame = ALIGN_DOWN(frame, FRAME_SIZE);
     210
     211                write_barrier();
    209212               
    210213                hash_table_insert(&page_ht, key, &pte->link);
  • kernel/genarch/src/mm/page_pt.c

    r0747468 r97c7682  
    4343#include <arch/mm/page.h>
    4444#include <arch/mm/as.h>
     45#include <arch/barrier.h>
    4546#include <typedefs.h>
    4647#include <arch/asm.h>
     
    4849#include <align.h>
    4950#include <macros.h>
     51#include <bitops.h>
    5052
    5153static void pt_mapping_insert(as_t *, uintptr_t, uintptr_t, unsigned int);
     
    8587                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
    8688                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page),
    87                     PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     89                    PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
    8890                    PAGE_WRITE);
     91                write_barrier();
     92                SET_PTL1_PRESENT(ptl0, PTL0_INDEX(page));
    8993        }
    9094       
     
    97101                SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
    98102                SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page),
    99                     PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     103                    PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
    100104                    PAGE_WRITE);
     105                write_barrier();
     106                SET_PTL2_PRESENT(ptl1, PTL1_INDEX(page));       
    101107        }
    102108       
     
    109115                SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
    110116                SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page),
    111                     PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     117                    PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
    112118                    PAGE_WRITE);
     119                write_barrier();
     120                SET_PTL3_PRESENT(ptl2, PTL2_INDEX(page));
    113121        }
    114122       
     
    116124       
    117125        SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
    118         SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags);
     126        SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags | PAGE_NOT_PRESENT);
     127        write_barrier();
     128        SET_FRAME_PRESENT(ptl3, PTL3_INDEX(page));
    119129}
    120130
     
    278288        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
    279289                return NULL;
     290
     291        read_barrier();
    280292       
    281293        pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
    282294        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
    283295                return NULL;
     296
     297#if (PTL1_ENTRIES != 0)
     298        read_barrier();
     299#endif
    284300       
    285301        pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
    286302        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
    287303                return NULL;
     304
     305#if (PTL2_ENTRIES != 0)
     306        read_barrier();
     307#endif
    288308       
    289309        pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
    290310       
    291311        return &ptl3[PTL3_INDEX(page)];
     312}
     313
     314/** Return the size of the region mapped by a single PTL0 entry.
     315 *
     316 * @return Size of the region mapped by a single PTL0 entry.
     317 */
     318static uintptr_t ptl0_step_get(void)
     319{
     320        size_t va_bits;
     321
     322        va_bits = fnzb(PTL0_ENTRIES) + fnzb(PTL1_ENTRIES) + fnzb(PTL2_ENTRIES) +
     323            fnzb(PTL3_ENTRIES) + PAGE_WIDTH;
     324
     325        return 1UL << (va_bits - fnzb(PTL0_ENTRIES));
    292326}
    293327
     
    309343{
    310344        uintptr_t ptl0 = PA2KA((uintptr_t) AS_KERNEL->genarch.page_table);
    311         uintptr_t ptl0step = (((uintptr_t) -1) / PTL0_ENTRIES) + 1;
     345        uintptr_t ptl0_step = ptl0_step_get();
    312346        size_t order;
    313347        uintptr_t addr;
     
    321355#endif
    322356
    323         ASSERT(ispwr2(ptl0step));
    324357        ASSERT(size > 0);
    325358
    326         for (addr = ALIGN_DOWN(base, ptl0step); addr - 1 < base + size - 1;
    327             addr += ptl0step) {
     359        for (addr = ALIGN_DOWN(base, ptl0_step); addr - 1 < base + size - 1;
     360            addr += ptl0_step) {
    328361                uintptr_t l1;
    329362
     
    332365                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(addr), KA2PA(l1));
    333366                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(addr),
    334                     PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
    335                     PAGE_WRITE);
     367                    PAGE_PRESENT | PAGE_USER | PAGE_CACHEABLE |
     368                    PAGE_EXEC | PAGE_WRITE | PAGE_READ);
    336369        }
    337370}
  • kernel/genarch/src/srln/srln.c

    r0747468 r97c7682  
    130130            = malloc(sizeof(srln_instance_t), FRAME_ATOMIC);
    131131        if (instance) {
    132                 instance->thread
    133                         = thread_create(ksrln, (void *) instance, TASK, 0, "ksrln", false);
     132                instance->thread = thread_create(ksrln, (void *) instance,
     133                    TASK, THREAD_FLAG_NONE, "ksrln");
    134134               
    135135                if (!instance->thread) {
Note: See TracChangeset for help on using the changeset viewer.