arm

impossible constraint in 'asm' error

你说的曾经没有我的故事 提交于 2020-01-06 06:53:44
问题 I'm trying to cross-compile a c++ file with arm-linux-gnueabi-g++.: make CROSS_COMPILE=arm-linux-gnueabi- all But an error occurs: arm-linux-gnueabi-g++ -O2 -c -oa32.o PMCTestA.cpp In file included from PMCTest.h:54:0, from PMCTestA.cpp:24: PMCTestLinux.h: In member function ‘void CCounters::GetProcessorVendor()’: PMCTestLinux.h:63:73: error: impossible constraint in ‘asm’ make: *** [a32.o] Error 1 And here is part of the code in PMCTestLinux.h from row 61: static void Cpuid (int Output[4],

how to single-step code on-target with no jtag, breakpoints, simulator, emulator

左心房为你撑大大i 提交于 2020-01-06 06:01:13
问题 Let's say you have a pointer to function whose source you do not have and which is "untrusted" because it might read/write to disallowed memory region. Before it executes each assembly instruction, you want to verify that it doesn't access disallowed memory regions. The OS is (almost) bare-metal i.e. a custom RTOS (so no Linux or QNX). This is for a functionality that needs to be enabled not only during development but during normal runtime. Ideally, it'd run something like this: void (*fptr)

ncurses program won't run on debian armv7

末鹿安然 提交于 2020-01-06 04:35:21
问题 Can somebody here help me with ncurses for armv7 (x86)? I just want to run on Debian my C++ program uses ncurses It has error "Error opening terminal: xterm." I used this installation guide: http://soft-dev-pro.blogspot.ru/2014/07/cross-compile-ncurses-for-arm.html If i type which in console, it shows this: which $TERM /usr/bin/xterm It seems initscr() function won't start curses mode 回答1: Your ncurses program is looking for /usr/arm-linux-gnueabihf/share/terminfo and not finding that. If you

ncurses program won't run on debian armv7

半城伤御伤魂 提交于 2020-01-06 04:35:09
问题 Can somebody here help me with ncurses for armv7 (x86)? I just want to run on Debian my C++ program uses ncurses It has error "Error opening terminal: xterm." I used this installation guide: http://soft-dev-pro.blogspot.ru/2014/07/cross-compile-ncurses-for-arm.html If i type which in console, it shows this: which $TERM /usr/bin/xterm It seems initscr() function won't start curses mode 回答1: Your ncurses program is looking for /usr/arm-linux-gnueabihf/share/terminfo and not finding that. If you

Why va_arg() produce different effects on x86_64 and arm?

人走茶凉 提交于 2020-01-06 04:34:29
问题 The codes: #include <stdio.h> #include <stdarg.h> #include <stdlib.h> typedef unsigned int uint32_t; float average(int n_values, ... ) { va_list var_arg; int count; float sum = 0; va_start(var_arg, n_values); for (count = 0; count < n_values; count += 1) { sum += va_arg(var_arg, signed long long int); } va_end(var_arg); return sum / n_values; } int main(int argc, char *argv[]) { (void)argc; (void)argv; printf("hello world!\n"); uint32_t t1 = 1; uint32_t t2 = 4; uint32_t t3 = 4; printf("result

Conditional Execution for “And” in ARM syntax

こ雲淡風輕ζ 提交于 2020-01-06 04:12:29
问题 I'm trying to get a grip on conditional execution within ARM programming. So I kind of understand a situation like this: if ( (R0 != 5) || (R2 != R3) ) ; != means not equal, || mean OR { R4-- ; // R4 = R4 - 1 } And the ARM version of this would be: CMP R0, 5 CMPEQ R2, R3 SUBNE R4, R4, 1 I was curious how ARM knows that that is an "OR" (||). So it does two compares. But what happens if both compares aren't correct. Is that what NE does? What happens if they were different (like example below).

How to cross compile a toolchain to an ARMv5 platform?

北城以北 提交于 2020-01-05 09:04:43
问题 I am not looking to setup a toolchain to cross compile on an x86 host to an ARMv5 target (I already have that and it's working), but a toolchain to compile on an ARMv5 platform to an ARMv5 target(itself). I know I can always just cross compile all my needed applications, but I want to have a compiler run on the system so I will have a good idea of how to do the same for other boards like the Rasberry Pi and Beaglebone, and because it just seems pretty cool. I have looked into crosstool-ng but

executing wrapped binary

主宰稳场 提交于 2020-01-05 08:48:16
问题 I am trying to execute a binary wrapped inside my own assembly code, there are reasons like i want to do some init and see how the binary behaves, however i am unable to execute the binary even without any such init, no output on uart, lcd (I am running an arm cortexa-8 based qsd8250b chipset powering a mdp[mobile development platform]) I know the wrapped binary runs perfectly on my board since i have used it earlier (less than a day ago). Problem is, i am unsure/info is not available

Does a pipeline stall occur on an ARM to Thumb switch?

谁都会走 提交于 2020-01-05 08:29:49
问题 In ARM architecture, if an ARM to Thumb mode switch occurs, will a pipeline stall occur? If so, how many cycles are affected? Is this same for Thumb to ARM mode switching ? Does this behavior vary with different ARM processors ? 回答1: Assuming you switch in the sensible way (with BLX / BX LR ), any modern core will predict that (assuming the branch predictor isn't turned off, of course). Writing to the PC directly is a little more variable - generally, big cores might predict it but little

GDB hardware breakpoint don't work with remote debugging

痴心易碎 提交于 2020-01-05 07:03:59
问题 I use GDBServer to do a remote debug with an ARM11 CPU. The software breakpoint works well, but we i use "hbreak test.c:5" to set a hardware breakpoint, CPU will never stop. GDB version: 7.3.1 Target CPU: ARM11 Operation: arm-linux-gdb ./main (gdb) target remote 192.168.0.1:2345 (gdb) hbreak test.c:5 => HW breakpoint, it doesn't work. but if change to "b test.c:5", it will works (gdb) c Does anybody can tell me how to enable hardware debug with GDB7.3.1? Thanks! 回答1: Hardware breakpoints can