The Pedigree Project  0.1
AsidManager.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 MIPS_COMMON_ASIDMANAGER_H
21 #define MIPS_COMMON_ASIDMANAGER_H
22 
23 #include "pedigree/kernel/process/Mutex.h"
24 #include "pedigree/kernel/processor/types.h"
25 
29 #define NUM_ASID 256
30 
45 {
46  public:
48  typedef uint8_t Asid;
49 
51  static AsidManager &instance();
52 
54  Asid obtainAsid();
57  void returnAsid(Asid asid);
58 
61  void bulldoze(Asid asid);
62 
63  private:
65  AsidManager();
67  ~AsidManager();
68 
70  uint32_t m_Asids[NUM_ASID];
71 
74 
77 };
80 #endif
Mutex m_Mutex
Definition: AsidManager.h:73
Definition: Mutex.h:58
void bulldoze(Asid asid)
Definition: AsidManager.cc:87
static AsidManager m_Instance
Definition: AsidManager.h:76
static AsidManager & instance()
Definition: AsidManager.cc:26
Asid obtainAsid()
Definition: AsidManager.cc:39
void returnAsid(Asid asid)
Definition: AsidManager.cc:75
uint32_t m_Asids[NUM_ASID]
Definition: AsidManager.h:70
uint8_t Asid
Definition: AsidManager.h:48