// Module SDA_ROUTINES.H "X-20" // // ************************************************************************* // * * // * © Copyright 2006 Hewlett-Packard Development Company, L.P. * // * * // * Confidential computer software. Valid license from HP and/or * // * its subsidiaries required for possession, use, or copying. * // * * // * Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * // * Computer Software Documentation, and Technical Data for Commercial * // * Items are licensed to the U.S. Government under vendor's standard * // * commercial license. * // * * // * Neither HP nor any of its subsidiaries shall be liable for technical * // * or editorial errors or omissions contained herein. The information * // * in this document is provided "as is" without warranty of any kind and * // * is subject to change without notice. The warranties for HP products * // * are set forth in the express limited warranty statements accompanying * // * such products. Nothing herein should be construed as constituting an * // * additional warranty. * // * * // ************************************************************************* // //++ // // FACILITY: // // VMS Executive (LIB_H) // // ABSTRACT: // // This module contains the C function prototypes for the SDA extension // routine entry points. // // AUTHOR: // // Christian Moser, January 1996 // // MODIFIED BY: // // X-20 RAB Richard A. Bishop 01-Feb-2006 // Add SDA$GET_FLAGS // // X-19 RAB Richard A. Bishop 04-Aug-2005 // Fix prototype for SDA$EXTEND_CBB_FFC // // X-18 RAB Richard A. Bishop 27-Jul-2005 // Add CBB routines // // X-17 RAB Richard A. Bishop 10-Feb-2005 // Add SDA$FID_TO_NAME // // X-16 RCL Rick Lord 26-Mar-2004 // Add #defines and prototype for SDA$DELETE_PREFIX // // X-15 RAB Richard A. Bishop 04-Feb-2003 // Allow for extensions wanting to get at the template // for IA64 instruction bundles. // // X-14 RAB Richard A. Bishop 16-Sep-2002 // SDA$GET_HEADER now has some additional (optional) // arguments for access to crash error log entry and/or // trap info data. // // X-13 RAB Richard A. Bishop 15-Dec-1999 // Add SDA$FAO // // X-12 RAB Richard A. Bishop 7-Dec-1998 // Add SDA$GET_DEVICE_NAME // // X-11 CMOS Christian Moser 30-JUN-1998 // Add new routines SET_PROCESS, SET_CPU and // GET_CURRENT_CPU. // // X-10 RAB Richard A. Bishop 15-May-1998 // Make lowercase and uppercase names equivalent. // // X-9 RAB Richard A. Bishop 26-Feb-1998 // Use "const char *" instead of "char *" where appropriate // // X-8 RAB Richard A. Bishop 3-Apr-1997 // Fix SDA$SYMBOL_VALUE definition/call. Now returns // uint64 instead of void. This to ensure users allow // 64-bits for the value. // // X-7 RAB Richard A. Bishop 21-Mar-1997 // Put back in X-5 now everything else is ready. Fix up // a couple more prototypes // // X-6 RAB Richard A. Bishop 21-Mar-1997 // Back out X-5 - too much fallout from the addition of // SDAMSG.MSG to LIB until I can get more ducks lined up. // // X-5 RAB Richard A. Bishop 20-Mar-1997 // Add SDAMSG.MSG, clean up loose ends (eg many routines // should return void instead of int) // // X-4 CMOS Christian Moser 13-MAR-1997 // Rename SDA$HANDLER to SDA$COND_HANDLER and define the vector // table address in this module, so the user doesn't have to // bother with this in the source module. // Also fix a bug to include the SDA_xxx include files from // SYS$LIB_C.TLB instead looking for them in the current // directory. // // X-3 CMOS Christian Moser 13-JAN-1997 // Uppercase CHF$SIGNAL_ARRAY and CHF$MECH_ARRAY for // __NEW_STARLET to match the CHFDEF declaration for Raven. // // X-2 CMOS Christian Moser 3-DEC-1996 // Add proper routine prototype declarations and more // comments to make it self explanatory. Add all // C friendly SDA extension routines and remove unfriendly // ones. All this in light of the full support for SDA // extensions. // // X-1 RAB Richard A. Bishop 1-Apr-1996 // Moved to LIB_H. Several changes in the light of // developing the PTHREAD$SDA extension. // // Prior audit trail is from CLUE$SDA...... // // X-1 CMOS Christian Moser 1-FEB-1996 // Initial version. // #ifndef __SDA_ROUTINES_LOADED #define __SDA_ROUTINES_LOADED 1 #pragma __nostandard // This file uses non-ANSI-Standard features #pragma __member_alignment __save #pragma __nomember_alignment #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 __unknown_params #define __optional_params ... // Common header files #include chfdef #include cpudef #include dmpdef #include far_pointers #include ints #include pcbdef #include sda_ciodef #include sda_flagsdef #include sda_msgdef #include sda_optdef #define sda$vector_table SDA$VECTOR_TABLE #define SDA$VECTOR_TABLE SDA$EXTEND_VECTOR_TABLE_ADDR #define sda$extend_vector_table_addr SDA$EXTEND_VECTOR_TABLE_ADDR extern int * sda$vector_table; /////////////////////////////////////////////////////////////////////////////// // // This routine transfers an area from the memory in the dump file to // the callers return buffer. It performs the necessary address // translation to locate the data in the dump file. // // Differences between GETMEM, TRYMEM, and REQMEM are as follows: // // TRYMEM is called from both GETMEM and REQMEM as the lower level // routine that actually does the work. TRYMEM returns success/failure // status in R0, but does not signal any errors. // // GETMEM signals a warning when any error status is returned from TRYMEM. // Signalling a warning will print out a warning message, but does not // abort the SDA command in progress. // // REQMEM signals an error when any error status is returned from TRYMEM. // Signalling an error will print out an error message, abort the SDA // command in progress and return us to the "SDA>" prompt. It should be // noted that if the error occurs before we get to the first prompt, an // error will cause the SDA image to exit. // // sda$getmem start, dest, length, [physical] // sda$trymem start, dest, length, [physical] // sda$reqmem start, dest, length, [physical] // // start = starting virtual address in dump // dest = return buffer address // length = length of transfer // physical = virtual (=0) or physical (=1) address, default = 0 // #define sda$getmem SDA$GETMEM #define SDA$GETMEM SDA$EXTEND_GETMEM64 #define sda$extend_getmem64 SDA$EXTEND_GETMEM64 int sda$extend_getmem64 ( VOID_PQ start, void *dest, int length, __optional_params ); #define sda$reqmem SDA$REQMEM #define SDA$REQMEM SDA$EXTEND_REQMEM64 #define sda$extend_reqmem64 SDA$EXTEND_REQMEM64 int sda$extend_reqmem64 ( VOID_PQ start, void *dest, int length, __optional_params ); #define sda$trymem SDA$TRYMEM #define SDA$TRYMEM SDA$EXTEND_TRYMEM64 #define sda$extend_trymem64 SDA$EXTEND_TRYMEM64 int sda$extend_trymem64 ( VOID_PQ start, void *dest, int length, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Adds a symbol to SDA's local symbol table. // // sda$add_symbol symbol_name, symbol_value // // symbol_name = address of symbol name string (zero-terminated) // symbol_value = symbol value // #define sda$add_symbol SDA$ADD_SYMBOL #define SDA$ADD_SYMBOL SDA$EXTEND_ADD_SYMBOL_CC #define sda$extend_add_symbol_cc SDA$EXTEND_ADD_SYMBOL_CC void sda$extend_add_symbol_cc ( const char *symbol_name, uint64 symbol_value ); /////////////////////////////////////////////////////////////////////////////// // // Convert a value to a symbol name and offset. // This routine accepts a value and returns a string which contains a // symbol and offset corresponding to that value. // First the value is checked in the value order tree. If no symbol can // be found, the value is then checked to see if it falls within one of // the loaded or activated images. // // sda$symbolize value, symbol_buf, symbol_len // // value = value to be translated // symbol_buf = address of buffer to return string into // symbol_len = maximum length of string buffer // // Status returned is either: // SS$_NORMAL - successful completion // SS$_BUFFEROVF - buffer too small, string truncated // SS$_NOTRAN - no symbolization for this value (zero string returned) // #define sda$symbolize SDA$SYMBOLIZE #define SDA$SYMBOLIZE SDA$EXTEND_SYMBOLIZE_CC #define sda$extend_symbolize_cc SDA$EXTEND_SYMBOLIZE_CC int sda$extend_symbolize_cc ( uint64 value, char *symbol_buf, uint32 symbol_len ); /////////////////////////////////////////////////////////////////////////////// // // Get the value of a specified symbol. // // sda$symbol_value symb_name, symb_value // // symb_name = zero-terminated string containing symbol name // symb_value = address to receive symbol value // #define sda$symbol_value SDA$SYMBOL_VALUE #define SDA$SYMBOL_VALUE SDA$EXTEND_SYMBOL_VALUE_CC #define sda$extend_symbol_value_cc SDA$EXTEND_SYMBOL_VALUE_CC int sda$extend_symbol_value_cc ( const char *symb_name, uint64 *symb_value ); /////////////////////////////////////////////////////////////////////////////// // // This routine will cause a new page to be written and will output the // page heading and current sub-heading. // // sda$new_page // #define sda$new_page SDA$NEW_PAGE #define SDA$NEW_PAGE SDA$EXTEND_NEW_PAGE #define sda$extend_new_page SDA$EXTEND_NEW_PAGE void sda$extend_new_page (); /////////////////////////////////////////////////////////////////////////////// // // This routine will output a specified number of blank lines. // // sda$skip_lines lines // // lines = number of lines to skip // #define sda$skip_lines SDA$SKIP_LINES #define SDA$SKIP_LINES SDA$EXTEND_SKIP_LINES #define sda$extend_skip_lines SDA$EXTEND_SKIP_LINES void sda$extend_skip_lines ( uint32 lines ); /////////////////////////////////////////////////////////////////////////////// // // This routine will check and make sure that the number of lines // specified will fit on the current page, otherwise it will issue a // page break. // // sda$ensure lines // // lines = number of lines to fit on page // #define sda$ensure SDA$ENSURE #define SDA$ENSURE SDA$EXTEND_ENSURE #define sda$extend_ensure SDA$EXTEND_ENSURE void sda$extend_ensure ( uint32 lines ); /////////////////////////////////////////////////////////////////////////////// // // Format a new page sub-heading. // // sda$format_heading ctrstr, [prmlst, ...] // // ctrstr = address of control string descriptor // prmlst = address of quadword FAO parameters // #define sda$format_heading SDA$FORMAT_HEADING #define SDA$FORMAT_HEADING SDA$EXTEND_FORMAT_SUBHEAD_CC #define sda$extend_format_subhead_cc SDA$EXTEND_FORMAT_SUBHEAD_CC void sda$extend_format_subhead_cc ( const char *ctrstr, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Set the current heading routine to be called after each page break. // // sda$set_heading_routine heading_rtn // // heading_rtn = address of routine to be called after each new page // #define sda$set_heading_routine SDA$SET_HEADING_ROUTINE #define SDA$SET_HEADING_ROUTINE SDA$EXTEND_SET_HEADING_ROUTINE #define sda$extend_set_heading_routine SDA$EXTEND_SET_HEADING_ROUTINE void sda$extend_set_heading_routine ( void (*heading_rtn) () ); /////////////////////////////////////////////////////////////////////////////// // // Format and print a single line. This will normally be screen output, // unless the SDA command SET OUTPUT or SET LOG is used to redirect the // output to a file. // // sda$print ctrstr, [prmlst, ...] // // ctrstr = address of a zero-terminated control string // prmlst = list of FAO parameters // #define sda$print SDA$PRINT #define SDA$PRINT SDA$EXTEND_PRINT_CC #define sda$extend_print_cc SDA$EXTEND_PRINT_CC int sda$extend_print_cc ( const char *ctrstr, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Format and type a single line to SYS$OUTPUT // // sda$type ctrstr, [prmlst, ...] // // ctrstr = address of a zero-terminated control string // prmlst = list of FAO parameters // #define sda$type SDA$TYPE #define SDA$TYPE SDA$EXTEND_TYPE_CC #define sda$extend_type_cc SDA$EXTEND_TYPE_CC int sda$extend_type_cc ( const char *ctrstr, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Format and return the resultant string // // sda$fao ctrstr, bufptr, buflen, [prmlst, ...] // // ctrstr = address of a zero-terminated control string // bufptr = address of buffer to receive the formatted string // buflen = the length of the output buffer // prmlst = list of FAO parameters // // The returned value of the routine is a pointer to the end of the // used portion of the buffer (i.e. a pointer to its trailing zero) // #define sda$fao SDA$FAO #define SDA$FAO SDA$EXTEND_FAO_CC #define sda$extend_fao_cc SDA$EXTEND_FAO_CC char * sda$extend_fao_cc ( const char *ctrstr, const char *bufptr, const int buflen, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Set the current pages line counter. // // sda$set_line_count line_count // // line_count = the number of lines printed on current page // #define sda$set_line_count SDA$SET_LINE_COUNT #define SDA$SET_LINE_COUNT SDA$EXTEND_SET_LINE_COUNT #define sda$extend_set_line_count SDA$EXTEND_SET_LINE_COUNT void sda$extend_set_line_count ( uint32 line_count ); /////////////////////////////////////////////////////////////////////////////// // // Get the number of lines currently printed on the current page. // // sda$get_line_count line_count // // line_count = the number of lines printed on current page // #define sda$get_line_count SDA$GET_LINE_COUNT #define SDA$GET_LINE_COUNT SDA$EXTEND_GET_LINE_COUNT #define sda$extend_get_line_count SDA$EXTEND_GET_LINE_COUNT void sda$extend_get_line_count ( uint32 *line_count ); /////////////////////////////////////////////////////////////////////////////// // // Allocate dynamic memory. // // sda$allocate size, ptr_block // // size = size of block to allocate (in bytes) // ptr_block = address of longword to receive address of block // #define sda$allocate SDA$ALLOCATE #define SDA$ALLOCATE SDA$EXTEND_ALLOCATE #define sda$extend_allocate SDA$EXTEND_ALLOCATE void sda$extend_allocate ( uint32 size, void **ptr_block ); /////////////////////////////////////////////////////////////////////////////// // // Deallocate and free dynamic memory. // // sda$deallocate ptr_block, size // // ptr_block = starting address of block to be freed // size = size of block to deallocate (in bytes) // #define sda$deallocate SDA$DEALLOCATE #define SDA$DEALLOCATE SDA$EXTEND_DEALLOCATE #define sda$extend_deallocate SDA$EXTEND_DEALLOCATE void sda$extend_deallocate ( void *ptr_block, uint32 size ); /////////////////////////////////////////////////////////////////////////////// // // Stores an address value into the current memory address. The // predefined SDA symbol "." points to the current location. // // sda$set_address address // // address = address value to store in current memory location // #define sda$set_address SDA$SET_ADDRESS #define SDA$SET_ADDRESS SDA$EXTEND_SET_ADDRESS64 #define sda$extend_set_address64 SDA$EXTEND_SET_ADDRESS64 void sda$extend_set_address64 ( VOID_PQ address ); /////////////////////////////////////////////////////////////////////////////// // // Gets the address value of the current memory location. // // sda$get_address address // // address = pointer on where to store the current memory address // #define sda$get_address SDA$GET_ADDRESS #define SDA$GET_ADDRESS SDA$EXTEND_GET_ADDRESS64 #define sda$extend_get_address64 SDA$EXTEND_GET_ADDRESS64 void sda$extend_get_address64 ( VOID_PQ *address ); /////////////////////////////////////////////////////////////////////////////// // // Validate queue structures. This routine can be used to validate the // integrity of double-linked, single-linked or self-relative queues // either with longword or quadword links. // If you specify the option SDA_OPT$M_LISTQUEUE the queue elements are // displayed for debugging purposes. Otherwise a one-line summary will // tell you how many elements were found and if the queue is intact or // not. // // sda$validate_queue queue_header [,options] // // queue_header = address to start search from // options = flags to indicate type of queue // none - defaults to double-linked longword queue // SDA_OPT$M_QUEUE_SELF - self-relative queue // SDA_OPT$M_QUEUE_QUADLINK - quadword queue // SDA_OPT$M_QUEUE_SINGLINK - single-linked queue // SDA_OPT$M_QUEUE_LISTQUEUE - display queue elements for debugging // #define sda$validate_queue SDA$VALIDATE_QUEUE #define SDA$VALIDATE_QUEUE SDA$EXTEND_VALIDATE_QUEUE64 #define sda$extend_validate_queue64 SDA$EXTEND_VALIDATE_QUEUE64 void sda$extend_validate_queue64 ( VOID_PQ queue_header, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Read symbols from a given file to add symbol definitions to the // working symbol table by reading GST entries. This is normal a symbol // file (.STB) or an image (.EXE) // // sda$read_symfile filespec, options [,relocate_base, symvect_va, // symvect_size, loaded_image_info] // // filespec = address of asciz file specification to read // options = indicate type of symbol file and logging flags // SDA_OPT$M_READ_FORCE - read/force // SDA_OPT$M_READ_IMAGE - read/image // SDA_OPT$M_READ_SYMVA - read/symva // SDA_OPT$M_READ_RELO - read/relo // SDA_OPT$M_READ_EXEC - read/exec [] // SDA_OPT$M_READ_NOLOG - /nolog, suppress # of symbols read // SDA_OPT$M_READ_FILESPEC - or given // SDA_OPT$M_READ_NOSIGNAL - return status, don't signal errors // relocate_base = base address for symbols (non-sliced symbols) // symvect_va = symb vector addr (symbols are offsets into sym vector) // symvect_size = size of symbol vector // loaded_img_info = addr of $LDRIMG data structure with execlet info // #define sda$read_symfile SDA$READ_SYMFILE #define SDA$READ_SYMFILE SDA$EXTEND_READ_SYMFILE_CC #define sda$extend_read_symfile_cc SDA$EXTEND_READ_SYMFILE_CC int sda$extend_read_symfile_cc ( const char *filespec, uint32 options, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // This routine displays the formatted content of a data structure which // begins at the address specified. If no symbol prefix is passed, then // SDA tries to find the symbols associated with the block type specified // in the block-type byte of the data structure. // // sda$format struct_addr [,options, struct_prefix] // // struct_addr = address of the data structure to be formatted // options = flags // none - use structure type from xxx$B_TYPE // SDA_OPT$M_FORMAT_TYPE - to be set if structure prefix passed // SDA_OPT$M_FORMAT_PHYSICAL - marks physical address instead of // virtual address // struct_prefix = descriptor of structure prefix string // #define sda$format SDA$FORMAT #define SDA$FORMAT SDA$EXTEND_FORMAT64 #define sda$extend_format64 SDA$EXTEND_FORMAT64 void sda$extend_format64 ( VOID_PQ struct_addr, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Display online help. // // sda$display_help library, topic // // library = address of library filespec // topic = address of of topic name // #define sda$display_help SDA$DISPLAY_HELP #define sda$display_help( library, topic ) \ { \ $DESCRIPTOR ( library_desc, library ); \ $DESCRIPTOR ( topic_desc, topic ); \ sda$extend_display_help ( &library_desc, \ &topic_desc ); \ } #define sda$extend_display_help SDA$EXTEND_DISPLAY_HELP void sda$extend_display_help ( struct dsc$descriptor_s *library_desc, struct dsc$descriptor_s *topic_desc ); /////////////////////////////////////////////////////////////////////////////// // // Parse and execute a SDA command line. Not every SDA command has a // callable extension interface. For example, to change the process // context from within SDA you would pass the command string // 'SET PROC/IND=xx' to this parse command routine. Abbreviations are // allowed. // // sda$parse_command cmd_line [,options] // // cmd_line = address of a valid SDA command line (zero-terminated) // options = flags // none - defaults to 'do not save this command' // SDA_OPT$K_PARSE_DONT_SAVE - means 'do not save this command' // SDA_OPT$K_PARSE_SAVE - indicates to 'save this command' // (can be recalled with KP0) // #define sda$parse_command SDA$PARSE_COMMAND #define SDA$PARSE_COMMAND SDA$EXTEND_PARSE_COMMAND_CC #define sda$extend_parse_command_cc SDA$EXTEND_PARSE_COMMAND_CC void sda$extend_parse_command_cc ( const char *cmd_line, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Reads input commands. The command entered will be returned as a zero- // terminated string. No input, by simply pressing or // will return a null string. // // sda$get_input prompt, buffer, buflen // // prompt = address of prompt string (asciz) // buffer = address of buffer to store command // buflen = maximum length of buffer // // Status returned is either: // SS$_NORMAL - successful completion // RMS$_EOF - user hit // #define sda$get_input SDA$GET_INPUT #define SDA$GET_INPUT SDA$EXTEND_GET_INPUT_CC #define sda$extend_get_input_cc SDA$EXTEND_GET_INPUT_CC int sda$extend_get_input_cc ( const char *prompt, char *buffer, uint32 buflen ); /////////////////////////////////////////////////////////////////////////////// // // Given a virtual address, this routine finds in which image it falls // and returns the image information and offset. The loaded image list // is traversed first to find this information. If it is not found, then // the process activated image list is traversed. If still no success, // then the resident installed images are checked. // // The status returned indicate the type of image if a match was found. // SDA_CIO$V_VALID - set if image offset was found // SDA_CIO$V_PROCESS - set if image was an activated image // SDA_CIO$V_SLICED - set if the image is sliced // SDA_CIO$V_COMPRESSED - set if activated image containing // compressed data sections // SDA_CIO$V_ISD_INDEX - index into ISD_LABELS table (only // for LDRIMG execlets) // // SDA_CIO$V_xxx flags set: img_info type: subimg_info type: // valid LDRIMG n/a // valid && sliced LDRIMG ISD_OVERLAY // valid && process IMCB n/a // valid && process && sliced IMCB KFERES_SECTION // // // sda$get_image_offset va, img_info, subimg_info, offset // // va = virtual address to look for // img_info = pointer to return addr of LDRIMG or IMCB block // subimg_info = pointer to return addr of ISD_OVERLAY or KFERES // offset = pointer to address to return offset from image // #define sda$get_image_offset SDA$GET_IMAGE_OFFSET #define SDA$GET_IMAGE_OFFSET SDA$EXTEND_GET_IMAGE_OFFSET #define sda$extend_get_image_offset SDA$EXTEND_GET_IMAGE_OFFSET COMP_IMG_OFF sda$extend_get_image_offset ( VOID_PQ va, VOID_PQ img_info, VOID_PQ subimg_info, VOID_PQ offset ); /////////////////////////////////////////////////////////////////////////////// // // Gets the string representing the bugcheck code passed as the argument. // The bugcheck message string is passed in the buffer (represented as // a pointer and length) in ASCIZ format. // // sda$get_bugcheck_msg bugcheck_code, buffer_ptr, buffer_size // // bugcheck_code = the bugcheck code to look up // buffer_ptr = address of buffer to save bugcheck message // buffer_size = size of buffer to put message in // #define sda$get_bugcheck_msg SDA$GET_BUGCHECK_MSG #define SDA$GET_BUGCHECK_MSG SDA$EXTEND_GET_BUGMSG_CC #define sda$extend_get_bugmsg_cc SDA$EXTEND_GET_BUGMSG_CC void sda$extend_get_bugmsg_cc ( uint32 bugcheck_code, char *buffer_ptr, uint32 buffer_size ); /////////////////////////////////////////////////////////////////////////////// // // Gets the string representing the current HW name and puts it in the // buffer passed as the argument (in ASCIZ format). // // sda$get_hw_name buffer_ptr, buffer_len // // buffer_ptr = address of buffer to save HW name // buffer_len = length of buffer to receive HW name // #define sda$get_hw_name SDA$GET_HW_NAME #define SDA$GET_HW_NAME SDA$EXTEND_GET_HW_NAME_CC #define sda$extend_get_hw_name_cc SDA$EXTEND_GET_HW_NAME_CC void sda$extend_get_hw_name_cc ( char *buffer_ptr, uint32 buffer_len ); /////////////////////////////////////////////////////////////////////////////// // // Translate block type/subtype to name // // sda$get_block_name block_type, block_subtype, buffer_ptr, buffer_len // // block_type = block type (usually extracted from xxx$b_type field) // block_subtype = block subtype (ignored if the block type has no subtypes) // buffer_ptr = address of buffer to save block name // buffer_len = length of buffer to receive block name // #define sda$get_block_name SDA$GET_BLOCK_NAME #define SDA$GET_BLOCK_NAME SDA$EXTEND_GET_BLOCK_NAME #define sda$extend_get_block_name SDA$EXTEND_GET_BLOCK_NAME void sda$extend_get_block_name ( uint32 block_type, uint32 block_subtype, char *buffer_ptr, uint32 buffer_len ); /////////////////////////////////////////////////////////////////////////////// // // Get the PCB address of the "SDA current process" currently selected. // // sda$get_current_pcb pcbadr // // pcbadr = address of to retrieve a pointer to a PCB address // #define sda$get_current_pcb SDA$GET_CURRENT_PCB #define SDA$GET_CURRENT_PCB SDA$EXTEND_GET_CURRENT_PCB #define sda$extend_get_current_pcb SDA$EXTEND_GET_CURRENT_PCB void sda$extend_get_current_pcb ( PCB **pcbadr ); /////////////////////////////////////////////////////////////////////////////// // // Returns pointers to the dumpfile header and the errorlog buffer // together with the size of those data structures. // // sda$get_header dmp_header, dmp_header_size, // errlog_buf, errlog_buf_size, // crasherl_buf, crasherl_buf_size, // trapinfo_buf, trapinfo_buf_size // // dmp_header = address in which to store the local copy address // of the dumpfile header // dmp_header_size = address to return size of dumpfile header // errlog_buf = address in which to store the local copy address // of the errorlog buffer // errlog_buf_size = address to return size of errorlog buffer // // (remaining arguments are optional) // // crasherl_buf = address in which to store the local copy address // of the crash error log entry // crasherl_buf_size = address to return size of crash error log entry // trapinfo_buf = address in which to store the local copy address // of the trapinfo data // trapinfo_buf_size = address to return size of trapinfo data // #define sda$get_header SDA$GET_HEADER #define SDA$GET_HEADER SDA$EXTEND_GET_HEADER #define sda$extend_get_header SDA$EXTEND_GET_HEADER void sda$extend_get_header ( DMP **dmp_header, uint32 *dmp_header_size, void **errlog_buf, uint32 *errlog_buf_size, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Translates one Alpha machine instruction or IA64 slot into the assembler // string equivalent. Alpha instructions are always 4 bytes long. For IA64 // the entire 128-bit bundle must be available, whose base address is found // by clearing the low 3 bits of the address referenced by the istream_ptr // argument. The instruction stream must first be read into local memory and // then a pointer to the instruction stream is passed to the routine. For // every successful translated instruction, that pointer is automatically // updated to point to the next instruction or slot. // The output assembler string is zero-terminated and in case of a failure // a null string is returned. Likewise, if IA64 and the output template // string argument is provided, it is zero-terminated and in case of a // failure a null string is returned. // // sda$instruction_decode istream_ptr, buffer, buflen [, template, templen] // // istream_ptr = address of the pointer which points to the i-stream // buffer = address of a string buffer into which to store the // output assembler string // buflen = maximum size of the string buffer // template = address of a string buffer into which to store the // output template string (IA64 only, optional) // templen = maximum size of the template buffer (IA64 only, // optional) // // Status returned is either: // SS$_NORMAL - successful completion // SS$_BADPARAM - any of the following failures (output buffer too // small, invalid register, invalid opcode class/format, // could not translate instruction) // #define sda$instruction_decode SDA$INSTRUCTION_DECODE #define SDA$INSTRUCTION_DECODE SDA$EXTEND_INSTRUCTION_DECODE #define sda$extend_instruction_decode SDA$EXTEND_INSTRUCTION_DECODE int sda$extend_instruction_decode ( void *istream_ptr, char *buffer, uint32 buflen, __optional_params ); /////////////////////////////////////////////////////////////////////////////// // // Get the CPU database address of the "SDA current CPU" currently // selected. // // sda$get_current_cpu cpudb // // cpudb = address of to retrieve a pointer to a CPUDB address // #define sda$get_current_cpu SDA$GET_CURRENT_CPU #define SDA$GET_CURRENT_CPU SDA$EXTEND_GET_CURRENT_CPU_CC #define sda$extend_get_current_cpu_cc SDA$EXTEND_GET_CURRENT_CPU_CC void sda$extend_get_current_cpu_cc ( CPU **cpudb ); /////////////////////////////////////////////////////////////////////////////// // // Set a new SDA process context. // // sda$set_process proc_name, proc_index, proc_addr // // proc_name = zero-terminated string containing process name // proc_index = process index // proc_addr = PCB address // // Note: the parameters are mutually exclusive. // #define sda$set_process SDA$SET_PROCESS #define SDA$SET_PROCESS SDA$EXTEND_SET_PROCESS_CC #define sda$extend_set_process_cc SDA$EXTEND_SET_PROCESS_CC int sda$extend_set_process_cc ( const char *proc_name, int proc_index, int proc_addr ); /////////////////////////////////////////////////////////////////////////////// // // Set a new SDA CPU context. // // sda$set_cpu cpu_id // // cpu_id = CPU Id // #define sda$set_cpu SDA$SET_CPU #define SDA$SET_CPU SDA$EXTEND_SET_CPU_CC #define sda$extend_set_cpu_cc SDA$EXTEND_SET_CPU_CC int sda$extend_set_cpu_cc ( int cpu_id ); /////////////////////////////////////////////////////////////////////////////// // // Convert a UCB address to a device name // // sda$get_device_name ucb_addr, name_buf, name_len // // ucb_addr = system address of the UCB // name_buf = address of buffer to return device name into // name_len = maximum length of device name buffer // // Status returned is either: // SS$_NORMAL - successful completion // SS$_BUFFEROVF - buffer too small, string truncated // SS$_NOTRAN - no symbolization for this value (zero string returned) // #define sda$get_device_name SDA$GET_DEVICE_NAME #define SDA$GET_DEVICE_NAME SDA$EXTEND_GET_DEVICE_NAME #define sda$extend_get_device_name SDA$EXTEND_GET_DEVICE_NAME int sda$extend_get_device_name ( VOID_PQ ucb_addr, char *name_buf, int name_len); /////////////////////////////////////////////////////////////////////////////// // // Condition handler which can be established using the following statement: // // lib$establish ( sda$cond_handler ); // #define sda$cond_handler SDA$COND_HANDLER #define SDA$COND_HANDLER SDA$EXTEND_COND_HANDLER #define sda$extend_cond_handler SDA$EXTEND_COND_HANDLER #ifdef __NEW_STARLET int sda$extend_cond_handler ( CHF$SIGNAL_ARRAY *sigarr, CHF$MECH_ARRAY *mecharr ); #else int sda$extend_cond_handler ( struct chf$signal_array *sigarr, struct chf$mech_array *mecharr ); #endif /////////////////////////////////////////////////////////////////////////////// // // Displays a list of image activated images together with their virtual // address range for debugging purposes. // // sda$dbg_image_info // #define sda$dbg_image_info SDA$DBG_IMAGE_INFO #define SDA$DBG_IMAGE_INFO SDA$EXTEND_DBG_IMAGE_INFO #define sda$extend_dbg_image_info SDA$EXTEND_DBG_IMAGE_INFO void sda$extend_dbg_image_info (); #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 /////////////////////////////////////////////////////////////////////////////// // // Delete all symbols with a given prefix from SDA's local symbol tables // // sda$delete_prefix prefix // // prefix = address of prefix string (zero-terminated) // #define sda$delete_prefix SDA$DELETE_PREFIX #define SDA$DELETE_PREFIX SDA$EXTEND_DELETE_PREFIX_CC #define sda$extend_delete_prefix_cc SDA$EXTEND_DELETE_PREFIX_CC void sda$extend_delete_prefix_cc ( const char *prefix); /////////////////////////////////////////////////////////////////////////////// // // Translate File ID to file name, using LIB$FID_TO_NAME if analyzing // running system, or using collected file data (if present) if // analyzing a system dump // // sda$fid_to_name devptr, fidptr, bufptr, buflen // // devptr = address of device name string (ASCIZ) in ALLDEVNAM // format (leading underscore and trailing colon // are ignored) // fidptr = address of 3-word FID // bufptr = address of buffer to receive the ASCIZ filename // buflen = the length of the output buffer // // Status returned is either: // SS$_NORMAL - successful completion // SDA$_NOCOLLECT - no collection available (for entire system, this // disk, or just this file) // other - as returned by LIB$FID_TO_NAME // #define sda$fid_to_name SDA$FID_TO_NAME #define SDA$FID_TO_NAME SDA$EXTEND_FID_TO_NAME #define sda$extend_fid_to_name SDA$EXTEND_FID_TO_NAME int sda$extend_fid_to_name ( char *devptr, unsigned short *fidptr, char *bufptr, int buflen ); /////////////////////////////////////////////////////////////////////////////// // // CBB handling routines: // SDA$CBB_INIT // SDA$CBB_TEST_BIT // SDA$CBB_CLEAR_BIT // SDA$CBB_SET_BIT // SDA$CBB_COPY // SDA$CBB_BOOLEAN_OPER // SDA$CBB_FFC // SDA$CBB_FFS // /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_init cbb // // cbb = Address of CBB (of length CBB$K_STATIC_BLOCK) // // Status returned: // None // #define sda$cbb_init SDA$CBB_INIT #define SDA$CBB_INIT SDA$EXTEND_CBB_INIT #define sda$extend_cbb_init SDA$EXTEND_CBB_INIT void sda$extend_cbb_init (CBB_PQ cbb); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_test_bit cbb, bit // // cbb = Address of local copy of CBB // bit = bit number to be tested (zero-based) // // Status returned is one of: // SS$_WASSET Bit was set // SS$_WASCLR Bit was clear // SS$_BADPARAM Bit number outside size of CBB // #define sda$cbb_test_bit SDA$CBB_TEST_BIT #define SDA$CBB_TEST_BIT SDA$EXTEND_CBB_TEST_BIT #define sda$extend_cbb_test_bit SDA$EXTEND_CBB_TEST_BIT int sda$extend_cbb_test_bit (CBB_PQ cbb, int bit); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_clear_bit cbb, bit // // cbb = Address of local copy of CBB // bit = bit number to be cleared (zero-based) // If bit = -1, all bits are cleared // // Status returned is one of: // SS$_NORMAL Success // SS$_BADPARAM Bit number outside size of CBB // #define sda$cbb_clear_bit SDA$CBB_CLEAR_BIT #define SDA$CBB_CLEAR_BIT SDA$EXTEND_CBB_CLEAR_BIT #define sda$extend_cbb_clear_bit SDA$EXTEND_CBB_CLEAR_BIT int sda$extend_cbb_clear_bit (CBB_PQ cbb, int bit); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_set_bit cbb, bit // // cbb = Address of local copy of CBB // bit = bit number to be set (zero-based) // If bit = -1, all bits are set // // Status returned is one of: // SS$_NORMAL Success // SS$_BADPARAM Bit number outside size of CBB // #define sda$cbb_set_bit SDA$CBB_SET_BIT #define SDA$CBB_SET_BIT SDA$EXTEND_CBB_SET_BIT #define sda$extend_cbb_set_bit SDA$EXTEND_CBB_SET_BIT int sda$extend_cbb_set_bit (CBB_PQ cbb, int bit); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_copy input_cbb, output_cbb // // input_cbb = Address of local copy of CBB to be copied // output_cbb = Address of target of copy // // Status returned: // None // #define sda$cbb_copy SDA$CBB_COPY #define SDA$CBB_COPY SDA$EXTEND_CBB_COPY #define sda$extend_cbb_copy SDA$EXTEND_CBB_COPY void sda$extend_cbb_copy (CBB_PQ input_cbb, CBB_PQ output_cbb); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_boolean_oper input_cbb, output_cbb // // input_cbb = Address of local copy of first CBB in operation // output_cbb = Address of local copy of second CBB (target) // operation = One of CBB$C_OR or CBB$C_BIC. Others to follow // if needed // // Status returned: // 0 No bits set in resulting bitmask // 1 At least one bit set in resulting bitmask // #define sda$cbb_boolean_oper SDA$CBB_BOOLEAN_OPER #define SDA$CBB_BOOLEAN_OPER SDA$EXTEND_CBB_BOOLEAN_OPER #define sda$extend_cbb_boolean_oper SDA$EXTEND_CBB_BOOLEAN_OPER int sda$extend_cbb_boolean_oper (CBB_PQ input_cbb, CBB_PQ output_cbb, int operation); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_ffc cbb, start_bit // // cbb = Address of local copy of CBB to be searched // start_bit = First bit in CBB for search // // Status returned: // n < valid bits Bit n is set // n >= valid bits No bits are set // #define sda$cbb_ffc SDA$CBB_FFC #define SDA$CBB_FFC SDA$EXTEND_CBB_FFC #define sda$extend_cbb_ffc SDA$EXTEND_CBB_FFC int sda$extend_cbb_ffc (CBB_PQ cbb, int start_bit); /////////////////////////////////////////////////////////////////////////////// // // sda$cbb_ffs cbb, start_bit // // cbb = Address of local copy of CBB to be searched // start_bit = First bit in CBB for search // // Status returned: // n < valid bits Bit n is set // n >= valid bits No bits are set // #define sda$cbb_ffs SDA$CBB_FFS #define SDA$CBB_FFS SDA$EXTEND_CBB_FFS #define sda$extend_cbb_ffs SDA$EXTEND_CBB_FFS int sda$extend_cbb_ffs (CBB_PQ cbb, int start_bit); /////////////////////////////////////////////////////////////////////////////// // // Obtain environment flags that allow an extension to know what is // being analyzed - system vs dump, type of dump, platform, override // mode, etc. // // sda$get_flags flagaddr // // flagaddr = address of location to receive flags // // Status returned: // None // #define sda$get_flags SDA$GET_FLAGS #define SDA$GET_FLAGS SDA$EXTEND_GET_FLAGS #define sda$extend_get_flags SDA$EXTEND_GET_FLAGS void sda$extend_get_flags (SDA_FLAGS *flagaddr); #endif // __SDA_ROUTINES_LOADED