blob: c904ee4f06dd165e0e0d412033f035c5317eb3ab [file] [log] [blame]
Sridhar Parasurambf391322015-01-23 09:29:07 -08001/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are
5met:
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
16THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26IF 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 Kadabifb6ff7e2015-07-13 20:13:05 -070043#include <sys/types.h>
Sridhar Parasurambf391322015-01-23 09:29:07 -080044#include <string.h>
45#include <assert.h>
46
47/*===========================================================================
48 MACRO DEFINITIONS
49===========================================================================*/
50
51#define OS_LOG_INIT( ) glink_os_log_init()
Steven Cahail79783352015-08-20 15:24:04 -060052#define GLINK_OS_SEC_TO_USEC (1000000ULL)
53#define GLINK_OS_SEC_TO_TICK (19200000ULL)
Sridhar Parasurambf391322015-01-23 09:29:07 -080054
Steven Cahail79783352015-08-20 15:24:04 -060055#define GLINK_OS_TICK_TO_USEC(t) ((t)*10ULL/192ULL)
56#define GLINK_OS_USEC_TO_TICK(u) ((u)*192ULL/10ULL)
Steven Cahaila136c102015-08-21 13:29:10 -060057
58#define GLINK_OS_UNREFERENCED_PARAM( param ) ( void )param
59
Sridhar Parasurambf391322015-01-23 09:29:07 -080060/*===========================================================================
61 TYPE DEFINITIONS
62===========================================================================*/
63#define DALSYS_SYNC_OBJ_SIZE_BYTES 40
64#define DALSYS_EVENT_OBJ_SIZE_BYTES 80
65
Sridhar Parasurambf391322015-01-23 09:29:07 -080066typedef struct DALSYSEventObj DALSYSEventObj;
67
68struct DALSYSEventObj
69{
70 unsigned long long _bSpace[DALSYS_EVENT_OBJ_SIZE_BYTES/sizeof(unsigned long long)];
71};
72
73
74typedef struct DALSYSSyncObj DALSYSSyncObj;
75struct DALSYSSyncObj
76{
77 unsigned long long _bSpace[DALSYS_SYNC_OBJ_SIZE_BYTES/sizeof(unsigned long long)];
78};
79
80typedef DALSYSSyncObj os_cs_type;
81
82typedef void ( *os_timer_cb_fn )( void *cb_data );
83
84typedef struct
85{
86 void * dal_event;
87 DALSYSEventObj dal_obj_memory;
88}os_event_type;
89
90typedef void ( *os_isr_cb_fn )( void *cb_data );
91
92typedef struct os_ipc_intr_struct
93{
94 uint32_t processor;
95 uint32_t irq_out;
96} os_ipc_intr_type;
97
Steven Cahail79783352015-08-20 15:24:04 -060098typedef unsigned long long os_timetick_type;
99
Sridhar Parasurambf391322015-01-23 09:29:07 -0800100#endif /* OS_TYPE_H */