Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ HelenOS.config	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -57,5 +57,5 @@
 
 % Machine type
-@ "testarm" Gxemul Testarm
+@ "testarm" GXEmul Testarm
 @ "integratorcp" Integratorcp
 ! [PLATFORM=arm32] MACHINE (choice)
Index: boot/arch/arm32/loader/Makefile
===================================================================
--- boot/arch/arm32/loader/Makefile	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ boot/arch/arm32/loader/Makefile	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -41,13 +41,4 @@
 TARGET = arm-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin
-
-ifeq ($(MACHINE), testarm)
-	DMACHINE = MACHINE_GXEMUL_TESTARM
-endif
-
-ifeq ($(MACHINE), integratorcp)
-	DMACHINE = MACHINE_ICP
-endif
-
 
 ifeq ($(COMPILER),gcc_native)
@@ -103,5 +94,5 @@
 	$(USPACEDIR)/srv/fs/fat/fat \
 	$(USPACEDIR)/srv/bd/file_bd/file_bd
-ifeq ($(MACHINE), testarm)
+ifeq ($(MACHINE),testarm)
 	RD_SRVS += \
 		$(USPACEDIR)/srv/bd/gxe_bd/gxe_bd
@@ -161,3 +152,3 @@
 
 %.o: %.c
-	$(CC) -D$(DMACHINE) $(DEFS) $(CFLAGS) -c $< -o $@
+	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
Index: boot/arch/arm32/loader/print/print.c
===================================================================
--- boot/arch/arm32/loader/print/print.c	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ boot/arch/arm32/loader/print/print.c	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -41,9 +41,10 @@
 
 /** Address where characters to be printed are expected. */
-#ifdef MACHINE_GXEMUL_TESTARM
-#define PUTC_ADDRESS	0x10000000
+#ifdef MACHINE_testarm
+	#define PUTC_ADDRESS  0x10000000
 #endif
-#ifdef MACHINE_ICP
-#define  PUTC_ADDRESS    0x16000000
+
+#ifdef MACHINE_integratorcp
+	#define PUTC_ADDRESS  0x16000000
 #endif
 
Index: defaults/arm32/GXemul/Makefile.config
===================================================================
--- defaults/arm32/GXemul/Makefile.config	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
+++ defaults/arm32/GXemul/Makefile.config	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -0,0 +1,2 @@
+# Machine type
+MACHINE = testarm
Index: defaults/arm32/integratorcp/Makefile.config
===================================================================
--- defaults/arm32/integratorcp/Makefile.config	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
+++ defaults/arm32/integratorcp/Makefile.config	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -0,0 +1,2 @@
+# Machine type
+MACHINE = integratorcp
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/Makefile	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -344,7 +344,4 @@
 	-rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(KARCH)/_link.ld
 	find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
-ifeq ($(PLATFORM),arm32)
-	rm -f arch/$(KARCH)/include/machine.h 
-endif
 	for arch in arch/* ; do \
 	    [ -e $$arch/_link.ld ] && rm $$arch/_link.ld 2>/dev/null ; \
@@ -354,7 +351,4 @@
 	ln -sfn ../../arch/$(KARCH)/include/ generic/include/arch
 	ln -sfn ../../genarch/include/ generic/include/genarch
-ifeq ($(PLATFORM),arm32)
-	ln -sfn mach/$(MACHINE)/$(MACHINE).h arch/$(KARCH)/include/machine.h 
-endif
 
 depend: archlinks
Index: kernel/arch/arm32/Makefile.inc
===================================================================
--- kernel/arch/arm32/Makefile.inc	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/Makefile.inc	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -61,11 +61,15 @@
 	arch/$(KARCH)/src/mm/page.c \
 	arch/$(KARCH)/src/mm/tlb.c \
-	arch/$(KARCH)/src/mm/page_fault.c 
-ifeq ($(MACHINE), testarm)
-        ARCH_SOURCES += arch/$(KARCH)/src/mach/testarm/testarm.c
-else ifeq ($(MACHINE), integratorcp)
-        ARCH_SOURCES += arch/$(KARCH)/src/mach/integratorcp/integratorcp.c
+	arch/$(KARCH)/src/mm/page_fault.c
+
+ifeq ($(MACHINE),testarm)
+	ARCH_SOURCES += arch/$(KARCH)/src/mach/testarm/testarm.c
 endif
-ifeq ($(CONFIG_PL050), y)
+
+ifeq ($(MACHINE),integratorcp)
+	ARCH_SOURCES += arch/$(KARCH)/src/mach/integratorcp/integratorcp.c
+endif
+
+ifeq ($(CONFIG_PL050),y)
 	ARCH_SOURCES += genarch/src/drivers/pl050/pl050.c
 endif
Index: kernel/arch/arm32/include/mach/integratorcp/integratorcp.h
===================================================================
--- kernel/arch/arm32/include/mach/integratorcp/integratorcp.h	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/include/mach/integratorcp/integratorcp.h	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -36,6 +36,6 @@
  */
 
-#ifndef KERN_arm32_ICP_H_
-#define KERN_arm32_ICP_H_
+#ifndef KERN_arm32_MACHINE_H_
+#define KERN_arm32_MACHINE_H_
 
 #include <arch/machine_func.h>
Index: kernel/arch/arm32/include/mach/testarm/testarm.h
===================================================================
--- kernel/arch/arm32/include/mach/testarm/testarm.h	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/include/mach/testarm/testarm.h	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -37,6 +37,6 @@
  */
 
-#ifndef KERN_arm32_GXEMUL_H_
-#define KERN_arm32_GXEMUL_H_
+#ifndef KERN_arm32_MACHINE_H_
+#define KERN_arm32_MACHINE_H_
 
 #include <arch/machine_func.h>
Index: kernel/arch/arm32/src/arm32.c
===================================================================
--- kernel/arch/arm32/src/arm32.c	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/src/arm32.c	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -41,5 +41,4 @@
 #include <console/console.h>
 #include <ddi/irq.h>
-#include <arch/machine.h>
 #include <print.h>
 #include <config.h>
@@ -50,4 +49,13 @@
 #include <string.h>
 
+#ifdef MACHINE_testarm
+	#include <arch/mach/testarm/testarm.h>
+#endif
+
+#ifdef MACHINE_integratorcp
+	#include <arch/mach/integratorcp/integratorcp.h>
+#endif
+
+
 /** Performs arm32-specific initialization before main_bsp() is called. */
 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
Index: kernel/arch/arm32/src/exception.c
===================================================================
--- kernel/arch/arm32/src/exception.c	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/src/exception.c	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -40,7 +40,14 @@
 #include <arch/mm/page_fault.h>
 #include <arch/barrier.h>
-#include <arch/machine.h>
 #include <print.h>
 #include <syscall/syscall.h>
+
+#ifdef MACHINE_testarm
+	#include <arch/mach/testarm/testarm.h>
+#endif
+
+#ifdef MACHINE_integratorcp
+	#include <arch/mach/integratorcp/integratorcp.h>
+#endif
 
 /** Offset used in calculation of exception handler's relative address.
Index: kernel/arch/arm32/src/interrupt.c
===================================================================
--- kernel/arch/arm32/src/interrupt.c	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/src/interrupt.c	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -36,8 +36,15 @@
 #include <arch/asm.h>
 #include <arch/regutils.h>
-#include <arch/machine.h>
 #include <ddi/irq.h>
 #include <ddi/device.h>
 #include <interrupt.h>
+
+#ifdef MACHINE_testarm
+	#include <arch/mach/testarm/testarm.h>
+#endif
+
+#ifdef MACHINE_integratorcp
+	#include <arch/mach/integratorcp/integratorcp.h>
+#endif
 
 /** Initial size of a table holding interrupt handlers. */
@@ -97,5 +104,4 @@
 	irq_init(IRQ_COUNT, IRQ_COUNT);
 	machine_timer_irq_start();
-	
 }
 
Index: kernel/arch/arm32/src/mm/frame.c
===================================================================
--- kernel/arch/arm32/src/mm/frame.c	(revision 76093aefd3bb77531c0e7013bb69e1546d81aab9)
+++ kernel/arch/arm32/src/mm/frame.c	(revision 646b9960f45edec2b83f4adb3bc5a501c2b28e9b)
@@ -36,6 +36,13 @@
 #include <mm/frame.h>
 #include <arch/mm/frame.h>
-#include <arch/machine.h>
 #include <config.h>
+
+#ifdef MACHINE_testarm
+	#include <arch/mach/testarm/testarm.h>
+#endif
+
+#ifdef MACHINE_integratorcp
+	#include <arch/mach/integratorcp/integratorcp.h>
+#endif
 
 /** Address of the last frame in the memory. */
