реклама на сайте
подробности

 
 
> strex/b/h
IgorKossak
сообщение Mar 13 2012, 08:58
Сообщение #1


Шаман
******

Группа: Модераторы
Сообщений: 3 064
Регистрация: 30-06-04
Из: Киев, Украина
Пользователь №: 221



Может уже где то проскакивало, но поиском не нашёл.
Что касается:
Цитата(klen @ Nov 29 2011, 00:05) *
/tmp/cc7ETq9C.s:508: Error: registers may not be the same -- `strexb r0,r0,[r1]'
/tmp/cc7ETq9C.s:533: Error: registers may not be the same -- `strexh r0,r0,[r1]'

на CodeSourcery рекомендуют сделать следующее:
Цитата
Question

When compiling applications that contain or use the Cortex Microcontroller Software Interface Standard e.g. CMSIS (http://www.onarm.com/cmsis/) you may receive the following errors:
/tmp/ccaxp69S.s: Assembler messages:
/tmp/ccaxp69S.s:463: Error: registers may not be the same -- `strexb r0,r0,[r1]'
/tmp/ccaxp69S.s:488: Error: registers may not be the same -- `strexh r0,r0,[r1]'

How do I fix these "registers may not be the same" errors? Where do they come from?

Answer

Some versions of the CMSIS contain invalid inline assembly of the following form:
uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
asm volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
return(result);
}

The first constraint =r on variable result is not correct, it should be =&r to indicate that the two registers used should not be the same e.g. early-clobber (this is required by the ARM Instruction Set Architecture).

To fix the error you must locate the invalid inline assembly and change the =r to =&r for the result register variable.

Often it is difficult to determine which source file was used to generate /tmp/ccaxp69S.s, to help with that problem add -save-temps to the compiler invocation to save the intermediate output to the current directory for your review.

This entry was last updated on 8 February 2012.

Т. е. сваливают всё не на компилятор, а на неграмотную строку в инлайн ассемблере. Может это и правильно?
Проверил их свежим тулчейном - работает.
PS Проверял только на старых проектах с CMSISv1.3
Go to the top of the page
 
+Quote Post

Сообщений в этой теме


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 25th July 2025 - 22:46
Рейтинг@Mail.ru


Страница сгенерированна за 0.01349 секунд с 7
ELECTRONIX ©2004-2016