From 80b9f6bb4d2ebb3474f660770a79c2dfd6bcee73 Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Fri, 30 Aug 2024 23:45:39 +0800 Subject: [PATCH] refactor: Renamed WITH_NO_COMPRESSION to WITH_COMPRESSION for consistent style --- armsrc/Makefile | 2 +- armsrc/appmain.c | 6 +++--- armsrc/start.c | 6 +++--- common_arm/Makefile.hal | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/armsrc/Makefile b/armsrc/Makefile index 2f27534ef..dedccd3e0 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -224,7 +224,7 @@ else endif $(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.stage1.elf $(OBJDIR)/fullimage.data.bin.z -ifeq (,$(findstring WITH_NO_COMPRESSION,$(APP_CFLAGS))) +ifneq (,$(findstring WITH_COMPRESSION,$(APP_CFLAGS))) $(info [=] LD $@) $(Q)$(CROSS_OBJCOPY) -O elf32-littlearm -I elf32-littlearm --strip-all --update-section .data=$(OBJDIR)/fullimage.data.bin.z $(OBJDIR)/fullimage.stage1.elf $@ else diff --git a/armsrc/appmain.c b/armsrc/appmain.c index b28ecdb51..64c39aff6 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -267,7 +267,7 @@ void ReadMem(int addr) { /* osimage version information is linked in, cf commonutil.h */ /* bootrom version information is pointed to from _bootphase1_version_pointer */ extern uint32_t _bootphase1_version_pointer[], _flash_start[], _flash_end[], __data_src_start__[]; -#ifdef WITH_NO_COMPRESSION +#ifndef WITH_COMPRESSION extern uint32_t _bootrom_end[], _bootrom_start[], __os_size__[]; #endif static void SendVersion(void) { @@ -311,7 +311,7 @@ static void SendVersion(void) { strncat(VersionString, "\n ", sizeof(VersionString) - strlen(VersionString) - 1); } } -#ifndef WITH_NO_COMPRESSION +#ifdef WITH_COMPRESSION // Send Chip ID and used flash memory uint32_t text_and_rodata_section_size = (uint32_t)__data_src_start__ - (uint32_t)_flash_start; uint32_t compressed_data_section_size = g_common_area.arg1; @@ -326,7 +326,7 @@ static void SendVersion(void) { struct p payload; payload.id = *(AT91C_DBGU_CIDR); -#ifdef WITH_NO_COMPRESSION +#ifndef WITH_COMPRESSION payload.section_size = (uint32_t)_bootrom_end - (uint32_t)_bootrom_start + (uint32_t)__os_size__; #else payload.section_size = text_and_rodata_section_size + compressed_data_section_size; diff --git a/armsrc/start.c b/armsrc/start.c index 8e0453467..a5e385ae7 100644 --- a/armsrc/start.c +++ b/armsrc/start.c @@ -23,7 +23,7 @@ #include "proxmark3_arm.h" #include "appmain.h" -#ifndef WITH_NO_COMPRESSION +#ifdef WITH_COMPRESSION #include "lz4.h" #endif #include "BigBuf.h" @@ -33,7 +33,7 @@ extern common_area_t g_common_area; extern uint32_t __data_src_start__[], __data_start__[], __data_end__[], __bss_start__[], __bss_end__[]; -#ifndef WITH_NO_COMPRESSION +#ifdef WITH_COMPRESSION static void uncompress_data_section(void) { int avail_in; memcpy(&avail_in, __data_src_start__, sizeof(int)); @@ -68,7 +68,7 @@ void Vector(void) { g_common_area.flags.osimage_present = 1; /* Set up data segment: Copy from flash to ram */ -#ifdef WITH_NO_COMPRESSION +#ifndef WITH_COMPRESSION uint32_t *data_src = __data_src_start__; uint32_t *data_dst = __data_start__; while (data_dst < __data_end__) *data_dst++ = *data_src++; diff --git a/common_arm/Makefile.hal b/common_arm/Makefile.hal index 6c9318fd5..f9bb9065e 100644 --- a/common_arm/Makefile.hal +++ b/common_arm/Makefile.hal @@ -228,8 +228,8 @@ endif ifneq ($(SKIP_HFPLOT),1) PLATFORM_DEFS += -DWITH_HFPLOT endif -ifeq ($(SKIP_COMPRESSION),1) - PLATFORM_DEFS += -DWITH_NO_COMPRESSION +ifneq ($(SKIP_COMPRESSION),1) + PLATFORM_DEFS += -DWITH_COMPRESSION endif # Standalone mode