diff --git a/usr/src/sp1/head/amd64/cpudef.h b/usr/src/sp1/head/amd64/cpudef.h new file mode 100644 index 0000000..b9aca80 --- /dev/null +++ b/usr/src/sp1/head/amd64/cpudef.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2026, Mirocom Laboratories + * All rights reserved. + * + * The following sources are CONFIDENTIAL and PROPRIETARY + * property of Mirocom Laboratories. Unauthorized copying, + * use, distribution or modification of this file, in whole + * and in part, is strictly prohibited without the prior written + * consent from Mirocom Laboratories. + */ + +#ifndef _MACHINE_CPUDEF_H_ +#define _MACHINE_CPUDEF_H_ 1 + +#include + +#define md_cpu_halt() \ + __asmv("hlt" ::: "memory") + +#define md_cpu_wait() \ + __asmv("pause" ::: "memory") + +#define md_cpu_intoff() \ + __asmv("cli" ::: "memory") + +#define md_cpu_inton() \ + __asmv("sti" ::: "memory") + +#endif /* !_MACHINE_CPUDEF_H_ */ diff --git a/usr/src/sp1/head/mu/cpu.h b/usr/src/sp1/head/mu/cpu.h index dc9a0f7..19b57ff 100644 --- a/usr/src/sp1/head/mu/cpu.h +++ b/usr/src/sp1/head/mu/cpu.h @@ -14,6 +14,13 @@ #include #include /* shared */ +#include /* shared */ + +/* cpudef.h glue */ +#define mu_cpu_halt md_cpu_halt /* Halt current core */ +#define mu_cpu_wait md_cpu_wait /* Spinwait hint */ +#define mu_cpu_intoff md_cpu_intoff /* Disable interrupts */ +#define mu_cpu_inton md_cpu_inton /* Enable interrupts */ /* * MI processor specific information