Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159288715
D17851.id50034.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17851.id50034.diff
View Options
Index: sys/amd64/include/cpu.h
===================================================================
--- sys/amd64/include/cpu.h
+++ sys/amd64/include/cpu.h
@@ -50,7 +50,6 @@
#define cpu_getstack(td) ((td)->td_frame->tf_rsp)
#define cpu_setstack(td, ap) ((td)->td_frame->tf_rsp = (ap))
#define cpu_spinwait() ia32_pause()
-#define cpu_lock_delay() DELAY(1)
#define TRAPF_USERMODE(framep) \
(ISPL((framep)->tf_cs) == SEL_UPL)
@@ -78,6 +77,7 @@
extern void (*vmm_resume_p)(void);
void cpu_halt(void);
+void cpu_lock_delay(void);
void cpu_reset(void);
void fork_trampoline(void);
void swi_vm(void *);
Index: sys/i386/include/cpu.h
===================================================================
--- sys/i386/include/cpu.h
+++ sys/i386/include/cpu.h
@@ -50,7 +50,6 @@
#define cpu_getstack(td) ((td)->td_frame->tf_esp)
#define cpu_setstack(td, ap) ((td)->td_frame->tf_esp = (ap))
#define cpu_spinwait() ia32_pause()
-#define cpu_lock_delay() DELAY(1)
#define TRAPF_USERMODE(framep) \
((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))
@@ -73,6 +72,7 @@
extern char etext[];
void cpu_halt(void);
+void cpu_lock_delay(void);
void cpu_reset(void);
void fork_trampoline(void);
void swi_vm(void *);
Index: sys/x86/x86/delay.c
===================================================================
--- sys/x86/x86/delay.c
+++ sys/x86/x86/delay.c
@@ -112,3 +112,18 @@
init_ops.early_delay(n);
TSEXIT();
}
+
+void
+cpu_lock_delay(void)
+{
+
+ /*
+ * Use TSC to wait for a usec if present, otherwise fall back
+ * to reading from port 0x84. We can't call into timecounters
+ * for this delay since timecounters might use spin locks.
+ */
+ if (tsc_freq != 0)
+ delay_tsc(1);
+ else
+ inb(0x84);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 13, 10:50 AM (7 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33923754
Default Alt Text
D17851.id50034.diff (1 KB)
Attached To
Mode
D17851: Add a custom implementation of cpu_lock_delay() for x86.
Attached
Detach File
Event Timeline
Log In to Comment