[PATCH 07/12] xddm/display/res.c: move ALIGN out of Save/RestoreFPU for easier amd64 implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 xddm/display/res.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/xddm/display/res.c b/xddm/display/res.c
index bfb3571..289ece5 100644
--- a/xddm/display/res.c
+++ b/xddm/display/res.c
@@ -1811,13 +1811,11 @@ static void FreeBitmapImage(PDev *pdev, Resource *res) // todo: defer
 
 #ifndef _WIN64
 
-static _inline void RestoreFPU(PDev *pdev, UINT8 FPUSave[])
+static _inline void RestoreFPU(PDev *pdev, size_t aligned_addr)
 {
-    void *align_addr =  (void *)ALIGN((size_t)(FPUSave), SSE_ALIGN);
-
     _asm
     {
-        mov esi, align_addr
+        mov esi, aligned_addr
 
         movdqa xmm0, [esi]
         movdqa xmm1, [esi + 16]
@@ -1826,13 +1824,11 @@ static _inline void RestoreFPU(PDev *pdev, UINT8 FPUSave[])
     }
 }
 
-static _inline void SaveFPU(PDev *pdev, UINT8 FPUSave[])
+static _inline void SaveFPU(PDev *pdev, size_t aligned_addr)
 {
-    void *align_addr =  (void *)ALIGN((size_t)(FPUSave), SSE_ALIGN);
-
     _asm
     {
-        mov edi, align_addr
+        mov edi, aligned_addr
     
         movdqa [edi], xmm0
         movdqa [edi + 16], xmm1
@@ -1865,7 +1861,8 @@ static _inline Resource *GetBitmapImage(PDev *pdev, SURFOBJ *surf, XLATEOBJ *col
     UINT8 *src_end;
     UINT8 *dest;
     UINT8 *dest_end;
-    UINT8 FPUSave[16 * 4 + 15];
+    UINT8 FPUSaveUnaligned[16 * 4 + 15];
+    size_t FPUSave = ALIGN((size_t)(FPUSaveUnaligned), SSE_ALIGN);
     BOOL use_sse = FALSE;
 
     DEBUG_PRINT((pdev, 12, "%s\n", __FUNCTION__));
-- 
1.9.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]