Index: headers/os/kernel/OS.h
===================================================================
--- headers/os/kernel/OS.h	(Revision 30156)
+++ headers/os/kernel/OS.h	(Arbeitskopie)
@@ -659,7 +659,8 @@
 	B_MK_61_PLATFORM,
 	B_NINTENDO_64_PLATFORM,
 	B_AMIGA_PLATFORM,
-	B_ATARI_PLATFORM
+	B_ATARI_PLATFORM,
+	B_BEAGLEBOARD_PLATFORM
 } platform_type;
 
 typedef struct {
Index: headers/os/kernel/debugger.h
===================================================================
--- headers/os/kernel/debugger.h	(Revision 30156)
+++ headers/os/kernel/debugger.h	(Arbeitskopie)
@@ -17,6 +17,8 @@
 	#include <arch/ppc/arch_debugger.h>
 #elif __M68K__
 	#include <arch/m68k/arch_debugger.h>
+#elif __ARM__
+	#include <arch/arm/arch_debugger.h>
 #else
 	#error you need to write a <arch/<cpu>/arch_debugger.h>
 #endif
Index: headers/os/arch/arm/arch_debugger.h
===================================================================
--- headers/os/arch/arm/arch_debugger.h	(Revision 0)
+++ headers/os/arch/arm/arch_debugger.h	(Revision 0)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005, Haiku Inc.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _ARCH_ARM_DEBUGGER_H
+#define _ARCH_ARM_DEBUGGER_H
+
+struct debug_cpu_state {
+	uint32	r0;
+	uint32	r1;
+	uint32	r2;
+	uint32	r3;
+	uint32	r4;
+	uint32	r5;
+	uint32	r6;
+	uint32	r7;
+	uint32	r8;
+	uint32	r9;
+	uint32	r10;
+	uint32	r11;
+	uint32	r12;
+	uint32	r13;
+	uint32	r14;
+	uint32	r15;
+	uint32	pc;
+	uint32	lr;
+#warning ARM: missing members!
+	uint32	cspr;
+} __attribute__((aligned(8)));
+
+#endif	// _ARCH_M68K_DEBUGGER_H
Index: headers/posix/arch/arm/signal.h
===================================================================
--- headers/posix/arch/arm/signal.h	(Revision 30156)
+++ headers/posix/arch/arm/signal.h	(Arbeitskopie)
@@ -1,3 +1,4 @@
+
 /*
  * Copyright 2008, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
@@ -28,8 +29,8 @@
 	ulong r13;	/* stack pointer */
 	ulong r14;	/* link register */
 	ulong r15;	/* program counter */
-	ulong cpsr;
-#warning ARM: fix floats in vregs, add missing stuff.
+	ulong cpsr;  	/* current programm status register */
+//#warning ARM: fix add missing stuff.
 };
 #endif /* __ARM__ */ 
 
Index: headers/posix/arch/arm/arch_setjmp.h
===================================================================
--- headers/posix/arch/arm/arch_setjmp.h	(Revision 30156)
+++ headers/posix/arch/arm/arch_setjmp.h	(Arbeitskopie)
@@ -5,8 +5,8 @@
 #ifndef _ARCH_SETJMP_H_
 #define _ARCH_SETJMP_H_
 
-#define _SETJMP_BUF_SZ (7+6+2+8*((96/8)/4))
-typedef int __jmp_buf[_SETJMP_BUF_SZ];
-#warning ARM: fix jmpbuf size
+//#define _SETJMP_BUF_SZ (7+6+2+8*((96/8)/4))
+typedef int __jmp_buf[64];
+//#warning ARM: fix jmpbuf size
 
 #endif	/* _ARCH_SETJMP_H_ */
Index: headers/posix/setjmp.h
===================================================================
--- headers/posix/setjmp.h	(Revision 30156)
+++ headers/posix/setjmp.h	(Arbeitskopie)
@@ -14,6 +14,8 @@
 	#include <arch/ppc/arch_setjmp.h>
 #elif __M68K__
 	#include <arch/m68k/arch_setjmp.h>
+#elif __ARM__
+	#include <arch/arm/arch_setjmp.h>
 #else
 	#error #include <arch/<cpu>/arch_setjmp.h>
 #endif
Index: headers/posix/signal.h
===================================================================
--- headers/posix/signal.h	(Revision 30156)
+++ headers/posix/signal.h	(Arbeitskopie)
@@ -257,6 +257,8 @@
         #include <arch/ppc/signal.h>
 #elif __M68K__
         #include <arch/m68k/signal.h>
+#elif __ARM__
+        #include <arch/arm/signal.h>
 #else
         #error #include <arch/<cpu>/signal.h>
 #endif
Index: headers/private/kernel/arch/arm/arch_kernel_args.h
===================================================================
--- headers/private/kernel/arch/arm/arch_kernel_args.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_kernel_args.h	(Revision 0)
@@ -0,0 +1,61 @@
+/*
+** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+** Distributed under the terms of the OpenBeOS License.
+*/
+#ifndef KERNEL_ARCH_M68K_KERNEL_ARGS_H
+#define KERNEL_ARCH_M68K_KERNEL_ARGS_H
+
+#ifndef KERNEL_BOOT_KERNEL_ARGS_H
+#	error This file is included from <boot/kernel_args.h> only
+#endif
+
+#define _PACKED __attribute__((packed))
+
+//#define MAX_VIRTUAL_RANGES_TO_KEEP	32
+
+// kernel args
+typedef struct {
+	int			cpu_type; // decimal: 68030, ...
+	int			fpu_type; // decimal: 68030, ...
+	int			mmu_type; // decimal: 68030, ...
+	int			platform; // M68K_PLATFORM_*
+	int			machine;  // platform specific machine type
+	bool			has_lpstop; //XXX: use bit flags
+	// architecture specific
+	uint64		cpu_frequency;
+	uint64		bus_frequency;
+	uint64		time_base_frequency;
+
+	// page root table
+	uint32	phys_pgroot;
+	uint32	vir_pgroot;
+	// interrupt vector table (VBR)
+	uint32	phys_vbr;
+	uint32	vir_vbr;
+//XXX:
+	addr_range	page_table;		// virtual address and size of the page table
+	addr_range	exception_handlers;
+	addr_range	framebuffer;		// maps where the framebuffer is located, in physical memory
+	int 		screen_x, screen_y, screen_depth;
+
+	// The virtual ranges we want to keep in the kernel. E.g. those belonging
+	// to the Open Firmware.
+//	uint32		num_virtual_ranges_to_keep;
+//	addr_range	virtual_ranges_to_keep[MAX_VIRTUAL_RANGES_TO_KEEP];
+
+	// platform specific
+	union {
+		struct {
+			struct {
+				//XXX: are those meant to be used by physical
+				// or virtual address ?
+				uint32 (*nf_get_id)(const char *);
+				int32 (*nf_call)(uint32, ...);
+				addr_t nf_page;
+				uint32 nf_dprintf_id;
+			} nat_feat;
+		} atari;
+	} plat_args;
+} arch_kernel_args;
+
+#endif	/* KERNEL_ARCH_M68K_KERNEL_ARGS_H */
Index: headers/private/kernel/arch/arm/arch_vm_translation_map.h
===================================================================
--- headers/private/kernel/arch/arm/arch_vm_translation_map.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_vm_translation_map.h	(Revision 0)
@@ -0,0 +1,26 @@
+/*
+** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+** Distributed under the terms of the OpenBeOS License.
+*/
+#ifndef _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H
+#define _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H
+
+#include <arch/vm_translation_map.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void m68k_translation_map_change_asid(vm_translation_map *map);
+
+status_t m68k_map_address_range(addr_t virtualAddress, addr_t physicalAddress,
+	size_t size);
+void m68k_unmap_address_range(addr_t virtualAddress, size_t size);
+status_t m68k_remap_address_range(addr_t *virtualAddress, size_t size,
+	bool unmap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _KERNEL_ARCH_M68K_VM_TRANSLATION_MAP_H */
Index: headers/private/kernel/arch/arm/arch_mmu.h
===================================================================
--- headers/private/kernel/arch/arm/arch_mmu.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_mmu.h	(Revision 0)
@@ -0,0 +1,123 @@
+/*
+** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+** Distributed under the terms of the OpenBeOS License.
+*/
+#ifndef _KERNEL_ARCH_M68K_MMU_H
+#define _KERNEL_ARCH_M68K_MMU_H
+
+
+#include <SupportDefs.h>
+#include <string.h>
+
+
+/*
+ * cf.
+ * "mc68030 Enhanced 32-bit Microprocessor User's Manual"
+ * (3rd edition), Section 9
+ * "mc68040 Enhanced 32-bit Microprocessor User's Manual"
+ * Section 9
+ *
+ * The 030 pmmu can support up to 6-level translation tree,
+ * each level using an size-selectable index from the
+ * virtual address, short (4-bit) and long (8-bit) page table
+ * and page entry descriptors, early tree termination, and selectable
+ * page size from 256 bytes to 32K.
+ * There is optionally a separate Supervisor Root Pointer to separate
+ * the user and kernel trees.
+ *
+ * The 040 pmmu however is way more limited in its abilities.
+ * It has a fixed 3-level page tree, with 7/7/6 bit splitting for
+ * 4K pages. The opcodes are also different so we will need specific
+ * routines. Both supervisor and root pointers must be used so we can't
+ * reuse one of them.
+ * 
+ *
+ * We settle to:
+ * - 1 bit index for the first level to easily split kernel and user
+ * part of the tree, with the possibility to force supervisor only for
+ * the kernel tree. The use of SRP to point to a 2nd tree is avoided as
+ * it is not available on 68060, plus that makes a spare 64bit reg to
+ * stuff things in.
+ * - 9 bit page directory
+ * - 10 bit page tables
+ * - 12 bit page index (4K pages, a common value).
+ */
+
+
+
+enum descriptor_types {
+	DT_INVALID = 0,			// invalid entry
+	DT_PAGE,				// page descriptor
+	DT_VALID_4,				// short page table descriptor
+	DT_VALID_8,				// long page table descriptor
+};
+
+#if 0
+/* This is the normal layout of the descriptors, as per documentation.
+ * When page size > 256, several bits are unused in the LSB of page
+ * addresses, which we can use in addition of other unused bits.
+ * the structs dedlared later reflect this for 4K pages.
+ */
+
+struct short_page_directory_entry {
+	// upper 32 bits
+	uint32 type : 2;
+	uint32 write_protect : 1;
+	uint32 used : 1;
+	uint32 address : 28;
+};
+
+struct long_page_directory_entry {
+	// upper 32 bits
+	uint32 type : 2;
+	uint32 write_protect : 1;
+	uint32 used : 1;
+	uint32 _zero1 : 4;
+	uint32 supervisor : 1;
+	uint32 _zero2 : 1;
+	uint32 _ones : 6;
+	uint32 limit : 15;
+	uint32 low_up : 1;						// limit is lower(1)/upper(0)
+	// lower 32 bits
+	uint32 unused : 4;						// 
+	uint32 address : 28;
+};
+
+struct short_page_table_entry {
+	uint32 type : 2;
+	uint32 write_protect : 1;
+	uint32 used : 1;
+	uint32 modified : 1;
+	uint32 _zero1 : 1;
+	uint32 cache_inhibit : 1;
+	uint32 _zero2 : 1;
+	uint32 address : 24;
+};
+
+struct long_page_table_entry {
+	// upper 32 bits
+	uint32 type : 2;
+	uint32 write_protect : 1;
+	uint32 used : 1;
+	uint32 modified : 1;
+	uint32 _zero1 : 1;
+	uint32 cache_inhibit : 1;
+	uint32 _zero2 : 1;
+	uint32 supervisor : 1;
+	uint32 _zero3 : 1;
+	uint32 _ones : 6;
+	// limit only used on early table terminators, else unused
+	uint32 limit : 15;
+	uint32 low_up : 1;						// limit is lower(1)/upper(0)
+	// lower 32 bits
+	uint32 unused : 8;						// 
+	uint32 address : 24;
+};
+#endif
+
+/* ppc
+extern void m68k_get_page_table(page_table_entry_group **_pageTable, size_t *_size);
+extern void m68k_set_page_table(page_table_entry_group *pageTable, size_t size);
+*/
+
+#endif	/* _KERNEL_ARCH_M68K_MMU_H */
Index: headers/private/kernel/arch/arm/arch_system_info.h
===================================================================
--- headers/private/kernel/arch/arm/arch_system_info.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_system_info.h	(Revision 0)
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_M68K_SYSTEM_INFO_H
+#define _KERNEL_ARCH_M68K_SYSTEM_INFO_H
+
+
+/* nothing to be seen here yet */
+
+
+#endif	/* _KRENEL_ARCH_M68K_SYSTEM_INFO_H */
Index: headers/private/kernel/arch/arm/arch_vm_types.h
===================================================================
--- headers/private/kernel/arch/arm/arch_vm_types.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_vm_types.h	(Revision 0)
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_M68K_VM_TYPES_H
+#define _KERNEL_ARCH_M68K_VM_TYPES_H
+
+#endif	/* _KERNEL_ARCH_M68K_VM_TYPES_H */
Index: headers/private/kernel/arch/arm/arch_thread.h
===================================================================
--- headers/private/kernel/arch/arm/arch_thread.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_thread.h	(Revision 0)
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2003-2006, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * 		Axel Dörfler <axeld@pinc-software.de>
+ * 		Ingo Weinhold <bonefish@cs.tu-berlin.de>
+ */
+#ifndef _KERNEL_ARCH_M68K_THREAD_H
+#define _KERNEL_ARCH_M68K_THREAD_H
+
+#include <arch/cpu.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void m68k_push_iframe(struct iframe_stack *stack, struct iframe *frame);
+void m68k_pop_iframe(struct iframe_stack *stack);
+struct iframe *m68k_get_user_iframe(void);
+
+/* as we won't support SMP on m68k (yet?) we can use a global here */
+extern struct thread *gCurrentThread;
+
+extern inline struct thread *
+arch_thread_get_current_thread(void)
+{
+	return gCurrentThread;
+}
+
+
+extern inline void
+arch_thread_set_current_thread(struct thread *t)
+{
+	gCurrentThread = t;
+}
+
+#if 0
+/* this would only work on 030... */
+
+extern inline struct thread *
+arch_thread_get_current_thread(void)
+{
+	uint64 v = 0;
+	asm volatile("pmove %%srp,(%0)" : : "a"(&v));
+	return (struct thread *)(uint32)(v & 0xffffffff);
+}
+
+
+extern inline void
+arch_thread_set_current_thread(struct thread *t)
+{
+	uint64 v;
+	asm volatile("pmove %%srp,(%0)\n" \
+			"move %1,(4,%0)\n" \
+			"pmove (%0),%%srp" : : "a"(&v), "d"(t));
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _KERNEL_ARCH_M68K_THREAD_H */
Index: headers/private/kernel/arch/arm/types.h
===================================================================
--- headers/private/kernel/arch/arm/types.h	(Revision 0)
+++ headers/private/kernel/arch/arm/types.h	(Revision 0)
@@ -0,0 +1,18 @@
+/* 
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef _M68K_TYPES_H
+#define _M68K_TYPES_H
+ 
+typedef unsigned long long  uint64;
+typedef long long            int64;
+typedef unsigned int       uint32;
+typedef int                 int32;
+typedef unsigned short     uint16;
+typedef short               int16;
+typedef unsigned char      uint8;
+typedef char                int8;
+
+#endif
+
Index: headers/private/kernel/arch/arm/arch_kernel.h
===================================================================
--- headers/private/kernel/arch/arm/arch_kernel.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_kernel.h	(Revision 0)
@@ -0,0 +1,32 @@
+/*
+** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef _KERNEL_ARCH_M68K_KERNEL_H
+#define _KERNEL_ARCH_M68K_KERNEL_H
+
+#include <arch/cpu.h>
+
+// memory layout
+#define KERNEL_BASE 0x80000000
+#define KERNEL_SIZE 0x80000000
+#define KERNEL_TOP  (KERNEL_BASE + (KERNEL_SIZE - 1))
+
+/*
+** User space layout is a little special:
+** The user space does not completely cover the space not covered by the kernel.
+** This is accomplished by starting user space at 1Mb and running to 64kb short of kernel space.
+** The lower 1Mb reserved spot makes it easy to find null pointer references and guarantees a
+** region wont be placed there. The 64kb region assures a user space thread cannot pass
+** a buffer into the kernel as part of a syscall that would cross into kernel space.
+*/
+#define USER_BASE     0x100000
+#define USER_BASE_ANY USER_BASE
+#define USER_SIZE     (0x80000000 - (0x10000 + 0x100000))
+#define USER_TOP      (USER_BASE + USER_SIZE)
+
+#define KERNEL_USER_DATA_BASE  0x6fff0000
+#define USER_STACK_REGION              0x70000000
+#define USER_STACK_REGION_SIZE (USER_TOP - USER_STACK_REGION)
+
+#endif	/* _KERNEL_ARCH_M68K_KERNEL_H */
Index: headers/private/kernel/arch/arm/ktypes.h
===================================================================
--- headers/private/kernel/arch/arm/ktypes.h	(Revision 0)
+++ headers/private/kernel/arch/arm/ktypes.h	(Revision 0)
@@ -0,0 +1,11 @@
+/* 
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef _M68K_KTYPES_H
+#define _M68K_KTYPES_H
+
+typedef unsigned long addr;
+
+#endif
+
Index: headers/private/kernel/arch/arm/arch_user_debugger.h
===================================================================
--- headers/private/kernel/arch/arm/arch_user_debugger.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_user_debugger.h	(Revision 0)
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2005, Axel Dörfler, axeld@pinc-software.de.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_M68K_USER_DEBUGGER_H
+#define _KERNEL_ARCH_M68K_USER_DEBUGGER_H
+
+
+struct arch_team_debug_info {
+	uint32 dummy;
+};
+
+struct arch_thread_debug_info {
+	uint32 dummy;
+};
+
+#endif	// _KERNEL_ARCH_M68K_USER_DEBUGGER_H
Index: headers/private/kernel/arch/arm/arch_vm.h
===================================================================
--- headers/private/kernel/arch/arm/arch_vm.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_vm.h	(Revision 0)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef ARCH_M68K_VM_H
+#define ARCH_M68K_VM_H
+
+#include <vm_translation_map.h>
+
+/* This many pages will be read/written on I/O if possible */
+
+#define NUM_IO_PAGES	4
+	/* 16 kB */
+
+#define PAGE_SHIFT 12
+
+
+struct m68k_vm_ops {
+	void *(*m68k_translation_map_get_pgdir)(vm_translation_map *map);
+	status_t (*arch_vm_translation_map_init_map)(vm_translation_map *map, bool kernel);
+	status_t (*arch_vm_translation_map_init_kernel_map_post_sem)(vm_translation_map *map);
+	status_t (*arch_vm_translation_map_init)(kernel_args *args);
+	status_t (*arch_vm_translation_map_init_post_area)(kernel_args *args);
+	status_t (*arch_vm_translation_map_init_post_sem)(kernel_args *args);
+	status_t (*arch_vm_translation_map_early_map)(kernel_args *ka, addr_t virtualAddress, addr_t physicalAddress, 
+		uint8 attributes, addr_t (*get_free_page)(kernel_args *));
+	status_t (*arch_vm_translation_map_early_query)(addr_t va, addr_t *out_physical);
+	void (*m68k_set_pgdir)(void *);
+#if 0 /* ppc stuff only ? */
+	status_t (*m68k_map_address_range)(addr_t virtualAddress, addr_t physicalAddress,
+		size_t size);
+	void (*m68k_unmap_address_range)(addr_t virtualAddress, size_t size);
+	status_t (*m68k_remap_address_range)(addr_t *_virtualAddress, size_t size, bool unmap);
+#endif
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct m68k_vm_ops *get_vm_ops();
+
+extern void *m68k_translation_map_get_pgdir(vm_translation_map *map);
+extern void m68k_set_pgdir(void *rt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif	/* ARCH_M68K_VM_H */
Index: headers/private/kernel/arch/arm/arch_platform.h
===================================================================
--- headers/private/kernel/arch/arm/arch_platform.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_platform.h	(Revision 0)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
+ * All rights reserved. Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARM_ARCH_PLATFORM_H
+#define _KERNEL_ARM_ARCH_PLATFORM_H
+
+#include <OS.h>
+#include <arch/platform.h>
+
+struct real_time_data;
+
+typedef enum ARM_platform_types {
+	ARM_PLATFORM_BEAGLEBOARD = 0,
+} ARM_platform_type;
+
+namespace BPrivate {
+
+// implemented in src/system/kernel/arch/ARM/arch_platform.cpp
+
+class ARMPlatform {
+public:
+	ARMPlatform(platform_type platformType, ARM_platform_type ARMPlatformType);
+	virtual ~ARMPlatform();
+
+	static ARMPlatform *Default();
+
+	inline platform_type PlatformType() const	{ return fPlatformType; }
+	inline ARM_platform_type ARMPlatformType() const	{ return fARMPlatformType; }
+
+	virtual status_t Init(struct kernel_args *kernelArgs) = 0;
+	virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
+	virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
+	virtual status_t InitPIC(struct kernel_args *kernelArgs) = 0;
+	virtual status_t InitRTC(struct kernel_args *kernelArgs,
+		struct real_time_data *data) = 0;
+	virtual status_t InitTimer(struct kernel_args *kernelArgs) = 0;
+
+	virtual char BlueScreenGetChar() = 0;
+
+	virtual char SerialDebugGetChar() = 0;
+	virtual void SerialDebugPutChar(char c) = 0;
+
+	virtual void EnableIOInterrupt(int irq) = 0;
+	virtual void DisableIOInterrupt(int irq) = 0;
+	virtual bool AcknowledgeIOInterrupt(int irq) = 0;
+
+	// mimic the PC CMOS
+	virtual uint8 ReadRTCReg(uint8 reg) = 0;
+	virtual void WriteRTCReg(uint8 reg, uint8 val) = 0;
+	virtual	void SetHardwareRTC(uint32 seconds) = 0;
+	virtual	uint32 GetHardwareRTC() = 0;
+
+	virtual void SetHardwareTimer(bigtime_t timeout) = 0;
+	virtual void ClearHardwareTimer(void) = 0;
+
+	virtual	void ShutDown(bool reboot) = 0;
+
+private:
+	ARM_platform_type	fARMPlatformType;
+	platform_type	fPlatformType;
+};
+
+
+}	// namespace BPrivate
+
+using BPrivate::ARMPlatform;
+
+//extern "C" ARMPlatform *instanciate_ARM_platform_amiga();
+extern "C" ARMPlatform *instanciate_ARM_platform_beagleboard();
+//extern "C" ARMPlatform *instanciate_ARM_platform_mac();
+//extern "C" ARMPlatform *instanciate_ARM_platform_next();
+
+
+#endif	// _KERNEL_ARM_ARCH_PLATFORM_H
Index: headers/private/kernel/arch/arm/arch_cpu.h
===================================================================
--- headers/private/kernel/arch/arm/arch_cpu.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_cpu.h	(Revision 0)
@@ -0,0 +1,189 @@
+/*
+** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+** Distributed under the terms of the Haiku License.
+*/
+#ifndef _KERNEL_ARCH_M68K_CPU_H
+#define _KERNEL_ARCH_M68K_CPU_H
+
+#ifndef _ASSEMBLER
+
+#include <arch/arm/arch_thread_types.h>
+#include <kernel.h>
+
+#endif	// !_ASSEMBLER
+
+/*
+#define SR_IP_MASK 0x0700
+#define SR_S 0x2000
+#define M68K_SR_S 13
+#define M68K_SR_T_MASK 0xC000
+#define M68K_SR_T0 14
+#define M68K_SR_T1 15
+*/
+#ifndef _ASSEMBLER
+
+
+
+
+
+#warning M68K: check for missing regs/movem
+struct iframe {
+
+#warning "iframe is nonsense"
+	/* fpu data registers */
+//#warning M68K: sizeof(fp*)
+//	struct mc680x0_fp_data_reg fp[8];
+	/* fpu control registers */
+//	struct mc680x0_fp_control_regs fpc;
+	/* fpu state */
+//	struct mc680x0_fpu_state fpu;
+	
+	/* data and address registers */
+//	uint32 d[8];
+//	uint32 a[7];
+	/* cpu exception frame, including sr, pc, format and vector */
+//	struct mc680x0_frame cpu;
+
+/*	uint32 vector;
+	uint32 srr0;
+	uint32 srr1;
+	uint32 dar;
+	uint32 dsisr;
+	uint32 lr;
+	uint32 cr;
+	uint32 xer;
+	uint32 ctr;
+	uint32 fpscr;
+	uint32 r31;
+	uint32 r30;
+	uint32 r29;
+	uint32 r28;
+	uint32 r27;
+	uint32 r26;
+	uint32 r25;
+	uint32 r24;
+	uint32 r23;
+	uint32 r22;
+	uint32 r21;
+	uint32 r20;
+	uint32 r19;
+	uint32 r18;
+	uint32 r17;
+	uint32 r16;
+	uint32 r15;
+	uint32 r14;
+	uint32 r13;
+	uint32 r12;
+	uint32 r11;
+	uint32 r10;
+	uint32 r9;
+	uint32 r8;
+	uint32 r7;
+	uint32 r6;
+	uint32 r5;
+	uint32 r4;
+	uint32 r3;
+	uint32 r2;
+	uint32 r1;
+	uint32 r0;
+	double f31;
+	double f30;
+	double f29;
+	double f28;
+	double f27;
+	double f26;
+	double f25;
+	double f24;
+	double f23;
+	double f22;
+	double f21;
+	double f20;
+	double f19;
+	double f18;
+	double f17;
+	double f16;
+	double f15;
+	double f14;
+	double f13;
+	double f12;
+	double f11;
+	double f10;
+	double f9;
+	double f8;
+	double f7;
+	double f6;
+	double f5;
+	double f4;
+	double f3;
+	double f2;
+	double f1;
+	double f0;*/
+} _PACKED;
+
+
+typedef struct arch_cpu_info {
+	int null;
+} arch_cpu_info;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//extern long long get_time_base(void);
+
+//void __m68k_setup_system_time(vint32 *cvFactor);
+	// defined in libroot: os/arch/system_time.c
+//int64 __m68k_get_time_base(void);
+	// defined in libroot: os/arch/system_time_asm.S
+/*
+extern void m68k_context_switch(void **_oldStackPointer, void *newStackPointer);
+
+extern bool m68k_set_fault_handler(addr_t *handlerLocation, addr_t handler)
+	__attribute__((noinline));
+
+extern bool m68k_is_hw_register_readable(addr_t address);
+extern bool m68k_is_hw_register_writable(addr_t address, uint16 value);
+	// defined in kernel: arch/m68k/cpu_asm.S
+*/
+#ifdef __cplusplus
+}
+#endif
+
+struct m68k_cpu_ops {
+	void (*flush_insn_pipeline)(void);
+	void (*flush_atc_all)(void);
+	void (*flush_atc_user)(void);
+	void (*flush_atc_addr)(addr_t addr);
+	void (*flush_dcache)(addr_t address, size_t len);
+	void (*flush_icache)(addr_t address, size_t len);
+	void (*idle)(void);
+};
+
+
+extern int arch_cpu_type;
+extern int arch_fpu_type;
+extern int arch_mmu_type;
+extern int arch_platform;
+extern int arch_machine;
+
+/*
+	Use of (some) special purpose registers.
+	XXX: those regs aren't implemented/accessed the same way on different cpus...
+
+	SRP[63-32]: current struct thread*
+	SRP[31-0] :
+	CAAR      : can we use it ??
+	MSP       :
+
+	PPC:
+	SPRG0: per CPU physical address pointer to an ppc_cpu_exception_context
+	       structure
+	SPRG1: scratch
+	SPRG2: current struct thread*
+	SPRG3: TLS base pointer (only for userland threads)
+*/
+
+#endif	// !_ASSEMBLER
+
+#endif	/* _KERNEL_ARCH_PPC_CPU_H */
Index: headers/private/kernel/arch/arm/stage2_priv.h
===================================================================
--- headers/private/kernel/arch/arm/stage2_priv.h	(Revision 0)
+++ headers/private/kernel/arch/arm/stage2_priv.h	(Revision 0)
@@ -0,0 +1,43 @@
+/*
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef _STAGE2_PRIV_H
+#define _STAGE2_PRIV_H
+
+#define LOAD_ADDR 0x100000
+#define BOOTDIR_ADDR 0x101000
+
+int s2_text_init();
+void s2_change_framebuffer_addr(unsigned int address);
+void putchar(char c);
+void puts(char *str);
+int printf(const char *fmt, ...);
+
+int of_init(void *of_entry);
+int of_open(const char *node_name);
+int of_finddevice(const char *dev);
+int of_instance_to_package(int in_handle);
+int of_getprop(int handle, const char *prop, void *buf, int buf_len);
+int of_setprop(int handle, const char *prop, const void *buf, int buf_len);
+int of_read(int handle, void *buf, int buf_len);
+int of_write(int handle, void *buf, int buf_len);
+int of_seek(int handle, long long pos);
+
+int s2_mmu_init();
+void mmu_map_page(unsigned int vsid, unsigned long pa, unsigned long va);;
+void syncicache(void *address, int len);
+
+void s2_faults_init(kernel_args *ka);
+
+void getibats(int bats[8]);
+void setibats(int bats[8]);
+void getdbats(int bats[8]);
+void setdbats(int bats[8]);
+unsigned int *getsdr1();
+void setsdr1(unsigned int sdr);
+unsigned int getsr(int sr);
+unsigned int getmsr();
+void setmsr(unsigned int msr);
+
+#endif
Index: headers/private/kernel/arch/arm/arch_int.h
===================================================================
--- headers/private/kernel/arch/arm/arch_int.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_int.h	(Revision 0)
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2005-2006, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * 		Axel Dörfler <axeld@pinc-software.de>
+ * 		Ingo Weinhold <bonefish@cs.tu-berlin.de>
+ */
+#ifndef _KERNEL_ARCH_ARM_INT_H
+#define _KERNEL_ARCH_ARM_INT_H
+
+#include <SupportDefs.h>
+
+#define NUM_IO_VECTORS	256
+
+#endif /* _KERNEL_ARCH_M68K_INT_H */
Index: headers/private/kernel/arch/arm/cpu.h
===================================================================
--- headers/private/kernel/arch/arm/cpu.h	(Revision 0)
+++ headers/private/kernel/arch/arm/cpu.h	(Revision 0)
@@ -0,0 +1,11 @@
+/* 
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef _ARM_CPU_H
+#define _ARM_CPU_H
+
+#define PAGE_SIZE 4096
+
+#endif
+
Index: headers/private/kernel/arch/arm/arch_thread_types.h
===================================================================
--- headers/private/kernel/arch/arm/arch_thread_types.h	(Revision 0)
+++ headers/private/kernel/arch/arm/arch_thread_types.h	(Revision 0)
@@ -0,0 +1,40 @@
+/* 
+** Copyright 2001, Travis Geiselbrecht. All rights reserved.
+** Distributed under the terms of the NewOS License.
+*/
+#ifndef KERNEL_ARCH_M68K_THREAD_TYPES_H
+#define KERNEL_ARCH_M68K_THREAD_TYPES_H
+
+#include <kernel.h>
+
+#define	IFRAME_TRACE_DEPTH 4
+
+struct iframe_stack {
+	struct iframe *frames[IFRAME_TRACE_DEPTH];
+	int32	index;
+};
+
+// architecture specific thread info
+struct arch_thread {
+	void	*sp;	// stack pointer
+	void	*interrupt_stack;
+
+	// used to track interrupts on this thread
+	struct iframe_stack	iframes;
+};
+
+struct arch_team {
+	// gcc treats empty structures as zero-length in C, but as if they contain
+	// a char in C++. So we have to put a dummy in to be able to use the struct
+	// from both in a consistent way.
+	char	dummy;
+};
+
+struct arch_fork_arg {
+	// gcc treats empty structures as zero-length in C, but as if they contain
+	// a char in C++. So we have to put a dummy in to be able to use the struct
+	// from both in a consistent way.
+	char	dummy;
+};
+
+#endif	/* KERNEL_ARCH_M68K_THREAD_TYPES_H */
Index: headers/private/system/arch/arm/asm_defs.h
===================================================================
--- headers/private/system/arch/arm/asm_defs.h	(Revision 0)
+++ headers/private/system/arch/arm/asm_defs.h	(Revision 0)
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2008, François Revol, revol@free.fr.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef SYSTEM_ARCH_ARM_ASM_DEFS_H
+#define SYSTEM_ARCH_ARM_ASM_DEFS_H
+
+
+#define SYMBOL(name)			.global name; name
+#define SYMBOL_END(name)		1: .size name, 1b - name
+#define STATIC_FUNCTION(name)	.type name, @function; name
+#define FUNCTION(name)			.global name; .type name, %function; name
+#define FUNCTION_END(name)		1: .size name, 1b - name
+
+
+#endif	/* SYSTEM_ARCH_ARM_ASM_DEFS_H */
+
Index: headers/private/system/arch/arm/arch_config.h
===================================================================
--- headers/private/system/arch/arm/arch_config.h	(Revision 0)
+++ headers/private/system/arch/arm/arch_config.h	(Revision 0)
@@ -0,0 +1,18 @@
+
+/*
+ * Copyright 2004, Axel Dörfler, axeld@pinc-software.de.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_ARM_CONFIG_H
+#define _KERNEL_ARCH_ARM_CONFIG_H
+
+
+#define FUNCTION_CALL_PARAMETER_ALIGNMENT_TYPE	unsigned int
+
+#define STACK_GROWS_DOWNWARDS
+
+//#define ATOMIC_FUNCS_ARE_SYSCALLS
+//#define ATOMIC64_FUNCS_ARE_SYSCALLS
+
+
+#endif	/* _KERNEL_ARCH_M68K_CONFIG_H */
Index: headers/private/system/arch/arm/arch_elf.h
===================================================================
--- headers/private/system/arch/arm/arch_elf.h	(Revision 0)
+++ headers/private/system/arch/arm/arch_elf.h	(Revision 0)
@@ -0,0 +1,37 @@
+/*
+** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
+** Distributed under the terms of the OpenBeOS License.
+*/
+#ifndef _KERNEL_ARCH_M68K_ELF_H
+#define _KERNEL_ARCH_M68K_ELF_H
+
+/* relocation types */
+
+#define	R_68K_NONE				0
+#define	R_68K_32 1            /* Direct 32 bit  */
+#define	R_68K_16 2            /* Direct 16 bit  */
+#define	R_68K_8 3             /* Direct 8 bit  */
+#define	R_68K_PC32 4          /* PC relative 32 bit */
+#define	R_68K_PC16 5          /* PC relative 16 bit */
+#define	R_68K_PC8 6           /* PC relative 8 bit */
+#define	R_68K_GOT32 7         /* 32 bit PC relative GOT entry */
+#define	R_68K_GOT16 8         /* 16 bit PC relative GOT entry */
+#define	R_68K_GOT8 9          /* 8 bit PC relative GOT entry */
+#define	R_68K_GOT32O 10       /* 32 bit GOT offset */
+#define	R_68K_GOT16O 11       /* 16 bit GOT offset */
+#define	R_68K_GOT8O 12        /* 8 bit GOT offset */
+#define	R_68K_PLT32 13        /* 32 bit PC relative PLT address */
+#define	R_68K_PLT16 14        /* 16 bit PC relative PLT address */
+#define	R_68K_PLT8 15         /* 8 bit PC relative PLT address */
+#define	R_68K_PLT32O 16       /* 32 bit PLT offset */
+#define	R_68K_PLT16O 17       /* 16 bit PLT offset */
+#define	R_68K_PLT8O 18        /* 8 bit PLT offset */
+#define	R_68K_COPY 19         /* Copy symbol at runtime */
+#define	R_68K_GLOB_DAT 20     /* Create GOT entry */
+#define	R_68K_JMP_SLOT 21     /* Create PLT entry */
+#define	R_68K_RELATIVE 22     /* Adjust by program base */
+/* These are GNU extensions to enable C++ vtable garbage collection.  */
+#define	R_68K_GNU_VTINHERIT 23
+#define	R_68K_GNU_VTENTRY 24
+
+#endif	/* _KERNEL_ARCH_M68K_ELF_H */
Index: headers/private/system/arch/arm/arch_commpage_defs.h
===================================================================
--- headers/private/system/arch/arm/arch_commpage_defs.h	(Revision 0)
+++ headers/private/system/arch/arm/arch_commpage_defs.h	(Revision 0)
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2007, Travis Geiselbrecht. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _SYSTEM_ARCH_ARM_COMMPAGE_DEFS_H
+#define _SYSTEM_ARCH_ARM_COMMPAGE_DEFS_H
+
+#ifndef _SYSTEM_COMMPAGE_DEFS_H
+#	error Must not be included directly. Include <commpage_defs.h> instead!
+#endif
+
+#define COMMPAGE_ENTRY_ARM_SYSCALL	(COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
+#define COMMPAGE_ENTRY_ARM_MEMCPY	(COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
+
+/* 0xffff0000 colides with IO space mapped with TT1 on Atari */
+#define ARCH_USER_COMMPAGE_ADDR (0xfeff0000)
+
+#endif	/* _SYSTEM_ARCH_M68K_COMMPAGE_DEFS_H */
Index: headers/private/system/arch/arm/arch_real_time_data.h
===================================================================
--- headers/private/system/arch/arm/arch_real_time_data.h	(Revision 0)
+++ headers/private/system/arch/arm/arch_real_time_data.h	(Revision 0)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
+ * All rights reserved. Distributed under the terms of the MIT License.
+ */
+#ifndef _KERNEL_ARCH_REAL_TIME_DATA_H
+#define _KERNEL_ARCH_REAL_TIME_DATA_H
+
+#include <StorageDefs.h>
+#include <SupportDefs.h>
+
+#warning ARM: fix system_time()
+
+struct arch_real_time_data {
+	vint32						system_time_conversion_factor;
+	vint32						version;
+		// Since there're no cheap atomic_{set,get,add}64() on PPC 32 (i.e. one
+		// that doesn't involve a syscall), we can't have just a single
+		// system_time_offset and set/get it atomically.
+		// That's why have our data twice. One set is current (indexed by
+		// version % 2). When setting the offset, we do that with disabled
+		// interrupts and protected by a spinlock. We write the new values
+		// into the other array element and increment the version.
+		// A reader first reads the version, then the date of interest, and
+		// finally rechecks the version. If it hasn't changed in the meantime,
+		// the read value is fine, otherwise it runs the whole procedure again.
+		//
+		// system_time_conversion_factor is currently consider constant,
+		// although that is not necessarily true. We simply don't support
+		// changing conversion factors at the moment.
+};
+
+#endif	/* _KERNEL_ARCH_REAL_TIME_DATA_H */
