Implement SSE instructions
This commit is contained in:
19
kernel/amd64/fx.h
Normal file
19
kernel/amd64/fx.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _KERNEL_AMD64_FX_H
|
||||
#define _KERNEL_AMD64_FX_H
|
||||
|
||||
#define fx_save(buf) \
|
||||
do { \
|
||||
__asm__ volatile ("fxsave64 (%0)" ::"r"((buf)) : "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define fx_restore(buf) \
|
||||
do { \
|
||||
__asm__ volatile ("fxrstor64 (%0)" ::"r"((buf)) : "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define fx_init(buf) \
|
||||
do { \
|
||||
__asm__ volatile ("fninit; fxsave64 (%0)" ::"r"((buf)) : "memory"); \
|
||||
} while (0)
|
||||
|
||||
#endif // _KERNEL_AMD64_FX_H
|
||||
Reference in New Issue
Block a user