Skip to content

Commit

Permalink
arch: arm: swap: Remove old context switch code
Browse files Browse the repository at this point in the history
Remove unused context switch code from the helper assembly file that
manages the SuperVisor Call invocations (SVCs). This is no longer in use
in the code, since all calls to __swap() now go through PendSV directly.

Signed-off-by: Carles Cufi <[email protected]>
  • Loading branch information
carlescufi authored and andrewboie committed May 23, 2018
1 parent 4a54005 commit 5b37cd7
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions arch/arm/core/swap_helper.S
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ SECTION_FUNC(TEXT, __svc)

/*
* grab service call number:
* 0: context switch
* 0: Unused
* 1: irq_offload (if configured)
* 2: kernel panic or oops (software generated fatal exception)
* 3: System call
Expand All @@ -326,9 +326,7 @@ SECTION_FUNC(TEXT, __svc)
tst r2, #0x1
bne _oops

cmp r1, #0
#endif
beq _context_switch

cmp r1, #2
beq _oops
Expand All @@ -342,24 +340,6 @@ SECTION_FUNC(TEXT, __svc)
b _IntExit
#endif

_context_switch:

/*
* Unlock interrupts:
* - in a SVC call, so protected against context switches
* - allow PendSV, since it's running at prio 0xff
*/
eors.n r0, r0
msr BASEPRI, r0

/* set PENDSV bit, pending the PendSV exception */
ldr r1, =_SCS_ICSR
ldr r2, =_SCS_ICSR_PENDSV
str r2, [r1, #0]

/* handler mode exit, to PendSV */
bx lr

_oops:
push {lr}
blx _do_kernel_oops
Expand Down

0 comments on commit 5b37cd7

Please sign in to comment.