From af620e118709e1a5272661c94641c3adf19fa524 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 3 Sep 2004 14:12:59 -0400 Subject: added system option to bin interrupt code seperately. arch/alpha/ev5.cc: set the mode explictly rather than having a bool user/notuser cpu/simple_cpu/simple_cpu.hh: there is no class Kernel kern/kernel_stats.cc: use cpu_mode_num kern/kernel_stats.hh: add interrupt mode and use cpu_mode_num rather than constant kern/linux/linux_system.cc: kern/linux/linux_system.hh: kern/system_events.cc: kern/system_events.hh: add events to change the mode to/from interrupt sim/system.cc: sim/system.hh: add a pal symbol table --HG-- extra : convert_revision : 9d30e826b72122062a5ea12d094f94760e75c66a --- kern/kernel_stats.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'kern/kernel_stats.cc') diff --git a/kern/kernel_stats.cc b/kern/kernel_stats.cc index c8c04e6d1..c08ee08f7 100644 --- a/kern/kernel_stats.cc +++ b/kern/kernel_stats.cc @@ -45,12 +45,13 @@ using namespace Stats; namespace Kernel { -const char *modestr[] = { "kernel", "user", "idle" }; +const char *modestr[] = { "kernel", "user", "idle", "interrupt" }; Statistics::Statistics(ExecContext *context) : xc(context), idleProcess((Addr)-1), themode(kernel), lastModeTick(0), iplLast(0), iplLastTick(0) { + bin_int = xc->system->params->bin_int; } void @@ -153,20 +154,20 @@ Statistics::regStats(const string &_name) } _mode - .init(3) + .init(cpu_mode_num) .name(name() + ".mode_switch") .desc("number of protection mode switches") ; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < cpu_mode_num; ++i) _mode.subname(i, modestr[i]); _modeGood - .init(3) + .init(cpu_mode_num) .name(name() + ".mode_good") ; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < cpu_mode_num; ++i) _modeGood.subname(i, modestr[i]); _modeFraction @@ -175,18 +176,18 @@ Statistics::regStats(const string &_name) .flags(total) ; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < cpu_mode_num; ++i) _modeFraction.subname(i, modestr[i]); _modeFraction = _modeGood / _mode; _modeTicks - .init(3) + .init(cpu_mode_num) .name(name() + ".mode_ticks") .desc("number of ticks spent at the given mode") .flags(pdf) ; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < cpu_mode_num; ++i) _modeTicks.subname(i, modestr[i]); _swap_context @@ -198,7 +199,7 @@ Statistics::regStats(const string &_name) void Statistics::setIdleProcess(Addr idlepcbb) { - assert(themode == kernel); + assert(themode == kernel || themode == interrupt); idleProcess = idlepcbb; themode = idle; changeMode(themode); @@ -241,14 +242,17 @@ Statistics::swpipl(int ipl) } void -Statistics::mode(bool usermode) +Statistics::mode(cpu_mode newmode) { Addr pcbb = xc->regs.ipr[AlphaISA::IPR_PALtemp23]; - cpu_mode newmode = usermode ? user : kernel; - if (newmode == kernel && pcbb == idleProcess) + if ((newmode == kernel || newmode == interrupt) && + pcbb == idleProcess) newmode = idle; + if (bin_int == false && newmode == interrupt) + newmode = kernel; + changeMode(newmode); } -- cgit v1.2.3