The Pedigree Project  0.1
hosted/ProcessorInformation.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 KERNEL_PROCESSOR_HOSTED_PROCESSORINFORMATION_H
21 #define KERNEL_PROCESSOR_HOSTED_PROCESSORINFORMATION_H
22 
23 #include "pedigree/kernel/processor/types.h"
24 
25 class Thread;
28 
34 {
35  friend class Processor;
36  friend class Multiprocessor;
37 
38  public:
44  void setVirtualAddressSpace(VirtualAddressSpace &virtualAddressSpace);
45 
46  uintptr_t getKernelStack() const;
47  void setKernelStack(uintptr_t stack);
48 #ifdef THREADS
49  Thread *getCurrentThread() const;
50  void setCurrentThread(Thread *pThread);
51  PerProcessorScheduler &getScheduler();
52 #endif
53 
54  protected:
57  HostedProcessorInformation(ProcessorId processorId, uint8_t apicId = 0);
60 
61  private:
71 
76 #ifdef THREADS
77 
81 #endif
82 
83  uintptr_t m_KernelStack;
84 };
85 
88 #endif
HostedProcessorInformation & operator=(const HostedProcessorInformation &)
VirtualAddressSpace * m_VirtualAddressSpace
VirtualAddressSpace & getVirtualAddressSpace() const
void setVirtualAddressSpace(VirtualAddressSpace &virtualAddressSpace)
The exception was caused by a hardware task switch.
Definition: Processor.h:80
size_t ProcessorId
Definition: Thread.h:54