2020-03-01 15:38:09 +01:00
|
|
|
/*
|
2021-09-06 17:22:36 +02:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-03-01 15:38:09 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-03-01 15:38:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
#include <Kernel/Forward.h>
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2021-09-06 17:22:36 +02:00
|
|
|
class ScopedAddressSpaceSwitcher {
|
2020-03-01 15:38:09 +01:00
|
|
|
public:
|
2021-09-06 17:22:36 +02:00
|
|
|
explicit ScopedAddressSpaceSwitcher(Process&);
|
|
|
|
~ScopedAddressSpaceSwitcher();
|
2020-03-01 15:38:09 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
u32 m_previous_cr3 { 0 };
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|