summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-03 13:05:20 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-03 13:05:20 +0200
commita095a90b51190386b93828153e2a533725cc2ab7 (patch)
tree1b048df8d43be5cd3854df2ba1a7e25841d5e7f1
parentac46e45f6efc82caee5261221e4ffe632bc11b7d (diff)
downloadserenity-a095a90b51190386b93828153e2a533725cc2ab7.zip
Kernel: Remove ancient nprocess and nblocked globals.
These were not in sync with reality, and not used anywhere anyway.
-rw-r--r--Kernel/Process.cpp10
-rw-r--r--Kernel/Thread.cpp3
-rw-r--r--Kernel/system.h2
3 files changed, 0 insertions, 15 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 3e8db5bb88..4c097db3d4 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -51,7 +51,6 @@ void Process::initialize()
Vector<pid_t> Process::all_pids()
{
Vector<pid_t> pids;
- pids.ensure_capacity(system.nprocess);
InterruptDisabler disabler;
for (auto* process = g_processes->head(); process; process = process->next())
pids.append(process->pid());
@@ -61,7 +60,6 @@ Vector<pid_t> Process::all_pids()
Vector<Process*> Process::all_processes()
{
Vector<Process*> processes;
- processes.ensure_capacity(system.nprocess);
InterruptDisabler disabler;
for (auto* process = g_processes->head(); process; process = process->next())
processes.append(process);
@@ -260,7 +258,6 @@ Process* Process::fork(RegisterDump& regs)
{
InterruptDisabler disabler;
g_processes->prepend(child);
- system.nprocess++;
}
#ifdef TASK_DEBUG
kprintf("Process %u (%s) forked from %u @ %p\n", child->pid(), child->name().characters(), m_pid, child_tss.eip);
@@ -508,7 +505,6 @@ Process* Process::create_user_process(const String& path, uid_t uid, gid_t gid,
{
InterruptDisabler disabler;
g_processes->prepend(process);
- system.nprocess++;
}
#ifdef TASK_DEBUG
kprintf("Process %u (%s) spawned @ %p\n", process->pid(), process->name().characters(), process->main_thread().tss().eip);
@@ -525,7 +521,6 @@ Process* Process::create_kernel_process(String&& name, void (*e)())
if (process->pid() != 0) {
InterruptDisabler disabler;
g_processes->prepend(process);
- system.nprocess++;
#ifdef TASK_DEBUG
kprintf("Kernel process %u (%s) spawned @ %p\n", process->pid(), process->name().characters(), process->main_thread().tss().eip);
#endif
@@ -611,11 +606,6 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
Process::~Process()
{
dbgprintf("~Process{%p} name=%s pid=%d, m_fds=%d\n", this, m_name.characters(), pid(), m_fds.size());
- {
- InterruptDisabler disabler;
- system.nprocess--;
- }
-
delete m_main_thread;
m_main_thread = nullptr;
}
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp
index 038abfacef..3703725fc1 100644
--- a/Kernel/Thread.cpp
+++ b/Kernel/Thread.cpp
@@ -94,12 +94,10 @@ Thread::~Thread()
void Thread::unblock()
{
if (current == this) {
- system.nblocked--;
m_state = Thread::Running;
return;
}
ASSERT(m_state != Thread::Runnable && m_state != Thread::Running);
- system.nblocked--;
m_state = Thread::Runnable;
}
@@ -117,7 +115,6 @@ void Thread::block(Thread::State new_state)
kprintf("Thread::block: %s(%u) block(%u/%s) with state=%u/%s\n", process().name().characters(), process().pid(), new_state, to_string(new_state), state(), to_string(state()));
}
ASSERT(state() == Thread::Running);
- system.nblocked++;
m_was_interrupted_while_blocked = false;
set_state(new_state);
Scheduler::yield();
diff --git a/Kernel/system.h b/Kernel/system.h
index ae91545be9..bd4572f95d 100644
--- a/Kernel/system.h
+++ b/Kernel/system.h
@@ -5,8 +5,6 @@
struct system_t
{
time_t uptime;
- dword nprocess;
- dword nblocked;
};
extern system_t system;