FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2005 Threads] PIC port explanationPosted by Richard on February 1, 2005 I have moved this message from the bug tracker list. Please do not submit bug trackers until it has been shown that a bug exists. Original message follows:
I'm not very much into pic-assembler (yet), but I believe there is an error in the pic-port.
From port.c:
<snippet from PortSAVECONTEXT macro> /* Save the new top of the software stack in the TCB. */ _asm MOVFF pxCurrentTCB, FSR0L MOVFF pxCurrentTCB + 1, FSR0H MOVFF FSR1L, POSTINC0 MOVFF FSR1H, POSTINC0 _endasm } </snippet from PortSAVECONTEXT macro>
<snippet from PortRESTORECONTEXT macro> /* Set FSR0 to point to pxCurrentTCB- >pxTopOfStack. */ MOVFF pxCurrentTCB, FSR0L MOVFF pxCurrentTCB + 1, FSR0H </snippet from PortRESTORECONTEXT macro>
I cannot believe that the code in the PortSAVECONTEXT- macro saves something in the TCB...
RE: PIC port explanationPosted by Richard on February 1, 2005 Here is the save context snippet with an explanation:
; Obtain the low byte of the pointer to the current ; TCB and place it in the low byte of the FSR0 ; register. MOVFF pxCurrentTCB, FSR0L
; Obtain the high byte of the pointer to the current ; TCB and place it in the high byte of the FSR0 ; register. MOVFF pxCurrentTCB + 1, FSR0H
; The FSR1 register is being used as the stack ; pointer. FSR0 now points to the current TCB ; structure - the first member of which is the top ; of stack. Store the top of stack being used into ; the TCB top of stack member.
; Move the low byte of the stack pointer into the ; TCB, then increment the pointer to the high ; byte. MOVFF FSR1L, POSTINC0
; Move the high byte of the stack pointer into the ; TCB. The FSR0 register is pointing to the high ; byte already due to the post increment in ; the statement above. MOVFF FSR1H, POSTINC0
RE: PIC port explanationPosted by Marcel van Lieshout on February 3, 2005 Thanks, it starts making sense now I'm getting more and more into pic asm...
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|