xref: /haiku/headers/private/kernel/arch/m68k/arch_platform.h (revision 020cbad9d40235a2c50a81a42d69912a5ff8fbc4)
1 /*
2  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_M68K_ARCH_PLATFORM_H
6 #define _KERNEL_M68K_ARCH_PLATFORM_H
7 
8 #include <arch/platform.h>
9 
10 struct real_time_data;
11 
12 enum m68k_platform_type {
13 	M68K_PLATFORM_AMIGA = 0,
14 	M68K_PLATFORM_ATARI,		/* Falcon */
15 	M68K_PLATFORM_MAC,
16 	M68K_PLATFORM_NEXT
17 };
18 
19 namespace BPrivate {
20 
21 class M68KPlatform {
22 public:
23 	M68KPlatform(m68k_platform_type platformType);
24 	virtual ~M68KPlatform();
25 
26 	static M68KPlatform *Default();
27 
28 	inline m68k_platform_type PlatformType() const	{ return fPlatformType; }
29 
30 	virtual status_t Init(struct kernel_args *kernelArgs) = 0;
31 	virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
32 	virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
33 	virtual status_t InitRTC(struct kernel_args *kernelArgs,
34 		struct real_time_data *data) = 0;
35 	virtual status_t InitTimer(struct kernel_args *kernelArgs) = 0;
36 
37 	virtual char SerialDebugGetChar() = 0;
38 	virtual void SerialDebugPutChar(char c) = 0;
39 
40 	virtual	void SetHardwareRTC(uint32 seconds) = 0;
41 	virtual	uint32 GetHardwareRTC() = 0;
42 
43 	virtual void SetHardwareTimer(bigtime_t timeout) = 0;
44 	virtual void ClearHardwareTimer(void) = 0;
45 
46 	virtual	void ShutDown(bool reboot) = 0;
47 
48 private:
49 	m68k_platform_type	fPlatformType;
50 };
51 
52 }	// namespace BPrivate
53 
54 using BPrivate::M68KPlatform;
55 
56 
57 #endif	// _KERNEL_M68K_ARCH_PLATFORM_H
58