--- Gnu-Mach/kern/mach_clock.c 2020/09/02 04:49:56 1.1.1.6 +++ Gnu-Mach/kern/mach_clock.c 2020/09/02 04:52:02 1.1.1.7 @@ -74,11 +74,11 @@ int timedelta = 0; int tickdelta = 0; #if HZ > 500 -int tickadj = 1; /* can adjust HZ usecs per second */ +unsigned tickadj = 1; /* can adjust HZ usecs per second */ #else -int tickadj = 500 / HZ; /* can adjust 100 usecs per second */ +unsigned tickadj = 500 / HZ; /* can adjust 100 usecs per second */ #endif -int bigadj = 1000000; /* adjust 10*tickadj if adjustment +unsigned bigadj = 1000000; /* adjust 10*tickadj if adjustment > bigadj */ /* @@ -133,7 +133,8 @@ timer_elt_data_t timer_head; /* ordered void clock_interrupt( int usec, /* microseconds per tick */ boolean_t usermode, /* executing user code */ - boolean_t basepri) /* at base priority */ + boolean_t basepri, /* at base priority */ + vm_offset_t pc) /* address of interrupted instruction */ { int my_cpu = cpu_number(); thread_t thread = current_thread(); @@ -184,8 +185,11 @@ void clock_interrupt( * This had better be MP safe. It might be interesting * to keep track of cpu in the sample. */ - if (usermode) { - take_pc_sample_macro(thread, SAMPLED_PC_PERIODIC); +#ifndef MACH_KERNSAMPLE + if (usermode) +#endif + { + take_pc_sample_macro(thread, SAMPLED_PC_PERIODIC, usermode, pc); } #endif /* MACH_PCSAMPLE */ @@ -539,7 +543,7 @@ void mapable_time_init(void) if (kmem_alloc_wired(kernel_map, (vm_offset_t *) &mtime, PAGE_SIZE) != KERN_SUCCESS) panic("mapable_time_init"); - memset(mtime, 0, PAGE_SIZE); + memset((void *) mtime, 0, PAGE_SIZE); update_mapped_time(&time); }