Changeset dc747e3 in mainline for generic/src/mm


Ignore:
Timestamp:
2005-12-15T10:27:59Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7dd2561
Parents:
3fc03fd
Message:

Add SPINLOCK_DECLARE and SPINLOCK_INITIALIZE macros.
SPINLOCK_DECLARE is to be used instead of direct spinlock_t declarations
in dynamically allocated structures on which spinlock_initialize() is called after
their creation.
SPINLOCK_INITIALIZE is to be used instead of direct spinlock_t declarations
of global spinlocks. It declares and initializes the spinlock.
Moreover, both macros are empty on UP so that -Wall warnings about unused structures
get supressed.

Location:
generic/src/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/frame.c

    r3fc03fd rdc747e3  
    4242#include <align.h>
    4343
    44 spinlock_t zone_head_lock;       /**< this lock protects zone_head list */
    45 link_t zone_head;                /**< list of all zones in the system */
     44SPINLOCK_INITIALIZE(zone_head_lock);    /**< this lock protects zone_head list */
     45link_t zone_head;                       /**< list of all zones in the system */
    4646
    4747/** Blacklist containing non-available areas of memory.
     
    243243void zone_init(void)
    244244{
    245         spinlock_initialize(&zone_head_lock, "zone_head_lock");
    246245        list_initialize(&zone_head);
    247246}
  • generic/src/mm/heap.c

    r3fc03fd rdc747e3  
    4444
    4545static chunk_t *chunk0;
    46 static spinlock_t heaplock;
     46SPINLOCK_INITIALIZE(heaplock);
    4747
    4848void early_heap_init(__address heap, size_t size)
    4949{
    50         spinlock_initialize(&heaplock, "heap_lock");
    5150        memsetb(heap, size, 0);
    5251        chunk0 = (chunk_t *) heap;
  • generic/src/mm/tlb.c

    r3fc03fd rdc747e3  
    3838#include <panic.h>
    3939
    40 #ifdef CONFIG_SMP
    41 static spinlock_t tlblock;
    42 #endif
     40SPINLOCK_INITIALIZE(tlblock);
    4341
    4442void tlb_init(void)
    4543{
    46         if (config.cpu_active == 1)
    47                 spinlock_initialize(&tlblock, "tlb_lock");
    48 
    4944        tlb_arch_init();
    5045}
Note: See TracChangeset for help on using the changeset viewer.