View | Details | Raw Unified | Return to bug 228768
Collapse All | Expand All

(-)sys/kern/kern_mutex.c (-1 / +1 lines)
Lines 1206-1212 Link Here
1206
1206
1207
	ldap->spin_cnt++;
1207
	ldap->spin_cnt++;
1208
	if (ldap->spin_cnt < 60000000 || kdb_active || panicstr != NULL)
1208
	if (ldap->spin_cnt < 60000000 || kdb_active || panicstr != NULL)
1209
		DELAY(1);
1209
		cpu_lock_delay();
1210
	else {
1210
	else {
1211
		td = mtx_owner(m);
1211
		td = mtx_owner(m);
1212
1212
(-)sys/x86/include/x86_var.h (+1 lines)
Lines 119-124 Link Here
119
bool	acpi_get_fadt_bootflags(uint16_t *flagsp);
119
bool	acpi_get_fadt_bootflags(uint16_t *flagsp);
120
void	*alloc_fpusave(int flags);
120
void	*alloc_fpusave(int flags);
121
void	busdma_swi(void);
121
void	busdma_swi(void);
122
void	cpu_lock_delay(void);
122
bool	cpu_mwait_usable(void);
123
bool	cpu_mwait_usable(void);
123
void	cpu_probe_amdc1e(void);
124
void	cpu_probe_amdc1e(void);
124
void	cpu_setregs(void);
125
void	cpu_setregs(void);
(-)sys/x86/x86/delay.c (+25 lines)
Lines 110-112 Link Here
110
	init_ops.early_delay(n);
110
	init_ops.early_delay(n);
111
	TSEXIT();
111
	TSEXIT();
112
}
112
}
113
114
void
115
cpu_lock_delay(void)
116
{
117
118
	/*
119
	 * Use TSC to wait for a usec if present, otherwise fall back
120
	 * to reading from port 0x84.  We can't call into timecounters
121
	 * for this delay since timecounters might use spin locks.
122
	 */
123
	if (tsc_freq != 0) {
124
		uint64_t end, freq, now;
125
126
		sched_pin();
127
		freq = tsc_freq;
128
		now = rdtsc();
129
		end = now + freq / 1000000;
130
		do {
131
			cpu_spinwait();
132
			now = rdtsc();
133
		} while (now < end);
134
		sched_unpin();
135
	} else
136
		inb(0x84);
137
}

Return to bug 228768