Changeset 567 for trunk/kernel/mm/khm.h


Ignore:
Timestamp:
Oct 5, 2018, 12:01:52 AM (6 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/khm.h

    r457 r567  
    11/*
    2  * khm.h - kernel heap manager used for variable size memory allocation.
     2 * khm.h - Kernel Heap Manager definition.
    33 *
    44 * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    5  *          Mohamed Lamine Karaoui (2015)
    6  *          Alain Greiner (2016)
     5 *          Alain Greiner (2016,2017,2018)
    76 *
    87 * Copyright (c) UPMC Sorbonne Universites
     
    2928#include <kernel_config.h>
    3029#include <hal_kernel_types.h>
    31 #include <spinlock.h>
     30#include <busylock.h>
    3231
    3332/*******************************************************************************************
    3433 * This structure defines a Kernel Heap Manager (KHM) in a given cluster.
    35  * It is used to allocate memory objects, that are not
    36  * enough replicated to justify a dedicated KCM allocator.
     34 * It is used to allocate memory objects, that are not enough replicated to justify
     35 * a dedicated KCM allocator.
    3736 ******************************************************************************************/
    3837
    3938typedef struct khm_s
    4039{
    41         spinlock_t lock;           /*! lock protecting exclusive access to heap               */
     40        busylock_t lock;           /*! lock protecting KHM allocator                          */
    4241        intptr_t   base;           /*! heap base address                                      */
    4342        uint32_t   size;           /*! heap size (bytes)                                      */
     
    5453typedef struct khm_block_s
    5554{
    56         uint32_t   busy:1;         /*! free block if zero                                     */
    57         uint32_t   size:31;        /*! size coded on 31 bits                                  */
     55        uint32_t   busy         /*! free block if zero                                     */
     56        uint32_t   size;           /*! block size                                                   */
    5857}
    5958khm_block_t;
Note: See TracChangeset for help on using the changeset viewer.