ofa_solaris.h revision 4659
/*
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* NAME: ofa_solaris.h
* DESC: OFED Solaris wrapper
*/
#ifndef _OFA_SOLARIS_H
#define _OFA_SOLARIS_H
#include <sys/byteorder.h>
#include <stdio.h>
#include <inttypes.h>
#include <alloca.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#endif
/* Size of a pointer */
#define __WORDSIZE 64
#else
#define __WORDSIZE 32
#endif
/*
* Endian definitions
*/
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#ifdef _BIG_ENDIAN
#define __BYTE_ORDER __BIG_ENDIAN
#elif defined _LITTLE_ENDIAN
#define __BYTE_ORDER __LITTLE_ENDIAN
#else
#endif
/*
* byteswap functions.
*/
#define bswap_8(x) ((x) & 0xff)
((uint32_t)(x) >> 24))
#else /* x86 */
#endif /* !__i386 && !__amd64 */
#if defined(_LP64) || defined(_LONGLONG_TYPE)
((uint64_t)(x) >> 56))
#else /* x86 */
#endif /* !__i386 && !__amd64 */
#else /* no uint64_t */
#endif
typedef struct sol_cpu_info_s {
char cpu_name[64];
int sol_get_cpu_info(sol_cpu_info_t **);
typedef struct sol_cpu_stats_s {
int sol_get_cpu_stats(sol_cpu_stats_t *);
void solaris_init(void);
void solaris_fini(void);
#ifdef __cplusplus
}
#endif
#endif /* _OFA_SOLARIS_H */