mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Maintain recursive process execution and system time.
This commit is contained in:
parent
1c64a7fda1
commit
5da12519cd
4 changed files with 14 additions and 1 deletions
|
@ -147,6 +147,8 @@ public:
|
|||
Timer alarm_timer;
|
||||
Clock execute_clock;
|
||||
Clock system_clock;
|
||||
Clock child_execute_clock;
|
||||
Clock child_system_clock;
|
||||
|
||||
public:
|
||||
int Execute(const char* programname, const uint8_t* program,
|
||||
|
|
|
@ -437,6 +437,11 @@ namespace Sortix
|
|||
|
||||
thepid = zombie->pid;
|
||||
|
||||
// It is safe to access these clocks directly as the child process is no
|
||||
// longer running at this point and the values are nicely frozen.
|
||||
child_execute_clock.Advance(zombie->child_execute_clock.current_time);
|
||||
child_system_clock.Advance(zombie->child_system_clock.current_time);
|
||||
|
||||
int exitstatus = zombie->exitstatus;
|
||||
if ( exitstatus < 0 )
|
||||
exitstatus = W_EXITCODE(128 + SIGKILL, SIGKILL);
|
||||
|
|
|
@ -83,8 +83,10 @@ void OnTick(struct timespec tick_period, bool system_mode)
|
|||
uptime_clock->Advance(tick_period);
|
||||
Process* process = CurrentProcess();
|
||||
process->execute_clock.Advance(tick_period);
|
||||
process->child_execute_clock.Advance(tick_period);
|
||||
if ( system_mode )
|
||||
process->system_clock.Advance(tick_period);
|
||||
process->system_clock.Advance(tick_period),
|
||||
process->child_system_clock.Advance(tick_period);
|
||||
}
|
||||
|
||||
void Init()
|
||||
|
|
|
@ -116,6 +116,10 @@ void InitializeProcessClocks(Process* process)
|
|||
process->execute_clock.Set(&nul_time, &tick_period);
|
||||
process->system_clock.SetCallableFromInterrupts(true);
|
||||
process->system_clock.Set(&nul_time, &tick_period);
|
||||
process->child_execute_clock.Set(&nul_time, &tick_period);
|
||||
process->child_execute_clock.SetCallableFromInterrupts(true);
|
||||
process->child_system_clock.Set(&nul_time, &tick_period);
|
||||
process->child_system_clock.SetCallableFromInterrupts(true);
|
||||
}
|
||||
|
||||
void Start()
|
||||
|
|
Loading…
Reference in a new issue