Lioncash
48b0b2fc46
dmnt_cheat_vm: Correct register Restore and ClearRegs behavior
...
Previously they were performing the same behavior as the Save and
ClearSave opcode types.
2019-12-07 12:41:56 -08:00
Lioncash
89a83b0e5a
bpcmitm_main: Remove unnecessary includes
...
Quite a few headers are unused in this header, so we can remove them to
make compilation a tiny bit faster.
2019-06-04 06:29:14 -04:00
Lioncash
7bdd4bb2d1
bpcmitm_main: Add missing header guard
...
Prevents potential inclusion issues.
2019-06-04 06:28:34 -04:00
Lioncash
dd10547ac2
setsys_settings_items: Less resource churn with combined key/value construction
...
The previous string construction discards two temporary std::string
instances (operator+ returns by value, not by reference), and creates a
std::string that it doesn't need to (the one around key). Instead we can
just append to the end of the initial std::string itself, saving on two
unnecessary created strings.
append() has a const char* overload as well (as does operator+), so we
can just append the key string as is without creating an entire new
string.
2019-06-03 21:37:53 -04:00
Lioncash
452c61db7a
setsys_settings_items: Simplify buffer management in LoadConfiguration()
...
We can use a std::string here instead of setting up a scope guard and
manual allocations. We also don't need to care about null-termination,
as c_str() will automatically ensure this is done when passing it into
ini_parse_string().
2019-06-03 21:37:12 -04:00
Mat M
7a4d1e786c
ldr_map: Silence lingering initializer warning ( #500 )
...
One initializer warning case that I seem to have missed (my bad).
2019-04-04 23:13:46 -07:00
Mat M
b237168ec7
loader: Silence Wmissing-field-initializers warnings ( #499 )
...
Specifying 0 as the initial entry of a structure is a C-ism. C++ permits
using an empty set of braces to signify the same behavior, silencing
missing initializer warnings.
2019-04-04 21:05:41 -07:00
Mat M
753958de28
fs_mitm/fs_dir_utils: Amend logic error within IterateDirectoryRecursivelyInternal() ( #498 )
...
This likely intended to get the size of the string and then subtract the
null terminator byte. Instead, this would always result in a sizeof of
8.
2019-04-04 20:04:26 -07:00
Mat M
f44a730a90
fatal_font: Add missing va_end() calls to PrintFormatLine() and PrintFormat() ( #497 )
...
Fairly self-explanatory. Ensures va_start() is balanced with va_end()
2019-04-04 11:21:25 -07:00
Lioncash
a400b10921
fusee-primary: Fix always false conditional in xmemmove
...
This was corrected in 4b8455baf9 for
fusee-secondary, but I neglected to also fix it in fusee-primary (my
bad!)
2018-08-24 22:30:36 -04:00
Lioncash
4b8455baf9
fusee-secondary: Correct else-if condition in xmemmove()
...
Previously both the if and else conditions were the same.
2018-07-29 20:53:01 -07:00
Lioncash
bbdf2868c9
fusee-secondary/fs_dev: Correct uninitialized cast within fsdev_seek()
...
Previously this was casting the same unassigned variable that was being
assigned to.
2018-07-29 20:15:44 -07:00
Mat M
1de6b336bb
all: Make file-scope variables internally linked where applicable ( #57 )
...
Narrows the scope of visible symbols to where they're actually used. Also
makes it easier to see true globals in source files
(ones used from multiple translation units)
2018-02-26 00:42:21 -08:00
Mat M
c94cfe4898
lock: Use stdatomic.h ( #56 )
...
Provides the same assembly output while using the standardized interface
e.g.
0000000000000000 <set_priv_smc_in_progress>:
0: 90000000 adrp x0, 0 <set_priv_smc_in_progress>
4: 91000000 add x0, x0, #0x0
8: 52800022 mov w2, #0x1 // #1
c: d503201f nop
10: 085ffc01 ldaxrb w1, [x0]
14: 08037c02 stxrb w3, w2, [x0]
18: 35ffffc3 cbnz w3, 10 <set_priv_smc_in_progress+0x10>
1c: 72001c3f tst w1, #0xff
20: 54ffff81 b.ne 10 <set_priv_smc_in_progress+0x10> // b.any
24: d65f03c0 ret
2018-02-25 22:59:48 -08:00
Mat M
461105a501
fuse: simplify checks in fuse_get_reserved_odm and fuse_get_spare_bit ( #54 )
...
A separate variable isn't particularly necessary here, and given that the type
is unsigned, we only need to test the upper bound.
This also resolves two -Wtype-limits warnings
2018-02-25 21:23:31 -08:00
Mat M
fff3912c81
mc: Remove dead code in get_carveout_by_id ( #52 )
2018-02-25 21:13:07 -08:00
Mat M
991d4f1355
se: Remove memset in se_perform_aes_block_operation ( #53 )
...
We can just initialize the array to be zeroed out. This is safer and less error-prone,
since the initializer is now associated with the variable directly, making it
impossible to put code relying on the zeroed out state before it (unlike with memset).
2018-02-25 21:12:49 -08:00
Lioncash
b328effd9b
memory_map: Remove unnecessary const
...
Since the return value isn't a pointer thing doesn't have much use.
2018-02-25 23:56:47 -05:00
Mat M
a081c93094
bootconfig/configitem: Fix includes and identifiers ( #49 )
2018-02-24 12:46:57 -08:00
Lioncash
a34813bcf4
memory_map: Fix most compilation issues
2018-02-24 15:38:48 -05:00
Mat M
56f5b56235
smc_user: Correct cache_flush to flush_dcache_range ( #48 )
...
cache_flush is a non-existent function
2018-02-23 20:38:21 -08:00
Mat M
44a2b7a344
smc_user: Add missing gcm.h include ( #47 )
...
Resolves an implicit declaration warning for gcm_decrypt_key
2018-02-23 16:09:55 -08:00
Mat M
e3897bb731
se: Add missing string.h include ( #46 )
...
Resolves implicit declaration warnings for memcpy and memset
2018-02-23 16:09:44 -08:00
Mat M
34d8a859ab
timers: Fix identifier name in wait's spin-lock ( #45 )
...
Also resolves implicit definition warnings for wait by including the necessary header where applicable
2018-02-23 16:09:34 -08:00
Lioncash
b4229f0fa8
mmu: Remove phys_addr parameter from mmu_unmap_range
...
It's unused
2018-02-23 09:25:21 -05:00
Lioncash
296b43744c
i2c: Fix -Wmissing-prototypes warnings
2018-02-23 09:19:32 -05:00
Mat M
9dfa6e2732
start.cold/warm: Correct MSR instructions ( #42 )
...
The second operand needs to be an immediate
2018-02-23 05:46:06 -08:00
Mat M
7b1fa3a8f0
start.cold/warm.s: Correct DSB instruction instances ( #41 )
...
DSB requires that the barrier option be specified
2018-02-23 05:42:55 -08:00
Mat M
615216edeb
smc_api: Fix compilation issues ( #40 )
...
* smc_api: Add missing includes
MASTERKEY_REVISION_400_CURRENT, seal_titlekey, PMC_BASE and the randomcache functions aren't visible without them
* smc_api: Add missing parameter name to smc_get_result
* smc_api: Fix buffer being passed to se_get_exp_mod_output in smc_unwrap_rsa_oaep_wrapped_titlekey_get_result
wrapped_titlekey doesn't exist
* smc_api: Correct device physical address accesses in smc_read_write_register
2018-02-23 05:41:26 -08:00
Mat M
0ec1ceca1f
sealedkeys: Fix compilation issues ( #39 )
...
* sealedkeys: Remove non-existent variable in condition in seal_titlekey
* sealedkeys: call unseal_key_internal in unseal_key instead of seal_key_internal
2018-02-23 05:40:38 -08:00
Lioncash
705802d749
mmu: Fix call to non-existent mmu_unmap_page_range function in mmio_unmap_all_devices
2018-02-23 07:32:23 -05:00
Lioncash
d2f12c5900
mmu: Remove extraneous argument to mmu_unmap in mmu_unmap_range
2018-02-23 07:30:48 -05:00
Mat M
765ae2c06a
se: Fix compilation issues ( #36 )
...
* se: Correct excess argument errors with se_perform_aes_block_operation
* se: Fix excess arguments with set_se_ctr
* se: Correct variable identifiers in se_synchronous_exp_mod
* se: Correct offset variable identifier in se_get_exp_mod_output
2018-02-22 23:12:44 -08:00
Mat M
3596032869
package2: Silence a -Wcomment warning ( #35 )
2018-02-22 23:11:51 -08:00
Mat M
7ab0acf656
package2: Correct -> to . in load_package2 ( #34 )
...
header is a local on the stack, so this should just be regular member accessing
2018-02-22 23:11:15 -08:00
Mat M
06c8b7a764
package2: Fix buffer variable name in rsa2048_pss_verify ( #32 )
2018-02-22 20:40:41 -08:00
Mat M
4131a61d00
package2: Use assignment instead of memcpy in decrypt_and_validate_header ( #33 )
...
This is more concise and also compiles (the previous code was missing an & on the source argument)
2018-02-22 20:31:13 -08:00
Mat M
7d777a0e59
package2: Fix loop index in decrypt_and_validate_header ( #31 )
2018-02-22 20:18:18 -08:00
Mat M
83216409d2
all: Use bool where applicable ( #30 )
2018-02-22 19:58:39 -08:00
Mat M
1d8f443f68
gcm: Convert source data to a uint8_t pointer before subscripting it ( #29 )
...
It's not well-formed to subscript a pointer to void
2018-02-22 18:44:27 -08:00
Mat M
3020faf8a2
mmu: Pass missing tbl argument to mmu_map_page in mmu_map_page_range ( #28 )
2018-02-22 18:28:30 -08:00
Lioncash
6fb3c77764
Add missing string.h includes
2018-02-22 21:09:02 -05:00
Mat M
a798df5a2c
cpu_context: Add missing include ( #25 )
2018-02-22 18:08:57 -08:00
Mat M
c6158d7d64
mmu: Fix loop index variable name in mmio_get_device_address ( #24 )
2018-02-22 18:05:43 -08:00
Mat M
0597fe887a
package2: Correct variable name for new device key source ( #19 )
...
Identifiers can't begin with a number
2018-02-22 18:03:22 -08:00
Mat M
25a5eacb96
masterkey: Add missing semicolon to mkey_vectors ( #18 )
2018-02-22 17:18:28 -08:00
Mat M
32238984bf
smc_user: Fix syntax ( #16 )
...
* smc_user: Fix syntax for size assignment in user_load_secure_exp_mod_key() and user_load_rsa_oaep_key()
* smc_user: Fix include directive
2018-02-22 14:18:34 -08:00