diff options
Diffstat (limited to 'sys/sparc64/include')
-rw-r--r-- | sys/sparc64/include/asmacros.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/sparc64/include/asmacros.h b/sys/sparc64/include/asmacros.h index 6d19a09..840959f 100644 --- a/sys/sparc64/include/asmacros.h +++ b/sys/sparc64/include/asmacros.h @@ -33,7 +33,7 @@ /* * Normal and alternate %g6 point to the pcb of the current process. Normal, - & alternate and interrupt %g7 point to per-cpu data. + * alternate and interrupt %g7 point to per-cpu data. */ #define PCB_REG %g6 #define PCPU_REG %g7 @@ -134,6 +134,19 @@ name: #define EMPTY +/* + * Generate atomic compare and swap, load and store instructions for the + * corresponding width and ASI (or not). Note that we want to evaluate the + * macro args before concatenating, so that EMPTY really turns into nothing. + */ +#define _LD(w, a) ld ## w ## a +#define _ST(w, a) st ## w ## a +#define _CAS(w, a) cas ## w ## a + +#define LD(w, a) _LD(w, a) +#define ST(w, a) _ST(w, a) +#define CAS(w, a) _CAS(w, a) + #endif /* LOCORE */ #endif /* _KERNEL */ |