xref: /haiku/src/system/kernel/arch/m68k/arch_platform.cpp (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2007, François Revol, revol@free.fr.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
6  * All rights reserved. Distributed under the terms of the MIT License.
7  */
8 
9 #include <arch_platform.h>
10 
11 #include <new>
12 
13 #include <KernelExport.h>
14 
15 #include <boot/kernel_args.h>
16 //#include <platform/openfirmware/openfirmware.h>
17 #include <real_time_clock.h>
18 #include <util/kernel_cpp.h>
19 
20 
21 static M68KPlatform *sM68KPlatform;
22 
23 
24 // constructor
25 M68KPlatform::M68KPlatform(platform_type platformType,
26 	m68k_platform_type m68kPlatformType)
27 	: fPlatformType(platformType),
28 	  fM68KPlatformType(m68kPlatformType)
29 {
30 }
31 
32 // destructor
33 M68KPlatform::~M68KPlatform()
34 {
35 }
36 
37 // Default
38 M68KPlatform *
39 M68KPlatform::Default()
40 {
41 	return sM68KPlatform;
42 }
43 
44 
45 // # pragma mark -
46 
47 
48 status_t
49 arch_platform_init(struct kernel_args *kernelArgs)
50 {
51 	// only Atari supported for now
52 	switch (kernelArgs->arch_args.platform) {
53 #if 0
54 		case M68K_PLATFORM_AMIGA:
55 			sM68KPlatform = instanciate_m68k_platform_amiga();
56 			break;
57 #endif
58 		case M68K_PLATFORM_ATARI:
59 			sM68KPlatform = instanciate_m68k_platform_atari();
60 			break;
61 #if 0
62 		case M68K_PLATFORM_MAC:
63 			sM68KPlatform = instanciate_m68k_platform_mac();
64 			break;
65 		case M68K_PLATFORM_NEXT:
66 			sM68KPlatform = instanciate_m68k_platform_next();
67 			break;
68 #endif
69 		default:
70 			panic("unknown platform d\n", kernelArgs->arch_args.platform);
71 	}
72 
73 	return sM68KPlatform->Init(kernelArgs);
74 }
75 
76 
77 status_t
78 arch_platform_init_post_vm(struct kernel_args *kernelArgs)
79 {
80 	return sM68KPlatform->InitPostVM(kernelArgs);
81 }
82 
83 
84 status_t
85 arch_platform_init_post_thread(struct kernel_args *kernelArgs)
86 {
87 	return B_OK;
88 }
89