The Pedigree Project  0.1
Processor.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 "pedigree/kernel/processor/Processor.h"
21 #include "pedigree/kernel/utilities/Vector.h"
22 #include "pedigree/kernel/utilities/new"
23 
24 size_t Processor::m_Initialised = 0;
25 #if !defined(MULTIPROCESSOR)
26 ProcessorInformation Processor::m_ProcessorInformation(0);
27 #else
29 ProcessorInformation Processor::m_SafeBspProcessorInformation(0);
30 #endif
31 
32 size_t Processor::m_nProcessors = 1;
33 
35 {
36  return m_Initialised;
37 }
38 
39 #if !defined(MULTIPROCESSOR)
41 {
42  return 0;
43 }
44 
45 ProcessorInformation &Processor::information()
46 {
48 }
49 
51 {
52  return 1;
53 }
54 #endif
55 
56 #ifndef PEDIGREE_BENCHMARK
57 EnsureInterrupts::EnsureInterrupts(bool desired)
58 {
59  m_bPrevious = Processor::getInterrupts();
60  Processor::setInterrupts(desired);
61 }
62 
63 EnsureInterrupts::~EnsureInterrupts()
64 {
65  Processor::setInterrupts(m_bPrevious);
66 }
67 #endif
static bool getInterrupts()
static size_t isInitialised()
Definition: Processor.cc:34
A vector / dynamic array.
static ProcessorInformation & information()
Definition: Processor.cc:45
static size_t m_Initialised
Definition: Processor.h:371
static void setInterrupts(bool bEnable)
static size_t getCount()
Definition: Processor.cc:50
size_t ProcessorId
static ProcessorId id()
Definition: Processor.cc:40
static ProcessorInformation m_ProcessorInformation
Definition: Processor.h:386