mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-17 08:34:23 -04:00
Integrate new result macros. (#1780)
* result: try out some experimental shenanigans * result: sketch out some more shenanigans * result: see what it looks like to convert kernel to use result conds instead of guards * make rest of kernel use experimental new macro-ing
This commit is contained in:
parent
375ba615be
commit
96f95b9f95
109 changed files with 1355 additions and 1380 deletions
|
@ -62,7 +62,7 @@ namespace ams::kern::svc {
|
|||
}
|
||||
MESOSPHERE_ASSERT(remaining == 0);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void FlushEntireDataCache() {
|
||||
|
@ -88,7 +88,7 @@ namespace ams::kern::svc {
|
|||
/* Flush the cache. */
|
||||
R_TRY(cpu::FlushDataCache(reinterpret_cast<void *>(address), size));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result InvalidateProcessDataCache(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
|
@ -104,7 +104,7 @@ namespace ams::kern::svc {
|
|||
/* Invalidate the cache. */
|
||||
R_TRY(process->GetPageTable().InvalidateProcessDataCache(address, size));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result StoreProcessDataCache(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
|
@ -123,14 +123,14 @@ namespace ams::kern::svc {
|
|||
|
||||
/* Perform the operation. */
|
||||
if (process.GetPointerUnsafe() == GetCurrentProcessPointer()) {
|
||||
return cpu::StoreDataCache(reinterpret_cast<void *>(address), size);
|
||||
R_RETURN(cpu::StoreDataCache(reinterpret_cast<void *>(address), size));
|
||||
} else {
|
||||
class StoreCacheOperation : public CacheOperation {
|
||||
public:
|
||||
virtual void Operate(void *address, size_t size) const override { cpu::StoreDataCache(address, size); }
|
||||
} operation;
|
||||
|
||||
return DoProcessCacheOperation(operation, page_table, address, size);
|
||||
R_RETURN(DoProcessCacheOperation(operation, page_table, address, size));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,14 +150,14 @@ namespace ams::kern::svc {
|
|||
|
||||
/* Perform the operation. */
|
||||
if (process.GetPointerUnsafe() == GetCurrentProcessPointer()) {
|
||||
return cpu::FlushDataCache(reinterpret_cast<void *>(address), size);
|
||||
R_RETURN(cpu::FlushDataCache(reinterpret_cast<void *>(address), size));
|
||||
} else {
|
||||
class FlushCacheOperation : public CacheOperation {
|
||||
public:
|
||||
virtual void Operate(void *address, size_t size) const override { cpu::FlushDataCache(address, size); }
|
||||
} operation;
|
||||
|
||||
return DoProcessCacheOperation(operation, page_table, address, size);
|
||||
R_RETURN(DoProcessCacheOperation(operation, page_table, address, size));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,19 +170,19 @@ namespace ams::kern::svc {
|
|||
}
|
||||
|
||||
Result FlushDataCache64(ams::svc::Address address, ams::svc::Size size) {
|
||||
return FlushDataCache(address, size);
|
||||
R_RETURN(FlushDataCache(address, size));
|
||||
}
|
||||
|
||||
Result InvalidateProcessDataCache64(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return InvalidateProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(InvalidateProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
Result StoreProcessDataCache64(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return StoreProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(StoreProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
Result FlushProcessDataCache64(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return FlushProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(FlushProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
/* ============================= 64From32 ABI ============================= */
|
||||
|
@ -192,19 +192,19 @@ namespace ams::kern::svc {
|
|||
}
|
||||
|
||||
Result FlushDataCache64From32(ams::svc::Address address, ams::svc::Size size) {
|
||||
return FlushDataCache(address, size);
|
||||
R_RETURN(FlushDataCache(address, size));
|
||||
}
|
||||
|
||||
Result InvalidateProcessDataCache64From32(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return InvalidateProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(InvalidateProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
Result StoreProcessDataCache64From32(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return StoreProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(StoreProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
Result FlushProcessDataCache64From32(ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return FlushProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(FlushProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue