Index: arch/ia32/src/boot/boot.S
===================================================================
--- arch/ia32/src/boot/boot.S	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/ia32/src/boot/boot.S	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -48,6 +48,8 @@
 	orl $0x1,%eax
 	movl %eax,%cr0
-	jmp 0f
-0:
+	jmpl $8,$meeting_point
+meeting_point:
+.code32
+
 	movw $16,%ax
 	movw %ax,%es
@@ -57,7 +59,4 @@
         movw %ax,%ss
 	movl $0x7c00,%esp
-	jmpl $8,$meeting_point
-meeting_point:
-.code32
 
 	lidt idtr
@@ -97,4 +96,6 @@
 	orl $(1<<31), %ebx
 	movl %ebx, %cr0
+	jmp 0f
+0:
 	ret
 
Index: arch/ia32/src/pm.c
===================================================================
--- arch/ia32/src/pm.c	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/ia32/src/pm.c	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -72,7 +72,7 @@
 void gdt_setbase(struct descriptor *d, __address base)
 {
-        d->base_0_15 = KA2PA(base) & 0xffff;
-        d->base_16_23 = (KA2PA(base) >> 16) & 0xff;
-        d->base_24_31 = (KA2PA(base) >> 24) & 0xff;
+        d->base_0_15 = base & 0xffff;
+        d->base_16_23 = ((base) >> 16) & 0xff;
+        d->base_24_31 = ((base) >> 24) & 0xff;
 
 }
@@ -86,6 +86,9 @@
 void idt_setoffset(struct idescriptor *d, __address offset)
 {
-	d->offset_0_15 = KA2PA(offset) & 0xffff;
-	d->offset_16_31 = KA2PA(offset) >> 16;
+	/*
+	 * Offset is a linear address.
+	 */
+	d->offset_0_15 = offset & 0xffff;
+	d->offset_16_31 = offset >> 16;
 }
 
Index: arch/ia32/src/smp/ap.S
===================================================================
--- arch/ia32/src/smp/ap.S	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/ia32/src/smp/ap.S	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -55,9 +55,5 @@
 	orl $1,%eax
 	movl %eax,%cr0
-	jmp 0f
-0:
-	ljmp $KTEXT,$jump_to_kernel
-
-# this is where the AP enters the kernel space
+	jmpl $KTEXT,$jump_to_kernel
 jump_to_kernel:
 .code32
Index: arch/ia32/src/smp/apic.c
===================================================================
--- arch/ia32/src/smp/apic.c	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/ia32/src/smp/apic.c	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -44,5 +44,5 @@
  * Advanced Programmable Interrupt Controller for MP systems.
  * Tested on:
- *	Bochs 2.0.2 - Bochs 2.2-cvs with 2-8 CPUs
+ *	Bochs 2.0.2 - Bochs 2.2 with 2-8 CPUs
  *	ASUS P/I-P65UP5 + ASUS C-P55T2D REV. 1.41 with 2x 200Mhz Pentium CPUs
  */
Index: arch/ia64/include/atomic.h
===================================================================
--- arch/ia64/include/atomic.h	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/ia64/include/atomic.h	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2005 Jakub Jermar
+ * 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 __ia64_ATOMIC_H__
+#define __ia64_ATOMIC_H__
+
+/*
+ * TODO: these are just placeholders for real implementations of atomic_inc and atomic_dec.
+ * WARNING: the following functions cause the code to be preemption-unsafe !!!
+ */
+
+static inline atomic_inc(volatile int *val) {
+	*val++;
+}
+
+static inline atomic_dec(volatile int *val) {
+	*val--;
+}
+
+#endif
Index: arch/mips/include/atomic.h
===================================================================
--- arch/mips/include/atomic.h	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ arch/mips/include/atomic.h	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -1,4 +1,4 @@
 /*
- * Copyright (C) 2001-2004 Jakub Jermar
+ * Copyright (C) 2005 Ondrej Palkovsky
  * All rights reserved.
  *
Index: doc/AUTHORS
===================================================================
--- doc/AUTHORS	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ doc/AUTHORS	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -4,2 +4,3 @@
 Josef Cejka
 Sergey Bondari
+Ondrej Palkovsky
Index: doc/requirements
===================================================================
--- doc/requirements	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ doc/requirements	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -11,5 +11,5 @@
 
     SMP COMPATIBILITY
-    o Bochs 2.0.2 - Bochs 2.2-cvs
+    o Bochs 2.0.2 - Bochs 2.2
 	o 2x-8x 686 CPU
     o ASUS P/I-P65UP5 + ASUS C-P55T2D REV. 1.41
Index: src/Makefile.config
===================================================================
--- src/Makefile.config	(revision e3f41b62d5b503ff9a3beb8ab121cc305d5f2fd7)
+++ src/Makefile.config	(revision b0bf5012e7a657969b61b900eb1f1446c6e3acae)
@@ -15,5 +15,5 @@
 
 # Deadlock detection support for spinlocks.
-#DEBUG_SPINLOCK=DEBUG_SPINLOCK
+DEBUG_SPINLOCK=DEBUG_SPINLOCK
 
 # Uncomment if you want to compile in userspace support
