kernel/team: Adjust address_space assignment slightly.

For the kernel team, we now assign it in team_init instead of having
a special case in Team::Team(), making things more similar to the
userland team creation.

Should not change any real functionality as Team::Create calls
almost nothing outside of this file.
This commit is contained in:
Augustin Cavalier 2021-08-27 14:51:44 -04:00
parent 147b47e086
commit 3ca830e364

View File

@ -444,7 +444,7 @@ Team::Team(team_id id, bool kernel)
fArgs[0] = '\0';
num_threads = 0;
io_context = NULL;
address_space = kernel ? VMAddressSpace::Kernel() : NULL;
address_space = NULL;
realtime_sem_context = NULL;
xsi_sem_context = NULL;
thread_list = NULL;
@ -2859,6 +2859,8 @@ team_init(kernel_args* args)
sKernelTeam = Team::Create(1, "kernel_team", true);
if (sKernelTeam == NULL)
panic("could not create kernel team!\n");
sKernelTeam->address_space = VMAddressSpace::Kernel();
sKernelTeam->SetArgs(sKernelTeam->Name());
sKernelTeam->state = TEAM_STATE_NORMAL;