The Pedigree Project  0.1
VsidManager.cc
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 #include "VsidManager.h"
21 #include "pedigree/kernel/Log.h"
22 
24 
26 {
27  return m_Instance;
28 }
29 
31 {
32 }
33 
35 {
36 }
37 
39 {
41  NOTICE("pStack: " << (uintptr_t) m_pStack << ", hwm: " << m_HighWaterMark);
42 
43  // Is the stack NULL?
44  // if (m_pStack == 0)
45  // Return the high water mark and increment.
46  return m_HighWaterMark++;
47 
48  // Pop the stack.
49  // VsidStack *pPopped = m_pStack;
50  // m_pStack = m_pStack->next;
51 
52  // Vsid vsid = pPopped->vsid;
53  // delete pPopped;
54 
55  // return vsid;
56 }
57 
59 {
62 
63  // VsidStack *pPushed = new VsidStack;
64  // pPushed->vsid = vsid;
65  // pPushed->next = m_pStack;
66  // m_pStack = pPushed;
67 }
void returnVsid(Vsid vsid)
Definition: VsidManager.cc:58
static VsidManager m_Instance
Definition: VsidManager.h:81
#define NOTICE(text)
Definition: Log.h:74
Mutex m_Mutex
Definition: VsidManager.h:78
static VsidManager & instance()
Definition: VsidManager.cc:25
VsidStack * m_pStack
Definition: VsidManager.h:75
uint32_t Vsid
Definition: VsidManager.h:45
Vsid obtainVsid()
Definition: VsidManager.cc:38
Vsid m_HighWaterMark
Definition: VsidManager.h:72