Skip to content

Commit

Permalink
Suppress all useless ( push {lr} ... pop {lr} ) instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGarriou committed Jan 12, 2016
1 parent 7516ad9 commit eb8f123
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
8 changes: 0 additions & 8 deletions goil/templates/code/cortex/armv7/handler_body.goilTemplate
Expand Up @@ -23,9 +23,7 @@ tpl_primary_irq_handler_% !handlerSource %:
/* __2__ENTER_KERNEL
* Enter into kernel
*/
push {lr}
bl tpl_enter_kernel
pop {lr}

/*
* Reset tpl_kern variables
Expand Down Expand Up @@ -69,9 +67,7 @@ tpl_primary_irq_handler_% !handlerSource %:
*/
ldr r12, [r5, #KS_KERN_PTR] /* load the tpl_kern base address */
ldr r12, [r12, #TPL_KERN_OFFSET_S_RUNNING]
push {lr}
bl tpl_save_context
pop {lr}

no_save_old_context_% !handlerSource %:
#if WITH_MEMORY_PROTECTION == YES
Expand All @@ -93,9 +89,7 @@ call_tpl_run_elected_% !handlerSource %:
*/
ldr r12, [r5, #KS_KERN_PTR] /* load the tpl_kern base address */
ldr r12, [r12, #TPL_KERN_OFFSET_S_RUNNING] /* get the address of the context bloc */
push {lr}
bl tpl_load_context
pop {lr}

/********************************************
* KERNEL EXIT WITHOUT CONTEXT SWITCH STAGE *
Expand All @@ -111,9 +105,7 @@ no_context_switch_% !handlerSource %:
/* __5__LEAVE_KERNEL
* Leave kernel
*/
push {lr}
bl tpl_leave_kernel
pop {lr}

/* __6__HANDLER_EPILOG
* Leave kernel
Expand Down
4 changes: 0 additions & 4 deletions goil/templates/code/cortex/armv7/tpl_primary_irq.goilTemplate
Expand Up @@ -186,9 +186,7 @@ tpl_enter_kernel:
/*
* Switch to kernel memory protection scheme
*/
push {lr}
bl tpl_kernel_mp
pop {lr}
#endif
/*
* Manage reentrance of kernel
Expand Down Expand Up @@ -239,9 +237,7 @@ tpl_leave_kernel:
/*
* Switch to user memory protection scheme
*/
push {lr}
bl tpl_user_mp
pop {lr}
#endif
tpl_leave_kernel_exit:
bx lr
Expand Down
12 changes: 0 additions & 12 deletions machines/cortex/tpl_system_call.S
Expand Up @@ -112,9 +112,7 @@ tpl_enter_kernel:
/*
* Switch to kernel memory protection scheme
*/
push {lr}
bl tpl_kernel_mp
pop {lr}
#endif
/*
* Manage reentrance of kernel
Expand Down Expand Up @@ -165,9 +163,7 @@ tpl_leave_kernel:
/*
* Switch to user memory protection scheme
*/
push {lr}
bl tpl_user_mp
pop {lr}
#endif
tpl_leave_kernel_exit:
bx lr
Expand Down Expand Up @@ -206,9 +202,7 @@ tpl_sc_handler:
/* __2__ENTER_KERNEL
* Enter into kernel
*/
push {lr}
bl tpl_enter_kernel
pop {lr}

/*
* Get the appropriate system call address into R3
Expand Down Expand Up @@ -271,9 +265,7 @@ tpl_sc_handler:
*/
ldr r12, [r5, #KS_KERN_PTR] /* load the tpl_kern base address */
ldr r12, [r12, #TPL_KERN_OFFSET_S_RUNNING]
push {lr}
bl tpl_save_context
pop {lr}

no_save_old_context:
#if WITH_MEMORY_PROTECTION == YES
Expand All @@ -295,9 +287,7 @@ call_tpl_run_elected:
*/
ldr r12, [r5, #KS_KERN_PTR] /* load the tpl_kern base address */
ldr r12, [r12, #TPL_KERN_OFFSET_S_RUNNING] /* get the address of the context bloc */
push {lr}
bl tpl_load_context
pop {lr}

/********************************************
* KERNEL EXIT WITHOUT CONTEXT SWITCH STAGE *
Expand All @@ -314,9 +304,7 @@ no_context_switch:
/* __5__LEAVE_KERNEL
* Leave kernel
*/
push {lr}
bl tpl_leave_kernel
pop {lr}

/* __6__HANDLER_EPILOG
* Leave kernel
Expand Down

0 comments on commit eb8f123

Please sign in to comment.