14562236bSHarry Wentland /*
24562236bSHarry Wentland  * Copyright 2012-16 Advanced Micro Devices, Inc.
34562236bSHarry Wentland  *
44562236bSHarry Wentland  * Permission is hereby granted, free of charge, to any person obtaining a
54562236bSHarry Wentland  * copy of this software and associated documentation files (the "Software"),
64562236bSHarry Wentland  * to deal in the Software without restriction, including without limitation
74562236bSHarry Wentland  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
84562236bSHarry Wentland  * and/or sell copies of the Software, and to permit persons to whom the
94562236bSHarry Wentland  * Software is furnished to do so, subject to the following conditions:
104562236bSHarry Wentland  *
114562236bSHarry Wentland  * The above copyright notice and this permission notice shall be included in
124562236bSHarry Wentland  * all copies or substantial portions of the Software.
134562236bSHarry Wentland  *
144562236bSHarry Wentland  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
154562236bSHarry Wentland  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
164562236bSHarry Wentland  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
174562236bSHarry Wentland  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
184562236bSHarry Wentland  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
194562236bSHarry Wentland  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
204562236bSHarry Wentland  * OTHER DEALINGS IN THE SOFTWARE.
214562236bSHarry Wentland  *
224562236bSHarry Wentland  * Authors: AMD
234562236bSHarry Wentland  *
244562236bSHarry Wentland  */
254562236bSHarry Wentland 
264562236bSHarry Wentland #ifndef _OS_TYPES_H_
274562236bSHarry Wentland #define _OS_TYPES_H_
284562236bSHarry Wentland 
294562236bSHarry Wentland #if defined __KERNEL__
304562236bSHarry Wentland 
314562236bSHarry Wentland #include <asm/byteorder.h>
324562236bSHarry Wentland #include <linux/types.h>
334562236bSHarry Wentland #include <drm/drmP.h>
344562236bSHarry Wentland 
3593052132SDave Airlie #include <linux/kref.h>
3693052132SDave Airlie 
374562236bSHarry Wentland #include "cgs_linux.h"
384562236bSHarry Wentland 
394562236bSHarry Wentland #if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU)
404562236bSHarry Wentland #define BIGENDIAN_CPU
414562236bSHarry Wentland #elif defined(__LITTLE_ENDIAN) && !defined(LITTLEENDIAN_CPU)
424562236bSHarry Wentland #define LITTLEENDIAN_CPU
434562236bSHarry Wentland #endif
444562236bSHarry Wentland 
454562236bSHarry Wentland #undef READ
464562236bSHarry Wentland #undef WRITE
474562236bSHarry Wentland #undef FRAME_SIZE
484562236bSHarry Wentland 
494562236bSHarry Wentland #define dm_output_to_console(fmt, ...) DRM_INFO(fmt, ##__VA_ARGS__)
504562236bSHarry Wentland 
514562236bSHarry Wentland #define dm_error(fmt, ...) DRM_ERROR(fmt, ##__VA_ARGS__)
524562236bSHarry Wentland 
534562236bSHarry Wentland #define dm_debug(fmt, ...) DRM_DEBUG_KMS(fmt, ##__VA_ARGS__)
544562236bSHarry Wentland 
554562236bSHarry Wentland #define dm_vlog(fmt, args) vprintk(fmt, args)
564562236bSHarry Wentland 
574562236bSHarry Wentland #endif
584562236bSHarry Wentland 
594562236bSHarry Wentland 
604562236bSHarry Wentland #endif /* _OS_TYPES_H_ */
61