-
Notifications
You must be signed in to change notification settings - Fork 56
/
ut-adaptor-exceptions.c
51 lines (44 loc) · 1.29 KB
/
ut-adaptor-exceptions.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
*
* Copyright (c) 2020, United States government as represented by the
* administrator of the National Aeronautics Space Administration.
* All rights reserved. This software was created at NASA Goddard
* Space Flight Center pursuant to government contracts.
*
* This is governed by the NASA Open Source Agreement and may be used,
* distributed and modified only according to the terms of that agreement.
*
*/
/**
* \file ut-adaptor-exceptions.c
* \ingroup adaptors
* \author [email protected]
*
*/
#include "ut-adaptor-exceptions.h"
#include "cfe_psp_config.h"
#include "cfe_psp_memory.h"
#define CFE_PSP_MAX_EXCEPTION_ENTRIES 4
#define CFE_PSP_MAX_EXCEPTION_BACKTRACE_SIZE 16
uint32 UT_Get_Exception_MaxEntries(void)
{
return CFE_PSP_MAX_EXCEPTION_ENTRIES;
}
size_t UT_Get_Exception_Size(void)
{
return sizeof(CFE_PSP_Exception_ContextDataEntry_t);
}
void UT_Generate_Exception_Context(struct CFE_PSP_Exception_LogData *Buffer, size_t Size)
{
size_t i;
uint8 *Dest = (uint8 *)&Buffer->context_info;
for (i = 0; i < Size && i < sizeof(Buffer->context_info); ++i)
{
*Dest = i & 0xFF;
}
Buffer->context_size = i;
}
uint32 UT_Get_Exception_Id(struct CFE_PSP_Exception_LogData *Buffer)
{
return Buffer->context_id;
}