The Pedigree Project  0.1
Mac.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 MACHINE_MAC_MAC_H
21 #define MACHINE_MAC_MAC_H
22 
23 #include "../ppc_common/Decrementer.h"
24 #include "../ppc_common/Keyboard.h"
25 #include "../ppc_common/Serial.h"
26 #include "../ppc_common/Vga.h"
27 #include "pedigree/kernel/machine/IrqManager.h"
28 #include "pedigree/kernel/machine/Machine.h"
29 
33 class Mac : public Machine
34 {
35  public:
36  inline static Machine &instance()
37  {
38  return m_Instance;
39  }
40 
41  virtual void initialise();
42  virtual Serial *getSerial(size_t n);
43  virtual size_t getNumSerial();
44  virtual Vga *getVga(size_t n);
45  virtual size_t getNumVga();
46  virtual IrqManager *getIrqManager();
48  virtual Timer *getTimer();
49  virtual Keyboard *getKeyboard();
50 
51  virtual void initialiseDeviceTree();
52 
53  private:
57  Mac();
58  Mac(const Mac &);
59  Mac &operator=(const Mac &);
63  virtual ~Mac();
64 
65  PPCSerial m_Serial[2];
66  Decrementer m_Decrementer;
67  // Timer m_Timers;
68  PPCVga m_Vga;
69  PPCKeyboard m_Keyboard;
70  IrqManager *m_pIrqManager;
71 
72  static Mac m_Instance;
73 };
74 
75 #endif
Definition: Mac.h:33
virtual Vga * getVga(size_t n)
Definition: Mac.cc:54
virtual Timer * getTimer()
Definition: Mac.cc:70
Mac()
Definition: Mac.cc:80
virtual ~Mac()
Definition: Mac.cc:83
virtual void initialiseDeviceTree()
Definition: Mac.cc:121
virtual Serial * getSerial(size_t n)
Definition: Mac.cc:46
virtual size_t getNumSerial()
Definition: Mac.cc:50
virtual SchedulerTimer * getSchedulerTimer()
Definition: Mac.cc:66
virtual Keyboard * getKeyboard()
Definition: Mac.cc:75
virtual size_t getNumVga()
Definition: Mac.cc:58
virtual void initialise()
Definition: Mac.cc:39