#include <minix/const.h>
#include <minix/partition.h>
#include <minix/u64.h>
+#include <minix/com.h>
+#include <minix/sysinfo.h>
#include <ibm/partition.h>
#include <termios.h>
#include <stdarg.h>
{
int i, mode, n, v;
struct part_entry *pe;
+ u32_t system_hz;
if (ev != 'r' || device >= 0) return;
return;
}
- v = 2*HZ;
+ if(getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz) < 0) {
+ fprintf(stderr, "autopart: system hz not found\n");
+ exit(1);
+ }
+ v = 2*system_hz;
ioctl(device, DIOCTIMEOUT, &v);
memset(bootblock, 0, sizeof(bootblock));
*/
#include <minix/config.h>
+#include <minix/com.h>
+#include <minix/sysinfo.h>
#include <minix/endpoint.h>
#include <limits.h>
#include <timers.h>
char cpu[sizeof(clock_t) * 3 + 1 + 2];
struct kinfo kinfo;
int s;
+ u32_t system_hz;
+
+ if(getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz) < 0) {
+ exit(1);
+ }
(void) signal(SIGSEGV, disaster); /* catch a common crash */
sprintf(pid, "%d", buf.ps_pid);
}
- ustime = (buf.ps_utime + buf.ps_stime) / HZ;
+ ustime = (buf.ps_utime + buf.ps_stime) / system_hz;
if (ustime < 60 * 60) {
sprintf(cpu, "%2lu:%02lu", ustime / 60, ustime % 60);
} else
#include <net/gen/netdb.h>
#include <net/gen/socket.h>
#include <minix/queryparam.h>
+#include <minix/com.h>
+#include <minix/sysinfo.h>
#include <inet/generic/buf.h>
#include <inet/generic/clock.h>
#include <inet/generic/tcp.h>
#include <inet/generic/tcp_int.h>
+u32_t system_hz;
char *prog_name;
tcp_conn_t tcp_conn_table[TCP_CONN_NR];
char values[2 * sizeof(tcp_conn_table) + 1];
int fl;
int a_flag, n_flag, v_flag;
+ getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+
(prog_name=strrchr(argv[0], '/')) ? prog_name++ : (prog_name=argv[0]);
a_flag= 0;
if (tcp_conn->tc_senddis >= now)
{
printf("(time wait %ld s)",
- (tcp_conn->tc_senddis-now)/HZ);
+ (tcp_conn->tc_senddis-now)/system_hz);
}
no_verbose= 1;
break;
tcp_conn->tc_max_mtu-IP_TCP_MIN_HDR_SIZE,
tcp_conn->tc_mtu,
(tcp_conn->tc_flags & TCF_PMTU) ? "" : " (no PMTU)",
- rtt/(HZ+0.0),
- artt/(HZ+0.0)/TCP_RTT_SCALE, TCP_DRTT_MULT,
- drtt/(HZ+0.0)/TCP_RTT_SCALE);
+ rtt/(system_hz+0.0),
+ artt/(system_hz+0.0)/TCP_RTT_SCALE, TCP_DRTT_MULT,
+ drtt/(system_hz+0.0)/TCP_RTT_SCALE);
flags= tcp_conn->tc_flags;
printf("\tflags:");
if (!flags)
printf("\n");
printf("\ttimer: ref %d, time %f, active %d\n",
tcp_conn->tc_transmit_timer.tim_ref,
- (0.0+tcp_conn->tc_transmit_timer.tim_time-now)/HZ,
+ (0.0+tcp_conn->tc_transmit_timer.tim_time-now)/system_hz,
tcp_conn->tc_transmit_timer.tim_active);
}
#include <sys/select.h>
#include <minix/ipc.h>
+#include <minix/com.h>
+#include <minix/sysinfo.h>
#include <minix/config.h>
#include <minix/type.h>
#include <minix/const.h>
#include "../../kernel/const.h"
#include "../../kernel/proc.h"
+u32_t system_hz;
+
#define TC_BUFFER 1024 /* Size of termcap(3) buffer */
#define TC_STRINGS 200 /* Enough room for cm,cl,so,se */
((pr->p_memmap[T].mem_len +
pr->p_memmap[D].mem_len) << CLICK_SHIFT)/1024);
printf("%6s", pr->p_rts_flags ? "" : "RUN");
- printf(" %3d:%02d ", (ticks/HZ/60), (ticks/HZ)%60);
+ printf(" %3d:%02d ", (ticks/system_hz/60), (ticks/system_hz)%60);
printf("%6.2f%% %s\n",
100.0*tick_procs[p].ticks/dt, name);
{
int r, c, s = 0, orig;
+ getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+
init(&r);
while((c=getopt(argc, argv, "s:")) != EOF) {
return 0;
}
-int sys_hz() { return 50; }