sim_events.cc (7819:afe8476ee9e9) sim_events.cc (7820:4ee66d8c1dd8)
1/*
2 * Copyright (c) 2002-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;

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

118}
119
120
121const char *
122CountedExitEvent::description() const
123{
124 return "counted exit";
125}
1/*
2 * Copyright (c) 2002-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;

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

118}
119
120
121const char *
122CountedExitEvent::description() const
123{
124 return "counted exit";
125}
126
127CheckSwapEvent::CheckSwapEvent(int ival)
128 : interval(ival)
129{
130 mainEventQueue.schedule(this, curTick + interval);
131}
132
133void
134CheckSwapEvent::process()
135{
136 /* Check the amount of free swap space */
137 long swap;
138
139 /* returns free swap in KBytes */
140 swap = procInfo("/proc/meminfo", "SwapFree:");
141
142 if (swap < 1000)
143 ccprintf(cerr, "\a\a\aWarning! Swap space is low (%d)\n", swap);
144
145 if (swap < 100) {
146 cerr << "\a\aAborting Simulation! Inadequate swap space!\n\n";
147 exitSimLoop("Lack of swap space");
148 }
149
150 assert(getFlags(IsMainQueue));
151 mainEventQueue.schedule(this, curTick + interval);
152}
153
154const char *
155CheckSwapEvent::description() const
156{
157 return "check swap";
158}