The Pedigree Project 0.1
kernel/machine/hosted/Machine.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef KERNEL_MACHINE_HOSTED_PC_H
21#define KERNEL_MACHINE_HOSTED_PC_H
22#include "pedigree/kernel/machine/Machine.h"
23
24#include <config.h>
25
26#include "IrqManager.h"
27#include "Keyboard.h"
28#include "SchedulerTimer.h"
29#include "Serial.h"
30#include "Timer.h"
31#include "Vga.h"
32
36class HostedMachine : public Machine {
37 public:
38 inline static HostedMachine& instance() {
39 return m_Instance;
40 }
41
42 virtual void initialise() INITIALISATION_ONLY;
43 virtual void initialise3();
44 virtual void deinitialise();
45
46 virtual void initialiseDeviceTree();
47
48 virtual Serial* getSerial(size_t n);
49 virtual size_t getNumSerial();
50 virtual Vga* getVga(size_t n);
51 virtual size_t getNumVga();
52 virtual IrqManager* getIrqManager();
54 virtual Timer* getTimer();
55 virtual Keyboard* getKeyboard();
56 virtual void setKeyboard(Keyboard* kb);
60
61 private:
67 HostedMachine& operator=(const HostedMachine&);
71 virtual ~HostedMachine();
72
73 HostedSerial m_Serial[2];
74 HostedVga m_Vga;
75 Keyboard* m_Keyboard;
76
77 static HostedMachine m_Instance;
78};
79
80#endif
HostedMachine() INITIALISATION_ONLY
virtual void setKeyboard(Keyboard *kb)
virtual void initialiseDeviceTree()
virtual void initialise3()
Called after processor startup - for thread creation etc.
MUST_USE_RESULT bool quiesceAllOtherProcessors() override
virtual size_t getNumSerial()
MUST_USE_RESULT bool resumeAllOtherProcessors() override
virtual Keyboard * getKeyboard()
virtual Timer * getTimer()
MUST_USE_RESULT bool stopAllOtherProcessors() override
virtual void deinitialise()
virtual Vga * getVga(size_t n)
virtual Serial * getSerial(size_t n)
virtual ~HostedMachine()
virtual size_t getNumVga()
virtual SchedulerTimer * getSchedulerTimer()
virtual void initialise() INITIALISATION_ONLY