2020-11-08 12:48:16 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-08 12:48:16 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
class StackInfo {
|
|
|
|
public:
|
|
|
|
StackInfo();
|
|
|
|
|
|
|
|
FlatPtr base() const { return m_base; }
|
|
|
|
FlatPtr top() const { return m_top; }
|
|
|
|
size_t size() const { return m_size; }
|
|
|
|
size_t size_free() const
|
|
|
|
{
|
|
|
|
FlatPtr dummy;
|
|
|
|
return reinterpret_cast<FlatPtr>(&dummy) - m_base;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
FlatPtr m_base;
|
|
|
|
FlatPtr m_top;
|
|
|
|
size_t m_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-11-26 11:18:30 +00:00
|
|
|
#if USING_AK_GLOBALLY
|
2020-11-08 12:48:16 +00:00
|
|
|
using AK::StackInfo;
|
2022-11-26 11:18:30 +00:00
|
|
|
#endif
|