1 INTERFACE[ia32,amd64,ux]:
4 #include "jdb_handler_queue.h"
5 #include "jdb_entry_frame.h"
6 #include "trap_state.h"
12 IMPLEMENTATION[ia32,amd64,ux]:
16 #include "kernel_console.h"
21 Jdb::write_tsc_s(Signed64 tsc, char *buf, int maxlen, bool sign)
23 Unsigned64 uns = Cpu::boot_cpu()->tsc_to_ns(tsc < 0 ? -tsc : tsc);
24 Unsigned32 ums = div32(uns, 1000000);
29 if (ums >= 3600000000U)
31 snprintf(buf, maxlen, ">999 h ");
37 *buf++ = (tsc < 0) ? '-' : (tsc == 0) ? ' ' : '+';
44 Mword _h = ums / 3600000;
45 Mword _m = (ums - 3600000 * _h) / 60000;
46 snprintf(buf, maxlen, "%3lu:%02lu h ", _h, _m);
53 Mword _m = ums / 60000;
54 Mword _s = (ums - 60000 * _m) / 1000;
55 snprintf(buf, maxlen, "%3lu:%02lu min", _m, _s);
61 // 1.000000...999.000000 s
62 Mword _s = ums / 1000;
63 Mword _us = div32(uns, 1000) - 1000000 * _s;
64 snprintf(buf, maxlen, "%3lu.%06lu s ", _s, _us);
70 snprintf(buf, maxlen, " 0 ");
74 // 1.000000...999.000000 ms
76 Mword _ns = ((Mword)uns - 1000000 * _ms);
77 snprintf(buf, maxlen, "%3lu.%06lu ms", _ms, _ns);
82 Jdb::write_tsc(Signed64 tsc, char *buf, int maxlen, bool sign)
84 Unsigned64 ns = Cpu::boot_cpu()->tsc_to_ns(tsc < 0 ? -tsc : tsc);
87 write_ll_ns(ns, buf, maxlen, sign);