/* * MODULE: SCH_ROUTINES.H * * VERSION: X-17 * * 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 SCH$ and SCH_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: 9-Jun-1993 * * MODIFICATION HISTORY: * * X-17 ER Eric Rasmussen 27-Oct-2005 * NMSP$CBB - Changed affinity routine interfaces from * bitmasks to bitmaps (a.k.a. CBBs): * sch$change_affinity() * sch$clear_affinity() * sch$compute_runnable_mask() * sch$set_affinity_bindings() * sch$clear_affinity_bindings() * * Add sch$update_affinity_bindings() * * X-16 JRK398 Jim Kauffman 20-Apr-2004 * Fix pointer target sizes for hard affinity routines * Add 64-bit affinity routines * * X-15 KLN3257 Karen L. Noel 10-Apr-2003 * Declare ASN routines to accept 64-bit pointers. * * X-14 WBF Burns Fisher 23-Oct-2002 * Add sch_std$report_event and sch_std$thread_ravail * * X-13 KLN3043 Karen L. Noel 20-Mar-2002 * Include freddef.h to resolves new references. * * X-12 KLN3040 Karen L. Noel 14-Mar-2002 * Add sch$save_asn and sch$get_asn for IA64. * * X-11 WBF Burns Fisher 21-Aug-2001 * Define first arg of sch$wait_proc as a WQH * rather than * a KTB * to avoid problems of passing the wrong indirection * level from a wait queue. * * X-10 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-9 PKMW386 Paul K. M. Weiss 8-Jan-1998 * Fix sch_std$qast to correctly specify the PCB parameter * as an output pointer to a pointer. * * X-8 JRK387 Jim Kauffman 4-Sep-1997 * Add SCH$ACQUIRE_IMPLICIT_AFFINITY and * SCH$RELEASE_IMPLICIT_AFFINITY * * X-7 NYK638 Nitin Y. Karkhanis 17-Jul-1996 * Add function prototypes for SCH$WAIT_PROC and * SCH$WAIT_KERNEL_MODE. * * X-6 LSS0356 Leonard S. Szubowicz 6-Sep-1995 * Include ints.h to define types used by various prototypes. * Also, fix prototype for SCH_STD$WAKE: PCB pointer returned * by reference. * * X-5 JRK369 Jim Kauffman 24-May-1995 * Fix SCH$CLEAR_CAPABILITY prototype * * X-4 LSS0348 Leonard S. Szubowicz 13-Jun-1995 * 64-bits: Add function prototypes for SCH$RESOURCE_WAIT[_PS] * * X-3 JRK369 Jim Kauffman 23-May-1995 * Add assorted affinity and capability routines * * X-2 KLN1422 Karen L. Noel 27-Mar-1995 * Replace sch_std$clref with sch_std$clrefr. * * X-1 LSS0279 Leonard S. Szubowicz 9-Jun-1993 * Initial version containing only those routines commonly used * by device drivers. * *-- */ #ifndef __SCH_ROUTINES_LOADED #define __SCH_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 #include #include #include #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 sch$add_cpu_cap SCH$ADD_CPU_CAP #define sch$change_affinity SCH$CHANGE_AFFINITY #define sch$change_capability SCH$CHANGE_CAPABILITY #define sch$change_cpu_capability SCH$CHANGE_CPU_CAPABILITY #define sch$clear_affinity SCH$CLEAR_AFFINITY #define sch$clear_affinity_bindings SCH$CLEAR_AFFINITY_BINDINGS #define sch$compute_runnable_mask SCH$COMPUTE_RUNNABLE_MASK #define sch$clear_capability SCH$CLEAR_CAPABILITY #define sch$wait_kernel_mode SCH$WAIT_KERNEL_MODE #define sch$wait_proc SCH$WAIT_PROC #define sch$remove_cpu_cap SCH$REMOVE_CPU_CAP #define sch$resource_wait SCH$RESOURCE_WAIT #define sch$resource_wait_ps SCH$RESOURCE_WAIT_PS #define sch$resource_wait_setup SCH$RESOURCE_WAIT_SETUP #define sch$set_affinity SCH$SET_AFFINITY #define sch$set_affinity_bindings SCH$SET_AFFINITY_BINDINGS #define sch$set_capability SCH$SET_CAPABILITY #define sch$acquire_implicit_affinity SCH$ACQUIRE_IMPLICIT_AFFINITY #define sch$release_implicit_affinity SCH$RELEASE_IMPLICIT_AFFINITY #define sch$update_affinity_bindings SCH$UPDATE_AFFINITY_BINDINGS #define sch_std$clrefr SCH_STD$CLREFR #define sch_std$iolockr SCH_STD$IOLOCKR #define sch_std$iolockw SCH_STD$IOLOCKW #define sch_std$iounlock SCH_STD$IOUNLOCK #define sch_std$lockr SCH_STD$LOCKR #define sch_std$lockr_quad SCH_STD$LOCKR_QUAD #define sch_std$lockrexec SCH_STD$LOCKREXEC #define sch_std$lockrexec_quad SCH_STD$LOCKREXEC_QUAD #define sch_std$lockw SCH_STD$LOCKW #define sch_std$lockwexec SCH_STD$LOCKWEXEC #define sch_std$lockwexec_quad SCH_STD$LOCKWEXEC_QUAD #define sch_std$lockwnowait SCH_STD$LOCKWNOWAIT #define sch_std$lockwnowait_quad SCH_STD$LOCKWNOWAIT_QUAD #define sch_std$postef SCH_STD$POSTEF #define sch_std$qast SCH_STD$QAST #define sch_std$ravail SCH_STD$RAVAIL #define sch_std$thread_ravail SCH_STD$THREAD_RAVAIL #define sch_std$unlock SCH_STD$UNLOCK #define sch_std$unlockexec SCH_STD$UNLOCKEXEC #define sch_std$unlockexec_quad SCH_STD$UNLOCKEXEC_QUAD #define sch_std$wake SCH_STD$WAKE #define sch$save_asn SCH$SAVE_ASN #define sch$get_asn SCH$GET_ASN /* Function prototypes for system routines with the SCH$ and SCH_STD$ prefix. */ int sch$add_cpu_cap(uint32 cpu_id, uint32 mask, UINT32_PQ prev_mask_p); int sch$change_affinity (CBB_PQ aff_bitmap, KTB *ktb, uint64 flags, CBB_PQ old_bitmap, int add_flag); int sch$change_capability (KTB *ktb, uint64 new_caps, uint32 cpuid, uint64 flags, UINT64_PQ old_mask, int add_flag); int sch$change_cpu_capability (uint32 cpuid, uint64 cap_mask, UINT64_PQ old_mask, int add_flag); int sch$clear_affinity(uint32 cpu_mask, KTB *ktb, uint32 flags, UINT32_PQ prev_mask_p); void sch$clear_affinity_bindings(CBB_PQ cpuid_bitmap); int sch$clear_capability(KTB *ktb, uint32 mask, uint32 cpu_id, uint32 flags, UINT32_PQ prev_mask_p); int sch$compute_runnable_mask (uint64 capabilities, CBB_PQ affinities, CBB_PQ run_bitmap_ptr); void sch$wait_kernel_mode (void); void sch$wait_proc (WQH *wait_queue, KTB *ktb); void sch$resource_wait (KTB *const ktb, const uint32 rsn); void sch$resource_wait_ps (KTB *const ktb,const uint32 rsn, const uint32 psl); int sch$resource_wait_setup (KTB *const ktb, const uint32 rsn); int sch$remove_cpu_cap(uint32 cpu_id, uint32 mask, UINT32_PQ prev_mask_p); int sch$set_affinity(uint32 cpu_mask, KTB *ktb, uint32 flags, UINT32_PQ prev_mask_p); void sch$set_affinity_bindings(CBB_PQ cpuid_bitmap); int sch$set_capability(KTB *ktb, uint32 mask, uint32 cpu_id, uint32 flags, UINT32_PQ prev_mask_p); int sch$acquire_implicit_affinity(KTB *ktb, int obsolete, int cpu_id); int sch$release_implicit_affinity(KTB *ktb); void sch$update_affinity_bindings(KTB *ktb, CBB_PQ cur_affs, CBB_PQ perm_affs); int sch_std$clrefr (int efn, PCB *pcb); MUTEX *sch_std$iolockr (PCB *pcb); MUTEX *sch_std$iolockw (PCB *pcb); void sch_std$iounlock (PCB *pcb); void sch_std$lockr (MTX *mtx, PCB *pcb); void sch_std$lockr_quad (MUTEX *mutex, PCB *pcb); int sch_std$lockrexec (MTX *mtx); int sch_std$lockrexec_quad (MUTEX *mutex); void sch_std$lockw (MTX *mtx, PCB *pcb); int sch_std$lockwexec (MTX *mtx); int sch_std$lockwexec_quad (MUTEX *mutex); int sch_std$lockwnowait (MTX *mtx, PCB *pcb); int sch_std$lockwnowait_quad (MUTEX *mutex, PCB *pcb); int sch_std$postef (int ipid, int incpri, int efn, PCB **pcb_p); int sch_std$qast (int incpri, ACB *acb, PCB **pcb_p); void sch_std$ravail (int rsn); void sch_std$report_event(int event,int prioIncrClass, KTB *ktb); void sch_std$thread_ravail (int rsn,int threadno); void sch_std$unlock (MTX *mtx, PCB *pcb); void sch_std$unlockexec (MTX *mtx); void sch_std$unlockexec_quad (MUTEX *mutex); int sch_std$wake (int ipid, PCB **pcb_p); #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size 64 #endif void sch$save_asn (PCB * old_pcb, FRED * old_fred, CPU * cpudb); int sch$get_asn (PCB * new_pcb, FRED * new_fred, CPU * cpudb, PCB * old_pcb, FRED * old_fred); #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #endif /* __SCH_ROUTINES_LOADED */