OpenCores
URL https://opencores.org/ocsvn/funbase_ip_library/funbase_ip_library/trunk

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.swp.api/] [openmcapi/] [1.0/] [include/] [mcapi_impl_spec.h] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
/*
2
 * Copyright (c) 2011, The Multicore Association All rights reserved.
3
 *
4
 * Copyright (c) 2011, Mentor Graphics Corporation
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms, with or without
8
 * modification, are permitted provided that the following conditions are
9
 * met:
10
 *
11
 * (1) Redistributions of source code must retain the above copyright
12
 *     notice, this list of conditions and the following disclaimer.
13
 *
14
 * (2) Redistributions in binary form must reproduce the above copyright
15
 *     notice, this list of conditions and the following disclaimer in the
16
 *     documentation and/or other materials provided with the distribution.
17
 *
18
 * (3) Neither the name of the Multicore Association nor the names of its
19
 *     contributors may be used to endorse or promote products derived from
20
 *     this software without specific prior written permission.
21
 *
22
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
 * POSSIBILITY OF SUCH DAMAGE.
34
 *
35
 * mcapi_impl_spec.h
36
 *
37
 * Version 2.014, February 2011
38
 *
39
 */
40
 
41
#ifndef MCAPI_IMPL_SPEC_H
42
#define MCAPI_IMPL_SPEC_H
43
 
44
#include <openmcapi_cfg.h>
45
#include <mgc_mcapi_impl_os.h>
46
 
47
#ifdef __cplusplus
48
extern "C" {
49
#endif /* __cplusplus */
50
 
51
/* XXX remove me */
52
#define MGC_MCAPI_ERR_NOT_CONNECTED (MCAPI_STATUSCODE_END+1)
53
 
54
/*
55
 * MCAPI implementation specific type definitions
56
 */
57
typedef unsigned int            mcapi_endpoint_t;
58
typedef unsigned int            mcapi_pktchan_recv_hndl_t;
59
typedef unsigned int            mcapi_pktchan_send_hndl_t;
60
typedef unsigned int            mcapi_sclchan_send_hndl_t;
61
typedef unsigned int            mcapi_sclchan_recv_hndl_t;
62
 
63
typedef struct {
64
    /* XXX */
65
} mcapi_node_attributes_t;
66
 
67
typedef struct {
68
} mcapi_param_t;
69
 
70
/*
71
 * NOTE: Application code should consider this type opaque, and must not
72
 * directly access these members.
73
 */
74
typedef struct
75
{
76
    mcapi_cond_t    mcapi_cond;
77
    mcapi_cond_t    *mcapi_cond_ptr;
78
} MCAPI_COND_STRUCT;
79
 
80
/* Data structure that is used in non-blocking operations.  The fields are
81
 * populated for later use to check the status of the original non-blocking
82
 * call.
83
 *
84
 * NOTE: Application code should consider this type opaque, and must not
85
 * directly access these members.
86
 */
87
struct _mcapi_request
88
{
89
    struct _mcapi_request   *mcapi_next;
90
    struct _mcapi_request   *mcapi_prev;
91
    mcapi_status_t          mcapi_status;
92
    mcapi_uint8_t           mcapi_type;
93
    mcapi_uint8_t           mcapi_chan_type;
94
    mcapi_node_t            mcapi_requesting_node_id; /* The node ID of the node
95
                                                       * making the call. */
96
    mcapi_port_t            mcapi_requesting_port_id;
97
    mcapi_endpoint_t        mcapi_target_endp;
98
    mcapi_endpoint_t        *mcapi_endp_ptr;        /* The application's
99
                                                     * pointer to an endpoint
100
                                                     * structure. */
101
 
102
    mcapi_node_t            mcapi_target_node_id;   /* The target node ID. */
103
 
104
    mcapi_port_t            mcapi_target_port_id;   /* The target endpoint
105
                                                     * port. */
106
    size_t                  mcapi_byte_count;
107
    void                    *mcapi_buffer;          /* Application buffer to
108
                                                     * fill in. */
109
 
110
    size_t                  mcapi_buf_size;         /* Application buffer
111
                                                     * size. */
112
 
113
    void                    **mcapi_pkt;            /* Application packet
114
                                                     * pointer to fill in. */
115
    mcapi_uint32_t          mcapi_pending_count;
116
    MCAPI_COND_STRUCT       mcapi_cond;
117
};
118
typedef struct  _mcapi_request      mcapi_request_t;
119
 
120
 
121
/* Number of MCAPI reserved ports, starting at port 0. Reserved ports can be
122
 * used for implementation specific purposes.
123
 */
124
#define MCAPI_NUM_RESERVED_PORTS                                2
125
 
126
/* Implementation defined MCAPI MIN and MAX values.
127
 *
128
 * Implementations may parameterize implementation specific max values,
129
 * smaller that the MCAPI max values. Implementations must specify what
130
 * those smaller values are and how they are set.
131
 *
132
 */
133
#define MCAPI_MAX_DOMAIN                        (2 << 14) - 1   /* Maximum value for domain */
134
#define MCAPI_MAX_NODE                           (2 << 7) - 1   /* Maximum value for node */
135
#define MCAPI_MAX_PORT                           (2 << 7) - 1   /* Maximum value for port */
136
#define MCAPI_MAX_MESSAGE_SIZE          (2 << 31) - 1   /* Maximum message size */
137
#define MCAPI_MAX_PACKET_SIZE           (2 << 31) - 1   /* Maximum packet size */
138
 
139
/*
140
 * Implementations may parameterize implementation specific priority min value
141
 * and set the number of reserved ports. Implementations must specify what
142
 * those values are and how they are set.
143
 */
144
#define MCAPI_MIN_PORT   MCAPI_NUM_RESERVED_PORTS       /* Minimum value for port */
145
#define MCAPI_MIN_PRORITY                       (2 << 31) - 1   /* XXX Minimum priority value */
146
 
147
/*
148
 * Implementation specific MCAPI endpoint status attributes
149
 */
150
#define MCAPI_ENDP_ATTR_STATUS_CREATED                  0x00010000      /* The endpoint is created */
151
 
152
 
153
#ifdef __cplusplus
154
}
155
#endif /* __cplusplus */
156
 
157
#endif /* MCAPI_IMPL_SPEC_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.