Commit f58a69aa authored by Linus Torvalds's avatar Linus Torvalds

Remove <asm-i386/xor.h>'s own home-made FPU begin/end macros,

use the real ones instead.
parent 8da730e9
...@@ -18,22 +18,6 @@ ...@@ -18,22 +18,6 @@
* Copyright (C) 1998 Ingo Molnar. * Copyright (C) 1998 Ingo Molnar.
*/ */
#define FPU_SAVE \
do { \
preempt_disable(); \
if (!test_thread_flag(TIF_USEDFPU)) \
__asm__ __volatile__ (" clts;\n"); \
__asm__ __volatile__ ("fsave %0; fwait": "=m"(fpu_save[0])); \
} while (0)
#define FPU_RESTORE \
do { \
__asm__ __volatile__ ("frstor %0": : "m"(fpu_save[0])); \
if (!test_thread_flag(TIF_USEDFPU)) \
stts(); \
preempt_enable(); \
} while (0)
#define LD(x,y) " movq 8*("#x")(%1), %%mm"#y" ;\n" #define LD(x,y) " movq 8*("#x")(%1), %%mm"#y" ;\n"
#define ST(x,y) " movq %%mm"#y", 8*("#x")(%1) ;\n" #define ST(x,y) " movq %%mm"#y", 8*("#x")(%1) ;\n"
#define XO1(x,y) " pxor 8*("#x")(%2), %%mm"#y" ;\n" #define XO1(x,y) " pxor 8*("#x")(%2), %%mm"#y" ;\n"
...@@ -46,9 +30,8 @@ static void ...@@ -46,9 +30,8 @@ static void
xor_pII_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) xor_pII_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
{ {
unsigned long lines = bytes >> 7; unsigned long lines = bytes >> 7;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
#undef BLOCK #undef BLOCK
...@@ -83,7 +66,7 @@ xor_pII_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) ...@@ -83,7 +66,7 @@ xor_pII_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
: :
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
static void static void
...@@ -91,9 +74,8 @@ xor_pII_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -91,9 +74,8 @@ xor_pII_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3) unsigned long *p3)
{ {
unsigned long lines = bytes >> 7; unsigned long lines = bytes >> 7;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
#undef BLOCK #undef BLOCK
...@@ -133,7 +115,7 @@ xor_pII_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -133,7 +115,7 @@ xor_pII_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: :
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
static void static void
...@@ -141,9 +123,8 @@ xor_pII_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -141,9 +123,8 @@ xor_pII_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3, unsigned long *p4) unsigned long *p3, unsigned long *p4)
{ {
unsigned long lines = bytes >> 7; unsigned long lines = bytes >> 7;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
#undef BLOCK #undef BLOCK
...@@ -188,7 +169,7 @@ xor_pII_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -188,7 +169,7 @@ xor_pII_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: :
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
...@@ -197,9 +178,8 @@ xor_pII_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -197,9 +178,8 @@ xor_pII_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3, unsigned long *p4, unsigned long *p5) unsigned long *p3, unsigned long *p4, unsigned long *p5)
{ {
unsigned long lines = bytes >> 7; unsigned long lines = bytes >> 7;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
/* need to save/restore p4/p5 manually otherwise gcc's 10 argument /* need to save/restore p4/p5 manually otherwise gcc's 10 argument
limit gets exceeded (+ counts as two arguments) */ limit gets exceeded (+ counts as two arguments) */
...@@ -255,7 +235,7 @@ xor_pII_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -255,7 +235,7 @@ xor_pII_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: "r" (p4), "r" (p5) : "r" (p4), "r" (p5)
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
#undef LD #undef LD
...@@ -270,9 +250,8 @@ static void ...@@ -270,9 +250,8 @@ static void
xor_p5_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) xor_p5_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
{ {
unsigned long lines = bytes >> 6; unsigned long lines = bytes >> 6;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
" .align 32 ;\n" " .align 32 ;\n"
...@@ -311,7 +290,7 @@ xor_p5_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) ...@@ -311,7 +290,7 @@ xor_p5_mmx_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
: :
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
static void static void
...@@ -319,9 +298,8 @@ xor_p5_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -319,9 +298,8 @@ xor_p5_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3) unsigned long *p3)
{ {
unsigned long lines = bytes >> 6; unsigned long lines = bytes >> 6;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
" .align 32,0x90 ;\n" " .align 32,0x90 ;\n"
...@@ -369,7 +347,7 @@ xor_p5_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -369,7 +347,7 @@ xor_p5_mmx_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: :
: "memory" ); : "memory" );
FPU_RESTORE; kernel_fpu_end();
} }
static void static void
...@@ -377,9 +355,8 @@ xor_p5_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -377,9 +355,8 @@ xor_p5_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3, unsigned long *p4) unsigned long *p3, unsigned long *p4)
{ {
unsigned long lines = bytes >> 6; unsigned long lines = bytes >> 6;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
__asm__ __volatile__ ( __asm__ __volatile__ (
" .align 32,0x90 ;\n" " .align 32,0x90 ;\n"
...@@ -436,7 +413,7 @@ xor_p5_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -436,7 +413,7 @@ xor_p5_mmx_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: :
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
static void static void
...@@ -444,9 +421,8 @@ xor_p5_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -444,9 +421,8 @@ xor_p5_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
unsigned long *p3, unsigned long *p4, unsigned long *p5) unsigned long *p3, unsigned long *p4, unsigned long *p5)
{ {
unsigned long lines = bytes >> 6; unsigned long lines = bytes >> 6;
char fpu_save[108];
FPU_SAVE; kernel_fpu_begin();
/* need to save p4/p5 manually to not exceed gcc's 10 argument limit */ /* need to save p4/p5 manually to not exceed gcc's 10 argument limit */
__asm__ __volatile__ ( __asm__ __volatile__ (
...@@ -517,7 +493,7 @@ xor_p5_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, ...@@ -517,7 +493,7 @@ xor_p5_mmx_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
: "r" (p4), "r" (p5) : "r" (p4), "r" (p5)
: "memory"); : "memory");
FPU_RESTORE; kernel_fpu_end();
} }
static struct xor_block_template xor_block_pII_mmx = { static struct xor_block_template xor_block_pII_mmx = {
...@@ -536,9 +512,6 @@ static struct xor_block_template xor_block_p5_mmx = { ...@@ -536,9 +512,6 @@ static struct xor_block_template xor_block_p5_mmx = {
.do_5 = xor_p5_mmx_5, .do_5 = xor_p5_mmx_5,
}; };
#undef FPU_SAVE
#undef FPU_RESTORE
/* /*
* Cache avoiding checksumming functions utilizing KNI instructions * Cache avoiding checksumming functions utilizing KNI instructions
* Copyright (C) 1999 Zach Brown (with obvious credit due Ingo) * Copyright (C) 1999 Zach Brown (with obvious credit due Ingo)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment