Revert "sched: replace some global variables to macro"

sched implementation not depends on macro abstraction, so revert below commit:

This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an
2024-06-06 16:49:50 +08:00
committed by Xiang Xiao
parent f4d9005bea
commit e456c88c09
22 changed files with 87 additions and 103 deletions
+5 -5
View File
@@ -136,13 +136,13 @@ static void exec_swap(FAR struct tcb_s *ptcb, FAR struct tcb_s *chtcb)
pndx = PIDHASH(ptcb->pid);
chndx = PIDHASH(chtcb->pid);
DEBUGASSERT(nxsched_pidhash()[pndx]);
DEBUGASSERT(nxsched_pidhash()[chndx]);
DEBUGASSERT(g_pidhash[pndx]);
DEBUGASSERT(g_pidhash[chndx]);
/* Exchange nxsched_pidhash() index */
/* Exchange g_pidhash index */
nxsched_pidhash()[pndx] = chtcb;
nxsched_pidhash()[chndx] = ptcb;
g_pidhash[pndx] = chtcb;
g_pidhash[chndx] = ptcb;
/* Exchange pid */
+11 -11
View File
@@ -187,9 +187,9 @@ static int elf_get_ntcb(void)
int count = 0;
int i;
for (i = 0; i < nxsched_npidhash(); i++)
for (i = 0; i < g_npidhash; i++)
{
if (nxsched_pidhash()[i] != NULL)
if (g_pidhash[i] != NULL)
{
count++;
}
@@ -313,11 +313,11 @@ static void elf_emit_note(FAR struct elf_dumpinfo_s *cinfo)
if (cinfo->pid == INVALID_PROCESS_ID)
{
for (i = 0; i < nxsched_npidhash(); i++)
for (i = 0; i < g_npidhash; i++)
{
if (nxsched_pidhash()[i] != NULL)
if (g_pidhash[i] != NULL)
{
elf_emit_tcb_note(cinfo, nxsched_pidhash()[i]);
elf_emit_tcb_note(cinfo, g_pidhash[i]);
}
}
}
@@ -395,11 +395,11 @@ static void elf_emit_stack(FAR struct elf_dumpinfo_s *cinfo)
if (cinfo->pid == INVALID_PROCESS_ID)
{
for (i = 0; i < nxsched_npidhash(); i++)
for (i = 0; i < g_npidhash; i++)
{
if (nxsched_pidhash()[i] != NULL)
if (g_pidhash[i] != NULL)
{
elf_emit_tcb_stack(cinfo, nxsched_pidhash()[i]);
elf_emit_tcb_stack(cinfo, g_pidhash[i]);
}
}
}
@@ -520,11 +520,11 @@ static void elf_emit_phdr(FAR struct elf_dumpinfo_s *cinfo,
if (cinfo->pid == INVALID_PROCESS_ID)
{
for (i = 0; i < nxsched_npidhash(); i++)
for (i = 0; i < g_npidhash; i++)
{
if (nxsched_pidhash()[i] != NULL)
if (g_pidhash[i] != NULL)
{
elf_emit_tcb_phdr(cinfo, nxsched_pidhash()[i], &phdr, &offset);
elf_emit_tcb_phdr(cinfo, g_pidhash[i], &phdr, &offset);
}
}
}