1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright 2023 Advanced Micro Devices, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Authors: AMD
24 *
25 */
26
27#ifndef __CMNTYPES_H__
28#define __CMNTYPES_H__
29
30#ifdef __GNUC__
31#if __GNUC__ == 4 && __GNUC_MINOR__ > 7
32typedef unsigned int uint;
33#endif
34#endif
35
36typedef signed char int8, *pint8;
37typedef signed short int16, *pint16;
38typedef signed int int32, *pint32;
39typedef signed int64, *pint64;
40
41typedef unsigned char uint8, *puint8;
42typedef unsigned short uint16, *puint16;
43typedef unsigned int uint32, *puint32;
44typedef unsigned uint64, *puint64;
45
46typedef unsigned long int ulong;
47typedef unsigned char uchar;
48typedef unsigned int uint;
49
50typedef void *pvoid;
51typedef char *pchar;
52typedef const void *const_pvoid;
53typedef const char *const_pchar;
54
55typedef struct rgba_struct {
56    uint8 a;
57    uint8 r;
58    uint8 g;
59    uint8 b;
60} rgba_t;
61
62typedef struct {
63    uint8 blue;
64    uint8 green;
65    uint8 red;
66    uint8 alpha;
67} gen_color_t;
68
69typedef union {
70	uint32		val;
71	gen_color_t f;
72} gen_color_u;
73
74//
75// Types to make it easy to get or set the bits of a float/double.
76// Avoids automatic casting from int to float and back.
77//
78#if 0
79typedef union {
80	uint32 i;
81	float f;
82} uintfloat32;
83
84typedef union {
85	uint64 i;
86	double f;
87} uintfloat64;
88
89#ifndef UNREFERENCED_PARAMETER
90#define UNREFERENCED_PARAMETER(x) x = x
91#endif
92#endif
93
94#endif  //__CMNTYPES_H__
95