EXTERN time_t boottime; /* time when the system was booted (for
* reporting to FS)
*/
+EXTERN u32_t system_hz; /* System clock frequency. */
EXTERN int report_reboot; /* During reboot to report to FS that we are
* rebooting.
*/
#endif
if(f > 0) printf("PM: failed to register %d processes with DS.\n", f);
+
+ system_hz = sys_hz();
}
/*===========================================================================*
r = vm_allocmem(m_in.memsize, &retmembase);
if(r == OK)
mp->mp_reply.membase = retmembase;
-#if 0
- printf("PM: do_allocmem: %d\n", r);
-#endif
return r;
}
src_addr = (vir_bytes) &loadinfo;
real_len = sizeof(struct loadinfo);
break;
+ case SIU_SYSTEMHZ:
+ src_addr = (vir_bytes) &system_hz;
+ real_len = sizeof(system_hz);
+ break;
default:
return(EINVAL);
}
if ( (s=getuptime(&uptime)) != OK)
panic(__FILE__,"set_alarm couldn't get uptime", s);
exptime = *tmr_exp_time(&mproc[proc_nr_n].mp_timer);
- remaining = (int) ((exptime - uptime + (HZ-1))/HZ);
+ remaining = (int) ((exptime - uptime + (system_hz-1))/system_hz);
if (remaining < 0) remaining = 0;
} else {
remaining = 0;
* this be declared properly without combinatorial explosion of message
* types?
*/
- ticks = (clock_t) (HZ * (unsigned long) (unsigned) sec);
- if ( (unsigned long) ticks / HZ != (unsigned) sec)
+ ticks = (clock_t) (system_hz * (unsigned long) (unsigned) sec);
+ if ( (unsigned long) ticks / system_hz != (unsigned) sec)
ticks = LONG_MAX; /* eternity (really TMR_NEVER) */
if (ticks != 0) {
if ( (s=getuptime(&uptime)) != OK)
panic(__FILE__,"do_time couldn't get uptime", s);
- mp->mp_reply.reply_time = (time_t) (boottime + (uptime/HZ));
- mp->mp_reply.reply_utime = (uptime%HZ)*1000000/HZ;
+ mp->mp_reply.reply_time = (time_t) (boottime + (uptime/system_hz));
+ mp->mp_reply.reply_utime = (uptime%system_hz)*1000000/system_hz;
return(OK);
}
}
if ( (s=getuptime(&uptime)) != OK)
panic(__FILE__,"do_stime couldn't get uptime", s);
- boottime = (long) m_in.stime - (uptime/HZ);
+ boottime = (long) m_in.stime - (uptime/system_hz);
s= sys_stime(boottime); /* Tell kernel about boottime */
if (s != OK)
return(ENOSYS);
}
-/*===========================================================================*
- * panic *
- *===========================================================================*/
-PUBLIC void panic(who, mess, num)
-char *who; /* who caused the panic */
-char *mess; /* panic message string */
-int num; /* number to go with it */
-{
-/* An unrecoverable error has occurred. Panics are caused when an internal
- * inconsistency is detected, e.g., a programming error or illegal value of a
- * defined constant. The process manager decides to exit.
- */
- printf("PM panic (%s): %s", who, mess);
- if (num != NO_NUM) printf(": %d",num);
- printf("\n");
-
- /* Exit PM. */
- sys_exit(SELF);
-}
-
-
/*===========================================================================*
* find_param *
*===========================================================================*/