xref: /haiku/headers/private/kernel/arch/ppc/arch_platform.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
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_PPC_ARCH_PLATFORM_H
6 #define _KERNEL_PPC_ARCH_PLATFORM_H
7 
8 #include <arch/platform.h>
9 
10 struct real_time_data;
11 
12 enum ppc_platform_type {
13 	PPC_PLATFORM_OPEN_FIRMWARE = 0,
14 	PPC_PLATFORM_U_BOOT
15 };
16 
17 namespace BPrivate {
18 
19 class PPCPlatform {
20 public:
21 	PPCPlatform(ppc_platform_type platformType);
22 	virtual ~PPCPlatform();
23 
24 	static PPCPlatform *Default();
25 
26 	inline ppc_platform_type PlatformType() const	{ return fPlatformType; }
27 
28 	virtual status_t Init(struct kernel_args *kernelArgs) = 0;
29 	virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
30 	virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
31 	virtual status_t InitRTC(struct kernel_args *kernelArgs,
32 		struct real_time_data *data) = 0;
33 
34 	virtual char SerialDebugGetChar() = 0;
35 	virtual void SerialDebugPutChar(char c) = 0;
36 
37 	virtual	void SetHardwareRTC(uint32 seconds) = 0;
38 	virtual	uint32 GetHardwareRTC() = 0;
39 
40 	virtual	void ShutDown(bool reboot) = 0;
41 
42 private:
43 	ppc_platform_type	fPlatformType;
44 };
45 
46 }	// namespace BPrivate
47 
48 using BPrivate::PPCPlatform;
49 
50 
51 #endif	// _KERNEL_PPC_ARCH_PLATFORM_H
52