Index: arch/amd64/include/asm.h
===================================================================
--- arch/amd64/include/asm.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ arch/amd64/include/asm.h	(revision 8ec9baeec9b8da8c63c55bb6f506595550262fea)
@@ -141,4 +141,17 @@
 }
 
+/** Read CR0
+ *
+ * Return value in CR0
+ *
+ * @return Value read.
+ */
+static inline __u64 read_cr0(void) 
+{ 
+	__u64 v; 
+	__asm__ volatile ("movq %%cr0,%0" : "=r" (v)); 
+	return v; 
+}
+
 /** Read CR2
  *
@@ -147,5 +160,10 @@
  * @return Value read.
  */
-static inline __u64 read_cr2(void) { __u64 v; __asm__ volatile ("movq %%cr2,%0" : "=r" (v)); return v; }
+static inline __u64 read_cr2(void) 
+{ 
+	__u64 v; 
+	__asm__ volatile ("movq %%cr2,%0" : "=r" (v)); 
+	return v; 
+}
 
 /** Write CR3
@@ -155,5 +173,8 @@
  * @param v Value to be written.
  */
-static inline void write_cr3(__u64 v) { __asm__ volatile ("movq %0,%%cr3\n" : : "r" (v)); }
+static inline void write_cr3(__u64 v) 
+{ 
+	__asm__ volatile ("movq %0,%%cr3\n" : : "r" (v)); 
+}
 
 /** Read CR3
@@ -163,5 +184,10 @@
  * @return Value read.
  */
-static inline __u64 read_cr3(void) { __u64 v; __asm__ volatile ("movq %%cr3,%0" : "=r" (v)); return v; }
+static inline __u64 read_cr3(void) 
+{ 
+	__u64 v;
+	__asm__ volatile ("movq %%cr3,%0" : "=r" (v)); 
+	return v; 
+}
 
 
Index: arch/amd64/include/context.h
===================================================================
--- arch/amd64/include/context.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ arch/amd64/include/context.h	(revision 8ec9baeec9b8da8c63c55bb6f506595550262fea)
@@ -34,5 +34,10 @@
 #endif
 
-#define SP_DELTA     8
+
+/* According to ABI the stack MUST be aligned on 
+ * 16-byte boundary. If it is not, the va_arg calling will
+ * panic sooner or later
+ */
+#define SP_DELTA     16
 
 struct context {
Index: arch/amd64/include/cpu.h
===================================================================
--- arch/amd64/include/cpu.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ arch/amd64/include/cpu.h	(revision 8ec9baeec9b8da8c63c55bb6f506595550262fea)
@@ -56,4 +56,5 @@
 extern void set_efer_flag(int flag);
 extern __u64 read_efer_flag(void);
+void cpu_setup_fpu(void);
 
 #endif /* __ASM__ */
Index: arch/amd64/include/cpuid.h
===================================================================
--- arch/amd64/include/cpuid.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ arch/amd64/include/cpuid.h	(revision 8ec9baeec9b8da8c63c55bb6f506595550262fea)
@@ -30,6 +30,10 @@
 #define __CPUID_H__
 
-#define AMD_CPUID_EXTENDED 0x80000001
+#define AMD_CPUID_EXTENDED   0x80000001
 #define AMD_EXT_NOEXECUTE    20
+
+#define INTEL_CPUID_STANDARD 0x1
+#define INTEL_SSE2           26
+#define INTEL_FXSAVE         24
 
 #ifndef __ASM__
Index: arch/amd64/include/fpu_context.h
===================================================================
--- arch/amd64/include/fpu_context.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ 	(revision )
@@ -1,37 +1,0 @@
-/*
- * Copyright (C) 2005 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __amd64_FPU_CONTEXT_H__
-#define __amd64_FPU_CONTEXT_H__
-
-#include <arch/types.h>
-
-struct fpu_context {
-};
-
-#endif
Index: arch/amd64/include/pm.h
===================================================================
--- arch/amd64/include/pm.h	(revision c4b3e3e3d61c7d230f47366698e425a72b4051ec)
+++ arch/amd64/include/pm.h	(revision 8ec9baeec9b8da8c63c55bb6f506595550262fea)
@@ -146,6 +146,5 @@
 
 extern struct ptr_16_64 gdtr;
-extern struct ptr_16_32 bsp_bootstrap_gdtr;
-extern struct ptr_16_32 ap_bootstrap_gdtr;
+extern struct ptr_16_32 real_bootstrap_gdtr;
 
 extern void pm_init(void);
