Index: kern/kern_clock.c =================================================================== --- kern/kern_clock.c (revision 245880) +++ kern/kern_clock.c (working copy) @@ -382,7 +382,7 @@ int stathz; int profhz; int profprocs; -int ticks; +volatile int ticks; int psratio; static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ @@ -469,7 +469,7 @@ hardclock(int usermode, uintfptr_t pc) { - atomic_add_int((volatile int *)&ticks, 1); + atomic_add_int(&ticks, 1); hardclock_cpu(usermode); tc_ticktock(1); cpu_tick_calibration(); Index: kern/kern_tc.c =================================================================== --- kern/kern_tc.c (revision 245880) +++ kern/kern_tc.c (working copy) @@ -103,8 +103,8 @@ int tc_min_ticktock_freq = 1; -time_t time_second = 1; -time_t time_uptime = 1; +volatile time_t time_second = 1; +volatile time_t time_uptime = 1; struct bintime boottimebin; struct timeval boottime; Index: pci/ncr.c =================================================================== --- pci/ncr.c (revision 245880) +++ pci/ncr.c (working copy) @@ -1386,7 +1386,7 @@ * Kernel variables referenced in the scripts. * THESE MUST ALL BE ALIGNED TO A 4-BYTE BOUNDARY. */ -static void *script_kvars[] = +static volatile void *script_kvars[] = { &time_second, &ticks, &ncr_cache }; static struct script script0 = { Index: dev/usb/net/if_cdce.c =================================================================== --- dev/usb/net/if_cdce.c (revision 245880) +++ dev/usb/net/if_cdce.c (working copy) @@ -500,6 +500,7 @@ const struct usb_interface_descriptor *id; const struct usb_cdc_ethernet_descriptor *ued; const struct usb_config *pcfg; + uint32_t seed; int error; uint8_t i; uint8_t data_iface_no; @@ -612,8 +613,9 @@ /* fake MAC address */ device_printf(dev, "faking MAC address\n"); + seed = ticks; sc->sc_ue.ue_eaddr[0] = 0x2a; - memcpy(&sc->sc_ue.ue_eaddr[1], &ticks, sizeof(uint32_t)); + memcpy(&sc->sc_ue.ue_eaddr[1], &seed, sizeof(uint32_t)); sc->sc_ue.ue_eaddr[5] = device_get_unit(dev); } else { Index: sys/time.h =================================================================== --- sys/time.h (revision 245880) +++ sys/time.h (working copy) @@ -287,8 +287,8 @@ void inittodr(time_t base); void resettodr(void); -extern time_t time_second; -extern time_t time_uptime; +extern volatile time_t time_second; +extern volatile time_t time_uptime; extern struct bintime boottimebin; extern struct timeval boottime; Index: sys/kernel.h =================================================================== --- sys/kernel.h (revision 245880) +++ sys/kernel.h (working copy) @@ -63,7 +63,7 @@ extern int stathz; /* statistics clock's frequency */ extern int profhz; /* profiling clock's frequency */ extern int profprocs; /* number of process's profiling */ -extern int ticks; +extern volatile int ticks; #endif /* _KERNEL */