Skip to content

Commit 099f05d

Browse files
committed
First pass changes.
1 parent 39f3520 commit 099f05d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

Ports/NiosII/GNU/os_cpu_c.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ static INT16U OSTmrCtr;
7373
*********************************************************************************************************
7474
*/
7575

76-
OS_STK *OSTaskStkInit(void (*task)(void *pd), void *pdata, OS_STK *pstk, INT16U opt)
76+
OS_STK *OSTaskStkInit (void (*task)(void *p_arg),
77+
void *pdata,
78+
OS_STK *ptos,
79+
INT16U opt)
7780
{
7881
INT32U *frame_pointer;
7982
INT32U *stk;
@@ -87,7 +90,7 @@ OS_STK *OSTaskStkInit(void (*task)(void *pd), void *pdata, OS_STK *pstk, INT16U
8790
* a single reent structure is used for all threads, which saves memory.
8891
*/
8992

90-
local_impure_ptr = (struct _reent*)((((INT32U)(pstk)) & ~0x3) - sizeof(struct _reent));
93+
local_impure_ptr = (struct _reent*)((((INT32U)(ptos)) & ~0x3) - sizeof(struct _reent));
9194

9295
_REENT_INIT_PTR (local_impure_ptr);
9396

@@ -98,14 +101,14 @@ OS_STK *OSTaskStkInit(void (*task)(void *pd), void *pdata, OS_STK *pstk, INT16U
98101

99102
frame_pointer = (INT32U*) local_impure_ptr;
100103
#else
101-
frame_pointer = (INT32U*) (((INT32U)(pstk)) & ~0x3);
104+
frame_pointer = (INT32U*) (((INT32U)(ptos)) & ~0x3);
102105
#endif /* OS_THREAD_SAFE_NEWLIB */
103106
stk = frame_pointer - 13;
104107

105108
/* Now fill the stack frame. */
106109

107110
stk[12] = (INT32U)task; /* task address (ra) */
108-
stk[11] = (INT32U) pdata; /* first register argument (r4) */
111+
stk[11] = (INT32U)pdata; /* first register argument (r4) */
109112

110113
#if OS_THREAD_SAFE_NEWLIB
111114
stk[10] = (INT32U) local_impure_ptr; /* value of _impure_ptr for this thread */
@@ -136,7 +139,7 @@ OS_STK *OSTaskStkInit(void (*task)(void *pd), void *pdata, OS_STK *pstk, INT16U
136139
*********************************************************************************************************
137140
*/
138141

139-
void OSTaskCreateHook (OS_TCB *ptcb)
142+
void OSTaskCreateHook (OS_TCB *ptcb)
140143
{
141144
ptcb = ptcb; /* Prevent compiler warning */
142145
}
@@ -154,7 +157,7 @@ void OSTaskCreateHook (OS_TCB *ptcb)
154157
*********************************************************************************************************
155158
*/
156159

157-
void OSTaskDelHook (OS_TCB *ptcb)
160+
void OSTaskDelHook (OS_TCB *ptcb)
158161
{
159162
ptcb = ptcb; /* Prevent compiler warning */
160163
}
@@ -176,7 +179,7 @@ void OSTaskDelHook (OS_TCB *ptcb)
176179
*********************************************************************************************************
177180
*/
178181

179-
void OSTaskSwHook (void)
182+
void OSTaskSwHook (void)
180183
{
181184
}
182185

@@ -192,7 +195,7 @@ void OSTaskSwHook (void)
192195
*********************************************************************************************************
193196
*/
194197

195-
void OSTaskStatHook (void)
198+
void OSTaskStatHook (void)
196199
{
197200
}
198201

@@ -214,10 +217,10 @@ void OSTaskStatHook (void)
214217
* Do that here to avoid build warnings.
215218
*/
216219
#ifdef ALT_INICHE
217-
void cticks_hook(void);
220+
void cticks_hook (void);
218221
#endif
219222

220-
void OSTimeTickHook (void)
223+
void OSTimeTickHook (void)
221224
{
222225
#if OS_TMR_EN > 0
223226
OSTmrCtr++;
@@ -233,26 +236,26 @@ void OSTimeTickHook (void)
233236
#endif
234237
}
235238

236-
void OSInitHookBegin(void)
239+
void OSInitHookBegin (void)
237240
{
238241
#if OS_TMR_EN > 0
239242
OSTmrCtr = 0;
240243
#endif
241244
}
242245

243-
void OSInitHookEnd(void)
246+
void OSInitHookEnd (void)
244247
{
245248
}
246249

247-
void OSTaskIdleHook(void)
250+
void OSTaskIdleHook (void)
248251
{
249252
}
250253

251-
void OSTaskReturnHook(OS_TCB *ptcb)
254+
void OSTaskReturnHook (OS_TCB *ptcb)
252255
{
253256
}
254257

255-
void OSTCBInitHook(OS_TCB *ptcb)
258+
void OSTCBInitHook (OS_TCB *ptcb)
256259
{
257260
}
258261

0 commit comments

Comments
 (0)