Skip to content

Commit 1e2487d

Browse files
committed
arch: arc: fix secureshield compile issue, modify typedef by adding _T to end of types
Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
1 parent 3c5392d commit 1e2487d

File tree

9 files changed

+49
-49
lines changed

9 files changed

+49
-49
lines changed

include/arc/arc_exception.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ typedef struct int_exc_frame {
9797
uint32_t ret;
9898
uint32_t sec_stat;
9999
uint32_t status32;
100-
} EMBARC_PACKED INT_EXC_FRAME;
100+
} EMBARC_PACKED INT_EXC_FRAME_T;
101101
#else
102102
typedef struct int_exc_frame {
103103
uint32_t erbta;
@@ -131,7 +131,7 @@ typedef struct int_exc_frame {
131131

132132
uint32_t ret;
133133
uint32_t status32;
134-
} EMBARC_PACKED INT_EXC_FRAME;
134+
} EMBARC_PACKED INT_EXC_FRAME_T;
135135
#endif
136136

137137
typedef struct dsp_ext_frame {
@@ -146,7 +146,7 @@ typedef struct dsp_ext_frame {
146146
uint32_t acc0_lo;
147147
uint32_t dsp_ctrl;
148148

149-
} EMBARC_PACKED DSP_EXT_FRAME;
149+
} EMBARC_PACKED DSP_EXT_FRAME_T;
150150

151151
typedef struct fpu_ext_frame {
152152
#if ARC_FEATURE_FPU_DA
@@ -159,18 +159,18 @@ typedef struct fpu_ext_frame {
159159
uint32_t fpu_status;
160160
uint32_t fpu_ctrl;
161161

162-
} EMBARC_PACKED FPU_EXT_FRAME;
162+
} EMBARC_PACKED FPU_EXT_FRAME_T;
163163

164164
typedef struct callee_frame {
165165

166166
#if ARC_FEATURE_FPU_DSP_CONTEXT
167167

168168
#if ARC_FEATURE_DSP
169-
DSP_EXT_FRAME dsp_regs;
169+
DSP_EXT_FRAME_T dsp_regs;
170170
#endif
171171

172172
#if ARC_FEATURE_FPU
173-
FPU_EXT_FRAME fpu_ext_regs;
173+
FPU_EXT_FRAME_T fpu_ext_regs;
174174
#endif
175175

176176
#endif /* ARC_FEATURE_FPU_DSP_CONTEXT */
@@ -199,16 +199,16 @@ typedef struct callee_frame {
199199
uint32_t r15;
200200
uint32_t r14;
201201
uint32_t r13;
202-
} EMBARC_PACKED CALLEE_FRAME;
202+
} EMBARC_PACKED CALLEE_FRAME_T;
203203

204204
typedef struct processor_frame {
205-
CALLEE_FRAME callee_regs;
206-
INT_EXC_FRAME exc_frame;
207-
} EMBARC_PACKED PROCESSOR_FRAME;
205+
CALLEE_FRAME_T callee_regs;
206+
INT_EXC_FRAME_T exc_frame;
207+
} EMBARC_PACKED PROCESSOR_FRAME_T;
208208

209-
#define ARC_PROCESSOR_FRAME_SIZE (sizeof(PROCESSOR_FRAME) / sizeof(uint32_t))
210-
#define ARC_EXC_FRAME_SIZE (sizeof(INT_EXC_FRAME) / sizeof(uint32_t))
211-
#define ARC_CALLEE_FRAME_SIZE (sizeof(CALLEE_FRAME) / sizeof(uint32_t))
209+
#define ARC_PROCESSOR_FRAME_T_SIZE (sizeof(PROCESSOR_FRAME_T) / sizeof(uint32_t))
210+
#define ARC_EXC_FRAME_T_SIZE (sizeof(INT_EXC_FRAME_T) / sizeof(uint32_t))
211+
#define ARC_CALLEE_FRAME_T_SIZE (sizeof(CALLEE_FRAME_T) / sizeof(uint32_t))
212212

213213
#ifdef OS_FREERTOS
214214
extern uint32_t exc_nest_count;

library/secureshield/core/inc/secureshield_int.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ extern void secureshield_int_init(void);
5656

5757

5858
#if SECURESHIELD_VERSION == 1
59-
extern uint32_t secureshield_interrupt_handle(INT_EXC_FRAME *sp);
60-
extern uint32_t secureshield_int_return(INT_EXC_FRAME *sp);
61-
extern void secureshield_int_ops(INT_EXC_FRAME *frame);
59+
extern uint32_t secureshield_interrupt_handle(INT_EXC_FRAME_T *sp);
60+
extern uint32_t secureshield_int_return(INT_EXC_FRAME_T *sp);
61+
extern void secureshield_int_ops(INT_EXC_FRAME_T *frame);
6262

6363
#elif SECURESHIELD_VERSION == 2
6464
extern void * secureshield_interrupt_handle(uint32_t *sp);

library/secureshield/core/inc/secureshield_sys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern int32_t secure_container_id_self(void);
3939

4040
#if SECURESHIELD_VERSION == 1
4141

42-
extern void secureshield_sys_ops(INT_EXC_FRAME *frame);
42+
extern void secureshield_sys_ops(INT_EXC_FRAME_T *frame);
4343

4444
#elif SECURESHIELD_VERSION == 2
4545
/* secureshield version 1 specific system services */

library/secureshield/core/src/arc_hal/secureshield_int.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ uint32_t* dst_container_user_sp;
695695
* \param[in] src_frame interrupt frame
696696
* \return target container sp
697697
*/
698-
uint32_t secureshield_interrupt_handle(INT_EXC_FRAME *src_frame)
698+
uint32_t secureshield_interrupt_handle(INT_EXC_FRAME_T *src_frame)
699699
{
700700
uint32_t src_id, dst_id;
701701
INT_HANDLER_T handler;
@@ -737,7 +737,7 @@ uint32_t secureshield_interrupt_handle(INT_EXC_FRAME *src_frame)
737737
/* switch access control table */
738738
vmpu_switch(src_id, dst_id);
739739
/* save current state */
740-
container_stack_push(src_id, (uint32_t *)src_frame - ARC_CALLEE_FRAME_SIZE,
740+
container_stack_push(src_id, (uint32_t *)src_frame - ARC_CALLEE_FRAME_T_SIZE,
741741
(uint32_t *)arc_aux_read(AUX_USER_SP), src_frame->status32, dst_id);
742742
/* gather information from current state */
743743

@@ -760,7 +760,7 @@ uint32_t secureshield_interrupt_handle(INT_EXC_FRAME *src_frame)
760760

761761
return 0;
762762
} else {
763-
container_stack_push(src_id, (uint32_t *)src_frame - ARC_CALLEE_FRAME_SIZE,
763+
container_stack_push(src_id, (uint32_t *)src_frame - ARC_CALLEE_FRAME_T_SIZE,
764764
(uint32_t *)arc_aux_read(AUX_USER_SP), src_frame->status32, dst_id);
765765
arc_aux_write(AUX_ERRET, (uint32_t)handler);
766766
arc_aux_write(AUX_ERSTATUS, src_frame->status32);
@@ -776,15 +776,15 @@ uint32_t secureshield_interrupt_handle(INT_EXC_FRAME *src_frame)
776776
* \param[in] dst_frame exception frame
777777
* \return target container sp
778778
*/
779-
uint32_t secureshield_int_return(INT_EXC_FRAME *dst_frame)
779+
uint32_t secureshield_int_return(INT_EXC_FRAME_T *dst_frame)
780780
{
781781
uint32_t src_id, dst_id;
782782

783783

784784
/* discard the created cpu frame, recover the original sp of destination container */
785785
dst_id = g_container_stack_curr_id;
786786

787-
if (container_stack_pop(dst_id, (uint32_t *)dst_frame + ARC_EXC_FRAME_SIZE,
787+
if (container_stack_pop(dst_id, (uint32_t *)dst_frame + ARC_EXC_FRAME_T_SIZE,
788788
(uint32_t *)arc_aux_read(AUX_USER_SP), dst_frame->status32) != 0 ) {
789789
return 0;
790790
}
@@ -813,7 +813,7 @@ uint32_t secureshield_int_return(INT_EXC_FRAME *dst_frame)
813813
* \brief interrupt operation handler
814814
* \param[in] frame exception frame
815815
*/
816-
void secureshield_int_ops(INT_EXC_FRAME *frame)
816+
void secureshield_int_ops(INT_EXC_FRAME_T *frame)
817817
{
818818
/* FIXME: remove switch case structure, use jump table */
819819
/* r0 is used as operation id */
@@ -907,7 +907,7 @@ void * secureshield_interrupt_handle(uint32_t *sp)
907907
if (src_id != dst_id) {
908908
vmpu_switch(src_id, dst_id);
909909

910-
container_stack_push(src_id, (uint32_t *)sp - ARC_CALLEE_FRAME_SIZE,
910+
container_stack_push(src_id, (uint32_t *)sp - ARC_CALLEE_FRAME_T_SIZE,
911911
(uint32_t *)arc_aux_read(AUX_KERNEL_SP), arc_aux_read(AUX_STATUS32),
912912
dst_id);
913913

library/secureshield/core/src/secureshield_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int32_t secure_container_id_caller(void)
214214
* \brief system service provided by secureshield runtime
215215
* \param[in] frame exception frame
216216
*/
217-
void secureshield_sys_ops(INT_EXC_FRAME *frame)
217+
void secureshield_sys_ops(INT_EXC_FRAME_T *frame)
218218
{
219219
/* FIXME: remove switch case structure, use jump table */
220220
/* r0 is used as operation id */

library/secureshield/core/src/secureshield_vmpu_arc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ aligned to the size of region and the region's size must be 2K, 4K, 8K ...*/
633633
uint32_t rodata_attribute;
634634
uint32_t ram_attribute;
635635

636-
PROCESSOR_FRAME *context;
636+
PROCESSOR_FRAME_T *context;
637637

638638

639639
if (container_cfg->type == SECURESHIELD_CONTAINER_SECURE) {
@@ -681,9 +681,9 @@ aligned to the size of region and the region's size must be 2K, 4K, 8K ...*/
681681
arc_aux_write(AUX_ERSTATUS, g_container_context[0].cpu_status);
682682
} else {
683683
if (container_cfg->type == SECURESHIELD_CONTAINER_SECURE) {
684-
context = (PROCESSOR_FRAME *) (container_cfg->stack_area - ARC_PROCESSOR_FRAME_SIZE);
684+
context = (PROCESSOR_FRAME_T *) (container_cfg->stack_area - ARC_PROCESSOR_FRAME_T_SIZE);
685685
} else {
686-
context = (PROCESSOR_FRAME *) (container_cfg->stack_secure - ARC_PROCESSOR_FRAME_SIZE);
686+
context = (PROCESSOR_FRAME_T *) (container_cfg->stack_secure - ARC_PROCESSOR_FRAME_T_SIZE);
687687
context->callee_regs.user_sp = (uint32_t)container_cfg->stack_area;
688688
g_container_context[container_id].normal_sp = container_cfg->stack_area;
689689
}
@@ -694,7 +694,7 @@ aligned to the size of region and the region's size must be 2K, 4K, 8K ...*/
694694
uint32_t size;
695695
uint32_t secure;
696696

697-
PROCESSOR_FRAME *context;
697+
PROCESSOR_FRAME_T *context;
698698

699699
secure = container_cfg->type;
700700

@@ -736,10 +736,10 @@ aligned to the size of region and the region's size must be 2K, 4K, 8K ...*/
736736
} else {
737737
/* \todo init cpu status ? */
738738
if (secure == SECURESHIELD_AC_SECURE) {
739-
context = (PROCESSOR_FRAME *) (container_cfg->stack_area - ARC_PROCESSOR_FRAME_SIZE);
739+
context = (PROCESSOR_FRAME_T *) (container_cfg->stack_area - ARC_PROCESSOR_FRAME_T_SIZE);
740740
context->callee_regs.secure_kernel_sp = (uint32_t)container_cfg->stack_area;
741741
} else {
742-
context = (PROCESSOR_FRAME *) (container_cfg->stack_secure - ARC_PROCESSOR_FRAME_SIZE);
742+
context = (PROCESSOR_FRAME_T *) (container_cfg->stack_secure - ARC_PROCESSOR_FRAME_T_SIZE);
743743
context->callee_regs.kernel_sp = (uint32_t)container_cfg->stack_area;
744744
context->callee_regs.secure_kernel_sp = (uint32_t)container_cfg->stack_secure;
745745
g_container_context[container_id].normal_sp =container_cfg->stack_area;

library/secureshield/core/src/v1/secureshield_trap.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ extern void secureshield_exc_entry_cpu(void);
4545
* \param[in] src_frame exception handling
4646
* \return target container sp
4747
*/
48-
static uint32_t trap_container_call_in(INT_EXC_FRAME *src_frame)
48+
static uint32_t trap_container_call_in(INT_EXC_FRAME_T *src_frame)
4949
{
5050
uint32_t trap_pc;
5151
uint8_t src_id, dst_id;
52-
PROCESSOR_FRAME *dst_frame;
52+
PROCESSOR_FRAME_T *dst_frame;
5353
uint32_t dst_fn;
5454
/* number of arguments to pass to the target function */
5555
uint8_t args;
@@ -92,13 +92,13 @@ static uint32_t trap_container_call_in(INT_EXC_FRAME *src_frame)
9292

9393
/* push the calling container and set the callee container */
9494
/* the left registers of src container will be saved later, reserve space here */
95-
if (container_stack_push(src_id, ((uint32_t *)src_frame) - ARC_CALLEE_FRAME_SIZE,
95+
if (container_stack_push(src_id, ((uint32_t *)src_frame) - ARC_CALLEE_FRAME_T_SIZE,
9696
(uint32_t *)arc_aux_read(AUX_USER_SP), src_frame->status32, dst_id) != 0) {
9797
return 0;
9898
}
9999

100100
/* create the cpu frame and exception frame for the destination container */
101-
dst_frame = (PROCESSOR_FRAME *)(g_container_context[dst_id].cur_sp);
101+
dst_frame = (PROCESSOR_FRAME_T *)(g_container_context[dst_id].cur_sp);
102102

103103
dst_frame->exc_frame.erbta = 0; /* erbta is 0, no branch */
104104
dst_frame->exc_frame.ret = dst_fn; /* eret */
@@ -135,22 +135,22 @@ static uint32_t trap_container_call_in(INT_EXC_FRAME *src_frame)
135135
* \param[in] dst_frame exception frame
136136
* \return target container sp
137137
*/
138-
static uint32_t trap_container_call_out(INT_EXC_FRAME *dst_frame)
138+
static uint32_t trap_container_call_out(INT_EXC_FRAME_T *dst_frame)
139139
{
140140
uint32_t src_id, dst_id;
141-
PROCESSOR_FRAME *src;
141+
PROCESSOR_FRAME_T *src;
142142

143143
/* discard the created cpu frame, recover the original sp of destination container */
144144
dst_id = g_container_stack_curr_id;
145145

146-
if (container_stack_pop(dst_id, (uint32_t *)dst_frame - ARC_CALLEE_FRAME_SIZE,
146+
if (container_stack_pop(dst_id, (uint32_t *)dst_frame - ARC_CALLEE_FRAME_T_SIZE,
147147
(uint32_t *)arc_aux_read(AUX_USER_SP), dst_frame->status32) != 0) {
148148
return 0;
149149
}
150150

151151
src_id = g_container_stack[g_container_stack_ptr].src_id;
152152

153-
src = (PROCESSOR_FRAME *)g_container_stack[g_container_stack_ptr].src_sp;
153+
src = (PROCESSOR_FRAME_T *)g_container_stack[g_container_stack_ptr].src_sp;
154154

155155
/* copy return value */
156156
src->exc_frame.r0 = dst_frame->r0;
@@ -169,7 +169,7 @@ static uint32_t trap_container_call_out(INT_EXC_FRAME *dst_frame)
169169
*/
170170
uint32_t secureshield_trap_handler(void *exc_frame)
171171
{
172-
INT_EXC_FRAME *trap_frame = (INT_EXC_FRAME *)exc_frame;
172+
INT_EXC_FRAME_T *trap_frame = (INT_EXC_FRAME_T *)exc_frame;
173173
uint8_t trap_id;
174174

175175
SECURESHIELD_ASSERT(trap_frame != NULL);

library/secureshield/core/src/v2/secureshield_sjli.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ static void sjli_default_entry(void)
6868
* \param[in] src_frame container context frame
6969
* \return target container's stack pointer
7070
*/
71-
uint32_t container_call_in(INT_EXC_FRAME *src_frame)
71+
uint32_t container_call_in(INT_EXC_FRAME_T *src_frame)
7272
{
7373

7474
uint8_t src_id, dst_id;
75-
PROCESSOR_FRAME *dst_frame;
75+
PROCESSOR_FRAME_T *dst_frame;
7676
uint32_t dst_fn;
7777
/* number of arguments to pass to the target function */
7878
uint8_t args;
@@ -128,15 +128,15 @@ uint32_t container_call_in(INT_EXC_FRAME *src_frame)
128128

129129
/* push the calling container and set the callee container */
130130
/* the left registers of src container will be saved later, reserve space here */
131-
container_stack_push(src_id, ((uint32_t *)src_frame) - ARC_CALLEE_FRAME_SIZE,
131+
container_stack_push(src_id, ((uint32_t *)src_frame) - ARC_CALLEE_FRAME_T_SIZE,
132132
(uint32_t *)arc_aux_read(AUX_KERNEL_SP), src_frame->status32, dst_id);
133133

134134
if (container_is_secure(src_id)) {
135135
g_container_context[0].normal_sp = (uint32_t *)arc_aux_read(AUX_KERNEL_SP);
136136
}
137137

138138
/* create the cpu frame and exception frame for the destination container */
139-
dst_frame = (PROCESSOR_FRAME *)(g_container_context[dst_id].cur_sp);
139+
dst_frame = (PROCESSOR_FRAME_T *)(g_container_context[dst_id].cur_sp);
140140

141141
dst_frame->exc_frame.blink = dst_fn; /* eret */
142142
dst_frame->exc_frame.ret = dst_fn; /* eret */
@@ -182,10 +182,10 @@ uint32_t container_call_in(INT_EXC_FRAME *src_frame)
182182
* \param[in] status32 callee container's status register
183183
* \return caller container's stack pointer
184184
*/
185-
uint32_t container_call_out(PROCESSOR_FRAME *dst)
185+
uint32_t container_call_out(PROCESSOR_FRAME_T *dst)
186186
{
187187
uint32_t src_id, dst_id;
188-
PROCESSOR_FRAME *src;
188+
PROCESSOR_FRAME_T *src;
189189

190190
/* discard the created cpu frame, recover the original sp of destination container */
191191
dst_id = g_container_stack_curr_id;
@@ -195,7 +195,7 @@ uint32_t container_call_out(PROCESSOR_FRAME *dst)
195195

196196
src_id = g_container_stack[g_container_stack_ptr].src_id;
197197

198-
src = (PROCESSOR_FRAME *)g_container_stack[g_container_stack_ptr].src_sp;
198+
src = (PROCESSOR_FRAME_T *)g_container_stack[g_container_stack_ptr].src_sp;
199199

200200
/* copy return value */
201201
src->exc_frame.r0 = dst->exc_frame.r0;

library/secureshield/core/src/v2/secureshield_sjli.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ typedef void (*SJLI_ENTRY) (void);
5252

5353
extern const SJLI_ENTRY secureshield_sjli_entry_table[NUM_SJLI_ENTRY];
5454

55-
extern uint32_t container_call_in(INT_EXC_FRAME *src_frame);
56-
extern uint32_t container_call_out(PROCESSOR_FRAME *dst);
55+
extern uint32_t container_call_in(INT_EXC_FRAME_T *src_frame);
56+
extern uint32_t container_call_out(PROCESSOR_FRAME_T *dst);
5757
extern void sjli_init(void);
5858
extern int32_t sjli_entry_install(uint32_t no, SJLI_ENTRY entry);
5959
extern SJLI_ENTRY sjli_entry_get(uint32_t no);

0 commit comments

Comments
 (0)