Implement support for parsing/interacting with NCAs. (#942)

* fs: implement support for interacting with ncas.

* spl: extend to use virtual keyslots
This commit is contained in:
SciresM 2020-05-11 15:04:51 -07:00 committed by GitHub
parent 3a1ccdd919
commit 81f91803ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 13301 additions and 405 deletions

View file

@ -208,4 +208,11 @@ namespace ams::util {
return T(1) << (BITSIZEOF(T) - CountLeadingZeros(x) - 1);
}
template<typename T, typename U>
constexpr ALWAYS_INLINE T DivideUp(T v, U d) {
using Unsigned = typename std::make_unsigned<U>::type;
const Unsigned add = static_cast<Unsigned>(d) - 1;
return static_cast<T>((v + add) / d);
}
}