Skip to content

Commit 49e8831

Browse files
Fix compilation issue of IA32_flat port (#1122)
* Fix compilation issue of IAR32 port * Add new line at EOF * Fix header check --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
1 parent 294569e commit 49e8831

File tree

1 file changed

+71
-74
lines changed

1 file changed

+71
-74
lines changed

portable/GCC/IA32_flat/ISR_Support.h

Lines changed: 71 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -26,106 +26,103 @@
2626
*
2727
*/
2828

29-
.extern ulTopOfSystemStack
30-
.extern ulInterruptNesting
29+
.extern ulTopOfSystemStack
30+
.extern ulInterruptNesting
3131

3232
/*-----------------------------------------------------------*/
3333

34-
.macro portFREERTOS_INTERRUPT_ENTRY
34+
.macro portFREERTOS_INTERRUPT_ENTRY
3535

36-
/* Save general purpose registers. */
37-
pusha
36+
/* Save general purpose registers. */
37+
pusha
3838

39-
/* If ulInterruptNesting is zero the rest of the task context will need
40-
* saving and a stack switch might be required. */
41-
movl ulInterruptNesting, % eax
42-
test % eax, % eax
43-
jne 2f
39+
/* If ulInterruptNesting is zero the rest of the task context will need
40+
saving and a stack switch might be required. */
41+
movl ulInterruptNesting, %eax
42+
test %eax, %eax
43+
jne 2f
4444

45-
/* Interrupts are not nested, so save the rest of the task context. */
46-
.
45+
/* Interrupts are not nested, so save the rest of the task context. */
46+
.if configSUPPORT_FPU == 1
4747

48-
if configSUPPORT_FPU == 1
48+
/* If the task has a buffer allocated to save the FPU context then
49+
save the FPU context now. */
50+
movl pucPortTaskFPUContextBuffer, %eax
51+
test %eax, %eax
52+
je 1f
53+
fnsave ( %eax ) /* Save FLOP context into ucTempFPUBuffer array. */
54+
fwait
4955

50-
/* If the task has a buffer allocated to save the FPU context then
51-
* save the FPU context now. */
52-
movl pucPortTaskFPUContextBuffer, % eax
53-
test % eax, % eax
54-
je 1f
55-
fnsave( % eax ) /* Save FLOP context into ucTempFPUBuffer array. */
56-
fwait
56+
1:
57+
/* Save the address of the FPU context, if any. */
58+
push pucPortTaskFPUContextBuffer
5759

58-
1 :
59-
/* Save the address of the FPU context, if any. */
60-
push pucPortTaskFPUContextBuffer
60+
.endif /* configSUPPORT_FPU */
6161

62-
.endif /* configSUPPORT_FPU */
62+
/* Find the TCB. */
63+
movl pxCurrentTCB, %eax
6364

64-
/* Find the TCB. */
65-
movl pxCurrentTCB, % eax
65+
/* Stack location is first item in the TCB. */
66+
movl %esp, (%eax)
6667

67-
/* Stack location is first item in the TCB. */
68-
movl % esp, ( % eax )
68+
/* Switch stacks. */
69+
movl ulTopOfSystemStack, %esp
70+
movl %esp, %ebp
6971

70-
/* Switch stacks. */
71-
movl ulTopOfSystemStack, % esp
72-
movl % esp, % ebp
72+
2:
73+
/* Increment nesting count. */
74+
add $1, ulInterruptNesting
7375

74-
2 :
75-
/* Increment nesting count. */
76-
add $1, ulInterruptNesting
77-
78-
.endm
76+
.endm
7977
/*-----------------------------------------------------------*/
8078

81-
.macro portINTERRUPT_EPILOGUE
82-
83-
cli
84-
sub $1, ulInterruptNesting
79+
.macro portINTERRUPT_EPILOGUE
8580

86-
/* If the nesting has unwound to zero. */
87-
movl ulInterruptNesting, % eax
88-
test % eax, % eax
89-
jne 2f
81+
cli
82+
sub $1, ulInterruptNesting
9083

91-
/* If a yield was requested then select a new TCB now. */
92-
movl ulPortYieldPending, % eax
93-
test % eax, % eax
94-
je 1f
95-
movl $0, ulPortYieldPending
96-
call vTaskSwitchContext
84+
/* If the nesting has unwound to zero. */
85+
movl ulInterruptNesting, %eax
86+
test %eax, %eax
87+
jne 2f
9788

98-
1 :
99-
/* Stack location is first item in the TCB. */
100-
movl pxCurrentTCB, % eax movl( % eax ), % esp
89+
/* If a yield was requested then select a new TCB now. */
90+
movl ulPortYieldPending, %eax
91+
test %eax, %eax
92+
je 1f
93+
movl $0, ulPortYieldPending
94+
call vTaskSwitchContext
10195

102-
.
96+
1:
97+
/* Stack location is first item in the TCB. */
98+
movl pxCurrentTCB, %eax
99+
movl (%eax), %esp
103100

104-
if configSUPPORT_FPU == 1
101+
.if configSUPPORT_FPU == 1
105102

106-
/* Restore address of task's FPU context buffer. */
107-
pop pucPortTaskFPUContextBuffer
103+
/* Restore address of task's FPU context buffer. */
104+
pop pucPortTaskFPUContextBuffer
108105

109-
/* If the task has a buffer allocated in which its FPU context is saved,
110-
* then restore it now. */
111-
movl pucPortTaskFPUContextBuffer, % eax
112-
test % eax, % eax
113-
je 1f
114-
frstor( % eax )
115-
1 :
116-
.endif
106+
/* If the task has a buffer allocated in which its FPU context is saved,
107+
then restore it now. */
108+
movl pucPortTaskFPUContextBuffer, %eax
109+
test %eax, %eax
110+
je 1f
111+
frstor ( %eax )
112+
1:
113+
.endif
117114

118-
2 :
119-
popa
115+
2:
116+
popa
120117

121-
.endm
118+
.endm
122119
/*-----------------------------------------------------------*/
123120

124-
.macro portFREERTOS_INTERRUPT_EXIT
121+
.macro portFREERTOS_INTERRUPT_EXIT
125122

126-
portINTERRUPT_EPILOGUE
127-
/* EOI. */
128-
movl $0x00, ( 0xFEE000B0 )
129-
iret
123+
portINTERRUPT_EPILOGUE
124+
/* EOI. */
125+
movl $0x00, (0xFEE000B0)
126+
iret
130127

131-
.endm
128+
.endm

0 commit comments

Comments
 (0)