patch.h
Go to the documentation of this file.
1
#ifndef __PATCH_H_
2
#define __PATCH_H_
3
4
/**
5
****************************************************************************************
6
*
7
* @file patch.h
8
*
9
* @brief offer the interface for the patch function based on the FPB of the cortex arm-m4;
10
*
11
* Copyright(C) 2016-2018, Shenzhen Goodix Technology Co., Ltd
12
* All Rights Reserved
13
*
14
****************************************************************************************
15
*/
16
17
/*
18
* ENUMERATIONS
19
****************************************************************************************
20
*/
21
enum
22
{
23
BIT_LLC_REM_ENCRYPT_PROC_CONTINUE
,
24
};
25
26
/*
27
* MACRO DECLARATIONS
28
****************************************************************************************
29
*/
30
#define PATCH_ENABLE_FLAG(BIT) (1<<BIT)
31
//please add the macro for the different application(Only Support 6 patches);
32
33
#define MANDATORY_PATCH (PATCH_ENABLE_FLAG(BIT_LLC_REM_ENCRYPT_PROC_CONTINUE))
34
35
#define OPTIMIZING_PATCH 0
36
37
/*
38
* FUNCTION DECLARATIONS
39
****************************************************************************************
40
*/
41
/**
42
* @brief The enable of the patch featurn based on the FPB of the Cortex ARM-m4.
43
* @param patch_flag the flag used to control the function to be selected as the patch function,one bit for one function.
44
* This parameter can be a combiantion of the following values:
45
* @arg @ref (1<<BIT_LLD_LLCP_OPCODE_IS_INVALID , )
46
* @arg @ref (1<<BIT_LLD_TEST_ISR, )
47
* please used the MACRO PATCH_ENABLE_FLAG(BIT) just like the MANDATORY_PATCH;
48
* and the different MACRO maybe defined for the different application;
49
* @retval None
50
*/
51
52
extern
void
set_patch_flag
(uint32_t patch_flag);
53
54
/**
55
* @brief Register the path function to the hardware patch.
56
* @param patch_index the patch index.
57
* @param func_addr the address of the patch function.
58
*
59
* @retval None
60
*/
61
void
fpb_register_patch_function
(
int
patch_index, uint32_t func_addr);
62
63
#endif // __PATCH_H_
set_patch_flag
void set_patch_flag(uint32_t patch_flag)
The enable of the patch featurn based on the FPB of the Cortex ARM-m4.
BIT_LLC_REM_ENCRYPT_PROC_CONTINUE
@ BIT_LLC_REM_ENCRYPT_PROC_CONTINUE
Definition:
patch.h:23
fpb_register_patch_function
void fpb_register_patch_function(int patch_index, uint32_t func_addr)
Register the path function to the hardware patch.