forked from xuos/xiuos
repair the task shcedule failed problem of arm,update the assign task before pendsv fault
This commit is contained in:
parent
1f5d4ac765
commit
517825a52f
|
@ -76,7 +76,6 @@ PendSV_Handler:
|
||||||
MOV R7, R11
|
MOV R7, R11
|
||||||
STMIA R1!, {R4 - R7} /* push thread {R8 - R11} high register to thread stack */
|
STMIA R1!, {R4 - R7} /* push thread {R8 - R11} high register to thread stack */
|
||||||
switch_to_task:
|
switch_to_task:
|
||||||
BL UpdateRunningTask
|
|
||||||
|
|
||||||
LDR R1, =InterruptToKtask
|
LDR R1, =InterruptToKtask
|
||||||
LDR R1, [R1]
|
LDR R1, [R1]
|
||||||
|
|
|
@ -70,9 +70,6 @@ PendSV_Handler:
|
||||||
|
|
||||||
switch_to_task:
|
switch_to_task:
|
||||||
|
|
||||||
PUSH {lr}
|
|
||||||
BL UpdateRunningTask
|
|
||||||
POP {lr}
|
|
||||||
|
|
||||||
#ifdef TASK_ISOLATION
|
#ifdef TASK_ISOLATION
|
||||||
PUSH {lr}
|
PUSH {lr}
|
||||||
|
|
|
@ -95,7 +95,7 @@ uint16 GetOsAssignLockLevel(void)
|
||||||
|
|
||||||
#include <xs_hook.h>
|
#include <xs_hook.h>
|
||||||
|
|
||||||
static int16 KTaskOsAssignLockNest;
|
static uint16 KTaskOsAssignLockNest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function will get critical lock level.
|
* This function will get critical lock level.
|
||||||
|
|
|
@ -87,6 +87,7 @@ SWITCH:
|
||||||
|
|
||||||
Assign.ready_vector_done->remove(new_task);
|
Assign.ready_vector_done->remove(new_task);
|
||||||
KTaskStatSetAsRunning(new_task);
|
KTaskStatSetAsRunning(new_task);
|
||||||
|
Assign.os_running_task = new_task;
|
||||||
|
|
||||||
SYS_KDEBUG_LOG(KDBG_SCHED,
|
SYS_KDEBUG_LOG(KDBG_SCHED,
|
||||||
("[%d]switch to priority#%d "
|
("[%d]switch to priority#%d "
|
||||||
|
@ -162,6 +163,7 @@ SWITCH:
|
||||||
|
|
||||||
Assign.ready_vector_done->remove(new_task);
|
Assign.ready_vector_done->remove(new_task);
|
||||||
KTaskStatSetAsRunning(new_task);
|
KTaskStatSetAsRunning(new_task);
|
||||||
|
Assign.os_running_task = new_task;
|
||||||
|
|
||||||
SYS_KDEBUG_LOG(KDBG_SCHED,
|
SYS_KDEBUG_LOG(KDBG_SCHED,
|
||||||
("[%d]switch to priority#%d "
|
("[%d]switch to priority#%d "
|
||||||
|
@ -327,6 +329,7 @@ x_err_t YieldOsAssign(void)
|
||||||
|
|
||||||
Assign.ready_vector_done->remove(new_task);
|
Assign.ready_vector_done->remove(new_task);
|
||||||
KTaskStatSetAsRunning(new_task);
|
KTaskStatSetAsRunning(new_task);
|
||||||
|
Assign.os_running_task = new_task;
|
||||||
|
|
||||||
SYS_KDEBUG_LOG(KDBG_SCHED,
|
SYS_KDEBUG_LOG(KDBG_SCHED,
|
||||||
("[%d]switch to priority#%d "
|
("[%d]switch to priority#%d "
|
||||||
|
|
|
@ -1647,9 +1647,17 @@ void shellTask(void *param)
|
||||||
while(RET_TRUE)
|
while(RET_TRUE)
|
||||||
{
|
{
|
||||||
if (shell->read) {
|
if (shell->read) {
|
||||||
|
memset(data, 0, KEY_LENGTH);
|
||||||
|
data_len = 0;
|
||||||
|
x_base lock;
|
||||||
|
|
||||||
data_len = shell->read(data);
|
data_len = shell->read(data);
|
||||||
for (i = 0; i < data_len; i++) {
|
if(data_len > 0) {
|
||||||
shellHandler(shell, data[i]);
|
int lock = CriticalAreaLock();
|
||||||
|
for (i = 0; i < data_len; i++) {
|
||||||
|
shellHandler(shell, data[i]);
|
||||||
|
}
|
||||||
|
CriticalAreaUnLock(lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,13 @@ signed char userShellRead(char *data)
|
||||||
{
|
{
|
||||||
char read_length = 0;
|
char read_length = 0;
|
||||||
struct BusBlockReadParam read_param;
|
struct BusBlockReadParam read_param;
|
||||||
read_param.read_length = 0;
|
|
||||||
read_param.size = 1;
|
|
||||||
read_param.buffer = data;
|
|
||||||
|
|
||||||
|
memset(&read_param,0, sizeof(read_param));
|
||||||
|
|
||||||
|
read_param.read_length = 0;
|
||||||
|
read_param.size = KEY_LENGTH;
|
||||||
|
read_param.buffer = data;
|
||||||
|
|
||||||
BusDevReadData(console, &read_param);
|
BusDevReadData(console, &read_param);
|
||||||
|
|
||||||
read_length = (char)read_param.read_length;
|
read_length = (char)read_param.read_length;
|
||||||
|
@ -120,7 +123,7 @@ int userShellInit(void)
|
||||||
tid = KTaskCreate("letter-shell",
|
tid = KTaskCreate("letter-shell",
|
||||||
shellTask, &shell,
|
shellTask, &shell,
|
||||||
SHELL_TASK_STACK_SIZE, SHELL_TASK_PRIORITY);
|
SHELL_TASK_STACK_SIZE, SHELL_TASK_PRIORITY);
|
||||||
|
|
||||||
StartupKTask(tid);
|
StartupKTask(tid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue