Changeset 9f945464 in mainline for kernel/generic/src/mm/frame.c


Ignore:
Timestamp:
2025-04-09T16:36:30Z (6 days ago)
Author:
GitHub <noreply@…>
Children:
3acb63b5
Parents:
2c94501 (diff), 597fa24 (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.
git-author:
Wayne Thornton <wmthornton-dev@…> (2025-04-09 16:36:30)
git-committer:
GitHub <noreply@…> (2025-04-09 16:36:30)
Message:

Merge pull request #3 from HelenOS/master

Enable static initialization of kernel synchronization primitives

File:
1 edited

Legend:

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

    r2c94501 r9f945464  
    6363#include <proc/thread.h> /* THREAD */
    6464
    65 zones_t zones;
     65zones_t zones = {
     66        .count = 0,
     67        .lock = IRQ_SPINLOCK_INITIALIZER("frame.zones.lock"),
     68};
    6669
    6770/*
     
    6972 * available.
    7073 */
    71 static mutex_t mem_avail_mtx;
    72 static condvar_t mem_avail_cv;
     74static MUTEX_INITIALIZE(mem_avail_mtx, MUTEX_ACTIVE);
     75static CONDVAR_INITIALIZE(mem_avail_cv);
    7376static size_t mem_avail_req = 0;  /**< Number of frames requested. */
    7477static size_t mem_avail_gen = 0;  /**< Generation counter. */
     
    11081111void frame_init(void)
    11091112{
    1110         if (config.cpu_active == 1) {
    1111                 zones.count = 0;
    1112                 irq_spinlock_initialize(&zones.lock, "frame.zones.lock");
    1113                 mutex_initialize(&mem_avail_mtx, MUTEX_ACTIVE);
    1114                 condvar_initialize(&mem_avail_cv);
    1115         }
    1116 
    11171113        /* Tell the architecture to create some memory */
    11181114        frame_low_arch_init();
Note: See TracChangeset for help on using the changeset viewer.