2020-11-08 15:48:16 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-08 15:48:16 +03: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 14:18:30 +03:00
|
|
|
#if USING_AK_GLOBALLY
|
2020-11-08 15:48:16 +03:00
|
|
|
using AK::StackInfo;
|
2022-11-26 14:18:30 +03:00
|
|
|
#endif
|