Changeset d5bd8d7 in mainline for kernel/generic/src/mm/backend_anon.c


Ignore:
Timestamp:
2007-03-25T13:02:06Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4638401
Parents:
0f6a3376
Message:

Fix coding style in the address space area backends.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/backend_anon.c

    r0f6a3376 rd5bd8d7  
    7373 * @param access Access mode that caused the fault (i.e. read/write/exec).
    7474 *
    75  * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e. serviced).
     75 * @return AS_PF_FAULT on failure (i.e. page fault) or AS_PF_OK on success (i.e.
     76 *     serviced).
    7677 */
    7778int anon_page_fault(as_area_t *area, uintptr_t addr, pf_access_t access)
     
    8788                /*
    8889                 * The area is shared, chances are that the mapping can be found
    89                  * in the pagemap of the address space area share info structure.
     90                 * in the pagemap of the address space area share info
     91                 * structure.
    9092                 * In the case that the pagemap does not contain the respective
    9193                 * mapping, a new frame is allocated and the mapping is created.
     
    103105                         */
    104106                        for (i = 0; i < leaf->keys; i++) {
    105                                 if (leaf->key[i] == ALIGN_DOWN(addr, PAGE_SIZE)) {
     107                                if (leaf->key[i] ==
     108                                    ALIGN_DOWN(addr, PAGE_SIZE)) {
    106109                                        allocate = false;
    107110                                        break;
     
    113116                               
    114117                                /*
    115                                  * Insert the address of the newly allocated frame to the pagemap.
     118                                 * Insert the address of the newly allocated
     119                                 * frame to the pagemap.
    116120                                 */
    117                                 btree_insert(&area->sh_info->pagemap, ALIGN_DOWN(addr, PAGE_SIZE) - area->base, (void *) frame, leaf);
     121                                btree_insert(&area->sh_info->pagemap,
     122                                    ALIGN_DOWN(addr, PAGE_SIZE) - area->base,
     123                                    (void *) frame, leaf);
    118124                        }
    119125                }
     
    142148        /*
    143149         * Map 'page' to 'frame'.
    144          * Note that TLB shootdown is not attempted as only new information is being
    145          * inserted into page tables.
     150         * Note that TLB shootdown is not attempted as only new information is
     151         * being inserted into page tables.
    146152         */
    147153        page_mapping_insert(AS, addr, frame, as_area_get_flags(area));
     
    185191         */
    186192        mutex_lock(&area->sh_info->lock);
    187         for (cur = area->used_space.leaf_head.next; cur != &area->used_space.leaf_head; cur = cur->next) {
     193        for (cur = area->used_space.leaf_head.next;
     194            cur != &area->used_space.leaf_head; cur = cur->next) {
    188195                btree_node_t *node;
    189196                int i;
     
    199206                       
    200207                                page_table_lock(area->as, false);
    201                                 pte = page_mapping_find(area->as, base + j*PAGE_SIZE);
    202                                 ASSERT(pte && PTE_VALID(pte) && PTE_PRESENT(pte));
    203                                 btree_insert(&area->sh_info->pagemap, (base + j*PAGE_SIZE) - area->base,
    204                                         (void *) PTE_GET_FRAME(pte), NULL);
     208                                pte = page_mapping_find(area->as,
     209                                    base + j * PAGE_SIZE);
     210                                ASSERT(pte && PTE_VALID(pte) &&
     211                                    PTE_PRESENT(pte));
     212                                btree_insert(&area->sh_info->pagemap,
     213                                    (base + j * PAGE_SIZE) - area->base,
     214                                    (void *) PTE_GET_FRAME(pte), NULL);
    205215                                page_table_unlock(area->as, false);
    206                                 frame_reference_add(ADDR2PFN(PTE_GET_FRAME(pte)));
     216
     217                                pfn_t pfn = ADDR2PFN(PTE_GET_FRAME(pte));
     218                                frame_reference_add(pfn);
    207219                        }
    208220                               
     
    214226/** @}
    215227 */
     228
Note: See TracChangeset for help on using the changeset viewer.