Deleted Added
sdiff udiff text old ( 12181:2150eff234c1 ) new ( 12182:acde8d31d970 )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 38 unchanged lines hidden (view full) ---

47
48namespace AlphaISA {
49namespace Kernel {
50
51const char *modestr[] = { "kernel", "user", "idle" };
52
53Statistics::Statistics()
54 : ::Kernel::Statistics(),
55 idleProcess((Addr)-1), themode(kernel), lastModeTick(0)
56{
57}
58
59void
60Statistics::regStats(const string &_name)
61{
62 ::Kernel::Statistics::regStats(_name);
63

--- 51 unchanged lines hidden (view full) ---

115 ;
116 for (int i = 0; i < cpu_mode_num; ++i)
117 _modeTicks.subname(i, modestr[i]);
118
119 _swap_context
120 .name(name() + ".swap_context")
121 .desc("number of times the context was actually changed")
122 ;
123}
124
125void
126Statistics::setIdleProcess(Addr idlepcbb, ThreadContext *tc)
127{
128 assert(themode == kernel);
129 idleProcess = idlepcbb;
130 themode = idle;

--- 48 unchanged lines hidden (view full) ---

179{
180 if (!PAL::name(code))
181 return;
182
183 _callpal[code]++;
184}
185
186void
187Statistics::serialize(CheckpointOut &cp) const
188{
189 ::Kernel::Statistics::serialize(cp);
190 int exemode = themode;
191 SERIALIZE_SCALAR(exemode);
192 SERIALIZE_SCALAR(idleProcess);
193 SERIALIZE_SCALAR(lastModeTick);
194}
195
196void
197Statistics::unserialize(CheckpointIn &cp)
198{
199 ::Kernel::Statistics::unserialize(cp);
200 int exemode;
201 UNSERIALIZE_SCALAR(exemode);
202 UNSERIALIZE_SCALAR(idleProcess);
203 UNSERIALIZE_SCALAR(lastModeTick);
204 themode = (cpu_mode)exemode;
205}
206
207} // namespace Kernel
208} // namespace AlphaISA