📄 history.txt
字号:
}
In TCC_Reset_Task since we are doing a complete reset we need to ensure that
tc_su_mode is 0 since the task will be started in user mode. TCC_Task_Shell
can not return and therefore left the task in supervisor mode when the task
completed. If we were to not re-initialize this field the task would become
locked in user mode and API would fail.
#if (NU_SUPERV_USER_MODE == 1)
task -> tc_su_mode = 0;
#endif
**********************************************************************************
Version 1.13 October 31, 2000
**********************************************************************************
This update contains bug fixes and enhancements. The following is a description of
the fixed bugs:
- TCCE.C (2 fixes) TCCE_Task_Sleep, TCCE_Suspend_Service
SYMPTOM: Compiler warning
SOLUTION:
In file tcce.c, line 887, this warning is generated:
"tcce.c", line 887: Warning: odd unsigned comparison with 0: '<='
tcce.c: 1 warning, 0 errors, 0 serious errors
The original line is :
/* If parameter is negative or zero, return */
if (ticks <= 0)
return;
This was changed to:
/* If parameter is zero, return */
if (ticks == 0)
return;
as this parameter is an unsigned and can never be less than zero.
SYMPTOM: If the task state is terminated or finished when NU_Suspend_Task
is called we returned NU_SUCCESS (with error checking enabled). We should
return a failure code. Note that no action is taken, the task is not moved
to a pure suspended state via the call.
SOLUTION:
In tcce.c, TCCE_Suspend_Service, we added the following check:
if ((task->tc_status == NU_FINISHED) || (task->tc_status == NU_TERMINATED))
/* Can't suspend a task in a finished or terminated state */
status = NU_INVALID_SUSPEND;
*****************************************************************************
- DM_EXTR.H DMC_Established_Memory_Pools, DMC_Memory_Pool_Information,
DMC_Memory_Pool_Pointers
- SM_EXTR.H SMC_Established_Memory_Pools, SMC_Memory_Pool_Information,
SMC_Memory_Pool_Pointers
SYMPTOM: Compiler warnings
SOLUTION: Replaced the DMC and SMC leading characters to DMF and SMF
respectively.
/* Information retrieval functions. */
UNSIGNED DMC_Established_Memory_Pools(VOID);
STATUS DMC_Memory_Pool_Information(NU_MEMORY_POOL *pool_ptr,
CHAR *name, VOID **start_address, UNSIGNED *pool_size,
UNSIGNED *min_allocation, UNSIGNED *available,
OPTION *suspend_type, UNSIGNED *tasks_waiting,
NU_TASK **first_task);
UNSIGNED DMC_Memory_Pool_Pointers(NU_MEMORY_POOL **pointer_list,
UNSIGNED maximum_pointers)
The function names were wrong. They should be DMF_Established_Memory_Pools(),
etc, ie so we replaced DMC_ with DMF_. Same for SMC_ changed to SMF_.
*****************************************************************************
- HIC.C HIC_Make_History_Entry
SYMPTOM: Exception due to no current active thread at time of function call.
SOLUTION:
In HIC.C (Generic) the function HIC_Make_History_Entry has the macro
TCT_Get_Current_Protect(). This can be invoked before there is a current
thread. This will cause an exception in MNT as well as any port having
either MMU support or no physical memory at location 0 + protect offset.
This code:
/* Pickup current protection. */
save_protect = TCT_Get_Current_Protect();
was changed as follows to fix this problem, assuring we are not in
initialization before calling TCT_Get_Current_Protect:
/* If we are not in initialization, get the current protection state */
if (INC_Initialize_State != INC_END_INITIALIZE)
/* Pickup current protection. */
save_protect = TCT_Get_Current_Protect();
else
/* we are in initialization, just clear save_protect */
save_protect = 0;
*****************************************************************************
- TMSE.C TMSE_Create_Timer
SYMPTOM: Timer doesn't expire for an exceptionally long time period.
SOLUTION:
If NU_Create_Timer() sets a timer to expire in 0 ticks, it does not in fact
expire until 2^32 ticks have occurred, due to in the routine
TMT_Timer_Interrupt, the value of the count-down timer is decremented before
it is tested against zero.
We added this check to TMSE_Create_Timer to determine if a parameter of 0
is used and return an error code:
else if (initial_time == 0)
/* Invalid time value. */
status = NU_INVALID_OPERATION;
*****************************************************************************
- PICE.C PICE_Receive_From_Pipe, PICE_Send_To Pipe,
PISE_Broadcast_To_Pipe, PISE_Send_To_Front_Of_Pipe,
- QUCE.C QUCE_Send_To_Queue, QUCE_Receive_From_Queue
QUSE_Broadcast_To_Queue, QUSE_Send_To_Front_Of_Queue
SYMPTOM: Memory gets corrupted as we can overwrite an area the size of the
largest INT value, in bytes.
SOLUTION:
We added this check:
else if (size == 0)
/* Indicate that the message size is invalid. */
status = NU_INVALID_SIZE;
as we do not allow 0-sized messages to be sent/received from
pipes or queues.
*****************************************************************************
- TCI.C
SYMPTOM: None, just legacy code that needed removing.
SOLUTION:
In tci.c:
extern VOID *TCD_Protect_Thread
This was legacy code, not used and was removed.
*****************************************************************************
- TMC.C TMC_Start_Timer
SYMPTOM: System could crash. An overflow occurs and the timer will never
return.
SOLUTION:
In the file TMC.C, line 417:
if (!TMD_Active_List_Busy)
{
/* Calculate the elapsed amount of time from the last timer
request. */
elapsed = TMD_Timer_Start - TMT_Read_Timer();
/* Adjust the first entry in the timer list and the timer
start value accordingly. */
TMD_Timer_Start = TMD_Timer_Start - elapsed;
list_ptr -> tm_remaining_time =
list_ptr -> tm_remaining_time - elapsed;
}
When the variable "elapsed" is greater than "tm_remaining_time" an overflow
occurs and the timer will never return.
Corrected the code as follows:
if (!TMD_Active_List_Busy)
{
/* Calculate the elapsed amount of time from the last timer request. */
elapsed = TMD_Timer_Start - TMT_Read_Timer();
/* Adjust the first entry in the timer list and the timer
start value accordingly. */
TMD_Timer_Start = TMD_Timer_Start - elapsed;
/* Make sure the remaining time is never below zero! */
if (list_ptr -> tm_remaining_time > elapsed)
{
list_ptr -> tm_remaining_time = list_ptr -> tm_remaining_time - elapsed;
}
else
{
list_ptr -> tm_remaining_time = 0;
}
}
*****************************************************************************
- TCC.C TCC_Task_Timeout
SYMPTOM: Task never wakes after signal sent to it. When you activate a
signal the target tasks' current state is placed in tc_saved_status and
tc_status is made NU_READY. When the signal handler finishes the
tc_saved_status is placed back int tc_status restoring the task state.
When the NU_Sleep() expires tc_status is made NU_READY.
Unfortunately this means that when the signal handler finishes the saved
sleep state is restored and the task never wakes.
SOLUTION:
Instead of blindly passing tc_status to resume task, a test must be made
to see if the task has a signal active. If a signal is active then
tc_saved_status should be passed to resume task.
Replace
/* Pickup the suspension protection saved-off when the task was
suspended. */
suspend_protect = task -> tc_suspend_protect;
task_status = task -> tc_status;
with
/* Pickup the suspension protection saved-off when the task was
suspended. */
suspend_protect = task -> tc_suspend_protect;
/* Is a signal handler currently running?*/
if (task -> tc_signal_active)
/* Use the saved status for current task status */
task_status = task -> tc_saved_status;
else
/* Just use the current task status */
task_status = task -> tc_status;
*****************************************************************************
- TC_DEFS.H
SYMPTOM: Compiler warning
SOLUTION:
#define TC_MAX_GROUPS TC_PRIORITIES/8
was changed to:
#define TC_MAX_GROUPS (TC_PRIORITIES/8)
*****************************************************************************
- *i.c
SYMPTOM: Compiler warnings
SOLUTION:
All the initialization code modules (eg tmi.c) omit to #include the
relevant prototypes (eg #include "tm_extr.h") and thus provoke warnings
when you ask the compiler to check that all functions definitions have a
corresponding declaration. (In general Nucleus conforms to this coding
convention, except for the initialization modules.)
All *.i.c files now #include the _defs.h and _extr.h files for that
component.
*****************************************************************************
- TCS.C TCS_Change_Time_Slice
SYMPTOM: If a call to NU_Change_Time_Slice is made dynamically and the
task was not created with a time slice, the time slice is set for that task
but no task switches occur due to the new time slice.
SOLUTION: Added the following "system notification" so PLUS is aware
the task has a defined time slice:
task -> tc_time_slice = time_slice;
task -> tc_cur_time_slice = time_slice;
/* Bug fix. Let the system know we have started a new time slice */
TMD_Time_Slice_State = TM_ACTIVE;
/* Release protection of information. */
TCT_Unprotect();
****************************************************************************
The sole enhancement to this release is we added a new function. In tmf.c,
the new function TMF_Get_Remaining_Time(NU_TIMER *timer_ptr) returns the
remaining time before expiration for the specified timer. Please see the
Nucleus PLUS Reference Manual and Internal Manual for a more full
description of this function.
*****************************************************************************
Nucleus PLUS generic version 1.13a was created on 04/10/01 by Chris Sheppard and
contains the following changes:
This release of the Nucleus PLUS kernel has been instrumented for Nucleus
ProView. For more information about Nucleus ProView, consult an ATI sales
representative.
The following files that had the macros changed from RTVIEW_PROF to
INCLUDE_PROVIEW are:
tms.c, tmc.c, tcs.c, tcc.c, pis.c, pic.c, ioc.c, sms.c, smc.c,
hi_defs.h, qus.c, quc.c, mbs.c, evc.c, dmc.c, mbc.c, pmc.c.
*****************************************************************************
- CSC.C
Added checks for use of inline functions to avoid ARM Tools errors.
*****************************************************************************
TCC.C (3 fixes) TCC_Register_LISR
SYMPTOM: Users can't register a LISR for the last interrupt source because
the check (vector >= NU_MAX_VECTORS) erroneously reports it as an invalid
vector number.
SOLUTION: Changed the conditional to read (vector > NU_MAX_VECTORS).
SYMPTOM: While searching the TCD_LISR_Pointers list the last entry is
ignored.
SOLUTION: Changed the following code:
while ((TCD_LISR_Pointers[index] != NU_NULL) && (index < NU_MAX_LISRS))
index++;
/* Determine if an empty slot was found. */
if (index < NU_MAX_LISRS)
to
while ((TCD_LISR_Pointers[index] != NU_NULL) && (index <= NU_MAX_LISRS))
index++;
/* Determine if an empty slot was found. */
if (index <= NU_MAX_LISRS)
*****************************************************************************
TCD.C
Changed
VOID (*TCD_LISR_Pointers[NU_MAX_LISRS])(INT vector);
to
VOID (*TCD_LISR_Pointers[NU_MAX_LISRS+1])(INT vector);
as the index to search this list is set to 1 before the search.
****************************************************************************
MBS.C MBS_Broadcast_To_Mailbox
SYMPTOM: The list of tasks suspended waiting on a mailbox may get corrupted
during a NU_Broadcast_To_Mailbox call.
SOLUTION: Added a new local variable, MB_SUSPEND *next_suspend_ptr; to
hold a pointer to the next task on the suspend list.
The old code looked like:
/* Wakeup each task waiting. */
preempt = preempt |
TCC_Resume_Task((NU_TASK *) suspend_ptr -> mb_suspended_task,
NU_MAILBOX_SUSPEND);
/* Move the suspend pointer along to the next block. */
suspend_ptr = (MB_SUSPEND *) suspend_ptr -> mb_suspend_link.cs_next;
} while (suspend_ptr != suspend_head);
This was changed to save off the suspend pointer BEFORE we do the
Resume_Task and then
/* Move the suspend pointer along to the next block. */
next_suspend_ptr = (MB_SUSPEND *) suspend_ptr -> mb_suspend_link.cs_next;
/* Wakeup each task waiting. */
preempt = preempt |
TCC_Resume_Task((NU_TASK *) suspend_ptr -> mb_suspended_task,
NU_MAILBOX_SUSPEND);
suspend_ptr = next_suspend_ptr;
} while (suspend_ptr != suspend_head);
*****************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -