namespace sts -> namespace ams

namespace sts::ams -> ams::exosphere, ams::.

This is to facilitate future use of ams:: namespace code in
mesosphere, as we'll want to include ams::util, ams::result, ams::svc...
This commit is contained in:
Michael Scire
2019-10-24 02:30:10 -07:00
committed by SciresM
parent 4059dc6187
commit 8cb77ac136
397 changed files with 968 additions and 926 deletions

View File

@@ -15,14 +15,14 @@
*/
#include <stratosphere.hpp>
namespace sts::sf::cmif {
namespace ams::sf::cmif {
ServerDomainManager::Domain::~Domain() {
while (!this->entries.empty()) {
Entry *entry = &this->entries.front();
{
std::scoped_lock lk(this->manager->entry_owner_lock);
STS_ASSERT(entry->owner == this);
AMS_ASSERT(entry->owner == this);
entry->owner = nullptr;
}
entry->object.Reset();
@@ -35,7 +35,7 @@ namespace sts::sf::cmif {
for (size_t i = 0; i < count; i++) {
Entry *entry = this->manager->entry_manager.AllocateEntry();
R_UNLESS(entry != nullptr, sf::cmif::ResultOutOfDomainEntries());
STS_ASSERT(entry->owner == nullptr);
AMS_ASSERT(entry->owner == nullptr);
out_ids[i] = this->manager->entry_manager.GetId(entry);
}
return ResultSuccess();
@@ -48,18 +48,18 @@ namespace sts::sf::cmif {
void ServerDomainManager::Domain::UnreserveIds(const DomainObjectId *ids, size_t count) {
for (size_t i = 0; i < count; i++) {
Entry *entry = this->manager->entry_manager.GetEntry(ids[i]);
STS_ASSERT(entry != nullptr);
STS_ASSERT(entry->owner == nullptr);
AMS_ASSERT(entry != nullptr);
AMS_ASSERT(entry->owner == nullptr);
this->manager->entry_manager.FreeEntry(entry);
}
}
void ServerDomainManager::Domain::RegisterObject(DomainObjectId id, ServiceObjectHolder &&obj) {
Entry *entry = this->manager->entry_manager.GetEntry(id);
STS_ASSERT(entry != nullptr);
AMS_ASSERT(entry != nullptr);
{
std::scoped_lock lk(this->manager->entry_owner_lock);
STS_ASSERT(entry->owner == nullptr);
AMS_ASSERT(entry->owner == nullptr);
entry->owner = this;
this->entries.push_back(*entry);
}
@@ -129,8 +129,8 @@ namespace sts::sf::cmif {
void ServerDomainManager::EntryManager::FreeEntry(Entry *entry) {
std::scoped_lock lk(this->lock);
STS_ASSERT(entry->owner == nullptr);
STS_ASSERT(!entry->object);
AMS_ASSERT(entry->owner == nullptr);
AMS_ASSERT(!entry->object);
this->free_list.push_front(*entry);
}
@@ -142,8 +142,8 @@ namespace sts::sf::cmif {
const auto id = ids[i];
Entry *entry = this->GetEntry(id);
if (id != InvalidDomainObjectId) {
STS_ASSERT(entry != nullptr);
STS_ASSERT(entry->owner == nullptr);
AMS_ASSERT(entry != nullptr);
AMS_ASSERT(entry->owner == nullptr);
this->free_list.erase(this->free_list.iterator_to(*entry));
}
}

View File

@@ -16,7 +16,7 @@
#include <functional>
#include <stratosphere.hpp>
namespace sts::sf::cmif {
namespace ams::sf::cmif {
Result DomainServiceObjectDispatchTable::ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
return this->ProcessMessageImpl(ctx, static_cast<DomainServiceObject *>(ctx.srv_obj)->GetServerDomain(), in_raw_data);
@@ -133,7 +133,7 @@ namespace sts::sf::cmif {
/* Write out header. */
constexpr size_t out_header_size = sizeof(CmifDomainOutHeader);
const size_t impl_out_data_total_size = this->GetImplOutDataTotalSize();
STS_ASSERT(out_header_size + impl_out_data_total_size + sizeof(DomainObjectId) * this->GetOutObjectCount() <= raw_data.GetSize());
AMS_ASSERT(out_header_size + impl_out_data_total_size + sizeof(DomainObjectId) * this->GetOutObjectCount() <= raw_data.GetSize());
*reinterpret_cast<CmifDomainOutHeader *>(raw_data.GetPointer()) = CmifDomainOutHeader{ .num_out_objects = static_cast<u32>(this->GetOutObjectCount()), };
/* Set output raw data. */
@@ -151,7 +151,7 @@ namespace sts::sf::cmif {
/* Write out header. */
constexpr size_t out_header_size = sizeof(CmifDomainOutHeader);
const size_t impl_out_data_total_size = this->GetImplOutDataTotalSize();
STS_ASSERT(out_header_size + impl_out_data_total_size <= raw_data.GetSize());
AMS_ASSERT(out_header_size + impl_out_data_total_size <= raw_data.GetSize());
*reinterpret_cast<CmifDomainOutHeader *>(raw_data.GetPointer()) = CmifDomainOutHeader{ .num_out_objects = 0, };
/* Set output raw data. */

View File

@@ -15,7 +15,7 @@
*/
#include <stratosphere.hpp>
namespace sts::sf::cmif {
namespace ams::sf::cmif {
Result impl::ServiceDispatchTableBase::ProcessMessageImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const {
/* Get versioning info. */
@@ -46,7 +46,7 @@ namespace sts::sf::cmif {
/* Forward forwardable results, otherwise ensure we can send result to user. */
R_TRY_CATCH(command_result) {
R_CATCH(sf::impl::ResultRequestContextChanged) { return R_CURRENT_RESULT; }
R_CATCH_ALL() { STS_ASSERT(out_header != nullptr); }
R_CATCH_ALL() { AMS_ASSERT(out_header != nullptr); }
} R_END_TRY_CATCH;
/* Write output header to raw data. */
@@ -89,11 +89,11 @@ namespace sts::sf::cmif {
/* Forward forwardable results, otherwise ensure we can send result to user. */
R_TRY_CATCH(command_result) {
R_CATCH(ams::mitm::ResultShouldForwardToSession) {
R_CATCH(sm::mitm::ResultShouldForwardToSession) {
return ctx.session->ForwardRequest(ctx);
}
R_CATCH(sf::impl::ResultRequestContextChanged) { return R_CURRENT_RESULT; }
R_CATCH_ALL() { STS_ASSERT(out_header != nullptr); }
R_CATCH_ALL() { AMS_ASSERT(out_header != nullptr); }
} R_END_TRY_CATCH;
/* Write output header to raw data. */

View File

@@ -16,7 +16,7 @@
#include <functional>
#include <stratosphere.hpp>
namespace sts::sf::cmif {
namespace ams::sf::cmif {
Result ServiceObjectHolder::ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
const auto ProcessHandler = this->dispatch_meta->ProcessHandler;