• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright(c) 2011 Trusted Logic.   All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  *  * Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  *  * Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in
12  *    the documentation and/or other materials provided with the
13  *    distribution.
14  *  * Neither the name Trusted Logic nor the names of its
15  *    contributors may be used to endorse or promote products derived
16  *    from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /*
32  * This header file defines the implementation-dependent types,
33  * constants and macros for all the Trusted Foundations implementations
34  * of the TEE Client API
35  */
36 #ifndef   __TEE_CLIENT_API_IMP_H__
37 #define   __TEE_CLIENT_API_IMP_H__
38 
39 #include "s_type.h"
40 #include "s_error.h"
41 
42 typedef struct
43 {
44    uint32_t             _hConnection;
45 }
46 TEEC_Context_IMP;
47 
48 typedef struct
49 {
50    struct TEEC_Context* _pContext;
51    S_HANDLE             _hClientSession;
52 }
53 TEEC_Session_IMP;
54 
55 typedef struct
56 {
57    struct TEEC_Context* _pContext;
58    S_HANDLE             _hBlock;
59    bool                 _bAllocated;
60 }
61 TEEC_SharedMemory_IMP;
62 
63 typedef struct
64 {
65    struct TEEC_Context* _pContext;
66     uint32_t            _hSession;
67 }
68 TEEC_Operation_IMP;
69 
70 /* There is no natural, compile-time limit on the shared memory, but a specific
71    implementation may introduce a limit (in particular on TrustZone) */
72 #define TEEC_CONFIG_SHAREDMEM_MAX_SIZE ((size_t)0xFFFFFFFF)
73 
74 #define TEEC_PARAM_TYPES(entry0Type, entry1Type, entry2Type, entry3Type) \
75    ((entry0Type) | ((entry1Type) << 4) | ((entry2Type) << 8) | ((entry3Type) << 12))
76 
77 
78 #endif /* __TEE_CLIENT_API_IMP_H__ */
79