mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 16:56:54 +07:00
1da177e4c3
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
#ifndef __MOVS_H__
|
|
#define __MOVS_H__
|
|
|
|
/*
|
|
** movs.h
|
|
**
|
|
** Inline assembly macros to generate movs & related instructions
|
|
*/
|
|
|
|
/* Set DFC register value */
|
|
|
|
#define SET_DFC(x) \
|
|
__asm__ __volatile__ (" movec %0,%/dfc" : : "d" (x));
|
|
|
|
/* Get DFC register value */
|
|
|
|
#define GET_DFC(x) \
|
|
__asm__ __volatile__ (" movec %/dfc, %0" : "=d" (x) : );
|
|
|
|
/* Set SFC register value */
|
|
|
|
#define SET_SFC(x) \
|
|
__asm__ __volatile__ (" movec %0,%/sfc" : : "d" (x));
|
|
|
|
/* Get SFC register value */
|
|
|
|
#define GET_SFC(x) \
|
|
__asm__ __volatile__ (" movec %/sfc, %0" : "=d" (x) : );
|
|
|
|
#define SET_VBR(x) \
|
|
__asm__ __volatile__ (" movec %0,%/vbr" : : "r" (x));
|
|
|
|
#define GET_VBR(x) \
|
|
__asm__ __volatile__ (" movec %/vbr, %0" : "=g" (x) : );
|
|
|
|
/* Set a byte using the "movs" instruction */
|
|
|
|
#define SET_CONTROL_BYTE(addr,value) \
|
|
__asm__ __volatile__ (" movsb %0, %1@" : : "d" (value), "a" (addr));
|
|
|
|
/* Get a byte using the "movs" instruction */
|
|
|
|
#define GET_CONTROL_BYTE(addr,value) \
|
|
__asm__ __volatile__ (" movsb %1@, %0" : "=d" (value) : "a" (addr));
|
|
|
|
/* Set a (long)word using the "movs" instruction */
|
|
|
|
#define SET_CONTROL_WORD(addr,value) \
|
|
__asm__ __volatile__ (" movsl %0, %1@" : : "d" (value), "a" (addr));
|
|
|
|
/* Get a (long)word using the "movs" instruction */
|
|
|
|
#define GET_CONTROL_WORD(addr,value) \
|
|
__asm__ __volatile__ (" movsl %1@, %0" : "=d" (value) : "a" (addr));
|
|
#endif
|