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 
23 #include "IrqManager.h"
24 #include "Keyboard.h"
25 #include "SchedulerTimer.h"
26 #include "Serial.h"
27 #include "Timer.h"
28 #include "Vga.h"
29 #include "pedigree/kernel/machine/Machine.h"
30 
34 class HostedMachine : public Machine
35 {
36  public:
37  inline static HostedMachine &instance()
38  {
39  return m_Instance;
40  }
41 
42  virtual void initialise() INITIALISATION_ONLY;
43 
44  virtual void initialiseDeviceTree();
45 
46  virtual Serial *getSerial(size_t n);
47  virtual size_t getNumSerial();
48  virtual Vga *getVga(size_t n);
49  virtual size_t getNumVga();
50  virtual IrqManager *getIrqManager();
52  virtual Timer *getTimer();
53  virtual Keyboard *getKeyboard();
54  virtual void setKeyboard(Keyboard *kb);
55  virtual void stopAllOtherProcessors();
56 
57  private:
63  HostedMachine &operator=(const HostedMachine &);
67  virtual ~HostedMachine();
68 
69  HostedSerial m_Serial[2];
70  HostedVga m_Vga;
71  Keyboard *m_Keyboard;
72 
73  static HostedMachine m_Instance;
74 };
75 
76 #endif
virtual Keyboard * getKeyboard()
HostedMachine() INITIALISATION_ONLY
virtual Vga * getVga(size_t n)
virtual SchedulerTimer * getSchedulerTimer()
virtual void initialiseDeviceTree()
virtual size_t getNumVga()
virtual Serial * getSerial(size_t n)
virtual ~HostedMachine()
virtual Timer * getTimer()
virtual size_t getNumSerial()
virtual void setKeyboard(Keyboard *kb)
virtual void initialise() INITIALISATION_ONLY