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#include <config.h>
23
24#define _PROCESSOR_INFORMATION_ONLY_WANT_PROCESSORID
25#include "pedigree/kernel/processor/ProcessorInformation.h"
26#undef _PROCESSOR_INFORMATION_ONLY_WANT_PROCESSORID
27
28#include "pedigree/kernel/compiler.h"
29#include "pedigree/kernel/process/RcuReadState.h"
30#include "pedigree/kernel/processor/types.h"
31
32class Thread;
37
43 friend class ProcessorBase;
44 friend class Multiprocessor;
45
46 public:
49 EXPORTED_PUBLIC VirtualAddressSpace& getVirtualAddressSpace() const;
52 void setVirtualAddressSpace(VirtualAddressSpace& virtualAddressSpace);
53
54 uintptr_t getKernelStack() const;
55 void setKernelStack(uintptr_t stack);
56 EXPORTED_PUBLIC Thread* getCurrentThread() const;
57 void setCurrentThread(Thread* pThread);
58 PerProcessorScheduler& getScheduler();
59
60 RcuReadState& rcuState() {
61 return m_RcuState;
62 }
63
64 ProcessorId processorId() const {
65 return m_ProcessorId;
66 }
67
68 protected:
71 HostedProcessorInformation(ProcessorId processorId, uint8_t apicId = 0);
74
75 private:
76 friend class DeviceHardIrqContext;
77 friend class SuspendDeviceHardIrqContext;
78
88
98 uintptr_t m_KernelStack;
105 RcuReadState m_RcuState;
106};
107
110#endif
VirtualAddressSpace * m_VirtualAddressSpace
HostedProcessorInformation & operator=(const HostedProcessorInformation &)
HostedProcessorInformation(const HostedProcessorInformation &)
void setVirtualAddressSpace(VirtualAddressSpace &virtualAddressSpace)
EXPORTED_PUBLIC VirtualAddressSpace & getVirtualAddressSpace() const
size_t ProcessorId