标签: arm

ARM AArch64 堆栈管理

ARMv8 没有 64 位堆栈的能力吗?我知道 AArch64 上没有推送和弹出指令,因此堆栈管理是否留给 AArch32 进行参数传递等?我们如何传递 48 位地址?我对在 AArch64 中运行时函数调用的工作方式感到困惑。

64-bit assembly arm calling-convention arm64

1
推荐指数
1
解决办法
3189
查看次数

在 Neon 中,两个 uint8 值之间是否存在饱和减法到 int8 中

我必须在两个 unint8 向量之间做减法,然后饱和到 int8 向量。例如

uint8 a=8;
uint8 b=248;

subtract: a-b=-240
saturate cast: -240 -> -128 
make sure the value is in [-128, 127]
Run Code Online (Sandbox Code Playgroud)

我想在C API手臂霓虹灯

arm neon

1
推荐指数
1
解决办法
800
查看次数

汇编语言中Rd、Rn、Rm、Ra的全称是什么?

我们经常使用这些术语。但他们为什么如此命名尚不清楚。

assembly arm

1
推荐指数
1
解决办法
4363
查看次数

Arm Assembly 在子程序中推送 POP 链接寄存器和 pc 并在子程序中调用子程序的正确方法

用于 ARM 组装

我一直在我的子程序中执行以下操作:

SubRoutine:
  PUSH {r1,r2,lr}
  //code that changes r1 and r2
  POP {r1,r2,lr}
  bx lr
Run Code Online (Sandbox Code Playgroud)

这是从子程序返回并继续执行主函数中代码的正确方法吗?我看到周围的人正在做以下事情:

SubRoutine:
  PUSH {r1,r2,lr}
  //code that changes r1 and r2
  POP {r1,r2,pc}
  bx lr
Run Code Online (Sandbox Code Playgroud)

但我不知道为什么你在推 LR 时会 POP 电脑。哪个是正确的方法,为什么?

此外,如果您在子例程中调用子例程,请执行以下操作:

SubRoutine:
   PUSH {r1,r2,lr}

  //code that changes r1 and r2
  PUSH {lr}
  bl AnotherRoutine (where bx lr will be used to return from it)
  POP {lr}

  POP {r1,r2,pc}
  bx lr
Run Code Online (Sandbox Code Playgroud)

或者你是这样做的:

SubRoutine:
   PUSH {r1,r2,lr}

  //code that changes r1 and r2
  PUSH {lr}
  bl AnotherRoutine(where …
Run Code Online (Sandbox Code Playgroud)

assembly stack arm subroutine

1
推荐指数
1
解决办法
4142
查看次数

ARM 汇编 - v1 和 a1 寄存器有什么区别?

我目前正在使用名为 armulator 的手臂模拟器。在查看一些小程序时,我看到正在使用寄存器 v1 和 a1。两者有什么区别?

assembly arm cpu-registers

1
推荐指数
1
解决办法
847
查看次数

STM32F0:EXTI1/EXTI2 上的中断未触发,而 EXTI4 正在工作。*使困惑*

你能在这里帮我一下,告诉我我做错了什么吗?EXTI1 和 EXTI2 不会触发,而 EXTI4 则正常工作。这不是硬件。如果我切换引脚,新的 EXTI4 按钮将继续触发,而我切换它的按钮不再触发。

我已经彻底检查了所有段,但我无法弄清楚为什么 EXTI0_1_IRQHandler 没有触发,而 EXTI4_15_IRQHandler 没有触发。请参阅下面我用于库的两个文件。我在 OpenSTM32 IDE 中使用 SPL。“main.c”只调用

ENCODER_STM32_configureInterface();
Run Code Online (Sandbox Code Playgroud)

所以真的没有其他事情发生。

// ENCODER_STM32 library: This library shall enable interfacing an encoder on an STM32F0 chip.

// GPIO Definitions
#define    ENCODER_GPIO_PORT       GPIOA
#define    ENCODER_GPIO_CLK_PIN    GPIO_Pin_1
#define    ENCODER_GPIO_DT_PIN     GPIO_Pin_2
#define    ENCODER_GPIO_SW_PIN     GPIO_Pin_4
#define    ENCODER_GPIO_PERIPH     RCC_AHBPeriph_GPIOA

// EXTI Definitions
#define    ENCODER_EXTI_PORTSRC    EXTI_PortSourceGPIOA
#define    ENCODER_EXTI_CLK_PINSRC EXTI_PinSource1
#define    ENCODER_EXTI_CLK_LINE   EXTI_Line1
#define    ENCODER_EXTI_DT_PINSRC  EXTI_PinSource2
#define    ENCODER_EXTI_DT_LINE    EXTI_Line2
#define    ENCODER_EXTI_SW_PINSRC  EXTI_PinSource4
#define    ENCODER_EXTI_SW_LINE    EXTI_Line4
#define    ENCODER_EXTI_PERIPH     RCC_APB2Periph_SYSCFG
#define    ENCODER_EXTI_MODE …
Run Code Online (Sandbox Code Playgroud)

arm interrupt stm32 stm32f0

1
推荐指数
1
解决办法
1798
查看次数

如何在 ARM 子例程中访问堆栈上的值?

所以我想从命令行读取 10 个整数,然后通过子程序打印这些值的总和。

我有以下相关代码:

...

sub sp, sp, #40 // making room on the stack
mov r4, sp      // use r4 as our working register for where we are in our space
   loop:
      (looping through this 10 times)
      ldr r0, =rdfmt
      mov r1, r4
      bl scanf
      add r4, r4 #4
   done:
      bl sum
sum:
   push {lr}
   (how do I load those back in from the stack?)

...
Run Code Online (Sandbox Code Playgroud)

在我的 sum 子例程中,我想在堆栈中迭代 10 次并获得我刚刚读入的值的总和。你是怎么做到的?

assembly arm

1
推荐指数
1
解决办法
385
查看次数

树莓派上 kubernetes 上的 gitlab-runner - 找不到容器“助手”

我正在尝试在树莓派上的 kubernetes 集群上运行 gitlab-runner。

gitlab 管道生成以下输出:

Running with gitlab-runner 10.4.0 (857480b6) on hello-world-gitlab-runner-6548-tq4mr (123)
Using Kubernetes namespace: gitlab
Using Kubernetes executor with image arm32v7/node ...
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
Waiting for pod gitlab/runner-123-project-456-concurrent-789 to be running, status is Pending
ERROR: Job failed (system failure): unable to upgrade connection: container not found ("helper")
Run Code Online (Sandbox Code Playgroud)

gitlab-runner pod 记录以下输出:

+ cp /scripts/config.toml /etc/gitlab-runner/
+ /entrypoint register --non-interactive --executor …
Run Code Online (Sandbox Code Playgroud)

arm raspberry-pi gitlab kubernetes gitlab-ci-runner

1
推荐指数
1
解决办法
1236
查看次数

减少 arm 中的指令数

我有这个程序,我正在为学校工作,其目的是将两个矩阵相加并将它们的结果存储在第三个矩阵中。目前,与驱动程序一起运行时的指令数为1,003,034,420条(即.o文件),但需要在10亿条以下。但是,我不知道该怎么做,因为我已经考虑了我使用的所有说明,并且所有这些说明似乎都是让程序正常工作的强制性要求。

请注意,此时我无法减少循环展开的指令数量,因为稍后会出现。

这是程序:

/* This function has 5 parameters, and the declaration in the
   C-language would look like:

   void matadd (int **C, int **A, int **B, int height, int width)

   C, A, B, and height will be passed in r0-r3, respectively, and
   width will be passed on the stack. */

.arch armv7-a
.text
.align  2
.global matadd
.syntax unified
.arm
matadd:
   push  {r4, r5, r6, r7, r8, r9, r10, r11, lr}
   ldr   r4, [sp, #36]                 @ load width into r4 …
Run Code Online (Sandbox Code Playgroud)

arm

1
推荐指数
1
解决办法
202
查看次数

Docker 容器中 Alpine Linux (arm32v6) 上的 PostgreSQL 9.6.9 - 如何安装正确的 postgresql-contrib 包?

我需要在 32 位 ARM 系统(它的 QNAP NAS,CPU:Annapurna Labs Alpine AL-314)上的 Docker 容器中安装支持 uuid-ossp 的 PostgreSQL 9.6.9。

我找到了arm32v6/postgres图像并安装了arm32v6/postgres:9.6.9-alpine. 这工作顺利,但缺少 postgresql-contrib 包。据我了解,我需要安装 postgresql-contrib 才能获得 uuid-ossp 支持。

我在容器中打开了一个 CLI 并尝试:

# apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/armhf/APKINDEX.tar.gz
v3.7.0-215-g16971064c0 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-207-gac61833f9b [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 8879 distinct packages available
# apk add postgresql-contrib=9.6.9-r0
ERROR: unsatisfiable constraints:
  postgresql-contrib-10.4-r0:
    breaks: world[postgresql-contrib=9.6.9-r0]
Run Code Online (Sandbox Code Playgroud)

如何安装正确版本的 postgresql-contrib?或者我可以在 PostgreSQL 9.6.9 中使用 postgresql-contrib-10.4-r0 吗?

postgresql arm docker alpine-linux postgresql-9.6

1
推荐指数
1
解决办法
1万
查看次数