/* module IA64_PAL_ROUTINES.H "X-11" * ************************************************************************* * * * Copyright 2002 Compaq Computer Corporation * * * * COMPAQ Registered in U.S. Patent and Trademark Office. * * * * Confidential computer software. Valid license from Compaq or * * authorized sublicensor 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. * * * * Compaq shall not be liable for technical or editorial errors or * * omissions contained herein. The information in this document is * * subject to change without notice. * * * ************************************************************************* *++ * * FACILITY: * * VMS Executive (LIB_H) * * ABSTRACT: * * This module contains the C function prototypes for the IA64 PAL * routines that begin with the IA64_PAL$ prefix. * * NOTE: * * The conventions used in these function prototypes are: * * 1. Case * This header file supports invoking the routines by either using all * lowercase or all uppercase names for the system routines. Either * naming convention works even in the presence of the /NAME=AS_IS * compiler switch. * * 2. Integer size * The generic "int" type is used where it doesn't matter whether the * integer is 32 or 64 bits wide. Thus "int" is the returned value of * most functions and is the type for most integers passed by value. * However, an unambiguous integer type, e.g. int32, is used for any * integer that is passed by reference. Also, int64 is used for any * integer that is expected to be 64 bits wide even if it is passed by * value. * * 3. Types * The function prototypes use the types defined in [SYSLIB]SYS$LIB_C.TLB. * The definitions of all types used are included below. * * 4. Parameter names * Parameter names are used in the prototypes. Although they are ignored * by the compiler they do provide useful documentation. For example: * * void ioc_std$reqcom (int iost1, int iost2, UCB *ucb); * * is used instead of the functionally equivalent: * * void ioc_std$reqcom (int, int, UCB *); * * 5. Parameters passed by reference * The parameter name includes the "_p" suffix if the parameter is passed * by reference unless the parameter type implies that it is always passed * by reference. For example, there is no "_p" suffix in: * * UCB *ucb; * int32 iosb[2]; * * since structures and arrays are always passed by reference. However: * * int32 *outlen_p; * UCB **new_ucb_p; * * include the suffix to denote that outlen_p is a pointer to a 32 bit * integer, and to denote that new_ucb_p is a pointer to a pointer to a * UCB structure. * * 6. Mixed pointer sizes within one argument * If a 64-bit pointer is being passed by reference, the reference to * the pointer should also be 64 bits wide to avoid confusion. * For example: * * PTE_PPQ va_pte_p; * VOID_PPQ start_va_p; * * should be used instead of: * * PTE_PQ *va_pte_p; * VOID_PQ *start_va_p; * * * AUTHOR: * * Karen L. Noel * * CREATION DATE: 30-Jan-2002 * * MODIFICATION HISTORY: * * X-11 WBF Burns Fisher 21-Oct-2008 * Oops...PAL_GET_PSTATE and PAL_SET_PSTATE are stacked * not static pal calls * * X-10 WBF Burns Fisher 27-Sep-2008 * Add PAL_PSTATE_INFO, GET_PSTATE, and SET_PSTATE * * X-9 WBF Burns Fisher 19-Oct-2006 * Add PAL_RSE_INFO * * X-7,8 KLN3557 Karen L. Noel 17-Feb-2005 * Add more PAL routines. * * X-6 Andy Kuehnel 11-Aug-2003 * - Make ia64_pal$halt_info static to avoid MULDEF linker * warnings. * * X-5 KLN3266 Karen L. Noel 17-Apr-2003 * Change uint64 to unsigned __int64 for modules that don't * include ints.h. * * X-4 KLN3264 Karen L. Noel 16-Apr-2003 * Add ia64_pal$call_stacked. Use it for ia64_pal$halt_info. * * X-3 KLN3128 Karen L. Noel 7-Nov-2002 * Fix constant names to match conventions. * * X-2 KLN3041 Karen L. Noel 15-Mar-2002 * Add ia64_pal$vm_summary routine. * *-- */ #ifndef __IA64_PAL__ROUTINES_LOADED #define __IA64_PAL__ROUTINES_LOADED 1 #pragma __required_pointer_size __save #pragma __required_pointer_size __long /* * Define all types that are used in the following function prototypes. */ #include #include /* * Function prototype of generic wrapper function */ extern unsigned __int64 ia64_pal$call_static ( PAL_RET * ret, unsigned __int64 index, unsigned __int64 arg1, unsigned __int64 arg2, unsigned __int64 arg3); extern unsigned __int64 ia64_pal$call_static_phys ( PAL_RET * ret, unsigned __int64 index, unsigned __int64 arg1, unsigned __int64 arg2, unsigned __int64 arg3); extern unsigned __int64 ia64_pal$call_stacked ( PAL_RET * ret, unsigned __int64 index, unsigned __int64 arg1, unsigned __int64 arg2, unsigned __int64 arg3); extern unsigned __int64 ia64_pal$call_stacked_phys ( PAL_RET * ret, unsigned __int64 index, unsigned __int64 arg1, unsigned __int64 arg2, unsigned __int64 arg3); /* * Functional prototypes of PAL wrapper functions */ #pragma inline (ia64_pal$cache_flush) static unsigned __int64 ia64_pal$cache_flush( unsigned __int64 cache_type, unsigned __int64 operation, unsigned __int64 progress, PAL_CFLUSH * cflush) { return (ia64_pal$call_static ((PAL_RET *)cflush, IA64_PAL$K_CACHE_FLUSH, cache_type, operation, progress)); } #pragma inline (ia64_pal$cache_info) static unsigned __int64 ia64_pal$cache_info(unsigned __int64 cache_level, unsigned __int64 cache_type, PAL_CINFO * cinfo) { return (ia64_pal$call_static ((PAL_RET *)cinfo, IA64_PAL$K_CACHE_INFO, cache_level, cache_type, 0)); } #pragma inline (ia64_pal$cache_init) static unsigned __int64 ia64_pal$cache_init(unsigned __int64 cache_level, unsigned __int64 cache_type, unsigned __int64 rest) { PAL_RET ret; return (ia64_pal$call_static_phys (&ret, IA64_PAL$K_CACHE_INIT, cache_level, cache_type, rest)); } #pragma inline (ia64_pal$cache_prot_info) static unsigned __int64 ia64_pal$cache_prot_info(unsigned __int64 cache_level, unsigned __int64 cache_type, PAL_CPINFO * cpinfo) { return (ia64_pal$call_static ((PAL_RET *)cpinfo, IA64_PAL$K_CACHE_PROT_INFO, cache_level, cache_type, 0)); } #pragma inline (ia64_pal$cache_read) static unsigned __int64 ia64_pal$cache_read (unsigned __int64 line_id, unsigned __int64 address, unsigned __int64 * data, unsigned __int64 * length, unsigned __int64 * mesi) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_stacked_phys (&ret, IA64_PAL$K_CACHE_READ, line_id, address, 0); *data = ret.pal_ret$q_val1; *length = ret.pal_ret$q_val2; *mesi = ret.pal_ret$q_val3; return (pal_status); } #pragma inline (ia64_pal$cache_summary) static unsigned __int64 ia64_pal$cache_summary(PAL_CSUMM * pal_csumm) { return (ia64_pal$call_static ((PAL_RET *)pal_csumm, IA64_PAL$K_CACHE_SUMMARY, 0, 0, 0)); } #pragma inline (ia64_pal$cache_write) static unsigned __int64 ia64_pal$cache_write (unsigned __int64 line_id, unsigned __int64 address, unsigned __int64 data) { PAL_RET ret; return (ia64_pal$call_stacked_phys (&ret, IA64_PAL$K_CACHE_WRITE, line_id, address, data)); } #pragma inline (ia64_pal$debug_info) static unsigned __int64 ia64_pal$debug_info (PAL_DEBUG_INFO * debug_info) { return (ia64_pal$call_static ((PAL_RET *)debug_info, IA64_PAL$K_DEBUG_INFO, 0, 0, 0)); } #pragma inline (ia64_pal$pstate_info) static unsigned __int64 ia64_pal$pstate_info (PAL_PSTATE_INFO_RETURNS *pstate_return,PAL_PSTATE_INFO * pstate_info) { return (ia64_pal$call_static ((PAL_RET *)pstate_return, IA64_PAL$K_PSTATE_INFO, (unsigned __int64)pstate_info, 0, 0)); } #pragma inline (ia64_pal$rse_info) static unsigned __int64 ia64_pal$rse_info (PAL_RSE_INFO * rse_info) { return (ia64_pal$call_static ((PAL_RET *)rse_info, IA64_PAL$K_RSE_INFO, 0, 0, 0)); } #pragma inline (ia64_pal$get_pstate) static unsigned __int64 ia64_pal$get_pstate(unsigned __int64 *addr, unsigned __int64 infoType) { unsigned __int64 pal_status; PAL_RET ret; pal_status = ia64_pal$call_stacked (&ret, IA64_PAL$K_GET_PSTATE, infoType, 0, 0); *addr = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$set_pstate) static unsigned __int64 ia64_pal$set_pstate(__int64 pstate, __int64 force_pstate) { unsigned __int64 pal_status; PAL_RET ret; pal_status = ia64_pal$call_stacked (&ret, IA64_PAL$K_SET_PSTATE, pstate, force_pstate, 0); return (pal_status); } #pragma inline (ia64_pal$halt) static unsigned __int64 ia64_pal$halt(unsigned __int64 halt_state, unsigned __int64 io_detail_ptr, unsigned __int64 * load_return) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static_phys (&ret, IA64_PAL$K_HALT, halt_state, io_detail_ptr, 0); if (load_return) *load_return = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$halt_info) static unsigned __int64 ia64_pal$halt_info(void * power_buffer) { PAL_RET ret; return (ia64_pal$call_stacked ( &ret, IA64_PAL$K_HALT_INFO, (unsigned __int64)power_buffer, 0, 0)); } #pragma inline (ia64_pal$halt_light) static unsigned __int64 ia64_pal$halt_light(void) { PAL_RET ret; return (ia64_pal$call_static (&ret, IA64_PAL$K_HALT_LIGHT, 0, 0, 0)); } #pragma inline (ia64_pal$mc_clear_log) static unsigned __int64 ia64_pal$mc_clear_log(PAL_MC_CLOG * mc_clog) { return (ia64_pal$call_static((PAL_RET *)mc_clog, IA64_PAL$K_MC_CLEAR_LOG, 0, 0, 0)); } #pragma inline (ia64_pal$mc_drain) static unsigned __int64 ia64_pal$mc_drain(void) { PAL_RET ret; return (ia64_pal$call_static(&ret, IA64_PAL$K_MC_DRAIN, 0, 0, 0)); } #pragma inline (ia64_pal$mc_expected) static unsigned __int64 ia64_pal$mc_expected(unsigned __int64 expected, unsigned __int64 * previous) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static_phys (&ret, IA64_PAL$K_MC_EXPECTED, expected, 0, 0); *previous = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$mc_error_info) static unsigned __int64 ia64_pal$mc_error_info (unsigned __int64 info_index, unsigned __int64 level_index, unsigned __int64 type_index, PAL_MCERR * err) { return (ia64_pal$call_static ((PAL_RET*) err, IA64_PAL$K_MC_ERROR_INFO, info_index, level_index, type_index)); } #pragma inline (ia64_pal$perf_mon_info) static unsigned __int64 ia64_pal$perf_mon_info(PAL_PM_INFO *pm_info, PAL_PM_BUFFER *pmbuf) { return (ia64_pal$call_static ((PAL_RET *)pm_info, IA64_PAL$K_PERF_MON_INFO, (unsigned __int64) pmbuf, 0, 0)); } #pragma inline (ia64_pal$proc_get_features) static unsigned __int64 ia64_pal$proc_get_features ( unsigned __int64 * features_avail, unsigned __int64 * feature_status, unsigned __int64 * feature_control) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static_phys (&ret, IA64_PAL$K_PROC_GET_FEATURES, 0, 0, 0); *features_avail = ret.pal_ret$q_val1; *feature_status = ret.pal_ret$q_val2; *feature_control = ret.pal_ret$q_val3; return (pal_status); } #pragma inline (ia64_pal$ptce_info) static unsigned __int64 ia64_pal$ptce_info(PAL_PTCE_INFO *info) { return (ia64_pal$call_static ( (PAL_RET *)info, IA64_PAL$K_PTCE_INFO, 0,0,0)); } #pragma inline (ia64_pal$vm_info) static unsigned __int64 ia64_pal$vm_info( unsigned __int64 tc_level, unsigned __int64 tc_type, PAL_VM_INFO * vm_info) { return (ia64_pal$call_static((PAL_RET *)vm_info, IA64_PAL$K_VM_INFO, tc_level, tc_type, 0)); } #pragma inline (ia64_pal$vm_page_size) static unsigned __int64 ia64_pal$vm_page_size(PAL_VM_PGSIZE * vm_pgsize) { return (ia64_pal$call_static((PAL_RET *)vm_pgsize, IA64_PAL$K_VM_PAGE_SIZE, 0, 0, 0)); } #pragma inline (ia64_pal$vm_summary) static unsigned __int64 ia64_pal$vm_summary(PAL_VM_SUMMARY *summ) { return (ia64_pal$call_static ( (PAL_RET *)summ, IA64_PAL$K_VM_SUMMARY, 0,0,0)); } #pragma inline (ia64_pal$mem_attrib) static unsigned __int64 ia64_pal$mem_attrib(unsigned __int64 * mem_attrib) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static(&ret, IA64_PAL$K_MEM_ATTRIB, 0, 0, 0); *mem_attrib = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$version) static unsigned __int64 ia64_pal$version ( unsigned __int64 * min_pal_ver, unsigned __int64 * current_pal_ver) { unsigned __int64 pal_status; PAL_RET ret; pal_status = ia64_pal$call_static (&ret, IA64_PAL$K_VERSION, 0, 0, 0); *min_pal_ver = ret.pal_ret$q_val1; *current_pal_ver = ret.pal_ret$q_val2; return (pal_status); } #pragma inline (ia64_pal$tr_read) static unsigned __int64 ia64_pal$tr_read(unsigned __int64 which_tr, unsigned __int64 tr_type, unsigned __int64 * return_buffer, /* 32-byte buffer - 4 quads */ PAL_TR_VALID * tr_valid) { unsigned __int64 ptr = __tpa((__int64)return_buffer); unsigned __int64 pal_status; PAL_RET ret; pal_status = ia64_pal$call_stacked_phys (&ret, IA64_PAL$K_VM_TR_READ, which_tr, tr_type, ptr); tr_valid->pal_tr_valid$q_val = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$freq_base) static unsigned __int64 ia64_pal$freq_base(unsigned __int64 * base_freq) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static (&ret, IA64_PAL$K_FREQ_BASE, 0, 0, 0); *base_freq = ret.pal_ret$q_val1; return (pal_status); } #pragma inline (ia64_pal$freq_ratios) static unsigned __int64 ia64_pal$freq_ratios (unsigned __int64 * proc, unsigned __int64 * bus, unsigned __int64 * itc) { PAL_RET ret; unsigned __int64 pal_status; pal_status = ia64_pal$call_static (&ret, IA64_PAL$K_FREQ_RATIOS, 0, 0, 0); *proc = ret.pal_ret$q_val1; *bus = ret.pal_ret$q_val2; *itc = ret.pal_ret$q_val3; return (pal_status); } #pragma __required_pointer_size __restore #endif /* __IA64_PAL_ROUTINES_LOADED */