LK ARM64 arch_init处理

arch/arm64/arch.c
arch_init
 

void arch_early_init(void) {     arm64_cpu_early_init();     platform_init_mmu_mappings(); }

void arch_init(void) { #if WITH_SMP     arch_mp_init_percpu();

    LTRACEF("midr_el1 0x%llx\n", ARM64_READ_SYSREG(midr_el1));

    secondaries_to_init = SMP_MAX_CPUS - 1; /* TODO: get count from somewhere else, or add cpus as they boot */

    lk_init_secondary_cpus(secondaries_to_init);

    LTRACEF("releasing %d secondary cpus\n", secondaries_to_init);

    /* release the secondary cpus */     spin_unlock(&arm_boot_cpu_lock);

    /* flush the release of the lock, since the secondary cpus are running without cache on */     arch_clean_cache_range((addr_t)&arm_boot_cpu_lock, sizeof(arm_boot_cpu_lock)); #endif }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
STM32F103C8T6是一款基于ARM Cortex-M3架构的微控制器,如果你想要配置Makefile以支持ARMv7E-M (Cortex-M4)体系结构,你需要在Makefile中设置一些特定的变量和选项。以下是配置示例: 1. 首先,在Makefile顶部,添加对`ARM_TOOLCHAIN_PATH`的指定,这个路径通常包含ARM编译工具链,例如gcc-arm-none-eabi: ```makefile ARM_TOOLCHAIN_PATH = /path/to/arm-none-eabi-gcc ``` 2. 然后,你可以设置`ARCH`和`CPU`变量,告诉Makefile你正在使用的处理器架构: ```makefile ARCH := arm7em CPU := cortex-m4 ``` 3. 使用`$(MAKECMDGOALS)`判断是否需要编译Cortex-M4相关的代码,因为默认情况下可能会针对所有目标,包括其他内核版本: ```makefile ifneq ($(findstring $(MAKECMDGOAL),clean),) ifeq ($(findstring cortex-m4,$(CPU)),cortex-m4) export STM32_F4XX_BASE := $(shell $(ARM_TOOLCHAIN_PATH)/bin/arm-none-eabi-gcc -dumpmachine | sed 's/-.*//') endif endif ``` 4. 接下来,在编译规则部分,使用这些变量选择正确的库和编译选项: ```makefile CFLAGS += -mcpu=$(CPU) -mthumb -march=$(ARCH) -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections LDFLAGS += -mcpu=$(CPU) -mthumb -march=$(ARCH) -Wl,--gc-sections ``` 5. 如果你在使用Keil MDK等IDE,那么可能还需要相应的宏定义和项目设置。 记得替换`/path/to/arm-none-eabi-gcc`为你实际的ARM工具链路径。完成上述设置后,你应该能针对STM32F103C8T6的Cortex-M4内核编译程序了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值