Rename sd_utils to fs_utils, etc
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "sd_utils.h"
|
||||
#include "fs_utils.h"
|
||||
#include "hwinit.h"
|
||||
#include "sdmmc.h"
|
||||
#include "lib/printk.h"
|
||||
@@ -18,7 +18,7 @@ int mount_sd(void) {
|
||||
return mounted_sd;
|
||||
}
|
||||
|
||||
size_t read_sd_file(void *dst, size_t dst_size, const char *filename) {
|
||||
size_t read_from_file(void *dst, size_t dst_size, const char *filename) {
|
||||
if (!mounted_sd && mount_sd() == 0) {
|
||||
return 0;
|
||||
}
|
||||
9
fusee/fusee-primary/src/fs_utils.h
Normal file
9
fusee/fusee-primary/src/fs_utils.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef FUSEE_FS_UTILS_H
|
||||
#define FUSEE_FS_UTILS_H
|
||||
|
||||
#include "utils.h"
|
||||
#include "sdmmc.h"
|
||||
|
||||
size_t read_from_file(void *dst, size_t dst_size, const char *filename);
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "hwinit.h"
|
||||
#include "fuse.h"
|
||||
#include "se.h"
|
||||
#include "sd_utils.h"
|
||||
#include "fs_utils.h"
|
||||
#include "stage2.h"
|
||||
#include "chainloader.h"
|
||||
#include "sdmmc.h"
|
||||
@@ -23,7 +23,7 @@ static char g_bct0_buffer[BCTO_MAX_SIZE];
|
||||
"stage2_entrypoint = 0xF0000000\n"
|
||||
|
||||
static const char *load_config(void) {
|
||||
if (!read_sd_file(g_bct0_buffer, BCTO_MAX_SIZE, "BCT.ini")) {
|
||||
if (!read_from_file(g_bct0_buffer, BCTO_MAX_SIZE, "BCT.ini")) {
|
||||
printk("Failed to read BCT0 from SD!\n");
|
||||
printk("[DEBUG] Using default BCT0!\n");
|
||||
memcpy(g_bct0_buffer, DEFAULT_BCT0_FOR_DEBUG, sizeof(DEFAULT_BCT0_FOR_DEBUG));
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef FUSEE_SD_UTILS_H
|
||||
#define FUSEE_SD_UTILS_H
|
||||
|
||||
#include "utils.h"
|
||||
#include "sdmmc.h"
|
||||
|
||||
size_t read_sd_file(void *dst, size_t dst_size, const char *filename);
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "utils.h"
|
||||
#include <stdint.h>
|
||||
#include "display/video_fb.h"
|
||||
#include "sd_utils.h"
|
||||
#include "fs_utils.h"
|
||||
#include "stage2.h"
|
||||
#include "chainloader.h"
|
||||
#include "lib/printk.h"
|
||||
@@ -105,7 +105,7 @@ void load_stage2(const char *bct0) {
|
||||
tmp_addr = config.load_address;
|
||||
}
|
||||
|
||||
if (read_sd_file((void *)tmp_addr, size, config.path) != size) {
|
||||
if (read_from_file((void *)tmp_addr, size, config.path) != size) {
|
||||
printk("Error: Failed to read stage2 (%s)!\n", config.path);
|
||||
generic_panic();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user