gr55xx_fpb.h
Go to the documentation of this file.
1
47 #ifndef __GR55XX_FPB_H_
48 #define __GR55XX_FPB_H_
49
50 #include <stdint.h>
51 #include <stdio.h>
52 #include <stdbool.h>
53
59 typedef enum
60 {
61 FPB_MODE_PATCH_ONLY = 0,
62 FPB_MODE_DEBUG_ONLY,
63 FPB_MODE_PATCH_AND_DEBUG,
64 } fpb_mode_t ;
65
67 typedef enum
68 {
69 FPB_PATCH_OFF = 0,
70 FPB_PATCH_ON,
71 } fpb_state_t;
72
74 typedef struct
75 {
76 volatile uint32_t CTRL;
77 volatile uint32_t REMAP;
78 volatile uint32_t COMP[8];
79 } FPB_REG_TypeDef;
85 #define FPB ((FPB_REG_TypeDef *) 0xE0002000UL)
94 typedef void(*fun_t)(void);
95
109 void fpb_enable(uint8_t index_start ,uint8_t index_end);
110
120 int fun_replace_by_svc(uint32_t ori_func, uint32_t rep_func, uint8_t patch_table_num);
121
128 uint32_t SVC_handler_proc(uint32_t *svc_args);
129
137 void fpb_register_patch_init_func(fun_t patch_enable_func);
138
146 void fpb_init(fpb_mode_t fpb_mode);
147
156 void svc_func_register(uint8_t svc_num, uint32_t func);
157
165 void svc_table_register(uint32_t *p_svc_table);
166
174 void fpb_register_user_space(uint32_t *user_fpb_space);
175
183 fpb_state_t fpb_save_state(void);
184
192 void fpb_load_state(fpb_state_t state);
193
195 #endif
196
fun_t
void(* fun_t)(void)
FPB function.
Definition: gr55xx_fpb.h:94
fpb_init
void fpb_init(fpb_mode_t fpb_mode)
FPB init function.
FPB_REG_TypeDef::REMAP
volatile uint32_t REMAP
Definition: gr55xx_fpb.h:77
fun_replace_by_svc
int fun_replace_by_svc(uint32_t ori_func, uint32_t rep_func, uint8_t patch_table_num)
Replace old and new functions.
FPB_PATCH_ON
@ FPB_PATCH_ON
Definition: gr55xx_fpb.h:70
FPB_PATCH_OFF
@ FPB_PATCH_OFF
Definition: gr55xx_fpb.h:69
fpb_load_state
void fpb_load_state(fpb_state_t state)
load the FPB state
FPB_REG_TypeDef::CTRL
volatile uint32_t CTRL
Definition: gr55xx_fpb.h:76
FPB_REG_TypeDef
FPB register.
Definition: gr55xx_fpb.h:75
FPB_MODE_PATCH_ONLY
@ FPB_MODE_PATCH_ONLY
Definition: gr55xx_fpb.h:61
FPB_MODE_DEBUG_ONLY
@ FPB_MODE_DEBUG_ONLY
Definition: gr55xx_fpb.h:62
FPB_MODE_PATCH_AND_DEBUG
@ FPB_MODE_PATCH_AND_DEBUG
Definition: gr55xx_fpb.h:63
svc_table_register
void svc_table_register(uint32_t *p_svc_table)
register sve table function
fpb_enable
void fpb_enable(uint8_t index_start, uint8_t index_end)
Enabling patch function.
fpb_register_user_space
void fpb_register_user_space(uint32_t *user_fpb_space)
register fpb space from user layer
fpb_register_patch_init_func
void fpb_register_patch_init_func(fun_t patch_enable_func)
Register FPB patch enable function.
fpb_state_t
fpb_state_t
FPB state.
Definition: gr55xx_fpb.h:68
fpb_save_state
fpb_state_t fpb_save_state(void)
save the FPB state
svc_func_register
void svc_func_register(uint8_t svc_num, uint32_t func)
svc sub-function register
fpb_mode_t
fpb_mode_t
FPB mode.
Definition: gr55xx_fpb.h:60
SVC_handler_proc
uint32_t SVC_handler_proc(uint32_t *svc_args)
SVC handler process function.