fusee: fix buildsystem, rename secondary -> package3

This commit is contained in:
Michael Scire
2021-09-05 15:45:40 -07:00
committed by SciresM
parent b7521465ee
commit 045f9b2f15
16 changed files with 246 additions and 139 deletions

View File

@@ -14,7 +14,7 @@ export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) $(TOPDIR)/../../fusee/fusee-primary
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) $(TOPDIR)/../../fusee
export DEPSDIR := $(CURDIR)/$(BUILD)
@@ -22,7 +22,7 @@ CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c)
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp)
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s)
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) fusee-primary.bin
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) fusee.bin
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
@@ -68,7 +68,7 @@ endif
all: $(BUILD)
check_fusee:
@$(MAKE) -C $(TOPDIR)/../../fusee/fusee-primary all
@$(MAKE) -C $(TOPDIR)/../../fusee release
$(BUILD): check_fusee
@[ -d $@ ] || mkdir -p $@
@@ -77,7 +77,7 @@ $(BUILD): check_fusee
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@$(MAKE) -C $(TOPDIR)/../../fusee/fusee-primary clean
@$(MAKE) -C $(TOPDIR)/../../fusee clean
@rm -fr $(BUILD) $(TARGET).kip $(TARGET).elf
@@ -96,12 +96,12 @@ $(OUTPUT).kip : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
boot_power_utils.o: fusee-primary.bin.o
boot_power_utils.o: fusee.bin.o
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
fusee-primary.bin.o: fusee-primary.bin
fusee.bin.o: fusee.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)

View File

@@ -16,7 +16,7 @@
#include <stratosphere.hpp>
#include "boot_power_utils.hpp"
#include "boot_pmic_driver.hpp"
#include "fusee-primary_bin.h"
#include "fusee_bin.h"
namespace ams::boot {
@@ -48,8 +48,8 @@ namespace ams::boot {
ClearIram();
/* Copy in payload. */
for (size_t ofs = 0; ofs < fusee_primary_bin_size; ofs += sizeof(g_work_page)) {
std::memcpy(g_work_page, &fusee_primary_bin[ofs], std::min(static_cast<size_t>(fusee_primary_bin_size - ofs), sizeof(g_work_page)));
for (size_t ofs = 0; ofs < fusee_bin_size; ofs += sizeof(g_work_page)) {
std::memcpy(g_work_page, &fusee_bin[ofs], std::min(static_cast<size_t>(fusee_bin_size - ofs), sizeof(g_work_page)));
exosphere::CopyToIram(IramPayloadBase + ofs, g_work_page, sizeof(g_work_page));
}
@@ -61,8 +61,8 @@ namespace ams::boot {
ClearIram();
/* Copy in payload. */
for (size_t ofs = 0; ofs < fusee_primary_bin_size; ofs += sizeof(g_work_page)) {
std::memcpy(g_work_page, &fusee_primary_bin[ofs], std::min(static_cast<size_t>(fusee_primary_bin_size - ofs), sizeof(g_work_page)));
for (size_t ofs = 0; ofs < fusee_bin_size; ofs += sizeof(g_work_page)) {
std::memcpy(g_work_page, &fusee_bin[ofs], std::min(static_cast<size_t>(fusee_bin_size - ofs), sizeof(g_work_page)));
exosphere::CopyToIram(IramPayloadBase + ofs, g_work_page, sizeof(g_work_page));
}
@@ -93,7 +93,7 @@ namespace ams::boot {
}
void SetInitialRebootPayload() {
::ams::SetInitialRebootPayload(fusee_primary_bin, fusee_primary_bin_size);
::ams::SetInitialRebootPayload(fusee_bin, fusee_bin_size);
}
void RebootForFatalError(ams::FatalErrorContext *ctx) {