My Project
|
00001 /* 00002 Copyright (c) 2012, Broadcom Europe Ltd 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are met: 00007 * Redistributions of source code must retain the above copyright 00008 notice, this list of conditions and the following disclaimer. 00009 * Redistributions in binary form must reproduce the above copyright 00010 notice, this list of conditions and the following disclaimer in the 00011 documentation and/or other materials provided with the distribution. 00012 * Neither the name of the copyright holder nor the 00013 names of its contributors may be used to endorse or promote products 00014 derived from this software without specific prior written permission. 00015 00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00017 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00018 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY 00020 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00021 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00022 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00023 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00024 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00032 #ifndef MMAL_COMMON_H 00033 #define MMAL_COMMON_H 00034 00035 #include <stdlib.h> 00036 #include <string.h> 00037 #include <stddef.h> 00038 #include <assert.h> 00039 00040 #include <interface/vcos/vcos.h> 00041 00042 /* C99 64bits integers */ 00043 #ifndef INT64_C 00044 # define INT64_C(value) value##LL 00045 # define UINT64_C(value) value##ULL 00046 #endif 00047 00048 #define MMAL_TSRING(s) #s 00049 #define MMAL_TO_STRING(s) MMAL_TSRING(s) 00050 00051 #define MMAL_COUNTOF(x) (sizeof((x))/sizeof((x)[0])) 00052 #define MMAL_MIN(a,b) ((a)<(b)?(a):(b)) 00053 #define MMAL_MAX(a,b) ((a)<(b)?(b):(a)) 00054 00055 /* FIXME: should be different for big endian */ 00056 #define MMAL_FOURCC(a,b,c,d) ((a) | (b << 8) | (c << 16) | (d << 24)) 00057 #define MMAL_PARAM_UNUSED(a) (void)(a) 00058 #define MMAL_MAGIC MMAL_FOURCC('m','m','a','l') 00059 00060 typedef int32_t MMAL_BOOL_T; 00061 #define MMAL_FALSE 0 00062 #define MMAL_TRUE 1 00063 00064 typedef struct MMAL_CORE_STATISTICS_T 00065 { 00066 uint32_t buffer_count; 00067 uint32_t first_buffer_time; 00068 uint32_t last_buffer_time; 00069 uint32_t max_delay; 00070 } MMAL_CORE_STATISTICS_T; 00071 00074 typedef struct MMAL_CORE_PORT_STATISTICS_T 00075 { 00076 MMAL_CORE_STATISTICS_T rx; 00077 MMAL_CORE_STATISTICS_T tx; 00078 } MMAL_CORE_PORT_STATISTICS_T; 00079 00081 typedef uint32_t MMAL_FIXED_16_16_T; 00082 00083 #endif /* MMAL_COMMON_H */