2007-10-22 03:42:09 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_M68K_ARCH_PLATFORM_H
|
|
|
|
#define _KERNEL_M68K_ARCH_PLATFORM_H
|
|
|
|
|
2008-06-30 01:08:12 +04:00
|
|
|
#include <OS.h>
|
2007-10-22 03:42:09 +04:00
|
|
|
#include <arch/platform.h>
|
|
|
|
|
|
|
|
struct real_time_data;
|
|
|
|
|
2008-06-29 22:22:34 +04:00
|
|
|
typedef enum m68k_platform_types {
|
2007-10-22 03:42:09 +04:00
|
|
|
M68K_PLATFORM_AMIGA = 0,
|
2008-06-20 06:22:26 +04:00
|
|
|
M68K_PLATFORM_ATARI, /* TT, Falcon, Hades, Milan... */
|
2008-01-21 00:30:59 +03:00
|
|
|
M68K_PLATFORM_MAC,
|
|
|
|
M68K_PLATFORM_NEXT
|
2008-06-29 22:22:34 +04:00
|
|
|
} m68k_platform_type;
|
2007-10-22 03:42:09 +04:00
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
2008-06-23 04:16:23 +04:00
|
|
|
// implemented in src/system/kernel/arch/m68k/arch_platform.cpp
|
|
|
|
|
2007-10-22 03:42:09 +04:00
|
|
|
class M68KPlatform {
|
|
|
|
public:
|
2016-07-20 21:13:27 +03:00
|
|
|
M68KPlatform(m68k_platform_type platformType);
|
2007-10-22 03:42:09 +04:00
|
|
|
virtual ~M68KPlatform();
|
|
|
|
|
|
|
|
static M68KPlatform *Default();
|
|
|
|
|
2016-07-20 21:13:27 +03:00
|
|
|
inline m68k_platform_type PlatformType() const { return fPlatformType; }
|
2007-10-22 03:42:09 +04:00
|
|
|
|
|
|
|
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;
|
2008-06-23 04:16:23 +04:00
|
|
|
virtual status_t InitPIC(struct kernel_args *kernelArgs) = 0;
|
2007-10-22 03:42:09 +04:00
|
|
|
virtual status_t InitRTC(struct kernel_args *kernelArgs,
|
|
|
|
struct real_time_data *data) = 0;
|
2008-01-21 00:30:59 +03:00
|
|
|
virtual status_t InitTimer(struct kernel_args *kernelArgs) = 0;
|
2007-10-22 03:42:09 +04:00
|
|
|
|
2008-08-03 19:57:03 +04:00
|
|
|
virtual char BlueScreenGetChar() = 0;
|
|
|
|
|
2007-10-22 03:42:09 +04:00
|
|
|
virtual char SerialDebugGetChar() = 0;
|
|
|
|
virtual void SerialDebugPutChar(char c) = 0;
|
|
|
|
|
2008-07-25 19:36:05 +04:00
|
|
|
virtual void EnableIOInterrupt(int irq) = 0;
|
|
|
|
virtual void DisableIOInterrupt(int irq) = 0;
|
2008-08-02 04:36:33 +04:00
|
|
|
virtual bool AcknowledgeIOInterrupt(int irq) = 0;
|
2008-07-25 19:05:52 +04:00
|
|
|
|
2008-10-13 17:55:57 +04:00
|
|
|
// mimic the PC CMOS
|
|
|
|
virtual uint8 ReadRTCReg(uint8 reg) = 0;
|
|
|
|
virtual void WriteRTCReg(uint8 reg, uint8 val) = 0;
|
2007-10-22 03:42:09 +04:00
|
|
|
virtual void SetHardwareRTC(uint32 seconds) = 0;
|
|
|
|
virtual uint32 GetHardwareRTC() = 0;
|
|
|
|
|
2008-01-21 00:30:59 +03:00
|
|
|
virtual void SetHardwareTimer(bigtime_t timeout) = 0;
|
|
|
|
virtual void ClearHardwareTimer(void) = 0;
|
|
|
|
|
2007-10-22 03:42:09 +04:00
|
|
|
virtual void ShutDown(bool reboot) = 0;
|
|
|
|
|
|
|
|
private:
|
2016-07-20 21:13:27 +03:00
|
|
|
m68k_platform_type fPlatformType;
|
2008-06-23 04:16:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-10-22 03:42:09 +04:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::M68KPlatform;
|
|
|
|
|
2008-06-29 22:22:34 +04:00
|
|
|
//extern "C" M68KPlatform *instanciate_m68k_platform_amiga();
|
|
|
|
extern "C" M68KPlatform *instanciate_m68k_platform_atari();
|
|
|
|
//extern "C" M68KPlatform *instanciate_m68k_platform_mac();
|
|
|
|
//extern "C" M68KPlatform *instanciate_m68k_platform_next();
|
|
|
|
|
2007-10-22 03:42:09 +04:00
|
|
|
|
|
|
|
#endif // _KERNEL_M68K_ARCH_PLATFORM_H
|