sp1: mu: Add standard CPU macros

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-04-17 08:51:12 -04:00
parent 25fd961596
commit e66c15b914
2 changed files with 36 additions and 0 deletions
+29
View File
@@ -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 <sys/cdefs.h>
#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_ */
+7
View File
@@ -14,6 +14,13 @@
#include <sys/types.h>
#include <machine/mcb.h> /* shared */
#include <machine/cpudef.h> /* 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