-/* $OpenBSD: locore.S,v 1.137 2023/07/25 06:48:37 guenther Exp $ */
+/* $OpenBSD: locore.S,v 1.138 2023/07/27 00:28:24 guenther Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
#endif /* DIAGNOSTIC */
END(cpu_switchto)
-/* placed here for correct static branch prediction in cpu_idle_* */
NENTRY(retpoline_rax)
JMP_RETPOLINE(rax)
-ENTRY(cpu_idle_cycle)
- RETGUARD_SETUP(cpu_idle_cycle, r11)
- movq cpu_idle_cycle_fcn,%rax
- cmpq $0,%rax
- jne retpoline_rax
+ENTRY(cpu_idle_cycle_hlt)
+ RETGUARD_SETUP(cpu_idle_cycle_hlt, r11)
sti
hlt
- RETGUARD_CHECK(cpu_idle_cycle, r11)
+ RETGUARD_CHECK(cpu_idle_cycle_hlt, r11)
ret
lfence
-END(cpu_idle_cycle)
+END(cpu_idle_cycle_hlt)
/*
* savectx(struct pcb *pcb);
-/* $OpenBSD: machdep.c,v 1.285 2023/07/10 03:32:10 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.286 2023/07/27 00:28:25 guenther Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
/*
* switchto vectors
*/
-void (*cpu_idle_cycle_fcn)(void) = NULL;
+void cpu_idle_cycle_hlt(void);
+void (*cpu_idle_cycle_fcn)(void) = &cpu_idle_cycle_hlt;
/* the following is used externally for concurrent handlers */
int setperf_prio = 0;
-/* $OpenBSD: cpu.h,v 1.157 2023/07/25 18:16:19 cheloha Exp $ */
+/* $OpenBSD: cpu.h,v 1.158 2023/07/27 00:28:24 guenther Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
int amd64_pa_used(paddr_t);
#define cpu_idle_enter() do { /* nothing */ } while (0)
extern void (*cpu_idle_cycle_fcn)(void);
+#define cpu_idle_cycle() (*cpu_idle_cycle_fcn)()
#define cpu_idle_leave() do { /* nothing */ } while (0)
struct region_descriptor;