2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. 2N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * PURPOSE: Operating System Dependent layer 2N/A * Provide OS dependent data structures & functions with 2N/A * a canonical DAPL interface. Designed to be portable 2N/A * and hide OS specific quirks of common functions. 2N/A * networking related headers 2N/A#
endif /* _INLINE_ */ 2N/A * initialization function 2N/A * dapl_os_atomic_inc 2N/A * get the current value of '*v', and then increment it. 2N/A * This is equivalent to an IB atomic fetch and add of 1, 2N/A * except that a DAT_COUNT might be 32 bits, rather than 64 2N/A * and it occurs in local memory. 2N/A * DAT_COUNT dapl_os_atomic_inc(INOUT DAPL_ATOMIC *v) 2N/A * dapl_os_atomic_dec 2N/A * decrement the current value of '*v'. No return value is required. 2N/A * DAT_COUNT dapl_os_atomic_dec(INOUT DAPL_ATOMIC *v) 2N/A * dapl_os_atomic_assign 2N/A * assign 'new_value' to '*v' if the current value 2N/A * matches the provided 'match_value'. 2N/A * Make no assignment if there is no match. 2N/A * Return the current value in any case. 2N/A * This matches the IBTA atomic operation compare & swap 2N/A * except that it is for local memory and a DAT_COUNT may 2N/A * be only 32 bits, rather than 64. 2N/A * DAT_COUNT dapl_os_atomic_assign(INOUT DAPL_ATOMIC *v, 2N/A * IN DAT_COUNT match_value, IN DAT_COUNT new_value) 2N/A * DAT_RETURN dapl_os_lock_init(IN DAPL_OS_LOCK *m) 2N/A/* DAT_RETURN dapl_os_lock(IN DAPL_OS_LOCK *m) */ 2N/A/* DAT_RETURN dapl_os_unlock(IN DAPL_OS_LOCK *m) */ 2N/A/* DAT_RETURN dapl_os_lock_destroy(IN DAPL_OS_LOCK *m) */ 2N/A * The wait object invariant: Presuming a call to dapl_os_wait_object_wait 2N/A * occurs at some point, there will be at least one wakeup after each call 2N/A * to dapl_os_wait_object_signal. I.e. Signals are not ignored, though 2N/A * they may be coallesced. 2N/A/* function prototypes */ 2N/A/* void *dapl_os_alloc(int size) */ 2N/A/* void *dapl_os_realloc(void *ptr, int size) */ 2N/A/* void dapl_os_free(void *ptr, int size) */ 2N/A/* void * dapl_os_memzero(void *loc, int size) */ 2N/A/* void * dapl_os_memcpy(void *dest, const void *src, int len) */ 2N/A/* int dapl_os_memcmp(const void *mem1, const void *mem2, int len) */ 2N/A/* unsigned int dapl_os_strlen(const char *str) */ 2N/A/* char * dapl_os_strdup(const char *str) */ 2N/A/* char *strcpy(char *dest, char *src) */ 2N/A/* char *strncpy(char *s1, const char *s2, size_t n) */ 2N/A/* char *strcat(char *dest, char *src) */ 2N/A/* function prototypes */ 2N/A * Sleep for the number of micro seconds specified by the invoking 2N/A * void dapl_os_sleep_usec(int sleep_time) 2N/A * Name Service Helper functions 2N/A#
endif /* IBHOSTS_NAMING */ 2N/A * *printf format helpers. We use the C string constant concatenation 2N/A * ability to define 64 bit formats, which unfortunatly are non standard 2N/A * in the C compiler world. E.g. %llx for gcc, %I64x for Windows 2N/A * Conversion Functions 2N/A/* long int dapl_os_strtol(const char *nptr, char **endptr, int base) */ 2N/A#
endif /* _DAPL_OSD_H_ */