xref: /haiku/headers/private/kernel/arch/m68k/arch_platform.h (revision 2897df967633aab846ff4917b53e2af7d1e54eeb)
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 <OS.h>
9 #include <arch/platform.h>
10 
11 struct real_time_data;
12 
13 typedef enum m68k_platform_types {
14 	M68K_PLATFORM_AMIGA = 0,
15 	M68K_PLATFORM_ATARI,		/* TT, Falcon, Hades, Milan... */
16 	M68K_PLATFORM_MAC,
17 	M68K_PLATFORM_NEXT
18 } m68k_platform_type;
19 
20 namespace BPrivate {
21 
22 // implemented in src/system/kernel/arch/m68k/arch_platform.cpp
23 
24 class M68KPlatform {
25 public:
26 	M68KPlatform(m68k_platform_type platformType);
27 	virtual ~M68KPlatform();
28 
29 	static M68KPlatform *Default();
30 
31 	inline m68k_platform_type PlatformType() const	{ return fPlatformType; }
32 
33 	virtual status_t Init(struct kernel_args *kernelArgs) = 0;
34 	virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
35 	virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
36 	virtual status_t InitPIC(struct kernel_args *kernelArgs) = 0;
37 	virtual status_t InitRTC(struct kernel_args *kernelArgs,
38 		struct real_time_data *data) = 0;
39 	virtual status_t InitTimer(struct kernel_args *kernelArgs) = 0;
40 
41 	virtual char BlueScreenGetChar() = 0;
42 
43 	virtual char SerialDebugGetChar() = 0;
44 	virtual void SerialDebugPutChar(char c) = 0;
45 
46 	virtual void EnableIOInterrupt(int irq) = 0;
47 	virtual void DisableIOInterrupt(int irq) = 0;
48 	virtual bool AcknowledgeIOInterrupt(int irq) = 0;
49 
50 	// mimic the PC CMOS
51 	virtual uint8 ReadRTCReg(uint8 reg) = 0;
52 	virtual void WriteRTCReg(uint8 reg, uint8 val) = 0;
53 	virtual	void SetHardwareRTC(uint32 seconds) = 0;
54 	virtual	uint32 GetHardwareRTC() = 0;
55 
56 	virtual void SetHardwareTimer(bigtime_t timeout) = 0;
57 	virtual void ClearHardwareTimer(void) = 0;
58 
59 	virtual	void ShutDown(bool reboot) = 0;
60 
61 private:
62 	m68k_platform_type	fPlatformType;
63 };
64 
65 
66 }	// namespace BPrivate
67 
68 using BPrivate::M68KPlatform;
69 
70 //extern "C" M68KPlatform *instanciate_m68k_platform_amiga();
71 extern "C" M68KPlatform *instanciate_m68k_platform_atari();
72 //extern "C" M68KPlatform *instanciate_m68k_platform_mac();
73 //extern "C" M68KPlatform *instanciate_m68k_platform_next();
74 
75 
76 #endif	// _KERNEL_M68K_ARCH_PLATFORM_H
77