Xtensa: Remove co-processor ownership array. I think that this is not needed (but I might be wrong).

This commit is contained in:
Gregory Nutt 2016-10-29 09:50:51 -06:00
parent ccf5b4e357
commit 4943b09ffa
4 changed files with 0 additions and 118 deletions

View File

@ -237,10 +237,7 @@ void xtensa_dumpstate(void);
/* Initialization */
#if XCHAL_CP_NUM > 0
void xtensa_coproc_init(void);
struct xtensa_cpstate_s;
void xtensa_coproc_release(struct xtensa_cpstate_s *cpstate);
void xtensa_coproc_enable(struct xtensa_cpstate_s *cpstate, int cpset);
void xtensa_coproc_disable(struct xtensa_cpstate_s *cpstate, int cpset);
#endif

View File

@ -71,114 +71,6 @@ _xtensa_coproc_saoffsets:
.text
/****************************************************************************
* Name: xtensa_coproc_init
*
* Description:
* Initializes.global co-processor management data, setting all co-
* processors to "unowned". Leaves CPENABLE as it found it (does NOT clear
* it).
*
* Called during initialization of the NuttX, before any threads run.
*
* This may be called from normal Xtensa single-threaded application code
* which might use co-processors. The Xtensa run-time initialization
* enables all co-processors. They must remain enabled here, else a co-
* processor exception might occur outside of a thread, which the exception
* handler doesn't expect.
*
* Entry Conditions:
* Xtensa single-threaded run-time environment is in effect.
* No thread is yet running.
*
* Exit conditions:
* None.
*
* Obeys ABI conventions per prototype:
* void xtensa_coproc_init(void)
*
****************************************************************************/
.global xtensa_coproc_init
.type xtensa_coproc_init, @function
.align 4
.literal_position
.align 4
xtensa_coproc_init:
/* Initialize thread co-processor ownerships to 0 (unowned). */
movi a2, _xt_coproc_owner_sa /* a2 = base of owner array */
addi a3, a2, (XTENSA_CP_MAX*portNUM_PROCESSORS) << 2 /* a3 = top+1 of owner array */
movi a4, 0 /* a4 = 0 (unowned) */
1: s32i a4, a2, 0
addi a2, a2, 4
bltu a2, a3, 1b
ret
.size xtensa_coproc_init, . - xtensa_coproc_init
/****************************************************************************
* Name: xtensa_coproc_release
*
* Description:
* Releases any and all co-processors owned by a given thread. The thread
* is identified by it's co-processor state save area defined in
* xtensa_context.h .
*
* Must be called before a thread's co-proc save area is deleted to avoid
* memory corruption when the exception handler tries to save the state.
* May be called when a thread terminates or completes but does not delete
* the co-proc save area, to avoid the exception handler having to save the
* thread's co-proc state before another thread can use it (optimization).
*
* Entry Conditions:
* A2 = Pointer to base of co-processor state save area.
*
* Exit conditions:
* None.
*
* Obeys ABI conventions per prototype:
* void xtensa_coproc_release(void * coproc_sa_base)
*
****************************************************************************/
.global xtensa_coproc_release
.type xtensa_coproc_release, @function
.align 4
.literal_position
.align 4
xtensa_coproc_release:
getcoreid a5
movi a3, XTENSA_CP_MAX << 2
mull a5, a5, a3
movi a3, _xt_coproc_owner_sa /* a3 = base of owner array */
add a3, a3, a5
addi a4, a3, XTENSA_CP_MAX << 2 /* a4 = top+1 of owner array */
movi a5, 0 /* a5 = 0 (unowned) */
rsil a6, XCHAL_EXCM_LEVEL /* Lock interrupts */
1: l32i a7, a3, 0 /* a7 = owner at a3 */
bne a2, a7, 2f /* if (coproc_sa_base == owner) */
s32i a5, a3, 0 /* owner = unowned */
2: addi a3, a3, 1<<2 /* a3 = next entry in owner array */
bltu a3, a4, 1b /* repeat until end of array */
3: wsr a6, PS /* Restore interrupts */
ret
.size xtensa_coproc_release, . - xtensa_coproc_release
/****************************************************************************
* Name: _xtensa_coproc_savestate
*

View File

@ -159,7 +159,6 @@ void _exit(int status)
/* Disable co-processor support for the task that is exit-ing. */
tcb = this_task();
xtensa_coproc_release(&tcb->xcp.cpstate);
xtensa_coproc_disable(&tcb->xcp.cpstate, XTENSA_CP_ALLSET);
#endif

View File

@ -134,12 +134,6 @@ void up_initialize(void)
xtensa_add_region();
#if XCHAL_CP_NUM > 0
/* Initialize co-processor management. */
xtensa_coproc_init();
#endif
/* Initialize the interrupt subsystem */
xtensa_irq_initialize();