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

@@ -19,7 +19,7 @@
#include "updater_bis_management.hpp"
namespace sts::updater {
namespace ams::updater {
Result BisAccessor::Initialize() {
R_TRY(fsOpenBisStorage(&this->storage, this->partition_id));
@@ -35,18 +35,18 @@ namespace sts::updater {
}
Result BisAccessor::Read(void *dst, size_t size, u64 offset) {
STS_ASSERT((offset % SectorAlignment) == 0);
AMS_ASSERT((offset % SectorAlignment) == 0);
return fsStorageRead(&this->storage, offset, dst, size);
}
Result BisAccessor::Write(u64 offset, const void *src, size_t size) {
STS_ASSERT((offset % SectorAlignment) == 0);
AMS_ASSERT((offset % SectorAlignment) == 0);
return fsStorageWrite(&this->storage, offset, src, size);
}
Result BisAccessor::Write(u64 offset, size_t size, const char *bip_path, void *work_buffer, size_t work_buffer_size) {
STS_ASSERT((offset % SectorAlignment) == 0);
STS_ASSERT((work_buffer_size % SectorAlignment) == 0);
AMS_ASSERT((offset % SectorAlignment) == 0);
AMS_ASSERT((work_buffer_size % SectorAlignment) == 0);
FILE *bip_fp = fopen(bip_path, "rb");
if (bip_fp == NULL) {
@@ -63,7 +63,7 @@ namespace sts::updater {
return fsdevGetLastResult();
}
}
STS_ASSERT(written + read_size <= size);
AMS_ASSERT(written + read_size <= size);
size_t aligned_size = ((read_size + SectorAlignment - 1) / SectorAlignment) * SectorAlignment;
R_TRY(this->Write(offset + written, work_buffer, aligned_size));
@@ -77,8 +77,8 @@ namespace sts::updater {
}
Result BisAccessor::Clear(u64 offset, u64 size, void *work_buffer, size_t work_buffer_size) {
STS_ASSERT((offset % SectorAlignment) == 0);
STS_ASSERT((work_buffer_size % SectorAlignment) == 0);
AMS_ASSERT((offset % SectorAlignment) == 0);
AMS_ASSERT((work_buffer_size % SectorAlignment) == 0);
std::memset(work_buffer, 0, work_buffer_size);
@@ -92,8 +92,8 @@ namespace sts::updater {
}
Result BisAccessor::GetHash(void *dst, u64 offset, u64 size, u64 hash_size, void *work_buffer, size_t work_buffer_size) {
STS_ASSERT((offset % SectorAlignment) == 0);
STS_ASSERT((work_buffer_size % SectorAlignment) == 0);
AMS_ASSERT((offset % SectorAlignment) == 0);
AMS_ASSERT((work_buffer_size % SectorAlignment) == 0);
Sha256Context sha_ctx;
sha256ContextCreate(&sha_ctx);
@@ -113,12 +113,12 @@ namespace sts::updater {
size_t Boot0Accessor::GetBootloaderVersion(void *bct) {
u32 version = *reinterpret_cast<u32 *>(reinterpret_cast<uintptr_t>(bct) + BctVersionOffset);
STS_ASSERT(version <= BctVersionMax);
AMS_ASSERT(version <= BctVersionMax);
return static_cast<size_t>(version);
}
size_t Boot0Accessor::GetEksIndex(size_t bootloader_version) {
STS_ASSERT(bootloader_version <= BctVersionMax);
AMS_ASSERT(bootloader_version <= BctVersionMax);
return (bootloader_version > 0) ? bootloader_version - 1 : 0;
}