/* * * Copyright © Digital Equipment Corporation, 1993 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: * * VMS Executive (LIB_H) * * ABSTRACT: * * This module contains the C function prototypes for the VMS system * routines that begin with the LDR$ and LDR_STD$ prefixes and have * a standard call interface. * * NOTE: * * The conventions used in these function prototypes are: * * 1. Case * This header file supports invoking the routines by either using all * lowercase or all uppercase names for the system routines. Either * naming convention works even in the presence of the /NAME=AS_IS * compiler switch. * * 2. Integer size * The generic "int" type is used where it doesn't matter whether the * integer is 32 or 64 bits wide. Thus "int" is the returned value of * most functions and is the type for most integers passed by value. * However, an unambiguous integer type, e.g. int32, is used for any * integer that is passed by reference. Also, int64 is used for any * integer that is expected to be 64 bits wide even if it is passed by * value. * * 3. Types * The function prototypes use the types defined in [SYSLIB]SYS$LIB_C.TLB. * The definitions of all types used are included below. * * 4. Parameter names * Parameter names are used in the prototypes. Although they are ignored * by the compiler they do provide useful documentation. For example: * * void ioc_std$reqcom (int iost1, int iost2, UCB *ucb); * * is used instead of the functionally equivalent: * * void ioc_std$reqcom (int, int, UCB *); * * 5. Parameters passed by reference * The parameter name includes the "_p" suffix if the parameter is passed * by reference unless the parameter type implies that it is always passed * by reference. For example, there is no "_p" suffix in: * * UCB *ucb; * int32 iosb[2]; * * since structures and arrays are always passed by reference. However: * * int32 *outlen_p; * UCB **new_ucb_p; * * include the suffix to denote that outlen_p is a pointer to a 32 bit * integer, and to denote that new_ucb_p is a pointer to a pointer to a * UCB structure. * * 6. Mixed pointer sizes within one argument * If a 64-bit pointer is being passed by reference, the reference to * the pointer should also be 64 bits wide to avoid confusion. * For example: * * PTE_PPQ va_pte_p; * VOID_PPQ start_va_p; * * should be used instead of: * * PTE_PQ *va_pte_p; * VOID_PQ *start_va_p; * * * AUTHOR: * * Leonard S. Szubowicz * * CREATION DATE: 8-Jun-1993 * * MODIFICATION HISTORY: * * X-8 SAD Stuart A. Davidson 21-Oct-2003 * Allow optional extra arg to LDR$ALLOC_SLICE, for alignment. * * X-7 SAD Stuart A. Davidson 16-MAY-2002 * Add routines needed in converting the exec loader to C. * * X-6 KLN2082 Karen L. Noel 04-Jun-1998 * Surround this file with short pointer pragmas in case someone * wants to compile with long pointers from the command line. * * X-5 DFW0291 David F. Wall 29-Jan-1997 * Add ldr_std$alloc_s2_va_aligned. * * X-4 NYK301 Nitin Y. Karkhanis 6-Mar-1995 * Add ldr_std$count_s2_pages. * * X-3 NYK259 Nitin Y. Karkhanis 7-Feb-1995 * Correct formal argument types for system space memory * allocation routines as per the new rule #6 (see above). * * X-2 NYK098 Nitin Y. Karkhanis 2-Nov-1994 * Define function protoypes for LDR_STD$ALLOC_S0S1_VA, * LDR_STD$DEALLOC_S0S1_VA, LDR_STD$ALLOC_S2_VA, and * LDR_STD$ALLOC_S2_VA. * * X-1 LSS0279 Leonard S. Szubowicz 8-Jun-1993 * Initial version containing only those routines commonly used * by device drivers. * *-- */ #ifndef __LDR_ROUTINES_LOADED #define __LDR_ROUTINES_LOADED 1 #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 __short /* And set ptr size default to 32-bit pointers */ #endif /* * Define all types that are used in the following function prototypes. */ #include #include #include /* VMS system routine entry points are defined externally using uppercase names. The following macros allow the usage of the lowercase versions of these names even in the presence of the /NAME=AS_IS compiler switch. */ #define ldr_std$alloc_pt LDR_STD$ALLOC_PT #define ldr_std$dealloc_pt LDR_STD$DEALLOC_PT #define ldr_std$alloc_s0s1_va LDR_STD$ALLOC_S0S1_VA #define ldr_std$dealloc_s0s1_va LDR_STD$DEALLOC_S0S1_VA #define ldr_std$alloc_s2_va LDR_STD$ALLOC_S2_VA #define ldr_std$dealloc_s2_va LDR_STD$DEALLOC_S2_VA #define ldr_std$count_s2_pages LDR_STD$COUNT_S2_PAGES #define ldr_std$alloc_s2_va_aligned LDR_STD$ALLOC_S2_VA_ALIGNED #define ldr$alloc_slice LDR$ALLOC_SLICE #define ldr$dealloc_slice LDR$DEALLOC_SLICE /* Function prototypes for system routines with the LDR$ and LDR_STD$ prefix. */ int ldr_std$alloc_pt (int npte, void **svapte_p); int ldr_std$dealloc_pt (void *svapte, int npte); int ldr_std$alloc_s0s1_va (const int req_pages, VOID_PPQ sva_p, PTE_PPQ va_pte_p); int ldr_std$dealloc_s0s1_va (const int page_count, const VOID_PQ sva); int ldr_std$alloc_s2_va (const int req_pages, VOID_PPQ sva_p, PTE_PPQ va_pte_p); int ldr_std$dealloc_s2_va (const int page_count, const VOID_PQ sva); int ldr_std$count_s2_pages (void); int ldr_std$alloc_s2_va_aligned (const int req_pages, VOID_PPQ sva); int ldr$alloc_slice (const uint64 page_type, const uint64 alloc_size, const uint64 return_length, const uint64 offset, void *ret_va_ref, ...); int ldr$dealloc_slice ( const uint64 PAGE_TYPE, uint64 dealloc_size_in_bytes, VOID_PQ VA); #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #endif /* __LDR_ROUTINES_LOADED */