/* module sysap_macros.h "X-4" * * Copyright © Digital Equipment Corporation, 1998; 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: * * These are C macros which parallel the functionality of SYSAP_MACROS.MAR. * The MACRO-32 interface does not follow the Alpha Calling Standard in several * ways. Arguments are passed in general registers, which may or may not be * saved and restored. Results are also passed in general registers additional * to R0. For this reason, these macros require the assistance of MACRO-32 * support in addition to the macros themselves. * * These macros define the SYSAP interface to Alpha SCS only. SYSAPs should * use the macros in preference to calling SCS$ routines directly. * * There three aspects to the resource allocation macros. The first allocates * the resource requested but does not stall on failure. The second is the * ability to call the resource allocation failure stall directly. The third * is the combination of the first two. However, the combination does its * resource allocation request and stall request in MACRO-32 code vice the * "C" macro. In the case where multiple resources are requested with potential * stalls for each, only one callback routine is specified. * * The SYSAP is free to use the base macro and SCS_STALL separately to have * complete control over the stalling control flow. * * The block transfer and message send macros which fork also are built from * base macros usable by the SYSAP to control the forking behavior explicitly * like their resource allocating cousins * * * Author: * * James M. Blue Creation Date: 22-Mar-1999 * * Modification History: * * X-4 JMB186 James M. Blue 5-Oct-1999 * Missed a few when doing X-3! * * X-3 JMB172 James M. Blue 16-Aug-1999 * Remove the CDT argument from the SCS_STD$_* send, receive, and * map routine calls where the CDT used by the underlying SCS$_* * routine is acquired from a different source, such as the CDRP. * * X-2 JMB154 James M. Blue 6-Aug-1999 * Removed unnecessary PDT argument in SCAN_MSGBUF_WAIT macro. * * X-1 JMB086 James M. Blue 22-Mar-1999 * Initial version. *-- */ #ifndef __SYSAP_MACROS_LOADED #define __SYSAP_MACROS_LOADED 1 #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif /* Include files */ #include /* *++ * *** Resource allocation Macros *** * * Overview: * * An SCS_STALL macro is provided that stalls the SYSAP for the resource * indicated by the condition value in status. Use of these macros allows * complete control over the placement of fork routine entry points and * subroutine returns. In the MACRO-32 version of these macros, there is * the ability to insert an inline .JSB_ENTRY . For this reason, the code * visually appears to flow linearly, in actuality it may be composed of * several routine entries. This capability is not available in "C". * Additionally, the default use of registers is also not available. * * Example: * * 1) SYSAP choses to use the VAX/SCS emulation version of the macro: * * void sample_scs_interface() * { * ... * status = ALLOC_MSG_BUF( cdt_p, pdt_p, cdrp_p, ravail_p ); * ; allocate Send buffer, requesting * ; a stall if required. The * ; routine for the stall return * ; must be specified. * * if ( status == SS$_WASSET ) return; * * ; * ; This is a bit on the deceiving side of things. This can * ; flow linearly only if the non-stall path is used. If the * ; stall path was required then this code path must be ended * ; at the time of the stall. The resumption will be at the * ; routine entry point specified. Because the macro is used * ; in a form requiring a status return, the required "return" * ; statement cannot be included in the macro. Thus the caller * ; must do it. Note that because this code is executed at IPL, * ; the caller must exit in order for the resource to become * ; available. * ; * ... * return; * } * * 2) SYSAP choses to use the components. * * void sample_scs_interface() * { * ... * status = ALLOCMSGBUF( pdt_p, cdrp_p ); * ; allocate Send buffer, but do not * ; stall on failure. * if ( status != SS$_NORMAL ) * ; if the resource wasn't allocated * { * status = SCS_STALL( status, cdt_p, pdt_p, cdrp_p, ravail_p ); * ; attempt to stall in order to * ; acquire the resource. * if ( status == SS$_WASSET ) return; * ; If stall activated then exit while * ; waiting for the resource to become * ; available. * } * if ( status == SS$_NORMAL ) * ; If the resource was allocated, then * { * ravail( status, cdt_p, pdt_p, cdt_p ); * ; go process it. * return; * } * error path * ; Otherwise, handle the error condition. * * ... * return; * } * * * NOTE: * 1. The use of ";" for the comments above is not appropriate to "C", * however, this is a "C" module and "C" does not handle imbedded * comments. So ... * 2. The first example could have been used to accomplish the second * as shown in the example. However, the second gives the caller * control over whether the stall request ever gets activated. *-- */ /********************** SCS Initialization of CDRP **************************** *+ * SCS_INIT_CDRP - * * This macro initializes SCS cells that must be set to an initial state prior * to the first call to a SCS service that allocates a resource. The same CDRP * that is re-used by a SYSAP needs only be initialized once. * * Arguments: * cdrp_p - * This argument contains a pointer to the CDRP which is being * initialized. * * Return: * None . *- */ #define scs_init_cdrp( cdrp_p ) \ ((CDRP *) cdrp_p)->cdrp$q_res_wait_state = 0; \ /* Zero wait state and SCS State */ \ ((CDRP *) cdrp_p)->cdrp$l_bd_addr = 0; \ /* Zero buffer descriptor address */ \ ((CDRP *) cdrp_p)->cdrp$l_rbun = 0; \ /* Resource bundle pointer */ /**************** Stall of SCS Fork Thread or SYSAP ************************ *+ * SCS_STALL - (non-kernal process) * * Stalls a SYSAP or SCS fork thread waiting for a resource. Modeled (very * loosely) after FORK, FORK_WAIT and friends. Control is always returned * to the caller. The SYSAP's R3, R4, and R5 contents are saved at stall * entry and restored as arguments along with the status in R0 as arguments * to the RAVAIL_P routine. * * The overall stall scheme used within the MACRO version of these macros * allows for the macro to be executed in-line including the stall return. * This is not possible with C. The stall return must be made to an existing * subroutine. * * The SCS stall linkage is via JSB. A stall condition found in R0 is used to * determine if a stall will be queued. If the stall is queued, then the * contents of R3 (cdt), R4 (pdt), and R5 (cdrp) will be saved in the CDRP fork * block. It is presumed that R5 will contain a pointer to a CDRP structure. * Whether a stall is queued or not, a return will be made to the caller. If * the returned condition code is SS$_WASSET, then a stall was queued and an * immediate return should be made. Note, this macro should only be used after * an allocation failure situation. * * Arguments * * stall_condition_code - * This argument contains the status returned by the resource allocation * request. * cdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is a * pointer to the cdt. * pdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is a * pointer to the pdt. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource * is being allocated. * ravail_p - * This argument contains a pointer to the routine to call when the stall * has completed; if specified as NULL, the routine pointer is assumed to * be in CDRP$L_FPC(R5) * * Return * * status - * The status resulting from the call. Generally, this is a SS$_WASSET * indicating that the resource wait stall was activated and that the * caller should unwind and return to it's caller. Otherwise, the input * status indicating that the resource allocation failed because the * error was not due to a wait condition. * * The arguments for the callback routine (ravail) are the first four argument * specified in this macro. If the status continues to be a failure then the * resource was not allocated and appropriate action must be taken. Otherwise, * the resource is allocated and is indicated by the appropriate cell(s) in the * CDRP being filled. *- */ #define scs_stall( stall_condition_code, cdt_p, pdt_p, cdrp_p, ravail_p ) \ scs_std$stall( stall_condition_code, cdt_p, pdt_p, cdrp_p, ravail_p ) /************ Stalls During Resource Allocation *************** * * For purposes of this functionality, stalls refer to those instances * where a resource allocation has failed upon initial request and must * wait for the resource to become available. The caller may chose to * use the stall mechanism to wait or may re-issue the request * periodically. The call is the same whether a stall is authorized or * not. To authorize a stall action, specify the RAVAIL argument; * otherwise, specify it as NULL ( (void *) 0 ). * * If a stall has been requested and the resource wait is stallable a * SS$_WASSET will be returned as the status. If this status is returned, * the caller must terminate the thread of execution. * ************ Message Buffer Allocation/Deallocation ********** *+ * ALLOC_MSG_BUF * * Allocate a sequenced message buffer and the credit to send it, without * stall. If successful (SS$_NORMAL), the application buffer pointer will * be contained in the CDRP$L_MSGBUF field of the CDRP. Otherwise, an * error status will be returned. This status will either be a condition * resolvable via stall or a fatal error (ie. connection closed). * * Arguments * * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource is * being allocated. The following cell must be valid: * * CDRP$L_CDT(R5) - Addr of CDT * * ravail_p - * This argument contains a pointer to the routine to call when the stall * has completed; if specified as NULL, a stall will not be requested * regardless of allocation request status. A SS$_WASSET status will be * returned, if a stall was successfully requested. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the resource was allocated to the caller. If not * SS$_NORMAL, then it will be either SS$_WASSET indicating that the * caller should unwind and return to it's caller or a fatal error. * *- */ #define alloc_msg_buf( pdt_p, cdrp_p, ravail_p ) \ scs_std$alloc_msgbuf( pdt_p, cdrp_p, ravail_p ) /* *+ * RECYCx_MSG_BUF * * Recycle a message buffer. This call is used to obtain credit for a * received message in order to turn it around and send it back to the * original sender. The two calls wait at high or low priority for * send credit (if waiting required), where x equals H for high and L * for low. * * Arguments * * cdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is a * pointer to the cdt. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource is * being allocated. The following cells must be valid: * * CDRP$L_CDT(R5) - Addr of CDT * * ravail_p - * This argument contains a pointer to the routine to call when the stall * has completed; if specified as NULL, a stall will not be requested * regardless of allocation request status. A SS$_WASSET status will be * returned, if a stall was successfully requested. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the resource was allocated to the caller. If not * SS$_NORMAL, then it will be either SS$_WASSET indicating that the * caller should unwind and return to it's caller or a fatal error. * *- */ #define recych_msg_buf( pdt_p, cdrp_p, ravail_p ) \ scs_std$rchmsgbuf( pdt_p, cdrp_p, ravail_p ) #define recycl_msg_buf( pdt_p, cdrp_p, ravail_p ) \ scs_std$rclmsgbuf( pdt_p, cdrp_p, ravail_p ) /* *+ * DEALLOC_MSG_BUF - * * Deallocates a message buffer and returns associated send credit. * This will cause any threads waiting for message buffers to be * called before control is returned to the caller. * * Arguments * * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource is * being deallocated. * * Return * * None. *- */ #define dealloc_msg_buf( pdt_p, cdrp_p ) \ scs_std$deallocmsg( pdt_p, cdrp_p ) /* *+ * DEALLOC_MSG_BUF_REG - * * Deallocates a message buffer which is not associated with a CDRP * and returns associated send credit. This will cause any threads * waiting for message buffers to be called before control is returned * to the caller. * * Arguments * * msg_buf_p - * This argument contains a pointer to the message buffer to be * deallocated. * cdt_p - * This argument contains a pointer to the connection descriptor table * (CDT). * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * * Return * * None. *- */ #define dealloc_msg_buf_reg( msg_buf_p, cdt_p, pdt_p ) \ scs_std$dealrgmsg( msg_buf_p, cdt_p, pdt_p ) /* *+ * RESTORE_CREDIT - * * Deallocates a send buffer and returns the credit. This is the only * way to get back send credits without sending the buffer. * * Arguments * * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource was * allocated. * * Return * * None. *- */ #define restore_credit( pdt_p, cdrp_p ) \ scs_std$restore_credit( pdt_p, cdrp_p ) /************ Datagram Allocation/Deallocation ********** *+ * ALLOC_DG_BUF - * * Allocates a Datagram buffer, this call does not stall on failure. * * Arguments * * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the resource is * being allocated. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the datagram was allocated to the caller. Otherwise, * SS$_INSFMEM, indicating no datagram buffers available and no memory to * make more. *- */ #define alloc_dg_buf( pdt_p, cdrp_p ) \ scs_std$allocdg( pdt_p, cdrp_p ) /* *+ * DEALLOC_DG_BUF - * * Deallocate a datagram buffer. * * Arguments * * dgbuf_p - * This is a pointer to the application data portion of the datagram * buffer to be deallocated. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * * Return * * None. *- */ #define dealloc_dg_buf( dgbuf_p, pdt_p ) \ scs_std$deallocdg( dgbuf_p, pdt_p ) /* *+ * QUEUE_MULT_DGS - * * Add or subtract datagram buffers from the port's supply of datagrams * "crediting" the indicated connection for the datagrams. * * Arguments * * buffer_count - * This argument contains the number of buffers to be added (+ number) * or removed (- number). * cdt_p - * This argument contains a pointer the connection descriptor table * (CDT). The count of buffers allocated is contained in this table. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * buffers_added_p - * This argument contains a pointer to a cell to receive the count of * buffers added or removed. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the resources were added or removed as requested. * Otherwise, SS$_DGQINCOMP indicating that not all requested buffers were * added or removed. *- */ #define queue_mlt_dgs( buffer_count, cdt_p, pdt_p, buffers_added_p ) \ scs_std$queuemdgs( buffer_count, cdt_p, pdt_p, buffers_added_p ) /* *+ * QUEUE_DG_BUF - * * Add a datagram buffer to the port's supply of datagrams. * * Arguments * * dg_buf_p - * This argument contains a pointer to the application portion of the * datagram buffer to be queued. * cdt_p - * This argument contains a pointer to the connection descriptor table * (CDT). The count of buffers allocated is contained in this table. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the buffer was queued as requested. *- */ #define queue_dg_buf( dg_buf_p, cdt_p, pdt_p ) \ scs_std$queuedg( dg_buf_p, cdt_p, pdt_p ) /************ Response ID Allocation/Deallocation ********** *+ * ALLOC_RSPID * * Allocate a RSPID. * * Arguments * * cdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is * a pointer to a cdt. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which the RSPID is * being allocated. * ravail_p - * This argument contains a pointer to the routine to call when the stall * has completed; if specified as NULL, a stall will not be requested * regardless of allocation request status. A SS$_WASSET status will be * returned, if a stall was successfully requested. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the resource was allocated to the caller. If not * SS$_NORMAL, then it will be either SS$_WASSET indicating that the * caller should unwind and return to it's caller or a fatal error. * *- */ #define alloc_rspid( cdt_p, pdt_p, cdrp_p, ravail_p ) \ scs_std$alloc_rspid( cdt_p, pdt_p, cdrp_p, ravail_p ) /* *+ * RECYCL_RSPID - * * "Re-allocates" an existing RSPID (eq. to DEALLOC_RSPID then ALLOC_RSPID, but * more efficient). This call cannot fail, thus there is no status or stall * capability required. * * Arguments * * cdrp_p - * This argument contains a pointer to the CDRP containing the RSPID * being recycled. * * Return * * None. *- */ #define recycl_rspid( cdrp_p ) \ scs_std$recyl_rspid( cdrp_p ) /* *+ * DEALLOC_RSPID - * * Deallocate a response id. If there are other RSPID waiters, * this call will invoke each of their waiting threads before * returning control to the caller. * * Arguments * * cdrp_p - * This argument contains a pointer to the CDRP containing the * RSPID being deallocated. * * Return * * None. *- */ #define dealloc_rspid( cdrp_p ) \ scs_std$deall_rspid( cdrp_p ) /************ Block transfer mapping Allocation/Deallocation ********** *+ * MAP * * Allocate mapping registers and map request data. It is presumed that the * data has already been probed and locked down as required. * * Arguments * * svapte_boff_bcnt_p - * This argument contains a pointer to a three element array in the * same order and size as CDRP$L_SVAPTE, CDRP$L_BOFF, and CDRP$L_BCNT * and containing similarly appropriate data for the buffer to be mapped. * If it is desired to map an IRP, then point to CDRP$L_SVAPTE. * cdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is a * pointer to the cdt. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer allocation is port specific. The * following PDT cell must be valid: * * PDT$L_BDLT - Address of Buffer Descriptor table for port * * cdrp_p - * This argument contains a pointer to the CDRP for which the buffer is * being mapped. The following CDRP cells must be valid: * * CDRP$L_CDT - Addr of CDT * CDRP$L_LBUFH_AD - Addr of SYSAP's buffer handle * CDT$L_RCONID - Remote connection ID * CDRP$L_BD_ADDR - Address of BD if non-zero * * If input CDRP is an IRP (CDRP$B_TYPE = DYN$C_IRP) then also: * * CDRP$L_SVAPTE - transfer starting page's PTE address * CDRP$L_BOFF - transfer byte in page offset * CDRP$L_BCNT - transfer size in bytes * CDRP$B_RMOD - caller's access mode (w/o protection check bit) * * ravail_p - * This argument contains a pointer to the routine to call when the stall * has completed; if specified as NULL, a stall will not be requested * regardless of allocation request status. A SS$_WASSET status will be * returned, if a stall was successfully requested. * * Return * * status - * The status resulting from the call. Generally, this is a SS$_NORMAL * indicating that the resource was allocated to the caller. If not * SS$_NORMAL, then it will be either SS$_WASSET indicating that the * caller should unwind and return to it's caller or a fatal error. * *- */ #define map( svapte_boff_bcnt_p, pdt_p, cdrp_p, ravail_p ) \ scs_std$map( svapte_boff_bcnt_p, pdt_p, cdrp_p, ravail_p ) /* *+ * UNMAP - * * Unmap a buffer for block transfer * * Arguments * * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because the buffer mapping is port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which contains the * buffer handle of the mapped data. * * Return * * None. *- */ #define unmap( pdt_p, cdrp_p ) \ scs_std$unmap( pdt_p, cdrp_p ) /*************** Connection error cleanup calls ************** * * Each of these macros searchs a resource wait queue (except SCAN_RDT * which searches the RSPID table) for stalled SYSAP threads associated * with the indicated connection (CDT) and calls the specified action * routine with the CDRP associated with the stalled thread in CDRP. * * SCAN_MSGBUF_WAIT - * * Scan message buffer and send credit wait queues for CDRP with given CDT * * Arguments * * action_p - * This argument contains a pointer to the action routine to be called * if a match is found. The action routine is called with the current * action_param value, CDT, CDRP. The action routine return is an * updated or the same action_param value to passed if the action * routine is called again during this call. * action_param - * This argument contains the value to be sent to the action routine. * cdt_p - * This argument contains a pointer to the connection descriptor (CDT) * to be matched. * * Return * * status - * The status returned by the action routine. *- */ #define scan_msgbuf_wait( action_p, action_param, cdt_p ) \ scs_std$lkp_msgwait( action_p, action_param, cdt_p ) /* *+ * SCAN_RDT - * * Scan RDT for CDRP with given CDT * * Arguments * * action_p - * This argument contains a pointer to the action routine to be called * if a match is found. The action routine is called with the current * action_param value, CDT, CDRP. The action routine return is an * updated or the same action_param value to passed if the action * routine is called again during this call. * action_param - * This argument contains the value to be sent to the action routine. * cdt_p - * This argument contains a pointer to the connection descriptor (CDT) * to be matched. * * Return * * status - * The status returned by the action routine. *- */ #define scan_rdt( action_p, action_param, cdt_p ) \ scs_std$lkp_rdtcdrp( action_p, action_param, cdt_p ) /* *+ * SCAN_RSPID_WAIT - * * Scan RSPID wait queue for CDRP with given CDT * * Arguments * * action_p - * This argument contains a pointer to the action routine to be called * if a match is found. The action routine is called with the current * action_param value, CDT, CDRP. The action routine return is an * updated or the same action_param value to passed if the action * routine is called again during this call. * action_param - * This argument contains the value to be sent to the action routine. * cdt_p - * This argument contains a pointer to the connection descriptor (CDT) * to be matched. * * Return * * status - * The status returned by the action routine. *- */ #define scan_rspid_wait( action_p, action_param, cdt_p ) \ scs_std$lkp_rdtwait( action_p, action_param, cdt_p ) /* *+ * CANCEL_WAIT - * * Cancel Resource Wait Stall for a CDRP. When a port stalls for a * resource (message buffer or map registers) some data structure is * placed on a wait queue. When timeouts fire, a SYSAP may want to * regain control of the CDRP to cancel the request and retry all * operations on the controller. The SYSAP invokes this macro to * cancel the resource wait stall and regain control of the CDRP. This * replaces the simple REMQUE of the CDRP off the resource wait queue in * VAX/VMS. This service is required as it is no longer always the CDRP * that is placed on the resource wait queue. This service is * synchronous and there is no return status. * * Arguments * * rwcptr_upd - * This argument contains a flag. If set to 1, then any resource * wait counters associated with the CDRP amd the cancelled resource * wait state are to be decremented. * pdt_p - * This argument contains a pointer to the port descriptor table (PDT). * It is required because many resource waits are port specific. * cdrp_p - * This argument contains a pointer to the CDRP for which contains the * queue for the wait in most cases. * * Return * * status - * SS$_NORMAL is returned if the cancel was successful. A 0 * indicates no wait state to cancel on this CDRP. *- */ #define cancel_wait( rwcptr_upd, pdt_p, cdrp_p ) \ scs_std$cancel_wait( rwcptr_upd, pdt_p, cdrp_p ) /**************** Misc. calls **************** * * FIND_RSPID_RDTE - * * Locate and validate the RDTE for a given response ID * * Arguments * * rspid - * This argument contains the RSPID from the received message * for which the RDTE is to be located. * rdte_p - * This argument is pointer to a pointer to be loaded with the * found RDTE if the RSPID was valid and the RDTE located. * * Return * * status - * If set to 1, then RDTE argument contains a pointer to the * associated RDTE for the RSPID requested, otherwise, 0 * indicating an invalid RSPID. *- */ #define find_rspid_rdte( rspid, rdte_p ) \ scs_std$find_rdte( rspid, rdte_p ) /* *+ * RESUME_RESOURCE_WAITER - * * Using the data from a CDRP restored using FIND_RSPID_RDTE, * resume the thread of execution stalled via SCS_STD$STALL. * * Arguments * * resume_status - * This argument contians the status to be passed the resumed thread. * cdrp_p - * This argument contains a pointer to the CDRP for which contains the * saved thread context. * * Return * * None. *- */ #define resume_resource_waiter( resume_status, cdrp_p ) \ scs_std$resumewaitr( resume_status, cdrp_p ) /* *+ * RESUME_THREAD - * * Using the data from a CDRP restored using FIND_RSPID_RDTE, * resume the thread of execution stalled as a result of a * data transfer request. * * Arguments * * resume_status - * This argument contians the status to be passed the resumed thread. * cdrp_p - * This argument contains a pointer to the CDRP for which contains the * saved thread context. * * Return * * None. *- */ #define resume_thread( resume_status, cdrp_p ) \ scs_std$resume_thread( resume_status, cdrp_p ) /**************** Configuration Services ******* *+ * CONFIG_PTH - * * Get path configuration information * * Arguments * * rmst_lclprt_p - * This argument contains a pointer to a data block * describing the remote station address and local port * name. * pbo_p - * This argument contains a pointer to a data block to be * filled with the path block information found. * pb_p - * This argument contains a pointer to the path block * containing the information. * * Return * * status - * If SS$_NORMAL, then pbo_p contains the path information; * otherwise, SS$_NOSUCHNODE indicating that no such remote * station exists. *- */ #define config_pth( rmst_lclprt_p, pbo_p, pb_p ) \ scs_std$config_pth( rmst_lclprt_p, pbo_p, pb_p ) /* *+ * CONFIG_SYS - * * Get system configuration information * * Arguments * * scssystemid_p - * This argument contains a pointer to the SCSSYSTEMID to * be located. * sbo_p - * This argument contains a pointer to a data block to be * filled with the system information found. * sb_p - * This argument contains a pointer to the system block * containing this information. * * Return * * status - * If SS$_NORMAL, then sbo_p contains the path information; * otherwise, SS$_NOSUCHNODE indicating that no such * SCSSYSTEMID exists. *- */ #define config_sys( scssystemid_p, sbo_p, sb_p ) \ scs_std$config_sys( scssystemid_p, sbo_p, sb_p ) /* *+ * POLL_PROC - * * Declare a SYSAP name to the process poller. * * Arguments * * notification_p - * This argument contains a pointer to the routine * to handle notification when the process poller * locates the requested SYSAP on a remote node. * context_data_p - * This argument contains a caller defined context * parameter to be passed to the notification routine. * sysap_name_p - * This argument contains a pointer to the sysap name * to be located via polling. * sppb_p - * This argument contains a pointer that will receive * a pointer to the SPPB allocated for this process. * * Return * * status - * SS$_NORMAL indicating that the sysap_name has been * decalred to the process poller or SS$_INSFMEM * indicating that a SCS Process Poller Block could not * be allocated. *- */ #define poll_proc( notification_p, context_data_p, sysap_name_p, sppb_p ) \ scs_std$poll_proc( notification_p, context_data_p, sysap_name_p, sppb_p ) /* *+ * POLL_MODE - * * Enable process polling for declared SYSAP name. * * Arguments * * enable_disable - * This argument contains a flag - LBC to disable polling and * LBS to enable polling. * sppb_p - * This argument contains a pointer to the SPPB allocated for * this process. * scssystemid_p - * This argument contains a pointer to the SCSSYSTEMID. * * Return * * status - * SS$_NORMAL indicating that polling has been enabled or * disabled as requested or SS$_NOSUCHNODE. *- */ #define poll_mode( enable_disable, sppb_p, scssystemid_p ) \ scs_std$poll_mode( enable_disable, sppb_p, scssystemid_p ) /* *+ * POLL_MBX - * * Declare a SYSAP name to the process poller with noticfication * via mailbox. Note: The IPL cannot be higher than IPL$_ASTDEL (2). * * Arguments * * channel_number - * This argument contains the channel number of an * existing mailbox which is to receive poller * notification. * sysap_name_p - * This argument contains a pointer to the sysap name * to be located via polling. * sppb_p - * This argument contains a pointer that will receive * a pointer to the SPPB allocated for this process. * * Return * * status - * SS$_NORMAL indicating that the sysap_name has been * decalred to the process poller, SS$_INSFMEM * indicating that a SCS Process Poller Block could not * be allocated, or SS$_IVCHAN indicating the mailbox * channel is invalid. *- */ #define poll_mbx( channel_number, sysap_name_p, sppb_p ) \ scs_std$poll_mbx( channel_number, sysap_name_p, sppb_p ); /* *+ * CANCEL_MBX - * * Cancel mailbox polling notification. * * Arguments * * sppb_p - * This argument contains a pointer to the SPPB allocated * for this process. * * Return * * None. *- */ #define cancel_mbx( sppb_p ) \ scs_std$cancel_mbx( sppb_p ) /*********** Maintenance Functions ***************** *+ * MRESET - * * Reset remote port and system * * Arguments * * force_flag - * This argument contains a 0 for do not force reset, 1 to * force a reset. * rstation_p - * This argument contains a pointer to the remote station * address of the port to be reset. * pdt_p - * This argument contains a pointer to the port descriptor * (PDT). This is a port specific function. * * Return * * status - * SS$_NORMAL to indicate successful request; SS$_NOSUCHNODE to * indicate that the remote station is unknown. *- */ #define mreset( force_flag, rstation_p, pdt_p ) \ scs_std$mreset( force_flag, rstation_p, pdt_p ); /* *+ * MSTART - * * Power up remote port and host. * * Arguments * * boot_flag - * This argument contains a 0 indicating boot starting at the * boot address supplied; 1 indicating use the default boot * address. * rstation_p - * This argument contains a pointer to the remote station * address of the port to be restarted. * boot_address - * This argument contains the boot address to be used if the * boot flag is set to 0. * pdt_p - * This argument contains a pointer to the port descriptor * (PDT). This is a port specific function. * * Return * * status - * SS$_NORMAL to indicate successful request; SS$_NOSUCHNODE to * indicate that the remote station is unknown. *- */ #define mstart( boot_flag, rstation_p, boot_address, pdt_p ) \ scs_std$mstart( boot_flag, rstation_p, boot_address, pdt_p ) /************** Connection Management Calls ************* * * These calls are concerned with Establising, Dissolving and obtaining * information about connections. * * The SYSAP should check the status following the call and upon entry to * the completion routine for errors that prevent sending the connection * management message at all (Eg. INSFMEM). * *+ * LISTEN - * * Listen for incoming CONNECT requests. LISTEN returns directly to the * caller after establishing the listen context or encountering an * allocation failure, therefore there is no need of the COMPLETE callback * argument. * * Arguments * * msgadr_p - * This argument contains a pointer to the routine handling * a connect request. * erradr_p - * This argument contains a pointer to the routine handling * any error conditions that may arise. * lprname_p - * This argument contains a pointer to the local process name * to be placed in the directory. * prinfo_p - * This argument contains a pointer to the information about * the local process. * cdt_p - * This argument contains a pointer to a pointer to the * connection descriptor assigned to this request. * * Return * * status - * SS$_NORMAL to indicate successful request, SS$_INSFCDT to * indicate that the connection descriptor table is full, or * SS$_INTERLOCK to indicate that there is no memory available * for a directory entry. *- */ #define listen( msgadr_p, erradr_p, lprname_p, prinfo_p, cdt_p ) \ scs_std$listen( msgadr_p, erradr_p, lprname_p, prinfo_p, cdt_p ) /* *+ * ACCEPT - * * Accept a connection request. * * Arguments * * msgadr_p - * This argument contains a pointer to the routine handling * sequenced message input. * dgadr_p - * This argument contains a pointer to the routine handling * datagram message input. * erradr_p - * This argument contains a pointer to the routine handling * error conditions such as connection loss. * initcr - * This argument contains the initial number of receive credits * to be extended to the remote node. * minscr - * This argument contains the minimum number of credits by a * local process protocol. * initdg - * This argument contains the number of datagrams to queue for * receive. * blkpri - * This argument contains the priority for block transfers. * condat_p - * This argument contains a pointer to the connection data. * auxstr_p - * This argument contains a pointer to an auxillary data * structure. * badrsp_p - * This argument contains a pointer to the routine handling * a bad response message. (Not implemented in SCS at this * time.) * movadr_p - * This argument contains a pointer to the routine handling * a SCS request to move to a different port. * load_rating - * This argument contains the numeric code for load rating * associated with this connection. * complete_p - * This argument contains a pointer to the routine handling * the connection completion. This call is a guaranteed stall. * cdt_p - * This argument contains a pointer to the CDT passed in by * the Listen request. * cdrp_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is a * pointer to a cdrp. * * Return * * status - * SS$_NORMAL to indicate a successful initiation of the * connect process; NOT completion of the process, SS$_DISCONNECT * to indicate that the connection was disconnected, SS$_INSFCDT * to indicate that no more cdt's could be allocated, SS$_INSFMEM * to indicate no memory for buffer allocation, SS$_VCBROKEN to * indicate that the virtual circuit was lost. * * Note: * The CDT is specified after the other parameter in order to maintain * their argument position when the call reaches the MACRO-32 layer of * SCS. It is moved to a register for the next layer call. *- */ #define accept( msgadr_p, dgadr_p, erradr_p, initcr, minscr, initdg, blkpri, \ condat_p, auxstr_p, badrsp_p, movadr_p, load_rating, \ complete_p, cdt_p, cdrp_p ) \ scs_std$accept( msgadr_p, dgadr_p, erradr_p, initcr, minscr, \ initdg, blkpri, condat_p, auxstr_p, badrsp_p, \ movadr_p, (load_rating ? load_rating : CDT$C_YELLOW), \ complete_p, cdt_p, cdrp_p ) /* *+ * REJECT - * * Reject a connection request. * * Arguments * * rejtyp - * This argument contains the reject code to be returned * to the connection initiator. * cdt_p - * This argument contains a pointer to the cdt received from * the listen request. * complete_p - * This argument contains a pointer to the routine handling * rejection completion. This call is a guaranteed stall. * cdrp_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is * a pointer to a cdrp. * * Return * status - * SS$_NORMAL to indicate a successful initiation of the * reject request; NOT completion of the process, SS$_ILLCDTST * to indicate that the CDT address is invalid (specifically, * that it was NULL), or SS$_VCBROKEN to indicate that the * virtual circuit was lost. *- */ #define reject( rejtyp, cdt_p, complete_p, cdrp_p ) \ scs_std$reject( rejtyp, cdt_p, complete_p, cdrp_p ) /* *+ * CONNECT - * * Initiate a connect over a virtual circuit to a remote node. * * Arguments * * msgadr_p - * This argument contains a pointer to the routine handling * sequenced message input. * dgadr_p - * This argument contains a pointer to the routine to handling * datagram message input. * erradr_p - * This argument contains a pointer to the routine to handling * error conditions such as connection loss. * rsysid_p - * This argument contains a pointer to the SCSSYSTEMID for the * remote node. * rstadr_p - * This argument contains a pointer to the station address for * the remote node. * * (Although both arguments (rsysid_p and rstadr_p) must be * specified, only one is required to be non-NULL and valid, the * other may point to a NULL field. * * rprnam_p - * This argument contains a pointer to the process name on for * the remote node. * lprnam_p - * This argument contains a pointer to the process name on for * the local node. * initcr - * This argument contains the initial number of receive credits * to be extended to the remote node. * minscr - * This argument contains the minimum number of credits by a * local process protocol. * initdg - * This argument contains the number of datagrams to queue for * receive. * blkpri - * This argument contains the priority for block transfers. * condat_p - * This argument contains a pointer to the connection data. * auxstr_p - * This argument contains a pointer to an auxillary data * structure. * badrsp_p - * This argument contains a pointer to the routine handling * bad response input. (Not implemented in SCS at this time.) * movadr_p - * This argument contains a pointer to the routine handling * a SCS request to move to a different port. * load_rating - * This argument contains the numeric code for load rating * associated with this connection. * req_fast_recvmsg_p - * This argument contains a pointer to the routine handling * fast path receive message request services. This routine * returns a int with low bit set indicating that fast path * may proceed. * fast_recvmsg_pm_p - * This argument contains a pointer to the routine handling * the receipt of a fast path message. * change_aff_p - * This argument contains a pointer to the routine handling * affinity changes. * complete_p - * This argument contains a pointer to the routine handling * connection completion. This call is a guaranteed stall. * connect_parameter - * This argument contains an unsigned longword parameter to * be passed to the connect complete routine. It is not used * or manipulated by SCS. * * Return * status - * SS$_NORMAL to indicate a successful initiation of the * connect process; NOT completion of the process, SS$_DISCONNECT * to indicate that the connection was disconnected, SS$_INSFCDT * to indicate that no more cdt's could be allocated, SS$_INSFMEM * to indicate no memory for buffer allocation, SS$_VCBROKEN to * indicate that the virtual circuit was lost. *- */ #define connect( msgadr_p, dgadr_p, erradr_p, rsysid_p, rstadr_p, rprnam_p, \ lprnam_p, initcr, minscr, initdg, blkpri, condat_p, auxstr_p, \ badrsp_p, movadr_p, load_rating, req_fast_recvmsg_p, \ fast_recvmsg_pm_p, change_aff_p, complete_p, connect_parameter ) \ scs_std$connect( msgadr_p, dgadr_p, erradr_p, rsysid_p, rstadr_p, \ rprnam_p, lprnam_p, initcr, minscr, initdg, blkpri, \ condat_p, auxstr_p, badrsp_p, movadr_p, \ (load_rating ? load_rating : CDT$C_YELLOW), \ req_fast_recvmsg_p, fast_recvmsg_pm_p, change_aff_p, \ complete_p, connect_parameter ) /* *+ * DISCONNECT - * * Remove a connection over a virtual circuit to a remote node. * * Arguments * * distyp - * This argument contains the disconnect reason code to be * returned to the remote node. * cdt_p - * This argument contains a pointer to the CDT for this connection. * complete_p - * This argument contains a pointer to the routine handling * disconnect completion. This call is a guaranteed stall. * disparam - * This argument contains a scalar value to be returned by the * disconnect completion routine. * * Return * status - * SS$_NORMAL to indicate a successful initiation of the * disconnect request; NOT completion of the process, * SS$_ALRDYCLOSED to indicate the connection was already * closed, SS$_ILLCDTST to indicate that the CDT address is * invalid (specifically, that it was NULL), or SS$_VCBROKEN * to indicate that the virtual circuit was lost. *- */ #define disconnect( distyp, cdt_p, complete_p, disparam ) \ scs_std$disconnect( distyp, cdt_p, complete_p, disparam ) /* *+ * SET_LOAD_RATING - * * Set a connection's dynamic load rating * * Arguments * * rating - * This argument contains the new load rating code. * cdt_p - * This argument contains a pointer to the CDT for this connection. * * Return * * status - * SS$_NORMAL to indicate that rating was changed, SS$_BADPARAM to * indicate that the rating was out of range, SS$_ILLCDTST to * indicate that the CDT was invalid. *- */ #define set_load_rating( rating, cdt_p ) \ scs_std$set_load_rating( rating, cdt_p ) /************** Block Data Transfer Calls ************* * * New for Alpha/SCS are three new macros that call the SCS block transfer * routines directly and return to caller. These macros require the SYSAP * already have a CDRP with a MSGBUF and RSPID, * * Each of the Alpha/SCS block transfer calls include a COMPLETE argument to * macros for specifying a call back entry when the block transfer completes. * These macros *Do not* end the current for thread, control is returned to * the caller * * If the COMPLETE argument is not specified the address of the complete * routine must have been stored in CDRP$L_FPC. * * NOTE: If a COMPLETE routine is explicitly specified there is no need to * check R0 status when called at that routine, it will always be SS$_NORMAL. * *+ * REQDATA / SENDDATA / SENDDATAWM * * These Alpha/SCS only macros call the SCS block transfer routines directly, * the do *not* end the current thread. The SYSAP specifies a completion * callback routine (COMPLETE argument) if none is specified it is assumed * to be in CDRP$L_FPC. * * The two block transfer calls differ only in transfer direction. For * SENDDATA the contents of the local data buffer (specified by the buffer * handle @CDRP$L_LBUFH_AD) is transferred to the remote SYSAP's data buffer * (specified by the buffer handle @CDRP$L_RBUFH_AD, which must be currently * MAP'd by the remote SYSAP) For REQDATA the remote data buffer contents are * transferred to the local data buffer. It is presumed that a RSPID and * message buffer have been previously allocated for this CDRP. * * Arguments * * pdt_p - * This argument contains a pointer to the PDT for this connection. * cdrp_p - * This argument contains a pointer to the CDRP for this connection. * The following cells of the CDRP must be valid: * * CDRP$L_RSPID - RSPID to use to correlate transfer * completion with initiation thread * CDRP$L_MSG_BUF - Message buffer to use for xfer command * CDRP$L_XCT_LEN - # bytes to xfer * CDRP$L_LBUFH_AD - Addr of local buffer handle * CDRP$L_LBOFF - Local byte offset for segmentation * CDRP$L_RBUFH_AD - Addr of remote buffer handle * CDRP$L_RBOFF - Remote byte offset for segmentation * * In addition, for SENDDATAWM, the following cell must be valid: * * CDRP$L_CDT - CDT for connection on which the piggyback * message is sent. * * complete_p - * This argument contains a pointer to the routine handling send * data completion. This call is a guaranteed stall. * * Return * * status - * Either SS$_NORMAL indicating the request was queued * successfully or SS$_ILLCDTST indicating the CDT was * not open. *- */ #define reqdata( pdt_p, cdrp_p, complete_p ) \ scs_std$reqdata( pdt_p, cdrp_p, complete_p ) #define senddata( pdt_p, cdrp_p, complete_p ) \ scs_std$senddata( pdt_p, cdrp_p, complete_p ) #define senddatawm( pdt_p, cdrp_p, complete_p ) \ scs_std$senddata_wmsg( pdt_p, cdrp_p, complete_p ) /* *+ * REQUEST_DATA / SEND_DATA / SEND_DATA_WMSG * * These macros behave similarly to those above, except that they * allocate the necessary RSPID and message buffer as part of the * call. These requests may result in a stall at any point. * However, the caller will only be called at the completion entry * routine upon final completion either with success or failure. * * Arguments * * msg_buf_len - * This argument contains the length of the message being * transmitted. THIS IS FOR SEND_DATA_WMSG ONLY. * pdt_p - * This argument contains a pointer to the PDT for this connection. * cdrp_p - * This argument contains a pointer to the CDRP for this connection. * complete_p - * This argument contains the address of the routine to handle * the final completion. This call may generate a stall. * * Return * * status - * Either SS$_WASSET indicating the request was queued or * an appropriate error condition for one of the resource * allocation routines. See ALLOCMSGBUF, ALLOCRSPID, or * RECYCHMSGBUF (for SEND_DATA_WMSG). *- */ #define request_data( pdt_p, cdrp_p, complete_p ) \ scs_std$request_data( pdt_p, cdrp_p, complete_p ) #define send_data( pdt_p, cdrp_p, complete_p ) \ scs_std$send_data( pdt_p, cdrp_p, complete_p ) #define send_data_wmsg( msg_buf_len, pdt_p, cdrp_p, complete_p ) \ scs_std$send_data_wmsg( msg_buf_len, pdt_p, cdrp_p, complete_p ) /************** Datagram Send Calls ************* * * SEND_DG_BUF - * * Send a datagram. * * Arguments * * disposition_flag - * This argument indicates the disposition of the * datagram after it has been sent. SYSAP$C_DISPQ * indicates return the datagram to the free queue, * SYSAP$C_DISPRET indicates return the datagram to * the SYSAP, and SYSAP$C_DISPPO indicates return * the datagram to the port for deallocation. * dg_msg_length - * This argument contains the length of the buffer * to transmit. * cdrp_p - * This argument contains a pointer to the CDRP * associated with this request. * * Return * * status - * SS$_NORMAL indicating the request was queued. *- */ #define send_dg_buf( disposition_flag, db_msg_length, cdrp_p ) \ scs_std$senddg( disposition_flag, db_msg_length, cdrp_p ) /* *+ * SEND_DG_BUF_REG - * * Send a datagram without CDRP. * * Arguments * * disposition_flag - * This argument indicates the disposition of the * datagram after it has been sent. SYSAP$C_DISPQ * indicates return the datagram to the free queue, * SYSAP$C_DISPRET indicates return the datagram to * the SYSAP, and SYSAP$C_DISPPO indicates return * the datagram to the port for deallocation. * dg_msg_length - * This argument contains the length of the buffer * to transmit. * dg_buf_p - * This argument contains a pointer to the application data portion * of a datagram to be sent. * cdt_p - * This argument contains a pointer to the PDT for this connection. * pdt_p - * This argument contains a pointer to the PDT for this connection. * * Return * * status - * SS$_NORMAL indicating the request was queued. *- */ #define send_dg_buf_reg( disposition_flag, dg_msg_length, dg_buf_p, cdt_p, pdt_p ) \ scs_std$sendrgdg( disposition_flag, dg_msg_length, dg_buf_p, cdt_p, pdt_p ) /************** Message Send Calls ************* *+ * SENDMSGBUF * * This macro is used to send a max sized message. If a RSPID is specified * a completion routine entry should be specified in the COMPLETE argument * (or be stored in CDRP$L_FPC(R5)). This is a guaranteed stall, if a RSPID * is specified, thus the caller must terminate the thread. * * Arguments * * pdt_p - * This argument contains a pointer to the PDT for this connection. * cdrp_p - * This argument contains a pointer to the CDRP for this connection. * The following cells must be valid: * * CDRP$L_CDT(R5) - Addr of CDT * CDRP$L_MSG_BUF(R5) - Addr of message * CDRP$L_RSPID(R5) - RSPID (to set RETFLG) * * complete_p - * This argument contains a pointer to the routine handling the final * completion. This call is guaranteed stall. This cell will only be * used if the RSPID is non-zero. * * Return * * status - * Either SS$_NORMAL indicating the request was queued or * SS$_ILLCDTST indicating the connection was closed. *- */ #define sendmsgbuf( pdt_p, cdrp_p, complete_p ) \ scs_std$sendmsg( SCS$GW_MAXMSG, pdt_p, cdrp_p, complete_p ) /* *+ * SENDCNTMSGBUF * * This macro is equivelent to SENDMSGBUF except a message size must be * specified. The jacket for this macro encompasses both the * SENDCNTMSGBUF and SEND_CNT_MSG_BUF macros of SYSAP_MACROS.MAR. Thus, * if there is no RSPID, there is no stall. If no completion routine is * specified and one is required, it is anticipated that the address has * previously been placed in CDRP$L_FPC of the CDRP. * * Arguments * * buf_size - * This argument contains the buffer size to be transmitted. * pdt_p - * This argument contains a pointer to the PDT for this connection. * cdrp_p - * This argument contains a pointer to the CDRP for this connection. * The following cells must be valid: * * CDRP$L_CDT(R5) - Addr of CDT * CDRP$L_MSG_BUF(R5) - Addr of message * CDRP$L_RSPID(R5) - RSPID (to set RETFLG) * * complete_p - * This argument contains a pointer to the routine handling the final * completion. This call is a guaranteed stall. * * Return * * status - * Either SS$_NORMAL indicating the request was queued or * SS$_ILLCDTST indicating the connection was closed. *- */ #define sendcntmsgbuf( buf_size, pdt_p, cdrp_p, complete_p ) \ scs_std$sendmsg( buf_size, pdt_p, cdrp_p, complete_p ) /************** Fast Path Calls ************* * * Called by a SYSAP which is attempting Fast Path I/O. * *+ * FAST_SENDMSG_REQUEST - * * Request a Fast Message Send via Fast Path. This service requests * permission from the SCS and port layers to use Fast Path for a fast * message send. If approval is granted then return status will be * success and both SCS and the PM spinlock will be held. The SYSAP is * expected to perform some updates and promptly drop the SCS spinlock * in favor of the PM spinlock. If permission is denied then only the * SCS spinlock is held and traditional slow path is used for the I/O. * A resource bundle is returned on a success. * * Arguments * * svapte_boff_bcnt_p - * This is a pointer to a three element array in the same order and * size as CDRP$L_SVAPTE, CDRP$L_BOFF, and CDRP$L_BCNT and containing * similarly appropriate data for the buffer to be mapped. If it is * desired to map an IRP, then point to CDRP$L_SVAPTE. This is used * by the port driver to validate its ability to use fast path. * pdt_p - * This argument contains a pointer to the PDT associated with this connection. * cdrp_p - * This argument contains a pointer to the CDRP containing the mapping buffer * handle to be used. * * Return * * status - * If LBS, then SCS and the port can handle this request as a Fast Path * request and have made the appropriate setup. Else, this request * cannot be handled as Fast Path request and must be handled in the * standard way. If successful (LBS), then both the IPL$_SCS and PM * spinlocks are held. The SYSAP should complete any required IPL$_SCS * level activity quickly and return the IPL$_SCS spinlock. Otherwise, * the IPL$_SCS lock is still held. *- */ #define FAST_SENDMSG_REQUEST( svapte_boff_bcnt_p, pdt_p, cdrp_p ) \ scs_std$fast_sendmsg_request( svapte_boff_bcnt_p, pdt_p, cdrp_p ) /* *+ * FAST_SENDMSG_ASSOCIATE_PM - * * Associate RBUN SCS resources to current message. This service associates * the RBUN SCS resources to the current request. The RBUN was allocated on * a previous FAST_SENDMSG_REQUEST call. This service operates entirely under * port mainline (PM) spinlock synchronization and returns a pointer to a * message buffer for the SYSAP to create a message. * * Arguments * * svapte_boff_bcnt_p - * This is a pointer to a three element array in the same order and * size as CDRP$L_SVAPTE, CDRP$L_BOFF, and CDRP$L_BCNT and containing * similarly appropriate data for the buffer to be mapped. If it is * desired to map an IRP, then point to CDRP$L_SVAPTE. This is used * by the port driver to validate its ability to use fast path. * pdt_p - * This argument contains a pointer to the PDT associated with this connection. * cdrp_p - * This argument contains a pointer to the CDRP containing the mapping buffer * handle to be used. * * Return * * None. *- */ #define fast_sendmsg_associate_pm( svapte_boff_bcnt_p, pdt_p, cdrp_p ) \ scs_std$fast_sendmsg_ass_res_pm( svapte_boff_bcnt_p, pdt_p, cdrp_p ) /* *+ * FAST_SENDMSG_PM * * Send a message under a port mainline (PM) spinlock. This service * sends a SYSAP message within Fast Path and executes under a PM * spinlock instead of the SCS spinlock. The message can for example, * be a message to a MSCP Server to perform an I/O. On return, the PM * spinlock has been released so the SYSAP should not do anything on * return but terminate the current thread. * * Unlike traditional SENDMSG processing, a SYSAP can only use this * service if a response is required (ie. that there is a RSPID in the * CDRP). * * Arguments * * msg_buf_len - * This argument contains the length of the message being * transmitted. * cdt_p - * This argument is actually a user defined cell that will be restored * when the user is called at the return entry point. Typically it is * a pointer to a cdt. * pdt_p - * This argument contains a pointer to the PDT associated with this connection. * cdrp_p - * This argument contains a pointer to the CDRP containing the RBUN to be used. * complete_p - * This argument contains a pointer to the routine handling the request * completion. * * Return * * None. *- */ #define fast_sendmsg_pm( msg_buf_len, cdt_p, pdt_p, cdrp_p, complete_p ) \ scs_std$fast_sendmsg_pm( msg_buf_len, cdt_p, pdt_p, cdrp_p, complete_p ) /* *+ * FAST_RECVMSG_CHECK_RES - * * Check on RBUN existence and create one if none. The SYSAP calls this * service to check on SCS resources. Currently only the RBUN is of * concern here. If the RBUN doesn't exists and a RBUN was wanted then * a RBUN is created out of the current I/O's resources. The SCS spinlock * is held for this routine and if the RBUN cannot be created then use of * Fast Path is denied. * * Arguments * * cdt_p - * This argument contains a pointer to the CDT associated with this connection. * pdt_p - * This argument contains a pointer to the PDT associated with this connection. * cdrp_p - * This argument contains a pointer to the CDRP containing the RSPID, message * buffer, and buffer handle to be used. * complete_p - * This argument contains a pointer to the routine handling the request * completion. * * Return * * Status - * If LBS, then fast can be used; otherwise the standard path must * used. *- */ #define fast_recvmsg_chk_res( cdt_p, pdt_p, cdrp_p ) \ ( cdrp_p->cdrp$l_rbun ? SS$_NORMAL : \ ( cdrp_p->cdrp$l_scs_state & cdrp$v_rbun_wanted ? \ scs_std$fast_recvmsg_chk_res( cdt_p, pdt_p, cdrp_p ) : 0 ) ) /* *+ * REPO_CDRP - * * Repossess the CDRP. When a SYSAP sends a message, for which a * response is expected out over a port, control of the CDRP * transfers to SCS and the port driver. However a SYSAP may wish * to seize control of the CDRP before the response arrives, as a * result of a connection failure or cancel operation. For a SYSAP * to regain control of the CDRP before a response comes in for this * CDRP, this macro can be invoked on the CDRP. The macro must be * invoked before any modification or access to and SCS CDRP fields * occur. Only SYSAPs supporting Fast Path need use this macro. * * Arguments * * pdt_p - * This argument contains a pointer to the PDT for this request. * cdrp_p - * This argument contains a pointer to the CDRP that is to be retrieved. * * Return * * None. *- */ #define repo_cdrp( pdt_p, cdrp_p ) \ scs_std$repossess_cdrp( pdt_p, cdrp_p ); #ifdef __cplusplus } #endif #endif /* __SYSAP_MACROS_LOADED */