/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2015 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright 2016 Joyent, Inc.
*/
#ifndef _I40E_OSDEP_H
#define _I40E_OSDEP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sysmacros.h>
/*
* For the moment, we use this to basically deal with a few custom changes
* particularly around the use of sprintf() in the common code. The DDI defines
* sprintf() in a rather different way than the rest of the world expects it.
* This is currently necessary to indicate that we should use an alternate
* behavior.
*/
#define DEBUGOUT4(S, A, B, C, D) \
i40e_debug(NULL, 0, S, A, B, C, D)
#define DEBUGOUT5(S, A, B, C, D, E) \
i40e_debug(NULL, 0, S, A, B, C, D, E)
#define DEBUGOUT6(S, A, B, C, D, E, F) \
i40e_debug(NULL, 0, S, A, B, C, D, E, F)
#define DEBUGOUT7(S, A, B, C, D, E, F, G) \
i40e_debug(NULL, 0, S, A, B, C, D, E, F, G)
#define INLINE inline
/*
* The mdb dmod needs to use this code as well, but mdb already defines TRUE and
* FALSE in the module API. Thus we don't define these if we're building the
* dmod, as indicated by _I40E_MDB_DMOD. However, if we don't define these, then
* the shared code will be upset.
*/
#ifndef _I40E_MDB_DMOD
#define false B_FALSE
#define true B_TRUE
#endif /* _I40E_MDB_DMOD */
#define FIELD_SIZEOF(x, y) (sizeof (((x*)0)->y))
typedef boolean_t bool;
/* long string relief */
/*
* Most other systems use spin locks for interrupts. However, illumos always
* uses a single kmutex_t for both and we decide what to do based on IPL (hint:
* it's not going to be a true spin lock, we'll use an adaptive mutex).
*/
struct i40e_spinlock {
};
/*
* Note, while prefetch is strictly not present on all architectures, (it's an
* SSE extension on i386), it is expected that the platforms provide it.
*/
struct i40e_osdep {
};
/*
* This structure and its members are defined by the common code. This means we
* cannot structure prefix it, even if we want to.
*/
struct i40e_virt_mem {
void *va;
};
/*
* The first three members of this structure are defined by the common code.
* This means we cannot structure prefix them, even if we wanted to.
*/
struct i40e_dma_mem {
/* illumos-private members */
};
struct i40e_hw; /* forward decl */
/*
* Intel expects that the symbol wr32 and rd32 be defined to something which can
* read and write the 32-bit register in PCI space.
*
* To make it easier for readers and satisfy the general agreement that macros
* should be in all capitals, we use our own versions of these macros.
*/
/*
* The use of GLGEN_STAT presumes that we're only using this file for a PF
* driver. If we end up doing a VF driver, then we'll want to logically change
* this.
*/
extern void i40e_debug(void *, u32, char *, ...);
#ifdef __cplusplus
}
#endif
#endif /* _I40E_OSDEP_H */