/*
*/
/*
* Copyright (c) 2012, 2012 Intel Corporation. All rights reserved.
*/
#ifndef __DRM_LINUX_H__
#define __DRM_LINUX_H__
#include <sys/byteorder.h>
#include "drm_atomic.h"
#define DRM_MEM_CACHED 0
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifdef __lint
/*
* The following is to keep lint happy when it encouters the use of 'flag'.
* On Linux, this allows a local variable to be used to retain context,
* but is unused on Solaris. Rather than trying to place LINTED
* directives in the source, we actually consue the flag for lint here.
*/
#else
#endif
#define time_after(a,b) ((long)(b) - (long)(a) < 0)
#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0)
#define time_in_range(a,b,c) \
(time_after_eq(a,b) && \
time_before_eq(a,c))
#ifdef _BIG_ENDIAN
#else
#define cpu_to_le16(x) (x)
#define le16_to_cpu(x) (x)
#endif
#define swap(a, b) \
#define abs(x) ((x < 0) ? -x : x)
#define unlikely(a) (a)
#ifdef __lint
/* Don't lint these macros. */
#define BUG_ON(a)
#define WARN_ON(a)
#else /* !__lint */
#endif /* __lint */
#define in_dbg_master() 0
typedef unsigned long dma_addr_t;
typedef int bool;
#define true (1)
#define false (0)
#define __init
#define __exit
#define __iomem
#ifdef _ILP32
#else /* _LP64 */
#endif
typedef struct kref {
} kref_t;
extern unsigned int hweight16(unsigned int w);
#ifdef __lint
/*
* The actual code for _wait_for() causes Solaris lint2 to fail, though
* by all appearances, the code actually works (may try and peek at
* the compiled code to understand why). So to get around the problem,
* we create a special lint version for _wait_for().
*/
#else /* !__lint */
int ret__ = 0; \
while (! (COND)) { \
break; \
} \
if (W) udelay(W); \
} \
ret__; \
})
#endif /* __lint */
#endif /* __DRM_LINUX_H__ */