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