mc146818.cc (8593:92ba80d63abc) mc146818.cc (8869:fa8dcdd7e26c)
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;

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

171 return 0x00;
172 break;
173 default:
174 panic("Shouldn't be here");
175 }
176 }
177}
178
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;

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

171 return 0x00;
172 break;
173 default:
174 panic("Shouldn't be here");
175 }
176 }
177}
178
179static time_t
180mkutctime(struct tm *time)
181{
182 time_t ret;
183 char *tz;
184
185 tz = getenv("TZ");
186 setenv("TZ", "", 1);
187 tzset();
188 ret = mktime(time);
189 if (tz)
190 setenv("TZ", tz, 1);
191 else
192 unsetenv("TZ");
193 tzset();
194 return ret;
195}
196
197void
198MC146818::tickClock()
199{
200 if (stat_regB & RTCB_NO_UPDT)
201 return;
202 time_t calTime = mkutctime(&curTime);
203 calTime++;
204 setTime(*gmtime(&calTime));

--- 79 unchanged lines hidden ---
179void
180MC146818::tickClock()
181{
182 if (stat_regB & RTCB_NO_UPDT)
183 return;
184 time_t calTime = mkutctime(&curTime);
185 calTime++;
186 setTime(*gmtime(&calTime));

--- 79 unchanged lines hidden ---