Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #22

Merged
1 commit merged into from
Aug 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/arch/arm32/mm/tee_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,14 @@ void tee_mm_free(tee_mm_entry_t *p)
entry = entry->next;

if (entry->next == NULL) {
DMSG("invalid mm_entry %p", p);
DMSG("invalid mm_entry %p", (void *)p);
TEE_ASSERT(0);
}
entry->next = entry->next->next;

if (p->pool->flags & TEE_MM_POOL_PAGED) {
/* unmap entry */
tee_pager_unmap((uint32_t) (p->offset << p->pool->shift) +
tee_pager_unmap((uint32_t)(p->offset << p->pool->shift) +
p->pool->lo, p->size);
}

Expand Down
3 changes: 3 additions & 0 deletions core/kernel/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

void _assert_log(const char *expr, const char *file, int line)
{
(void)expr;
(void)file;
(void)line;
EMSG("Assertion '%s' failed at %s:%d", expr, file, line);
}

Expand Down
27 changes: 19 additions & 8 deletions lib/libutee/include/user_ta_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,27 @@ struct user_ta_sub_head {
uint32_t stack_size;
};

#define TA_FLAG_USER_MODE (1 << 0)
#define TA_FLAG_EXEC_DDR (1 << 1)
#define TA_FLAG_SINGLE_INSTANCE (1 << 2)
#define TA_FLAG_MULTI_SESSION (1 << 3)
#define TA_FLAG_INSTANCE_KEEP_ALIVE (1 << 4)
#define TA_FLAG_USER_MODE (1 << 0)
#define TA_FLAG_EXEC_DDR (1 << 1)
#define TA_FLAG_SINGLE_INSTANCE (1 << 2)
#define TA_FLAG_MULTI_SESSION (1 << 3)
#define TA_FLAG_INSTANCE_KEEP_ALIVE (1 << 4) /* remains after last close */
/*
* TEE Core will allow memrefs in some firewalled memory if this flag is
* set for a User TA.
* TA_FLAG_UNSAFE_NW_PARAMS: May manipulate some secure memory based on
* physical pointers from non-secure world
*/
#define TA_FLAG_UNSAFE_NW_PARAMS (1 << 5)
#define TA_FLAG_UNSAFE_NW_PARAMS (1 << 5)
#define TA_FLAG_REMAP_SUPPORT (1 << 6) /* use map/unmap syscalls */
#define TA_FLAG_CACHE_MAINTENANCE (1 << 7) /* use cache flush syscall */

#define TA_PROP_STR_SINGLE_INSTANCE "gpd.ta.singleInstance"
#define TA_PROP_STR_MULTI_SESSION "gpd.ta.multiSession"
#define TA_PROP_STR_KEEP_ALIVE "gpd.ta.instanceKeepAlive"
#define TA_PROP_STR_DATA_SIZE "gpd.ta.dataSize"
#define TA_PROP_STR_STACK_SIZE "gpd.ta.stackSize"
#define TA_PROP_STR_UNSAFE_PARAM "op-tee.unsafe_param"
#define TA_PROP_STR_REMAP "op-tee.remap"
#define TA_PROP_STR_CACHE_SYNC "op-tee.cache_sync"

enum user_ta_prop_type {
USER_TA_PROP_TYPE_BOOL, /* bool */
Expand Down
5 changes: 3 additions & 2 deletions lib/libutee/ta_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,13 @@ int puts(const char *str)

#else /* CFG_TEE_TA_LOG_LEVEL */
#include <tee_internal_api_extensions.h>
int printf(const char *fmt, ...)
#include <compiler.h>
int printf(const char *fmt __unused, ...)
{
return 0;
}

int puts(const char *str)
int puts(const char *str __unused)
{
return 0;
}
Expand Down
21 changes: 11 additions & 10 deletions ta/arch/arm32/user_ta_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,21 @@ uint8_t *ta_heap_base __attribute__ ((section(".ta_heap_base")));
const size_t ta_data_size = TA_DATA_SIZE;

const struct user_ta_property ta_props[] = {
{"gpd.ta.singleInstance", USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_SINGLE_INSTANCE) != 0} },
{TA_PROP_STR_SINGLE_INSTANCE, USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_SINGLE_INSTANCE) != 0}},

{"gpd.ta.multiSession", USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_MULTI_SESSION) != 0} },
{TA_PROP_STR_MULTI_SESSION, USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_MULTI_SESSION) != 0}},

{"gpd.ta.instanceKeepAlive", USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_INSTANCE_KEEP_ALIVE) != 0} },
{TA_PROP_STR_KEEP_ALIVE, USER_TA_PROP_TYPE_BOOL,
&(const bool){(TA_FLAGS & TA_FLAG_INSTANCE_KEEP_ALIVE) != 0}},

{"gpd.ta.dataSize", USER_TA_PROP_TYPE_U32,
&(const uint32_t){TA_DATA_SIZE} },
{TA_PROP_STR_DATA_SIZE, USER_TA_PROP_TYPE_U32,
&(const uint32_t){TA_DATA_SIZE}},

{TA_PROP_STR_STACK_SIZE, USER_TA_PROP_TYPE_U32,
&(const uint32_t){TA_STACK_SIZE}},

{"gpd.ta.stackSize", USER_TA_PROP_TYPE_U32,
&(const uint32_t){TA_STACK_SIZE} },
/*
* Extended propietary properties, name of properties must not begin with
* "gpd."
Expand Down