The Pedigree Project  0.1
mips32/TlbManager.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 MIPS32_TLBMANAGER_H
21 #define MIPS32_TLBMANAGER_H
22 
23 #include "pedigree/kernel/processor/InterruptHandler.h"
24 #include "pedigree/kernel/processor/state.h"
25 #include "pedigree/kernel/processor/types.h"
26 
29 {
30  public:
32  static MIPS32TlbManager &instance();
33 
35  void initialise();
36 
39  static void interruptAsm();
40 
43  static void
44  writeTlb(uintptr_t entryHi, uintptr_t entryLo0, uintptr_t entryLo1);
47  static void writeTlbWired(
48  uintptr_t tlbEntry, uintptr_t entryHi, uintptr_t entryLo0,
49  uintptr_t entryLo1);
52  static void flush(uintptr_t numEntries);
55  static void flushAsid(uintptr_t numEntries, uintptr_t asid);
58  static void writeContext(uintptr_t context);
61  static void writeWired(uintptr_t wired);
64  static void writePageMask(uintptr_t pageMask);
67  static uintptr_t getNumEntries();
68 
69  //
70  // InterruptHandler interface.
71  //
72  void interrupt(size_t interruptNumber, InterruptState &state);
73 
74  private:
79 
82 
84  uint32_t m_nEntries;
85 };
86 
87 #endif
static void writeWired(uintptr_t wired)
void interrupt(size_t interruptNumber, InterruptState &state)
Definition: TlbManager.cc:70
static MIPS32TlbManager m_Instance
static void writePageMask(uintptr_t pageMask)
static void writeTlbWired(uintptr_t tlbEntry, uintptr_t entryHi, uintptr_t entryLo0, uintptr_t entryLo1)
static void flush(uintptr_t numEntries)
static void writeTlb(uintptr_t entryHi, uintptr_t entryLo0, uintptr_t entryLo1)
static void flushAsid(uintptr_t numEntries, uintptr_t asid)
static uintptr_t getNumEntries()
static void writeContext(uintptr_t context)
static MIPS32TlbManager & instance()
Definition: TlbManager.cc:31
Abstract base class for interrupt-handlers.
static void interruptAsm()