⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fm_defs.h

📁 NecluesRTX RTOS的源码
💻 H
字号:
/************************************************************************/
/*                                                                      */
/*              Copyright 1990 by Accelerated Technology                */
/*                                                                      */
/*  PROPRIETARY RIGHTS of Accelerated Technology are involved in the    */
/*  subject matter of this material.  All manufacturing, reproduction,  */
/*  use, and sales rights pertaining to this subject matter are         */
/*  governed by the license agreement.  The buyer or recipient of this  */
/*  package, implicitly accepts the terms of the license.               */
/*                                                                      */
/************************************************************************/

/************************************************************************/
/*                                                                      */
/*  FILE DESCRIPTION                                                    */
/*                                                                      */
/*  This file contains the description of the Fixed Length Memory       */
/*  Management structures and associated suspension structures.         */
/*                                                                      */
/*  ROUTINES                                                            */
/*                                                                      */
/*      None                                                            */
/*                                                                      */
/*  NOTES                                                               */
/*                                                                      */
/*      None                                                            */
/*                                                                      */
/************************************************************************/

/* Define the test patterns that are placed on the front and back sides of 
   the memory headers.  Through examination of these fields, nucleus can 
   detect (in most cases) whether or not the header has been corrupted.  */

#define            TOP_PATTERN       0x1234
#define            BOTTOM_PATTERN    0x5678


/* The structure "FM_SUSPENSION_STRUCT" defines the information necessary 
   to suspend a task for a particular partition type.  This structure is 
   allocated off of calling application's stack.  */

struct FM_SUSPENSION_STRUCT 
{
    unsigned int             fm_not_used;   /* Not used                 */
    /* Note that the pointers must be one unsigned after the front of the 
       list in order to be compatible with the linked list management.  */
    struct FM_SUSPENSION_STRUCT
                            *fm_next_susp,  /* Next suspension ptr      */
                            *fm_prev_susp;  /* Previous suspension ptr  */
    signed int               fm_task_id;    /* Task suspended           */
    signed int               fm_partition_id;/* ID of partition          */
    unsigned int           **fm_return_addr;/* Address to return value  */
};


/* The structure "FM_BLOCK_HEADER_STRUCT" defines the information necessary 
   for management of a system partition.  */

struct FM_BLOCK_HEADER_STRUCT 
{
    unsigned int             fm_pattern_1;  /* Test pattern at the top  */
    /* Note that the pointers must be one unsigned after the top of the 
       list in order to be compatible with the linked list management.  */
    struct FM_BLOCK_HEADER_STRUCT
                            *fm_next_block, /* Next block ptr           */
                            *fm_prev_block; /* Previous block ptr       */
    signed int               fm_task_id;    /* Task that allocated it   */
    signed int               fm_in_use;     /* Partition is in use      */
    signed int              fm_partition_id;/* ID of partition          */
    unsigned int             fm_pattern_2;  /* Test pattern on bottom   */
};


/* The structure "FM_LIST_STRUCT" defines the information necessary 
   for management of a linked list.  */

struct FM_LIST_STRUCT 
{
    unsigned int             fm_not_used;   /* Not used for anything    */
    struct FM_LIST_STRUCT   *fm_next_ptr,   /* Next ptr                 */
                            *fm_prev_ptr;   /* Previous ptr             */
};


/* The structure "FM_PARTITION_CONTROL_STRUCT" defines the information 
   necessary to manage allocation/deallocation of a partition.  In the file 
   "FM.C" an array of these structures is allocated relative to the 
   specification in the file "IN_DATA.C."  */

struct FM_BLOCK_CONTROL_STRUCT 
{
    struct FM_BLOCK_HEADER_STRUCT
                        *fm_available_head, /* Available list head      */
                        *fm_available_tail; /* Available list tail      */
    int                  fm_free_partitions;/* Number of free partitions*/
    struct FM_SUSPENSION_STRUCT
                        *fm_alloc_wait_head,/* Partition not available  */
                        *fm_alloc_wait_tail;/* Partition not available  */
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -