📄 vm_defs.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 Variable 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 "VM_SUSPENSION_STRUCT" defines the information necessary
to suspend a task for memory. This structure is allocated off of calling
application's stack. */
struct VM_SUSPENSION_STRUCT
{
unsigned int vm_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 VM_SUSPENSION_STRUCT
*vm_next_susp, /* Next suspension ptr */
*vm_prev_susp; /* Previous suspension ptr */
signed int vm_task_id; /* Task suspended */
unsigned long vm_request; /* Memory requested */
unsigned int **vm_return_addr;/* Address to return value */
};
/* The structure "VM_BLOCK_HEADER_STRUCT" defines the information necessary
for management of a system variable length memory block. */
struct VM_BLOCK_HEADER_STRUCT
{
unsigned int vm_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 VM_BLOCK_HEADER_STRUCT
*vm_next_block, /* Next block ptr */
*vm_prev_block; /* Previous block ptr */
signed int vm_task_id; /* Task that allocated it */
signed int vm_in_use; /* Memory block is in use */
unsigned long vm_block_size; /* Size of available memory,
in terms of unsigned words */
unsigned int vm_pattern_2; /* Test pattern on bottom */
};
/* The structure "VM_BLOCK_TRAILER_STRUCT" defines the trailer block necessary
for joining free blocks together again and reducing fragmentation. */
struct VM_BLOCK_TRAILER_STRUCT
{
unsigned int vm_pattern_1; /* Test pattern at the top */
struct VM_BLOCK_HEADER_STRUCT
*vm_header_ptr; /* Block's header pointer */
unsigned int vm_pattern_2; /* Test pattern on bottom */
};
/* The structure "VM_LIST_STRUCT" defines the information necessary
for management of a linked list. */
struct VM_LIST_STRUCT
{
unsigned int vm_not_used; /* Not used for anything */
struct VM_LIST_STRUCT *vm_next_ptr, /* Next ptr */
*vm_prev_ptr; /* Previous ptr */
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -