Changeset da1bafb in mainline for kernel/genarch/src/mm/as_ht.c


Ignore:
Timestamp:
2010-05-24T18:57:31Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/as_ht.c

    r666f492 rda1bafb  
    3030 * @{
    3131 */
    32  
     32
    3333/**
    3434 * @file
    35  * @brief       Address space functions for global page hash table.
     35 * @brief Address space functions for global page hash table.
    3636 */
    3737
     
    4646#include <synch/mutex.h>
    4747
    48 static pte_t *ht_create(int flags);
    49 static void ht_destroy(pte_t *page_table);
     48static pte_t *ht_create(unsigned int);
     49static void ht_destroy(pte_t *);
    5050
    51 static void ht_lock(as_t *as, bool lock);
    52 static void ht_unlock(as_t *as, bool unlock);
     51static void ht_lock(as_t *, bool);
     52static void ht_unlock(as_t *, bool);
    5353
    5454as_operations_t as_ht_operations = {
     
    6868 *
    6969 * @return Returns NULL.
     70 *
    7071 */
    71 pte_t *ht_create(int flags)
     72pte_t *ht_create(unsigned int flags)
    7273{
    7374        if (flags & FLAG_AS_KERNEL) {
     
    7576                mutex_initialize(&page_ht_lock, MUTEX_PASSIVE);
    7677        }
     78       
    7779        return NULL;
    7880}
     
    8385 *
    8486 * @param page_table This parameter is ignored.
     87 *
    8588 */
    8689void ht_destroy(pte_t *page_table)
     
    9497 * Interrupts must be disabled.
    9598 *
    96  * @param as Address space.
     99 * @param as   Address space.
    97100 * @param lock If false, do not attempt to lock the address space.
     101 *
    98102 */
    99103void ht_lock(as_t *as, bool lock)
     
    101105        if (lock)
    102106                mutex_lock(&as->lock);
     107       
    103108        mutex_lock(&page_ht_lock);
    104109}
     
    109114 * Interrupts must be disabled.
    110115 *
    111  * @param as Address space.
     116 * @param as     Address space.
    112117 * @param unlock If false, do not attempt to lock the address space.
     118 *
    113119 */
    114120void ht_unlock(as_t *as, bool unlock)
    115121{
    116122        mutex_unlock(&page_ht_lock);
     123       
    117124        if (unlock)
    118125                mutex_unlock(&as->lock);
Note: See TracChangeset for help on using the changeset viewer.