Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved. |
| 2 | |
| 3 | Redistribution and use in source and binary forms, with or without |
| 4 | modification, are permitted provided that the following conditions are |
| 5 | met: |
| 6 | * Redistributions of source code must retain the above copyright |
| 7 | notice, this list of conditions and the following disclaimer. |
| 8 | * Redistributions in binary form must reproduce the above |
| 9 | copyright notice, this list of conditions and the following |
| 10 | disclaimer in the documentation and/or other materials provided |
| 11 | with the distribution. |
| 12 | * Neither the name of The Linux Foundation nor the names of its |
| 13 | contributors may be used to endorse or promote products derived |
| 14 | from this software without specific prior written permission. |
| 15 | |
| 16 | THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #ifndef OS_TYPE_H |
| 30 | #define OS_TYPE_H |
| 31 | |
| 32 | /*=========================================================================== |
| 33 | |
| 34 | G-Link OS Specific types/functions |
| 35 | |
| 36 | ===========================================================================*/ |
| 37 | |
| 38 | /*=========================================================================== |
| 39 | |
| 40 | INCLUDE FILES |
| 41 | |
| 42 | ===========================================================================*/ |
Channagoud Kadabi | fb6ff7e | 2015-07-13 20:13:05 -0700 | [diff] [blame] | 43 | #include <sys/types.h> |
Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 44 | #include <string.h> |
| 45 | #include <assert.h> |
| 46 | |
| 47 | /*=========================================================================== |
| 48 | MACRO DEFINITIONS |
| 49 | ===========================================================================*/ |
| 50 | |
| 51 | #define OS_LOG_INIT( ) glink_os_log_init() |
Steven Cahail | 7978335 | 2015-08-20 15:24:04 -0600 | [diff] [blame] | 52 | #define GLINK_OS_SEC_TO_USEC (1000000ULL) |
| 53 | #define GLINK_OS_SEC_TO_TICK (19200000ULL) |
Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 54 | |
Steven Cahail | 7978335 | 2015-08-20 15:24:04 -0600 | [diff] [blame] | 55 | #define GLINK_OS_TICK_TO_USEC(t) ((t)*10ULL/192ULL) |
| 56 | #define GLINK_OS_USEC_TO_TICK(u) ((u)*192ULL/10ULL) |
Steven Cahail | a136c10 | 2015-08-21 13:29:10 -0600 | [diff] [blame] | 57 | |
| 58 | #define GLINK_OS_UNREFERENCED_PARAM( param ) ( void )param |
| 59 | |
Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 60 | /*=========================================================================== |
| 61 | TYPE DEFINITIONS |
| 62 | ===========================================================================*/ |
| 63 | #define DALSYS_SYNC_OBJ_SIZE_BYTES 40 |
| 64 | #define DALSYS_EVENT_OBJ_SIZE_BYTES 80 |
| 65 | |
Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 66 | typedef struct DALSYSEventObj DALSYSEventObj; |
| 67 | |
| 68 | struct DALSYSEventObj |
| 69 | { |
| 70 | unsigned long long _bSpace[DALSYS_EVENT_OBJ_SIZE_BYTES/sizeof(unsigned long long)]; |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | typedef struct DALSYSSyncObj DALSYSSyncObj; |
| 75 | struct DALSYSSyncObj |
| 76 | { |
| 77 | unsigned long long _bSpace[DALSYS_SYNC_OBJ_SIZE_BYTES/sizeof(unsigned long long)]; |
| 78 | }; |
| 79 | |
| 80 | typedef DALSYSSyncObj os_cs_type; |
| 81 | |
| 82 | typedef void ( *os_timer_cb_fn )( void *cb_data ); |
| 83 | |
| 84 | typedef struct |
| 85 | { |
| 86 | void * dal_event; |
| 87 | DALSYSEventObj dal_obj_memory; |
| 88 | }os_event_type; |
| 89 | |
| 90 | typedef void ( *os_isr_cb_fn )( void *cb_data ); |
| 91 | |
| 92 | typedef struct os_ipc_intr_struct |
| 93 | { |
| 94 | uint32_t processor; |
| 95 | uint32_t irq_out; |
| 96 | } os_ipc_intr_type; |
| 97 | |
Steven Cahail | 7978335 | 2015-08-20 15:24:04 -0600 | [diff] [blame] | 98 | typedef unsigned long long os_timetick_type; |
| 99 | |
Sridhar Parasuram | bf39132 | 2015-01-23 09:29:07 -0800 | [diff] [blame] | 100 | #endif /* OS_TYPE_H */ |