mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
Change read_sd_file semantics to return size read.
This commit is contained in:
parent
222ec1cd7f
commit
ea609e68d3
6 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
#include "sd_utils.h"
|
#include "sd_utils.h"
|
||||||
|
|
||||||
int read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
||||||
/* TODO: Implement this function. */
|
/* TODO: Implement this function. */
|
||||||
(void)(dst);
|
(void)(dst);
|
||||||
(void)(dst_size);
|
(void)(dst_size);
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
int read_sd_file(void *dst, size_t dst_size, const char *filename);
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -71,7 +71,9 @@ void load_list_entry(const char *key) {
|
||||||
generic_panic();
|
generic_panic();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!read_sd_file((void *)load_file_ctx.load_address, LOADER_FILESIZE_MAX, load_file_ctx.path)) {
|
/* Read file off of SD. */
|
||||||
|
load_file_ctx.load_size = read_sd_file((void *)load_file_ctx.load_address, LOADER_FILESIZE_MAX, load_file_ctx.path);
|
||||||
|
if (load_file_ctx.load_size == 0) {
|
||||||
printk("Error: Failed to read %s!\n", load_file_ctx.path);
|
printk("Error: Failed to read %s!\n", load_file_ctx.path);
|
||||||
generic_panic();
|
generic_panic();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ typedef struct {
|
||||||
char path[0x300];
|
char path[0x300];
|
||||||
const char *key;
|
const char *key;
|
||||||
uintptr_t load_address;
|
uintptr_t load_address;
|
||||||
|
size_t load_size;
|
||||||
} load_file_t;
|
} load_file_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "sd_utils.h"
|
#include "sd_utils.h"
|
||||||
|
|
||||||
int read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
||||||
/* TODO: Implement this function. */
|
/* TODO: Implement this function. */
|
||||||
(void)(dst);
|
(void)(dst);
|
||||||
(void)(dst_size);
|
(void)(dst_size);
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
int read_sd_file(void *dst, size_t dst_size, const char *filename);
|
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in a new issue