Convert the CCS4 MSP430X port layer to permit large and small data models, and large and small code models.

This commit is contained in:
Richard Barry 2011-01-03 16:48:59 +00:00
parent 2c894e0f55
commit 9a24d4a37f
4 changed files with 155 additions and 44 deletions

View file

@ -53,6 +53,8 @@
; * The definition of the "register test" tasks, as described at the top of
; * main.c
.include data_model.h
.global vTaskIncrementTick
.global vTaskSwitchContext
.global vPortSetupTimerInterrupt
@ -69,21 +71,21 @@
portSAVE_CONTEXT .macro
;Save the remaining registers.
pushm.a #12, r15
movx.w &usCriticalNesting, r14
pushx.a r14
movx.a &pxCurrentTCB, r12
movx.a sp, 0( r12 )
pushm_x #12, r15
mov.w &usCriticalNesting, r14
push_x r14
mov_x &pxCurrentTCB, r12
mov_x sp, 0( r12 )
.endm
;-----------------------------------------------------------
portRESTORE_CONTEXT .macro
movx.a &pxCurrentTCB, r12
movx.a @r12, sp
popx.a r15
movx.w r15, &usCriticalNesting
popm.a #12, r15
mov_x &pxCurrentTCB, r12
mov_x @r12, sp
pop_x r15
mov.w r15, &usCriticalNesting
popm_x #12, r15
;The last thing on the stack will be the status register.
;Ensure the power down bits are clear ready for the next
@ -91,7 +93,7 @@ portRESTORE_CONTEXT .macro
bic.w #0xf0, 0( sp )
pop.w sr
reta
ret_x
.endm
;-----------------------------------------------------------
@ -113,8 +115,8 @@ vPortPreemptiveTickISR:
push.w sr
portSAVE_CONTEXT
calla #vTaskIncrementTick
calla #vTaskSwitchContext
call_x #vTaskIncrementTick
call_x #vTaskSwitchContext
portRESTORE_CONTEXT
;-----------------------------------------------------------
@ -126,7 +128,7 @@ vPortCooperativeTickISR:
push.w sr
portSAVE_CONTEXT
calla #vTaskIncrementTick
call_x #vTaskIncrementTick
portRESTORE_CONTEXT
;-----------------------------------------------------------
@ -147,7 +149,7 @@ vPortYield:
portSAVE_CONTEXT
; Select the next task to run.
calla #vTaskSwitchContext
call_x #vTaskSwitchContext
; Restore the context of the new task.
portRESTORE_CONTEXT
@ -162,7 +164,7 @@ xPortStartScheduler:
; Setup the hardware to generate the tick. Interrupts are disabled
; when this function is called.
calla #vPortSetupTimerInterrupt
call_x #vPortSetupTimerInterrupt
; Restore the context of the first task that is going to run.
portRESTORE_CONTEXT