// Module POOL_ZONES.H "X-5" // // Copyright © Digital Equipment Corporation, 1996 All Rights Reserved. // Unpublished rights reserved under the copyright laws of the United States. // // The software contained on this media is proprietary to and embodies the // confidential technology of Digital Equipment Corporation. Possession, use, // duplication or dissemination of the software and media is authorized only // pursuant to a valid written license from Digital Equipment Corporation. // // RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. // Government is subject to restrictions as set forth in Subparagraph // (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. // //++ // // FACILITY: // // OpenVMS Executive (LIB_H) // // ABSTRACT: // // This module contains the C function prototypes and structure // definitions for the 64-bit poolzone routines. // // AUTHOR: // // Christian Moser, June 1997 // // MODIFIED BY: // // X-5 MLH Mark L. Hopkins 3-AUG-2006 // In the _poolzone structure, change the use of the // quadword field, not1stpage, to be the list head // of a singly linked list of empty poolzone_page. // This allows poolzone purges to be faster. // // X-4 MAS0695 Mark A. Stiles 2-Jun-2001 // Pad out the poolzone_page header to 128 bytes, so that // structures within start on cache line boundaries // (currently 64b). // // X-3 CMOS Christian Moser 20-NOV-1997 // Fix declaration of exe$pool_deallocate to use VOID_PQ // instead of VOID_PPQ, since we pass a pointer to the // packet. To generate better code, use quadword alignment // by default. // // X-2 CMOS Christian Moser 22-SEP-1997 // Define cell for empty_page counter, use a fill cell, in // order to change the size. // // X-1 CMOS Christian Moser 17-JUN-1997 // Initial version. // #ifndef __POOL_ZONES_LOADED #define __POOL_ZONES_LOADED 1 #pragma __nostandard // This file uses non-ANSI-Standard features #pragma __member_alignment __save #pragma __nomember_alignment __quadword #ifdef __INITIAL_POINTER_SIZE // Defined whenever ptr size pragmas supported #pragma __required_pointer_size __save // Save the previously-defined required ptr size #pragma __required_pointer_size __long // And set ptr size default to 64-bit pointers #endif // // Common header files // #include far_pointers #include ints /////////////////////////////////////////////////////////////////////////////// // // NOTE: PALcode quadword queue instructions (like REMQUEQ or INSQUEQ) // require octaword alignment, hence it is important to align the // queue links on such boundary! // /////////////////////////////////////////////////////////////////////////////// // // Structure definition for the poolzone page header // typedef struct _poolzone_page { struct _poolzone_page *zonepage_flink; struct _poolzone_page *zonepage_blink; VOID_PQ freequeue_flink; VOID_PQ freequeue_blink; struct _poolzone *zone; uint64 packet_size; uint64 packet_count; uint64 free_count; uint64 hits; uint64 relinks; uint64 reserved1; uint64 reserved2; uint64 reserved3; uint64 reserved4; uint64 reserved5; uint64 reserved6; uint64 first_packet; } POOLZONE_PAGE; // // Structure definition for the poolzone header // typedef struct _poolzone { struct _poolzone_page *zonepage_flink; struct _poolzone_page *zonepage_blink; uint64 packet_size; uint64 pages; uint64 max_pages; uint64 free_count; uint64 hits; uint64 misses; uint64 expansions; uint64 failures; #pragma message save #pragma message disable(UNSTRUCTMEM) union { uint64 not1stpage; struct _poolzone_page *empty_list; }; #pragma message restore uint64 empty_pages; } POOLZONE; // // Structure definition for the poolzone region header // typedef struct _poolzone_region { uint64 fill_1; unsigned short int size; unsigned char type; unsigned char subtype; uint32 fill_2; int (*zonepage_alloc_rtn)(); int (*zonepage_dealloc_rtn)(); uint64 zone_count; uint64 fill_3; uint64 reserved_1; uint64 reserved_2; uint64 reserved_3; uint64 reserved_4; struct _poolzone zone[1]; } POOLZONE_REGION; // // Poolzone routine prototype declarations // int exe$poolzone_create ( POOLZONE_REGION *zone_region, int granularity, int init_pages, int max_pages ); int exe$poolzone_expand ( POOLZONE_REGION *zone_region, POOLZONE *zone ); int exe$poolzone_purge ( POOLZONE_REGION *zone_region, POOLZONE *zone, int num_pages ); int exe$poolzone_allocate ( POOLZONE_REGION *zone_region, POOLZONE *zone, VOID_PPQ return_address ); int exe$poolzone_deallocate ( POOLZONE *zone, VOID_PQ packet ); int exe$pool_allocate ( POOLZONE_REGION *zone_region, int size, VOID_PPQ return_address ); int exe$pool_deallocate ( VOID_PQ packet ); #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE // Defined whenever ptr size pragmas supported #pragma __required_pointer_size __restore // Restore the previously-defined required ptr size #endif #pragma __standard #endif // __POOL_ZONES_LOADED