Index: kernel/arch/arm32/include/drivers/gxemul.h
===================================================================
--- kernel/arch/arm32/include/drivers/gxemul.h	(revision ac47b7c2b6e75a9b9aa60b443fca9a151cf89e5c)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*
- * Copyright (c) 2007 Michal Kebrt
- * 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.
- */
-
-/** @addtogroup arm32gxemul GXemul
- *  @brief GXemul machine specific parts.
- *  @ingroup arm32
- * @{
- */
-/** @file
- *  @brief GXemul peripheries drivers declarations.
- */
-
-#ifndef KERN_arm32_GXEMUL_H_
-#define KERN_arm32_GXEMUL_H_
-
-/** Last interrupt number (beginning from 0) whose status is probed
- * from interrupt controller
- */
-#define GXEMUL_IRQC_MAX_IRQ  8
-#define GXEMUL_KBD_IRQ       2
-#define GXEMUL_TIMER_IRQ     4
-
-/** Timer frequency */
-#define GXEMUL_TIMER_FREQ  100
-
-#define GXEMUL_KBD_ADDRESS   0x10000000
-#define GXEMUL_MP_ADDRESS    0x11000000
-#define GXEMUL_FB_ADDRESS    0x12000000
-#define GXEMUL_RTC_ADDRESS   0x15000000
-#define GXEMUL_IRQC_ADDRESS  0x16000000
-
-extern void *gxemul_kbd;
-extern void *gxemul_rtc;
-extern void *gxemul_irqc;
-
-#define GXEMUL_HALT_OFFSET        0x010
-#define GXEMUL_RTC_FREQ_OFFSET    0x100
-#define GXEMUL_MP_MEMSIZE_OFFSET  0x090
-#define GXEMUL_RTC_ACK_OFFSET     0x110
-
-extern void gxemul_init(void);
-
-#endif
-
-/** @}
- */
Index: kernel/arch/arm32/include/exception.h
===================================================================
--- kernel/arch/arm32/include/exception.h	(revision ac47b7c2b6e75a9b9aa60b443fca9a151cf89e5c)
+++ kernel/arch/arm32/include/exception.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
@@ -137,4 +137,11 @@
 extern void exception_init(void);
 extern void print_istate(istate_t *istate);
+extern void reset_exception_entry(void);
+extern void irq_exception_entry(void);
+extern void fiq_exception_entry(void);
+extern void undef_instr_exception_entry(void);
+extern void prefetch_abort_exception_entry(void);
+extern void data_abort_exception_entry(void);
+extern void swi_exception_entry(void);
 
 
Index: kernel/arch/arm32/include/mach/integratorcp/integratorcp.h
===================================================================
--- kernel/arch/arm32/include/mach/integratorcp/integratorcp.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
+++ kernel/arch/arm32/include/mach/integratorcp/integratorcp.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2009 Vineeth Pillai
+ * 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.
+ */
+
+/** @addtogroup arm32integratorcp
+ *  @brief Integratorcp machine specific parts.
+ *  @ingroup arm32
+ * @{
+ */
+/** @file
+ *  @brief Integratorcp peripheries drivers declarations.
+ */
+
+#ifndef KERN_arm32_ICP_H_
+#define KERN_arm32_ICP_H_
+
+#include <arch/machine_func.h>
+
+/** Last interrupt number (beginning from 0) whose status is probed
+ * from interrupt controller
+ */
+#define ICP_IRQC_MAX_IRQ  8
+#define ICP_KBD_IRQ       3
+#define ICP_TIMER_IRQ    6
+
+/** Timer frequency */
+#define ICP_TIMER_FREQ  10000
+
+#define ICP_UART			0x16000000
+#define ICP_KBD				0x18000000
+#define ICP_KBD_STAT			0x04
+#define ICP_KBD_DATA			0x08
+#define ICP_KBD_INTR_STAT		0x10
+#define ICP_RTC				0x13000000
+#define ICP_RTC1_LOAD_OFFSET		0x100
+#define ICP_RTC1_READ_OFFSET		0x104
+#define ICP_RTC1_CTL_OFFSET		0x108
+#define ICP_RTC1_INTRCLR_OFFSET		0x10C
+#define ICP_RTC1_INTRSTAT_OFFSET	0x114
+#define ICP_RTC1_BGLOAD_OFFSET		0x118
+#define ICP_RTC_CTL_VALUE		0x00E2
+#define ICP_IRQC			0x14000000
+#define ICP_IRQC_MASK_OFFSET		0xC
+#define ICP_IRQC_UNMASK_OFFSET		0x8
+#define ICP_FB				0x00800000
+#define ICP_FB_FRAME			(ICP_FB >> 12)
+#define ICP_FB_NUM_FRAME		512
+#define ICP_VGA				0xC0000000
+#define ICP_CMCR			0x10000000
+#define ICP_SDRAM_MASK			0x1C
+#define ICP_SDRAMCR_OFFSET		0x20
+
+typedef struct {
+        uintptr_t uart;
+        uintptr_t kbd_ctrl;
+        uintptr_t kbd_stat;
+        uintptr_t kbd_data;
+        uintptr_t kbd_intstat;
+        uintptr_t rtc;
+        uintptr_t rtc1_load;
+        uintptr_t rtc1_read;
+        uintptr_t rtc1_ctl;
+        uintptr_t rtc1_intrclr;
+        uintptr_t rtc1_intrstat;
+        uintptr_t rtc1_bgload;
+        uintptr_t irqc;
+        uintptr_t irqc_mask;
+        uintptr_t irqc_unmask;
+        uintptr_t vga;
+        uintptr_t cmcr;
+        uintptr_t sdramcr;
+} icp_hw_map_t;
+
+
+extern void icp_init(void);
+extern void icp_fb_init(void);
+extern void icp_output_init(void);
+extern void icp_input_init(void);
+extern void icp_release_console(void);
+extern void icp_grab_console(void);
+extern void icp_timer_irq_start(void);
+extern void icp_cpu_halt(void);
+extern void icp_irq_exception(int exc_no, istate_t *istate);
+extern uintptr_t icp_get_memory_size(void);
+extern uintptr_t icp_get_fb_address(void);
+extern void icp_fb_init(void);
+extern void icp_frame_init(void);
+
+#endif
+
+/** @}
+ */
Index: kernel/arch/arm32/include/mach/testarm/testarm.h
===================================================================
--- kernel/arch/arm32/include/mach/testarm/testarm.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
+++ kernel/arch/arm32/include/mach/testarm/testarm.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * Copyright (c) 2009 Vineeth Pillai
+ * 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.
+ */
+
+/** @addtogroup arm32gxemul GXemul
+ *  @brief GXemul machine specific parts.
+ *  @ingroup arm32
+ * @{
+ */
+/** @file
+ *  @brief GXemul peripheries drivers declarations.
+ */
+
+#ifndef KERN_arm32_GXEMUL_H_
+#define KERN_arm32_GXEMUL_H_
+
+#include <arch/machine_func.h>
+
+/** Last interrupt number (beginning from 0) whose status is probed
+ * from interrupt controller
+ */
+#define GXEMUL_IRQC_MAX_IRQ  8
+#define GXEMUL_KBD_IRQ       2
+#define GXEMUL_TIMER_IRQ     4
+
+/** Timer frequency */
+#define GXEMUL_TIMER_FREQ  100
+
+#define GXEMUL_KBD_ADDRESS   0x10000000
+#define GXEMUL_MP_ADDRESS    0x11000000
+#define GXEMUL_FB_ADDRESS    0x12000000
+#define GXEMUL_RTC_ADDRESS   0x15000000
+#define GXEMUL_IRQC_ADDRESS  0x16000000
+
+extern void *gxemul_kbd;
+extern void *gxemul_rtc;
+extern void *gxemul_irqc;
+
+#define GXEMUL_HALT_OFFSET        0x010
+#define GXEMUL_RTC_FREQ_OFFSET    0x100
+#define GXEMUL_MP_MEMSIZE_OFFSET  0x090
+#define GXEMUL_RTC_ACK_OFFSET     0x110
+
+extern void gxemul_init(void);
+extern void gxemul_fb_init(void);
+extern void gxemul_output_init(void);
+extern void gxemul_input_init(void);
+extern void gxemul_release_console(void);
+extern void gxemul_grab_console(void);
+extern void gxemul_timer_irq_start(void);
+extern void gxemul_cpu_halt(void);
+extern void gxemul_irq_exception(int exc_no, istate_t *istate);
+extern uintptr_t gxemul_get_memory_size(void);
+extern uintptr_t gxemul_get_fb_address(void);
+extern void gxemul_fb_init(void);
+extern void gxemul_frame_init(void);
+
+
+#endif
+
+/** @}
+ */
Index: kernel/arch/arm32/include/machine_func.h
===================================================================
--- kernel/arch/arm32/include/machine_func.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
+++ kernel/arch/arm32/include/machine_func.h	(revision 5e738155aabe3b1083edd0a2e466ca19dd31d8ed)
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2007 Michal Kebrt
+ * Copyright (c) 2009 Vineeth Pillai
+ * 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.
+ */
+
+/** @addtogroup arm32
+ * @{
+ */
+/** @file
+ *  @brief Declarations of machine specific functions.
+ *
+ *  These functions enable to differentiate more kinds of ARM emulators
+ *  or CPUs. It's the same concept as "arch" functions on the architecture
+ *  level.
+ */
+
+#ifndef KERN_arm32_MACHINE_FUNC_H_
+#define KERN_arm32_MACHINE_FUNC_H_
+
+#include <console/console.h>
+#include <arch/types.h>
+#include <arch/exception.h>
+
+#define MACHINE_GENFUNC	machine_genfunc
+
+struct arm_machine_ops {
+	void		(*machine_grab_console)(void);
+	void		(*machine_release_console)(void);
+	void		(*machine_init)(void);
+	void		(*machine_timer_irq_start)(void);
+	void		(*machine_cpu_halt)(void);
+	uintptr_t	(*machine_get_memory_size)(void);
+	void		(*machine_fb_init)(void);
+	void		(*machine_irq_exception)(int, istate_t*);
+	uintptr_t	(*machine_get_fb_address)(void);
+	void		(*machine_frame_init)(void);
+	void		(*machine_output_init)(void);
+	void		(*machine_input_init)(void);
+};
+
+extern struct arm_machine_ops machine_ops;
+
+
+/** Acquire console back for kernel. */
+extern void machine_grab_console(void);
+
+/** Return console to userspace. */
+extern void machine_release_console(void);
+
+
+/** Maps HW devices to the kernel address space using #hw_map. */
+extern void machine_init(void);
+
+
+/** Starts timer. */
+extern void machine_timer_irq_start(void);
+
+
+/** Halts CPU. */
+extern void machine_cpu_halt(void);
+
+
+/** Returns size of available memory.
+ *
+ *  @return Size of available memory.
+ */
+extern uintptr_t machine_get_memory_size(void);
+
+/** Initializes the Frame Buffer
+ *
+ */
+extern void machine_fb_init(void);
+
+
+/** Interrupt exception handler.
+ *
+ * @param exc_no Interrupt exception number.
+ * @param istate Saved processor state.
+ */
+extern void machine_irq_exception(int exc_no, istate_t *istate);
+
+
+/** Returns address of framebuffer device.
+ *
+ *  @return Address of framebuffer device.
+ */
+extern uintptr_t machine_get_fb_address(void);
+
+/*
+ * Machine specific frame initialization
+ */
+extern void machine_frame_init(void);
+
+/*
+ * configure the serial line output device.
+ */
+extern void machine_output_init(void);
+
+/*
+ * configure the serial line input device.
+ */
+extern void machine_input_init(void);
+
+extern void machine_genfunc(void);
+#endif
+
+/** @}
+ */
